albertvillanova HF staff commited on
Commit
add4922
1 Parent(s): bcf4b72

Convert dataset to Parquet (#4)

Browse files

- Convert dataset to Parquet (f98486401898395781df446735b32951aff18ba9)
- Add raw data files (80ade013e6cd041bec4222919d5b28ad5b94ffab)
- Delete loading script (93e006e75d252cb661bcd363362cea7c8ae32076)
- Delete legacy dataset_infos.json (21bfc53a1fdc02d6346ef0d9a10143f345e723a0)

README.md CHANGED
@@ -21,6 +21,9 @@ task_ids:
21
  - multi-label-classification
22
  paperswithcode_id: goemotions
23
  pretty_name: GoEmotions
 
 
 
24
  tags:
25
  - emotion
26
  dataset_info:
@@ -102,10 +105,10 @@ dataset_info:
102
  dtype: int32
103
  splits:
104
  - name: train
105
- num_bytes: 55343630
106
  num_examples: 211225
107
- download_size: 42742918
108
- dataset_size: 55343630
109
  - config_name: simplified
110
  features:
111
  - name: text
@@ -146,19 +149,30 @@ dataset_info:
146
  dtype: string
147
  splits:
148
  - name: train
149
- num_bytes: 4224198
150
  num_examples: 43410
151
  - name: validation
152
- num_bytes: 527131
153
  num_examples: 5426
154
  - name: test
155
- num_bytes: 524455
156
  num_examples: 5427
157
- download_size: 4394818
158
- dataset_size: 5275784
159
- config_names:
160
- - raw
161
- - simplified
 
 
 
 
 
 
 
 
 
 
 
162
  ---
163
 
164
  # Dataset Card for GoEmotions
 
21
  - multi-label-classification
22
  paperswithcode_id: goemotions
23
  pretty_name: GoEmotions
24
+ config_names:
25
+ - raw
26
+ - simplified
27
  tags:
28
  - emotion
29
  dataset_info:
 
105
  dtype: int32
106
  splits:
107
  - name: train
108
+ num_bytes: 55343102
109
  num_examples: 211225
110
+ download_size: 24828322
111
+ dataset_size: 55343102
112
  - config_name: simplified
113
  features:
114
  - name: text
 
149
  dtype: string
150
  splits:
151
  - name: train
152
+ num_bytes: 4224138
153
  num_examples: 43410
154
  - name: validation
155
+ num_bytes: 527119
156
  num_examples: 5426
157
  - name: test
158
+ num_bytes: 524443
159
  num_examples: 5427
160
+ download_size: 3464371
161
+ dataset_size: 5275700
162
+ configs:
163
+ - config_name: raw
164
+ data_files:
165
+ - split: train
166
+ path: raw/train-*
167
+ - config_name: simplified
168
+ data_files:
169
+ - split: train
170
+ path: simplified/train-*
171
+ - split: validation
172
+ path: simplified/validation-*
173
+ - split: test
174
+ path: simplified/test-*
175
+ default: true
176
  ---
177
 
178
  # Dataset Card for GoEmotions
dataset_infos.json DELETED
@@ -1 +0,0 @@
1
- {"raw": {"description": "The GoEmotions dataset contains 58k carefully curated Reddit comments labeled for 27 emotion categories or Neutral.\nThe emotion categories are admiration, amusement, anger, annoyance, approval, caring, confusion, curiosity, desire,\ndisappointment, disapproval, disgust, embarrassment, excitement, fear, gratitude, grief, joy, love, nervousness,\noptimism, pride, realization, relief, remorse, sadness, surprise.\n", "citation": "@inproceedings{demszky2020goemotions,\n author = {Demszky, Dorottya and Movshovitz-Attias, Dana and Ko, Jeongwoo and Cowen, Alan and Nemade, Gaurav and Ravi, Sujith},\n booktitle = {58th Annual Meeting of the Association for Computational Linguistics (ACL)},\n title = {{GoEmotions: A Dataset of Fine-Grained Emotions}},\n year = {2020}\n}\n", "homepage": "https://github.com/google-research/google-research/tree/master/goemotions", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "id": {"dtype": "string", "id": null, "_type": "Value"}, "author": {"dtype": "string", "id": null, "_type": "Value"}, "subreddit": {"dtype": "string", "id": null, "_type": "Value"}, "link_id": {"dtype": "string", "id": null, "_type": "Value"}, "parent_id": {"dtype": "string", "id": null, "_type": "Value"}, "created_utc": {"dtype": "float32", "id": null, "_type": "Value"}, "rater_id": {"dtype": "int32", "id": null, "_type": "Value"}, "example_very_unclear": {"dtype": "bool", "id": null, "_type": "Value"}, "admiration": {"dtype": "int32", "id": null, "_type": "Value"}, "amusement": {"dtype": "int32", "id": null, "_type": "Value"}, "anger": {"dtype": "int32", "id": null, "_type": "Value"}, "annoyance": {"dtype": "int32", "id": null, "_type": "Value"}, "approval": {"dtype": "int32", "id": null, "_type": "Value"}, "caring": {"dtype": "int32", "id": null, "_type": "Value"}, "confusion": {"dtype": "int32", "id": null, "_type": "Value"}, "curiosity": {"dtype": "int32", "id": null, "_type": "Value"}, "desire": {"dtype": "int32", "id": null, "_type": "Value"}, "disappointment": {"dtype": "int32", "id": null, "_type": "Value"}, "disapproval": {"dtype": "int32", "id": null, "_type": "Value"}, "disgust": {"dtype": "int32", "id": null, "_type": "Value"}, "embarrassment": {"dtype": "int32", "id": null, "_type": "Value"}, "excitement": {"dtype": "int32", "id": null, "_type": "Value"}, "fear": {"dtype": "int32", "id": null, "_type": "Value"}, "gratitude": {"dtype": "int32", "id": null, "_type": "Value"}, "grief": {"dtype": "int32", "id": null, "_type": "Value"}, "joy": {"dtype": "int32", "id": null, "_type": "Value"}, "love": {"dtype": "int32", "id": null, "_type": "Value"}, "nervousness": {"dtype": "int32", "id": null, "_type": "Value"}, "optimism": {"dtype": "int32", "id": null, "_type": "Value"}, "pride": {"dtype": "int32", "id": null, "_type": "Value"}, "realization": {"dtype": "int32", "id": null, "_type": "Value"}, "relief": {"dtype": "int32", "id": null, "_type": "Value"}, "remorse": {"dtype": "int32", "id": null, "_type": "Value"}, "sadness": {"dtype": "int32", "id": null, "_type": "Value"}, "surprise": {"dtype": "int32", "id": null, "_type": "Value"}, "neutral": {"dtype": "int32", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "go_emotions", "config_name": "raw", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 55343630, "num_examples": 211225, "dataset_name": "go_emotions"}}, "download_checksums": {"https://storage.googleapis.com/gresearch/goemotions/data/full_dataset/goemotions_1.csv": {"num_bytes": 14174600, "checksum": "cac049036bad5d68d1081f72b65f2cc51e4df82af05e3e22cfa747051cac1af3"}, "https://storage.googleapis.com/gresearch/goemotions/data/full_dataset/goemotions_2.csv": {"num_bytes": 14173154, "checksum": "f699ecc5aa425c1720c1d02475f1e41815244b680bd75b282eb770d2c76cd84d"}, "https://storage.googleapis.com/gresearch/goemotions/data/full_dataset/goemotions_3.csv": {"num_bytes": 14395164, "checksum": "467f1e7191af00f2e76cc7f425885c2dc304bea8aff284b10e8c460d22f2e1af"}}, "download_size": 42742918, "post_processing_size": null, "dataset_size": 55343630, "size_in_bytes": 98086548}, "simplified": {"description": "The GoEmotions dataset contains 58k carefully curated Reddit comments labeled for 27 emotion categories or Neutral.\nThe emotion categories are admiration, amusement, anger, annoyance, approval, caring, confusion, curiosity, desire,\ndisappointment, disapproval, disgust, embarrassment, excitement, fear, gratitude, grief, joy, love, nervousness,\noptimism, pride, realization, relief, remorse, sadness, surprise.\n", "citation": "@inproceedings{demszky2020goemotions,\n author = {Demszky, Dorottya and Movshovitz-Attias, Dana and Ko, Jeongwoo and Cowen, Alan and Nemade, Gaurav and Ravi, Sujith},\n booktitle = {58th Annual Meeting of the Association for Computational Linguistics (ACL)},\n title = {{GoEmotions: A Dataset of Fine-Grained Emotions}},\n year = {2020}\n}\n", "homepage": "https://github.com/google-research/google-research/tree/master/goemotions", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "labels": {"feature": {"num_classes": 28, "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"], "names_file": null, "id": null, "_type": "ClassLabel"}, "length": -1, "id": null, "_type": "Sequence"}, "id": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "go_emotions", "config_name": "simplified", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 4224198, "num_examples": 43410, "dataset_name": "go_emotions"}, "validation": {"name": "validation", "num_bytes": 527131, "num_examples": 5426, "dataset_name": "go_emotions"}, "test": {"name": "test", "num_bytes": 524455, "num_examples": 5427, "dataset_name": "go_emotions"}}, "download_checksums": {"https://github.com/google-research/google-research/raw/master/goemotions/data/train.tsv": {"num_bytes": 3519053, "checksum": "1c254a142be5c00e80d819b9ae1bbd36d94b2eeb8f4b1271846508d57e57d9c5"}, "https://github.com/google-research/google-research/raw/master/goemotions/data/dev.tsv": {"num_bytes": 439059, "checksum": "575489c079c9de1097062a01738f998590d6b7ead66dd1c9fd1d2ba01fd8bc62"}, "https://github.com/google-research/google-research/raw/master/goemotions/data/test.tsv": {"num_bytes": 436706, "checksum": "0587b2dd8b27b97352adbfc3fb083d46005c8946657fdc2b1ca8b1cc7f1f8be4"}}, "download_size": 4394818, "post_processing_size": null, "dataset_size": 5275784, "size_in_bytes": 9670602}}
 
 
go_emotions.py DELETED
@@ -1,158 +0,0 @@
1
- # coding=utf-8
2
- # Copyright 2020 HuggingFace Datasets Authors.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
- # Lint as: python3
17
- """GoEmotions dataset"""
18
-
19
-
20
- import csv
21
- import os
22
-
23
- import datasets
24
-
25
-
26
- _DESCRIPTION = """\
27
- The GoEmotions dataset contains 58k carefully curated Reddit comments labeled for 27 emotion categories or Neutral.
28
- The emotion categories are admiration, amusement, anger, annoyance, approval, caring, confusion, curiosity, desire,
29
- disappointment, disapproval, disgust, embarrassment, excitement, fear, gratitude, grief, joy, love, nervousness,
30
- optimism, pride, realization, relief, remorse, sadness, surprise.
31
- """
32
-
33
- _CITATION = """\
34
- @inproceedings{demszky2020goemotions,
35
- author = {Demszky, Dorottya and Movshovitz-Attias, Dana and Ko, Jeongwoo and Cowen, Alan and Nemade, Gaurav and Ravi, Sujith},
36
- booktitle = {58th Annual Meeting of the Association for Computational Linguistics (ACL)},
37
- title = {{GoEmotions: A Dataset of Fine-Grained Emotions}},
38
- year = {2020}
39
- }
40
- """
41
-
42
- _CLASS_NAMES = [
43
- "admiration",
44
- "amusement",
45
- "anger",
46
- "annoyance",
47
- "approval",
48
- "caring",
49
- "confusion",
50
- "curiosity",
51
- "desire",
52
- "disappointment",
53
- "disapproval",
54
- "disgust",
55
- "embarrassment",
56
- "excitement",
57
- "fear",
58
- "gratitude",
59
- "grief",
60
- "joy",
61
- "love",
62
- "nervousness",
63
- "optimism",
64
- "pride",
65
- "realization",
66
- "relief",
67
- "remorse",
68
- "sadness",
69
- "surprise",
70
- "neutral",
71
- ]
72
-
73
- _BASE_DOWNLOAD_URL = "https://github.com/google-research/google-research/raw/master/goemotions/data/"
74
- _RAW_DOWNLOAD_URLS = [
75
- "https://storage.googleapis.com/gresearch/goemotions/data/full_dataset/goemotions_1.csv",
76
- "https://storage.googleapis.com/gresearch/goemotions/data/full_dataset/goemotions_2.csv",
77
- "https://storage.googleapis.com/gresearch/goemotions/data/full_dataset/goemotions_3.csv",
78
- ]
79
- _HOMEPAGE = "https://github.com/google-research/google-research/tree/master/goemotions"
80
-
81
-
82
- class GoEmotionsConfig(datasets.BuilderConfig):
83
- @property
84
- def features(self):
85
- if self.name == "simplified":
86
- return {
87
- "text": datasets.Value("string"),
88
- "labels": datasets.Sequence(datasets.ClassLabel(names=_CLASS_NAMES)),
89
- "id": datasets.Value("string"),
90
- }
91
- elif self.name == "raw":
92
- d = {
93
- "text": datasets.Value("string"),
94
- "id": datasets.Value("string"),
95
- "author": datasets.Value("string"),
96
- "subreddit": datasets.Value("string"),
97
- "link_id": datasets.Value("string"),
98
- "parent_id": datasets.Value("string"),
99
- "created_utc": datasets.Value("float"),
100
- "rater_id": datasets.Value("int32"),
101
- "example_very_unclear": datasets.Value("bool"),
102
- }
103
- d.update({label: datasets.Value("int32") for label in _CLASS_NAMES})
104
- return d
105
-
106
-
107
- class GoEmotions(datasets.GeneratorBasedBuilder):
108
- """GoEmotions dataset"""
109
-
110
- BUILDER_CONFIGS = [
111
- GoEmotionsConfig(
112
- name="raw",
113
- ),
114
- GoEmotionsConfig(
115
- name="simplified",
116
- ),
117
- ]
118
- BUILDER_CONFIG_CLASS = GoEmotionsConfig
119
- DEFAULT_CONFIG_NAME = "simplified"
120
-
121
- def _info(self):
122
- return datasets.DatasetInfo(
123
- description=_DESCRIPTION,
124
- features=datasets.Features(self.config.features),
125
- homepage=_HOMEPAGE,
126
- citation=_CITATION,
127
- )
128
-
129
- def _split_generators(self, dl_manager):
130
- if self.config.name == "raw":
131
- paths = dl_manager.download_and_extract(_RAW_DOWNLOAD_URLS)
132
- return [datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepaths": paths, "raw": True})]
133
- if self.config.name == "simplified":
134
- train_path = dl_manager.download_and_extract(os.path.join(_BASE_DOWNLOAD_URL, "train.tsv"))
135
- dev_path = dl_manager.download_and_extract(os.path.join(_BASE_DOWNLOAD_URL, "dev.tsv"))
136
- test_path = dl_manager.download_and_extract(os.path.join(_BASE_DOWNLOAD_URL, "test.tsv"))
137
- return [
138
- datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepaths": [train_path]}),
139
- datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepaths": [dev_path]}),
140
- datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepaths": [test_path]}),
141
- ]
142
-
143
- def _generate_examples(self, filepaths, raw=False):
144
- """Generate AG News examples."""
145
- for file_idx, filepath in enumerate(filepaths):
146
- with open(filepath, "r", encoding="utf-8") as f:
147
- if raw:
148
- reader = csv.DictReader(f)
149
- else:
150
- reader = csv.DictReader(f, delimiter="\t", fieldnames=list(self.config.features.keys()))
151
-
152
- for row_idx, row in enumerate(reader):
153
- if raw:
154
- row["example_very_unclear"] = row["example_very_unclear"] == "TRUE"
155
- else:
156
- row["labels"] = [int(ind) for ind in row["labels"].split(",")]
157
-
158
- yield f"{file_idx}_{row_idx}", row
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
raw/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5de61486d0b557920f960cbe8b7579f51cdea2d80e74cf647b583967a3642a68
3
+ size 24828322
simplified/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fd0953e535ba2569edc6a1daaa1133f8e4b9071691d540c9bab812fda132bc26
3
+ size 346630
simplified/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b7d74279616ae7c9b8374ab62ea9f9d6504d36a577bb17f745d720dc2b0d4e76
3
+ size 2767678
simplified/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d46ad5633c4fa41829d22d549743a7bf858d94129536a02af7280c281db5e63a
3
+ size 350063