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

Update files from the datasets library (from 1.7.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.7.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,228 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - found
4
+ language_creators:
5
+ - found
6
+ languages:
7
+ - en
8
+ licenses:
9
+ - cc-by-4-0
10
+ multilinguality:
11
+ - monolingual
12
+ size_categories:
13
+ - 1M<n<10M
14
+ source_datasets:
15
+ - original
16
+ task_categories:
17
+ - other
18
+ task_ids:
19
+ - other-other-knowledge-base
20
+ paperswithcode_id: ascentkb
21
+ ---
22
+
23
+ # Dataset Card for Ascent KB
24
+
25
+ ## Table of Contents
26
+ - [Dataset Description](#dataset-description)
27
+ - [Dataset Summary](#dataset-summary)
28
+ - [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
29
+ - [Languages](#languages)
30
+ - [Dataset Structure](#dataset-structure)
31
+ - [Data Instances](#data-instances)
32
+ - [Data Fields](#data-fields)
33
+ - [Data Splits](#data-splits)
34
+ - [Dataset Creation](#dataset-creation)
35
+ - [Curation Rationale](#curation-rationale)
36
+ - [Source Data](#source-data)
37
+ - [Annotations](#annotations)
38
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
39
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
40
+ - [Social Impact of Dataset](#social-impact-of-dataset)
41
+ - [Discussion of Biases](#discussion-of-biases)
42
+ - [Other Known Limitations](#other-known-limitations)
43
+ - [Additional Information](#additional-information)
44
+ - [Dataset Curators](#dataset-curators)
45
+ - [Licensing Information](#licensing-information)
46
+ - [Citation Information](#citation-information)
47
+ - [Contributions](#contributions)
48
+
49
+ ## Dataset Description
50
+
51
+ - **Homepage:** https://ascent.mpi-inf.mpg.de/
52
+ - **Repository:** https://github.com/phongnt570/ascent
53
+ - **Paper:** https://arxiv.org/abs/2011.00905
54
+ - **Point of Contact:** http://tuan-phong.com
55
+
56
+ ### Dataset Summary
57
+
58
+ This dataset contains 8.9M commonsense assertions extracted by the Ascent pipeline developed at the [Max Planck Institute for Informatics](https://www.mpi-inf.mpg.de/departments/databases-and-information-systems/).
59
+ The focus of this dataset is on everyday concepts such as *elephant*, *car*, *laptop*, etc.
60
+ The current version of Ascent KB (v1.0.0) is approximately **19 times larger than ConceptNet** (note that, in this comparison, non-commonsense knowledge in ConceptNet such as lexical relations is excluded).
61
+
62
+ For more details, take a look at
63
+ [the research paper](https://arxiv.org/abs/2011.00905) and
64
+ [the website](https://ascent.mpi-inf.mpg.de).
65
+
66
+ ### Supported Tasks and Leaderboards
67
+
68
+ The dataset can be used in a wide range of downstream tasks such as commonsense question answering or dialogue systems.
69
+
70
+ ### Languages
71
+
72
+ The dataset is in English.
73
+
74
+ ## Dataset Structure
75
+
76
+ ### Data Instances
77
+ There are two configurations available for this dataset:
78
+ 1. `canonical` (default): This part contains `<arg1 ; rel ; arg2>`
79
+ assertions where the relations (`rel`) were mapped to
80
+ [ConceptNet relations](https://github.com/commonsense/conceptnet5/wiki/Relations)
81
+ with slight modifications:
82
+ - Introducing 2 new relations: `/r/HasSubgroup`, `/r/HasAspect`.
83
+ - All `/r/HasA` relations were replaced with `/r/HasAspect`.
84
+ This is motivated by the [ATOMIC-2020](https://allenai.org/data/atomic-2020)
85
+ schema, although they grouped all `/r/HasA` and
86
+ `/r/HasProperty` into `/r/HasProperty`.
87
+ - The `/r/UsedFor` relation was replaced with `/r/ObjectUse`
88
+ which is broader (could be either _"used for"_, _"used in"_, or _"used as"_, ect.).
89
+ This is also taken from ATOMIC-2020.
90
+ 2. `open`: This part contains open assertions of the form
91
+ `<subject ; predicate ; object>` extracted directly from web
92
+ contents. This is the original form of the `canonical` triples.
93
+
94
+ In both configurations, each assertion is equipped with
95
+ extra information including: a set of semantic `facets`
96
+ (e.g., *LOCATION*, *TEMPORAL*, etc.), its `support` (i.e., number of occurrences),
97
+ and a list of `source_sentences`.
98
+
99
+ An example row in the `canonical` configuration:
100
+
101
+ ```JSON
102
+ {
103
+ "arg1": "elephant",
104
+ "rel": "/r/HasProperty",
105
+ "arg2": "intelligent",
106
+ "support": 15,
107
+ "facets": [
108
+ {
109
+ "value": "extremely",
110
+ "type": "DEGREE",
111
+ "support": 11
112
+ }
113
+ ],
114
+ "source_sentences": [
115
+ {
116
+ "text": "Elephants are extremely intelligent animals.",
117
+ "source": "https://www.softschools.com/facts/animals/asian_elephant_facts/2310/"
118
+ },
119
+ {
120
+ "text": "Elephants are extremely intelligent creatures and an elephant's brain can weigh as much as 4-6 kg.",
121
+ "source": "https://www.elephantsforafrica.org/elephant-facts/"
122
+ }
123
+ ]
124
+ }
125
+ ```
126
+
127
+ ### Data Fields
128
+
129
+ - **For `canonical` configuration**
130
+ - `arg1`: the first argument to the relationship, e.g., *elephant*
131
+ - `rel`: the canonical relation, e.g., */r/HasProperty*
132
+ - `arg2`: the second argument to the relationship, e.g., *intelligence*
133
+ - `support`: the number of occurrences of the assertion, e.g., *15*
134
+ - `facets`: an array of semantic facets, each contains
135
+ - `value`: facet value, e.g., *extremely*
136
+ - `type`: facet type, e.g., *DEGREE*
137
+ - `support`: the number of occurrences of the facet, e.g., *11*
138
+ - `source_sentences`: an array of source sentences from which the assertion was
139
+ extracted, each contains
140
+ - `text`: the raw text of the sentence
141
+ - `source`: the URL to its parent document
142
+
143
+ - **For `open` configuration**
144
+ - The fields of this configuration are the same as the `canonical`
145
+ configuration's, except that
146
+ the (`arg1`, `rel`, `arg2`) fields are replaced with the
147
+ (`subject`, `predicate`, `object`) fields
148
+ which are free
149
+ text phrases extracted directly from the source sentences
150
+ using an Open Information Extraction (OpenIE) tool.
151
+
152
+ ### Data Splits
153
+
154
+ There are no splits. All data points come to a default split called `train`.
155
+
156
+ ## Dataset Creation
157
+
158
+ ### Curation Rationale
159
+
160
+ The commonsense knowledge base was created to assist in development of robust and reliable AI.
161
+
162
+ ### Source Data
163
+
164
+ #### Initial Data Collection and Normalization
165
+
166
+ Texts were collected from the web using the Bing Search API, and went through various cleaning steps before being processed by an OpenIE tool to get open assertions.
167
+ The assertions were then grouped into semantically equivalent clusters.
168
+ Take a look at the research paper for more details.
169
+
170
+ #### Who are the source language producers?
171
+
172
+ Web users.
173
+
174
+ ### Annotations
175
+
176
+ #### Annotation process
177
+
178
+ None.
179
+
180
+ #### Who are the annotators?
181
+
182
+ None.
183
+
184
+ ### Personal and Sensitive Information
185
+
186
+ Unknown.
187
+
188
+ ## Considerations for Using the Data
189
+
190
+ ### Social Impact of Dataset
191
+
192
+ [Needs More Information]
193
+
194
+ ### Discussion of Biases
195
+
196
+ [Needs More Information]
197
+
198
+ ### Other Known Limitations
199
+
200
+ [Needs More Information]
201
+
202
+ ## Additional Information
203
+
204
+ ### Dataset Curators
205
+
206
+ The knowledge base has been developed by researchers at the
207
+ [Max Planck Institute for Informatics](https://www.mpi-inf.mpg.de/departments/databases-and-information-systems/).
208
+
209
+ Contact [Tuan-Phong Nguyen](http://tuan-phong.com) in case of questions and comments.
210
+
211
+ ### Licensing Information
212
+
213
+ [The Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/)
214
+
215
+ ### Citation Information
216
+
217
+ ```
218
+ @InProceedings{nguyen2021www,
219
+ title={Advanced Semantics for Commonsense Knowledge Extraction},
220
+ author={Nguyen, Tuan-Phong and Razniewski, Simon and Weikum, Gerhard},
221
+ year={2021},
222
+ booktitle={The Web Conference 2021},
223
+ }
224
+ ```
225
+
226
+ ### Contributions
227
+
228
+ Thanks to [@phongnt570](https://github.com/phongnt570) for adding this dataset.
ascent_kb.py ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """Ascent KB: A Deep Commonsense Knowledge Base"""
16
+
17
+ import json
18
+
19
+ import datasets
20
+
21
+
22
+ _CITATION = """\
23
+ @InProceedings{nguyen2021www,
24
+ title={Advanced Semantics for Commonsense Knowledge Extraction},
25
+ author={Nguyen, Tuan-Phong and Razniewski, Simon and Weikum, Gerhard},
26
+ year={2021},
27
+ booktitle={The Web Conference 2021},
28
+ }
29
+ """
30
+
31
+ _DESCRIPTION = """\
32
+ This dataset contains 8.9M commonsense assertions extracted by the Ascent pipeline (https://ascent.mpi-inf.mpg.de/).
33
+ """
34
+
35
+ _HOMEPAGE = "https://ascent.mpi-inf.mpg.de/"
36
+
37
+ _LICENSE = "The Creative Commons Attribution 4.0 International License. https://creativecommons.org/licenses/by/4.0/"
38
+
39
+ # The HuggingFace dataset library don't host the datasets but only point to the original files
40
+ # This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
41
+
42
+ _URL = "https://nextcloud.mpi-klsb.mpg.de/index.php/s/dFLdTQHqiFrt3Q3/download"
43
+
44
+
45
+ # DONE: Name of the dataset usually match the script name with CamelCase instead of snake_case
46
+ class AscentKB(datasets.GeneratorBasedBuilder):
47
+ """Ascent KB: A Deep Commonsense Knowledge Base. Version 1.0.0."""
48
+
49
+ VERSION = datasets.Version("1.0.0")
50
+
51
+ BUILDER_CONFIGS = [
52
+ datasets.BuilderConfig(
53
+ name="canonical",
54
+ version=VERSION,
55
+ description="This KB contains <arg1 ; rel ; arg2> \
56
+ assertions where relations are canonicalized based on ConceptNet relations.",
57
+ ),
58
+ datasets.BuilderConfig(
59
+ name="open",
60
+ version=VERSION,
61
+ description="This KB contains open assertions of the form \
62
+ <subject ; predicate ; object> extracted directly from web contents.",
63
+ ),
64
+ ]
65
+
66
+ DEFAULT_CONFIG_NAME = "canonical"
67
+
68
+ def _info(self):
69
+ if self.config.name == "canonical":
70
+ features = datasets.Features(
71
+ {
72
+ "arg1": datasets.Value("string"),
73
+ "rel": datasets.Value("string"),
74
+ "arg2": datasets.Value("string"),
75
+ "support": datasets.Value("int64"),
76
+ "facets": [
77
+ {
78
+ "value": datasets.Value("string"),
79
+ "type": datasets.Value("string"),
80
+ "support": datasets.Value("int64"),
81
+ }
82
+ ],
83
+ "source_sentences": [{"text": datasets.Value("string"), "source": datasets.Value("string")}],
84
+ }
85
+ )
86
+ else: # features for the "open" part
87
+ features = datasets.Features(
88
+ {
89
+ "subject": datasets.Value("string"),
90
+ "predicate": datasets.Value("string"),
91
+ "object": datasets.Value("string"),
92
+ "support": datasets.Value("int64"),
93
+ "facets": [
94
+ {
95
+ "value": datasets.Value("string"),
96
+ "type": datasets.Value("string"),
97
+ "support": datasets.Value("int64"),
98
+ }
99
+ ],
100
+ "source_sentences": [{"text": datasets.Value("string"), "source": datasets.Value("string")}],
101
+ }
102
+ )
103
+ return datasets.DatasetInfo(
104
+ description=_DESCRIPTION,
105
+ features=features,
106
+ supervised_keys=None,
107
+ homepage=_HOMEPAGE,
108
+ license=_LICENSE,
109
+ citation=_CITATION,
110
+ )
111
+
112
+ def _split_generators(self, dl_manager):
113
+ """Returns SplitGenerators."""
114
+ # my_urls = _URLs[self.config.name]
115
+ # data_file = dl_manager.download_and_extract(my_urls)
116
+
117
+ data_file = dl_manager.download_and_extract(_URL)
118
+
119
+ return [
120
+ datasets.SplitGenerator(
121
+ name=datasets.Split.TRAIN,
122
+ gen_kwargs={
123
+ "filepath": data_file,
124
+ "split": "train",
125
+ },
126
+ ),
127
+ ]
128
+
129
+ # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
130
+ def _generate_examples(self, filepath, split):
131
+ """Yields examples as (key, example) tuples."""
132
+ # This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
133
+ # The `key` is here for legacy reason (tfds) and is not important in itself.
134
+
135
+ with open(filepath, encoding="utf-8") as f:
136
+ for id_, row in enumerate(f):
137
+ data = json.loads(row)
138
+ if self.config.name == "canonical":
139
+ data.pop("subject")
140
+ data.pop("predicate")
141
+ data.pop("object")
142
+ yield id_, data
143
+ else: # "open"
144
+ data.pop("arg1")
145
+ data.pop("rel")
146
+ data.pop("arg2")
147
+ yield id_, data
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
1
+ {"canonical": {"description": "This dataset contains 8.9M commonsense assertions extracted by the Ascent pipeline (https://ascent.mpi-inf.mpg.de/).\n", "citation": "@InProceedings{nguyen2021www,\n title={Advanced Semantics for Commonsense Knowledge Extraction},\n author={Nguyen, Tuan-Phong and Razniewski, Simon and Weikum, Gerhard},\n year={2021},\n booktitle={The Web Conference 2021},\n}\n", "homepage": "https://ascent.mpi-inf.mpg.de/", "license": "The Creative Commons Attribution 4.0 International License. https://creativecommons.org/licenses/by/4.0/", "features": {"arg1": {"dtype": "string", "id": null, "_type": "Value"}, "rel": {"dtype": "string", "id": null, "_type": "Value"}, "arg2": {"dtype": "string", "id": null, "_type": "Value"}, "support": {"dtype": "int64", "id": null, "_type": "Value"}, "facets": [{"value": {"dtype": "string", "id": null, "_type": "Value"}, "type": {"dtype": "string", "id": null, "_type": "Value"}, "support": {"dtype": "int64", "id": null, "_type": "Value"}}], "source_sentences": [{"text": {"dtype": "string", "id": null, "_type": "Value"}, "source": {"dtype": "string", "id": null, "_type": "Value"}}]}, "post_processed": null, "supervised_keys": null, "builder_name": "ascent_kb", "config_name": "canonical", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 2976697816, "num_examples": 8904060, "dataset_name": "ascent_kb"}}, "download_checksums": {"https://nextcloud.mpi-klsb.mpg.de/index.php/s/dFLdTQHqiFrt3Q3/download": {"num_bytes": 710727536, "checksum": "51fd88a07bca4fa48a9157dd1d93d9bac88ad2b38b5eae662d2cbfad47895016"}}, "download_size": 710727536, "post_processing_size": null, "dataset_size": 2976697816, "size_in_bytes": 3687425352}, "open": {"description": "This dataset contains 8.9M commonsense assertions extracted by the Ascent pipeline (https://ascent.mpi-inf.mpg.de/).\n", "citation": "@InProceedings{nguyen2021www,\n title={Advanced Semantics for Commonsense Knowledge Extraction},\n author={Nguyen, Tuan-Phong and Razniewski, Simon and Weikum, Gerhard},\n year={2021},\n booktitle={The Web Conference 2021},\n}\n", "homepage": "https://ascent.mpi-inf.mpg.de/", "license": "The Creative Commons Attribution 4.0 International License. https://creativecommons.org/licenses/by/4.0/", "features": {"subject": {"dtype": "string", "id": null, "_type": "Value"}, "predicate": {"dtype": "string", "id": null, "_type": "Value"}, "object": {"dtype": "string", "id": null, "_type": "Value"}, "support": {"dtype": "int64", "id": null, "_type": "Value"}, "facets": [{"value": {"dtype": "string", "id": null, "_type": "Value"}, "type": {"dtype": "string", "id": null, "_type": "Value"}, "support": {"dtype": "int64", "id": null, "_type": "Value"}}], "source_sentences": [{"text": {"dtype": "string", "id": null, "_type": "Value"}, "source": {"dtype": "string", "id": null, "_type": "Value"}}]}, "post_processed": null, "supervised_keys": null, "builder_name": "ascent_kb", "config_name": "open", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 2882678298, "num_examples": 8904060, "dataset_name": "ascent_kb"}}, "download_checksums": {"https://nextcloud.mpi-klsb.mpg.de/index.php/s/dFLdTQHqiFrt3Q3/download": {"num_bytes": 710727536, "checksum": "51fd88a07bca4fa48a9157dd1d93d9bac88ad2b38b5eae662d2cbfad47895016"}}, "download_size": 710727536, "post_processing_size": null, "dataset_size": 2882678298, "size_in_bytes": 3593405834}}
dummy/canonical/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7b1f94b3585398b8803d8efaa0311d059f7802c16dc38fd977228344b4ad871b
3
+ size 1968
dummy/open/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7b1f94b3585398b8803d8efaa0311d059f7802c16dc38fd977228344b4ad871b
3
+ size 1968