Upload many_emotions.py
Browse files- many_emotions.py +6 -3
many_emotions.py
CHANGED
@@ -27,8 +27,6 @@ _URLS = {
|
|
27 |
}
|
28 |
|
29 |
_SUB_CLASSES = [
|
30 |
-
"no emotion",
|
31 |
-
"happiness",
|
32 |
"anger",
|
33 |
"fear",
|
34 |
"joy",
|
@@ -213,8 +211,13 @@ class EmotionsDataset(datasets.GeneratorBasedBuilder):
|
|
213 |
'dataset': example["dataset"],
|
214 |
'license': example["license"]
|
215 |
}
|
|
|
|
|
|
|
|
|
|
|
216 |
example.update({
|
217 |
-
"label":
|
218 |
})
|
219 |
yield example["id"], example
|
220 |
|
|
|
27 |
}
|
28 |
|
29 |
_SUB_CLASSES = [
|
|
|
|
|
30 |
"anger",
|
31 |
"fear",
|
32 |
"joy",
|
|
|
211 |
'dataset': example["dataset"],
|
212 |
'license': example["license"]
|
213 |
}
|
214 |
+
label = _CLASS_NAMES[example["label"]]
|
215 |
+
if label == "no emotion":
|
216 |
+
label = "neutral"
|
217 |
+
elif label == "happiness":
|
218 |
+
label = "joy"
|
219 |
example.update({
|
220 |
+
"label": label
|
221 |
})
|
222 |
yield example["id"], example
|
223 |
|