stanfordnlp/imdb
Viewer β’ Updated β’ 100k β’ 177k β’ 472
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 |
# 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