Datasets:

Multilinguality:
monolingual
Language Creators:
crowdsourced
found
Annotations Creators:
crowdsourced
Source Datasets:
original
ArXiv:
Tags:
License:
albertvillanova HF staff commited on
Commit
075e1c6
1 Parent(s): 0455262

Convert dataset to Parquet (#3)

Browse files

- Convert dataset to Parquet (1355b881c8142fdbcc9d158569fd86ef1d167c45)
- Add omcs_sentences_free data files (93f11e33fcb65ceed2ecc28d1973896b2054af1d)
- Add omcs_sentences_more data files (4464dc4f967eb7c7470a336ba86f19a428f7c1c7)
- Delete loading script (9092df33df40904f997cdb38f952af66817e620e)

README.md CHANGED
@@ -31,6 +31,10 @@ task_ids:
31
  - multi-class-classification
32
  paperswithcode_id: conceptnet
33
  pretty_name: Conceptnet5
 
 
 
 
34
  dataset_info:
35
  - config_name: conceptnet5
36
  features:
@@ -52,10 +56,10 @@ dataset_info:
52
  dtype: float32
53
  splits:
54
  - name: train
55
- num_bytes: 11493868180
56
  num_examples: 34074917
57
- download_size: 497963447
58
- dataset_size: 11493868180
59
  - config_name: omcs_sentences_free
60
  features:
61
  - name: sentence
@@ -66,10 +70,10 @@ dataset_info:
66
  dtype: string
67
  splits:
68
  - name: train
69
- num_bytes: 174811310
70
  num_examples: 898160
71
- download_size: 104247648
72
- dataset_size: 174811310
73
  - config_name: omcs_sentences_more
74
  features:
75
  - name: sentence
@@ -80,14 +84,24 @@ dataset_info:
80
  dtype: string
81
  splits:
82
  - name: train
83
- num_bytes: 341424279
84
  num_examples: 2001735
85
- download_size: 209776958
86
- dataset_size: 341424279
87
- config_names:
88
- - conceptnet5
89
- - omcs_sentences_free
90
- - omcs_sentences_more
 
 
 
 
 
 
 
 
 
 
91
  ---
92
 
93
  # Dataset Card for Conceptnet5
31
  - multi-class-classification
32
  paperswithcode_id: conceptnet
33
  pretty_name: Conceptnet5
34
+ config_names:
35
+ - conceptnet5
36
+ - omcs_sentences_free
37
+ - omcs_sentences_more
38
  dataset_info:
39
  - config_name: conceptnet5
40
  features:
56
  dtype: float32
57
  splits:
58
  - name: train
59
+ num_bytes: 11493772756
60
  num_examples: 34074917
61
+ download_size: 1280623369
62
+ dataset_size: 11493772756
63
  - config_name: omcs_sentences_free
64
  features:
65
  - name: sentence
70
  dtype: string
71
  splits:
72
  - name: train
73
+ num_bytes: 174810230
74
  num_examples: 898160
75
+ download_size: 72941617
76
+ dataset_size: 174810230
77
  - config_name: omcs_sentences_more
78
  features:
79
  - name: sentence
84
  dtype: string
85
  splits:
86
  - name: train
87
+ num_bytes: 341421867
88
  num_examples: 2001735
89
+ download_size: 129630544
90
+ dataset_size: 341421867
91
+ configs:
92
+ - config_name: conceptnet5
93
+ data_files:
94
+ - split: train
95
+ path: conceptnet5/train-*
96
+ default: true
97
+ - config_name: omcs_sentences_free
98
+ data_files:
99
+ - split: train
100
+ path: omcs_sentences_free/train-*
101
+ - config_name: omcs_sentences_more
102
+ data_files:
103
+ - split: train
104
+ path: omcs_sentences_more/train-*
105
  ---
106
 
107
  # Dataset Card for Conceptnet5
conceptnet5.py DELETED
@@ -1,194 +0,0 @@
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
-
18
- import json
19
-
20
- import datasets
21
-
22
-
23
- # Find for instance the citation on arxiv or on the dataset repo/website
24
- _CITATION = """\
25
- Robyn Speer, Joshua Chin, and Catherine Havasi. 2017. "ConceptNet 5.5: An Open Multilingual Graph of General Knowledge." In proceedings of AAAI 31.
26
- }
27
- """
28
-
29
- # You can copy an official description
30
- _DESCRIPTION = """This dataset is designed to provide training data
31
- for common sense relationships pulls together from various sources.
32
-
33
- The dataset is multi-lingual. See langauge codes and language info
34
- here: https://github.com/commonsense/conceptnet5/wiki/Languages
35
-
36
-
37
- This dataset provides an interface for the conceptnet5 csv file, and
38
- some (but not all) of the raw text data used to build conceptnet5:
39
- omcsnet_sentences_free.txt, and omcsnet_sentences_more.txt.
40
-
41
- One use of this dataset would be to learn to extract the conceptnet
42
- relationship from the omcsnet sentences.
43
-
44
- Conceptnet5 has 34,074,917 relationships. Of those relationships,
45
- there are 2,176,099 surface text sentences related to those 2M
46
- entries.
47
-
48
- omcsnet_sentences_free has 898,161 lines. omcsnet_sentences_more has
49
- 2,001,736 lines.
50
-
51
- Original downloads are available here
52
- https://github.com/commonsense/conceptnet5/wiki/Downloads. For more
53
- information, see: https://github.com/commonsense/conceptnet5/wiki
54
-
55
- The omcsnet data comes with the following warning from the authors of
56
- the above site: Remember: this data comes from various forms of
57
- crowdsourcing. Sentences in these files are not necessarily true,
58
- useful, or appropriate.
59
-
60
- """
61
-
62
-
63
- _LICENSE = """
64
- This work includes data from ConceptNet 5, which was compiled by the
65
- Commonsense Computing Initiative. ConceptNet 5 is freely available under
66
- the Creative Commons Attribution-ShareAlike license (CC BY SA 3.0) from
67
- http://conceptnet.io.
68
-
69
- The included data was created by contributors to Commonsense Computing
70
- projects, contributors to Wikimedia projects, DBPedia, OpenCyc, Games
71
- with a Purpose, Princeton University's WordNet, Francis Bond's Open
72
- Multilingual WordNet, and Jim Breen's JMDict.
73
-
74
- There are various othe licenses. See:
75
- https://github.com/commonsense/conceptnet5/wiki/Copying-and-sharing-ConceptNet
76
- """
77
-
78
- _URLs = {
79
- "conceptnet5": "https://s3.amazonaws.com/conceptnet/downloads/2019/edges/conceptnet-assertions-5.7.0.csv.gz",
80
- "omcs_sentences_free": "https://s3.amazonaws.com/conceptnet/downloads/2018/omcs-sentences-free.txt",
81
- "omcs_sentences_more": "https://s3.amazonaws.com/conceptnet/downloads/2018/omcs-sentences-more.txt",
82
- }
83
-
84
-
85
- class Conceptnet5(datasets.GeneratorBasedBuilder):
86
- """Conceptnet5 dataset for common sense graphs and underlying sentences."""
87
-
88
- VERSION = datasets.Version("0.1.0")
89
-
90
- BUILDER_CONFIGS = [
91
- datasets.BuilderConfig(
92
- name="conceptnet5", description="The relationships defined by conceptnet5", version="5.7.0"
93
- ),
94
- datasets.BuilderConfig(name="omcs_sentences_free", description="OMCSNet free form text", version="5.7.0"),
95
- datasets.BuilderConfig(
96
- name="omcs_sentences_more",
97
- description="OMCSNet free form text, and text from templates, games, responses to questions, and so on",
98
- version="5.7.0",
99
- ),
100
- ]
101
-
102
- DEFAULT_CONFIG_NAME = "conceptnet5"
103
-
104
- def _info(self):
105
- if self.config.name == "conceptnet5":
106
- features = datasets.Features(
107
- {
108
- "sentence": datasets.Value("string"),
109
- "full_rel": datasets.Value("string"),
110
- "rel": datasets.Value("string"),
111
- "arg1": datasets.Value("string"),
112
- "arg2": datasets.Value("string"),
113
- "lang": datasets.Value("string"),
114
- "extra_info": datasets.Value("string"),
115
- "weight": datasets.Value("float"),
116
- }
117
- )
118
- else:
119
- features = datasets.Features(
120
- {
121
- "sentence": datasets.Value("string"),
122
- "raw_data": datasets.Value("string"),
123
- "lang": datasets.Value("string"),
124
- }
125
- )
126
- return datasets.DatasetInfo(
127
- description=_DESCRIPTION,
128
- features=features,
129
- supervised_keys=None,
130
- homepage="https://github.com/commonsense/conceptnet5/wiki",
131
- license=_LICENSE,
132
- citation=_CITATION,
133
- )
134
-
135
- def _split_generators(self, dl_manager):
136
- """Returns SplitGenerators."""
137
- my_urls = _URLs[self.config.name]
138
- data_dir = dl_manager.download_and_extract(my_urls)
139
- return [
140
- datasets.SplitGenerator(
141
- name=datasets.Split.TRAIN,
142
- gen_kwargs={
143
- "filepath": data_dir,
144
- "split": "train",
145
- },
146
- ),
147
- ]
148
-
149
- def _generate_examples(self, filepath, split):
150
- """Yields examples from the conceptnet5 graph if the config is 'conceptnet5', otherwise yields the sentences for omcs."""
151
-
152
- with open(filepath, "rb") as f:
153
- for id_, row in enumerate(f):
154
- if self.config.name == "conceptnet5":
155
- row = row.split(b"\t")
156
- s = row[4]
157
- data = json.loads(s)
158
- lang1 = row[2].split(b"/")[2].decode("utf-8")
159
- lang2 = row[3].split(b"/")[2].decode("utf-8")
160
- if lang1 == lang2:
161
- lang = lang1
162
- else:
163
- lang = lang1 + "/" + lang2
164
- if "surfaceText" in data:
165
- sentence = data["surfaceText"].strip()
166
- else:
167
- sentence = ""
168
- if b"weight" in data:
169
- weight = float(data[b"weight"])
170
- else:
171
- weight = 1.0
172
- yield id_, {
173
- "sentence": sentence,
174
- "full_rel": row[0].decode("utf-8"),
175
- "rel": row[1].decode("utf-8"),
176
- "arg1": row[2].decode("utf-8"),
177
- "arg2": row[3].decode("utf-8"),
178
- "lang": lang,
179
- "extra_info": row[4].decode("utf-8"),
180
- "weight": weight,
181
- }
182
- else:
183
- row = row.decode("utf-8").strip()
184
- data = row.split("\t")
185
- if len(data) > 1:
186
- sentence = data[1]
187
- lang = data[4]
188
- else:
189
- continue
190
- yield id_, {
191
- "raw_data": row,
192
- "sentence": sentence,
193
- "lang": lang,
194
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
conceptnet5/train-00000-of-00023.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2e9b2067e4cd5ab9b0adf69aac2360aa662ca13152a15ca3f4e06b6e3c8d1af6
3
+ size 68723520
conceptnet5/train-00001-of-00023.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:14333c6c2cb2e752d12a7af391fa2900fcf949a84899f0a31315dc965ffb3569
3
+ size 54587972
conceptnet5/train-00002-of-00023.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5a2bfe1a51bcea66f86c39c6388af3d94fe7b932ad67c7d3f8f12d444ef4814c
3
+ size 57123740
conceptnet5/train-00003-of-00023.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3c052307def5f9432a169f253733e7c3ad9d68d7784db5934f2ad0513d488284
3
+ size 49892945
conceptnet5/train-00004-of-00023.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4007e6b90735643379812510675fcd7890e584b3fea5f804fc64325c1a45c7bb
3
+ size 46466451
conceptnet5/train-00005-of-00023.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f24c891e9b53eb8434b8ee3ba0de57e47c4759f37a0c2d95d71dfd26f772c54d
3
+ size 52857064
conceptnet5/train-00006-of-00023.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6efc95a549315a8de3d3d2f93c753897d5ad43100af77498058b1f78baa27e6b
3
+ size 50854896
conceptnet5/train-00007-of-00023.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9c0f332e48dc788bb16bc803df3a3d4e13baad3138b86132f9795cc9762c8cd2
3
+ size 54884758
conceptnet5/train-00008-of-00023.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:965e9c60f499cccc57e37ba21a637d2396ff26a5a24e8537ca5b0e8c484504af
3
+ size 45063269
conceptnet5/train-00009-of-00023.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bafcc5d228dbbe1b2afd2c6db48492b2bebc33ecbdb0abc03dda3ec439486a8c
3
+ size 34027100
conceptnet5/train-00010-of-00023.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dea19f45b3e483176e33c46c0d8f1e6b8cc3b6415752637314f2578718c6655b
3
+ size 41145706
conceptnet5/train-00011-of-00023.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:698cc67c5cb1a5efbbfd2b79d9c7275c0f7c9071d3b05d8189c55fbdec9aa079
3
+ size 83339221
conceptnet5/train-00012-of-00023.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c1729f9e617dc184f7622e791aae84f3c80e68fa563b2e57e2f589b027ef59ca
3
+ size 47567897
conceptnet5/train-00013-of-00023.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3d4b1f87f934cd95e663d44c686d8f084c043461311eae9995e160ec6de46ba0
3
+ size 48384045
conceptnet5/train-00014-of-00023.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3a61ce97a00f559d02a325d513053b3661048d1d58701232cb4a2c62abd55afa
3
+ size 40074985
conceptnet5/train-00015-of-00023.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9eb0933610ec423467860c2c753b79e4a4ecd7eaa3179bd6f9e3338aca05de77
3
+ size 37353940
conceptnet5/train-00016-of-00023.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4130852bf2282d2b7856690a58a79b318dbf2b0cc1e6a35717d6555ddf0437f1
3
+ size 47039264
conceptnet5/train-00017-of-00023.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a16231f6c735a0326a2cc2dc12e2ecceab0a07dca7499ae3ada15252c40d9df1
3
+ size 45952560
conceptnet5/train-00018-of-00023.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c1345c2e93c71a9813e2641d13406809192c87351e566b29a902b74967fae7f7
3
+ size 62123402
conceptnet5/train-00019-of-00023.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9fb032495085bcd6ccc19a8c3409506f08aa8c8fb3a7dcd6b78c43656a77a6ff
3
+ size 62521900
conceptnet5/train-00020-of-00023.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6b69953643fed134e2f57e2704aa119d3f459f5f337370fea258722e832b43d0
3
+ size 85988596
conceptnet5/train-00021-of-00023.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5b4450264a918a81b5fd2b27dfafb9a4161fdd9486be3315282566e3678f3efc
3
+ size 73439279
conceptnet5/train-00022-of-00023.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:be4ef98327a84cd15c402aded97ca8eb8ba0cda6543b3d27747fa242f024fbba
3
+ size 91210859
omcs_sentences_free/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:37b6a4a4642076a9c705cee74914c8523d0cb4d018ece8815d520c7a44e88558
3
+ size 72941617
omcs_sentences_more/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:095f36420b7889846c36b5527b7df8180eb76a1bdd3e50b3cb00873a5eecfe6e
3
+ size 129630544