Stanford nlp 使用stanford nlp API进行情感分析时出现java.lang.NullPointerException

Stanford nlp 使用stanford nlp API进行情感分析时出现java.lang.NullPointerException,stanford-nlp,Stanford Nlp,我是斯坦福nlp API的新手。我试图用斯坦福API进行情感分析,但它抛出了一个例外。请参阅下面的日志 Adding annotator tokenize Adding annotator ssplit Adding annotator pos Reading POS tagger model from edu/stanford/nlp/models/pos-tagger/english-left3words/english-left3words-distsim.tagger ... done

我是斯坦福nlp API的新手。我试图用斯坦福API进行情感分析,但它抛出了一个例外。请参阅下面的日志

Adding annotator tokenize
Adding annotator ssplit
Adding annotator pos
Reading POS tagger model from edu/stanford/nlp/models/pos-tagger/english-left3words/english-left3words-distsim.tagger ... done [1.4 sec].
Adding annotator lemma
Adding annotator ner
Loading classifier from edu/stanford/nlp/models/ner/english.all.3class.distsim.crf.ser.gz ... done [5.3 sec].
Loading classifier from edu/stanford/nlp/models/ner/english.muc.7class.distsim.crf.ser.gz ... done [2.3 sec].
Loading classifier from edu/stanford/nlp/models/ner/english.conll.4class.distsim.crf.ser.gz ... done [4.7 sec].
Adding annotator parse
Loading parser from serialized file edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz ... done [1.1 sec].
Adding annotator dcoref
Adding annotator sentiment
Exception in thread "main" java.lang.NoClassDefFoundError: org/ejml/simple/SimpleBase
    at edu.stanford.nlp.pipeline.SentimentAnnotator.<init>    (SentimentAnnotator.java:48)
    at  edu.stanford.nlp.pipeline.StanfordCoreNLP$14.create(StanfordCoreNLP.java:850)
    at edu.stanford.nlp.pipeline.AnnotatorPool.get(AnnotatorPool.java:81)
    at edu.stanford.nlp.pipeline.StanfordCoreNLP.construct(StanfordCoreNLP.java:262)
    at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:129)
    at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:125)
    at io.stanford.NLP.findSentiment(NLP.java:30)
    at io.stanford.TestStanford.main(TestStanford.java:8)
Caused by: java.lang.ClassNotFoundException: org.ejml.simple.SimpleBase
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    ... 8 more
添加注释器标记化
添加注释器ssplit
添加注释器位置
阅读来自edu/stanford/nlp/models/POS-tagger/english-left3words/english-left3words-distsim.tagger的POS-tagger模型。。。完成[1.4秒]。
添加注释引理
添加注释器
正在从edu/stanford/nlp/models/ner/english.all.3class.distsim.crf.ser.gz加载分类器。。。完成[5.3秒]。
从edu/stanford/nlp/models/ner/english.muc.7class.distsim.crf.ser.gz加载分类器。。。完成[2.3秒]。
从edu/stanford/nlp/models/ner/english.conll.4class.distsim.crf.ser.gz加载分类器。。。完成[4.7秒]。
添加注释器解析
正在从序列化文件edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz加载解析器。。。完成[1.1秒]。
添加注释器dcoref
添加注释者情绪
线程“main”java.lang.NoClassDefFoundError中出现异常:org/ejml/simple/SimpleBase
在edu.stanford.nlp.pipeline.annotator。(mountainAnnotator.java:48)
位于edu.stanford.nlp.pipeline.StanfordCoreNLP$14.create(StanfordCoreNLP.java:850)
位于edu.stanford.nlp.pipeline.AnnotatorPool.get(AnnotatorPool.java:81)
位于edu.stanford.nlp.pipeline.StanfordCoreNLP.construct(StanfordCoreNLP.java:262)
位于edu.stanford.nlp.pipeline.StanfordCoreNLP.(StanfordCoreNLP.java:129)
位于edu.stanford.nlp.pipeline.StanfordCoreNLP.(StanfordCoreNLP.java:125)
在io.stanford.NLP.findsention(NLP.java:30)
位于io.stanford.TestStanford.main(TestStanford.java:8)
原因:java.lang.ClassNotFoundException:org.ejml.simple.SimpleBase
位于java.net.URLClassLoader$1.run(URLClassLoader.java:202)
位于java.security.AccessController.doPrivileged(本机方法)
位于java.net.URLClassLoader.findClass(URLClassLoader.java:190)
位于java.lang.ClassLoader.loadClass(ClassLoader.java:306)
位于sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
位于java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 8个以上

产生此输出的代码是什么?我强烈怀疑您没有将“情感”注释器包括在注释器列表中,无论是在运行代码所用的属性文件中,还是在传递到注释管道中的属性对象中。如果不运行情绪注释器,文档将不会附加情绪注释,因此在尝试检索它们时,将使用空指针。

生成此输出的代码是什么?我强烈怀疑您没有将“情感”注释器包括在注释器列表中,无论是在运行代码所用的属性文件中,还是在传递到注释管道中的属性对象中。如果不运行情绪注释器,文档将不会附加情绪注释,因此在尝试检索它们时,将使用空指针。

生成此输出的代码是什么?我强烈怀疑您没有将“情感”注释器包括在注释器列表中,无论是在运行代码所用的属性文件中,还是在传递到注释管道中的属性对象中。如果不运行情绪注释器,文档将不会附加情绪注释,因此在尝试检索它们时,将使用空指针。

生成此输出的代码是什么?我强烈怀疑您没有将“情感”注释器包括在注释器列表中,无论是在运行代码所用的属性文件中,还是在传递到注释管道中的属性对象中。如果不运行情绪注释器,文档将不会附加情绪注释,因此在尝试检索它们时将使用空指针。

对于Stanford CoreNLP 3.5.2发行版,应该有一个名为ejml-0.23.jar的.jar文件,其中包含缺少的类;请确保将这个jar放在类路径中,事实上,您可能希望StanfordCorenlp3.5.2附带的所有jar都放在类路径中

对于Stanford CoreNLP 3.5.2发行版,应该有一个名为ejml-0.23.jar的.jar文件,其中包含缺少的类;请确保将这个jar放在类路径中,事实上,您可能希望StanfordCorenlp3.5.2附带的所有jar都放在类路径中

对于Stanford CoreNLP 3.5.2发行版,应该有一个名为ejml-0.23.jar的.jar文件,其中包含缺少的类;请确保将这个jar放在类路径中,事实上,您可能希望StanfordCorenlp3.5.2附带的所有jar都放在类路径中

对于Stanford CoreNLP 3.5.2发行版,应该有一个名为ejml-0.23.jar的.jar文件,其中包含缺少的类;请确保将这个jar放在类路径中,事实上,您可能希望StanfordCorenlp3.5.2附带的所有jar都放在类路径中

谢谢加博。“情绪”注释器不见了。我添加了这个,但现在我有另一个例外。请看编辑后的问题。谢谢你,我是汉克斯·加博。“情绪”注释器不见了。我添加了这个,但现在我有另一个例外。请看编辑后的问题。谢谢你,我是汉克斯·加博。“情绪”注释器不见了。我添加了这个,但现在我有另一个例外。请看编辑后的问题。谢谢你,我是汉克斯·加博。“情绪”注释器不见了。我添加了这个,但现在我有另一个例外。请看编辑后的问题。谢谢是预付款