system HF staff commited on
Commit
a7f53d7
0 Parent(s):

Update files from the datasets library (from 1.0.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.0.0

.gitattributes ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"emo2019": {"description": "In this dataset, given a textual dialogue i.e. an utterance along with two previous turns of context, the goal was to infer the underlying emotion of the utterance by choosing from four emotion classes - Happy, Sad, Angry and Others. \n", "citation": "@inproceedings{chatterjee-etal-2019-semeval,\n title={SemEval-2019 Task 3: EmoContext Contextual Emotion Detection in Text},\n author={Ankush Chatterjee and Kedhar Nath Narahari and Meghana Joshi and Puneet Agrawal},\n booktitle={Proceedings of the 13th International Workshop on Semantic Evaluation},\n year={2019},\n address={Minneapolis, Minnesota, USA},\n publisher={Association for Computational Linguistics},\n url={https://www.aclweb.org/anthology/S19-2005},\n doi={10.18653/v1/S19-2005},\n pages={39--48},\n abstract={In this paper, we present the SemEval-2019 Task 3 - EmoContext: Contextual Emotion Detection in Text. Lack of facial expressions and voice modulations make detecting emotions in text a challenging problem. For instance, as humans, on reading ''Why don't you ever text me!'' we can either interpret it as a sad or angry emotion and the same ambiguity exists for machines. However, the context of dialogue can prove helpful in detection of the emotion. In this task, given a textual dialogue i.e. an utterance along with two previous turns of context, the goal was to infer the underlying emotion of the utterance by choosing from four emotion classes - Happy, Sad, Angry and Others. To facilitate the participation in this task, textual dialogues from user interaction with a conversational agent were taken and annotated for emotion classes after several data processing steps. A training data set of 30160 dialogues, and two evaluation data sets, Test1 and Test2, containing 2755 and 5509 dialogues respectively were released to the participants. A total of 311 teams made submissions to this task. The final leader-board was evaluated on Test2 data set, and the highest ranked submission achieved 79.59 micro-averaged F1 score. Our analysis of systems submitted to the task indicate that Bi-directional LSTM was the most common choice of neural architecture used, and most of the systems had the best performance for the Sad emotion class, and the worst for the Happy emotion class}\n}\n", "homepage": "https://www.aclweb.org/anthology/S19-2005/", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 4, "names": ["others", "happy", "sad", "angry"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "supervised_keys": null, "builder_name": "emo", "config_name": "emo2019", "version": {"version_str": "1.0.0", "description": null, "datasets_version_to_prepare": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 2433205, "num_examples": 30160, "dataset_name": "emo"}, "test": {"name": "test", "num_bytes": 421555, "num_examples": 5509, "dataset_name": "emo"}}, "download_checksums": {"https://drive.google.com/uc?id=12Uz59TYg_NtxOy7SXraYeXPMRT7oaO7X": {"num_bytes": 2867411, "checksum": "70e202c93671cebe3efdefa38dc6d1153d2f469d4538f3ab4ca395aaf7f14157"}, "https://drive.google.com/uc?id=1Hn5ytHSSoGOC4sjm3wYy0Dh0oY_oXBbb": {"num_bytes": 495145, "checksum": "b0844ed2a9d3485cf2bde315fdfc04cf6d61eeeaf834b680fb6c4407f9f3be1f"}}, "download_size": 3362556, "dataset_size": 2854760, "size_in_bytes": 6217316}}
dummy/emo2019/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1f1b4a82737554d0a389da536c7abf8ee61bd3d0373b31dffd21e70f8ab79364
3
+ size 292
emo.py ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
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
+ """ SemEval-2019 Task 3: EmoContext Contextual Emotion Detection in Text """
16
+
17
+ from __future__ import absolute_import, division, print_function
18
+
19
+ import json
20
+
21
+ import datasets
22
+
23
+
24
+ _CITATION = """\
25
+ @inproceedings{chatterjee-etal-2019-semeval,
26
+ title={SemEval-2019 Task 3: EmoContext Contextual Emotion Detection in Text},
27
+ author={Ankush Chatterjee and Kedhar Nath Narahari and Meghana Joshi and Puneet Agrawal},
28
+ booktitle={Proceedings of the 13th International Workshop on Semantic Evaluation},
29
+ year={2019},
30
+ address={Minneapolis, Minnesota, USA},
31
+ publisher={Association for Computational Linguistics},
32
+ url={https://www.aclweb.org/anthology/S19-2005},
33
+ doi={10.18653/v1/S19-2005},
34
+ pages={39--48},
35
+ abstract={In this paper, we present the SemEval-2019 Task 3 - EmoContext: Contextual Emotion Detection in Text. Lack of facial expressions and voice modulations make detecting emotions in text a challenging problem. For instance, as humans, on reading ''Why don't you ever text me!'' we can either interpret it as a sad or angry emotion and the same ambiguity exists for machines. However, the context of dialogue can prove helpful in detection of the emotion. In this task, given a textual dialogue i.e. an utterance along with two previous turns of context, the goal was to infer the underlying emotion of the utterance by choosing from four emotion classes - Happy, Sad, Angry and Others. To facilitate the participation in this task, textual dialogues from user interaction with a conversational agent were taken and annotated for emotion classes after several data processing steps. A training data set of 30160 dialogues, and two evaluation data sets, Test1 and Test2, containing 2755 and 5509 dialogues respectively were released to the participants. A total of 311 teams made submissions to this task. The final leader-board was evaluated on Test2 data set, and the highest ranked submission achieved 79.59 micro-averaged F1 score. Our analysis of systems submitted to the task indicate that Bi-directional LSTM was the most common choice of neural architecture used, and most of the systems had the best performance for the Sad emotion class, and the worst for the Happy emotion class}
36
+ }
37
+ """
38
+
39
+ _DESCRIPTION = """\
40
+ In this dataset, given a textual dialogue i.e. an utterance along with two previous turns of context, the goal was to infer the underlying emotion of the utterance by choosing from four emotion classes - Happy, Sad, Angry and Others.
41
+ """
42
+
43
+
44
+ class EmoConfig(datasets.BuilderConfig):
45
+ """BuilderConfig for EmoContext."""
46
+
47
+ def __init__(self, **kwargs):
48
+ """BuilderConfig for EmoContext.
49
+ Args:
50
+ **kwargs: keyword arguments forwarded to super.
51
+ """
52
+ super(EmoConfig, self).__init__(**kwargs)
53
+
54
+
55
+ _TEST_URL = "https://drive.google.com/file/d/1Hn5ytHSSoGOC4sjm3wYy0Dh0oY_oXBbb/view?usp=sharing"
56
+ _TRAIN_URL = "https://drive.google.com/file/d/12Uz59TYg_NtxOy7SXraYeXPMRT7oaO7X/view?usp=sharing"
57
+
58
+
59
+ class Emo(datasets.GeneratorBasedBuilder):
60
+ """ SemEval-2019 Task 3: EmoContext Contextual Emotion Detection in Text. Version 1.0.0 """
61
+
62
+ VERSION = datasets.Version("1.0.0")
63
+
64
+ BUILDER_CONFIGS = [
65
+ EmoConfig(
66
+ name="emo2019",
67
+ version=datasets.Version("1.0.0"),
68
+ description="Plain text",
69
+ ),
70
+ ]
71
+
72
+ def _info(self):
73
+ return datasets.DatasetInfo(
74
+ description=_DESCRIPTION,
75
+ features=datasets.Features(
76
+ {
77
+ "text": datasets.Value("string"),
78
+ "label": datasets.features.ClassLabel(names=["others", "happy", "sad", "angry"]),
79
+ }
80
+ ),
81
+ supervised_keys=None,
82
+ homepage="https://www.aclweb.org/anthology/S19-2005/",
83
+ citation=_CITATION,
84
+ )
85
+
86
+ def _get_drive_url(self, url):
87
+ base_url = "https://drive.google.com/uc?id="
88
+ split_url = url.split("/")
89
+ return base_url + split_url[5]
90
+
91
+ def _split_generators(self, dl_manager):
92
+ """Returns SplitGenerators."""
93
+ dl_train = dl_manager.download_and_extract(self._get_drive_url(_TRAIN_URL))
94
+ dl_test = dl_manager.download_and_extract(self._get_drive_url(_TEST_URL))
95
+ return [
96
+ datasets.SplitGenerator(
97
+ name=datasets.Split.TRAIN,
98
+ gen_kwargs={
99
+ "filepath": dl_train,
100
+ "split": "train",
101
+ },
102
+ ),
103
+ datasets.SplitGenerator(
104
+ name=datasets.Split.TEST,
105
+ gen_kwargs={"filepath": dl_test, "split": "test"},
106
+ ),
107
+ ]
108
+
109
+ def _generate_examples(self, filepath, split):
110
+ """ Yields examples. """
111
+ with open(filepath, "rb") as f:
112
+ data = json.load(f)
113
+ for id_, text, label in zip(data["text"].keys(), data["text"].values(), data["Label"].values()):
114
+ yield id_, {
115
+ "text": text,
116
+ "label": label,
117
+ }