Text Classification
Transformers
Safetensors
English
distilbert
sentiment-analysis
imdb
text-embeddings-inference
Instructions to use bolewara/imdb-sentiment-distilbert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bolewara/imdb-sentiment-distilbert with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="bolewara/imdb-sentiment-distilbert")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("bolewara/imdb-sentiment-distilbert") model = AutoModelForSequenceClassification.from_pretrained("bolewara/imdb-sentiment-distilbert", device_map="auto") - Notebooks
- Google Colab
- Kaggle
IMDB Sentiment Classifier (DistilBERT fine-tuned)
DistilBERT-base-uncased fine-tuned for binary sentiment classification (positive/negative movie reviews). A genuine transformer fine-tune performed locally on a 1,500-review IMDB subsample.
Model Characteristics
- Base model:
distilbert-base-uncased(Hugging Face) - Task: Binary sequence classification
- Eval loss: 0.0005 (after early stopping on epoch 2)
- Training: 2 epochs, lr 2e-5, batch 8, warmup 50 steps
Data Overview
- Dataset:
stanfordnlp/imdb(subsampled to 1,500 train / 300 test for CPU feasibility) - Text truncated/padded to 128 tokens
Evaluation Results
- Eval loss: 0.000518
- Early stopping triggered at epoch 2 of 3
Files
model.safetensorsโ fine-tuned weightsconfig.jsonโ model config (2 labels)tokenizer.json,tokenizer_config.jsonโ tokenizereval_metrics.txtโ final evaluation metrics
Usage
from transformers import AutoModelForSequenceClassification, AutoTokenizer
model = AutoModelForSequenceClassification.from_pretrained("bolewara/imdb-sentiment-distilbert")
tokenizer = AutoTokenizer.from_pretrained("bolewara/imdb-sentiment-distilbert")
Writeup
A full case study is in the accompanying writeup (also published on Kaggle): Fine-Tuning DistilBERT for Movie Review Sentiment Analysis.
Provenance
Fine-tuned by Anuj Bolewar (anujbolewar on Kaggle) from distilbert-base-uncased on stanfordnlp/imdb.
- Downloads last month
- 10
Model tree for bolewara/imdb-sentiment-distilbert
Base model
distilbert/distilbert-base-uncased