Update wikipedia-nq.py
Browse files- wikipedia-nq.py +7 -16
wikipedia-nq.py
CHANGED
@@ -82,26 +82,17 @@ class WikipediaNq(datasets.GeneratorBasedBuilder):
|
|
82 |
)
|
83 |
|
84 |
def _split_generators(self, dl_manager):
|
85 |
-
|
|
|
|
|
|
|
86 |
splits = [
|
87 |
datasets.SplitGenerator(
|
88 |
-
name=
|
89 |
gen_kwargs={
|
90 |
-
"filepath": downloaded_files[
|
91 |
},
|
92 |
-
)
|
93 |
-
datasets.SplitGenerator(
|
94 |
-
name='dev',
|
95 |
-
gen_kwargs={
|
96 |
-
"filepath": downloaded_files["dev"],
|
97 |
-
},
|
98 |
-
),
|
99 |
-
datasets.SplitGenerator(
|
100 |
-
name='test',
|
101 |
-
gen_kwargs={
|
102 |
-
"filepath": downloaded_files["test"],
|
103 |
-
},
|
104 |
-
),
|
105 |
]
|
106 |
return splits
|
107 |
|
|
|
82 |
)
|
83 |
|
84 |
def _split_generators(self, dl_manager):
|
85 |
+
if self.config.data_files:
|
86 |
+
downloaded_files = dl_manager.download_and_extract(data_files)
|
87 |
+
else:
|
88 |
+
downloaded_files = dl_manager.download_and_extract(_DATASET_URLS)
|
89 |
splits = [
|
90 |
datasets.SplitGenerator(
|
91 |
+
name=split,
|
92 |
gen_kwargs={
|
93 |
+
"filepath": downloaded_files[split],
|
94 |
},
|
95 |
+
) for split in downloaded_files
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
]
|
97 |
return splits
|
98 |
|