首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >情感分析api/工具,for Java

情感分析api/工具,for Java
EN

Stack Overflow用户
提问于 2011-05-20 14:05:43
回答 3查看 9K关注 0票数 7

我正在编写一个Java程序,需要分析一小块文本(3-4句话,新闻文章),以了解他们的情感。我只需要知道这篇文章通常是正面的、负面的还是中性的。

例如,理想的情况是将以下内容归类为“正面”:

亚马逊的Kindle电子书销量猛增。Amazon.com说,比起平装版和精装本加起来,它的Kindle电子阅读设备的电子书销量更多。

我所需要的是一个非常简单和快速的第三方解决方案,我可以在我的程序中使用。它不一定总是完全准确的。许可证等并不是一个问题,只要有可能跟踪解决方案。

到目前为止,我已经找到了一个潜在的很好的解决方案,AlchemyAPI,但我很难真正使用它。

如果有人以前遇到过这个问题,并且知道一个特别好/容易的解决方案,或者是一个非常好的教程,我将非常感激:)

(我也为这个问题中缺少代码表示歉意。)

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2011-05-20 14:58:35

我刚刚测试了AlchemyAPI。这并不是百分之百准确,但我想这种技术还处于初级阶段。

您需要注册(免费)才能获得api密钥。

下面是一个示例用法:http://access.alchemyapi.com/calls/text/TextGetTextSentiment?apikey=<insert your api key>&sentiment=1&showSourceText=1&text=Kindle%20e-book%20sales%20soar%20for%20Amazon.%20Amazon.com%20says%20it%20is%20selling%20more%20e-books%20for%20its%20Kindle%20electronic%20reading%20device%20than%20paperback%20and%20hardback%20print%20editions%20combined

这些投入是:

  1. sentiment=1
  2. showSourceText=1
  3. 文本(我使用了您的示例文本,uri编码)

我得到了以下输出(中性情绪,而不是预期的积极情绪):

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<results>    
    <status>OK</status>    
    <usage>By accessing AlchemyAPI or using information generated by AlchemyAPI, you are agreeing to be bound by the AlchemyAPI Terms of Use: http://www.alchemyapi.com/company/terms.html</usage>    
    <url></url>    
    <language>english</language>    
    <text>Kindle e-book sales soar for Amazon. Amazon.com says it is selling more e-books for its Kindle electronic reading device than paperback and hardback print editions combined</text>    
    <docSentiment>    
        <type>neutral</type>    
    </docSentiment>    
</results>

另一个示例用法:http://access.alchemyapi.com/calls/text/TextGetTextSentiment?apikey=<insert your api key>&sentiment=1&showSourceText=1&text=kindle%20is%20amazing

以及产出:

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>    
<results>    
    <status>OK</status>    
    <usage>By accessing AlchemyAPI or using information generated by AlchemyAPI, you are agreeing to be bound by the AlchemyAPI Terms of Use: http://www.alchemyapi.com/company/terms.html</usage>    
    <url></url>    
    <language>english</language>    
    <text>kindle is amazing</text>    
    <docSentiment>    
        <type>positive</type>    
        <score>0.283568</score>    
    </docSentiment>    
</results>
票数 15
EN

Stack Overflow用户

发布于 2018-04-26 03:37:11

2018年有更多的情感分析API!:-)根据您需要的特性或文本的语言,您可以使用其中之一:

  • hyindao的LexSent算法
  • mtman在算法中的情感分析
  • 基于nlu算法的情感分析
  • 基于nlu算法的社会情感分析
  • Amazon服务理解
  • 艾琳语篇分析
  • 玻色子NLP情感分析
  • 谷歌云自然语言
  • IBM Watson NLU
  • 意义云情感分析
  • Microsoft认知服务文本分析
  • Repustate文本分析
  • Salesforce爱因斯坦语言
  • Twinword情感分析
  • TheSay PreCeive

对于语言支持,特性和价格比较我要提到这篇文章。

票数 0
EN

Stack Overflow用户

发布于 2018-11-28 13:10:46

如果你需要更好的情感分析准确性,你可以自己训练你的模型,比如https://text2data.com/Sentiment-Model-Training

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

https://stackoverflow.com/questions/6073109

复制
相关文章

相似问题

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