Downloads · 30 days
7
16% of all-time downloads
ecroatt/imdb-bilstm-sentiment
imdb-bilstm-sentiment is a machine learning model from ecroatt. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
Predicts whether a movie review is positive (👍) or negative (👎) using a compact bidirectional LSTM built in PyTorch.
Downloads · 30 days
7
16% of all-time downloads
All-time downloads
43
Public
Repo size
15.7 MB
Likes
0
Public
Click a slice to open those files.
.bin15.6 MB · 100%
From the Hugging Face model README
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