SkyWater21 commited on
Commit
515acc6
·
1 Parent(s): 295c797

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +103 -2
README.md CHANGED
@@ -83,7 +83,76 @@ Original dataset: [GoEmotions dataset](https://huggingface.co/datasets/google-re
83
 
84
  The dataset was machine translated to Lithuanian using free Google Translate API.
85
 
86
- Dataset contains 7 emotion labels as per Dr. Ekman theory. Labels are as follows:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  ```yaml
88
  0: anger
89
  1: disgust
@@ -92,4 +161,36 @@ Dataset contains 7 emotion labels as per Dr. Ekman theory. Labels are as follows
92
  4: sadness
93
  5: surprise
94
  6: neutral
95
- ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
 
84
  The dataset was machine translated to Lithuanian using free Google Translate API.
85
 
86
+ Tool used for translation: [deep-translator](https://pypi.org/project/deep-translator/)
87
+
88
+ Translation script:
89
+ ```python
90
+ from datasets import load_dataset
91
+ from deep_translator import GoogleTranslator
92
+ from deep_translator.exceptions import TranslationNotFound
93
+
94
+ original_dataset = load_dataset("go_emotions", name="simplified")
95
+ translator = GoogleTranslator(source="en", target="lt")
96
+
97
+ def translate_batch(batch):
98
+ original_text = batch["text"]
99
+
100
+ while True:
101
+ try:
102
+ translated_batch = translator.translate_batch(original_text)
103
+ break
104
+ except TranslationNotFound:
105
+ # Translation can fail due to API limits, so we retry until it works
106
+ print(f"Translation failed. Retrying...")
107
+
108
+ # We fix untranslated entries (None values) by replacing them with the original text
109
+ for i in range(len(translated_batch)):
110
+ if not translated_batch[i]:
111
+ translated_batch[i] = original_text[i]
112
+ print(f"Replaced {original_text[i]} vs {translated_batch[i]}")
113
+
114
+ batch["lt_text"] = translated_batch
115
+
116
+ return batch
117
+
118
+ translated_dataset = original_dataset.map(
119
+ translate_batch, batched=True, batch_size=500
120
+ )
121
+ ```
122
+
123
+ Column `labels` contains multi-label emotion annotations with 28 emotion labels as per GoEmotion dataset:
124
+ ```yaml
125
+ 0: admiration
126
+ 1: amusement
127
+ 2: anger
128
+ 3: annoyance
129
+ 4: approval
130
+ 5: caring
131
+ 6: confusion
132
+ 7: curiosity
133
+ 8: desire
134
+ 9: disappointment
135
+ 10: disapproval
136
+ 11: disgust
137
+ 12: embarrassment
138
+ 13: excitement
139
+ 14: fear
140
+ 15: gratitude
141
+ 16: grief
142
+ 17: joy
143
+ 18: love
144
+ 19: nervousness
145
+ 20: optimism
146
+ 21: pride
147
+ 22: realization
148
+ 23: relief
149
+ 24: remorse
150
+ 25: sadness
151
+ 26: surprise
152
+ 27: neutral
153
+ ```
154
+
155
+ Column `labels_ekman` contains multi-label emotion annotations with 7 base emotions as per Dr. Ekman theory:
156
  ```yaml
157
  0: anger
158
  1: disgust
 
161
  4: sadness
162
  5: surprise
163
  6: neutral
164
+ ```
165
+
166
+ Label mapping from 28 emotions from GoEmotion to 7 base emotions as per Dr. Ekman theory:
167
+ |GoEmotion|Ekman|
168
+ |---|---|
169
+ | admiration | joy|
170
+ | amusement | joy|
171
+ | anger | anger|
172
+ | annoyance | anger|
173
+ | approval | joy|
174
+ | caring | joy|
175
+ | confusion | surprise|
176
+ | curiosity | surprise|
177
+ | desire | joy|
178
+ | disappointment | sadness|
179
+ | disapproval | anger|
180
+ | disgust | disgust|
181
+ | embarrassment | sadness|
182
+ | excitement | joy|
183
+ | fear | fear|
184
+ | gratitude | joy|
185
+ | grief | sadness|
186
+ | joy | joy|
187
+ | love | joy|
188
+ | nervousness | fear|
189
+ | optimism | joy|
190
+ | pride | joy|
191
+ | realization | surprise|
192
+ | relief | joy|
193
+ | remorse | sadness|
194
+ | sadness | sadness|
195
+ | surprise | surprise|
196
+ | neutral | neutral|