--- license: mit datasets: - imdb language: - en tags: - sentiment-analysis - lstm - movie-reviews - pytorch model-index: - name: IMDB-BiLSTM-Sentiment results: - task: type: sentiment-analysis name: Binary Sentiment Classification dataset: type: imdb name: IMDB Large Movie Review Dataset metrics: - name: Accuracy type: accuracy value: 0.8651 - name: F1 type: f1 value: 0.8635 - name: AUC type: auc value: 0.9299 --- # ๐ŸŽฌ 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 ```python # 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](https://huggingface.co/badges/space-gradio.svg)](https://huggingface.co/spaces/ecroatt/imdb-bilstm-demo)