【发布时间】:2017-08-29 06:41:34
【问题描述】:
我正在为我的一个项目使用 coreNLP 的依赖项解析。基本依赖和增强依赖是特定依赖的不同结果。 我使用以下代码来获得增强的依赖关系。
val lp = LexicalizedParser.loadModel("edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz")
lp.setOptionFlags("-maxLength", "80")
val rawWords = edu.stanford.nlp.ling.Sentence.toCoreLabelList(tokens_arr:_*)
val parse = lp.apply(rawWords)
val tlp = new PennTreebankLanguagePack()
val gsf:GrammaticalStructureFactory = tlp.grammaticalStructureFactory()
val gs:GrammaticalStructure = gsf.newGrammaticalStructure(parse)
val tdl = gs.typedDependenciesCCprocessed()
对于以下示例,
Account name of ramkumar.
我使用简单的 API 来获取基本依赖项。我之间的依赖关系 (帐户,名称)是(复合)。但是当我使用上面的代码来获得增强的依赖关系时,我得到(帐户,名称)之间的关系为(dobj)。
对此有什么解决办法?这是一个错误还是我做错了什么?
【问题讨论】:
标签: parsing nlp stanford-nlp dependency-parsing