Python script for analyzing Twitter users' sentiment polarity towards a specific trending hashtag on the platform online.
- API & Source Platform used:
- Libraries used:
Tweepy
Textblob
Pandas
Numpy
Matplotlib
- Download the .zip file
- Unzip the folder
- Open the main.py file in the terminal of your preferred IDE.
- Enter the
#hashtag
you wanna analyze the sentiment polarity of. - Wait for the program to analyze the data from the fetched dataset.
- Dataset used in the analysis, usually ranges between (10, 1000] and is non-customizable by the user.
#hashtag
Trending hashtag or hot topic you wanna analyze.-1
Terminates program
- The Twitter Developer Authentication for an elevated API has been done through here.
- Read the official documentation here
- The API & TOKEN keys are saved via configparser in Python.
- Therefore, you would need to setup your own keys after signing up for your own Twitter Dev account.
- To setup the config path, create this path/file:
./TwitterDev/config.ini
in the dir/zip. - No need to re-setup the path in any code, it has already been declared in auth.py
- The requests between the script and the API has been handled through Tweepy library.
- Read the official documentation here
- TextBlob is a Python (2 and 3) library for processing textual data.
- It provides a simple API for diving into common natural language processing (NLP) tasks such as part-of-speech tagging, noun phrase extraction, sentiment analysis, classification, translation, and more.
- Read official documentation here
- Pandas is a Python library used to analyze data.
- Read official documentation here
- NumPy is a Python library used for working with arrays. It also has functions for working in domain of linear algebra, fourier transform, and matrices.
- Read the official documentation here
- Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python.
- Read the official latest (3.5.1) documentation here