Mining sentiment from Twitter
It's time to put our knowledge of different sentiment classification models in a more realistic scenario—Twitter sentiment analysis.Â
As we mentioned in the introduction, sentiment analysis is of great interest for all companies that have a presence online (which is, well, lots of companies in many countries). It is also relevant for politicians, researchers, stock traders and others.Â
Note
Before using any service or API, be sure to review their terms of service and follow them! We do not encourage unlawful behavior in any way.
Connecting to the Twitter API
Luckily for us, there is a nice package in R to retrieve our Tweets: The library twitteR
. First, there are a number of steps you need to follow:
- If you do not have one, create a Twitter account to be able to access their API.
- Go to https://dev.twitter.com/apps and log in with your credentials.Â
- Once logged in, click on
Create New App
. - Put this as callback URL http://localhost:1410.
- Now go to
Keys and Access Tokens...