Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎭 Sentiment Analysis on Movie Reviews

This project is a deep learning-based sentiment analysis tool that classifies movie reviews as positive or negative. Built using Python, Keras (TensorFlow backend), and Streamlit for the interactive frontend.


📌 Project Description

This app uses a pre-trained LSTM (Long Short-Term Memory) neural network to detect the sentiment of a movie review. Users can input any review, and the model will predict whether it's positive or negative.

The dataset used is the IMDB Dataset of 50K Movie Reviews, obtained via the Kaggle API.


🚀 Features

  • Interactive web UI built with Streamlit
  • Trained LSTM model for sentiment prediction
  • Live prediction of user input reviews
  • Preprocessing using Keras Tokenizer and Padding
  • Easily deployable on Streamlit Cloud

🧠 Tech Stack

  • Python 3
  • TensorFlow / Keras
  • Pandas
  • Scikit-learn
  • Streamlit
  • IMDB Dataset (via Kaggle)

📂 Folder Structure

 📁 Project Root 
  ├── app.py # Main Streamlit app 
  ├── sentiment_model.h5 # Trained LSTM model 
  ├── tokenizer.pickle # Fitted tokenizer for preprocessing 
  ├── README.md 
  └── requirements.txt # Python dependencies 

📥 Installation & Running Locally

git clone https://github.com/SUJAY-HK/Sentiment-Analysis-Streamlit.git
cd  Sentiment-Analysis-Streamlit

# (optional) create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

pip install -r requirements.txt

# Run the app
streamlit run app.py

🧪 How It Works

  • The user enters a movie review through the Streamlit web app.
  • The input text is:
    • Tokenized using a fitted tokenizer
    • Padded to a fixed sequence length
  • The processed text is fed into a trained LSTM model.
  • The model outputs a probability score.
  • This score is mapped to:
    • Positive sentiment (if probability > 0.5)
    • Negative sentiment (if probability ≤ 0.5)

🔗 Dataset

About

A simple web-based Sentiment Analysis App built using Streamlit and a trained LSTM model. It predicts the sentiment (positive or negative) of movie reviews based on user input. The model is trained on the IMDB dataset and uses tokenization and padding for preprocessing.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages