A real-time sentiment analysis web app that classifies text as Positive, Negative, or Neutral using a fine-tuned BERT model — with WhatsApp alerts via Twilio for negative sentiment.
- 🔍 BERT-based NLP — deep learning model for accurate sentiment classification
- 🌐 Flask Web App — clean UI to enter text and view results instantly
- 📲 WhatsApp Notifications — automatically alerts via Twilio when negative sentiment is detected
- 📊 Twitter Dataset — trained on 74,000+ labelled tweets
- ⚡ Real-time Prediction — instant results on any text input
Enter any text → get instant sentiment prediction → negative results trigger a WhatsApp alert
| Layer | Technology |
|---|---|
| Language | Python 3.9+ |
| Web Framework | Flask |
| NLP Model | BERT (HuggingFace Transformers) |
| Notifications | Twilio WhatsApp API |
| Data Processing | Pandas, NumPy |
| ML Library | Scikit-learn |
| Frontend | HTML, CSS |
Sentiment-Analysis/
├── app.py # Flask web application
├── bert_model.py # BERT model loading & prediction
├── train.py # Model training script
├── preprocess.py # Text preprocessing pipeline
├── data_loader.py # Dataset utilities
├── twitter_training.csv # Training dataset (74k+ tweets)
├── twitter_validation.csv # Validation dataset
├── index.html # Home page UI
├── result.html # Results page UI
├── styles.css # Styling
└── requirements.txt
- Python 3.9+
- pip
# Clone the repository
git clone https://github.com/mdsajid2003/Sentiment-Analysis.git
cd Sentiment-Analysis
# Install dependencies
pip install -r requirements.txt
# Run the app
python app.pyOpen your browser at http://localhost:5000
Twitter Entity Sentiment dataset with 74,000+ labelled tweets across Positive, Negative, and Neutral categories.
Source: Kaggle — Twitter Entity Sentiment Analysis
- Deploy on Render / HuggingFace Spaces
- Add multi-language support
- Real-time sentiment dashboard with charts
- Fine-tune on domain-specific datasets
This project is licensed under the MIT License.