Datasets:
Tasks:
Text2Text Generation
Modalities:
Text
Formats:
parquet
Languages:
English
Size:
10K - 100K
ArXiv:
Tags:
concepts-to-text
License:
Commit
•
792db81
1
Parent(s):
1740c86
Convert dataset to Parquet (#3)
Browse files- Convert dataset to Parquet (6bcab1cb9e2593b6ad4b3c0487d58c06defe659d)
- Delete loading script (4c592de4da0bddd9aa3511021ae8c73a0fb46a4e)
- Delete legacy dataset_infos.json (4ef68a2650bf5983b0f03fc039332515959f59c4)
- README.md +17 -8
- common_gen.py +0 -109
- data/test-00000-of-00001.parquet +3 -0
- data/train-00000-of-00001.parquet +3 -0
- data/validation-00000-of-00001.parquet +3 -0
- dataset_infos.json +0 -1
README.md
CHANGED
@@ -1,16 +1,15 @@
|
|
1 |
---
|
2 |
annotations_creators:
|
3 |
- crowdsourced
|
4 |
-
language:
|
5 |
-
- en
|
6 |
language_creators:
|
7 |
- found
|
8 |
- crowdsourced
|
|
|
|
|
9 |
license:
|
10 |
- mit
|
11 |
multilinguality:
|
12 |
- monolingual
|
13 |
-
pretty_name: CommonGen
|
14 |
size_categories:
|
15 |
- 10K<n<100K
|
16 |
source_datasets:
|
@@ -19,6 +18,7 @@ task_categories:
|
|
19 |
- text2text-generation
|
20 |
task_ids: []
|
21 |
paperswithcode_id: commongen
|
|
|
22 |
tags:
|
23 |
- concepts-to-text
|
24 |
dataset_info:
|
@@ -31,16 +31,25 @@ dataset_info:
|
|
31 |
dtype: string
|
32 |
splits:
|
33 |
- name: train
|
34 |
-
num_bytes:
|
35 |
num_examples: 67389
|
36 |
- name: validation
|
37 |
-
num_bytes:
|
38 |
num_examples: 4018
|
39 |
- name: test
|
40 |
-
num_bytes:
|
41 |
num_examples: 1497
|
42 |
-
download_size:
|
43 |
-
dataset_size:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
---
|
45 |
|
46 |
# Dataset Card for "common_gen"
|
|
|
1 |
---
|
2 |
annotations_creators:
|
3 |
- crowdsourced
|
|
|
|
|
4 |
language_creators:
|
5 |
- found
|
6 |
- crowdsourced
|
7 |
+
language:
|
8 |
+
- en
|
9 |
license:
|
10 |
- mit
|
11 |
multilinguality:
|
12 |
- monolingual
|
|
|
13 |
size_categories:
|
14 |
- 10K<n<100K
|
15 |
source_datasets:
|
|
|
18 |
- text2text-generation
|
19 |
task_ids: []
|
20 |
paperswithcode_id: commongen
|
21 |
+
pretty_name: CommonGen
|
22 |
tags:
|
23 |
- concepts-to-text
|
24 |
dataset_info:
|
|
|
31 |
dtype: string
|
32 |
splits:
|
33 |
- name: train
|
34 |
+
num_bytes: 6724166
|
35 |
num_examples: 67389
|
36 |
- name: validation
|
37 |
+
num_bytes: 408740
|
38 |
num_examples: 4018
|
39 |
- name: test
|
40 |
+
num_bytes: 77518
|
41 |
num_examples: 1497
|
42 |
+
download_size: 3434865
|
43 |
+
dataset_size: 7210424
|
44 |
+
configs:
|
45 |
+
- config_name: default
|
46 |
+
data_files:
|
47 |
+
- split: train
|
48 |
+
path: data/train-*
|
49 |
+
- split: validation
|
50 |
+
path: data/validation-*
|
51 |
+
- split: test
|
52 |
+
path: data/test-*
|
53 |
---
|
54 |
|
55 |
# Dataset Card for "common_gen"
|
common_gen.py
DELETED
@@ -1,109 +0,0 @@
|
|
1 |
-
import json
|
2 |
-
import os
|
3 |
-
import random
|
4 |
-
|
5 |
-
import datasets
|
6 |
-
|
7 |
-
|
8 |
-
random.seed(42) # This is important, to ensure the same order for concept sets as the official script.
|
9 |
-
|
10 |
-
_CITATION = """\
|
11 |
-
@inproceedings{lin-etal-2020-commongen,
|
12 |
-
title = "{C}ommon{G}en: A Constrained Text Generation Challenge for Generative Commonsense Reasoning",
|
13 |
-
author = "Lin, Bill Yuchen and
|
14 |
-
Zhou, Wangchunshu and
|
15 |
-
Shen, Ming and
|
16 |
-
Zhou, Pei and
|
17 |
-
Bhagavatula, Chandra and
|
18 |
-
Choi, Yejin and
|
19 |
-
Ren, Xiang",
|
20 |
-
booktitle = "Findings of the Association for Computational Linguistics: EMNLP 2020",
|
21 |
-
month = nov,
|
22 |
-
year = "2020",
|
23 |
-
address = "Online",
|
24 |
-
publisher = "Association for Computational Linguistics",
|
25 |
-
url = "https://www.aclweb.org/anthology/2020.findings-emnlp.165",
|
26 |
-
doi = "10.18653/v1/2020.findings-emnlp.165",
|
27 |
-
pages = "1823--1840"
|
28 |
-
}
|
29 |
-
"""
|
30 |
-
|
31 |
-
_DESCRIPTION = """\
|
32 |
-
CommonGen is a constrained text generation task, associated with a benchmark dataset,
|
33 |
-
to explicitly test machines for the ability of generative commonsense reasoning. Given
|
34 |
-
a set of common concepts; the task is to generate a coherent sentence describing an
|
35 |
-
everyday scenario using these concepts.
|
36 |
-
|
37 |
-
CommonGen is challenging because it inherently requires 1) relational reasoning using
|
38 |
-
background commonsense knowledge, and 2) compositional generalization ability to work
|
39 |
-
on unseen concept combinations. Our dataset, constructed through a combination of
|
40 |
-
crowd-sourcing from AMT and existing caption corpora, consists of 30k concept-sets and
|
41 |
-
50k sentences in total.
|
42 |
-
"""
|
43 |
-
_URL = "https://storage.googleapis.com/huggingface-nlp/datasets/common_gen/commongen_data.zip"
|
44 |
-
|
45 |
-
|
46 |
-
class CommonGen(datasets.GeneratorBasedBuilder):
|
47 |
-
VERSION = datasets.Version("2020.5.30")
|
48 |
-
|
49 |
-
def _info(self):
|
50 |
-
features = datasets.Features(
|
51 |
-
{
|
52 |
-
"concept_set_idx": datasets.Value("int32"),
|
53 |
-
"concepts": datasets.Sequence(datasets.Value("string")),
|
54 |
-
"target": datasets.Value("string"),
|
55 |
-
}
|
56 |
-
)
|
57 |
-
return datasets.DatasetInfo(
|
58 |
-
description=_DESCRIPTION,
|
59 |
-
features=features,
|
60 |
-
supervised_keys=datasets.info.SupervisedKeysData(input="concepts", output="target"),
|
61 |
-
homepage="https://inklab.usc.edu/CommonGen/index.html",
|
62 |
-
citation=_CITATION,
|
63 |
-
)
|
64 |
-
|
65 |
-
def _split_generators(self, dl_manager):
|
66 |
-
"""Returns SplitGenerators."""
|
67 |
-
|
68 |
-
dl_dir = dl_manager.download_and_extract(_URL)
|
69 |
-
|
70 |
-
return [
|
71 |
-
datasets.SplitGenerator(
|
72 |
-
name=datasets.Split.TRAIN,
|
73 |
-
gen_kwargs={"filepath": os.path.join(dl_dir, "commongen.train.jsonl"), "split": "train"},
|
74 |
-
),
|
75 |
-
datasets.SplitGenerator(
|
76 |
-
name=datasets.Split.VALIDATION,
|
77 |
-
gen_kwargs={"filepath": os.path.join(dl_dir, "commongen.dev.jsonl"), "split": "dev"},
|
78 |
-
),
|
79 |
-
datasets.SplitGenerator(
|
80 |
-
name=datasets.Split.TEST,
|
81 |
-
gen_kwargs={"filepath": os.path.join(dl_dir, "commongen.test_noref.jsonl"), "split": "test"},
|
82 |
-
),
|
83 |
-
]
|
84 |
-
|
85 |
-
def _generate_examples(self, filepath, split):
|
86 |
-
"""Yields examples."""
|
87 |
-
with open(filepath, encoding="utf-8") as f:
|
88 |
-
id_ = 0
|
89 |
-
for idx, row in enumerate(f):
|
90 |
-
row = row.replace(", }", "}") # Fix possible JSON format error
|
91 |
-
data = json.loads(row)
|
92 |
-
|
93 |
-
rand_order = [word for word in data["concept_set"].split("#")]
|
94 |
-
random.shuffle(rand_order)
|
95 |
-
|
96 |
-
if split == "test":
|
97 |
-
yield idx, {
|
98 |
-
"concept_set_idx": idx,
|
99 |
-
"concepts": rand_order,
|
100 |
-
"target": "",
|
101 |
-
}
|
102 |
-
else:
|
103 |
-
for scene in data["scene"]:
|
104 |
-
yield id_, {
|
105 |
-
"concept_set_idx": idx,
|
106 |
-
"concepts": rand_order,
|
107 |
-
"target": scene,
|
108 |
-
}
|
109 |
-
id_ += 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data/test-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c9dbd388bb5e19c98cb1160dfddbac6feeac7bbc0d802d94492286c6b3fbb7f6
|
3 |
+
size 31157
|
data/train-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5641eb79211ff3022efd7f0d4df83ceb0e894e7c553340fd418d4075d319ea0c
|
3 |
+
size 3232448
|
data/validation-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fa383822542c5df1bd2876830b6fb61c57a771fbe06d37a07846417dc3f0b6de
|
3 |
+
size 171260
|
dataset_infos.json
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"default": {"description": "CommonGen is a constrained text generation task, associated with a benchmark dataset, \nto explicitly test machines for the ability of generative commonsense reasoning. Given \na set of common concepts; the task is to generate a coherent sentence describing an \neveryday scenario using these concepts.\n\nCommonGen is challenging because it inherently requires 1) relational reasoning using \nbackground commonsense knowledge, and 2) compositional generalization ability to work \non unseen concept combinations. Our dataset, constructed through a combination of \ncrowd-sourcing from AMT and existing caption corpora, consists of 30k concept-sets and \n50k sentences in total.\n", "citation": "@inproceedings{lin-etal-2020-commongen,\n author = {Bill Yuchen Lin and Wangchunshu Zhou and Ming Shen and Pei Zhou and Chandra Bhagavatula and Yejin Choi and Xiang Ren},\n title = {{C}ommon{G}en: A Constrained Text Generation Challenge for Generative Commonsense Reasoning},\n booktitle = {Findings of the Association for Computational Linguistics: EMNLP 2020},\n year = {2020}\n}\n", "homepage": "https://inklab.usc.edu/CommonGen/index.html", "license": "", "features": {"concept_set_idx": {"dtype": "int32", "id": null, "_type": "Value"}, "concepts": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "target": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": {"input": "concepts", "output": "target"}, "builder_name": "common_gen", "config_name": "default", "version": {"version_str": "2020.5.30", "description": null, "datasets_version_to_prepare": null, "major": 2020, "minor": 5, "patch": 30}, "splits": {"train": {"name": "train", "num_bytes": 6724250, "num_examples": 67389, "dataset_name": "common_gen"}, "validation": {"name": "validation", "num_bytes": 408752, "num_examples": 4018, "dataset_name": "common_gen"}, "test": {"name": "test", "num_bytes": 77530, "num_examples": 1497, "dataset_name": "common_gen"}}, "download_checksums": {"https://storage.googleapis.com/huggingface-nlp/datasets/common_gen/commongen_data.zip": {"num_bytes": 1845699, "checksum": "a3f19ca607da4e874fc5f2dd1f53c13a6788a497f883d74cc3f9a1fcda44c594"}}, "download_size": 1845699, "post_processing_size": null, "dataset_size": 7210532, "size_in_bytes": 9056231}}
|
|
|
|