A Streamlit-based web application that analyzes movie review sentiments using two different models:
- Logistic Regression (TF-IDF)
- LSTM (Deep Learning)
This project demonstrates how to build and deploy a sentiment analysis web app with two NLP models.
Users can enter any movie review text and instantly get a positive or negative prediction.
sentiment-analysis-app/ │ ├── app.py # Streamlit web app ├── train_models.ipynb # Jupyter notebook for training models ├── requirements.txt # Dependencies ├── model_logistic.pkl # Logistic Regression model ├── tfidf_vectorizer.pkl # TF-IDF vectorizer ├── model_lstm.h5 # LSTM neural network model ├── tokenizer.pkl # Tokenizer for LSTM └── README.md # Documentation
- streamlit
- pandas
- numpy
- tensorflow
- nltk
- scikit-learn
- keras
- transformers
- torch
Install all dependencies: pip install -r requirements.txt
🚀 Run the App
Activate your virtual environment (optional) and run:
streamlit run app.py
To retrain or modify the models, open the notebook:
sentiment_analysis.ipynb This notebook includes all steps for:
Text preprocessing
Logistic Regression (TF-IDF)
LSTM model training
Saving model files for deployment