Skip to content

Repository files navigation

🎬 Movie Sentiment Analyzer

A web app that predicts whether a movie review is Positive or Negative using machine learning models.


✨ Features

  • Predicts sentiment of movie reviews using Logistic Regression and Naive Bayes
  • Shows confidence scores for each prediction
  • Provides tips for writing better reviews
  • Modern Streamlit web interface with a sidebar
  • User-friendly and interactive UI

πŸ› οΈ Technologies Used

  • Python 🐍
  • Scikit-learn for machine learning models 🧠
  • Pandas for data handling πŸ“Š
  • Joblib for saving/loading models πŸ’Ύ
  • Streamlit for frontend and web interface 🌐

πŸš€ Usage

1. Clone the repository:

git clone https://github.com/dhivya-shreetha-s/sentiment-analysis

2.Navigate to the project folder:

cd sentiment-analysis

3.Install required packages:

pip install -r requirements.txt

4.Run the training file to generate models (if not already saved):

python sentiment_classifier1.py

5.Launch the Streamlit web app:

python -m streamlit run app.py

6.Open the URL in your browser and enter movie reviews to get sentiment predictions.

πŸ“‚File Structure

sentiment-analysis/
β”‚
β”œβ”€ app.py                     # Streamlit frontend
β”œβ”€ sentiment_classifier1.py   # Model training script
β”œβ”€ IMDB_Dataset.csv           # Dataset used for training
β”œβ”€ tfidf_vectorizer.pkl       # Saved vectorizer
β”œβ”€ logistic_model.pkl         # Saved Logistic Regression model
β”œβ”€ naive_bayes_model.pkl      # Saved Naive Bayes model
β”œβ”€ requirements.txt           # Required Python packages
└─ README.md                  # Project documentation

πŸ“ Notes

1.Make sure to run the training script first to generate the .pkl files if they are not present

2.Works best with clear and descriptive reviews

3.Sidebar provides instructions and information for easy navigation

4.Compatible with Python 3.10+

About

🎬 Movie Sentiment Analyzer is a Python web app that predicts whether a movie review is Positive πŸ‘ or Negative πŸ‘Ž using Logistic Regression and Naive Bayes. Built with Streamlit 🌐, it offers an interactive interface to enter reviews and get instant sentiment predictions πŸ§ πŸ“Š.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages