Datasets:

Languages:
English
ArXiv:
License:
albertvillanova HF staff commited on
Commit
2605bbb
1 Parent(s): bb37359

Add license and citation information to cosmos_qa dataset (#4913)

Browse files

* Add license information to cosmos_qa dataset card

* Add license to script

* Regenerate metadata JSON

* Update citation information

* Fix style

Commit from https://github.com/huggingface/datasets/commit/c47e6a987e838445bd5d8f84cbb17ab55df65535

Files changed (3) hide show
  1. README.md +16 -8
  2. cosmos_qa.py +26 -32
  3. dataset_infos.json +1 -1
README.md CHANGED
@@ -6,7 +6,7 @@ language:
6
  language_creators:
7
  - found
8
  license:
9
- - unknown
10
  multilinguality:
11
  - monolingual
12
  pretty_name: CosmosQA
@@ -167,17 +167,25 @@ The data fields are the same among all splits.
167
 
168
  ### Licensing Information
169
 
170
- [More Information Needed](https://github.com/huggingface/datasets/blob/master/CONTRIBUTING.md#how-to-contribute-to-the-dataset-cards)
171
 
172
  ### Citation Information
173
 
174
  ```
175
- @inproceedings{cosmos,
176
- title={COSMOS QA: Machine Reading Comprehension
177
- with Contextual Commonsense Reasoning},
178
- author={Lifu Huang and Ronan Le Bras and Chandra Bhagavatula and Yejin Choi},
179
- booktitle ={arXiv:1909.00277v2},
180
- year={2019}
 
 
 
 
 
 
 
 
181
  }
182
  ```
183
 
 
6
  language_creators:
7
  - found
8
  license:
9
+ - cc-by-4.0
10
  multilinguality:
11
  - monolingual
12
  pretty_name: CosmosQA
 
167
 
168
  ### Licensing Information
169
 
170
+ As reported via email by Yejin Choi, the dataset is licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) license.
171
 
172
  ### Citation Information
173
 
174
  ```
175
+ @inproceedings{huang-etal-2019-cosmos,
176
+ title = "Cosmos {QA}: Machine Reading Comprehension with Contextual Commonsense Reasoning",
177
+ author = "Huang, Lifu and
178
+ Le Bras, Ronan and
179
+ Bhagavatula, Chandra and
180
+ Choi, Yejin",
181
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP)",
182
+ month = nov,
183
+ year = "2019",
184
+ address = "Hong Kong, China",
185
+ publisher = "Association for Computational Linguistics",
186
+ url = "https://www.aclweb.org/anthology/D19-1243",
187
+ doi = "10.18653/v1/D19-1243",
188
+ pages = "2391--2401",
189
  }
190
  ```
191
 
cosmos_qa.py CHANGED
@@ -1,4 +1,4 @@
1
- """TODO(cosmos_qa): Add a description here."""
2
 
3
 
4
  import csv
@@ -7,22 +7,32 @@ import json
7
  import datasets
8
 
9
 
10
- # TODO(cosmos_qa): BibTeX citation
11
- _CITATION = """\
12
- @inproceedings{cosmos,
13
- title={COSMOS QA: Machine Reading Comprehension
14
- with Contextual Commonsense Reasoning},
15
- author={Lifu Huang and Ronan Le Bras and Chandra Bhagavatula and Yejin Choi},
16
- booktitle ={arXiv:1909.00277v2},
17
- year={2019}
18
- }
19
- """
20
 
21
- # TODO(cosmos_qa):
22
  _DESCRIPTION = """\
23
  Cosmos QA is a large-scale dataset of 35.6K problems that require commonsense-based reading comprehension, formulated as multiple-choice questions. It focuses on reading between the lines over a diverse collection of people's everyday narratives, asking questions concerning on the likely causes or effects of events that require reasoning beyond the exact text spans in the context
24
  """
25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  _URL = "https://github.com/wilburOne/cosmosqa/raw/master/data/"
27
  _URLS = {
28
  "train": _URL + "train.csv",
@@ -32,17 +42,13 @@ _URLS = {
32
 
33
 
34
  class CosmosQa(datasets.GeneratorBasedBuilder):
35
- """TODO(cosmos_qa): Short description of my dataset."""
36
 
37
- # TODO(cosmos_qa): Set up version.
38
  VERSION = datasets.Version("0.1.0")
39
 
40
  def _info(self):
41
- # TODO(cosmos_qa): Specifies the datasets.DatasetInfo object
42
  return datasets.DatasetInfo(
43
- # This is the description that will appear on the datasets page.
44
  description=_DESCRIPTION,
45
- # datasets.features.FeatureConnectors
46
  features=datasets.Features(
47
  {
48
  "id": datasets.Value("string"),
@@ -52,47 +58,35 @@ class CosmosQa(datasets.GeneratorBasedBuilder):
52
  "answer1": datasets.Value("string"),
53
  "answer2": datasets.Value("string"),
54
  "answer3": datasets.Value("string"),
55
- "label": datasets.Value("int32")
56
- # These are the features of your dataset like images, labels ...
57
  }
58
  ),
59
- # If there's a common (input, target) tuple from the features,
60
- # specify them here. They'll be used if as_supervised=True in
61
- # builder.as_dataset.
62
- supervised_keys=None,
63
- # Homepage of the dataset for documentation
64
- homepage="https://wilburone.github.io/cosmos/",
65
  citation=_CITATION,
 
66
  )
67
 
68
  def _split_generators(self, dl_manager):
69
  """Returns SplitGenerators."""
70
- # TODO(cosmos_qa): Downloads the data and defines the splits
71
- # dl_manager is a datasets.download.DownloadManager that can be used to
72
- # download and extract URLs
73
  urls_to_download = _URLS
74
  dl_dir = dl_manager.download_and_extract(urls_to_download)
75
  return [
76
  datasets.SplitGenerator(
77
  name=datasets.Split.TRAIN,
78
- # These kwargs will be passed to _generate_examples
79
  gen_kwargs={"filepath": dl_dir["train"], "split": "train"},
80
  ),
81
  datasets.SplitGenerator(
82
  name=datasets.Split.TEST,
83
- # These kwargs will be passed to _generate_examples
84
  gen_kwargs={"filepath": dl_dir["test"], "split": "test"},
85
  ),
86
  datasets.SplitGenerator(
87
  name=datasets.Split.VALIDATION,
88
- # These kwargs will be passed to _generate_examples
89
  gen_kwargs={"filepath": dl_dir["dev"], "split": "dev"},
90
  ),
91
  ]
92
 
93
  def _generate_examples(self, filepath, split):
94
  """Yields examples."""
95
- # TODO(cosmos_qa): Yields (key, example) tuples from the dataset
96
  with open(filepath, encoding="utf-8") as f:
97
  if split == "test":
98
  for id_, row in enumerate(f):
 
1
+ """Cosmos QA dataset."""
2
 
3
 
4
  import csv
 
7
  import datasets
8
 
9
 
10
+ _HOMEPAGE = "https://wilburone.github.io/cosmos/"
 
 
 
 
 
 
 
 
 
11
 
 
12
  _DESCRIPTION = """\
13
  Cosmos QA is a large-scale dataset of 35.6K problems that require commonsense-based reading comprehension, formulated as multiple-choice questions. It focuses on reading between the lines over a diverse collection of people's everyday narratives, asking questions concerning on the likely causes or effects of events that require reasoning beyond the exact text spans in the context
14
  """
15
 
16
+ _CITATION = """\
17
+ @inproceedings{huang-etal-2019-cosmos,
18
+ title = "Cosmos {QA}: Machine Reading Comprehension with Contextual Commonsense Reasoning",
19
+ author = "Huang, Lifu and
20
+ Le Bras, Ronan and
21
+ Bhagavatula, Chandra and
22
+ Choi, Yejin",
23
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP)",
24
+ month = nov,
25
+ year = "2019",
26
+ address = "Hong Kong, China",
27
+ publisher = "Association for Computational Linguistics",
28
+ url = "https://www.aclweb.org/anthology/D19-1243",
29
+ doi = "10.18653/v1/D19-1243",
30
+ pages = "2391--2401",
31
+ }
32
+ """
33
+
34
+ _LICENSE = "CC BY 4.0"
35
+
36
  _URL = "https://github.com/wilburOne/cosmosqa/raw/master/data/"
37
  _URLS = {
38
  "train": _URL + "train.csv",
 
42
 
43
 
44
  class CosmosQa(datasets.GeneratorBasedBuilder):
45
+ """Cosmos QA dataset."""
46
 
 
47
  VERSION = datasets.Version("0.1.0")
48
 
49
  def _info(self):
 
50
  return datasets.DatasetInfo(
 
51
  description=_DESCRIPTION,
 
52
  features=datasets.Features(
53
  {
54
  "id": datasets.Value("string"),
 
58
  "answer1": datasets.Value("string"),
59
  "answer2": datasets.Value("string"),
60
  "answer3": datasets.Value("string"),
61
+ "label": datasets.Value("int32"),
 
62
  }
63
  ),
64
+ homepage=_HOMEPAGE,
 
 
 
 
 
65
  citation=_CITATION,
66
+ license=_LICENSE,
67
  )
68
 
69
  def _split_generators(self, dl_manager):
70
  """Returns SplitGenerators."""
 
 
 
71
  urls_to_download = _URLS
72
  dl_dir = dl_manager.download_and_extract(urls_to_download)
73
  return [
74
  datasets.SplitGenerator(
75
  name=datasets.Split.TRAIN,
 
76
  gen_kwargs={"filepath": dl_dir["train"], "split": "train"},
77
  ),
78
  datasets.SplitGenerator(
79
  name=datasets.Split.TEST,
 
80
  gen_kwargs={"filepath": dl_dir["test"], "split": "test"},
81
  ),
82
  datasets.SplitGenerator(
83
  name=datasets.Split.VALIDATION,
 
84
  gen_kwargs={"filepath": dl_dir["dev"], "split": "dev"},
85
  ),
86
  ]
87
 
88
  def _generate_examples(self, filepath, split):
89
  """Yields examples."""
 
90
  with open(filepath, encoding="utf-8") as f:
91
  if split == "test":
92
  for id_, row in enumerate(f):
dataset_infos.json CHANGED
@@ -1 +1 @@
1
- {"default": {"description": "Cosmos QA is a large-scale dataset of 35.6K problems that require commonsense-based reading comprehension, formulated as multiple-choice questions. It focuses on reading between the lines over a diverse collection of people's everyday narratives, asking questions concerning on the likely causes or effects of events that require reasoning beyond the exact text spans in the context\n", "citation": "@inproceedings{cosmos,\n title={COSMOS QA: Machine Reading Comprehension\n with Contextual Commonsense Reasoning},\n author={Lifu Huang and Ronan Le Bras and Chandra Bhagavatula and Yejin Choi},\n booktitle ={arXiv:1909.00277v2},\n year={2019}\n}\n", "homepage": "https://wilburone.github.io/cosmos/", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "context": {"dtype": "string", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "answer0": {"dtype": "string", "id": null, "_type": "Value"}, "answer1": {"dtype": "string", "id": null, "_type": "Value"}, "answer2": {"dtype": "string", "id": null, "_type": "Value"}, "answer3": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"dtype": "int32", "id": null, "_type": "Value"}}, "supervised_keys": null, "builder_name": "cosmos_qa", "config_name": "default", "version": {"version_str": "0.1.0", "description": null, "datasets_version_to_prepare": null, "major": 0, "minor": 1, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 5128447, "num_examples": 6963, "dataset_name": "cosmos_qa"}, "train": {"name": "train", "num_bytes": 17185126, "num_examples": 25262, "dataset_name": "cosmos_qa"}, "validation": {"name": "validation", "num_bytes": 2189979, "num_examples": 2985, "dataset_name": "cosmos_qa"}}, "download_checksums": {"https://github.com/wilburOne/cosmosqa/raw/master/data/train.csv": {"num_bytes": 16660449, "checksum": "d8d5ca1f9f6534b6530550718591af89372d976a8fc419360fab4158dee4d0b2"}, "https://github.com/wilburOne/cosmosqa/raw/master/data/test.jsonl": {"num_bytes": 5610681, "checksum": "70005196dc2588b95de34f1657b25e2c1a4810cfe55b5bb0c0e15580c37b3ed0"}, "https://github.com/wilburOne/cosmosqa/raw/master/data/valid.csv": {"num_bytes": 2128345, "checksum": "a6a94fc1463ca82bb10f98ef68ed535405e6f5c36e044ff8e136b5c19dea63f3"}}, "download_size": 24399475, "dataset_size": 24503552, "size_in_bytes": 48903027}}
 
1
+ {"default": {"description": "Cosmos QA is a large-scale dataset of 35.6K problems that require commonsense-based reading comprehension, formulated as multiple-choice questions. It focuses on reading between the lines over a diverse collection of people's everyday narratives, asking questions concerning on the likely causes or effects of events that require reasoning beyond the exact text spans in the context\n", "citation": "@inproceedings{huang-etal-2019-cosmos,\n title = \"Cosmos {QA}: Machine Reading Comprehension with Contextual Commonsense Reasoning\",\n author = \"Huang, Lifu and\n Le Bras, Ronan and\n Bhagavatula, Chandra and\n Choi, Yejin\",\n booktitle = \"Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP)\",\n month = nov,\n year = \"2019\",\n address = \"Hong Kong, China\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/D19-1243\",\n doi = \"10.18653/v1/D19-1243\",\n pages = \"2391--2401\",\n}\n", "homepage": "https://wilburone.github.io/cosmos/", "license": "CC BY 4.0", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "context": {"dtype": "string", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "answer0": {"dtype": "string", "id": null, "_type": "Value"}, "answer1": {"dtype": "string", "id": null, "_type": "Value"}, "answer2": {"dtype": "string", "id": null, "_type": "Value"}, "answer3": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"dtype": "int32", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "cosmos_qa", "config_name": "default", "version": {"version_str": "0.1.0", "description": null, "major": 0, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 17159918, "num_examples": 25262, "dataset_name": "cosmos_qa"}, "test": {"name": "test", "num_bytes": 5121479, "num_examples": 6963, "dataset_name": "cosmos_qa"}, "validation": {"name": "validation", "num_bytes": 2186987, "num_examples": 2985, "dataset_name": "cosmos_qa"}}, "download_checksums": {"https://github.com/wilburOne/cosmosqa/raw/master/data/train.csv": {"num_bytes": 16660449, "checksum": "d8d5ca1f9f6534b6530550718591af89372d976a8fc419360fab4158dee4d0b2"}, "https://github.com/wilburOne/cosmosqa/raw/master/data/test.jsonl": {"num_bytes": 5610681, "checksum": "70005196dc2588b95de34f1657b25e2c1a4810cfe55b5bb0c0e15580c37b3ed0"}, "https://github.com/wilburOne/cosmosqa/raw/master/data/valid.csv": {"num_bytes": 2128345, "checksum": "a6a94fc1463ca82bb10f98ef68ed535405e6f5c36e044ff8e136b5c19dea63f3"}}, "download_size": 24399475, "post_processing_size": null, "dataset_size": 24468384, "size_in_bytes": 48867859}}