Loading VADER
Sentiment analysis provides us a small glimpse of the meaning of texts with a rather directly interpretable method. While it has its limitations, it's a good place to begin working with textual data. There's a number of out-of-the-box tools in Python we can use for sentiment analysis.
ds_tweets with the datetime index has been loaded for you.
Bài tập này là một phần của khóa học
Analyzing Social Media Data in Python
Hướng dẫn bài tập
- Load
SentimentIntensityAnalyzerfromnltk.sentiment.vader. - Instantiate a new
SentimentIntensityAnalyzerobject. - Generate sentiment scores with the
.apply()method and the analyzer'spolarity_scores()function.
Bài tập tương tác thực hành trực tiếp
Hãy thử làm bài tập này bằng cách hoàn thành đoạn mã mẫu này.
# Load SentimentIntensityAnalyzer
____
# Instantiate new SentimentIntensityAnalyzer
sid = ____
# Generate sentiment scores
sentiment_scores = ds_tweets['text'].____(____)