始める無料で始める

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.

この演習はコースの一部です

Analyzing Social Media Data in Python

コースを見る

演習の手順

  • Load SentimentIntensityAnalyzer from nltk.sentiment.vader.
  • Instantiate a new SentimentIntensityAnalyzer object.
  • Generate sentiment scores with the .apply() method and the analyzer's polarity_scores() function.

実践的なインタラクティブ演習

このサンプルコードを完成させて、この演習に挑戦してみましょう。

# Load SentimentIntensityAnalyzer
____

# Instantiate new SentimentIntensityAnalyzer
sid = ____

# Generate sentiment scores
sentiment_scores = ds_tweets['text'].____(____)
コードを編集して実行