- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
当我们在斯坦福演示页面上对其进行测试时:http://nlp.stanford.edu:8080/sentiment/rntnDemo.html
它给树每个节点的情感分数如下:
我正在尝试使用命令在我的本地系统上测试它:
H:\Drive E\Stanford\stanfor-corenlp-full-2013~>java -cp "*" edu.stanford.nlp.sen
timent.Evaluate edu/stanford/nlp/models/sentiment/sentiment.ser.gz test.txt
text.txt
有
这部电影不关心机智、机智或任何其他类型的智慧幽默。
那些在美丽的事物中发现丑陋意义的人是腐败而不迷人的。
产生结果:
谁能告诉我为什么它是空的?或者也许我在执行时犯了任何错误?我的目的是分析文本并获得带有分数的情感结果。
最佳答案
您使用的文件有误,命令也不完整。以下是您应该使用的命令。
java -cp "*"edu.stanford.nlp.sentiment.Evaluate -model edu/stanford/nlp/models/sentiment/sentiment.ser.gz -treebank 测试.txt
text.txt 文件不包含普通句子,而是包含树库
例如
(2 (3 (3 Effective) (2 but)) (1 (1 too-tepid) (2 biopic)))
(3 (3 (2 If) (3 (2 you) (3 (2 sometimes) (2 (2 like) (3 (2 to) (3 (3 (2 go) (2 (2 to) (2 (2 the) (2 movies)))) (3 (2 to) (3 (2 have) (4 fun))))))))) (2 (2 ,) (2 (2 Wasabi) (3 (3 (2 is) (2 (2 a) (2 (3 good) (2 (2 place) (2 (2 to) (2 start)))))) (2 .)))))
(4 (4 (4 (3 (2 Emerges) (3 (2 as) (3 (2 something) (3 rare)))) (2 ,)) (4 (2 (2 an) (2 (2 issue) (2 movie))) (3 (2 that) (3 (3 (2 's) (4 (3 (3 (2 so) (4 honest)) (2 and)) (3 (2 keenly) (2 observed)))) (2 (2 that) (2 (2 it) (2 (1 (2 does) (2 n't)) (2 (2 feel) (2 (2 like) (2 one)))))))))) (2 .))
(2 (2 (2 The) (2 film)) (3 (3 (3 (3 provides) (2 (2 some) (3 (4 great) (2 insight)))) (3 (2 into) (3 (2 (2 the) (2 (2 neurotic) (2 mindset))) (3 (2 of) (2 (2 (2 (2 (2 all) (2 comics)) (2 --)) (2 even)) (3 (2 those) (4 (2 who) (4 (2 have) (4 (2 reached) (4 (4 (2 the) (3 (2 absolute) (2 top))) (2 (2 of) (2 (2 the) (2 game))))))))))))) (2 .)))
收到的输出是
EVALUATION SUMMARY
Tested 82600 labels
66258 correct
16342 incorrect
0.802155 accuracy
Tested 2210 roots
976 correct
1234 incorrect
0.441629 accuracy
Label confusion matrix: rows are gold label, columns predicted label
323 1294 292 99 0
161 5498 2993 602 1
27 2245 51972 2283 21
3 652 2868 7247 228
3 148 282 2140 1218
Root label confusion matrix: rows are gold label, columns predicted label
44 193 23 19 0
39 451 62 81 0
9 190 82 101 7
0 131 30 299 50
0 36 8 255 100
Approximate Negative label accuracy: 0.912008
Approximate Positive label accuracy: 0.930750
Combined approximate label accuracy: 0.923128
Approximate Negative root label accuracy: 0.879081
Approximate Positive root label accuracy: 0.808266
Combined approximate root label accuracy: 0.842756
希望这有帮助:) !!
关于java - 使用stanford core nlp java代码获取情绪分析结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20368101/
我刚开始使用Stanford Parser,但我不太了解这些标签。这可能是一个愚蠢的问题,但是谁能告诉我SBARQ和SQ标签代表什么,在哪里可以找到它们的完整列表?我知道Penn Treebank的样
我正在使用 python 的内置库 nltk 来获取 stanford ner tagger api 设置,但我发现此 api 的单词标记与 stanford 的 ner tagger 网站上的在线演
我正在尝试使用斯坦福依赖解析器。我尝试从 Windows 上的命令行运行解析器以使用以下命令提取依赖项: java -mx100m -cp "stanford-parser.jar" edu.stan
我正在尝试开始使用 Stanford CoreNLP,甚至无法通过这里的第一个简单示例。 https://stanfordnlp.github.io/CoreNLP/api.html 这是我的代码:
我正在使用 stanford 核心 NLP,并使用这一行来加载一些模块来处理我的文本: props.put("annotators", "tokenize, ssplit, pos, lemma, n
我找到了与 Stanford Core NLP 兼容的德语解析和 pos-tag 模型。但是我无法使德语词形还原工作。有办法吗? 最佳答案 抱歉,据我所知,Stanford CoreNLP 不存在德语
我目前正在使用以下命令解析阿拉伯文本: java -mx1500m edu.stanford.nlp.parser.lexparser.LexicalizedParser \ -cp "$scri
我有以下结果,如您所见,爱德华这个名字有不同的结果(null 和 male)。这发生在几个名字上。 edward, Gender: null james, Gender: MALE karla, Ge
我发现了 stanford-NLP 的工具,发现它真的很有趣。 我是一名法国数据挖掘者/数据科学家,喜欢文本分析,并且很想使用您的工具,但是 NER 在法语中不可用,这让我感到非常困惑。 我很想制作我
我正在使用 Suse Linux 13.1 并自学斯坦福大学的 CS 106b 类(class)。我在这里找到了压缩库 http://www.stanford.edu/class/cs106b/hom
我正在使用 stanford CoreNLP 来尝试查找名词短语的语法关系。 这是一个例子: 给定“The fitness room was dirty”这句话。 我成功地将“The fitness
我正在使用 Stanford CoreNLP 并将其用于 NER。但是当我提取组织名称时,我看到每个词都标有注释。因此,如果实体是“纽约时报”,那么它将被记录为三个不同的实体:“NEW”、“YORK”
我开始使用 coreNLP 库 3.3.1 来分析意大利文本文档。有没有人尝试过使用英语以外的语言?您是否找到了训练算法所需的模型? 谢谢 卡罗 最佳答案 目前,除了英语,我们只为中文打包模型(见 h
斯坦福解析器和斯坦福 CoreNlp 的词性 (POS) 模型用途不同,这就是为什么通过 Stanford Parser 和 CoreNlp 执行的 POS 标记的输出存在差异。 在线核心 NLP 输
我的 (maven) 项目依赖于 stanford-CoreNLP 和 stanford-Parser,显然每个依赖项的(词汇化)解析器产生不同的输出,它们并不相同。 我的问题是如何确定应该从哪个包加
我正在尝试学习 Stanford CoreNLP 库。我在发布的示例 ( https://sergeytihon.wordpress.com/2013/10/26/stanford-corenlp-i
我是 nltk 的新手,似乎正在遵循过时的教程来开始使用 nltk 中的 StanleyDependencyParser。 我已经从https://stanfordnlp.github.io/安装了S
我正在尝试使用Stanford CoreNLP训练NER模型,但是找不到主类。我已经在我的CLASSPATH中包含了jar文件的路径,但仍然找不到它们。有什么办法解决这个问题吗? C:\ Users
我不明白它要我做什么。分配给 sentence正在工作: val sentences : java.util.List[CoreMap] = document.get(classOf[Sentence
我正在参加 Rotten Tomatoes NLP 预测的 kaggle 竞赛。 训练集格式解析如下: PhraseId SentenceId Phrase Sentiment 1 1 A serie
我是一名优秀的程序员,十分优秀!