情感分析词典

时间:2010-11-15 20:52:45

标签: dictionary nlp sentiment-analysis

我想知道是否有人知道我在哪里可以获得正面和负面词汇的字典。我正在研究情绪分析,这是它的关键部分。

9 个答案:

答案 0 :(得分:35)

匹兹堡大学的Sentiment Lexicon可能就是你所追求的。这是一个约8,000个单词的词汇,具有正面/中立/负面情绪。它在this paper中有更详细的描述,并在GPL下发布。

答案 1 :(得分:23)

到达时间稍晚我会注意到词典对情绪分析的贡献有限。 一些情绪承载句子不包含任何“情绪”词 - 例如“阅读书籍”,这在书评中可能是积极的,而在电影评论中是负面的。 同样,情感词“不可预测”在惊悚片的背景下可能是积极的,但在描述丰田的休息系统时则是消极的。

还有更多......

答案 2 :(得分:21)

答案 3 :(得分:12)

刘冰教授提供了一个约6800字的英语词典,你可以从这个链接下载: Opinion Mining, Sentiment Analysis, and Opinion Spam Detection

答案 4 :(得分:6)

This paper from 2002描述了一种自动从文本样本中导出这样一个字典的算法,只使用两个单词作为种子集。

答案 5 :(得分:3)

你可以在这里找到

AFINN并动态创建它。就像每当未知的+ ve字出现时加上+1。就像香蕉是新的+ ve字并出现两次然后它将变成+2。

你想要的文章和数据会变得更强大!

答案 6 :(得分:3)

Harvard-IV字典目录http://www.wjh.harvard.edu/~inquirer/homecat.htm至少有两套现成的字典用于正/负方向。

答案 7 :(得分:2)

您可以使用vader情感词典

df = pd.DataFrame({'port':['aa789',2,3],
                   'supplier_id':[4,'s',6],
                   'currency':['USD',8,9],
                   'value':[1.7,3,5]})

print (df)
  currency   port supplier_id  value
0      USD  aa789           4    1.7
1        8      2           s    3.0
2        9      3           6    5.0

#for python 2 change str to basestring
m1 = (df.port.astype(str).str.len() == 5) & (df.port.apply(lambda x :isinstance(x, str)))
m2 = df.supplier_id.apply(lambda x : isinstance(x, int))
m3=(df.currency.astype(str).str.len() == 3)&(df.currency.apply(lambda x :isinstance(x, str)))
m4 = df.value.apply(lambda x : isinstance(x, float))
mask = m1 & m2 & m3 & m4
print (mask)
0     True
1    False
2    False
dtype: bool

print (df[mask])
  currency   port supplier_id  value
0      USD  aa789           4    1.7

它会给你句子的极性。

输出:

from nltk.sentiment.vader import SentimentIntensityAnalyzer

sentence='APPle is good for health'
sid = SentimentIntensityAnalyzer()
ss = sid.polarity_scores(sentence)  
print(ss)

答案 8 :(得分:1)

Sentiwords可获得155,000个单词(及其极性,即从极负到极高的分数介于-1和1之间)。 here

讨论了该词典