Datasets:
GEM
/

Tasks:
Other
Modalities:
Text
Languages:
English
ArXiv:
Libraries:
Datasets
License:
WorkInTheDark commited on
Commit
d78a025
1 Parent(s): 4a377e7
Files changed (5) hide show
  1. dataset_infos.json +0 -1
  2. fairytaleqa.py +16 -14
  3. test.json +0 -3
  4. train.json +0 -3
  5. valid.json +0 -3
dataset_infos.json DELETED
@@ -1 +0,0 @@
1
- {"plain_text": {"description": "The FairytaleQA dataset focusing on narrative comprehension of kindergarten to eighth-grade students. Generated by educational experts based on an evidence-based theoretical framework, FairytaleQA consists of 10,580 explicit and implicit questions derived from 278 children-friendly stories, covering seven types of narrative elements or relations. This is for the Question Generation Task of FairytaleQA.\n", "citation": "@inproceedings{xu2022fairytaleqa,\n author={Xu, Ying and Wang, Dakuo and Yu, Mo and Ritchie, Daniel and Yao, Bingsheng and Wu, Tongshuang and Zhang, Zheng and Li, Toby Jia-Jun and Bradford, Nora and Sun, Branda and Hoang, Tran Bao and Sang, Yisi and Hou, Yufang and Ma, Xiaojuan and Yang, Diyi and Peng, Nanyun and Yu, Zhou and Warschauer, Mark},\n title = {Fantastic Questions and Where to Find Them: Fairytale{QA} -- An Authentic Dataset for Narrative Comprehension},\n publisher = {Association for Computational Linguistics},\n year = {2022}\n}\n", "homepage": "https://github.com/uci-soe/FairytaleQAData", "license": "", "features": {"story_name": {"dtype": "string", "id": null, "_type": "Value"}, "content": {"dtype": "string", "id": null, "_type": "Value"}, "answer": {"dtype": "string", "id": null, "_type": "Value"}, "gem_id": {"dtype": "string", "id": null, "_type": "Value"}, "target": {"dtype": "string", "id": null, "_type": "Value"}, "references": [{"dtype": "string", "id": null, "_type": "Value"}], "local_or_sum": {"dtype": "string", "id": null, "_type": "Value"}, "attribute": {"dtype": "string", "id": null, "_type": "Value"}, "ex_or_im": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "fairytale_qa", "config_name": "plain_text", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 11133353, "num_examples": 8548, "dataset_name": "fairytale_qa"}, "validation": {"name": "validation", "num_bytes": 1266866, "num_examples": 1025, "dataset_name": "fairytale_qa"}, "test": {"name": "test", "num_bytes": 1230365, "num_examples": 1007, "dataset_name": "fairytale_qa"}}, "download_checksums": {"train.json": {"num_bytes": 11159226, "checksum": "ef0235f3fa7560d04c46e1e5c174d601adff837641b209e4cafd605b5f60a2be"}, "valid.json": {"num_bytes": 1261009, "checksum": "213ba90343b3ef2fb01f4ecb16f68d7bd9ee048deec5338b4ac5888a072abb66"}, "test.json": {"num_bytes": 1232713, "checksum": "7e17ae3b8e417d0eb9962be564c4f6619ac510bf066b6c94c8e6c12b0ce97ff5"}}, "download_size": 13652948, "post_processing_size": null, "dataset_size": 13630584, "size_in_bytes": 27283532}}
 
 
fairytaleqa.py CHANGED
@@ -74,14 +74,14 @@ _URLS = {
74
  "test": "test.json"
75
  }
76
 
77
- class FairytaleQAConfig(datasets.BuilderConfig):
78
 
79
- def __init__(self, **kwargs):
80
- """
81
- Args:
82
- **kwargs: keyword arguments forwarded to super.
83
- """
84
- super(FairytaleQAConfig, self).__init__(**kwargs)
85
 
86
  # _URLS = "https://huggingface.co/datasets/GEM/FairytaleQA/resolve/main/fairytaleqa.zip"
87
 
@@ -103,12 +103,14 @@ class FairytaleQA(datasets.GeneratorBasedBuilder):
103
  # data = datasets.load_dataset('my_dataset', 'first_domain')
104
  # data = datasets.load_dataset('my_dataset', 'second_domain')
105
 
 
 
106
 
107
- BUILDER_CONFIGS = [
108
- FairytaleQAConfig(
109
- name="plain_text",
110
- description="Plain Text")
111
- ]
112
 
113
  # DEFAULT_CONFIG_NAME = "train" # It's not mandatory to have a default configuration. Just use one if it make sense.
114
 
@@ -170,7 +172,7 @@ class FairytaleQA(datasets.GeneratorBasedBuilder):
170
  ]
171
 
172
  # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
173
- def _generate_examples(self, filepath, split):
174
  # TODO: This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
175
  # The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
176
  logger.info("generating examples from = %s", filepath)
@@ -186,7 +188,7 @@ class FairytaleQA(datasets.GeneratorBasedBuilder):
186
  "answer": data['answer'],
187
  "gem_id": f"GEM-FairytaleQA-{split}-{id_}",
188
  "target": data['question'],
189
- "references": [ data['question'] ],
190
  "local_or_sum": data['local_or_sum'],
191
  "attribute": data['attribute'],
192
  "ex_or_im": data['ex_or_im']
 
74
  "test": "test.json"
75
  }
76
 
77
+ # class FairytaleQAConfig(datasets.BuilderConfig):
78
 
79
+ # def __init__(self, **kwargs):
80
+ # """
81
+ # Args:
82
+ # **kwargs: keyword arguments forwarded to super.
83
+ # """
84
+ # super(FairytaleQAConfig, self).__init__(**kwargs)
85
 
86
  # _URLS = "https://huggingface.co/datasets/GEM/FairytaleQA/resolve/main/fairytaleqa.zip"
87
 
 
103
  # data = datasets.load_dataset('my_dataset', 'first_domain')
104
  # data = datasets.load_dataset('my_dataset', 'second_domain')
105
 
106
+ VERSION = datasets.Version("1.0.0")
107
+ DEFAULT_CONFIG_NAME = "fairytaleqa"
108
 
109
+ # BUILDER_CONFIGS = [
110
+ # FairytaleQAConfig(
111
+ # name="plain_text",
112
+ # description="Plain Text")
113
+ # ]
114
 
115
  # DEFAULT_CONFIG_NAME = "train" # It's not mandatory to have a default configuration. Just use one if it make sense.
116
 
 
172
  ]
173
 
174
  # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
175
+ def _generate_examples(self, filepath, split, filepaths=None, lang=None):
176
  # TODO: This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
177
  # The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
178
  logger.info("generating examples from = %s", filepath)
 
188
  "answer": data['answer'],
189
  "gem_id": f"GEM-FairytaleQA-{split}-{id_}",
190
  "target": data['question'],
191
+ "references": [] if split == "train" else [ data['question'] ],
192
  "local_or_sum": data['local_or_sum'],
193
  "attribute": data['attribute'],
194
  "ex_or_im": data['ex_or_im']
test.json DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:7e17ae3b8e417d0eb9962be564c4f6619ac510bf066b6c94c8e6c12b0ce97ff5
3
- size 1232713
 
 
 
 
train.json DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:ef0235f3fa7560d04c46e1e5c174d601adff837641b209e4cafd605b5f60a2be
3
- size 11159226
 
 
 
 
valid.json DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:213ba90343b3ef2fb01f4ecb16f68d7bd9ee048deec5338b4ac5888a072abb66
3
- size 1261009