parquet-converter commited on
Commit
e37054d
1 Parent(s): 86859be

Update parquet files

Browse files
.gitattributes DELETED
@@ -1,27 +0,0 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
- *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.bin.* filter=lfs diff=lfs merge=lfs -text
5
- *.bz2 filter=lfs diff=lfs merge=lfs -text
6
- *.ftz filter=lfs diff=lfs merge=lfs -text
7
- *.gz filter=lfs diff=lfs merge=lfs -text
8
- *.h5 filter=lfs diff=lfs merge=lfs -text
9
- *.joblib filter=lfs diff=lfs merge=lfs -text
10
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.model filter=lfs diff=lfs merge=lfs -text
12
- *.msgpack filter=lfs diff=lfs merge=lfs -text
13
- *.onnx filter=lfs diff=lfs merge=lfs -text
14
- *.ot filter=lfs diff=lfs merge=lfs -text
15
- *.parquet filter=lfs diff=lfs merge=lfs -text
16
- *.pb filter=lfs diff=lfs merge=lfs -text
17
- *.pt filter=lfs diff=lfs merge=lfs -text
18
- *.pth filter=lfs diff=lfs merge=lfs -text
19
- *.rar filter=lfs diff=lfs merge=lfs -text
20
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
21
- *.tar.* filter=lfs diff=lfs merge=lfs -text
22
- *.tflite filter=lfs diff=lfs merge=lfs -text
23
- *.tgz filter=lfs diff=lfs merge=lfs -text
24
- *.xz filter=lfs diff=lfs merge=lfs -text
25
- *.zip filter=lfs diff=lfs merge=lfs -text
26
- *.zstandard filter=lfs diff=lfs merge=lfs -text
27
- *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README.md DELETED
@@ -1,320 +0,0 @@
1
- ---
2
- annotations_creators:
3
- - crowdsourced
4
- language_creators:
5
- - found
6
- language:
7
- - en
8
- license:
9
- - apache-2.0
10
- multilinguality:
11
- - monolingual
12
- size_categories:
13
- - 100K<n<1M
14
- - 10K<n<100K
15
- source_datasets:
16
- - original
17
- task_categories:
18
- - text-classification
19
- task_ids:
20
- - multi-class-classification
21
- - multi-label-classification
22
- paperswithcode_id: goemotions
23
- pretty_name: GoEmotions
24
- configs:
25
- - raw
26
- - simplified
27
- tags:
28
- - emotion
29
- dataset_info:
30
- - config_name: raw
31
- features:
32
- - name: text
33
- dtype: string
34
- - name: id
35
- dtype: string
36
- - name: author
37
- dtype: string
38
- - name: subreddit
39
- dtype: string
40
- - name: link_id
41
- dtype: string
42
- - name: parent_id
43
- dtype: string
44
- - name: created_utc
45
- dtype: float32
46
- - name: rater_id
47
- dtype: int32
48
- - name: example_very_unclear
49
- dtype: bool
50
- - name: admiration
51
- dtype: int32
52
- - name: amusement
53
- dtype: int32
54
- - name: anger
55
- dtype: int32
56
- - name: annoyance
57
- dtype: int32
58
- - name: approval
59
- dtype: int32
60
- - name: caring
61
- dtype: int32
62
- - name: confusion
63
- dtype: int32
64
- - name: curiosity
65
- dtype: int32
66
- - name: desire
67
- dtype: int32
68
- - name: disappointment
69
- dtype: int32
70
- - name: disapproval
71
- dtype: int32
72
- - name: disgust
73
- dtype: int32
74
- - name: embarrassment
75
- dtype: int32
76
- - name: excitement
77
- dtype: int32
78
- - name: fear
79
- dtype: int32
80
- - name: gratitude
81
- dtype: int32
82
- - name: grief
83
- dtype: int32
84
- - name: joy
85
- dtype: int32
86
- - name: love
87
- dtype: int32
88
- - name: nervousness
89
- dtype: int32
90
- - name: optimism
91
- dtype: int32
92
- - name: pride
93
- dtype: int32
94
- - name: realization
95
- dtype: int32
96
- - name: relief
97
- dtype: int32
98
- - name: remorse
99
- dtype: int32
100
- - name: sadness
101
- dtype: int32
102
- - name: surprise
103
- dtype: int32
104
- - name: neutral
105
- dtype: int32
106
- splits:
107
- - name: train
108
- num_bytes: 55343630
109
- num_examples: 211225
110
- download_size: 42742918
111
- dataset_size: 55343630
112
- - config_name: simplified
113
- features:
114
- - name: text
115
- dtype: string
116
- - name: labels
117
- sequence:
118
- class_label:
119
- names:
120
- 0: admiration
121
- 1: amusement
122
- 2: anger
123
- 3: annoyance
124
- 4: approval
125
- 5: caring
126
- 6: confusion
127
- 7: curiosity
128
- 8: desire
129
- 9: disappointment
130
- 10: disapproval
131
- 11: disgust
132
- 12: embarrassment
133
- 13: excitement
134
- 14: fear
135
- 15: gratitude
136
- 16: grief
137
- 17: joy
138
- 18: love
139
- 19: nervousness
140
- 20: optimism
141
- 21: pride
142
- 22: realization
143
- 23: relief
144
- 24: remorse
145
- 25: sadness
146
- 26: surprise
147
- 27: neutral
148
- - name: id
149
- dtype: string
150
- splits:
151
- - name: train
152
- num_bytes: 4224198
153
- num_examples: 43410
154
- - name: validation
155
- num_bytes: 527131
156
- num_examples: 5426
157
- - name: test
158
- num_bytes: 524455
159
- num_examples: 5427
160
- download_size: 4394818
161
- dataset_size: 5275784
162
- ---
163
-
164
- # Dataset Card for GoEmotions
165
-
166
- ## Table of Contents
167
- - [Dataset Description](#dataset-description)
168
- - [Dataset Summary](#dataset-summary)
169
- - [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
170
- - [Languages](#languages)
171
- - [Dataset Structure](#dataset-structure)
172
- - [Data Instances](#data-instances)
173
- - [Data Fields](#data-fields)
174
- - [Data Splits](#data-splits)
175
- - [Dataset Creation](#dataset-creation)
176
- - [Curation Rationale](#curation-rationale)
177
- - [Source Data](#source-data)
178
- - [Annotations](#annotations)
179
- - [Personal and Sensitive Information](#personal-and-sensitive-information)
180
- - [Considerations for Using the Data](#considerations-for-using-the-data)
181
- - [Social Impact of Dataset](#social-impact-of-dataset)
182
- - [Discussion of Biases](#discussion-of-biases)
183
- - [Other Known Limitations](#other-known-limitations)
184
- - [Additional Information](#additional-information)
185
- - [Dataset Curators](#dataset-curators)
186
- - [Licensing Information](#licensing-information)
187
- - [Citation Information](#citation-information)
188
- - [Contributions](#contributions)
189
-
190
- ## Dataset Description
191
-
192
- - **Homepage:** https://github.com/google-research/google-research/tree/master/goemotions
193
- - **Repository:** https://github.com/google-research/google-research/tree/master/goemotions
194
- - **Paper:** https://arxiv.org/abs/2005.00547
195
- - **Leaderboard:**
196
- - **Point of Contact:** [Dora Demszky](https://nlp.stanford.edu/~ddemszky/index.html)
197
-
198
- ### Dataset Summary
199
-
200
- The GoEmotions dataset contains 58k carefully curated Reddit comments labeled for 27 emotion categories or Neutral.
201
- The raw data is included as well as the smaller, simplified version of the dataset with predefined train/val/test
202
- splits.
203
-
204
- ### Supported Tasks and Leaderboards
205
-
206
- This dataset is intended for multi-class, multi-label emotion classification.
207
-
208
- ### Languages
209
-
210
- The data is in English.
211
-
212
- ## Dataset Structure
213
-
214
- ### Data Instances
215
-
216
- Each instance is a reddit comment with a corresponding ID and one or more emotion annotations (or neutral).
217
-
218
- ### Data Fields
219
-
220
- The simplified configuration includes:
221
- - `text`: the reddit comment
222
- - `labels`: the emotion annotations
223
- - `comment_id`: unique identifier of the comment (can be used to look up the entry in the raw dataset)
224
-
225
- In addition to the above, the raw data includes:
226
- * `author`: The Reddit username of the comment's author.
227
- * `subreddit`: The subreddit that the comment belongs to.
228
- * `link_id`: The link id of the comment.
229
- * `parent_id`: The parent id of the comment.
230
- * `created_utc`: The timestamp of the comment.
231
- * `rater_id`: The unique id of the annotator.
232
- * `example_very_unclear`: Whether the annotator marked the example as being very unclear or difficult to label (in this
233
- case they did not choose any emotion labels).
234
-
235
- In the raw data, labels are listed as their own columns with binary 0/1 entries rather than a list of ids as in the
236
- simplified data.
237
-
238
- ### Data Splits
239
-
240
- The simplified data includes a set of train/val/test splits with 43,410, 5426, and 5427 examples respectively.
241
-
242
- ## Dataset Creation
243
-
244
- ### Curation Rationale
245
-
246
- From the paper abstract:
247
-
248
- > Understanding emotion expressed in language has a wide range of applications, from building empathetic chatbots to
249
- detecting harmful online behavior. Advancement in this area can be improved using large-scale datasets with a
250
- fine-grained typology, adaptable to multiple downstream tasks.
251
-
252
- ### Source Data
253
-
254
- #### Initial Data Collection and Normalization
255
-
256
- Data was collected from Reddit comments via a variety of automated methods discussed in 3.1 of the paper.
257
-
258
- #### Who are the source language producers?
259
-
260
- English-speaking Reddit users.
261
-
262
- ### Annotations
263
-
264
- #### Annotation process
265
-
266
- [More Information Needed]
267
-
268
- #### Who are the annotators?
269
-
270
- Annotations were produced by 3 English-speaking crowdworkers in India.
271
-
272
- ### Personal and Sensitive Information
273
-
274
- This dataset includes the original usernames of the Reddit users who posted each comment. Although Reddit usernames
275
- are typically disasociated from personal real-world identities, this is not always the case. It may therefore be
276
- possible to discover the identities of the individuals who created this content in some cases.
277
-
278
- ## Considerations for Using the Data
279
-
280
- ### Social Impact of Dataset
281
-
282
- Emotion detection is a worthwhile problem which can potentially lead to improvements such as better human/computer
283
- interaction. However, emotion detection algorithms (particularly in computer vision) have been abused in some cases
284
- to make erroneous inferences in human monitoring and assessment applications such as hiring decisions, insurance
285
- pricing, and student attentiveness (see
286
- [this article](https://www.unite.ai/ai-now-institute-warns-about-misuse-of-emotion-detection-software-and-other-ethical-issues/)).
287
-
288
- ### Discussion of Biases
289
-
290
- From the authors' github page:
291
-
292
- > Potential biases in the data include: Inherent biases in Reddit and user base biases, the offensive/vulgar word lists used for data filtering, inherent or unconscious bias in assessment of offensive identity labels, annotators were all native English speakers from India. All these likely affect labelling, precision, and recall for a trained model. Anyone using this dataset should be aware of these limitations of the dataset.
293
-
294
- ### Other Known Limitations
295
-
296
- [More Information Needed]
297
-
298
- ## Additional Information
299
-
300
- ### Dataset Curators
301
-
302
- Researchers at Amazon Alexa, Google Research, and Stanford. See the [author list](https://arxiv.org/abs/2005.00547).
303
-
304
- ### Licensing Information
305
-
306
- The GitHub repository which houses this dataset has an
307
- [Apache License 2.0](https://github.com/google-research/google-research/blob/master/LICENSE).
308
-
309
- ### Citation Information
310
-
311
- @inproceedings{demszky2020goemotions,
312
- author = {Demszky, Dorottya and Movshovitz-Attias, Dana and Ko, Jeongwoo and Cowen, Alan and Nemade, Gaurav and Ravi, Sujith},
313
- booktitle = {58th Annual Meeting of the Association for Computational Linguistics (ACL)},
314
- title = {{GoEmotions: A Dataset of Fine-Grained Emotions}},
315
- year = {2020}
316
- }
317
-
318
- ### Contributions
319
-
320
- Thanks to [@joeddav](https://github.com/joeddav) for adding this dataset.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/go_emotions-train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:50bb14db3a43eee69e3a997f5e1a28ee6cb1307838c9468d68d6f9c8fc3f142c
3
+ size 24828321
simplified/go_emotions-test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:56645ddc5746796abb7eff078bb6fb287440e1ab1f2e921935dd09b2f844cec3
3
+ size 346629
simplified/go_emotions-train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:17b9032ae782fb6b3ae17852b0ce14b4f29c9f7be17ca6b2b358aecf5d81afe2
3
+ size 2767677
simplified/go_emotions-validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3740dfced75849c10b89657df507b1d2bee02bdee5752c59a6a8e1f6c7ab9569
3
+ size 350062