Sentimentify is an AI-powered sentiment analysis application designed to analyze Spotify user reviews. Using a fine-tuned DistilBERT transformer model, it classifies reviews as positive, neutral, or negative while providing confidence scores and visualizations.
- Real-time sentiment analysis of user-entered reviews
- Interactive UI with Spotify-inspired design
- Review history tracking with persistence
- Detailed model metrics and performance visualizations
- Auto-suggestion for text input
- Mobile-responsive design
The DistilBERT model powering Sentimentify achieves:
- 86.17% validation accuracy
- 0.8622 F1 score
- Balanced performance across sentiment classes
- Frontend: HTML, CSS, JavaScript, Tailwind CSS
- Backend: Python, Flask
- ML Model: DistilBERT (PyTorch), Transformers, NLTK
- Deployment: GitHub Pages (frontend), Cloud provider (backend)
- Python 3.8+
- Node.js (optional, for local development)
- Git
- Fork or clone this repository
- Enable GitHub Pages in your repository settings:
- Go to Settings > Pages
- Select the main branch as source
- Save
- Create a
requirements.txtfile in your repository (already included): torch transformers nltk emoji flask flask-cors joblib gunicorn - Create a free account on Render
- Create a new Web Service and link to your GitHub repo
- Configure the service:
- Build command:
pip install -r requirements.txt - Start command:
gunicorn sentiment_api:app - Environment variables: Add any necessary API keys
- Deploy the service
- Update the API endpoint in
script.js:
// Change from local to deployed URL
const response = await fetch('https://your-backend-name.onrender.com/analyze', {
// ...
});- Clone the repository
git clone https://github.com/yourusername/sentimentify.git
cd sentimentify- Initialize Virtual Environment and Install backend dependencies
python -m venv venv_sentimental
.\venv_sentimental\Scripts\activate
pip install -r requirements.txt- Run the Flask API
python sentiment_api.py- Open index.html in your browser or use a local server
# Using Python's built-in server
python -m http.serverBase Model: DistilBERT (distilbert-base-uncased) Parameters: 66M Layers: 6 transformer blocks Embedding Size: 768 Training: 10 epochs (early stopping at epoch 9) Performance: 86.17% validation accuracy, 0.8622 F1 score
Contributions are welcome! Please feel free to submit a Pull Request.
📄 License This project is licensed under the MIT License - see the LICENSE file for details. ```