Update agieval.py
Browse files- agieval.py +22 -5
agieval.py
CHANGED
|
@@ -66,16 +66,23 @@ class AgiEval(datasets.GeneratorBasedBuilder):
|
|
| 66 |
print("IDKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK")
|
| 67 |
features = datasets.Features(
|
| 68 |
{
|
| 69 |
-
"passage": datasets.Value("string")||None,
|
| 70 |
"question": datasets.Value("string"),
|
| 71 |
"options": datasets.features.Sequence(datasets.Value("string")),
|
| 72 |
"label": datasets.ClassLabel(num_classes=5, names=["A", "B", "C", "D", "E"]),
|
| 73 |
"solution": datasets.Value("string"),
|
| 74 |
}
|
| 75 |
)
|
| 76 |
-
elif self.config.name in ["sat_en", "sat_math"
|
| 77 |
features = datasets.Features(
|
| 78 |
-
{"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
"question": datasets.Value("string"),
|
| 80 |
"options": datasets.features.Sequence(datasets.Value("string")),
|
| 81 |
"label": datasets.ClassLabel(num_classes=4, names=["A", "B", "C", "D"]),
|
|
@@ -278,13 +285,23 @@ class AgiEval(datasets.GeneratorBasedBuilder):
|
|
| 278 |
data = json.loads(row)
|
| 279 |
if self.config.name == "aqua_rat":
|
| 280 |
yield key, {
|
| 281 |
-
"passage": data["passage"],
|
| 282 |
"question": data["question"],
|
| 283 |
"options": data["options"],
|
| 284 |
"label": data["label"],
|
| 285 |
"solution": data["other"]["solution"],
|
| 286 |
}
|
| 287 |
-
elif self.config.name in ["sat_en", "sat_math"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 288 |
label_index = "ABCDE".index(data["label"])
|
| 289 |
if label_index > len(data["options"]) - 1:
|
| 290 |
continue
|
|
|
|
| 66 |
print("IDKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK")
|
| 67 |
features = datasets.Features(
|
| 68 |
{
|
|
|
|
| 69 |
"question": datasets.Value("string"),
|
| 70 |
"options": datasets.features.Sequence(datasets.Value("string")),
|
| 71 |
"label": datasets.ClassLabel(num_classes=5, names=["A", "B", "C", "D", "E"]),
|
| 72 |
"solution": datasets.Value("string"),
|
| 73 |
}
|
| 74 |
)
|
| 75 |
+
elif self.config.name in ["sat_en", "sat_math"]:
|
| 76 |
features = datasets.Features(
|
| 77 |
+
{"question": datasets.Value("string"),
|
| 78 |
+
"options": datasets.features.Sequence(datasets.Value("string")),
|
| 79 |
+
"label": datasets.ClassLabel(num_classes=4, names=["A", "B", "C", "D"]),
|
| 80 |
+
"solution": datasets.Value("string"),
|
| 81 |
+
}
|
| 82 |
+
)
|
| 83 |
+
elif self.config.name in ["sat-en-without-passage"]:
|
| 84 |
+
features = datasets.Features(
|
| 85 |
+
{"passage": datasets.Value("string"),
|
| 86 |
"question": datasets.Value("string"),
|
| 87 |
"options": datasets.features.Sequence(datasets.Value("string")),
|
| 88 |
"label": datasets.ClassLabel(num_classes=4, names=["A", "B", "C", "D"]),
|
|
|
|
| 285 |
data = json.loads(row)
|
| 286 |
if self.config.name == "aqua_rat":
|
| 287 |
yield key, {
|
|
|
|
| 288 |
"question": data["question"],
|
| 289 |
"options": data["options"],
|
| 290 |
"label": data["label"],
|
| 291 |
"solution": data["other"]["solution"],
|
| 292 |
}
|
| 293 |
+
elif self.config.name in ["sat_en", "sat_math"]:
|
| 294 |
+
label_index = "ABCDE".index(data["label"])
|
| 295 |
+
if label_index > len(data["options"]) - 1:
|
| 296 |
+
continue
|
| 297 |
+
else:
|
| 298 |
+
yield key, {
|
| 299 |
+
"question": data["question"],
|
| 300 |
+
"options": data["options"],
|
| 301 |
+
"label": data["label"],
|
| 302 |
+
"solution": data["other"]["solution"],
|
| 303 |
+
}
|
| 304 |
+
elif self.config.name in ["sat-en-without-passage"]:
|
| 305 |
label_index = "ABCDE".index(data["label"])
|
| 306 |
if label_index > len(data["options"]) - 1:
|
| 307 |
continue
|