stanfordnlp/imdb
Viewer • Updated • 100k • 180k • 938
How to use ousmane93/finetuning-sentiment-model-3000-samples with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="ousmane93/finetuning-sentiment-model-3000-samples") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("ousmane93/finetuning-sentiment-model-3000-samples")
model = AutoModelForSequenceClassification.from_pretrained("ousmane93/finetuning-sentiment-model-3000-samples", device_map="auto")This model is a fine-tuned version of distilbert-base-uncased on a 3,000-example subset of the IMDB dataset for binary sentiment classification (positive / negative movie reviews).
DistilBERT is a smaller, faster, and cheaper version of BERT. This model adds a sequence
classification head (2 labels) on top of distilbert-base-uncased and fine-tunes it for
sentiment analysis.
LABEL_0 = Negative, LABEL_1 = PositiveThe model was trained on a shuffled subset of the IMDB dataset (seed=42):
The following hyperparameters were used during training:
On the 300-example evaluation set, the model achieves:
| Metric | Value |
|---|---|
| Loss | 0.3321 |
| Accuracy | 0.8700 |
| F1 | 0.8713 |
from transformers import pipeline
sentiment_model = pipeline(
model="ousmane93/finetuning-sentiment-model-3000-samples"
)
sentiment_model(["I love this movie", "This movie sucks!"])
Base model
distilbert/distilbert-base-uncased