Skip to content

Repository files navigation

🎬 IMDB Movie Review Sentiment Analyzer

Python PyTorch Streamlit License: MIT


📌 Overview

The IMDB Sentiment Analyzer is an End-to-End Deep Learning Pipeline that classifies IMDB movie reviews into Positive or Negative sentiments.
It uses an LSTM neural network built in PyTorch and is deployed with an interactive Streamlit web app.

💡 Just enter any movie review, and the app will display:

  • Sentiment result (Positive/Negative)
  • Confidence score visualized as ⭐ star ratings

🔗 Live Demo

👉 Streamlit App


📽️ UI Preview


🚀 Features

  • 🧠 Deep Learning Model – LSTM trained from scratch
  • 🗃 IMDB Dataset (50K reviews)
  • 🎨 Streamlit UI with custom background & styled theme
  • Confidence visualization with star ratings
  • 📊 ~87% Accuracy on test dataset

🏗️ Architecture

  1. Data Preprocessing (cleaning, tokenization, encoding)
  2. Vocabulary Encoding
  3. Train/Test Split
  4. Model Training (LSTM)
  5. Save Trained Model (imdb_lstm_model.pth)
  6. Deploy using Streamlit

Model Summary:

  • Embedding Layer
  • LSTM Layer
  • Dropout (0.5)
  • Fully Connected Layer
  • Sigmoid Output

📂 Dataset

Dataset: IMDB 50K Movie Reviews

  • 25,000 labeled reviews for training
  • 25,000 labeled reviews for testing
  • Balanced Positive & Negative classes

🛠️ Tech Stack

  • Python 3.9+
  • PyTorch (Deep Learning)
  • Streamlit (Web UI)
  • Pandas, NumPy, Scikit-learn (Data Processing)

⚙️ Installation & Setup

1. Clone the Repository

git clone https://github.com/your-username/IMDB-Sentiment-Analyzer.git
cd IMDB-Sentiment-Analyzer

2. Create Virtual Environment & Install Dependencies

python -m venv venv
source venv/bin/activate   # On Mac/Linux
venv\Scripts\activate      # On Windows

pip install -r requirements.txt

3. Run Streamlit App

streamlit run app.py

📊 Results

  • Accuracy: ~87%
  • Confidence score visualization helps interpret predictions easily.

🔮 Future Enhancements

  • ✅ Add Transformer/BERT-based model for better accuracy
  • ✅ Deploy with Docker for scalability
  • ✅ Multi-language support

📜 License

This project is licensed under the MIT License – see the LICENSE file for details.


About

A deep learning project that uses an LSTM model trained on IMDB movie reviews to classify user-submitted text as Positive or Negative. The app is built with PyTorch and deployed using Streamlit, featuring a modern UI with a custom background, styled components, and star-based confidence visualization.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages