model updated
Browse files- config.json +8 -20
- finetune-emotions.py +3 -2
- pytorch_model.bin +1 -1
config.json
CHANGED
@@ -8,26 +8,14 @@
|
|
8 |
"hidden_act": "gelu",
|
9 |
"hidden_dropout_prob": 0.1,
|
10 |
"hidden_size": 768,
|
11 |
-
"id2label":
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
"2": "love"
|
20 |
-
},
|
21 |
-
{
|
22 |
-
"3": "anger"
|
23 |
-
},
|
24 |
-
{
|
25 |
-
"4": "fear"
|
26 |
-
},
|
27 |
-
{
|
28 |
-
"5": "surprise"
|
29 |
-
}
|
30 |
-
],
|
31 |
"initializer_range": 0.02,
|
32 |
"intermediate_size": 3072,
|
33 |
"label2id": {
|
|
|
8 |
"hidden_act": "gelu",
|
9 |
"hidden_dropout_prob": 0.1,
|
10 |
"hidden_size": 768,
|
11 |
+
"id2label": {
|
12 |
+
"0": "sadness",
|
13 |
+
"1": "joy",
|
14 |
+
"2": "love",
|
15 |
+
"3": "anger",
|
16 |
+
"4": "fear",
|
17 |
+
"5": "surprise"
|
18 |
+
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
"initializer_range": 0.02,
|
20 |
"intermediate_size": 3072,
|
21 |
"label2id": {
|
finetune-emotions.py
CHANGED
@@ -28,11 +28,12 @@ def get_encoded_data(tokenizer):
|
|
28 |
return emotions_encoded
|
29 |
|
30 |
if __name__ == "__main__":
|
31 |
-
|
|
|
32 |
model = AutoModelForSequenceClassification.from_pretrained(
|
33 |
pretrained_model_name_or_path = BASE_MODEL_NAME,
|
34 |
num_labels = len(labels),
|
35 |
-
id2label=
|
36 |
resume_download=True,).to(device)
|
37 |
|
38 |
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL_NAME)
|
|
|
28 |
return emotions_encoded
|
29 |
|
30 |
if __name__ == "__main__":
|
31 |
+
id2label = {0: 'sadness', 1: 'joy', 2: 'love', 3: 'anger', 4: 'fear', 5: 'surprise'}
|
32 |
+
labels = list(id2label.values())
|
33 |
model = AutoModelForSequenceClassification.from_pretrained(
|
34 |
pretrained_model_name_or_path = BASE_MODEL_NAME,
|
35 |
num_labels = len(labels),
|
36 |
+
id2label = id2label,
|
37 |
resume_download=True,).to(device)
|
38 |
|
39 |
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL_NAME)
|
pytorch_model.bin
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 438036351
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:416c31214cc859ad412b651c4bee2b72ca1dcb3801a53e780d4daeb5e126502f
|
3 |
size 438036351
|