Skip to content

This is a simple machine learning project that classifies movie reviews as positive or negative using natural language processing (NLP). It’s built for beginners to understand the complete ML workflow - from data loading and preprocessing to model training, evaluation, and prediction - all in one Python script.

Notifications You must be signed in to change notification settings

aozoragh/text-sentiment-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

🎬 Movie Review Sentiment Classifier (Beginner ML Project)

This is a simple machine learning project that classifies movie reviews as positive or negative using natural language processing (NLP). It’s built for beginners to understand the complete ML workflow — from data loading and preprocessing to model training, evaluation, and prediction — all in one Python script.

🔍 Key Features

  • Uses the NLTK Movie Reviews dataset (no external downloads needed)
  • Converts text to numerical features using TF-IDF vectorization
  • Trains a Logistic Regression classifier to predict sentiment
  • Displays accuracy and classification report
  • Allows custom review predictions directly from the terminal

🧠 Tech Stack

  • Python 3
  • NLTK for dataset & tokenization
  • Scikit-learn for ML model & evaluation
  • NumPy / Pandas / Matplotlib (optional for future visualization)

⚙️ How It Works

  1. Load and shuffle labeled movie reviews from NLTK
  2. Convert raw text into TF-IDF vectors
  3. Train a Logistic Regression model on 80% of data
  4. Evaluate accuracy on the remaining 20%
  5. Predict sentiment for new review text inputs

🚀 Usage

py main.py

📈 Accuracy

~80–85% on the NLTK Movie Reviews dataset — great for a baseline sentiment classifier.

About

This is a simple machine learning project that classifies movie reviews as positive or negative using natural language processing (NLP). It’s built for beginners to understand the complete ML workflow - from data loading and preprocessing to model training, evaluation, and prediction - all in one Python script.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages