Downloads · 30 days
9
1% of all-time downloads
amir7d0/distilbert-base-uncased-finetuned-amazon-reviews
distilbert-base-uncased-finetuned-amazon-reviews is a text classification model from amir7d0. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
- Model Card for distilbert-base-uncased-finetuned-amazon-reviews - Table of Contents - Model Details - Uses - Fine-tuning hyperparameters - Evaluation - Framework versions
Downloads · 30 days
9
1% of all-time downloads
All-time downloads
824
Public
Repo size
1.3 GB
Likes
0
Public
Click a slice to open those files.
.h5268 MB · 50%
From the Hugging Face model README
This model is a fine-tuned version of distilbert-base-uncased on amazon_reviews_multi dataset. This model reaches an accuracy of xxx on the dev set.
You can use this model directly with a pipeline for text classification.
from transformers import pipeline
checkpoint = "amir7d0/distilbert-base-uncased-finetuned-amazon-reviews"
classifier = pipeline("text-classification", model=checkpoint)
classifier(["Replace me by any text you'd like."])
and in TensorFlow:
from transformers import AutoTokenizer, TFAutoModelForSequenceClassification
checkpoint = "amir7d0/distilbert-base-uncased-finetuned-amazon-reviews"
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
model = TFAutoModelForSequenceClassification.from_pretrained(checkpoint)
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='tf')
output = model(encoded_input)
Here is the raw dataset (amazon_reviews_multi) we used for finetuning the model. The dataset contains 200,000, 5,000, and 5,000 reviews in the training, dev, and test sets respectively.
The following hyperparameters were used during training:
The fine-tuned model was evaluated on the test set of amazon_reviews_multi.
| Split | Accuracy (exact) | Accuracy (off-by-1) |
|---|---|---|
| Dev set | 56.96% | 85.50% |
| Test set | 57.36% | 85.58% |