【发布时间】:2016-09-12 12:38:05
【问题描述】:
我想使用来自http://nlp.stanford.edu/software/openie.html 的示例代码,但行
System.out.println(sentence.get(SemanticGraphCoreAnnotations.EnhancedDependenciesAnnotation.class).toString(SemanticGraph.OutputFormat.LIST));
给出错误
SemanticGraphCoreAnnotations.EnhancedDependenciesAnnotation 不能 解析为一个类型
即使我导入了 edu.stanford.nlp.semgraph.SemanticGraphCoreAnnotations。 Eclipse 建议进行以下快速修复:
更改为“AlternativeDependenciesAnnotation” (edu.stanford.nlp.semgraph.SemanticGraphCoreAnnotations;)
更改为“BasicDependenciesAnnotation” (edu.stanford.nlp.semgraph.SemanticGraphCoreAnnotations;)
应用第一个修复会导致 java.lang.NullPointerException,而第二个修复会给出以下结果,但第一句话的结果并不令人满意:
从加载子句搜索器 edu/stanford/nlp/models/naturalli/clauseSearcherModel.ser.gz...1.0 奥巴马 在夏威夷熊
导入edu.stanford.nlp.semgraph.SemanticGraphCoreAnnotations.EnhancedDependenciesAnnotation;无法解决和import import edu.stanford.nlp.semgraph.SemanticGraphCoreAnnotations;也无济于事。
我导入了 JAR
- 乔达时间
- stanford-corenlp-3.6.0
- stanford-corenlp-3.6.0-models
- ejml-0.23
- 欢乐日
- xom
- slf4j
- slf4j-简单
我使用 CoreNLP 3.6.0。 .我检查了 edu.stanford.nlp.semgraph 中的 SemanticGraphCoreAnnotations.java ,它包含 EnhancedDependenciesAnnotation.class 。我该如何解决这个问题?
【问题讨论】:
标签: stanford-nlp