如何获得与CoreNlp.run相同的结果?

时间:2017-06-20 04:38:32

标签: java stanford-nlp

我使用CoreNlp来获取解析树,maven依赖关系如下所示:

<dependency>
    <groupId>edu.stanford.nlp</groupId>
    <artifactId>stanford-corenlp</artifactId>
<version>3.8.0</version>
</dependency>

<dependency>
    <groupId>edu.stanford.nlp</groupId>
    <artifactId>stanford-corenlp</artifactId>
    <version>3.8.0</version>
    <classifier>models</classifier>
</dependency>

结果与CoreNlp.run不同(处理相同的句子),我想获得与CoreNlp.run相同的结果,我该怎么办?谢谢!

1 个答案:

答案 0 :(得分:0)

可能,这是在本地使用不同的解析器模型。 corenlp.run使用shift-reduce选区解析器来提高效率,而CoreNLP分布中的默认解析器是PCFG。这里的权衡是在更快和更准确的模型(换档减少)与更快的加载时间和更小的模型磁盘大小(PCFG)之间。有关详细信息:https://nlp.stanford.edu/software/srparser.shtml(请注意,您需要包含其他模型jar)