Twitter Sentiment Analysis using Python
Sentiment Analysis on Twitter keywords using Python - using Tweepy and TextBlob libraries and NLTK corpora. Data Visualization was done using Matplotlib.
- Tweepy is the python client for the official Twitter API.
- TextBlob is the python library for processing textual data.
- Ensure you have python installed
- Replace the following lines in TwitterClient.py with values from your Twitter Application from the developer account:
consumer_key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' consumer_secret = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' access_token = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' access_token_secret = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
-
Clone the repository
git clone git@github.com:Gichure/twitter-sentiment-analysis.git
-
Go to the
twitter-sentiment-analysis folder
cd twitter-sentiment-analysis folder `` -
Go to the executable file folder
cd src/com/pgichure/sentiment-analysis/
-
Execute the script "TwitterClient.py"
python TwitterClient.py
You will be prompted to enter the keyword. Provide keyword and hit enter
Send me an email to build a sentiment analysis application for your unique business brands, campaigns and needs. Visit my website