Datasets:
SuzanaB
commited on
Commit
•
263d8a5
1
Parent(s):
a3d3319
Fix paths
Browse files
hr500k.py
CHANGED
@@ -14,6 +14,8 @@
|
|
14 |
# limitations under the License.
|
15 |
|
16 |
|
|
|
|
|
17 |
import datasets
|
18 |
|
19 |
|
@@ -112,23 +114,24 @@ class Hr500K(datasets.GeneratorBasedBuilder):
|
|
112 |
|
113 |
def _split_generators(self, dl_manager):
|
114 |
"""Returns SplitGenerators."""
|
115 |
-
|
116 |
-
|
117 |
-
'dev': f"{_URL}{_DEV_FILE}",
|
118 |
-
'test': f"{_URL}{_TEST_FILE}",
|
119 |
-
}
|
120 |
-
|
121 |
-
downloaded_files = dl_manager.download_and_extract(urls_to_download)
|
122 |
|
123 |
return [
|
124 |
datasets.SplitGenerator(
|
125 |
-
name=datasets.Split.TRAIN, gen_kwargs={
|
|
|
|
|
126 |
),
|
127 |
datasets.SplitGenerator(
|
128 |
-
name=datasets.Split.VALIDATION, gen_kwargs={
|
|
|
|
|
129 |
),
|
130 |
datasets.SplitGenerator(
|
131 |
-
name=datasets.Split.TEST, gen_kwargs={
|
|
|
|
|
132 |
),
|
133 |
]
|
134 |
|
|
|
14 |
# limitations under the License.
|
15 |
|
16 |
|
17 |
+
import os
|
18 |
+
|
19 |
import datasets
|
20 |
|
21 |
|
|
|
114 |
|
115 |
def _split_generators(self, dl_manager):
|
116 |
"""Returns SplitGenerators."""
|
117 |
+
my_url = _URL[self.config.name]
|
118 |
+
data_dir = dl_manager.download_and_extract(my_url)
|
|
|
|
|
|
|
|
|
|
|
119 |
|
120 |
return [
|
121 |
datasets.SplitGenerator(
|
122 |
+
name=datasets.Split.TRAIN, gen_kwargs={
|
123 |
+
'filepath': os.path.join(data_dir, _TRAINING_FILE),
|
124 |
+
'split': 'train'}
|
125 |
),
|
126 |
datasets.SplitGenerator(
|
127 |
+
name=datasets.Split.VALIDATION, gen_kwargs={
|
128 |
+
'filepath': os.path.join(data_dir, _DEV_FILE),
|
129 |
+
'split': 'dev'}
|
130 |
),
|
131 |
datasets.SplitGenerator(
|
132 |
+
name=datasets.Split.TEST, gen_kwargs={
|
133 |
+
'filepath': os.path.join(data_dir, _TEST_FILE),
|
134 |
+
'split': 'test'}
|
135 |
),
|
136 |
]
|
137 |
|