Datasets:

Modalities:
Text
Formats:
parquet
Libraries:
Datasets
pandas
License:
SkyWater21 commited on
Commit
751ce5a
·
verified ·
1 Parent(s): 60c25b7

Initial data import

Browse files
README.md CHANGED
@@ -1,3 +1,130 @@
1
  ---
2
- license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - en
4
+ - lt
5
+ license: mit
6
+ task_categories:
7
+ - text-classification
8
+ dataset_info:
9
+ config_name: simplified_ekman
10
+ features:
11
+ - name: lt_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: 71995184.8176143
39
+ num_examples: 333447
40
+ - name: validation
41
+ num_bytes: 8999425.091192849
42
+ num_examples: 41681
43
+ - name: test
44
+ num_bytes: 8999425.091192849
45
+ num_examples: 41681
46
+ download_size: 55584192
47
+ dataset_size: 89994035.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 Lithuanian 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="lt")
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["lt_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:758cacaa33d5cdc1d15ce0f80abca130868c7aeb206681888dd349770223be9e
3
+ size 5379894
simplified_ekman/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:67a8fab8bcaad9ded7d5c07de424874a925dca1b5f9128b3ed38208a03291f3c
3
+ size 42780140
simplified_ekman/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:65763b793264c670d766425330c21143205d3e58fb147dac320a3c4409146cd7
3
+ size 5371794