Skip to content

Real-time Twitter sentiment analysis app built with Streamlit. Fetches live tweets using Twitter API v2 and analyzes sentiment with a custom model. Includes interactive charts and CSV download.

Notifications You must be signed in to change notification settings

ShauryaDusht/realtime-twitter-sentiment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Real-Time Twitter Sentiment Analysis

Live Demo

Check out the deployed version of the app: Live Demo

This is a Streamlit-based web app for real-time sentiment analysis of tweets using Twitter API v2. The app fetches tweets based on user-input keywords and performs sentiment analysis using a custom sentiment analysis model (previously used VADER and TextBlob). It also provides interactive visualizations and allows downloading the analyzed data.

Features

  • Fetch live tweets based on a keyword using Twitter API v2
  • Sentiment analysis using a custom-built sentiment analysis model (Previously used VADER and TextBlob)
  • Interactive visualizations (Pie Charts, Histograms, Metrics)
  • Filter and search tweets based on sentiment
  • Download results as a CSV file

Installation & Usage

Clone the Repository

git clone https://github.com/ShauryaDusht/realtime-twitter-sentiment.git
cd realtime-twitter-sentiment

Create a Virtual Environment (Recommended)

python -m venv venv
source venv/bin/activate  # On macOS/Linux
venv\Scripts\activate    # On Windows

Install Dependencies

Ensure you have Python installed, then run:

pip install -r requirements.txt

Set Up Twitter API Credentials

Get your Bearer Token from Twitter Developer Portal. Add it when prompted in the app.

Run the Streamlit App

streamlit run app.py

Tech Stack

  • Frontend: Streamlit
  • Backend: Tweepy (Twitter API v2), NLTK, Custom Sentiment Analysis Model (Previously used VADER and TextBlob)
  • Visualization: Plotly, Pandas

Screenshots

Here are some screenshots of the app in action:

Screenshot 1 Screenshot 2 Screenshot 3 Screenshot 4 Screenshot 5 Screenshot 6 Screenshot 7 Screenshot 8 Screenshot 9

About

Real-time Twitter sentiment analysis app built with Streamlit. Fetches live tweets using Twitter API v2 and analyzes sentiment with a custom model. Includes interactive charts and CSV download.

Topics

Resources

Stars

Watchers

Forks

Languages