代码之家  ›  专栏  ›  技术社区  ›  matt_07734

斯坦福大学CoreNLP中的详细情绪分数

  •  3
  • matt_07734  · 技术社区  · 7 年前

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

    演示给一个句子一个从0到4的详细情感分数。

    我了解如何使用命令行获得“积极”或“消极”评估,类似于此: Screenshot from corenlp.run showing a positive sentiment analysis

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

    斯坦福大学CoreNLP中有没有办法返回给定句子的分数(即0-4),以显示其积极或消极程度?

    谢谢

    1 回复  |  直到 7 年前
        1
  •  6
  •   StanfordNLPHelp    7 年前

    获取此类信息有多种方式。

    我还应该注意到,有一个直接映射:

    “负”=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