Stanford Dependency-Parser 分享

今天对Stanford Dependency Parser全面进行了调试。经过参看FAQ,得到Dep分析代码如下
  TreebankLanguagePack tlp = new ChineseTreebankLanguagePack();
  GrammaticalStructureFactory gsf = tlp.grammaticalStructureFactory();
  GrammaticalStructure gs = gsf.newGrammaticalStructure(tree);
  System.out.println(StringUtils.join(gs.typedDependenciesCollapsed(true), "/n"));

模型文件表

          
PCFGFactored
Xinhua (mainland, newswire)xinhuaPCFG.ser.gz xinhuaFactored.ser.gz xinhuaFactoredSegmenting.ser.gz
Mixed ChinesechinesePCFG.ser.gz chineseFactored.ser.gz


1、PCFG具有最快的分析速度,Factored对中文分析性能有较大的提高(推荐使用)
2、Xinhua Grammars主要使用大陆简体新闻语料, Mixed包含了台湾、香港等繁体语料。
3、前4个分析器(Factored 2个 + PCFG 2个)均需要已分词,最后的一个不需要
4、绝大多数的Dependency Relations编码在ChineseGrammaticalRelations 类中(可进一步参考)

Can you explain the different parsers? How can the PCFG parser produce typed dependency parses? Why if I use the getBestDependencyParse() method do I get null or an untyped dependency parse?
   此问题主要针对英文与中文;首先解释一下
   xxx PCFG.ser.gz
     内容 :unlexicalized PCFG grammar + 1 parser.(ACL 2003 Accurate Unlexicalized Parsing paper)
     过程 :基于CFG树的模式匹配 -> Typed Dependencies为后处理 (Marie-Catherine de Marneffe paper)
     注意 :分析器产生Dependencies Relations是基于Phrase Structure (CFG) Parse,而非Dependency Parse。对于一个PCFG Parser接口,调用 getBestDependencyParse()将得到一个NULL,因为没有进行Dependency分析,但仍可以使用单独的GrammaticalStructure从PCFG结果获取Typed Dependencies表达。
   xxx Factored.ser.gz
     内容 :2 Grammars + 3 parsers.
     过程 :简单的PCFG分析器 -> Untyped Dependency分析器 -> 一个分析器综合考虑两个分析器的得分,获取一个最佳分析结果。(NIPS Fast Exact Inference paper)
     注意 :Dependencies Relations通过由此分析产生的Phrase Structure Parse得到. 对于一个Factored Parser接口, 调用getBestDependencyParse()将得到最佳的Untyped Dependency Parse结果.

   对英文而言,上述两个模型尽管分析方法与语法不同,平均分析性能是近似的。绝大多数应用使用PCFG以满足速度要求,而Factored采用了词汇化方 法,因而具有更强的分析准确度。到目前为至,Stanford没有从LexicalParser分离出Dependency Parser,但将来应该会实现这一功能。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值