Datasets:
ArXiv:
License:
error fix
Browse files- snow-mountain.py +23 -110
snow-mountain.py
CHANGED
@@ -96,125 +96,38 @@ class Test(datasets.GeneratorBasedBuilder):
|
|
96 |
|
97 |
downloaded_files = dl_manager.download(_FILES[self.config.name])
|
98 |
|
99 |
-
|
100 |
-
datasets.SplitGenerator(
|
101 |
-
name="train_500",
|
102 |
-
gen_kwargs={
|
103 |
-
"filepath": downloaded_files["train_500"],
|
104 |
-
"dl_manager": dl_manager,
|
105 |
-
},
|
106 |
-
),
|
107 |
-
datasets.SplitGenerator(
|
108 |
-
name="train_1000",
|
109 |
-
gen_kwargs={
|
110 |
-
"filepath": downloaded_files["train_1000"],
|
111 |
-
"dl_manager": dl_manager,
|
112 |
-
},
|
113 |
-
),
|
114 |
-
datasets.SplitGenerator(
|
115 |
-
name="train_2500",
|
116 |
-
gen_kwargs={
|
117 |
-
"filepath": downloaded_files["train_2500"],
|
118 |
-
"dl_manager": dl_manager,
|
119 |
-
},
|
120 |
-
),
|
121 |
-
datasets.SplitGenerator(
|
122 |
-
name="train_short",
|
123 |
-
gen_kwargs={
|
124 |
-
"filepath": downloaded_files["train_short"],
|
125 |
-
"dl_manager": dl_manager,
|
126 |
-
},
|
127 |
-
),
|
128 |
-
datasets.SplitGenerator(
|
129 |
-
name="train_full",
|
130 |
-
gen_kwargs={
|
131 |
-
"filepath": downloaded_files["train_full"],
|
132 |
-
"dl_manager": dl_manager,
|
133 |
-
},
|
134 |
-
),
|
135 |
-
]
|
136 |
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
gen_kwargs={
|
141 |
-
"filepath": downloaded_files["val_500"],
|
142 |
-
"dl_manager": dl_manager,
|
143 |
-
},
|
144 |
-
),
|
145 |
datasets.SplitGenerator(
|
146 |
-
name="
|
147 |
gen_kwargs={
|
148 |
-
"filepath": downloaded_files["
|
149 |
"dl_manager": dl_manager,
|
150 |
},
|
151 |
-
)
|
|
|
|
|
152 |
datasets.SplitGenerator(
|
153 |
-
name="
|
154 |
gen_kwargs={
|
155 |
-
"filepath": downloaded_files["
|
156 |
"dl_manager": dl_manager,
|
157 |
},
|
158 |
-
)
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
"dl_manager": dl_manager,
|
171 |
-
},
|
172 |
-
),
|
173 |
-
]
|
174 |
-
|
175 |
-
test_splits = [
|
176 |
-
datasets.SplitGenerator(
|
177 |
-
name="test_common",
|
178 |
-
gen_kwargs={
|
179 |
-
"filepath": downloaded_files["test_common"],
|
180 |
-
"dl_manager": dl_manager,
|
181 |
-
},
|
182 |
-
),
|
183 |
-
]
|
184 |
-
return train_splits + dev_splits + test_splits
|
185 |
-
|
186 |
-
# data_size = ['500', '1000', '2500', 'short', 'full']
|
187 |
-
|
188 |
-
# splits = []
|
189 |
-
# for size in data_size:
|
190 |
-
# splits.append(
|
191 |
-
# datasets.SplitGenerator(
|
192 |
-
# name=f"train_{size}",
|
193 |
-
# gen_kwargs={
|
194 |
-
# "filepath": downloaded_files[f"train_{size}"],
|
195 |
-
# "dl_manager": dl_manager,
|
196 |
-
# },
|
197 |
-
# )
|
198 |
-
# )
|
199 |
-
# splits.append(
|
200 |
-
# datasets.SplitGenerator(
|
201 |
-
# name=f"val_{size}",
|
202 |
-
# gen_kwargs={
|
203 |
-
# "filepath": downloaded_files[f"val_{size}"],
|
204 |
-
# "dl_manager": dl_manager,
|
205 |
-
# },
|
206 |
-
# )
|
207 |
-
# )
|
208 |
-
# splits.append(
|
209 |
-
# datasets.SplitGenerator(
|
210 |
-
# name="test_common",
|
211 |
-
# gen_kwargs={
|
212 |
-
# "filepath": downloaded_files["test_common"],
|
213 |
-
# "dl_manager": dl_manager,
|
214 |
-
# },
|
215 |
-
# )
|
216 |
-
# )
|
217 |
-
# return splits
|
218 |
|
219 |
|
220 |
def _generate_examples(self, filepath, dl_manager):
|
|
|
96 |
|
97 |
downloaded_files = dl_manager.download(_FILES[self.config.name])
|
98 |
|
99 |
+
data_size = ['500', '1000', '2500', 'short', 'full']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
|
101 |
+
splits = []
|
102 |
+
for size in data_size:
|
103 |
+
splits.append(
|
|
|
|
|
|
|
|
|
|
|
104 |
datasets.SplitGenerator(
|
105 |
+
name=f"train_{size}",
|
106 |
gen_kwargs={
|
107 |
+
"filepath": downloaded_files[f"train_{size}"],
|
108 |
"dl_manager": dl_manager,
|
109 |
},
|
110 |
+
)
|
111 |
+
)
|
112 |
+
splits.append(
|
113 |
datasets.SplitGenerator(
|
114 |
+
name=f"val_{size}",
|
115 |
gen_kwargs={
|
116 |
+
"filepath": downloaded_files[f"val_{size}"],
|
117 |
"dl_manager": dl_manager,
|
118 |
},
|
119 |
+
)
|
120 |
+
)
|
121 |
+
splits.append(
|
122 |
+
datasets.SplitGenerator(
|
123 |
+
name="test_common",
|
124 |
+
gen_kwargs={
|
125 |
+
"filepath": downloaded_files["test_common"],
|
126 |
+
"dl_manager": dl_manager,
|
127 |
+
},
|
128 |
+
)
|
129 |
+
)
|
130 |
+
return splits
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
|
132 |
|
133 |
def _generate_examples(self, filepath, dl_manager):
|