Sebastian Gehrmann
commited on
Commit
•
957a67e
1
Parent(s):
e077548
- cs_restaurants.py +15 -4
cs_restaurants.py
CHANGED
@@ -64,22 +64,33 @@ class E2ENlg(datasets.GeneratorBasedBuilder):
|
|
64 |
dl_dir = dl_manager.download_and_extract(_URLs)
|
65 |
challenge_sets = [
|
66 |
("challenge_train_sample", "train_cs_restaurants_RandomSample500.json"),
|
67 |
-
(
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
]
|
70 |
return [
|
71 |
-
datasets.SplitGenerator(
|
|
|
|
|
72 |
for spl in ["train", "validation", "test"]
|
73 |
] + [
|
74 |
datasets.SplitGenerator(
|
75 |
name=challenge_split,
|
76 |
gen_kwargs={
|
77 |
-
"filepath": os.path.join(
|
|
|
|
|
78 |
"split": challenge_split,
|
79 |
},
|
80 |
)
|
81 |
for challenge_split, filename in challenge_sets
|
82 |
]
|
|
|
83 |
def _generate_examples(self, filepath, split, filepaths=None, lang=None):
|
84 |
"""Yields examples."""
|
85 |
if split.startswith("challenge"):
|
|
|
64 |
dl_dir = dl_manager.download_and_extract(_URLs)
|
65 |
challenge_sets = [
|
66 |
("challenge_train_sample", "train_cs_restaurants_RandomSample500.json"),
|
67 |
+
(
|
68 |
+
"challenge_validation_sample",
|
69 |
+
"validation_cs_restaurants_RandomSample500.json",
|
70 |
+
),
|
71 |
+
(
|
72 |
+
"challenge_test_scramble",
|
73 |
+
"test_cs_restaurants_ScrambleInputStructure500.json",
|
74 |
+
),
|
75 |
]
|
76 |
return [
|
77 |
+
datasets.SplitGenerator(
|
78 |
+
name=spl, gen_kwargs={"filepath": dl_dir[spl], "split": spl}
|
79 |
+
)
|
80 |
for spl in ["train", "validation", "test"]
|
81 |
] + [
|
82 |
datasets.SplitGenerator(
|
83 |
name=challenge_split,
|
84 |
gen_kwargs={
|
85 |
+
"filepath": os.path.join(
|
86 |
+
dl_dir["challenge_set"], "cs_restaurants", filename
|
87 |
+
),
|
88 |
"split": challenge_split,
|
89 |
},
|
90 |
)
|
91 |
for challenge_split, filename in challenge_sets
|
92 |
]
|
93 |
+
|
94 |
def _generate_examples(self, filepath, split, filepaths=None, lang=None):
|
95 |
"""Yields examples."""
|
96 |
if split.startswith("challenge"):
|