Skip to content

sai-jagdale/Sentiment_Analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 Sentiment Analyzer Web App

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.

πŸ’‘ Features

  • 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 🧠

πŸ“¦ Project Structure

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

🧠 Model Info

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

πŸš€ How to Run the Project

1. Clone the repository

git clone https://github.com/your-username/sentiment-analyzer.git
cd sentiment-analyzer

2. Install dependencies

pip install -r requirements.txt

3. (Optional) Train the model if not already done

# Open Jupyter Notebook and run all cells to train the model
jupyter notebook model/train_model.ipynb

4. Start the Flask app

python app.py

βœ… Go to your browser and open: http://127.0.0.1:5000/

πŸ“¦ Dependencies

Flask scikit-learn pandas joblib nltk notebook

πŸ“š Dataset Used

Twitter sentiment dataset (twitter_training.csv and twitter_validation.csv) - From Kaggle

About

A web-based Sentiment Analyzer that classifies text as Positive πŸ’š, Negative 😑, or Neutral 😐 using a machine learning model trained on Twitter data. Built with Flask, scikit-learn, and NLTK, it features a clean UI, emoji-based results, and error handling.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors