Chapter 11. Sentiment Analysis of Twitter Data
In this chapter we will see how to perform sentiment analysis over Twitter data. Initially, we introduce the Twitter API with Python. Then, we distinguish the basic elements of a sentiment classification. Finally, we present the Natural Language Toolkit (NLTK) to implement the tweets' sentiment analyzer.
In this chapter we will cover:
The anatomy of Twitter data
Using OAuth to access Twitter API
Getting started with Twython:
Simple search/query
Working with timelines
Working with followers
Working with places and trends
Sentiment classification:
Effective norms for English words
Text corpus
Get started with Natural Language Toolkit (NLTK)
Bag of words
Naïve Bayes
Sentiment analysis of tweets
In Chapter 4, Text Classification, we presented a basic introduction to text classification. In this chapter, we will perform a sentiment analysis of tweets to rate the emotional value (positive or negative) using classification with Naive Bayes method.
Sentiment analysis...