简体   繁体   English

斯坦福CORENLP Master崩溃(NullPointerException)

[英]Stanford CORENLP Master Keep Crashing (NullPointerException)

I downloaded the latest version of Stanford CoreNLP with the larger english model from this link 我从此链接下载了具有较大英语模型的最新版本的Stanford CoreNLP

Placing the model downloaded in the same project folder, i am using "ant" / "ant jar" to build the project. 将下载的模型放在相同的项目文件夹中,我正在使用“ ant” /“ ant jar”来构建项目。

I then load the server using this command on windows: 然后,我在Windows上使用以下命令加载服务器:

java -d64 -mx20g -classpath "*;lib\*;liblocal\*;libsrc\*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -timeout 500000

Loading the result page from http://localhost:9000 , the server crashes when using filters such as relations, coreference. http:// localhost:9000加载结果页面,使用诸如关系,共指之类的过滤器时,服务器崩溃。

I get the error: 我得到错误:

java.util.concurrent.ExecutionException: java.lang.NullPointerException

The log from server: 来自服务器的日志:

Some annotation fail such as: 某些注释失败,例如:

[pool-1-thread-1] INFO edu.stanford.nlp.pipeline.MentionAnnotator - Error with building coref mention annotator!

And the main problem / exception: 以及主要问题/异常:

 java.util.concurrent.ExecutionException: java.lang.NullPointerException
        at java.util.concurrent.FutureTask.report(Unknown Source)
        at java.util.concurrent.FutureTask.get(Unknown Source)
        at edu.stanford.nlp.pipeline.StanfordCoreNLPServer$CoreNLPHandler.handle(StanfordCoreNLPServer.java:497)
        at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
        at sun.net.httpserver.AuthFilter.doFilter(Unknown Source)
        at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
        at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(Unknown Source)
        at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
        at sun.net.httpserver.ServerImpl$Exchange.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
        at edu.stanford.nlp.pipeline.MentionAnnotator.annotate(MentionAnnotator.java:100)
        at edu.stanford.nlp.pipeline.AnnotationPipeline.annotate(AnnotationPipeline.java:75)
        at edu.stanford.nlp.pipeline.StanfordCoreNLP.annotate(StanfordCoreNLP.java:606)
        at edu.stanford.nlp.pipeline.StanfordCoreNLPServer$CoreNLPHandler.lambda$handle$344(StanfordCoreNLPServer.java:479)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        ... 3 more

Any help on what could be causing this would be much appreciated. 对此造成的任何帮助将不胜感激。

Thanks 谢谢

What are you feeding to the library? 你在图书馆喂什么? I used to run coreNLP library in IntelliJ and Netbeans and I had an issue where if I fed a blank space (either one or more spaces, a tab or an empty blank line) I would get a null pointer exception. 我曾经在IntelliJ和Netbeans中运行coreNLP库,但遇到一个问题,如果我输入一个空格(一个或多个空格,一个制表符或一个空的空白行),我将得到一个空指针异常。 I had to check every sentence so they wouldn't be blank when feeding it to the coreNLP library. 我必须检查每个句子,以便在将其提供给coreNLP库时不会空白。 (I was storing each sentence as a String in a Array, so if I stored a blank string in the array and passed it to the CoreNLP library it would crash). (我将每个句子作为字符串存储在数组中,因此,如果将空白字符串存储在数组中并将其传递给CoreNLP库,则会崩溃)。 I don't know if its your case but hope this helps. 我不知道您的情况,但希望能对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM