File size: 2,100 Bytes
5a5316a 46ce709 5a5316a 46ce709 30d5e95 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
---
license: apache-2.0
datasets:
- amazon_polarity
base_model: distilbert-base-uncased
model-index:
- name: distilbert-base-uncased-finetuned-emotion-balanced
results:
- task:
type: text-classification
name: Text Classification
dataset:
name: amazon_polarity
type: sentiment
args: default
metrics:
- type: accuracy
value: 0.958
name: Accuracy
- type: loss
value: 0.119
name: Loss
- type: f1
value: 0.957
name: F1
metrics:
- accuracy
- f1
---
# distilbert-sentiment
This model is a fine-tuned version of [distilbert-base-uncased](https://huggingface.co/distilbert-base-uncased) on a subset of the [amazon-polarity dataset](https://huggingface.co/datasets/amazon_polarity).
It achieves the following results on the evaluation set:
- Loss: 0.119
- Accuracy: 0.958
- F1_score: 0.957
## Model description
This sentiment classifier has been trained on 180_000 samples for the training set, 20_000 samples for the validation set and 20_000 samples for the test set.
## Intended uses & limitations
```python
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 classify emotions
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
| key | value |
| --- | ----- |
| eval_loss | 0.119 |
| eval_accuracy | 0.958 |
| eval_f1_score | 0.957 |
### Framework versions
- Transformers 4.34.0
- Pytorch lightning 2.0.9
- Tokenizers 0.13.3 |