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

Update files from the datasets library (from 1.2.0)

Browse files

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

Files changed (5) hide show
  1. .gitattributes +27 -0
  2. README.md +177 -0
  3. atomic.py +149 -0
  4. dataset_infos.json +1 -0
  5. dummy/atomic/1.1.0/dummy_data.zip +3 -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
README.md ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - crowdsourced
4
+ language_creators:
5
+ - crowdsourced
6
+ languages:
7
+ - en
8
+ licenses:
9
+ - cc-by-4-0
10
+ multilinguality:
11
+ - monolingual
12
+ size_categories:
13
+ - 100K<n<1M
14
+ source_datasets:
15
+ - original
16
+ task_categories:
17
+ - conditional-text-generation
18
+ task_ids:
19
+ - other-stuctured-to-text
20
+ ---
21
+
22
+ # Dataset Card for An Atlas of Machine Commonsense for If-Then Reasoning - Atomic Common Sense Dataset
23
+
24
+ ## Table of Contents
25
+ - [Dataset Description](#dataset-description)
26
+ - [Dataset Summary](#dataset-summary)
27
+ - [Supported Tasks](#supported-tasks-and-leaderboards)
28
+ - [Languages](#languages)
29
+ - [Dataset Structure](#dataset-structure)
30
+ - [Data Instances](#data-instances)
31
+ - [Data Fields](#data-instances)
32
+ - [Data Splits](#data-instances)
33
+ - [Dataset Creation](#dataset-creation)
34
+ - [Curation Rationale](#curation-rationale)
35
+ - [Source Data](#source-data)
36
+ - [Annotations](#annotations)
37
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
38
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
39
+ - [Social Impact of Dataset](#social-impact-of-dataset)
40
+ - [Discussion of Biases](#discussion-of-biases)
41
+ - [Other Known Limitations](#other-known-limitations)
42
+ - [Additional Information](#additional-information)
43
+ - [Dataset Curators](#dataset-curators)
44
+ - [Licensing Information](#licensing-information)
45
+ - [Citation Information](#citation-information)
46
+
47
+ ## Dataset Description
48
+
49
+ - **Homepage:**
50
+ https://homes.cs.washington.edu/~msap/atomic/
51
+ - **Repository:**
52
+ https://homes.cs.washington.edu/~msap/atomic/
53
+ - **Paper:**
54
+ Maarten Sap, Ronan LeBras, Emily Allaway, Chandra Bhagavatula, Nicholas Lourie, Hannah Rashkin, Brendan Roof, Noah A. Smith & Yejin Choi (2019). ATOMIC: An Atlas of Machine Commonsense for If-Then Reasoning. AAAI
55
+
56
+ ### Dataset Summary
57
+
58
+ This dataset provides the template sentences and
59
+ relationships defined in the ATOMIC common sense dataset. There are
60
+ three splits - train, test, and dev.
61
+
62
+ From the authors.
63
+
64
+ Disclaimer/Content warning: the events in atomic have been
65
+ automatically extracted from blogs, stories and books written at
66
+ various times. The events might depict violent or problematic actions,
67
+ which we left in the corpus for the sake of learning the (probably
68
+ negative but still important) commonsense implications associated with
69
+ the events. We removed a small set of truly out-dated events, but
70
+ might have missed some so please email us (msap@cs.washington.edu) if
71
+ you have any concerns.
72
+
73
+
74
+ For more information, see: https://homes.cs.washington.edu/~msap/atomic/
75
+
76
+ ### Languages
77
+ en
78
+
79
+ ## Dataset Structure
80
+
81
+ ### Data Instances
82
+
83
+ Here is one example from the atomic dataset:
84
+
85
+
86
+ ``
87
+ {'event': "PersonX uses PersonX's ___ to obtain", 'oEffect': [], 'oReact': ['annoyed', 'angry', 'worried'], 'oWant': [], 'prefix': ['uses', 'obtain'], 'split': 'trn', 'xAttr': [], 'xEffect': [], 'xIntent': ['to have an advantage', 'to fulfill a desire', 'to get out of trouble'], 'xNeed': [], 'xReact': ['pleased', 'smug', 'excited'], 'xWant': []}
88
+ ``
89
+
90
+
91
+ ### Data Fields
92
+
93
+ Notes from the authors:
94
+
95
+ * event: just a string representation of the event.
96
+ * oEffect,oReact,oWant,xAttr,xEffect,xIntent,xNeed,xReact,xWant: annotations for each of the dimensions, stored in a json-dumped string.
97
+ Note: "none" means the worker explicitly responded with the empty response, whereas [] means the worker did not annotate this dimension.
98
+ * prefix: json-dumped string that represents the prefix of content words (used to make a better trn/dev/tst split).
99
+ * split: string rep of which split the event belongs to.
100
+
101
+ ### Data Splits
102
+
103
+ The atomic dataset has three splits: test, train and dev of the form:
104
+
105
+ ## Dataset Creation
106
+
107
+ ### Curation Rationale
108
+
109
+ This dataset was gathered and created over to assist in common sense reasoning.
110
+
111
+ ### Source Data
112
+
113
+ #### Initial Data Collection and Normalization
114
+
115
+ See the reaserch paper and website for more detail. The dataset was
116
+ created by the University of Washington using crowd sourced data
117
+
118
+
119
+ #### Who are the source language producers?
120
+
121
+ The Atomic authors and crowd source.
122
+
123
+ ### Annotations
124
+
125
+ #### Annotation process
126
+
127
+ Human annotations directed by forms.
128
+
129
+ #### Who are the annotators?
130
+
131
+ Human annotations.
132
+
133
+ ### Personal and Sensitive Information
134
+
135
+ Unkown, but likely none.
136
+
137
+ ## Considerations for Using the Data
138
+
139
+ ### Social Impact of Dataset
140
+
141
+ The goal for the work is to help machines understand common sense.
142
+
143
+ ### Discussion of Biases
144
+
145
+ Since the data is human annotators, there is likely to be baised. From the authors:
146
+
147
+
148
+ Disclaimer/Content warning: the events in atomic have been automatically extracted from blogs, stories and books written at various times. The events might depict violent or problematic actions, which we left in the corpus for the sake of learning the (probably negative but still important) commonsense implications associated with the events. We removed a small set of truly out-dated events, but might have missed some so please email us (msap@cs.washington.edu) if you have any concerns.
149
+
150
+
151
+ ### Other Known Limitations
152
+
153
+ While there are many relationships, the data is quite sparse. Also, each item of the dataset could be expanded into multiple sentences along the vsrious dimensions, oEffect, oRect, etc.
154
+
155
+ For example, given event: "PersonX uses PersonX's ___ to obtain" and dimension oReact: "annoyed", this could be transformed into an entry:
156
+
157
+ "PersonX uses PersonX's ___ to obtain => PersonY is annoyed"
158
+
159
+ ## Additional Information
160
+
161
+ ### Dataset Curators
162
+
163
+ The authors of Aotmic at The University of Washington
164
+
165
+ ### Licensing Information
166
+
167
+ The Creative Commons Attribution 4.0 International License. https://creativecommons.org/licenses/by/4.0/
168
+
169
+ ### Citation Information
170
+
171
+ @article{Sap2019ATOMICAA,
172
+ title={ATOMIC: An Atlas of Machine Commonsense for If-Then Reasoning},
173
+ author={Maarten Sap and Ronan Le Bras and Emily Allaway and Chandra Bhagavatula and Nicholas Lourie and Hannah Rashkin and Brendan Roof and Noah A. Smith and Yejin Choi},
174
+ journal={ArXiv},
175
+ year={2019},
176
+ volume={abs/1811.00146}
177
+ }
atomic.py ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """The Atommic Dataset"""
16
+
17
+ from __future__ import absolute_import, division, print_function
18
+
19
+ import json
20
+ import os
21
+
22
+ import datasets
23
+
24
+
25
+ _CITATION = """@article{Sap2019ATOMICAA,
26
+ title={ATOMIC: An Atlas of Machine Commonsense for If-Then Reasoning},
27
+ author={Maarten Sap and Ronan Le Bras and Emily Allaway and Chandra Bhagavatula and Nicholas Lourie and Hannah Rashkin and Brendan Roof and Noah A. Smith and Yejin Choi},
28
+ journal={ArXiv},
29
+ year={2019},
30
+ volume={abs/1811.00146}
31
+ }
32
+ """
33
+
34
+
35
+ _DESCRIPTION = """This dataset provides the template sentences and
36
+ relationships defined in the ATOMIC common sense dataset. There are
37
+ three splits - train, test, and dev.
38
+
39
+ From the authors.
40
+
41
+ Disclaimer/Content warning: the events in atomic have been
42
+ automatically extracted from blogs, stories and books written at
43
+ various times. The events might depict violent or problematic actions,
44
+ which we left in the corpus for the sake of learning the (probably
45
+ negative but still important) commonsense implications associated with
46
+ the events. We removed a small set of truly out-dated events, but
47
+ might have missed some so please email us (msap@cs.washington.edu) if
48
+ you have any concerns.
49
+
50
+ """
51
+
52
+ _HOMEPAGE = "https://homes.cs.washington.edu/~msap/atomic/"
53
+
54
+ _LICENSE = "The Creative Commons Attribution 4.0 International License. https://creativecommons.org/licenses/by/4.0/"
55
+
56
+ _URLs = {"atomic": "https://homes.cs.washington.edu/~msap/atomic/data/atomic_data.tgz"}
57
+
58
+
59
+ class Atomic(datasets.GeneratorBasedBuilder):
60
+ """Atomic Common Sense Dataset"""
61
+
62
+ VERSION = datasets.Version("1.1.0")
63
+
64
+ BUILDER_CONFIGS = [
65
+ datasets.BuilderConfig(name="atomic", version=VERSION, description="The Atomic dataset"),
66
+ ]
67
+
68
+ def _info(self):
69
+ features = datasets.Features(
70
+ {
71
+ "event": datasets.Value("string"),
72
+ "oEffect": datasets.Sequence(datasets.Value("string")),
73
+ "oReact": datasets.Sequence(datasets.Value("string")),
74
+ "oWant": datasets.Sequence(datasets.Value("string")),
75
+ "xAttr": datasets.Sequence(datasets.Value("string")),
76
+ "xEffect": datasets.Sequence(datasets.Value("string")),
77
+ "xIntent": datasets.Sequence(datasets.Value("string")),
78
+ "xNeed": datasets.Sequence(datasets.Value("string")),
79
+ "xReact": datasets.Sequence(datasets.Value("string")),
80
+ "xWant": datasets.Sequence(datasets.Value("string")),
81
+ "prefix": datasets.Sequence(datasets.Value("string")),
82
+ "split": datasets.Value("string"),
83
+ }
84
+ )
85
+ return datasets.DatasetInfo(
86
+ description=_DESCRIPTION,
87
+ features=features,
88
+ supervised_keys=None,
89
+ homepage=_HOMEPAGE,
90
+ license=_LICENSE,
91
+ citation=_CITATION,
92
+ )
93
+
94
+ def _split_generators(self, dl_manager):
95
+ """Returns SplitGenerators."""
96
+ my_urls = _URLs[self.config.name]
97
+ data_dir = dl_manager.download_and_extract(my_urls)
98
+ return [
99
+ datasets.SplitGenerator(
100
+ name=datasets.Split.TRAIN,
101
+ gen_kwargs={
102
+ "filepath": os.path.join(data_dir, "v4_atomic_trn.csv"),
103
+ "split": "train",
104
+ },
105
+ ),
106
+ datasets.SplitGenerator(
107
+ name=datasets.Split.TEST,
108
+ gen_kwargs={"filepath": os.path.join(data_dir, "v4_atomic_tst.csv"), "split": "test"},
109
+ ),
110
+ datasets.SplitGenerator(
111
+ name=datasets.Split.VALIDATION,
112
+ gen_kwargs={
113
+ "filepath": os.path.join(data_dir, "v4_atomic_dev.csv"),
114
+ "split": "dev",
115
+ },
116
+ ),
117
+ ]
118
+
119
+ def _generate_examples(self, filepath, split):
120
+ """ Yields examples from the Atomic dataset. """
121
+
122
+ with open(filepath, encoding="utf-8") as f:
123
+ for id_, row in enumerate(f):
124
+ if row.startswith("event"):
125
+ continue
126
+ row = row.replace('"[', "[").replace(']"', "]")
127
+ sent, rest = row.split("[", 1)
128
+ sent = sent.strip(', "')
129
+ rest = "[" + rest
130
+ rest = rest.replace('""', '"').replace('\\\\"]', '"]')
131
+ rest = rest.split(",")
132
+ rest[-1] = '"' + rest[-1].strip() + '"'
133
+ rest = ",".join(rest)
134
+ row = '["' + sent + '",' + rest + "]"
135
+ row = json.loads(row)
136
+ yield id_, {
137
+ "event": str(row[0]),
138
+ "oEffect": row[1],
139
+ "oReact": row[2],
140
+ "oWant": row[3],
141
+ "xAttr": row[4],
142
+ "xEffect": row[5],
143
+ "xIntent": row[6],
144
+ "xNeed": row[7],
145
+ "xReact": row[8],
146
+ "xWant": row[9],
147
+ "prefix": row[10],
148
+ "split": str(row[11]),
149
+ }
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"atomic": {"description": "This dataset provides the template sentences and\nrelationships defined in the ATOMIC common sense dataset. There are\nthree splits - train, test, and dev.\n\nFrom the authors.\n\nDisclaimer/Content warning: the events in atomic have been\nautomatically extracted from blogs, stories and books written at\nvarious times. The events might depict violent or problematic actions,\nwhich we left in the corpus for the sake of learning the (probably\nnegative but still important) commonsense implications associated with\nthe events. We removed a small set of truly out-dated events, but\nmight have missed some so please email us (msap@cs.washington.edu) if\nyou have any concerns.\n\n", "citation": "@article{Sap2019ATOMICAA,\n title={ATOMIC: An Atlas of Machine Commonsense for If-Then Reasoning},\n author={Maarten Sap and Ronan Le Bras and Emily Allaway and Chandra Bhagavatula and Nicholas Lourie and Hannah Rashkin and Brendan Roof and Noah A. Smith and Yejin Choi},\n journal={ArXiv},\n year={2019},\n volume={abs/1811.00146}\n}\n", "homepage": "https://homes.cs.washington.edu/~msap/atomic/", "license": "The Creative Commons Attribution 4.0 International License. https://creativecommons.org/licenses/by/4.0/", "features": {"event": {"dtype": "string", "id": null, "_type": "Value"}, "oEffect": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "oReact": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "oWant": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "xAttr": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "xEffect": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "xIntent": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "xNeed": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "xReact": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "xWant": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "prefix": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "split": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "atomic", "config_name": "atomic", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 32441878, "num_examples": 202271, "dataset_name": "atomic"}, "test": {"name": "test", "num_bytes": 3995624, "num_examples": 24856, "dataset_name": "atomic"}, "validation": {"name": "validation", "num_bytes": 3629768, "num_examples": 22620, "dataset_name": "atomic"}}, "download_checksums": {"https://homes.cs.washington.edu/~msap/atomic/data/atomic_data.tgz": {"num_bytes": 19083782, "checksum": "f22779944e6613044d530875dd9592a333be2e3cb83d25493b36bba7c59b2ba9"}}, "download_size": 19083782, "post_processing_size": null, "dataset_size": 40067270, "size_in_bytes": 59151052}}
dummy/atomic/1.1.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:378683111c9e5973cc965224a8e5d18bd2d806ea7dc89ed5266c79bd6a5953ea
3
+ size 3286