🎬 IMDB Bi-LSTM Sentiment Classifier

Predicts whether a movie review is positive (πŸ‘) or negative (πŸ‘Ž) using a compact bidirectional LSTM built in PyTorch.

Detail Value
Sequence length cap 500 tokens
Vocabulary size 5 000 word stems
Embedding dim 256
LSTM 2 layers Β· 256 hidden Β· bidirectional
Parameters ~6 M
Validation accuracy 0.8651
Test AUC 0.9299

Quick start

# pip install huggingface_hub torch nltk

from huggingface_hub import hf_hub_download
from inference import predict   # ships with the repo files

hf_hub_download("ecroatt/imdb-bilstm-sentiment", "pytorch_model.bin")

print(predict("Terrific cast and a heart-warming story!"))
# 0.96  ->  positive

print(predict("I was bored out of my mind; worst sequel ever."))
# 0.04  ->  negative

Gradio demo

Downloads last month
29
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Dataset used to train ecroatt/imdb-bilstm-sentiment

Space using ecroatt/imdb-bilstm-sentiment 1

Evaluation results