gpt4 book ai didi

java - Stanford CoreNLP 中的详细情绪评分

转载 作者:塔克拉玛干 更新时间:2023-11-01 23:02:24 26 4
gpt4 key购买 nike

在 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

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

谢谢!

最佳答案

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

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

“非常消极”= 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

关于java - Stanford CoreNLP 中的详细情绪评分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47273885/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com