【发布时间】:2018-03-12 20:19:54
【问题描述】:
我正在使用斯坦福 CoreNLP 管道,并从 SentencesAnnotation 获得 TreeAnnotation 和 BasicDependenciesAnnotation。
我正在寻找一种方法来判断解析器对 POS 标签和依赖结构的确定程度。
我记得早些时候在修改斯坦福 NLP 库时,我在某处看到多个具有不同排名的树为同一个句子返回。 我找不到有关如何从解析器或管道中获取此信息的任何信息。
据我所知,DependencyScoring 类似乎在 TypedDependency 上运行,而不是管道作为注释过程的一部分产生的东西。
编辑:代码详情:
Annotation document = new Annotation("This is my sentence");
pipeline.annotate(document);
List<CoreMap> sentences = document.get(SentencesAnnotation.class);
...
Tree tree = sentence1.get(TreeAnnotation.class);
SemanticGraph dependencies = sentence1.get(CollapsedCCProcessedDependenciesAnnotation.class);
【问题讨论】:
-
你是如何产生依赖解析的?你是从
parse注释器那里得到它们的吗?如果是这种情况,依赖关系实际上是由确定性转换产生的——您唯一的概率度量将来自转换开始的 PCFG 解析。如果确实如此,我可以提供更多细节。 -
基本上我做“注释文档 = new Annotation("This is my sentence"); pipeline.annotate(document); List
sentence = document.get(SentencesAnnotation.class);"然后得到 TreeAnnotation 和 Dependency Graph。是的,请详细说明 PCFG 方法。 -
@JonGauthier 另外,是否有可能在依赖关系中看到单词对的可能性/概率?例如。遇到“MD”->“JJ”或“will”->“able”关系的概率有多大?如果您愿意,我可以将其作为单独的问题发布。
标签: nlp stanford-nlp