Instructions to use sangatbaloch/imdb-encoder-finetuned with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sangatbaloch/imdb-encoder-finetuned with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="sangatbaloch/imdb-encoder-finetuned")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("sangatbaloch/imdb-encoder-finetuned") model = AutoModelForSequenceClassification.from_pretrained("sangatbaloch/imdb-encoder-finetuned", device_map="auto") - Notebooks
- Google Colab
- Kaggle
IMDb encoder sentiment classifier
Base: distilbert/distilbert-base-uncased. Bidirectional encoder with a fine-tuned classification head. Labels: negative=0, positive=1. Both models use the same stratified IMDb subsets: 4000 train, 1000 validation, 1000 official test. Seed 42, 2 epochs, learning rate 2e-5, weight decay .01, effective batch 16, max length 256. Best validation F1 selects checkpoint. Test data never selects checkpoints.
Measured held-out test results
{ "test_loss": 0.2693862318992615, "test_accuracy": 0.899, "test_precision": 0.911340206185567, "test_recall": 0.884, "test_f1": 0.8974619289340101, "test_runtime": 2.5526, "test_samples_per_second": 391.753, "test_steps_per_second": 48.969, "confusion_matrix": [ [ 457, 43 ], [ 58, 442 ] ], "parameter_count": 66955010 } Confusion matrix rows=true, columns=predicted, label order negative then positive. Precision/recall/F1 use positive class.
Limitations
Educational subset experiment, not full IMDb benchmark. English movie reviews only. Sarcasm, domain shift and truncation can cause errors. Confidence is uncalibrated.
- Downloads last month
- 22
Model tree for sangatbaloch/imdb-encoder-finetuned
Base model
distilbert/distilbert-base-uncased