Update disrpt.py
Browse files
disrpt.py
CHANGED
@@ -157,16 +157,14 @@ class Dataset(datasets.GeneratorBasedBuilder):
|
|
157 |
urls={k:v for (k,v) in _URLs.items() if cfg_name in k and requests.get(v).status_code!=404}
|
158 |
data_file = dl_manager.download(urls)
|
159 |
self.files = {**self.files, **data_file}
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
return train+[
|
167 |
-
datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": data_file[data_dir+'-dev.'+type]}),
|
168 |
-
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": data_file[data_dir+'-test.'+type]}),
|
169 |
]
|
|
|
170 |
|
171 |
def _info(self): return datasets.DatasetInfo(
|
172 |
citation=key_to_entry.get(datasets_and_citations.get(remove_type(self.config.name)),None),
|
|
|
157 |
urls={k:v for (k,v) in _URLs.items() if cfg_name in k and requests.get(v).status_code!=404}
|
158 |
data_file = dl_manager.download(urls)
|
159 |
self.files = {**self.files, **data_file}
|
160 |
+
|
161 |
+
splits_dict = {datasets.Split.TRAIN: 'train', datasets.Split.VALIDATION: 'dev', datasets.Split.TEST: 'test'}
|
162 |
+
split_generators = [
|
163 |
+
datasets.SplitGenerator(name=split, gen_kwargs={"filepath": data_file[f"{data_dir}-{key}.{type}"]})
|
164 |
+
for split, key in splits_dict.items()
|
165 |
+
if f"{data_dir}-{key}" in data_file
|
|
|
|
|
|
|
166 |
]
|
167 |
+
return split_generators
|
168 |
|
169 |
def _info(self): return datasets.DatasetInfo(
|
170 |
citation=key_to_entry.get(datasets_and_citations.get(remove_type(self.config.name)),None),
|