Downloads · 30 days
9
2% of all-time downloads
laxsvips/minilm-finetuned-emotion
minilm-finetuned-emotion is a text classification model from laxsvips. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
probably proofread and complete it, then remove this comment. --
Downloads · 30 days
9
2% of all-time downloads
All-time downloads
394
Public
Repo size
2.3 GB
Likes
0
Public
Click a slice to open those files.
.h5134 MB · 99%
From the Hugging Face model README
This model is a fine-tuned version of microsoft/MiniLM-L12-H384-uncased on the Hugging Face emotion (https://huggingface.co/datasets/emotion) dataset. It achieves the following results on the evaluation set:
MiniLM is a distilled model from the paper "MiniLM: Deep Self-Attention Distillation for Task-Agnostic Compression of Pre-Trained Transformers".
This model has been created as a learning guide on:
from transformers import pipeline
model_cpt = "laxsvips/minilm-finetuned-emotion"
pipe = pipeline("text-classification", model=model_cpt)
predicted_scores = pipe("I am so glad you could help me")
print(predicted_scores)
The results:
[[{'label': 'sadness', 'score': 0.003758953418582678},
{'label': 'joy', 'score': 0.9874302744865417},
{'label': 'love', 'score': 0.00610917154699564},
{'label': 'anger', 'score': 9.696640336187556e-05},
{'label': 'fear', 'score': 0.0006420552381314337},
{'label': 'surprise', 'score': 0.00196251692250371}]]
Emotion is a dataset of English Twitter messages with six basic emotions: anger, fear, joy, love, sadness, and surprise.
Refer to the Colab notebook
The following hyperparameters were used during training:
| Train Loss | Train Accuracy | Validation Loss | Validation Accuracy | Epoch |
|---|---|---|---|---|
| 0.9485 | 0.5543 | 0.8404 | 0.6870 | 0 |
| 0.4192 | 0.8347 | 0.3450 | 0.9040 | 1 |
| 0.2132 | 0.9178 | 0.2288 | 0.9240 | 2 |
| 0.1465 | 0.9364 | 0.1838 | 0.9295 | 3 |
| 0.1168 | 0.9446 | 0.1709 | 0.9350 | 4 |
{'accuracy': 0.935,
'precision': 0.937365614416424,
'recall': 0.935,
'f1_score': 0.9355424419858925}