Upload many_emotions.py
Browse files- many_emotions.py +14 -12
many_emotions.py
CHANGED
@@ -26,6 +26,18 @@ _URLS = {
|
|
26 |
}
|
27 |
}
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
_CLASS_NAMES = [
|
30 |
"no emotion",
|
31 |
"happiness",
|
@@ -77,17 +89,7 @@ class EmotionsDataset(datasets.GeneratorBasedBuilder):
|
|
77 |
),
|
78 |
EmotionsDatasetConfig(
|
79 |
name="multilingual",
|
80 |
-
label_classes=
|
81 |
-
"no emotion",
|
82 |
-
"happiness",
|
83 |
-
"anger",
|
84 |
-
"fear",
|
85 |
-
"joy",
|
86 |
-
"love",
|
87 |
-
"sadness",
|
88 |
-
"surprise",
|
89 |
-
"neutral",
|
90 |
-
],
|
91 |
features=["text", "label", "dataset", "license"]
|
92 |
)
|
93 |
]
|
@@ -113,7 +115,7 @@ class EmotionsDataset(datasets.GeneratorBasedBuilder):
|
|
113 |
{
|
114 |
"id": datasets.Value("string"),
|
115 |
'text': Value(dtype='string', id=None),
|
116 |
-
'label': ClassLabel(names=
|
117 |
'dataset': Value(dtype='string', id=None),
|
118 |
'license': Value(dtype='string', id=None)
|
119 |
}
|
|
|
26 |
}
|
27 |
}
|
28 |
|
29 |
+
_SUB_CLASSES = [
|
30 |
+
"no emotion",
|
31 |
+
"happiness",
|
32 |
+
"anger",
|
33 |
+
"fear",
|
34 |
+
"joy",
|
35 |
+
"love",
|
36 |
+
"sadness",
|
37 |
+
"surprise",
|
38 |
+
"neutral",
|
39 |
+
]
|
40 |
+
|
41 |
_CLASS_NAMES = [
|
42 |
"no emotion",
|
43 |
"happiness",
|
|
|
89 |
),
|
90 |
EmotionsDatasetConfig(
|
91 |
name="multilingual",
|
92 |
+
label_classes=_SUB_CLASSES,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
features=["text", "label", "dataset", "license"]
|
94 |
)
|
95 |
]
|
|
|
115 |
{
|
116 |
"id": datasets.Value("string"),
|
117 |
'text': Value(dtype='string', id=None),
|
118 |
+
'label': ClassLabel(names=_SUB_CLASSES, id=None),
|
119 |
'dataset': Value(dtype='string', id=None),
|
120 |
'license': Value(dtype='string', id=None)
|
121 |
}
|