Datasets:
Sebastian Gehrmann commited on
Commit ·
403c49e
1
Parent(s): 4de7399
initial loader
Browse files- dataset_infos.json +1 -0
- viggo.py +83 -0
dataset_infos.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"default": {"description": "ViGGO was designed for the task of data-to-text generation in chatbots (as opposed to task-oriented dialogue systems), with target responses being more conversational than information-seeking, yet constrained to the information presented in a meaning representation. The dataset, being relatively small and clean, can also serve for demonstrating transfer learning capabilities of neural models.\n", "citation": "@inproceedings{juraska-etal-2019-viggo,\n title = \"{V}i{GGO}: A Video Game Corpus for Data-To-Text Generation in Open-Domain Conversation\",\n author = \"Juraska, Juraj and\n Bowden, Kevin and\n Walker, Marilyn\",\n booktitle = \"Proceedings of the 12th International Conference on Natural Language Generation\",\n month = oct # \"{--}\" # nov,\n year = \"2019\",\n address = \"Tokyo, Japan\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://aclanthology.org/W19-8623\",\n doi = \"10.18653/v1/W19-8623\",\n pages = \"164--172\",\n}\n", "homepage": "https://nlds.soe.ucsc.edu/viggo", "license": "", "features": {"gem_id": {"dtype": "string", "id": null, "_type": "Value"}, "meaning_representation": {"dtype": "string", "id": null, "_type": "Value"}, "target": {"dtype": "string", "id": null, "_type": "Value"}, "references": [{"dtype": "string", "id": null, "_type": "Value"}]}, "post_processed": null, "supervised_keys": {"input": "meaning_representation", "output": "target"}, "task_templates": null, "builder_name": "viggo", "config_name": "default", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 2094490, "num_examples": 5103, "dataset_name": "viggo"}, "validation": {"name": "validation", "num_bytes": 285396, "num_examples": 714, "dataset_name": "viggo"}, "test": {"name": "test", "num_bytes": 415074, "num_examples": 1083, "dataset_name": "viggo"}, "challenge_train_1_percent": {"name": "challenge_train_1_percent", "num_bytes": 19585, "num_examples": 50, "dataset_name": "viggo"}}, "download_checksums": {"train.csv": {"num_bytes": 1370770, "checksum": "39d4bf7ef5b7b78c1c137d05d461e779884ad08cf53e0ee6cf63c3653c5f8aae"}, "validation.csv": {"num_bytes": 187448, "checksum": "c4d4b3b5075d84c1645cccd678e665e0d2a40226e3e9a383270a5c666006adbc"}, "test.csv": {"num_bytes": 268969, "checksum": "020f24199655b4c6f9246123263d2c6d3ea01189046150153dcc6cf8b914037a"}, "challenge_train_1_percent.csv": {"num_bytes": 11230, "checksum": "84a2540a71b5034c0d454899d6f68bfd2c0a48c7e3c6fb8e34723189bf818eaa"}}, "download_size": 1838417, "post_processing_size": null, "dataset_size": 2814545, "size_in_bytes": 4652962}}
|
viggo.py
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import csv
|
| 2 |
+
import json
|
| 3 |
+
import os
|
| 4 |
+
import datasets
|
| 5 |
+
|
| 6 |
+
_CITATION = """\
|
| 7 |
+
@inproceedings{juraska-etal-2019-viggo,
|
| 8 |
+
title = "{V}i{GGO}: A Video Game Corpus for Data-To-Text Generation in Open-Domain Conversation",
|
| 9 |
+
author = "Juraska, Juraj and
|
| 10 |
+
Bowden, Kevin and
|
| 11 |
+
Walker, Marilyn",
|
| 12 |
+
booktitle = "Proceedings of the 12th International Conference on Natural Language Generation",
|
| 13 |
+
month = oct # "{--}" # nov,
|
| 14 |
+
year = "2019",
|
| 15 |
+
address = "Tokyo, Japan",
|
| 16 |
+
publisher = "Association for Computational Linguistics",
|
| 17 |
+
url = "https://aclanthology.org/W19-8623",
|
| 18 |
+
doi = "10.18653/v1/W19-8623",
|
| 19 |
+
pages = "164--172",
|
| 20 |
+
}
|
| 21 |
+
"""
|
| 22 |
+
|
| 23 |
+
_DESCRIPTION = """\
|
| 24 |
+
ViGGO was designed for the task of data-to-text generation in chatbots (as opposed to task-oriented dialogue systems), with target responses being more conversational than information-seeking, yet constrained to the information presented in a meaning representation. The dataset, being relatively small and clean, can also serve for demonstrating transfer learning capabilities of neural models.
|
| 25 |
+
"""
|
| 26 |
+
|
| 27 |
+
_URLs = {
|
| 28 |
+
"train": "train.csv",
|
| 29 |
+
"validation": "validation.csv",
|
| 30 |
+
"test": "test.csv",
|
| 31 |
+
"challenge_train_1_percent": "challenge_train_1_percent.csv",
|
| 32 |
+
"challenge_train_1_percent": "challenge_train_1_percent.csv",
|
| 33 |
+
"challenge_train_1_percent": "challenge_train_1_percent.csv",
|
| 34 |
+
"challenge_train_1_percent": "challenge_train_1_percent.csv",
|
| 35 |
+
"challenge_train_1_percent": "challenge_train_1_percent.csv",
|
| 36 |
+
"challenge_train_1_percent": "challenge_train_1_percent.csv",
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
class Viggo(datasets.GeneratorBasedBuilder):
|
| 41 |
+
VERSION = datasets.Version("1.0.0")
|
| 42 |
+
DEFAULT_CONFIG_NAME = "viggo"
|
| 43 |
+
|
| 44 |
+
def _info(self):
|
| 45 |
+
features = datasets.Features(
|
| 46 |
+
{
|
| 47 |
+
"gem_id": datasets.Value("string"),
|
| 48 |
+
"meaning_representation": datasets.Value("string"),
|
| 49 |
+
"target": datasets.Value("string"),
|
| 50 |
+
"references": [datasets.Value("string")],
|
| 51 |
+
}
|
| 52 |
+
)
|
| 53 |
+
return datasets.DatasetInfo(
|
| 54 |
+
description=_DESCRIPTION,
|
| 55 |
+
features=features,
|
| 56 |
+
supervised_keys=datasets.info.SupervisedKeysData(
|
| 57 |
+
input="meaning_representation", output="target"
|
| 58 |
+
),
|
| 59 |
+
homepage="https://nlds.soe.ucsc.edu/viggo",
|
| 60 |
+
citation=_CITATION,
|
| 61 |
+
)
|
| 62 |
+
|
| 63 |
+
def _split_generators(self, dl_manager):
|
| 64 |
+
"""Returns SplitGenerators."""
|
| 65 |
+
dl_dir = dl_manager.download_and_extract(_URLs)
|
| 66 |
+
return [
|
| 67 |
+
datasets.SplitGenerator(
|
| 68 |
+
name=spl, gen_kwargs={"filepath": dl_dir[spl], "split": spl}
|
| 69 |
+
)
|
| 70 |
+
for spl in _URLs.keys()
|
| 71 |
+
]
|
| 72 |
+
|
| 73 |
+
def _generate_examples(self, filepath, split, filepaths=None, lang=None):
|
| 74 |
+
"""Yields examples."""
|
| 75 |
+
with open(filepath, "r", encoding='utf-8-sig') as csvfile:
|
| 76 |
+
reader = csv.DictReader(csvfile)
|
| 77 |
+
for id_, row in enumerate(reader):
|
| 78 |
+
yield id_, {
|
| 79 |
+
"gem_id": f"cs_restaurants-{split}-{id_}",
|
| 80 |
+
"meaning_representation": row["mr"],
|
| 81 |
+
"target": row["ref"],
|
| 82 |
+
"references": [row["ref"]],
|
| 83 |
+
}
|