我想用斯坦福NLP包测试几个句子,并想得到它的分数的情感结果。
我尝试了几种方法。在一些测试中,我得到了部分结果,比如我给出的文本的极性。但不是情绪得分。
这是我执行的命令:H:\Drive E\Stanford\stanfor-corenlp-full-2013~>java -cp "*" -mx1g edu.stanford. nlp.sentiment.Evaluate edu/stanford/nlp/models/sentiment/sentiment.ser.gz test.txt
给出结果:
EVALUATION SUMMARY
Tested 0 labels
0 correct
0 incorrect
? accuracy
Tested 0 roots
0 correct
0 incorrect
? accuracy
Label confusion matrix: rows are gold label, columns predicted label
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
Root label confusion matrix: rows are gold label, columns predicted label
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
Approximate negative label accuracy: ?
Approximate positive label accuracy: ?
Combined approximate label accuracy: ?
Approximate negative root label accuracy: ?
Approximate positive root label accuracy: ?
Combined approximate root label accuracy: ?text.txt包含
这部电影不关心聪明,机智或任何其他类型的智慧幽默。那些在美丽的事物中发现丑陋含义的人是腐败的,没有魅力。有一些缓慢和重复的部分,但它有足够的趣味来保持它的趣味性。
发布于 2014-02-07 18:04:34
如果你想获得情绪评分,使用这个命令-
java -cp stanford-corenlp-3.3.1.jar:stanford-corenlp-3.3.1-models.jar:xom.jar:joda-time.jar:jollyday.jar:ejml-0.23.jar -Xmx3g edu.stanford.nlp.pipeline.StanfordCoreNLP -annotators tokenize,ssplit,parse,pos,sentiment -file input.txt这将生成一个名为input.txt.xml的xml文件,其情感得分如下-
<sentence id="1" sentimentValue="1" sentiment="Negative">发布于 2016-08-17 02:18:55
你不能评估文本文件。你必须评估treebank。
https://stackoverflow.com/questions/20371903
复制相似问题