首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >评估斯坦福自然语言处理的情感分析结果

评估斯坦福自然语言处理的情感分析结果
EN

Stack Overflow用户
提问于 2013-12-04 17:46:19
回答 2查看 1.8K关注 0票数 1

我想用斯坦福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

给出结果:

代码语言:javascript
复制
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包含

这部电影不关心聪明,机智或任何其他类型的智慧幽默。那些在美丽的事物中发现丑陋含义的人是腐败的,没有魅力。有一些缓慢和重复的部分,但它有足够的趣味来保持它的趣味性。

EN

回答 2

Stack Overflow用户

发布于 2014-02-07 18:04:34

如果你想获得情绪评分,使用这个命令-

代码语言:javascript
复制
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文件,其情感得分如下-

代码语言:javascript
复制
<sentence id="1" sentimentValue="1" sentiment="Negative">
票数 2
EN

Stack Overflow用户

发布于 2016-08-17 02:18:55

你不能评估文本文件。你必须评估treebank。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20371903

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档