A machine learning project that classifies movie reviews as positive or negative using Natural Language Processing (NLP) and Logistic Regression.
Manually reading thousands of reviews to understand audience sentiment is impractical. This project automates sentiment detection, which streaming platforms like Netflix and Prime Video use to understand user taste profiles and improve recommendations.
- IMDB Dataset of 50K Movie Reviews from Kaggle
- 50,000 movie reviews labeled as positive or negative
- Python 3
- pandas — data loading and manipulation
- scikit-learn — machine learning and text vectorization
- TfidfVectorizer — converts text to numerical features
- Logistic Regression — classification algorithm
- Load and clean the dataset
- Convert sentiment labels to numbers (positive = 1, negative = 0)
- Convert review text to numerical vectors using TF-IDF
- Train a Logistic Regression model on 80% of the data
- Test on the remaining 20% and measure accuracy
Accuracy: 89.14% on test data.
- Clone this repository
- Install dependencies: pip install -r requirements.txt
- Place IMDB Dataset.csv in the project folder
- Run: python sentiment_analysis.py
sentiment-analysis/ ├── sentiment_analysis.py ├── IMDB Dataset.csv ├── requirements.txt └── README.md