Skip to content

puniaiml/Twitter-Sentiment-Analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 SentimentAI · Twitter Sentiment Analysis


🚀 Overview

SentimentAI is a deep learning-based web application that classifies tweets into four sentiment categories using a hybrid BERT + BiLSTM architecture.

The system leverages transformer-based contextual embeddings along with sequential learning to achieve high accuracy and robust sentiment understanding.

👉 Designed for real-world NLP applications like:

  • Social media monitoring
  • Brand sentiment analysis
  • Opinion mining

🎥 Live Demo


🧠 Model Architecture

Layer Details
BERT Encoder bert-base-uncased
Dropout p = 0.10
BiLSTM 2 layers · hidden size = 128
Linear 256 → 4 classes
Log-Softmax Output activation

🏷️ Sentiment Classes

Class Description
🟢 Positive Happiness, excitement, praise
🔴 Negative Anger, sadness, criticism
🟡 Neutral Informational, no emotion
⚪ Irrelevant Spam or unrelated content

📊 Performance

Metric Score
Accuracy 90.0%
Precision 90.0%
Recall 90.0%
F1 Score 90.0%

📁 Dataset

  • 📊 74,681 tweets
  • 🏷️ 4 sentiment classes
  • 📌 Real-world Twitter dataset

⚙️ Tech Stack

Layer Technology
Frontend Streamlit
Model PyTorch + HuggingFace
NLP Transformers (BERT)
Visualization Plotly
Deployment Streamlit Cloud
Model Hosting HuggingFace Hub

📱 Application Preview

🏠 Dashboard & Model Overview


✍️ Tweet Input & Analysis


📊 Prediction Result & Confidence Scores


🔄 Working Flow

  1. 📝 User inputs tweet text
  2. 🔍 Text is tokenized using BERT tokenizer
  3. 🧠 BERT extracts contextual embeddings
  4. 🔄 BiLSTM processes sequence
  5. 📊 Model predicts sentiment class
  6. 📱 Result displayed in UI

🤗 Model Weights


⚙️ Run Locally

git clone https://github.com/puneethas26/sentiment-bert-bilstm.git
cd sentiment-bert-bilstm
pip install -r requirements.txt
streamlit run app.py

About

BERT + BiLSTM based Twitter Sentiment Analysis web app with ~90% accuracy, deployed using Streamlit for real-time prediction and visualization.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors