SentimentSnap is an end-to-end NLP project that analyzes user reviews and predicts their sentiment (Positive, Neutral, or Negative). It combines a Flask API backend with a Streamlit frontend for a seamless, interactive user experience.
- ✅ Real-time sentiment prediction
- 🧹 Text preprocessing with Lemmatization
- 🤖 Trained ML models (Logistic Regression, SVM, Naive Bayes and Random Forest.)
- ✨ TF-IDF vectorization using bi-grams (3000 features)
- 🔌 Flask backend serving predictions via API
- 🌐 Streamlit frontend with a user-friendly interface
| Layer | Technology |
|---|---|
| Frontend | Streamlit |
| Backend | Flask (API-only) |
| ML Models | Scikit-learn |
| Text Prep | NLTK, TfidfVectorizer |
| Serialization | Pickle |
SentimentSnap/
├── sentiment_api.py # Flask API backend
├── sentiment_ui.py # Streamlit frontend
├── models/
│ ├── sentiment_model.pkl # Trained ML model
│ └── tfidf_vectorizer.pkl # TF-IDF vectorizer
├── text_preprocess.py # Text cleaning and lemmatization
├── README.md
└── requirements.txt # Project dependencies
git clone https://github.com/Rishi52/SentimentSnap
cd SentimentSnappip install -r requirements.txtpython sentiment_api.pyThe API will be available at:
http://localhost:5000/predict
In a new terminal:
streamlit run sentiment_ui.pyInput:
The food was absolutely amazing and the service was top-notch!Output:
Sentiment: Positive ✅
This project is licensed under the MIT License. See the LICENSE file for details.
- 🛠️ NLTK – For text preprocessing
- 📚 Scikit-learn – For building ML models
- 🎨 Streamlit – For crafting an intuitive UI
- ⚙️ Flask – For building a lightweight API layer
🔗 Ready to bring insights out of text — one sentiment at a time!