Initial upload of go_emotions
Browse files- README.md +23 -0
- config.json +83 -0
- onnx/model.onnx +3 -0
- onnx/model_quantized.onnx +3 -0
- quantize_config.json +35 -0
- special_tokens_map.json +7 -0
- tokenizer.json +0 -0
- tokenizer_config.json +15 -0
- vocab.txt +0 -0
README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
[joeddav/distilbert-base-uncased-go-emotions-student](https://huggingface.co/joeddav/distilbert-base-uncased-go-emotions-student) converted to ONNX and quantized using optimum.
|
| 6 |
+
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
# distilbert-base-uncased-go-emotions-student
|
| 10 |
+
|
| 11 |
+
## Model Description
|
| 12 |
+
|
| 13 |
+
This model is distilled from the zero-shot classification pipeline on the unlabeled GoEmotions dataset using [this
|
| 14 |
+
script](https://github.com/huggingface/transformers/tree/master/examples/research_projects/zero-shot-distillation).
|
| 15 |
+
It was trained with mixed precision for 10 epochs and otherwise used the default script arguments.
|
| 16 |
+
|
| 17 |
+
## Intended Usage
|
| 18 |
+
|
| 19 |
+
The model can be used like any other model trained on GoEmotions, but will likely not perform as well as a model
|
| 20 |
+
trained with full supervision. It is primarily intended as a demo of how an expensive NLI-based zero-shot model
|
| 21 |
+
can be distilled to a more efficient student, allowing a classifier to be trained with only unlabeled data. Note
|
| 22 |
+
that although the GoEmotions dataset allow multiple labels per instance, the teacher used single-label
|
| 23 |
+
classification to create psuedo-labels.
|
config.json
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "joeddav/distilbert-base-uncased-go-emotions-student",
|
| 3 |
+
"activation": "gelu",
|
| 4 |
+
"architectures": [
|
| 5 |
+
"DistilBertForSequenceClassification"
|
| 6 |
+
],
|
| 7 |
+
"attention_dropout": 0.1,
|
| 8 |
+
"dim": 768,
|
| 9 |
+
"dropout": 0.1,
|
| 10 |
+
"hidden_dim": 3072,
|
| 11 |
+
"id2label": {
|
| 12 |
+
"0": "admiration",
|
| 13 |
+
"1": "amusement",
|
| 14 |
+
"2": "anger",
|
| 15 |
+
"3": "annoyance",
|
| 16 |
+
"4": "approval",
|
| 17 |
+
"5": "caring",
|
| 18 |
+
"6": "confusion",
|
| 19 |
+
"7": "curiosity",
|
| 20 |
+
"8": "desire",
|
| 21 |
+
"9": "disappointment",
|
| 22 |
+
"10": "disapproval",
|
| 23 |
+
"11": "disgust",
|
| 24 |
+
"12": "embarrassment",
|
| 25 |
+
"13": "excitement",
|
| 26 |
+
"14": "fear",
|
| 27 |
+
"15": "gratitude",
|
| 28 |
+
"16": "grief",
|
| 29 |
+
"17": "joy",
|
| 30 |
+
"18": "love",
|
| 31 |
+
"19": "nervousness",
|
| 32 |
+
"20": "optimism",
|
| 33 |
+
"21": "pride",
|
| 34 |
+
"22": "realization",
|
| 35 |
+
"23": "relief",
|
| 36 |
+
"24": "remorse",
|
| 37 |
+
"25": "sadness",
|
| 38 |
+
"26": "surprise",
|
| 39 |
+
"27": "neutral"
|
| 40 |
+
},
|
| 41 |
+
"initializer_range": 0.02,
|
| 42 |
+
"label2id": {
|
| 43 |
+
"admiration": 0,
|
| 44 |
+
"amusement": 1,
|
| 45 |
+
"anger": 2,
|
| 46 |
+
"annoyance": 3,
|
| 47 |
+
"approval": 4,
|
| 48 |
+
"caring": 5,
|
| 49 |
+
"confusion": 6,
|
| 50 |
+
"curiosity": 7,
|
| 51 |
+
"desire": 8,
|
| 52 |
+
"disappointment": 9,
|
| 53 |
+
"disapproval": 10,
|
| 54 |
+
"disgust": 11,
|
| 55 |
+
"embarrassment": 12,
|
| 56 |
+
"excitement": 13,
|
| 57 |
+
"fear": 14,
|
| 58 |
+
"gratitude": 15,
|
| 59 |
+
"grief": 16,
|
| 60 |
+
"joy": 17,
|
| 61 |
+
"love": 18,
|
| 62 |
+
"nervousness": 19,
|
| 63 |
+
"neutral": 27,
|
| 64 |
+
"optimism": 20,
|
| 65 |
+
"pride": 21,
|
| 66 |
+
"realization": 22,
|
| 67 |
+
"relief": 23,
|
| 68 |
+
"remorse": 24,
|
| 69 |
+
"sadness": 25,
|
| 70 |
+
"surprise": 26
|
| 71 |
+
},
|
| 72 |
+
"max_position_embeddings": 512,
|
| 73 |
+
"model_type": "distilbert",
|
| 74 |
+
"n_heads": 12,
|
| 75 |
+
"n_layers": 6,
|
| 76 |
+
"pad_token_id": 0,
|
| 77 |
+
"qa_dropout": 0.1,
|
| 78 |
+
"seq_classif_dropout": 0.2,
|
| 79 |
+
"sinusoidal_pos_embds": false,
|
| 80 |
+
"tie_weights_": true,
|
| 81 |
+
"transformers_version": "4.34.0.dev0",
|
| 82 |
+
"vocab_size": 30522
|
| 83 |
+
}
|
onnx/model.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:036f30ecf2408e929a88e74bbdb0093b09cf2a43a1406065e0a6fa09c10c5410
|
| 3 |
+
size 268035690
|
onnx/model_quantized.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1a4a425c70f9dc0f2da1d0cacd6fc4c6008e85bb8961fe62de46bd9e44cde464
|
| 3 |
+
size 67601404
|
quantize_config.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"per_channel": true,
|
| 3 |
+
"reduce_range": true,
|
| 4 |
+
"per_model_config": {
|
| 5 |
+
"model": {
|
| 6 |
+
"op_types": [
|
| 7 |
+
"Unsqueeze",
|
| 8 |
+
"Reshape",
|
| 9 |
+
"Erf",
|
| 10 |
+
"Cast",
|
| 11 |
+
"Pow",
|
| 12 |
+
"Softmax",
|
| 13 |
+
"Transpose",
|
| 14 |
+
"Relu",
|
| 15 |
+
"Div",
|
| 16 |
+
"Gather",
|
| 17 |
+
"Shape",
|
| 18 |
+
"Slice",
|
| 19 |
+
"Gemm",
|
| 20 |
+
"Concat",
|
| 21 |
+
"Mul",
|
| 22 |
+
"Sqrt",
|
| 23 |
+
"MatMul",
|
| 24 |
+
"Constant",
|
| 25 |
+
"ReduceMean",
|
| 26 |
+
"Sub",
|
| 27 |
+
"Add",
|
| 28 |
+
"Expand",
|
| 29 |
+
"Where",
|
| 30 |
+
"Equal"
|
| 31 |
+
],
|
| 32 |
+
"weight_type": "QInt8"
|
| 33 |
+
}
|
| 34 |
+
}
|
| 35 |
+
}
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cls_token": "[CLS]",
|
| 3 |
+
"mask_token": "[MASK]",
|
| 4 |
+
"pad_token": "[PAD]",
|
| 5 |
+
"sep_token": "[SEP]",
|
| 6 |
+
"unk_token": "[UNK]"
|
| 7 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"clean_up_tokenization_spaces": true,
|
| 3 |
+
"cls_token": "[CLS]",
|
| 4 |
+
"do_basic_tokenize": true,
|
| 5 |
+
"do_lower_case": true,
|
| 6 |
+
"mask_token": "[MASK]",
|
| 7 |
+
"model_max_length": 512,
|
| 8 |
+
"never_split": null,
|
| 9 |
+
"pad_token": "[PAD]",
|
| 10 |
+
"sep_token": "[SEP]",
|
| 11 |
+
"strip_accents": null,
|
| 12 |
+
"tokenize_chinese_chars": true,
|
| 13 |
+
"tokenizer_class": "DistilBertTokenizer",
|
| 14 |
+
"unk_token": "[UNK]"
|
| 15 |
+
}
|
vocab.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|