SentimentAI: BERT Movie Review Sentiment Analysis
A premium, end-to-end sentiment analysis application using a fine-tuned BERT model on the IMDB movie review dataset.
Features
- BERT Backend: fine-tuned
bert-base-uncased for high-accuracy sentiment classification.
- Fast Training: Configurable script to train on subsets or the full dataset.
- Modern UI: A stunning glassmorphism dashboard for real-time inference.
- REST API: Flask-based API for easy integration.
Project Structure
prepare_data.py: Downloads and tokenizes the IMDB dataset.
train_bert.py: Fine-tunes the BERT model.
predict.py: Inference class for sentiment prediction.
app/: Contains the web dashboard and Flask backend.
requirements.txt: Python dependencies.
Setup Instructions
1. Install Dependencies
pip install -r requirements.txt
2. Train the Model
Run the training script to fine-tune BERT on the IMDB dataset.
Note: By default, it trains on a small subset (1000 samples) for speed. You can increase subset_size in the script for better accuracy.
3. Run the Web App
- Start the Flask backend:
- Open
app/index.html in your browser.
Technologies Used
- Python: Core logic and model training.
- Hugging Face Transformers: BERT model implementation.
- PyTorch: Deep learning framework.
- Flask: Web API.
- Vanilla HTML/CSS/JS: Premium frontend with glassmorphism design.