【问题标题】:Vader lexicon results don't add up to 1.0Vader 词典结果加起来不等于 1.0
【发布时间】:2020-07-16 11:34:32
【问题描述】:

我的数据是来自 Stocktwits 的推文,我尝试使用 python 中的 Vader 库进行情绪分析。 问题是正、中性和负字段加起来不等于 1.0。取而代之的是,它们加起来是 2.0。

{'neg': 0.0, 'neu': 2.0, 'pos': 0.0, 'compound': 0.0}

这正常吗?

【问题讨论】:

    标签: python stocktwits vader


    【解决方案1】:

    是的,这很正常。 example in the docs 显示类似的结果:

    VADER is smart, handsome, and funny.----------------------------- {'pos': 0.746, 'compound': 0.8316, 'neu': 0.254, 'neg': 0.0}
    VADER is smart, handsome, and funny!----------------------------- {'pos': 0.752, 'compound': 0.8439, 'neu': 0.248, 'neg': 0.0}
    ...
    VADER is not smart, handsome, nor funny.------------------------- {'pos': 0.0, 'compound': -0.7424, 'neu': 0.354, 'neg': 0.646}
    

    posneuneg 分数是属于每个类别的文本比例的比率(因此这些总和应该是 1... 或通过浮动操作接近它)。如果您想要对给定句子的情绪进行多维测量,这些是最有用的指标。​​

    您可能想使用compound 分数:

    compound 分数是通过对词典中每个单词的价分数求和,根据规则进行调整,然后归一化到 -1(最极端的负数)和 +1(最极端的正数)之间的值计算得出的。如果您想要一个给定句子的单一一维情绪度量,这是最有用的指标。将其称为“标准化加权综合得分”是准确的。

    对于希望设置标准化阈值以将句子分类为正面、中性或负面的研究人员也很有用。

    【讨论】:

      猜你喜欢
      • 2018-11-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-25
      • 2017-03-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多