Update polygraph_xsum.py
Browse files- polygraph_xsum.py +3 -3
polygraph_xsum.py
CHANGED
|
@@ -9,9 +9,10 @@ _LANGS = ["en"]
|
|
| 9 |
|
| 10 |
_DATA_DIRECTORY = "."
|
| 11 |
VERSION = datasets.Version("0.0.1")
|
| 12 |
-
|
| 13 |
_CONFIG = {
|
| 14 |
"dataset": "xsum",
|
|
|
|
| 15 |
"input_column": "document",
|
| 16 |
"output_column": "summary",
|
| 17 |
}
|
|
@@ -46,14 +47,13 @@ class PolygraphXsum(datasets.GeneratorBasedBuilder):
|
|
| 46 |
x, y = _prepare_dataset(dataset[split])
|
| 47 |
result_dataset = datasets.Dataset.from_dict({"input": x, "output": y})
|
| 48 |
result_dataset.to_json(dst_path)
|
| 49 |
-
downloaded_files = dl_manager.download_custom(
|
| 50 |
|
| 51 |
return [
|
| 52 |
datasets.SplitGenerator(
|
| 53 |
name=datasets.Split.TRAIN,
|
| 54 |
gen_kwargs={
|
| 55 |
"filepath": downloaded_files["train"],
|
| 56 |
-
"lang": lang,
|
| 57 |
}),
|
| 58 |
datasets.SplitGenerator(
|
| 59 |
name=datasets.Split.VALIDATION,
|
|
|
|
| 9 |
|
| 10 |
_DATA_DIRECTORY = "."
|
| 11 |
VERSION = datasets.Version("0.0.1")
|
| 12 |
+
|
| 13 |
_CONFIG = {
|
| 14 |
"dataset": "xsum",
|
| 15 |
+
"splits": ["train", "validation", "test"],
|
| 16 |
"input_column": "document",
|
| 17 |
"output_column": "summary",
|
| 18 |
}
|
|
|
|
| 47 |
x, y = _prepare_dataset(dataset[split])
|
| 48 |
result_dataset = datasets.Dataset.from_dict({"input": x, "output": y})
|
| 49 |
result_dataset.to_json(dst_path)
|
| 50 |
+
downloaded_files = dl_manager.download_custom({split: split for split in _CONFIG["splits"]}, download_custom_dataset)
|
| 51 |
|
| 52 |
return [
|
| 53 |
datasets.SplitGenerator(
|
| 54 |
name=datasets.Split.TRAIN,
|
| 55 |
gen_kwargs={
|
| 56 |
"filepath": downloaded_files["train"],
|
|
|
|
| 57 |
}),
|
| 58 |
datasets.SplitGenerator(
|
| 59 |
name=datasets.Split.VALIDATION,
|