【问题标题】:Detailed Sentiment Score in Stanford CoreNLP斯坦福 CoreNLP 中的详细情绪评分
【发布时间】:2017-11-13 21:31:20
【问题描述】:

在 StanfordCore NLP 网站上有如下演示:http://nlp.stanford.edu:8080/sentiment/rntnDemo.html

demo 给出了一个句子从 0 到 4 的详细情感分数。

我了解如何使用命令行获得“正面”或“负面”评估,类似于以下内容: Screenshot from corenlp.run showing a positive sentiment analysis

我已经看过这个问题,但我对如何创建所附屏幕截图中显示的分析感兴趣。 Getting sentiment analysis result using stanford core nlp java code

Stanford CoreNLP 中是否有办法返回给定句子的分数(即 0-4),以显示其积极或消极程度?

谢谢!

【问题讨论】:

    标签: java stanford-nlp sentiment-analysis


    【解决方案1】:

    有多种方法可以获取此类信息。

    另外我应该注意的是有一个直接映射:

    “非常消极”= 0 “负” = 1 “中性” = 2 “积极”= 3 “非常积极”= 4

    这是一个示例命令:

    java -Xmx8g edu.stanford.nlp.pipeline.StanfordCoreNLP -annotators tokenize,ssplit,pos,lemma,ner,parse,sentiment -file example-1.txt -outputFormat json
    

    在文件example-1.txt.json 中,您会看到很多与句子的情感相关的字段,包括sentimentValue

    在这个 GitHub 问题上有更多信息:

    https://github.com/stanfordnlp/CoreNLP/issues/465

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-05
      • 1970-01-01
      • 2019-03-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多