Datasets:

Modalities:
Text
Formats:
parquet
Libraries:
Datasets
pandas
License:
normundsg SkyWater21 commited on
Commit
0b7c8b4
·
verified ·
1 Parent(s): 1e9a408

Initial data import (#1)

Browse files

- Initial data import (5db14946abbed51aa67e98e1945e683b85b05793)


Co-authored-by: Daniels Buls <SkyWater21@users.noreply.huggingface.co>

README.md CHANGED
@@ -1,3 +1,130 @@
1
  ---
2
- license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - en
4
+ - ru
5
+ license: mit
6
+ task_categories:
7
+ - text-classification
8
+ dataset_info:
9
+ config_name: simplified_ekman
10
+ features:
11
+ - name: ru_text
12
+ dtype: string
13
+ - name: text
14
+ dtype: string
15
+ - name: labels
16
+ dtype:
17
+ class_label:
18
+ names:
19
+ '0': sadness
20
+ '1': joy
21
+ '2': love
22
+ '3': anger
23
+ '4': fear
24
+ '5': surprise
25
+ - name: labels_ekman
26
+ dtype:
27
+ class_label:
28
+ names:
29
+ '0': anger
30
+ '1': disgust
31
+ '2': fear
32
+ '3': joy
33
+ '4': sadness
34
+ '5': surprise
35
+ '6': neutral
36
+ splits:
37
+ - name: train
38
+ num_bytes: 103759867.36530161
39
+ num_examples: 333447
40
+ - name: validation
41
+ num_bytes: 12970022.317349194
42
+ num_examples: 41681
43
+ - name: test
44
+ num_bytes: 12970022.317349194
45
+ num_examples: 41681
46
+ download_size: 68831057
47
+ dataset_size: 129699912.0
48
+ configs:
49
+ - config_name: simplified_ekman
50
+ data_files:
51
+ - split: train
52
+ path: simplified_ekman/train-*
53
+ - split: validation
54
+ path: simplified_ekman/validation-*
55
+ - split: test
56
+ path: simplified_ekman/test-*
57
  ---
58
+ The original dataset: https://www.kaggle.com/datasets/nelgiriyewithana/emotions
59
+
60
+ The derived dataset was machine translated from English into Russian using the free Google Translate API (with [deep-translator](https://pypi.org/project/deep-translator/)). The translation script:
61
+
62
+ ```python
63
+ import pandas as pd
64
+ from deep_translator import GoogleTranslator
65
+ from deep_translator.exceptions import TranslationNotFound
66
+
67
+ # Load dataset and drop the ID column
68
+ df = pd.read_csv("path_to_your_downloaded_file/text.csv").iloc[:, 1:]
69
+
70
+ translator = GoogleTranslator(source="en", target="ru")
71
+
72
+ def translate_samples(samples):
73
+ texts = samples["text"].tolist()
74
+
75
+ while True:
76
+ try:
77
+ translated = translator.translate_batch(texts)
78
+ break
79
+ except TranslationNotFound:
80
+ print(f"Translation failed for '{texts}', retrying...")
81
+
82
+ # Replace None with original text if translation is not applicable
83
+ translated = [
84
+ t if t is not None else orig
85
+ for t, orig in zip(translated, texts)
86
+ ]
87
+
88
+ # Print replacements
89
+ for t, orig in zip(translated, texts):
90
+ if t == orig:
91
+ print(f"Replaced {orig} with {t}")
92
+
93
+ samples["ru_text"] = translated
94
+ return samples
95
+
96
+ # Apply batch translation
97
+ batch_size = 500
98
+ translated_dataset = df.groupby(df.index // batch_size, group_keys=False).apply(translate_samples)
99
+ ```
100
+
101
+ Column `labels` contain the following classes:
102
+ ```yaml
103
+ 0: sadness
104
+ 1: joy
105
+ 2: love
106
+ 3: anger
107
+ 4: fear
108
+ 5: surprise
109
+ ```
110
+
111
+ Column `labels_ekman` contains the Ekman emotion classes:
112
+ ```yaml
113
+ 0: anger
114
+ 1: disgust - omitted in this dataset
115
+ 2: fear
116
+ 3: joy
117
+ 4: sadness
118
+ 5: surprise
119
+ 6: neutral - omitted in this dataset
120
+ ```
121
+ which were mapped from the original classes as follows:
122
+ ```yaml
123
+ Original -> Ekman
124
+ sadness (0) -> sadness (4)
125
+ joy (1) -> joy (3)
126
+ love (2) -> joy (3)
127
+ anger (3) -> anger (0)
128
+ fear (4) -> fear (2)
129
+ surprise (5) -> surprise (5)
130
+ ```
simplified_ekman/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:62cdb8104a383ccf22af39d31097537b68efc22fa4e3fa276d8b8f34374e45d4
3
+ size 6700269
simplified_ekman/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b4ce25e927009af252d1268e6f0f39e3b625c0653b4e2cf172ec27349799a0c7
3
+ size 53245337
simplified_ekman/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:79cc966bd2fc445884fb487cbcff5f809d0500e263516ee16130ab4225d27665
3
+ size 6698132