stanfordnlp/imdb
Viewer β’ Updated β’ 100k β’ 189k β’ 371
How to use Kapilydv6/my-first-sentiment-model with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="Kapilydv6/my-first-sentiment-model") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("Kapilydv6/my-first-sentiment-model")
model = AutoModelForSequenceClassification.from_pretrained("Kapilydv6/my-first-sentiment-model")A fine-tuned DistilBERT model for classifying movie reviews as POSITIVE or NEGATIVE.
from transformers import pipeline
classifier = pipeline("sentiment-analysis", model="Kapilydv6/my-first-sentiment-model")
result = classifier("This movie was amazing!")
print(result)
# [{'label': 'POSITIVE', 'score': 0.99}]
This is a beginner project trained on a small subset of IMDB reviews. For production use, train on the full dataset with more epochs.
These warnings are normal and expected:
UNEXPECTED keys (vocab layers)
MISSING keys (classifier, pre_classifier)
| Epoch | Train Loss | Eval Accuracy | Eval F1 |
|---|---|---|---|
| 1 | ~0.51 | 85.0% | 84.96% |
| 2 | ~0.26 | 86.6% | 86.55% |
| 3 | ~0.16 | 87.4% | 87.39% |
β
Loss decreased (0.60 β 0.15) β Model is learning
β
Accuracy increased each epoch β Model is improving
β
Best model (Epoch 3) was automatically selected and saved
| Review | Prediction | Confidence |
|---|---|---|
| "Absolutely fantastic!" | POSITIVE | 97.9% |
| "Terrible waste of time" | NEGATIVE | 96.7% |
| "It was okay, nothing special" | NEGATIVE | 75.3% |
π‘ Insight:
Symlinks warning
LayerNorm gamma/beta β weight/bias