0

我刚刚下载并使用以下命令运行 Standfor NLP 3.6.0 http://stanfordnlp.github.io/CoreNLP/index.html :

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

我测试了其他注释器,如 POS、Tokenizer,它们工作得很好。但是,当我尝试运行情感注释器 [ 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]不知道我错过了什么?

4

2 回答 2

0

对于遇到同样问题的人,请从github而不是从他们的网站下载项目。确保您有模型jar、英文和 ejml 模型。

那应该这样做。

于 2016-08-12T20:21:51.417 回答
0

sentiment尝试运行注释器时,3.6.0 对我也不起作用。然而,3.7.0 开箱即用。在这里下载。然后java -mx4g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 9000 -timeout 15000按照http://stanfordnlp.github.io/CoreNLP/corenlp-server.html中的说明运行它。例如用 curl 运行它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}'

于 2017-02-14T15:57:56.567 回答