Update agieval.py
Browse files- agieval.py +18 -33
agieval.py
CHANGED
@@ -165,11 +165,13 @@ class AgiEval(datasets.GeneratorBasedBuilder):
|
|
165 |
)
|
166 |
elif self.config.name == "math":
|
167 |
features = datasets.Features(
|
168 |
-
{
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
|
|
|
|
173 |
}
|
174 |
)
|
175 |
elif self.config.name in ['lsat_lr', 'lsat_rc', 'lsat_ar']:
|
@@ -185,21 +187,21 @@ class AgiEval(datasets.GeneratorBasedBuilder):
|
|
185 |
elif self.config.name in ['gaokao_physics', 'jec_qa_ca', 'jec_qa_kd']:
|
186 |
features = datasets.Features(
|
187 |
{
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
}
|
194 |
)
|
195 |
elif self.config.name in ['gaokao_mathqa', 'gaokao_chinese', 'gaokao_history', 'gaokao_geography', 'gaokao_biology', 'gaokao_chemistry', 'gaokao_english']:
|
196 |
features = datasets.Features(
|
197 |
{
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
}
|
204 |
)
|
205 |
|
@@ -255,15 +257,7 @@ class AgiEval(datasets.GeneratorBasedBuilder):
|
|
255 |
try:
|
256 |
data = ast.literal_eval(samples[names[self.config.name]][key])
|
257 |
explanation_row = explanations[names[self.config.name]][key]
|
258 |
-
if self.config.name in ["aqua_rat", "sat_math", "sat_en_without_passage"]:
|
259 |
-
yield key, {
|
260 |
-
"passage": data["passage"],
|
261 |
-
"question": data["question"],
|
262 |
-
"options": data["options"],
|
263 |
-
"label": data["label"],
|
264 |
-
"solution": str(explanation_row),
|
265 |
-
}
|
266 |
-
elif self.config.name in ["logiqa_en","logiqa_zh"]:
|
267 |
yield key, {
|
268 |
"passage": data["passage"],
|
269 |
"question": data["question"],
|
@@ -284,15 +278,6 @@ class AgiEval(datasets.GeneratorBasedBuilder):
|
|
284 |
"type": data["type"],
|
285 |
"solution": str(explanation_row),
|
286 |
}
|
287 |
-
|
288 |
-
elif self.config.name == "sat_en":
|
289 |
-
yield key, {
|
290 |
-
"passage": data["passage"],
|
291 |
-
"question": data["question"],
|
292 |
-
"options": data["options"],
|
293 |
-
"label": data["label"],
|
294 |
-
"solution": str(explanation_row),
|
295 |
-
}
|
296 |
elif self.config.name in ['lsat_lr', 'lsat_rc', 'lsat_ar']:
|
297 |
yield key, {
|
298 |
"passage": data["passage"],
|
|
|
165 |
)
|
166 |
elif self.config.name == "math":
|
167 |
features = datasets.Features(
|
168 |
+
{
|
169 |
+
"passage": datasets.Value("string"),
|
170 |
+
"question": datasets.Value("string"),
|
171 |
+
"answer": datasets.Value("string"),
|
172 |
+
"solution": datasets.Value("string"),
|
173 |
+
"level": datasets.Value("int32"),
|
174 |
+
"type": datasets.Value("string"),
|
175 |
}
|
176 |
)
|
177 |
elif self.config.name in ['lsat_lr', 'lsat_rc', 'lsat_ar']:
|
|
|
187 |
elif self.config.name in ['gaokao_physics', 'jec_qa_ca', 'jec_qa_kd']:
|
188 |
features = datasets.Features(
|
189 |
{
|
190 |
+
"passage": datasets.Value("string"),
|
191 |
+
"question": datasets.Value("string"),
|
192 |
+
"options": datasets.features.Sequence(datasets.Value("string")),
|
193 |
+
"label": datasets.features.Sequence(datasets.Value("string")),
|
194 |
+
"solution": datasets.Value("string"),
|
195 |
}
|
196 |
)
|
197 |
elif self.config.name in ['gaokao_mathqa', 'gaokao_chinese', 'gaokao_history', 'gaokao_geography', 'gaokao_biology', 'gaokao_chemistry', 'gaokao_english']:
|
198 |
features = datasets.Features(
|
199 |
{
|
200 |
+
"passage": datasets.Value("string"),
|
201 |
+
"question": datasets.Value("string"),
|
202 |
+
"options": datasets.features.Sequence(datasets.Value("string")),
|
203 |
+
"label": datasets.ClassLabel(num_classes=4, names=["A", "B", "C", "D"]),
|
204 |
+
"solution": datasets.Value("string"),
|
205 |
}
|
206 |
)
|
207 |
|
|
|
257 |
try:
|
258 |
data = ast.literal_eval(samples[names[self.config.name]][key])
|
259 |
explanation_row = explanations[names[self.config.name]][key]
|
260 |
+
if self.config.name in ["aqua_rat", "sat_math", "sat_en_without_passage", "logiqa_en","logiqa_zh", "sat_en"]:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
261 |
yield key, {
|
262 |
"passage": data["passage"],
|
263 |
"question": data["question"],
|
|
|
278 |
"type": data["type"],
|
279 |
"solution": str(explanation_row),
|
280 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
281 |
elif self.config.name in ['lsat_lr', 'lsat_rc', 'lsat_ar']:
|
282 |
yield key, {
|
283 |
"passage": data["passage"],
|