【问题标题】:How could I improve the accuracy of sentiment analysis of news headlines? [closed]如何提高新闻标题情感分析的准确性? [关闭]
【发布时间】:2017-08-25 21:04:20
【问题描述】:

我使用VaderTextBlob 来分析新闻标题的情绪,结果好坏参半:许多我认为略微负面的标题被评为中性。以下是几个例子:

Who wants to live in an artificially intelligent future?
# Vader: {'compound': 0.4588, 'pos': 0.273, 'neu': 0.727, 'neg': 0.0}
# TextBlob: Sentiment(polarity=0.2840909090909091, subjectivity=0.40625)

The internet and social media provide huge opportunities for the coming generation, but there’s a dark side from which it must be protected.
# Vader: {'compound': 0.743, 'pos': 0.278, 'neu': 0.722, 'neg': 0.0}
# TextBlob: Sentiment(polarity=0.09444444444444448, subjectivity=0.45555555555555555)

For three months I’ve lived without tech and now realise we need to question its ever-encroaching invasion – before we end up in bed with a sex robot.
# Vader {'compound': 0.0, 'pos': 0.0, 'neu': 1.0, 'neg': 0.0}
# TextBlob Sentiment(polarity=0.0, subjectivity=0.0)

我认为第一句话可以任意解读,但后两句肯定有负面因素:“有阴暗面”和“它不断入侵”,所以我很惊讶维德同时给出了这两个词0 的负疮和 TextBlob 的极性为 0 或更高。

对于情感分析算法来说,这类文本从根本上来说是困难的,还是我可以考虑另一种方法?

我提到的库的吸引力在于我不必制作自己的分类数据集,但如果我可能获得更好的结果,我可能会考虑。

【问题讨论】:

    标签: python sentiment-analysis textblob vader


    【解决方案1】:

    基本区别在于,大多数当前工具都在处理单个单词的情感指数。例如,在文本中的任何地方找到“喜欢”或“优秀”将表示积极评价。您的示例更多地取决于对短语的一些“理解”,需要最少的解析。这是一个更详细的过程,需要对语言语义有更深入的了解。

    可以解决此问题的一种方法是用索引短语(作为单词插入)以及单词来填充词典。然后,您预处理输入以将这些短语转换为您在词典中使用的任何指示。例如,用下划线连接这些短语——“dark_side”在你的词典中,索引为负数。

    我希望这能给你一个有用的方向。

    【讨论】:

    • 非常感谢您的回复,感谢我的问题很模糊!我会考虑在 Vader 或 TextBlob 的词典中添加术语……对于未来的 Google 员工,我发现 this page v 有助于评估不同的词典如何处理文本。
    猜你喜欢
    • 2020-11-06
    • 1970-01-01
    • 1970-01-01
    • 2015-04-11
    • 2020-07-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多