Update agieval.py
Browse files- agieval.py +43 -1
agieval.py
CHANGED
|
@@ -73,6 +73,12 @@ _URLS = {
|
|
| 73 |
'math': {
|
| 74 |
"test": HEAD+'math.jsonl'
|
| 75 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
'few_shot': {
|
| 77 |
'few_shot':'https://raw.githubusercontent.com/microsoft/AGIEval/main/data/few_shot_prompts.csv'
|
| 78 |
}
|
|
@@ -137,6 +143,16 @@ class AgiEval(datasets.GeneratorBasedBuilder):
|
|
| 137 |
version=VERSION,
|
| 138 |
description="",
|
| 139 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
]
|
| 141 |
DEFAULT_CONFIG_NAME = "aqua_rat"
|
| 142 |
|
|
@@ -207,6 +223,16 @@ class AgiEval(datasets.GeneratorBasedBuilder):
|
|
| 207 |
"solution": datasets.Value("string"),
|
| 208 |
}
|
| 209 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 210 |
|
| 211 |
|
| 212 |
return datasets.DatasetInfo(
|
|
@@ -242,7 +268,7 @@ class AgiEval(datasets.GeneratorBasedBuilder):
|
|
| 242 |
names = {'aqua_rat': 'aqua-rat', 'sat_en': 'sat-en', 'sat_math': 'sat-math',
|
| 243 |
'lsat_ar': 'lsat-ar', 'lsat_lr': 'lsat-lr', 'lsat_rc': 'lsat-rc',
|
| 244 |
'logiqa_en': 'logiqa-en', 'logiqa_zh': 'logiqa-zh', 'math': 'math',
|
| 245 |
-
'sat_en_without_passage': 'sat-en-without-passage'}
|
| 246 |
|
| 247 |
if split == "few_shot":
|
| 248 |
# Load the data from the CSV
|
|
@@ -299,6 +325,14 @@ class AgiEval(datasets.GeneratorBasedBuilder):
|
|
| 299 |
"label": data["label"],
|
| 300 |
"solution": str(explanation_row),
|
| 301 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 302 |
except:
|
| 303 |
pass
|
| 304 |
else:
|
|
@@ -353,4 +387,12 @@ class AgiEval(datasets.GeneratorBasedBuilder):
|
|
| 353 |
"label": data["label"],
|
| 354 |
"solution": data["label"],
|
| 355 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 356 |
|
|
|
|
| 73 |
'math': {
|
| 74 |
"test": HEAD+'math.jsonl'
|
| 75 |
},
|
| 76 |
+
'jec_qa_ca': {
|
| 77 |
+
"test": HEAD+'jec-qa-ca.jsonl'
|
| 78 |
+
},
|
| 79 |
+
'jec_qa_kd': {
|
| 80 |
+
"test": HEAD+'jec-qa-kd.jsonl'
|
| 81 |
+
},
|
| 82 |
'few_shot': {
|
| 83 |
'few_shot':'https://raw.githubusercontent.com/microsoft/AGIEval/main/data/few_shot_prompts.csv'
|
| 84 |
}
|
|
|
|
| 143 |
version=VERSION,
|
| 144 |
description="",
|
| 145 |
),
|
| 146 |
+
datasets.BuilderConfig(
|
| 147 |
+
name="jec_qa_ca",
|
| 148 |
+
version=VERSION,
|
| 149 |
+
description="",
|
| 150 |
+
),
|
| 151 |
+
datasets.BuilderConfig(
|
| 152 |
+
name="jec_qa_kd",
|
| 153 |
+
version=VERSION,
|
| 154 |
+
description="",
|
| 155 |
+
),
|
| 156 |
]
|
| 157 |
DEFAULT_CONFIG_NAME = "aqua_rat"
|
| 158 |
|
|
|
|
| 223 |
"solution": datasets.Value("string"),
|
| 224 |
}
|
| 225 |
)
|
| 226 |
+
elif self.config.name in ['gaokao_physics', 'jec_qa_ca', 'jec_qa_kd']:
|
| 227 |
+
features = datasets.Features(
|
| 228 |
+
{
|
| 229 |
+
"passage": datasets.Value("string"),
|
| 230 |
+
"question": datasets.Value("string"),
|
| 231 |
+
"options": datasets.features.Sequence(datasets.Value("string")),
|
| 232 |
+
"label": datasets.features.Sequence(datasets.Value("string")),
|
| 233 |
+
"solution": datasets.Value("string"),
|
| 234 |
+
}
|
| 235 |
+
)
|
| 236 |
|
| 237 |
|
| 238 |
return datasets.DatasetInfo(
|
|
|
|
| 268 |
names = {'aqua_rat': 'aqua-rat', 'sat_en': 'sat-en', 'sat_math': 'sat-math',
|
| 269 |
'lsat_ar': 'lsat-ar', 'lsat_lr': 'lsat-lr', 'lsat_rc': 'lsat-rc',
|
| 270 |
'logiqa_en': 'logiqa-en', 'logiqa_zh': 'logiqa-zh', 'math': 'math',
|
| 271 |
+
'sat_en_without_passage': 'sat-en-without-passage', 'jec_qa_ca':'jec-qa-ca', 'jec_qa_kd':'jec-qa-kd'}
|
| 272 |
|
| 273 |
if split == "few_shot":
|
| 274 |
# Load the data from the CSV
|
|
|
|
| 325 |
"label": data["label"],
|
| 326 |
"solution": str(explanation_row),
|
| 327 |
}
|
| 328 |
+
elif self.config.name in ['gaokao_physics', 'jec_qa_ca', 'jec_qa_kd']:
|
| 329 |
+
yield key, {
|
| 330 |
+
"passage": data["passage"],
|
| 331 |
+
"question": data["question"],
|
| 332 |
+
"options": data["options"],
|
| 333 |
+
"label": data["label"],
|
| 334 |
+
"solution": str(explanation_row),
|
| 335 |
+
}
|
| 336 |
except:
|
| 337 |
pass
|
| 338 |
else:
|
|
|
|
| 387 |
"label": data["label"],
|
| 388 |
"solution": data["label"],
|
| 389 |
}
|
| 390 |
+
elif self.config.name in ['gaokao_physics', 'jec_qa_ca', 'jec-qa_kd']:
|
| 391 |
+
yield key, {
|
| 392 |
+
"passage": data["passage"],
|
| 393 |
+
"question": data["question"],
|
| 394 |
+
"options": data["options"],
|
| 395 |
+
"label": data["label"],
|
| 396 |
+
"solution": data["label"],
|
| 397 |
+
}
|
| 398 |
|