Run this model with HF Jobs
Run AdamCodd/distilbert-base-uncased-finetuned-sentiment-amazon on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/AdamCodd/distilbert-base-uncased-finetuned-sentiment-amazon. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/AdamCodd/distilbert-base-uncased-finetuned-sentiment-amazon on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use AdamCodd/distilbert-base-uncased-finetuned-sentiment-amazon with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AdamCodd/distilbert-base-uncased-finetuned-sentiment-amazon with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="AdamCodd/distilbert-base-uncased-finetuned-sentiment-amazon")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("AdamCodd/distilbert-base-uncased-finetuned-sentiment-amazon") model = AutoModelForSequenceClassification.from_pretrained("AdamCodd/distilbert-base-uncased-finetuned-sentiment-amazon", device_map="auto") - Notebooks
- Google Colab
- Kaggle
distilbert-sentiment
This model is a fine-tuned version of distilbert-base-uncased on a subset of the amazon-polarity dataset.
[Update 10/10/23] The model has been retrained on a larger part of the dataset with an improvement on the loss, f1 score and accuracy. It achieves the following results on the evaluation set:
- Loss: 0.116
- Accuracy: 0.961
- F1_score: 0.960
Model description
This sentiment classifier has been trained on 360_000 samples for the training set, 40_000 samples for the validation set and 40_000 samples for the test set.
Intended uses & limitations
from transformers import pipeline
# Create the pipeline
sentiment_classifier = pipeline('text-classification', model='AdamCodd/distilbert-base-uncased-finetuned-sentiment-amazon')
# Now you can use the pipeline to get the sentiment
result = sentiment_classifier("This product doesn't fit me at all.")
print(result)
#[{'label': 'negative', 'score': 0.9994848966598511}]
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 3e-05
- train_batch_size: 32
- eval_batch_size: 32
- seed: 1270
- optimizer: AdamW with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- lr_scheduler_warmup_steps: 150
- num_epochs: 2
- weight_decay: 0.01
Training results
(Previous results before retraining from the model evaluator)
| key | value |
|---|---|
| eval_accuracy | 0.94112 |
| eval_auc | 0.9849 |
| eval_f1_score | 0.9417 |
| eval_precision | 0.9321 |
| eval_recall | 0.95149 |
Framework versions
- Transformers 4.34.0
- Pytorch lightning 2.0.9
- Tokenizers 0.14.0
If you want to support me, you can here.
- Downloads last month
- 133
Model tree for AdamCodd/distilbert-base-uncased-finetuned-sentiment-amazon
Dataset used to train AdamCodd/distilbert-base-uncased-finetuned-sentiment-amazon
Space using AdamCodd/distilbert-base-uncased-finetuned-sentiment-amazon 1
Collection including AdamCodd/distilbert-base-uncased-finetuned-sentiment-amazon
Evaluation results
- Accuracy on amazon_polarityself-reported0.961
- Loss on amazon_polarityself-reported0.116
- F1 on amazon_polarityself-reported0.960
- Accuracy on amazon_polaritytest set verified0.941
- Precision on amazon_polaritytest set verified0.932
- Recall on amazon_polaritytest set verified0.951
- AUC on amazon_polaritytest set verified0.985
- F1 on amazon_polaritytest set verified0.942