Skip to content

Python script for analyzing Twitter users' sentiment polarity towards a specific trending hashtag on the platform online.

Notifications You must be signed in to change notification settings

kxnyshk/trending-hashtag-polarity-viz.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

twitter-hashtag-sentiment-analysis.py

Python script for analyzing Twitter users' sentiment polarity towards a specific trending hashtag on the platform online.

Fetching the repo

  • Download the .zip file
  • Unzip the folder
  • Open the main.py file in the terminal of your preferred IDE.

How to use

  • 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.

Commands

  • #hashtag Trending hashtag or hot topic you wanna analyze.
  • -1 Terminates program

Twitter Dev Auth setup

  • 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

About Tweepy

  • The requests between the script and the API has been handled through Tweepy library.
  • Read the official documentation here

Libraries used

Textblob

  • 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

  • Pandas is a Python library used to analyze data.
  • Read official documentation here

Numpy

  • 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

  • Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python.
  • Read the official latest (3.5.1) documentation here

Further reading

Releases

No releases published

Packages

No packages published

Languages