A simple NLP project that uses a trained machine learning model to predict the sentiment of user input text (positive, negative, neutral) using Flask and Tailwind CSS.
- Takes user input in a web form
- Predicts sentiment using a trained ML model
- Shows emoji-based feedback and explanation
- Clean Tailwind CSS interface
- Works with browser favicon using emoji π§
Sentiment_Analyzer/ β βββ data/ β βββ twitter_training.csv β βββ twitter_validation.csv β βββ model/ β βββ label_encoder.pkl β βββ sentiment_model.pkl β βββ vectorizer.pkl β βββ train_model.ipynb β βββ templates/ β βββ index.html # Frontend UI β βββ Screenshots/ β βββ Preview1.png β βββ Preview2.png β βββ Preview3.png β βββ Preview4.png β βββ app.py # Flask backend βββ requirements.txt βββ README.md
The model was trained on a Twitter sentiment dataset using TF-IDF vectorization + Logistic Regression classifier.
##π οΈ Technologies Used
- Python β Programming language used for backend and model training
- Flask β Lightweight web framework for building the application interface
- NLTK β Natural Language Toolkit for text preprocessing and cleaning
- Scikit-learn β For building and training the sentiment classification model
- Pandas β Handling and processing dataset (CSV files)
- Joblib β Saving and loading trained ML models and vectorizers
- Tailwind CSS β For modern, responsive frontend styling (via CDN)
- HTML5 β Markup language for frontend UI
- Jupyter Notebook β For training and experimenting with the model
git clone https://github.com/your-username/sentiment-analyzer.git
cd sentiment-analyzerpip install -r requirements.txt# Open Jupyter Notebook and run all cells to train the model
jupyter notebook model/train_model.ipynbpython app.pyβ Go to your browser and open: http://127.0.0.1:5000/
Flask scikit-learn pandas joblib nltk notebook
Twitter sentiment dataset (twitter_training.csv and twitter_validation.csv) - From Kaggle