简体   繁体   English

Python中的情感分析:Textblob与Vader?

[英]Sentiment Analysis in Python: Textblob vs Vader?

I am learning how to conduct sentiment analysis on social media posts using Python. 我正在学习如何使用Python对社交媒体帖子进行情感分析。 I found there are different tools to achieve this, such as Textblob or Vader. 我发现有多种工具可以实现此目的,例如Textblob或Vader。

I would like to understand what are the differences I should pay attention to when choosing one or the other. 我想了解选择其中一种时应注意的区别。

In this case, I am trying to analyze tweets from different users over a fixed period of time. 在这种情况下,我试图分析固定时间段内来自不同用户的推文。

Thanks! 谢谢!

Vader Sentiment Analysis works better for with texts from social media and in general as well. 维德情绪分析更适合与社交媒体以及一般的文本一起使用。 It is based on lexicons of sentiment-related words. 它基于与情感相关的单词的词典。 Each words in the lexicon is rated whether it is positive or negative. 词典中的每个单词都是正负的。

When it comes to analysing comments or text from social media, the sentiment of the sentence changes based on the emoticons. 当分析来自社交媒体的评论或文本时,句子的情感会根据表情符号而变化。 Vader takes this into account along with slang, capitalization etc and hence a better option when it comes to tweets analysis and their sentiments. Vader将其与,语,大写字母等一起考虑在内,因此在推文分析及其情感方面是一个更好的选择。

Refer to this paper for more details. 有关更多详细信息,请参阅本文

It produces 4 metrics - positive, negative, neutral and compound score. 它产生4个指标-正,负,中性和复合得分。 I did Twitter sentiment analysis using Vader and was surprised that the sentiments were better compared to textBlob. 我使用维达(Vader)进行了Twitter情绪分析,并且感到与textBlob相比,情绪更好。 You can refer to the code in my githubrepo I manually validated random tweets and came up with a compound score that can determine positive and negative tweets. 您可以参考我的githubrepo中的代码,我手动验证了随机推文,并得出了可以确定正面和负面推文的综合评分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM