Skip to content

Predict the sentiments of the Twitter tweets in a go using NLP techniques and Logistic Regresion Model.

Notifications You must be signed in to change notification settings

abhiiiman/Twitter_Sentiment_Analysis

Repository files navigation

Twitter Sentiment Analysis 🐦😃☹️

This project leverages Natural Language Processing (NLP) and Logistic Regression to classify the sentiment of tweets as either positive or negative. The model achieved an accuracy of 82%. Below you'll find detailed instructions on how to set up and run this project locally, as well as how to use the deployed Streamlit app.

Project Structure

Setup Instructions

  1. Clone the Repository
git clone https://github.com/abhiiiman/Twitter_Sentiment_Analysis.git
cd Twitter_Sentiment_Analysis
  1. Create a Virtual Environment
python -m venv venv
  • Mac Users
source venv/bin/activate 
  • Windows Users
venv\Scripts\activate
  1. Install Dependencies
pip install -r requirements.txt
  1. Download NLTK Data
  • In a Python shell, run:
import nltk
nltk.download('stopwords')
nltk.download('punkt')
  1. Download the Dataset from here Download the Dataset

  2. Run the Streamlit App

streamlit run app.py

Using the Deployed Streamlit App

  1. Navigate to the Streamlit App Click Here
  2. Enter Tweet Content
  3. Predict Sentiment
  4. Screenshots
  • Negative Tweet

  • Positive Tweet

Don't forget to give it a Star!

If you loved this project, give it aon GitHub! It would make my codebase as happy as a positive tweet 😄.

Releases

No releases published

Packages

No packages published