A simple, clean NLP + Machine Learning project based on the provided SRS.
The system classifies English reviews as Positive or Negative.
Pipeline:
IMDB dataset -> cleaning -> NLP preprocessing -> TF-IDF -> Logistic Regression + Linear SVM -> evaluation -> Streamlit prediction
The project intentionally avoids unnecessary complexity.
- Logistic Regression - baseline model
- Linear SVM (LinearSVC) - improved model
The best model is selected using test F1-score.
sentiment_analysis_project/
├── app.py
├── train.py
├── predict.py
├── evaluate.py
├── requirements.txt
├── README.md
├── data/
│ └── .gitkeep
└── models/
└── .gitkeep
Windows:
python -m venv .venv
.venv\Scripts\activatepip install -r requirements.txtpython train.pyThe first run downloads the IMDB dataset through Hugging Face Datasets and saves a local CSV copy in data/.
The trained model is saved in models/.
python evaluate.pystreamlit run app.pyRaw reviews
↓
Cleaning
↓
NLP preprocessing
↓
TF-IDF
↓
Logistic Regression + Linear SVM
↓
Compare metrics
↓
Save best model
↓
Streamlit prediction
- IMDB is a labelled movie-review dataset.
- The original train/test split is preserved.
- The text cleaning is deliberately simple and readable.
- No paid GPU is required.