Update agieval.py
Browse files- agieval.py +15 -96
agieval.py
CHANGED
|
@@ -127,101 +127,6 @@ class AgiEval(datasets.GeneratorBasedBuilder):
|
|
| 127 |
version=datasets.Version("2.0.1"),
|
| 128 |
description="",
|
| 129 |
) for e in list(_URLS.keys()) if e!="few_shot"
|
| 130 |
-
# datasets.BuilderConfig(
|
| 131 |
-
# name="aqua_rat",
|
| 132 |
-
# version=VERSION,
|
| 133 |
-
# description="",
|
| 134 |
-
# ),
|
| 135 |
-
# datasets.BuilderConfig(
|
| 136 |
-
# name="sat_en",
|
| 137 |
-
# version=VERSION,
|
| 138 |
-
# description="",
|
| 139 |
-
# ),
|
| 140 |
-
# datasets.BuilderConfig(
|
| 141 |
-
# name="sat_math",
|
| 142 |
-
# version=VERSION,
|
| 143 |
-
# description="",
|
| 144 |
-
# ),
|
| 145 |
-
# datasets.BuilderConfig(
|
| 146 |
-
# name="sat_en_without_passage",
|
| 147 |
-
# version=VERSION,
|
| 148 |
-
# description="",
|
| 149 |
-
# ),
|
| 150 |
-
# datasets.BuilderConfig(
|
| 151 |
-
# name="lsat_ar",
|
| 152 |
-
# version=VERSION,
|
| 153 |
-
# description="",
|
| 154 |
-
# ),
|
| 155 |
-
# datasets.BuilderConfig(
|
| 156 |
-
# name="lsat_lr",
|
| 157 |
-
# version=VERSION,
|
| 158 |
-
# description="",
|
| 159 |
-
# ),
|
| 160 |
-
# datasets.BuilderConfig(
|
| 161 |
-
# name="lsat_rc",
|
| 162 |
-
# version=VERSION,
|
| 163 |
-
# description="",
|
| 164 |
-
# ),
|
| 165 |
-
# datasets.BuilderConfig(
|
| 166 |
-
# name="logiqa_en",
|
| 167 |
-
# version=VERSION,
|
| 168 |
-
# description="",
|
| 169 |
-
# ),
|
| 170 |
-
# datasets.BuilderConfig(
|
| 171 |
-
# name="logiqa_zh",
|
| 172 |
-
# version=VERSION,
|
| 173 |
-
# description="",
|
| 174 |
-
# ),
|
| 175 |
-
# datasets.BuilderConfig(
|
| 176 |
-
# name="math",
|
| 177 |
-
# version=VERSION,
|
| 178 |
-
# description="",
|
| 179 |
-
# ),
|
| 180 |
-
# datasets.BuilderConfig(
|
| 181 |
-
# name="jec_qa_ca",
|
| 182 |
-
# version=VERSION,
|
| 183 |
-
# description="",
|
| 184 |
-
# ),
|
| 185 |
-
# datasets.BuilderConfig(
|
| 186 |
-
# name="jec_qa_kd",
|
| 187 |
-
# version=VERSION,
|
| 188 |
-
# description="",
|
| 189 |
-
# ),
|
| 190 |
-
# datasets.BuilderConfig(
|
| 191 |
-
# name="gaokao_biology",
|
| 192 |
-
# version=VERSION,
|
| 193 |
-
# description="",
|
| 194 |
-
# ),
|
| 195 |
-
# datasets.BuilderConfig(
|
| 196 |
-
# name="gaokao_biology",
|
| 197 |
-
# version=VERSION,
|
| 198 |
-
# description="",
|
| 199 |
-
# ),
|
| 200 |
-
# datasets.BuilderConfig(
|
| 201 |
-
# name="gaokao_biology",
|
| 202 |
-
# version=VERSION,
|
| 203 |
-
# description="",
|
| 204 |
-
# ),
|
| 205 |
-
# datasets.BuilderConfig(
|
| 206 |
-
# name="gaokao_biology",
|
| 207 |
-
# version=VERSION,
|
| 208 |
-
# description="",
|
| 209 |
-
# ),
|
| 210 |
-
# datasets.BuilderConfig(
|
| 211 |
-
# name="gaokao_biology",
|
| 212 |
-
# version=VERSION,
|
| 213 |
-
# description="",
|
| 214 |
-
# ),
|
| 215 |
-
# datasets.BuilderConfig(
|
| 216 |
-
# name="gaokao_biology",
|
| 217 |
-
# version=VERSION,
|
| 218 |
-
# description="",
|
| 219 |
-
# ),
|
| 220 |
-
# datasets.BuilderConfig(
|
| 221 |
-
# name="gaokao_biology",
|
| 222 |
-
# version=VERSION,
|
| 223 |
-
# description="",
|
| 224 |
-
# ),
|
| 225 |
]
|
| 226 |
DEFAULT_CONFIG_NAME = "aqua_rat"
|
| 227 |
|
|
@@ -302,6 +207,16 @@ class AgiEval(datasets.GeneratorBasedBuilder):
|
|
| 302 |
"solution": datasets.Value("string"),
|
| 303 |
}
|
| 304 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 305 |
|
| 306 |
|
| 307 |
return datasets.DatasetInfo(
|
|
@@ -337,7 +252,11 @@ class AgiEval(datasets.GeneratorBasedBuilder):
|
|
| 337 |
names = {'aqua_rat': 'aqua-rat', 'sat_en': 'sat-en', 'sat_math': 'sat-math',
|
| 338 |
'lsat_ar': 'lsat-ar', 'lsat_lr': 'lsat-lr', 'lsat_rc': 'lsat-rc',
|
| 339 |
'logiqa_en': 'logiqa-en', 'logiqa_zh': 'logiqa-zh', 'math': 'math',
|
| 340 |
-
'sat_en_without_passage': 'sat-en-without-passage', 'jec_qa_ca':'jec-qa-ca',
|
|
|
|
|
|
|
|
|
|
|
|
|
| 341 |
|
| 342 |
if split == "few_shot":
|
| 343 |
# Load the data from the CSV
|
|
|
|
| 127 |
version=datasets.Version("2.0.1"),
|
| 128 |
description="",
|
| 129 |
) for e in list(_URLS.keys()) if e!="few_shot"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
]
|
| 131 |
DEFAULT_CONFIG_NAME = "aqua_rat"
|
| 132 |
|
|
|
|
| 207 |
"solution": datasets.Value("string"),
|
| 208 |
}
|
| 209 |
)
|
| 210 |
+
elif self.config.name in ['gaokao_mathqa', 'gaokao_chinese', 'gaokao_history', 'gaokao_geography', 'gaokao_biology', 'gaokao_chemistry', 'gaokao_english']:
|
| 211 |
+
features = datasets.Features(
|
| 212 |
+
{
|
| 213 |
+
"passage": datasets.Value("string"),
|
| 214 |
+
"question": datasets.Value("string"),
|
| 215 |
+
"options": datasets.features.Sequence(datasets.Value("string")),
|
| 216 |
+
"label": datasets.ClassLabel(num_classes=4, names=["A", "B", "C", "D"]),
|
| 217 |
+
"solution": datasets.Value("string"),
|
| 218 |
+
}
|
| 219 |
+
)
|
| 220 |
|
| 221 |
|
| 222 |
return datasets.DatasetInfo(
|
|
|
|
| 252 |
names = {'aqua_rat': 'aqua-rat', 'sat_en': 'sat-en', 'sat_math': 'sat-math',
|
| 253 |
'lsat_ar': 'lsat-ar', 'lsat_lr': 'lsat-lr', 'lsat_rc': 'lsat-rc',
|
| 254 |
'logiqa_en': 'logiqa-en', 'logiqa_zh': 'logiqa-zh', 'math': 'math',
|
| 255 |
+
'sat_en_without_passage': 'sat-en-without-passage', 'jec_qa_ca':'jec-qa-ca',
|
| 256 |
+
'jec_qa_kd':'jec-qa-kd', 'gaokao_mathqa':'gaokao-mathqa', 'gaokao_chinese':'gaokao-chinese',
|
| 257 |
+
'gaokao_history':'gaokao-history', 'gaokao_geography':'gaokao-geography',
|
| 258 |
+
'gaokao_biology':'gaokao-biology', 'gaokao_chemistry':'gaokao-chemistry',
|
| 259 |
+
'gaokao_english':"gaokao-english", "gaokao_physics":"gaokao-physics"}
|
| 260 |
|
| 261 |
if split == "few_shot":
|
| 262 |
# Load the data from the CSV
|