Datasets:

Modalities:
Text
Formats:
parquet
Libraries:
Datasets
pandas
License:
File size: 4,859 Bytes
ef10bec
 
 
 
 
 
 
 
 
dea290f
1370afd
6e2a22e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ef10bec
dea290f
1370afd
6e2a22e
 
 
 
 
 
 
 
 
ef10bec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f712918
ef10bec
 
 
 
 
 
beae9d0
 
 
f712918
ef10bec
beae9d0
ef10bec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f712918
ef10bec
 
 
 
 
f712918
ef10bec
f712918
ef10bec
 
 
 
 
 
 
2751759
f712918
6bf0859
ef10bec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6bf0859
ef10bec
 
 
 
 
 
 
 
 
 
f712918
beae9d0
dea290f
ef10bec
dea290f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
beae9d0
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
---

dataset_info:
- config_name: simplified_ekman
  features:
  - name: lv_text
    dtype: string
  - name: text
    dtype: string
  - name: labels
    dtype:
      list:
        class_label:
          names:
            - admiration
            - amusement
            - anger
            - annoyance
            - approval
            - caring
            - confusion
            - curiosity
            - desire
            - disappointment
            - disapproval
            - disgust
            - embarrassment
            - excitement
            - fear
            - gratitude
            - grief
            - joy
            - love
            - nervousness
            - optimism
            - pride
            - realization
            - relief
            - remorse
            - sadness
            - surprise
            - neutral
  - name: labels_ekman
    dtype:
      list:
        class_label:
          names:
            - anger
            - disgust
            - fear
            - joy
            - sadness
            - surprise
            - neutral
  - name: id
    dtype: string
  splits:
  - name: train
    num_bytes: 8267776
    num_examples: 43410
  - name: validation
    num_bytes: 1029817
    num_examples: 5426
  - name: test
    num_bytes: 1025790
    num_examples: 5427
  download_size: 6700239
  dataset_size: 10323383
configs:
- config_name: simplified_ekman
  data_files:
  - split: train
    path: simplified_ekman/train-*
  - split: validation
    path: simplified_ekman/validation-*
  - split: test
    path: simplified_ekman/test-*
license: apache-2.0
task_categories:
- text-classification
language:
- lv
- en
---


# Latvian GoEmotions dataset

The original dataset: [GoEmotions](https://huggingface.co/datasets/google-research-datasets/go_emotions) ([paper](https://aclanthology.org/2020.acl-main.372/)).

The derived dataset was machine translated from English into Latvian using the free Google Translate API (with [deep-translator](https://pypi.org/project/deep-translator/)). The translation script:

```python

from datasets import load_dataset

from deep_translator import GoogleTranslator

from deep_translator.exceptions import TranslationNotFound



original_dataset = load_dataset("go_emotions", name="simplified")

translator = GoogleTranslator(source="en", target="lv")



def translate_batch(batch):

    original_text = batch["text"]



    while True:

        try:

            translated_batch = translator.translate_batch(original_text)

            break

        except TranslationNotFound:

            print(f"Translation failed. Retrying...")



    # We fix untranslated entries (None values) by replacing them with the original text

    for i in range(len(translated_batch)):

        if not translated_batch[i]:

            translated_batch[i] = original_text[i]

            print(f"Replaced {original_text[i]} vs {translated_batch[i]}")



    batch["lv_text"] = translated_batch



    return batch



translated_dataset = original_dataset.map(

    translate_batch, batched=True, batch_size=500

)

```

The derived dataset uses two aligned tagsets:

- The original 27 + `neutral` emotion labels (may contain more than one label per sample):
```yaml

0: admiration

1: amusement

2: anger

3: annoyance

4: approval

5: caring

6: confusion

7: curiosity

8: desire

9: disappointment

10: disapproval

11: disgust

12: embarrassment

13: excitement

14: fear

15: gratitude

16: grief

17: joy

18: love

19: nervousness

20: optimism

21: pride

22: realization

23: relief

24: remorse

25: sadness

26: surprise

27: neutral

```

- The basic 6 + `neutral` emotion labels as per [Paul Ekman's theory](https://en.wikipedia.org/wiki/Emotion_classification) (may contain more than one label per sample):
```yaml

0: anger

1: disgust

2: fear

3: joy

4: sadness

5: surprise

6: neutral

```

Mapping from the 27 fine-grained emotions to the 6 basic emotions:

| GoEmotions | Ekman |
|---|---|
| admiration | joy |
| amusement | joy |
| anger | anger |
| annoyance | anger |
| approval | joy |
| caring | joy |
| confusion | surprise |
| curiosity | surprise |
| desire | joy |
| disappointment | sadness |
| disapproval | anger |
| disgust | disgust |
| embarrassment | sadness |
| excitement | joy |
| fear | fear |
| gratitude | joy |
| grief | sadness |
| joy | joy |
| love | joy |
| nervousness | fear |
| optimism | joy |
| pride | joy |
| realization | surprise |
| relief | joy |
| remorse | sadness |
| sadness | sadness |
| surprise | surprise |

## Acknowledgements

This work was supported by the EU Recovery and Resilience Facility project [Language Technology Initiative](https://www.vti.lu.lv) (2.3.1.1.i.0/1/22/I/CFLA/002).