2016-08-02 52 views
0

我只是下载并使用下面的命令运行Standfor NLP 3.6.0 http://stanfordnlp.github.io/CoreNLP/index.html斯坦福NLP服务器::未知注释:情绪

java -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer --public --port 1062 

我测试的其他注释像POS,标记者和他们的工作只是OK 。然而,当我尝试运行的情绪注释[http://nlp.stanford.edu/sentiment/]我收到以下错误:

java.lang.IllegalArgumentException: Unknown annotator: sentiment 
    at edu.stanford.nlp.pipeline.StanfordCoreNLP.ensurePrerequisiteAnnotators(StanfordCoreNLP.java:281) 
    at edu.stanford.nlp.pipeline.StanfordCoreNLPServer$CoreNLPHandler.getProperties(StanfordCoreNLPServer.java:476) 
    at edu.stanford.nlp.pipeline.StanfordCoreNLPServer$CoreNLPHandler.handle(StanfordCoreNLPServer.java:350) 
    at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79) 
    at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83) 
    at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:82) 
    at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:675) 
    at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79) 
    at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:647) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
    at java.lang.Thread.run(Thread.java:745) 

我上传我从下载页面得到了所有文件[http://stanfordnlp.github.io/CoreNLP/index.html#download]不知道我缺少什么?

回答

0

对于遇到同样问题的人,请从github下载项目,而不是从他们的网站上下载。确保你有models罐子,English和ejml模型。

这应该做到这一点。

0

3.6.0在尝试运行sentiment注释器时对我无效。 3.7.0然而开箱即用。下载它here。然后运行java -mx4g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 9000 -timeout 15000,如http://stanfordnlp.github.io/CoreNLP/corenlp-server.html所述。例如用卷曲运行它curl --data 'The quick brown fox jumped over the lazy dog.' 'http://localhost:9000/?properties={%22annotators%22%3A%22tokenize%2Cssplit%2Cparse%2Csentiment%22%2C%22outputFormat%22%3A%22json%22}'