【问题标题】:Confused with "sentiment" package in R?对 R 中的“情感”包感到困惑?
【发布时间】:2016-05-30 14:28:15
【问题描述】:

我一直在使用 R 的 sentiment 包进行情绪分析。当我的许多文件中的一些微不足道的负面因素成为正面因素时,我感到震惊。比如

library("sentiment")
classify_polarity("Not good")

#      POS                NEG                 POS/NEG            BEST_FIT  
# [1,] "8.78232285939751" "0.445453222112551" "19.7154772340574" "positive"

我不确定这背后发生了什么。有人可以澄清一下吗?

【问题讨论】:

  • possibly relevant。加上那个函数不应该返回一个矩阵,这是一个糟糕的设计选择
  • @rawr 谢谢。我刚刚浏览了源代码。这对每个单词进行评分并总结为整体。 “好”比“不好”的得分相对较高,仍然是积极的。我可以在 R 中对情绪分析进行任何其他适当的实现吗?
  • 你点击链接了吗?
  • @rawr 是的,qdap::polarity() 给出平均极性。我希望这对我的目的有用。

标签: r sentiment-analysis


【解决方案1】:

谢谢你。我发现这很有帮助。

>library(qdap)
> polarity("Not Good")
  all total.sentences total.words ave.polarity sd.polarity stan.mean.polarity
  1 all               1           2       -0.707          NA                 NA
> polarity("It's cool but not great")
  all total.sentences total.words ave.polarity sd.polarity stan.mean.polarity
  1 all               1           5       -0.894          NA                 NA
> polarity("It's awesome")
  all total.sentences total.words ave.polarity sd.polarity stan.mean.polarity
  1 all               1           2        0.707          NA                 NA

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-03-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-28
    • 2012-01-04
    • 1970-01-01
    相关资源
    最近更新 更多