model_name: IMDb Movie Sentiment Classifier
version: 1.0.0
license: MIT
architecture: CNN (Convolutional Neural Network)
framework: TensorFlow / Keras
language: English
tags:
sentiment-analysis
binary-classification
deep-learning
movie-reviews
keras
streamlit-app
tensorboard
description: |
A convolutional neural network (CNN) based sentiment analysis model trained on the Stanford IMDb (aclImdb) dataset.
The model classifies movie reviews as either positive or negative. It is integrated with a Streamlit app for real-time predictions,
and logs training metrics using TensorBoard.
datasets:
name: Stanford IMDb (aclImdb)
source: https://ai.stanford.edu/~amaas/data/sentiment/
size: 50,000 reviews (25,000 positive, 25,000 negative)
split:
train: 80%
validation: 20%
preprocessing:
- Lowercasing
- HTML tag removal
- Punctuation and extra space stripping
- Tokenization and padding to 500 words max
The model underperforms on class 0 (negative sentiment), with low recall.
CNNs do not capture long-range dependencies well; consider using BiLSTM or transformer-based models (e.g. BERT).
Performance may degrade on noisy or sarcastic text.
usage: |
Load models/imdb_cnn_model.h5 and tokenizer.pkl to predict sentiment of new reviews.
The Streamlit app in app/app.py provides a web interface.
To run:
streamlit run app/app.py
This project uses a Convolutional Neural Network (CNN) to classify movie reviews from the Stanford IMDb Dataset (aclImdb) as positive or negative. The application includes:
✅ TensorFlow + Keras model
✅ Streamlit interface for real-time prediction
✅ TensorBoard for training monitoring
✅ Cleaned and preprocessed text data
✅ Class-weighted training to improve recall
📦 Project Structure
bash
1MovieSentimentAnalysis/
2├── app/ # Streamlit app3│ └── app.py
4├── data/ # Preprocessed CSVs5│ └── imdb_train.csv
6├── logs/ # TensorBoard logs7├── models/ # Saved model + tokenizer8│ ├── imdb_cnn_model.h5
9│ └── tokenizer.pkl
10├── train.py # Model training script11├── evaluate.py # Evaluation script (confusion matrix, metrics)12├── requirements.txt
13├── README.md
14└── modelcard.yaml # Metadata about the model