Update agieval.py
Browse files- agieval.py +48 -28
agieval.py
CHANGED
@@ -314,21 +314,31 @@ class AgiEval(datasets.GeneratorBasedBuilder):
|
|
314 |
"solution": str(explanation_row),
|
315 |
}
|
316 |
elif self.config.name in ['gaokao_physics', 'jec_qa_ca', 'jec_qa_kd']:
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
elif self.config.name in ['gaokao_mathqa', 'gaokao_chinese', 'gaokao_history', 'gaokao_geography', 'gaokao_biology', 'gaokao_chemistry', 'gaokao_english']:
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
|
|
332 |
except:
|
333 |
pass
|
334 |
else:
|
@@ -384,19 +394,29 @@ class AgiEval(datasets.GeneratorBasedBuilder):
|
|
384 |
"solution": data["label"],
|
385 |
}
|
386 |
elif self.config.name in ['gaokao_physics', 'jec_qa_ca', 'jec_qa_kd']:
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
394 |
elif self.config.name in ['gaokao_mathqa', 'gaokao_chinese', 'gaokao_history', 'gaokao_geography', 'gaokao_biology', 'gaokao_chemistry', 'gaokao_english']:
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
|
|
402 |
|
|
|
314 |
"solution": str(explanation_row),
|
315 |
}
|
316 |
elif self.config.name in ['gaokao_physics', 'jec_qa_ca', 'jec_qa_kd']:
|
317 |
+
if isinstance(data["label"], str):
|
318 |
+
yield key, {
|
319 |
+
"passage": data["passage"],
|
320 |
+
"question": data["question"],
|
321 |
+
"options": data["options"],
|
322 |
+
"label": [data["label"]],
|
323 |
+
"solution": str(explanation_row),
|
324 |
+
}
|
325 |
+
else:
|
326 |
+
yield key, {
|
327 |
+
"passage": data["passage"],
|
328 |
+
"question": data["question"],
|
329 |
+
"options": data["options"],
|
330 |
+
"label": data["label"],
|
331 |
+
"solution": str(explanation_row),
|
332 |
+
}
|
333 |
elif self.config.name in ['gaokao_mathqa', 'gaokao_chinese', 'gaokao_history', 'gaokao_geography', 'gaokao_biology', 'gaokao_chemistry', 'gaokao_english']:
|
334 |
+
if data["label"] in ["A", "B", "C", "D", "E"]:
|
335 |
+
yield key, {
|
336 |
+
"passage": data["passage"],
|
337 |
+
"question": data["question"],
|
338 |
+
"options": data["options"],
|
339 |
+
"label": data["label"],
|
340 |
+
"solution": str(explanation_row),
|
341 |
+
}
|
342 |
except:
|
343 |
pass
|
344 |
else:
|
|
|
394 |
"solution": data["label"],
|
395 |
}
|
396 |
elif self.config.name in ['gaokao_physics', 'jec_qa_ca', 'jec_qa_kd']:
|
397 |
+
if isinstance(data["label"], str):
|
398 |
+
yield key, {
|
399 |
+
"passage": data["passage"],
|
400 |
+
"question": data["question"],
|
401 |
+
"options": data["options"],
|
402 |
+
"label": [data["label"]],
|
403 |
+
"solution": data["label"],
|
404 |
+
}
|
405 |
+
else:
|
406 |
+
yield key, {
|
407 |
+
"passage": data["passage"],
|
408 |
+
"question": data["question"],
|
409 |
+
"options": data["options"],
|
410 |
+
"label": data["label"],
|
411 |
+
"solution": data["label"],
|
412 |
+
}
|
413 |
elif self.config.name in ['gaokao_mathqa', 'gaokao_chinese', 'gaokao_history', 'gaokao_geography', 'gaokao_biology', 'gaokao_chemistry', 'gaokao_english']:
|
414 |
+
if data["label"] in ["A", "B", "C", "D", "E"]:
|
415 |
+
yield key, {
|
416 |
+
"passage": data["passage"],
|
417 |
+
"question": data["question"],
|
418 |
+
"options": data["options"],
|
419 |
+
"label": data["label"],
|
420 |
+
"solution": data["label"],
|
421 |
+
}
|
422 |
|