File size: 1,109 Bytes
6785e3f 73a3bcb 6785e3f 73a3bcb 6785e3f 73a3bcb 6785e3f 73a3bcb 6785e3f 73a3bcb 6785e3f 73a3bcb 6785e3f 73a3bcb 6785e3f 73a3bcb 6785e3f 73a3bcb |
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 |
---
library_name: transformers
tags: []
---
#### Overview
A DistilBERT trained model for sentence sentiment classification.
Classifies sentences into 6 emotions - sadness, joy, love, anger, fear, surprise.
#### Dataset used for model
Model trained on [Emotions Dataset](https://www.kaggle.com/datasets/nelgiriyewithana/emotions), which is based on English Twitter messages and has 6 labels.
#### How the model was created
The model was trained using `DistilBertForSequenceClassification.from_pretrained` with `problem_type="single_label_classification"` for 10 epochs with a learning rate of 5e-5 and weight decay of 0.01.
#### Inference
```python
from transformers import pipeline
classifier = pipeline("text-classification", model="entfane/distilbert-emotion-recognition")
text_to_predict = ["I hate going there, it is so boring", "That's so wonderful!"]
result = classifier(text_to_predict)
print(result) # contains a list of dictionaries (one for each output)
```
#### Summary
Evaluation of output using dataset test split gives:
- Accuracy: 0.942
- Precision: 0.950
- Recall: 0.942
- F1: 0.942
|