stanfordnlp/imdb
Viewer • Updated • 100k • 152k • 551
Run rahulk05/imdb-lstm-attention on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Use HF Jobs to fine-tune https://huggingface.co/rahulk05/imdb-lstm-attention. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Use HF Jobs to run batch inference with https://huggingface.co/rahulk05/imdb-lstm-attention on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
How to use rahulk05/imdb-lstm-attention with Keras:
# !pip install -U keras tensorflow huggingface_hub
# Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here;
# "jax" and "torch" also work for computation once TensorFlow is installed.
import os
os.environ["KERAS_BACKEND"] = "tensorflow"
import keras
model = keras.saving.load_model("hf://rahulk05/imdb-lstm-attention")
Three recurrent sentiment classifiers trained on the official 25,000-review IMDB training split (Maas et al., 2011) and tested on the 25,000 test reviews of other movies. Code: https://github.com/rahulrvu-24/imdb-lstm-attention
| Model | Test accuracy (%, mean ± std over seeds) |
|---|---|
| LSTM | 88.17 ± 0.82 |
| BiLSTM | 88.06 ± 0.84 |
| BiLSTM-Attention | 90.18 ± 0.49 |
| TF-IDF + LogReg | 90.54 |
| BiLSTM-Attention + TF-IDF | 91.38 ± 0.18 |
<arch>.weights.h5 (Keras 3), vocab.json, baseline_vocab.json +
baseline_arrays.npz (TF-IDF + logistic regression as plain arrays), config.json,
examples.json (robustness pairs).Limitations. English movie reviews only; the training labels are polar (ratings 1-4 and 7-10), so mixed reviews have no training examples; accuracy drops on reviews edited to flip their sentiment (see the repository's report).