Twitter sentiment analysis for any topic with tweepy library
Sentiment analysis is used to analyse text from a social medias like twitter, customer reviews from e-commerece websites like amazon to predict the sentiment of the tweets or product reviews. The sentiment may be positive, negative, or neutral.This has a great role in understanding the sentiment of people towards a specific topic or product for which we wish to start a business.
It uses a lexicon of sentiment related words to predict the sentiment of a sentence.
The lexicon has many sentiment related words with each word corresponding to a positive or negative value.When a sentence is given for sentiment analysis, the number of words with positive and negative points are counted. If the number of words with positive point is more than that of negative ones, then the polarity of sentiment is positive :) and vice versa :(
- Tweepy is the library used for accessing the twitter API which is required for collecting the tweets for sentiment analysis.
- Pandas is used for dataset(tweets) manipulation.
- NLTK is required for predicting the score of sentiment or polarity of sentiment based on vader lexicon.
You can get create a twitter API from here.
Here are some research which solves some specific problem using sentiment analysis