A web app that predicts whether a movie review is Positive or Negative using machine learning models.
- 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
- Python π
- Scikit-learn for machine learning models π§
- Pandas for data handling π
- Joblib for saving/loading models πΎ
- Streamlit for frontend and web interface π
1. Clone the repository:
git clone https://github.com/dhivya-shreetha-s/sentiment-analysis2.Navigate to the project folder:
cd sentiment-analysis3.Install required packages:
pip install -r requirements.txt4.Run the training file to generate models (if not already saved):
python sentiment_classifier1.py5.Launch the Streamlit web app:
python -m streamlit run app.py6.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+