Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Stanford nlp 斯坦福CoreNLP统计Coref系统NullPointerException_Stanford Nlp - Fatal编程技术网

Stanford nlp 斯坦福CoreNLP统计Coref系统NullPointerException

Stanford nlp 斯坦福CoreNLP统计Coref系统NullPointerException,stanford-nlp,Stanford Nlp,我正在尝试使用以下命令应用统计共指系统来处理文本文件 java -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLP -annotators tokenize,cleanxml,ssplit,pos,lemma,ner,parse,coref -file input.txt 这将抛出以下错误消息: [main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator tok

我正在尝试使用以下命令应用统计共指系统来处理文本文件

java -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLP -annotators tokenize,cleanxml,ssplit,pos,lemma,ner,parse,coref -file input.txt
这将抛出以下错误消息:

[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator tokenize
[main] INFO edu.stanford.nlp.pipeline.TokenizerAnnotator - TokenizerAnnotator: No tokenizer type provided. Defaulting to PTBTokenizer.
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator cleanxml
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator ssplit
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator pos
Reading POS tagger model from edu/stanford/nlp/models/pos-tagger/english-left3words/english-left3words-distsim.tagger ... done [0.9 sec].
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator lemma
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator ner
Loading classifier from edu/stanford/nlp/models/ner/english.all.3class.distsim.crf.ser.gz ... done [1.8 sec].
Loading classifier from edu/stanford/nlp/models/ner/english.muc.7class.distsim.crf.ser.gz ... done [0.8 sec].
Loading classifier from edu/stanford/nlp/models/ner/english.conll.4class.distsim.crf.ser.gz ... done [1.0 sec].
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator parse
[main] INFO edu.stanford.nlp.parser.common.ParserGrammar - Loading parser from serialized file edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz ...
done [0.4 sec].
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator coref

Processing file /home/xilin/Toolkits/stanford-corenlp-full-2015-12-09/input.txt ... writing to /home/xilin/Toolkits/stanford-corenlp-full-2015-12-09/input.txt.out
Annotating file /home/xilin/Toolkits/stanford-corenlp-full-2015-12-09/input.txt
Exception in thread "main" java.lang.RuntimeException: Error annotating document with coref
at edu.stanford.nlp.scoref.StatisticalCorefSystem.annotate(StatisticalCorefSystem.java:86)
at edu.stanford.nlp.scoref.StatisticalCorefSystem.annotate(StatisticalCorefSystem.java:63)
at edu.stanford.nlp.pipeline.CorefAnnotator.annotate(CorefAnnotator.java:97)
at edu.stanford.nlp.pipeline.AnnotationPipeline.annotate(AnnotationPipeline.java:72)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.annotate(StanfordCoreNLP.java:534)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.annotate(StanfordCoreNLP.java:544)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.processFiles(StanfordCoreNLP.java:1098)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.processFiles(StanfordCoreNLP.java:877)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.run(StanfordCoreNLP.java:1187)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.main(StanfordCoreNLP.java:1257)
Caused by: java.lang.NullPointerException
at edu.stanford.nlp.hcoref.Preprocessor.assignMentionIDs(Preprocessor.java:170)
at edu.stanford.nlp.hcoref.Preprocessor.initializeMentions(Preprocessor.java:153)
at edu.stanford.nlp.hcoref.Preprocessor.preprocess(Preprocessor.java:64)
at edu.stanford.nlp.hcoref.CorefDocMaker.makeDocument(CorefDocMaker.java:194)
at edu.stanford.nlp.hcoref.CorefDocMaker.makeDocument(CorefDocMaker.java:154)
at edu.stanford.nlp.scoref.StatisticalCorefSystem.annotate(StatisticalCorefSystem.java:68)
... 9 more

如果我将上述命令中的选项“coref”更改为“dcoref”,那么确定性的coreference系统将平稳运行。其他人指出,这是3.6.0发行版中的一个版本。我正在使用,并且正在获取最新版本。但是,该错误似乎仍然存在。

您需要在
coref
之前包含
提及
注释器。不过,这显示为空指针异常的事实确实是一个bug。您正在使用哪个Git版本?我们最近改变了处理需求的方式,这可能是一个遗留错误。

您需要在
coref
之前包含
注释器。不过,这显示为空指针异常的事实确实是一个bug。您正在使用哪个Git版本?我们最近改变了处理需求的方式,这可能是一个遗留的bug。

的确如此。特别是,这是当前后v3.6.0当前代码中的一个问题。如果您使用v3.6.0 jar运行此命令,您将正确地获得:
线程“main”java.lang.IllegalArgumentException中的异常:注释器“coref”需要注释器“title”
。如果在coref之前添加提及注释器,程序将能够运行。我昨天把罐子拉出来重新编译了。因此,我认为这是回购协议中隐藏的错误。错误已经修复!的确特别是,这是当前后v3.6.0当前代码中的一个问题。如果您使用v3.6.0 jar运行此命令,您将正确地获得:
线程“main”java.lang.IllegalArgumentException中的异常:注释器“coref”需要注释器“title”
。如果在coref之前添加提及注释器,程序将能够运行。我昨天把罐子拉出来重新编译了。因此,我认为这是回购协议中隐藏的错误。错误已经修复!