Datasets:

Multilinguality:
monolingual
Language Creators:
crowdsourced
found
Annotations Creators:
crowdsourced
Source Datasets:
original
ArXiv:
Tags:
License:
system HF staff commited on
Commit
e73b0cb
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

.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,311 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - crowdsourced
4
+ language_creators:
5
+ - crowdsourced
6
+ - found
7
+ languages:
8
+ - de
9
+ - en
10
+ - es
11
+ - fr
12
+ - it
13
+ - ja
14
+ - nl
15
+ - pt
16
+ - ru
17
+ - zh
18
+ licenses:
19
+ - cc-by-4-0
20
+ multilinguality:
21
+ - monolingual
22
+ size_categories:
23
+ - n>1M
24
+ source_datasets:
25
+ - original
26
+ task_categories:
27
+ - text-classification
28
+ task_ids:
29
+ - multi-class-classification
30
+ ---
31
+
32
+ # Dataset Card for Conceptnet5
33
+
34
+ ## Table of Contents
35
+ - [Dataset Description](#dataset-description)
36
+ - [Dataset Summary](#dataset-summary)
37
+ - [Supported Tasks](#supported-tasks-and-leaderboards)
38
+ - [Languages](#languages)
39
+ - [Dataset Structure](#dataset-structure)
40
+ - [Data Instances](#data-instances)
41
+ - [Data Fields](#data-instances)
42
+ - [Data Splits](#data-instances)
43
+ - [Dataset Creation](#dataset-creation)
44
+ - [Curation Rationale](#curation-rationale)
45
+ - [Source Data](#source-data)
46
+ - [Annotations](#annotations)
47
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
48
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
49
+ - [Social Impact of Dataset](#social-impact-of-dataset)
50
+ - [Discussion of Biases](#discussion-of-biases)
51
+ - [Other Known Limitations](#other-known-limitations)
52
+ - [Additional Information](#additional-information)
53
+ - [Dataset Curators](#dataset-curators)
54
+ - [Licensing Information](#licensing-information)
55
+ - [Citation Information](#citation-information)
56
+
57
+ ## Dataset Description
58
+
59
+ - **Homepage:**
60
+ https://github.com/commonsense/conceptnet5/wiki
61
+ - **Repository:**
62
+ https://github.com/commonsense/conceptnet5/wiki
63
+ - **Paper:**
64
+ Robyn Speer, Joshua Chin, and Catherine Havasi. 2017. "ConceptNet 5.5: An Open Multilingual Graph of General Knowledge." In proceedings of AAAI 31.o
65
+
66
+ ### Dataset Summary
67
+
68
+ ConceptNet is a multilingual knowledge base, representing words and
69
+ phrases that people use and the common-sense relationships between
70
+ them. The knowledge in ConceptNet is collected from a variety of
71
+ resources, including crowd-sourced resources (such as Wiktionary and
72
+ Open Mind Common Sense), games with a purpose (such as Verbosity and
73
+ nadya.jp), and expert-created resources (such as WordNet and JMDict).
74
+
75
+ You can browse what ConceptNet knows at http://conceptnet.io.
76
+
77
+ This dataset is designed to provide training data
78
+ for common sense relationships pulls together from various sources.
79
+
80
+ The dataset is multi-lingual. See langauge codes and language info
81
+ here: https://github.com/commonsense/conceptnet5/wiki/Languages
82
+
83
+
84
+ This dataset provides an interface for the conceptnet5 csv file, and
85
+ some (but not all) of the raw text data used to build conceptnet5:
86
+ omcsnet_sentences_free.txt, and omcsnet_sentences_more.txt.
87
+
88
+ One use of this dataset would be to learn to extract the conceptnet
89
+ relationship from the omcsnet sentences.
90
+
91
+ Conceptnet5 has 34,074,917 relationships. Of those relationships,
92
+ there are 2,176,099 surface text sentences related to those 2M
93
+ entries.
94
+
95
+ omcsnet_sentences_free has 898,161 lines. omcsnet_sentences_more has
96
+ 2,001,736 lines.
97
+
98
+ Original downloads are available here
99
+ https://github.com/commonsense/conceptnet5/wiki/Downloads. For more
100
+ information, see: https://github.com/commonsense/conceptnet5/wiki
101
+
102
+ The omcsnet data comes with the following warning from the authors of
103
+ the above site:
104
+
105
+ Remember: this data comes from various forms of
106
+ crowdsourcing. Sentences in these files are not necessarily true,
107
+ useful, or appropriate.
108
+
109
+ ### Languages
110
+ en, fr, it, de, es, ru, pt, ja, nl, zh and others
111
+
112
+ ## Dataset Structure
113
+
114
+ ### Data Instances
115
+
116
+ There are three configurations for the dataset: conceptnet5, omcs_sentences_free, omcs_sentences_more.
117
+
118
+ Conceptnet5 defines:
119
+
120
+ ``
121
+ {
122
+ 'sentence': ...,
123
+ 'full_rel': ...,
124
+ 'rel': ...,
125
+ 'arg1': ...,
126
+ 'arg2': ...,
127
+ 'lang': ...,
128
+ 'extra_info': ...
129
+ 'weight': ...
130
+ }
131
+ ``
132
+
133
+ The omcs text defines:
134
+ ``
135
+ {
136
+ 'sentence': ...,
137
+ 'raw_data': ...
138
+ 'weight': ...
139
+ }
140
+ ``
141
+
142
+ ### Data Fields
143
+
144
+ For conceptnet5 configurations:
145
+ * full_rel: the full relationship. e.g., /a/[/r/Antonym/,/c/en/able/,/c/en/cane/]
146
+ * rel: the binary relationship. e.g., /r/Antonym
147
+ * arg1: the first argument to the binary relationship. e.g., /c/en/able
148
+ * arg2: the second argument to the binary relationship. e.g., /c/en/cane
149
+ * lang: the language code. e.g., en, fr, etc. If the arg1 and arg2 are two different languages, then the form os lang1/lang2.
150
+ * extra_info: a string that includes json data that has the dataset name, license type (mostly cc-4.0), contributor, etc. e.g., : {"dataset": "/d/verbosity", "license": "cc:by/4.0", "sources": [{"contributor": "/s/resource/verbosity"}], "surfaceEnd": "cane", "surfaceStart": "able", "surfaceText": "[[able]] is the opposite of [[cane]]", "weight": 0.299}
151
+ * sentence: the sentence from which the relationship was extracted, if one exists, with brackets around the arg1 and arg2. e.g., [[able]] is the opposite of [[cane]]
152
+ * weight: the weight assigned by the curators or automatically to the relationship, between 1.0-0.0, higher being more certain.
153
+
154
+ For the omcs text configurations:
155
+
156
+ * sentence: the raw sentence
157
+ * raw_data: the raw tab seperated data of the form, id, text, curator_id, created_on, lanugage_id, activity_id, and score. Most of this information was tied to older systems for entering the data os was not partsed into fields for the dataset. e.g., 1237278 someone can be at catch 10805 2006-11-14 17:56:49.70872-05 en 27 1
158
+ * lang: the language code
159
+
160
+ ### Data Splits
161
+
162
+ There are no splits.
163
+
164
+ ## Dataset Creation
165
+
166
+ ### Curation Rationale
167
+
168
+ This dataset was gathered and created over many years for research in common sense reasoning.
169
+
170
+ ### Source Data
171
+
172
+ #### Initial Data Collection and Normalization
173
+
174
+ Started as the Open Mind Common Sense project at MIT Media Lab in 1999. See https://en.wikipedia.org/wiki/Open_Mind_Common_Sense
175
+
176
+ #### Who are the source language producers?
177
+
178
+ Crowd Sourced
179
+
180
+ ### Annotations
181
+
182
+ #### Annotation process
183
+
184
+ Crowd Source template text, games, etc.
185
+
186
+ #### Who are the annotators?
187
+
188
+ Crowd sourced.
189
+
190
+ ### Personal and Sensitive Information
191
+
192
+ Unkown, but likely there are names of famous individuals.
193
+
194
+ ## Considerations for Using the Data
195
+
196
+ ### Social Impact of Dataset
197
+
198
+ The goal for the work is to help machines understand common sense.
199
+
200
+ ### Discussion of Biases
201
+
202
+ See the website and paper for efforts to minimize data bias, but
203
+ please note that omcs_sentences_free, omcs_sentences_more are raw data
204
+ entered by users and may very well have biased data.
205
+
206
+
207
+ ### Other Known Limitations
208
+
209
+ While the relationship dataset is large, the amount of actual sentences is limited.
210
+
211
+ ## Additional Information
212
+
213
+ ### Dataset Curators
214
+
215
+ The authors of https://github.com/commonsense/conceptnet5/wiki and Luminoso.
216
+
217
+ ### Licensing Information
218
+
219
+ This work includes data from ConceptNet 5, which was compiled by the
220
+ Commonsense Computing Initiative. ConceptNet 5 is freely available under
221
+ the Creative Commons Attribution-ShareAlike license (CC BY SA 3.0) from
222
+ http://conceptnet.io.
223
+
224
+ The included data was created by contributors to Commonsense Computing
225
+ projects, contributors to Wikimedia projects, DBPedia, OpenCyc, Games
226
+ with a Purpose, Princeton University's WordNet, Francis Bond's Open
227
+ Multilingual WordNet, and Jim Breen's JMDict.
228
+ Credits and acknowledgements
229
+ ConceptNet has been developed by:
230
+
231
+ The MIT Media Lab, through various groups at different times:
232
+
233
+ Commonsense Computing
234
+ Software Agents
235
+ Digital Intuition
236
+ The Commonsense Computing Initiative, a worldwide collaboration with contributions from:
237
+
238
+ National Taiwan University
239
+ Universidade Federal de São Carlos
240
+ Hokkaido University
241
+ Tilburg University
242
+ Nihon Unisys Labs
243
+ Dentsu Inc.
244
+ Kyoto University
245
+ Yahoo Research Japan
246
+ Luminoso Technologies, Inc.
247
+
248
+ Significant amounts of data were imported from:
249
+
250
+ WordNet, a project of Princeton University
251
+ Open Multilingual WordNet, compiled by Francis Bond and Kyonghee Paik
252
+ Wikipedia and Wiktionary, collaborative projects of the Wikimedia Foundation
253
+ Luis von Ahn's "Games with a Purpose"
254
+ JMDict, compiled by Jim Breen
255
+ CC-CEDict, by MDBG
256
+ The Unicode CLDR
257
+ DBPedia
258
+ Here is a short, incomplete list of people who have made significant contributions to the development of ConceptNet as a data resource, roughly in order of appearance:
259
+
260
+ Push Singh
261
+ Catherine Havasi
262
+ Hugo Liu
263
+ Hyemin Chung
264
+ Robyn Speer
265
+ Ken Arnold
266
+ Yen-Ling Kuo
267
+ Joshua Chin
268
+ Joanna Lowry-Duda
269
+ Robert Beaudoin
270
+ Naoki Otani
271
+ Vanya Cohen
272
+ Licenses for included resources
273
+ Commonsense Computing
274
+ The Commonsense Computing project originated at the MIT Media Lab and expanded worldwide. Tens of thousands of contributors have taken some time to teach facts to computers. Their pseudonyms can be found in the "sources" list found in ConceptNet's raw data and in its API.
275
+
276
+ Games with a Purpose
277
+ Data collected from Verbosity, one of the CMU "Games with a Purpose", is used and released under ConceptNet's license, by permission from Luis von Ahn and Harshit Surana.
278
+
279
+ Verbosity players are anonymous, so in the "sources" list, data from Verbosity is simply credited to the pseudonym "verbosity".
280
+
281
+ Wikimedia projects
282
+ ConceptNet uses data directly from Wiktionary, the free dictionary. It also uses data from Wikipedia, the free encyclopedia via DBPedia.
283
+
284
+ Wiktionary and Wikipedia are collaborative projects, authored by their respective online communities. They are currently released under the Creative Commons Attribution-ShareAlike license.
285
+
286
+ Wikimedia encourages giving attribution by providing links to the hosted pages that the data came from, and DBPedia asks for the same thing in turn. In addition to crediting the assertions that came from Wiktionary and DBPedia, we also provide "ExternalURL" edges pointing to the page that they came from. For example, the term /c/de/sprache has an ExternalURL link pointing to http://en.wiktionary.org/wiki/Sprache. Its list of individual contributors can be seen by following its "History" link.
287
+
288
+ The URLs of links to DBPedia are the same as the resource names that DBPedia uses, encouraging interoperability with their linked data.
289
+
290
+ WordNet
291
+ WordNet is available under an unencumbered license: see http://wordnet.princeton.edu/wordnet/license/. Its text is reproduced below:
292
+
293
+ WordNet Release 3.0
294
+
295
+ This software and database is being provided to you, the LICENSEE, by Princeton University under the following license. By obtaining, using and/or copying this software and database, you agree that you have read, understood, and will comply with these terms and conditions.:
296
+
297
+ Permission to use, copy, modify and distribute this software and database and its documentation for any purpose and without fee or royalty is hereby granted, provided that you agree to comply with the following copyright notice and statements, including the disclaimer, and that the same appear on ALL copies of the software, database and documentation, including modifications that you make for internal use or for distribution.
298
+
299
+ WordNet 3.0 Copyright 2006 by Princeton University. All rights reserved.
300
+
301
+ THIS SOFTWARE AND DATABASE IS PROVIDED "AS IS" AND PRINCETON UNIVERSITY MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PRINCETON UNIVERSITY MAKES NO REPRESENTATIONS OR WARRANTIES OF MERCHANT- ABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE LICENSED SOFTWARE, DATABASE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
302
+
303
+ The name of Princeton University or Princeton may not be used in advertising or publicity pertaining to distribution of the software and/or database. Title to copyright in this software, database and any associated documentation shall at all times remain with Princeton University and LICENSEE agrees to preserve same.
304
+
305
+ Open Multilingual WordNet
306
+ Open Multilingual WordNet was compiled by Francis Bond, Kyonghee Paik, and Ryan Foster, from data provided by many multilingual WordNet projects. Here is the complete list of references to the projects that created the data.
307
+
308
+
309
+ ### Citation Information
310
+
311
+ Robyn Speer, Joshua Chin, and Catherine Havasi. 2017. "ConceptNet 5.5: An Open Multilingual Graph of General Knowledge." In proceedings of AAAI 31.
conceptnet5.py ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """Conceptnet 5.7.0 and OMCSNet raw data"""
16
+
17
+ from __future__ import absolute_import, division, print_function
18
+
19
+ import json
20
+
21
+ import datasets
22
+
23
+
24
+ # Find for instance the citation on arxiv or on the dataset repo/website
25
+ _CITATION = """\
26
+ Robyn Speer, Joshua Chin, and Catherine Havasi. 2017. "ConceptNet 5.5: An Open Multilingual Graph of General Knowledge." In proceedings of AAAI 31.
27
+ }
28
+ """
29
+
30
+ # You can copy an official description
31
+ _DESCRIPTION = """This dataset is designed to provide training data
32
+ for common sense relationships pulls together from various sources.
33
+
34
+ The dataset is multi-lingual. See langauge codes and language info
35
+ here: https://github.com/commonsense/conceptnet5/wiki/Languages
36
+
37
+
38
+ This dataset provides an interface for the conceptnet5 csv file, and
39
+ some (but not all) of the raw text data used to build conceptnet5:
40
+ omcsnet_sentences_free.txt, and omcsnet_sentences_more.txt.
41
+
42
+ One use of this dataset would be to learn to extract the conceptnet
43
+ relationship from the omcsnet sentences.
44
+
45
+ Conceptnet5 has 34,074,917 relationships. Of those relationships,
46
+ there are 2,176,099 surface text sentences related to those 2M
47
+ entries.
48
+
49
+ omcsnet_sentences_free has 898,161 lines. omcsnet_sentences_more has
50
+ 2,001,736 lines.
51
+
52
+ Original downloads are available here
53
+ https://github.com/commonsense/conceptnet5/wiki/Downloads. For more
54
+ information, see: https://github.com/commonsense/conceptnet5/wiki
55
+
56
+ The omcsnet data comes with the following warning from the authors of
57
+ the above site: Remember: this data comes from various forms of
58
+ crowdsourcing. Sentences in these files are not necessarily true,
59
+ useful, or appropriate.
60
+
61
+ """
62
+
63
+
64
+ _LICENSE = """
65
+ This work includes data from ConceptNet 5, which was compiled by the
66
+ Commonsense Computing Initiative. ConceptNet 5 is freely available under
67
+ the Creative Commons Attribution-ShareAlike license (CC BY SA 3.0) from
68
+ http://conceptnet.io.
69
+
70
+ The included data was created by contributors to Commonsense Computing
71
+ projects, contributors to Wikimedia projects, DBPedia, OpenCyc, Games
72
+ with a Purpose, Princeton University's WordNet, Francis Bond's Open
73
+ Multilingual WordNet, and Jim Breen's JMDict.
74
+
75
+ There are various othe licenses. See:
76
+ https://github.com/commonsense/conceptnet5/wiki/Copying-and-sharing-ConceptNet
77
+ """
78
+
79
+ _URLs = {
80
+ "conceptnet5": "https://s3.amazonaws.com/conceptnet/downloads/2019/edges/conceptnet-assertions-5.7.0.csv.gz",
81
+ "omcs_sentences_free": "https://s3.amazonaws.com/conceptnet/downloads/2018/omcs-sentences-free.txt",
82
+ "omcs_sentences_more": "https://s3.amazonaws.com/conceptnet/downloads/2018/omcs-sentences-more.txt",
83
+ }
84
+
85
+
86
+ class Conceptnet5(datasets.GeneratorBasedBuilder):
87
+ """Conceptnet5 dataset for common sense graphs and underlying sentences."""
88
+
89
+ VERSION = datasets.Version("0.1.0")
90
+
91
+ BUILDER_CONFIGS = [
92
+ datasets.BuilderConfig(
93
+ name="conceptnet5", description="The relationships defined by conceptnet5", version="5.7.0"
94
+ ),
95
+ datasets.BuilderConfig(name="omcs_sentences_free", description="OMCSNet free form text", version="5.7.0"),
96
+ datasets.BuilderConfig(
97
+ name="omcs_sentences_more",
98
+ description="OMCSNet free form text, and text from templates, games, responses to questions, and so on",
99
+ version="5.7.0",
100
+ ),
101
+ ]
102
+
103
+ DEFAULT_CONFIG_NAME = "conceptnet5"
104
+
105
+ def _info(self):
106
+ if self.config.name == "conceptnet5":
107
+ features = datasets.Features(
108
+ {
109
+ "sentence": datasets.Value("string"),
110
+ "full_rel": datasets.Value("string"),
111
+ "rel": datasets.Value("string"),
112
+ "arg1": datasets.Value("string"),
113
+ "arg2": datasets.Value("string"),
114
+ "lang": datasets.Value("string"),
115
+ "extra_info": datasets.Value("string"),
116
+ "weight": datasets.Value("float"),
117
+ }
118
+ )
119
+ else:
120
+ features = datasets.Features(
121
+ {
122
+ "sentence": datasets.Value("string"),
123
+ "raw_data": datasets.Value("string"),
124
+ "lang": datasets.Value("string"),
125
+ }
126
+ )
127
+ return datasets.DatasetInfo(
128
+ description=_DESCRIPTION,
129
+ features=features,
130
+ supervised_keys=None,
131
+ homepage="https://github.com/commonsense/conceptnet5/wiki",
132
+ license=_LICENSE,
133
+ citation=_CITATION,
134
+ )
135
+
136
+ def _split_generators(self, dl_manager):
137
+ """Returns SplitGenerators."""
138
+ my_urls = _URLs[self.config.name]
139
+ data_dir = dl_manager.download_and_extract(my_urls)
140
+ return [
141
+ datasets.SplitGenerator(
142
+ name=datasets.Split.TRAIN,
143
+ gen_kwargs={
144
+ "filepath": data_dir,
145
+ "split": "train",
146
+ },
147
+ ),
148
+ ]
149
+
150
+ def _generate_examples(self, filepath, split):
151
+ """ Yields examples from the conceptnet5 graph if the config is 'conceptnet5', otherwise yields the sentences for omcs. """
152
+
153
+ with open(filepath, "rb") as f:
154
+ for id_, row in enumerate(f):
155
+ if self.config.name == "conceptnet5":
156
+ row = row.split(b"\t")
157
+ s = row[4]
158
+ data = json.loads(s)
159
+ lang1 = row[2].split(b"/")[2].decode("utf-8")
160
+ lang2 = row[3].split(b"/")[2].decode("utf-8")
161
+ if lang1 == lang2:
162
+ lang = lang1
163
+ else:
164
+ lang = lang1 + "/" + lang2
165
+ if "surfaceText" in data:
166
+ sentence = data["surfaceText"].strip()
167
+ else:
168
+ sentence = ""
169
+ if b"weight" in data:
170
+ weight = float(data[b"weight"])
171
+ else:
172
+ weight = 1.0
173
+ yield id_, {
174
+ "sentence": sentence,
175
+ "full_rel": row[0].decode("utf-8"),
176
+ "rel": row[1].decode("utf-8"),
177
+ "arg1": row[2].decode("utf-8"),
178
+ "arg2": row[3].decode("utf-8"),
179
+ "lang": lang,
180
+ "extra_info": row[4].decode("utf-8"),
181
+ "weight": weight,
182
+ }
183
+ else:
184
+ row = row.decode("utf-8").strip()
185
+ data = row.split("\t")
186
+ if len(data) > 1:
187
+ sentence = data[1]
188
+ lang = data[4]
189
+ else:
190
+ continue
191
+ yield id_, {
192
+ "raw_data": row,
193
+ "sentence": sentence,
194
+ "lang": lang,
195
+ }
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
1
+ {"conceptnet5": {"description": "\\ This dataset is designed to provide training data\nfor common sense relationships pulls together from various\nsources. \n\nThe dataset is multi-lingual. See langauge codes and language info\nhere: https://github.com/commonsense/conceptnet5/wiki/Languages\n\n\nThis dataset provides an interface for the conceptnet5 csv file, and\nsome (but not all) of the raw text data used to build conceptnet5:\nomcsnet_sentences_free.txt, and omcsnet_sentences_more.txt.\n\nOne use of this dataset would be to learn to extract the conceptnet\nrelationship from the omcsnet sentences.\n\nConceptnet5 has 34,074,917 relationships. Of those relationships,\nthere are 2,176,099 surface text sentences related to those 2M\nentries.\n\nomcsnet_sentences_free has 898,161 lines. omcsnet_sentences_more has\n2,001,736 lines.\n\nOriginal downloads are available here\nhttps://github.com/commonsense/conceptnet5/wiki/Downloads. For more\ninformation, see: https://github.com/commonsense/conceptnet5/wiki\n\nThe omcsnet data comes with the following warning from the authors of\nthe above site: \n\nRemember: this data comes from various forms of\ncrowdsourcing. Sentences in these files are not necessarily true,\nuseful, or appropriate.\n\n", "citation": "Robyn Speer, Joshua Chin, and Catherine Havasi. 2017. \"ConceptNet 5.5: An Open Multilingual Graph of General Knowledge.\" In proceedings of AAAI 31.\n}\n", "homepage": "https://github.com/commonsense/conceptnet5/wiki", "license": "\nThis work includes data from ConceptNet 5, which was compiled by the\nCommonsense Computing Initiative. ConceptNet 5 is freely available under\nthe Creative Commons Attribution-ShareAlike license (CC BY SA 3.0) from\nhttp://conceptnet.io.\n\nThe included data was created by contributors to Commonsense Computing\nprojects, contributors to Wikimedia projects, DBPedia, OpenCyc, Games\nwith a Purpose, Princeton University's WordNet, Francis Bond's Open\nMultilingual WordNet, and Jim Breen's JMDict.\n\nThere are various othe licenses. See:\nhttps://github.com/commonsense/conceptnet5/wiki/Copying-and-sharing-ConceptNet\n", "features": {"sentence": {"dtype": "string", "id": null, "_type": "Value"}, "full_rel": {"dtype": "string", "id": null, "_type": "Value"}, "rel": {"dtype": "string", "id": null, "_type": "Value"}, "arg1": {"dtype": "string", "id": null, "_type": "Value"}, "arg2": {"dtype": "string", "id": null, "_type": "Value"}, "lang": {"dtype": "string", "id": null, "_type": "Value"}, "extra_info": {"dtype": "string", "id": null, "_type": "Value"}, "weight": {"dtype": "float32", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "conceptnet5", "config_name": "conceptnet5", "version": {"version_str": "5.7.0", "description": null, "major": 5, "minor": 7, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 11493868180, "num_examples": 34074917, "dataset_name": "conceptnet5"}}, "download_checksums": {"https://s3.amazonaws.com/conceptnet/downloads/2019/edges/conceptnet-assertions-5.7.0.csv.gz": {"num_bytes": 497963447, "checksum": "accd65fe94038584295574ddc26e1500c1919c8c4532bf771811cafd0948af7e"}}, "download_size": 497963447, "post_processing_size": null, "dataset_size": 11493868180, "size_in_bytes": 11991831627}, "omcs_sentences_free": {"description": "\\ This dataset is designed to provide training data\nfor common sense relationships pulls together from various\nsources. \n\nThe dataset is multi-lingual. See langauge codes and language info\nhere: https://github.com/commonsense/conceptnet5/wiki/Languages\n\n\nThis dataset provides an interface for the conceptnet5 csv file, and\nsome (but not all) of the raw text data used to build conceptnet5:\nomcsnet_sentences_free.txt, and omcsnet_sentences_more.txt.\n\nOne use of this dataset would be to learn to extract the conceptnet\nrelationship from the omcsnet sentences.\n\nConceptnet5 has 34,074,917 relationships. Of those relationships,\nthere are 2,176,099 surface text sentences related to those 2M\nentries.\n\nomcsnet_sentences_free has 898,161 lines. omcsnet_sentences_more has\n2,001,736 lines.\n\nOriginal downloads are available here\nhttps://github.com/commonsense/conceptnet5/wiki/Downloads. For more\ninformation, see: https://github.com/commonsense/conceptnet5/wiki\n\nThe omcsnet data comes with the following warning from the authors of\nthe above site: \n\nRemember: this data comes from various forms of\ncrowdsourcing. Sentences in these files are not necessarily true,\nuseful, or appropriate.\n\n", "citation": "Robyn Speer, Joshua Chin, and Catherine Havasi. 2017. \"ConceptNet 5.5: An Open Multilingual Graph of General Knowledge.\" In proceedings of AAAI 31.\n}\n", "homepage": "https://github.com/commonsense/conceptnet5/wiki", "license": "\nThis work includes data from ConceptNet 5, which was compiled by the\nCommonsense Computing Initiative. ConceptNet 5 is freely available under\nthe Creative Commons Attribution-ShareAlike license (CC BY SA 3.0) from\nhttp://conceptnet.io.\n\nThe included data was created by contributors to Commonsense Computing\nprojects, contributors to Wikimedia projects, DBPedia, OpenCyc, Games\nwith a Purpose, Princeton University's WordNet, Francis Bond's Open\nMultilingual WordNet, and Jim Breen's JMDict.\n\nThere are various othe licenses. See:\nhttps://github.com/commonsense/conceptnet5/wiki/Copying-and-sharing-ConceptNet\n", "features": {"sentence": {"dtype": "string", "id": null, "_type": "Value"}, "raw_data": {"dtype": "string", "id": null, "_type": "Value"}, "lang": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "conceptnet5", "config_name": "omcs_sentences_free", "version": {"version_str": "5.7.0", "description": null, "major": 5, "minor": 7, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 174811310, "num_examples": 898160, "dataset_name": "conceptnet5"}}, "download_checksums": {"https://s3.amazonaws.com/conceptnet/downloads/2018/omcs-sentences-free.txt": {"num_bytes": 104247648, "checksum": "ec6c2631d6c2be32cf4332b025aa35064172c26168e89657477ecadf612ec41d"}}, "download_size": 104247648, "post_processing_size": null, "dataset_size": 174811310, "size_in_bytes": 279058958}, "omcs_sentences_more": {"description": "\\ This dataset is designed to provide training data\nfor common sense relationships pulls together from various\nsources. \n\nThe dataset is multi-lingual. See langauge codes and language info\nhere: https://github.com/commonsense/conceptnet5/wiki/Languages\n\n\nThis dataset provides an interface for the conceptnet5 csv file, and\nsome (but not all) of the raw text data used to build conceptnet5:\nomcsnet_sentences_free.txt, and omcsnet_sentences_more.txt.\n\nOne use of this dataset would be to learn to extract the conceptnet\nrelationship from the omcsnet sentences.\n\nConceptnet5 has 34,074,917 relationships. Of those relationships,\nthere are 2,176,099 surface text sentences related to those 2M\nentries.\n\nomcsnet_sentences_free has 898,161 lines. omcsnet_sentences_more has\n2,001,736 lines.\n\nOriginal downloads are available here\nhttps://github.com/commonsense/conceptnet5/wiki/Downloads. For more\ninformation, see: https://github.com/commonsense/conceptnet5/wiki\n\nThe omcsnet data comes with the following warning from the authors of\nthe above site: \n\nRemember: this data comes from various forms of\ncrowdsourcing. Sentences in these files are not necessarily true,\nuseful, or appropriate.\n\n", "citation": "Robyn Speer, Joshua Chin, and Catherine Havasi. 2017. \"ConceptNet 5.5: An Open Multilingual Graph of General Knowledge.\" In proceedings of AAAI 31.\n}\n", "homepage": "https://github.com/commonsense/conceptnet5/wiki", "license": "\nThis work includes data from ConceptNet 5, which was compiled by the\nCommonsense Computing Initiative. ConceptNet 5 is freely available under\nthe Creative Commons Attribution-ShareAlike license (CC BY SA 3.0) from\nhttp://conceptnet.io.\n\nThe included data was created by contributors to Commonsense Computing\nprojects, contributors to Wikimedia projects, DBPedia, OpenCyc, Games\nwith a Purpose, Princeton University's WordNet, Francis Bond's Open\nMultilingual WordNet, and Jim Breen's JMDict.\n\nThere are various othe licenses. See:\nhttps://github.com/commonsense/conceptnet5/wiki/Copying-and-sharing-ConceptNet\n", "features": {"sentence": {"dtype": "string", "id": null, "_type": "Value"}, "raw_data": {"dtype": "string", "id": null, "_type": "Value"}, "lang": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "conceptnet5", "config_name": "omcs_sentences_more", "version": "5.7.0", "splits": {"train": {"name": "train", "num_bytes": 341424279, "num_examples": 2001735, "dataset_name": "conceptnet5"}}, "download_checksums": {"https://s3.amazonaws.com/conceptnet/downloads/2018/omcs-sentences-more.txt": {"num_bytes": 209776958, "checksum": "1bebca297d2c82c44e816bb13d0ea4c1a9c6ee83c435f19e2e5dd744c988d30f"}}, "download_size": 209776958, "post_processing_size": null, "dataset_size": 341424279, "size_in_bytes": 551201237}}
dummy/conceptnet5/5.7.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d0f578cb42c711135255dd1a97e6b147aff0dd7e532b044dc0f11a22267c288a
3
+ size 565
dummy/omcs_sentences_free/5.7.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:520ad9c4925f1f4242b12f415fb51ea018da386e01f9d56d279f3ee2328c5aca
3
+ size 517
dummy/omcs_sentences_more/5.7.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e33aca73ea14fcc6c1b927edb0c93c3aa8c3cf92dd9242b624ed36e1fecd4f42
3
+ size 549