Felix
commited on
Commit
•
fa5311d
1
Parent(s):
59a5da9
format more compactly
Browse files- superlim-2.py +84 -110
superlim-2.py
CHANGED
@@ -186,101 +186,81 @@ class SuperLim(datasets.GeneratorBasedBuilder):
|
|
186 |
def _info(self):
|
187 |
# TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
|
188 |
if self.config.name == 'absabank-imm': # This is the name of the configuration selected in BUILDER_CONFIGS above
|
189 |
-
features = datasets.Features(
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
}
|
195 |
-
)
|
196 |
elif self.config.name == 'argumentation_sent':
|
197 |
-
features = datasets.Features(
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
}
|
204 |
-
)
|
205 |
elif self.config.name == "dalaj-ged":
|
206 |
-
features = datasets.Features(
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
}
|
219 |
-
)
|
220 |
-
}
|
221 |
-
)
|
222 |
elif self.config.name == "sweana":
|
223 |
-
features = datasets.Features(
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
}
|
231 |
-
)
|
232 |
elif self.config.name == 'swediagnostics':
|
233 |
-
features = datasets.Features(
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
}
|
244 |
-
)
|
245 |
elif self.config.name == 'swedn':
|
246 |
-
features = datasets.Features(
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
}
|
254 |
-
)
|
255 |
elif self.config.name == "swefaq":
|
256 |
-
features = datasets.Features(
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
}
|
264 |
-
)
|
265 |
elif self.config.name == 'swemnli':
|
266 |
-
features = datasets.Features(
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
}
|
273 |
-
)
|
274 |
elif self.config.name == "swepar":
|
275 |
-
features = datasets.Features(
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
}
|
283 |
-
)
|
284 |
elif self.config.name == "swesat":
|
285 |
features = datasets.Features({
|
286 |
"id": datasets.Value("string"),
|
@@ -295,31 +275,25 @@ class SuperLim(datasets.GeneratorBasedBuilder):
|
|
295 |
})
|
296 |
})
|
297 |
elif self.config.name == "swesim_relatedness":
|
298 |
-
features = datasets.Features(
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
}
|
304 |
-
)
|
305 |
elif self.config.name == "swesim_similarity":
|
306 |
-
features = datasets.Features(
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
}
|
312 |
-
)
|
313 |
elif self.config.name == "swewic":
|
314 |
-
features = datasets.Features(
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
}
|
322 |
-
)
|
323 |
else:
|
324 |
raise ValueError(f"Subset {self.config.name} does not exist.")
|
325 |
return datasets.DatasetInfo(
|
|
|
186 |
def _info(self):
|
187 |
# TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
|
188 |
if self.config.name == 'absabank-imm': # This is the name of the configuration selected in BUILDER_CONFIGS above
|
189 |
+
features = datasets.Features({
|
190 |
+
"id": datasets.Value("string"),
|
191 |
+
"text": datasets.Value("string"),
|
192 |
+
"label": datasets.Value(dtype='float32')
|
193 |
+
})
|
|
|
|
|
194 |
elif self.config.name == 'argumentation_sent':
|
195 |
+
features = datasets.Features({
|
196 |
+
"sentence_id": datasets.Value("string"),
|
197 |
+
"topic": datasets.Value("string"),
|
198 |
+
"label": datasets.Value("string"),
|
199 |
+
"sentence": datasets.Value("string")
|
200 |
+
})
|
|
|
|
|
201 |
elif self.config.name == "dalaj-ged":
|
202 |
+
features = datasets.Features({
|
203 |
+
"sentence": datasets.Value("string"),
|
204 |
+
"label": datasets.Value("string"),
|
205 |
+
"meta": datasets.Features({
|
206 |
+
'error_span': datasets.Value("string"),
|
207 |
+
'confusion_pair': datasets.Value("string"),
|
208 |
+
'error_label': datasets.Value("string"),
|
209 |
+
'education_level': datasets.Value("string"),
|
210 |
+
'l1': datasets.Value("string"),
|
211 |
+
'data_source': datasets.Value("string")
|
212 |
+
})
|
213 |
+
})
|
|
|
|
|
|
|
|
|
214 |
elif self.config.name == "sweana":
|
215 |
+
features = datasets.Features({
|
216 |
+
"pair1_element1": datasets.Value("string"),
|
217 |
+
"pair1_element2": datasets.Value("string"),
|
218 |
+
"pair2_element1": datasets.Value("string"),
|
219 |
+
"pair2_element2": datasets.Value("string"),
|
220 |
+
"category": datasets.Value("string"),
|
221 |
+
})
|
|
|
|
|
222 |
elif self.config.name == 'swediagnostics':
|
223 |
+
features = datasets.Features({
|
224 |
+
'lexical_semantics': datasets.Value("string"),
|
225 |
+
'predicate_argument_structure': datasets.Value("string"),
|
226 |
+
'logic': datasets.Value("string"),
|
227 |
+
'knowledge': datasets.Value("string"),
|
228 |
+
'domain': datasets.Value("string"),
|
229 |
+
'premise': datasets.Value("string"),
|
230 |
+
'hypothesis': datasets.Value("string"),
|
231 |
+
'label':datasets.Value("string")
|
232 |
+
})
|
|
|
|
|
233 |
elif self.config.name == 'swedn':
|
234 |
+
features = datasets.Features({
|
235 |
+
"id": datasets.Value("string"),
|
236 |
+
"headline": datasets.Value("string"),
|
237 |
+
"summary": datasets.Value("string"),
|
238 |
+
"article": datasets.Value("string"),
|
239 |
+
"article_category": datasets.Value("string")
|
240 |
+
})
|
|
|
|
|
241 |
elif self.config.name == "swefaq":
|
242 |
+
features = datasets.Features({
|
243 |
+
"category_id": datasets.Value("string"),
|
244 |
+
"candidate_answers": datasets.Value("string"),
|
245 |
+
"question": datasets.Value("string"),
|
246 |
+
"label": datasets.Value("string"),
|
247 |
+
"meta": datasets.Value("string"),
|
248 |
+
})
|
|
|
|
|
249 |
elif self.config.name == 'swemnli':
|
250 |
+
features = datasets.Features({
|
251 |
+
"id": datasets.Value("string"),
|
252 |
+
"premise": datasets.Value("string"),
|
253 |
+
"hypothesis": datasets.Value("string"),
|
254 |
+
"label": datasets.Value("string")
|
255 |
+
})
|
|
|
|
|
256 |
elif self.config.name == "swepar":
|
257 |
+
features = datasets.Features({
|
258 |
+
"genre": datasets.Value("string"),
|
259 |
+
"file": datasets.Value("string"),
|
260 |
+
"sentence_1": datasets.Value("string"),
|
261 |
+
"sentence_2": datasets.Value("string"),
|
262 |
+
"label": datasets.Value("string"),
|
263 |
+
})
|
|
|
|
|
264 |
elif self.config.name == "swesat":
|
265 |
features = datasets.Features({
|
266 |
"id": datasets.Value("string"),
|
|
|
275 |
})
|
276 |
})
|
277 |
elif self.config.name == "swesim_relatedness":
|
278 |
+
features = datasets.Features({
|
279 |
+
"word_1": datasets.Value("string"),
|
280 |
+
"word_2": datasets.Value("string"),
|
281 |
+
"label": datasets.Value("string"),
|
282 |
+
})
|
|
|
|
|
283 |
elif self.config.name == "swesim_similarity":
|
284 |
+
features = datasets.Features({
|
285 |
+
"word_1": datasets.Value("string"),
|
286 |
+
"word_2": datasets.Value("string"),
|
287 |
+
"label": datasets.Value("string"),
|
288 |
+
})
|
|
|
|
|
289 |
elif self.config.name == "swewic":
|
290 |
+
features = datasets.Features({
|
291 |
+
"idx": datasets.Value("string"),
|
292 |
+
"first": datasets.Value("string"),
|
293 |
+
"second": datasets.Value("string"),
|
294 |
+
"label": datasets.Value("string"),
|
295 |
+
"meta": datasets.Value("string"),
|
296 |
+
})
|
|
|
|
|
297 |
else:
|
298 |
raise ValueError(f"Subset {self.config.name} does not exist.")
|
299 |
return datasets.DatasetInfo(
|