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
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
---
size_categories: 10K<n<100K
tags:
- rlfh
- argilla
- human-feedback
---

# Dataset Card for go_emotions_raw

This dataset has been created with [Argilla](https://docs.argilla.io).

As shown in the sections below, this dataset can be loaded into Argilla as explained in [Load with Argilla](#load-with-argilla), or used directly with the `datasets` library in [Load with `datasets`](#load-with-datasets).

## Dataset Description

- **Homepage:** https://argilla.io
- **Repository:** https://github.com/argilla-io/argilla
- **Paper:** 
- **Leaderboard:** 
- **Point of Contact:** 

### Dataset Summary

It contains the raw version of [go_emotions](https://huggingface.co/datasets/go_emotions) as a `FeedbackDataset`. Each of the original questions are defined a single
`FeedbackRecord` and contain the `responses` from each annotator. The final labels in the *simplified* version of the dataset have been used as `suggestions`, so that we
can use this dataset to showcase the metrics related to the agreement between annotators as well as the `responses` vs `suggestions` metrics.

This dataset contains:

* A dataset configuration file conforming to the Argilla dataset format named `argilla.yaml`. This configuration file will be used to configure the dataset when using the `FeedbackDataset.from_huggingface` method in Argilla.

* Dataset records in a format compatible with HuggingFace `datasets`. These records will be loaded automatically when using `FeedbackDataset.from_huggingface` and can be loaded independently using the `datasets` library via `load_dataset`.

* The [annotation guidelines](#annotation-guidelines) that have been used for building and curating the dataset, if they've been defined in Argilla.

### Load with Argilla

To load with Argilla, you'll just need to install Argilla as `pip install argilla --upgrade` and then use the following code:

```python
import argilla as rg

ds = rg.FeedbackDataset.from_huggingface("argilla/go_emotions_raw")
```

### Load with `datasets`

To load this dataset with `datasets`, you'll just need to install `datasets` as `pip install datasets --upgrade` and then use the following code:

```python
from datasets import load_dataset

ds = load_dataset("argilla/go_emotions_raw")
```

### Supported Tasks and Leaderboards

This dataset can contain [multiple fields, questions and responses](https://docs.argilla.io/en/latest/conceptual_guides/data_model.html#feedback-dataset) so it can be used for different NLP tasks, depending on the configuration. The dataset structure is described in the [Dataset Structure section](#dataset-structure).

There are no leaderboards associated with this dataset.

### Languages

[More Information Needed]

## Dataset Structure

### Data in Argilla

The dataset is created in Argilla with: **fields**, **questions**, **suggestions**, **metadata**, **vectors**, and **guidelines**.

The **fields** are the dataset records themselves, for the moment just text fields are supported. These are the ones that will be used to provide responses to the questions.

| Field Name | Title | Type | Required | Markdown |
| ---------- | ----- | ---- | -------- | -------- |
| text | Text | FieldTypes.text | True | False |


The **questions** are the questions that will be asked to the annotators. They can be of different types, such as rating, text, label_selection, multi_label_selection, or ranking.

| Question Name | Title | Type | Required | Description | Values/Labels |
| ------------- | ----- | ---- | -------- | ----------- | ------------- |
| label | Label | QuestionTypes.multi_label_selection | True | Classify the text by selecting the correct label from the given list of labels. | ['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'] |


The **suggestions** are human or machine generated recommendations for each question to assist the annotator during the annotation process, so those are always linked to the existing questions, and named appending "-suggestion" and "-suggestion-metadata" to those, containing the value/s of the suggestion and its metadata, respectively. So on, the possible values are the same as in the table above, but the column name is appended with "-suggestion" and the metadata is appended with "-suggestion-metadata".

The **metadata** is a dictionary that can be used to provide additional information about the dataset record. This can be useful to provide additional context to the annotators, or to provide additional information about the dataset record itself. For example, you can use this to provide a link to the original source of the dataset record, or to provide additional information about the dataset record itself, such as the author, the date, or the source. The metadata is always optional, and can be potentially linked to the `metadata_properties` defined in the dataset configuration file in `argilla.yaml`.



| Metadata Name | Title | Type | Values | Visible for Annotators |
| ------------- | ----- | ---- | ------ | ---------------------- |


The **guidelines**, are optional as well, and are just a plain string that can be used to provide instructions to the annotators. Find those in the [annotation guidelines](#annotation-guidelines) section.

### Data Instances

An example of a dataset instance in Argilla looks as follows:

```json
{
    "external_id": null,
    "fields": {
        "text": " \"If you don\u0027t wear BROWN AND ORANGE...YOU DON\u0027T MATTER!\" We need a tshirt with that on it asap! "
    },
    "metadata": {},
    "responses": [
        {
            "status": "submitted",
            "user_id": "00000000-0000-0000-0000-000000000001",
            "values": {
                "label": {
                    "value": [
                        "neutral"
                    ]
                }
            }
        },
        {
            "status": "submitted",
            "user_id": "00000000-0000-0000-0000-000000000016",
            "values": {
                "label": {
                    "value": [
                        "anger",
                        "annoyance",
                        "optimism"
                    ]
                }
            }
        },
        {
            "status": "submitted",
            "user_id": "00000000-0000-0000-0000-000000000028",
            "values": {
                "label": {
                    "value": [
                        "approval"
                    ]
                }
            }
        },
        {
            "status": "submitted",
            "user_id": "00000000-0000-0000-0000-000000000039",
            "values": {
                "label": {
                    "value": [
                        "neutral"
                    ]
                }
            }
        },
        {
            "status": "submitted",
            "user_id": "00000000-0000-0000-0000-000000000048",
            "values": {
                "label": {
                    "value": [
                        "annoyance"
                    ]
                }
            }
        }
    ],
    "suggestions": [
        {
            "agent": null,
            "question_name": "label",
            "score": null,
            "type": "human",
            "value": [
                "annoyance",
                "neutral"
            ]
        }
    ],
    "vectors": {}
}
```

While the same record in HuggingFace `datasets` looks as follows:

```json
{
    "external_id": null,
    "label": [
        {
            "status": "submitted",
            "user_id": "00000000-0000-0000-0000-000000000001",
            "value": [
                "neutral"
            ]
        },
        {
            "status": "submitted",
            "user_id": "00000000-0000-0000-0000-000000000016",
            "value": [
                "anger",
                "annoyance",
                "optimism"
            ]
        },
        {
            "status": "submitted",
            "user_id": "00000000-0000-0000-0000-000000000028",
            "value": [
                "approval"
            ]
        },
        {
            "status": "submitted",
            "user_id": "00000000-0000-0000-0000-000000000039",
            "value": [
                "neutral"
            ]
        },
        {
            "status": "submitted",
            "user_id": "00000000-0000-0000-0000-000000000048",
            "value": [
                "annoyance"
            ]
        }
    ],
    "label-suggestion": [
        "annoyance",
        "neutral"
    ],
    "label-suggestion-metadata": {
        "agent": null,
        "score": null,
        "type": "human"
    },
    "metadata": "{}",
    "text": " \"If you don\u0027t wear BROWN AND ORANGE...YOU DON\u0027T MATTER!\" We need a tshirt with that on it asap! "
}
```

### Data Fields

Among the dataset fields, we differentiate between the following:

* **Fields:** These are the dataset records themselves, for the moment just text fields are supported. These are the ones that will be used to provide responses to the questions.
    
    * **text** is of type `FieldTypes.text`.

* **Questions:** These are the questions that will be asked to the annotators. They can be of different types, such as `RatingQuestion`, `TextQuestion`, `LabelQuestion`, `MultiLabelQuestion`, and `RankingQuestion`.
    
    * **label** is of type `QuestionTypes.multi_label_selection` with the following allowed values ['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'], and description "Classify the text by selecting the correct label from the given list of labels.".

* **Suggestions:** As of Argilla 1.13.0, the suggestions have been included to provide the annotators with suggestions to ease or assist during the annotation process. Suggestions are linked to the existing questions, are always optional, and contain not just the suggestion itself, but also the metadata linked to it, if applicable.
    
    * (optional) **label-suggestion** is of type `QuestionTypes.multi_label_selection` with the following allowed values ['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'].



Additionally, we also have two more fields that are optional and are the following:

* **metadata:** This is an optional field that can be used to provide additional information about the dataset record. This can be useful to provide additional context to the annotators, or to provide additional information about the dataset record itself. For example, you can use this to provide a link to the original source of the dataset record, or to provide additional information about the dataset record itself, such as the author, the date, or the source. The metadata is always optional, and can be potentially linked to the `metadata_properties` defined in the dataset configuration file in `argilla.yaml`.
* **external_id:** This is an optional field that can be used to provide an external ID for the dataset record. This can be useful if you want to link the dataset record to an external resource, such as a database or a file.

### Data Splits

The dataset contains a single split, which is `train`.

## Dataset Creation

### Script used for the generation

```python
import argilla as rg
from datasets import load_dataset
import uuid
from datasets import concatenate_datasets

ds = load_dataset("go_emotions", "raw", split="train")
ds_prepared = load_dataset("go_emotions")

_CLASS_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",
]
label_to_id = {label: i for i, label in enumerate(_CLASS_NAMES)}
id_to_label = {i: label for i, label in enumerate(_CLASS_NAMES)}

# Concatenate the datasets and transform to pd.DataFrame

ds_prepared = concatenate_datasets([ds_prepared["train"], ds_prepared["validation"], ds_prepared["test"]])
df_prepared = ds_prepared.to_pandas()

# Obtain the final labels as a dict, to later include these as suggestions

labels_prepared = {}
for idx in df_prepared.index:
    labels = [id_to_label[label_id] for label_id in df_prepared['labels'][idx]]
    labels_prepared[df_prepared['id'][idx]] = labels

# Add labels to the dataset and keep only the relevant columns

def add_labels(ex):
    labels = []
    for label in _CLASS_NAMES:
        if ex[label] == 1:
            labels.append(label)
    ex["labels"] = labels
    
    return ex
    
ds = ds.map(add_labels)
df = ds.select_columns(["text", "labels", "rater_id", "id"]).to_pandas()

# Create a FeedbackDataset for text classification

feedback_dataset = rg.FeedbackDataset.for_text_classification(labels=_CLASS_NAMES, multi_label=True)

# Create the records with the original responses, and use as suggestions
# the final labels in the "simplified" go_emotions dataset.

records = []
for text, df_text in df.groupby("text"):
    responses = []
    for rater_id, df_raters in df_text.groupby("rater_id"):
        responses.append(
            {
                "values": {"label": {"value": df_raters["labels"].iloc[0].tolist()}},
                "status": "submitted",
                "user_id": uuid.UUID(int=rater_id),
            }
        )
    suggested_labels = labels_prepared.get(df_raters["id"].iloc[0], None)
    if not suggested_labels:
        continue
    suggestion = [
        {
            "question_name": "label",
            "value": suggested_labels,
            "type": "human",
        }
    ]
    records.append(
        rg.FeedbackRecord(
            fields={"text": df_raters["text"].iloc[0]},
            responses=responses,
            suggestions=suggestion
        )
    )


feedback_dataset.add_records(records)

# Push to the hub
feedback_dataset.push_to_huggingface("plaguss/go_emotions_raw")
```

### Curation Rationale

[More Information Needed]

### Source Data

#### Initial Data Collection and Normalization

[More Information Needed]

#### Who are the source language producers?

[More Information Needed]

### Annotations

#### Annotation guidelines

This is a text classification dataset that contains texts and labels. Given a set of texts and a predefined set of labels, the goal of text classification is to assign one or more labels to each text based on its content. Please classify the texts by making the correct selection.

#### Annotation process

[More Information Needed]

#### Who are the annotators?

[More Information Needed]

### Personal and Sensitive Information

[More Information Needed]

## Considerations for Using the Data

### Social Impact of Dataset

[More Information Needed]

### Discussion of Biases

[More Information Needed]

### Other Known Limitations

[More Information Needed]

## Additional Information

### Dataset Curators

[More Information Needed]

### Licensing Information

[More Information Needed]

### Citation Information

[More Information Needed]

### Contributions

[More Information Needed]