Update README.md
Browse files
README.md
CHANGED
|
@@ -8,4 +8,50 @@ base_model:
|
|
| 8 |
- google/mobilebert-uncased
|
| 9 |
pipeline_tag: text-classification
|
| 10 |
library_name: transformers
|
| 11 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
- google/mobilebert-uncased
|
| 9 |
pipeline_tag: text-classification
|
| 10 |
library_name: transformers
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
#### Overview
|
| 15 |
+
|
| 16 |
+
Model trained from [mobileBert](https://huggingface.co/google/mobilebert-uncased) on the [go_emotions](https://huggingface.co/datasets/go_emotions) dataset for multi-label classification.
|
| 17 |
+
|
| 18 |
+
#### Dataset used for the model
|
| 19 |
+
|
| 20 |
+
[go_emotions](https://huggingface.co/datasets/go_emotions) is based on Reddit data and has 28 labels. It is a multi-label dataset where one or multiple labels may apply for any given input text, hence this model is a multi-label classification model with 28 'probability' float outputs for any given input text. Typically a threshold of 0.5 is applied to the probabilities for the prediction for each label.
|
| 21 |
+
|
| 22 |
+
#### How the model was created
|
| 23 |
+
|
| 24 |
+
The model was trained using `AutoModelForSequenceClassification.from_pretrained` with `problem_type="multi_label_classification"` for 3 epochs with a learning rate of 2e-5 and weight decay of 0.01.
|
| 25 |
+
|
| 26 |
+
#### Inference
|
| 27 |
+
|
| 28 |
+
There are multiple ways to use this model in Huggingface Transformers. Possibly the simplest is using a pipeline:
|
| 29 |
+
|
| 30 |
+
### 1. Install dependencies
|
| 31 |
+
|
| 32 |
+
```bash
|
| 33 |
+
pip install torch transformers
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
```python
|
| 38 |
+
from transformers import pipeline
|
| 39 |
+
classifier = pipeline(task="text-classification", model="AR04/Senti", top_k=None)
|
| 40 |
+
sentences = ["hi! u r looki beautiful today dear"]
|
| 41 |
+
model_outputs = classifier(sentences)
|
| 42 |
+
print(model_outputs[0])
|
| 43 |
+
# produces a list of dicts for each of the labels
|
| 44 |
+
|
| 45 |
+
[{'label': 'admiration', 'score': 0.9517803192138672}, {'label': 'love', 'score': 0.18317067623138428}, {'label': 'joy', 'score': 0.03131399303674698}, {'label': 'neutral', 'score': 0.01567094214260578}, {'label': 'surprise', 'score': 0.009232419542968273}, {'label': 'approval', 'score': 0.007308646105229855}, {'label': 'excitement', 'score': 0.006345656234771013}, {'label': 'pride', 'score': 0.004945244640111923}, {'label': 'caring', 'score': 0.0038624939043074846}, {'label': 'realization', 'score': 0.0023580112028867006}, {'label': 'desire', 'score': 0.0017759536858648062}, {'label': 'optimism', 'score': 0.0013220690889284015}, {'label': 'sadness', 'score': 0.001188945840112865}, {'label': 'disappointment', 'score': 0.0009136834414675832}, {'label': 'gratitude', 'score': 0.0008250900427810848}, {'label': 'relief', 'score': 0.0005154621903784573}, {'label': 'amusement', 'score': 0.0004376845608931035}, {'label': 'fear', 'score': 0.00038696840056218207}, {'label': 'embarrassment', 'score': 0.0003084330528508872}, {'label': 'grief', 'score': 0.00019462488126009703}, {'label': 'confusion', 'score': 0.00018893269589170814}, {'label': 'annoyance', 'score': 0.0001587819424457848}, {'label': 'curiosity', 'score': 0.0001355114800389856}, {'label': 'remorse', 'score': 0.00011744408402591944}, {'label': 'anger', 'score': 0.00010586195276118815}, {'label': 'disgust', 'score': 9.386352030560374e-05}, {'label': 'nervousness', 'score': 7.547048153355718e-05}, {'label': 'disapproval', 'score': 3.7117086321813986e-05}]
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
#### Evaluation / metrics
|
| 49 |
+
|
| 50 |
+
Here are the evaluation results of **Senti** on the GoEmotions validation set:
|
| 51 |
+
|
| 52 |
+
| Metric | Value |
|
| 53 |
+
|--------------|-------|
|
| 54 |
+
| Loss | 0.085 |
|
| 55 |
+
| F1-score | 0.586 |
|
| 56 |
+
| ROC AUC | 0.752 |
|
| 57 |
+
| Accuracy | 0.460 |
|