kimvu commited on
Commit
411c244
·
1 Parent(s): 1aa9557

Update agieval.py

Browse files
Files changed (1) hide show
  1. agieval.py +14 -4
agieval.py CHANGED
@@ -46,6 +46,9 @@ _URLS = {
46
  "sat_en": {
47
  "test": HEAD+'sat-en.jsonl',
48
  },
 
 
 
49
  "sat_math": {
50
  "test": HEAD+'sat-math.jsonl'
51
  },
@@ -99,6 +102,11 @@ class AgiEval(datasets.GeneratorBasedBuilder):
99
  version=VERSION,
100
  description="",
101
  ),
 
 
 
 
 
102
  datasets.BuilderConfig(
103
  name="lsat_ar",
104
  version=VERSION,
@@ -152,7 +160,7 @@ class AgiEval(datasets.GeneratorBasedBuilder):
152
  "solution": datasets.Value("string"),
153
  }
154
  )
155
- elif self.config.name == "sat_math":
156
  # remove solution from other
157
  features = datasets.Features(
158
  {"question": datasets.Value("string"),
@@ -161,6 +169,7 @@ class AgiEval(datasets.GeneratorBasedBuilder):
161
  "solution": datasets.Value("string"),
162
  }
163
  )
 
164
  elif self.config.name == "logiqa_en":
165
  # remove solution from other
166
  features = datasets.Features(
@@ -232,7 +241,8 @@ class AgiEval(datasets.GeneratorBasedBuilder):
232
  # Mapping for column names in CSV to dataset names
233
  names = {'aqua_rat': 'aqua-rat', 'sat_en': 'sat-en', 'sat_math': 'sat-math',
234
  'lsat_ar': 'lsat-ar', 'lsat_lr': 'lsat-lr', 'lsat_rc': 'lsat-rc',
235
- 'logiqa_en': 'logiqa_en', 'logiqa_zh': 'logiqa_zh', 'math': 'math'}
 
236
 
237
  if split == "few_shot":
238
  # Load the data from the CSV
@@ -246,7 +256,7 @@ class AgiEval(datasets.GeneratorBasedBuilder):
246
  try:
247
  data = ast.literal_eval(samples[names[self.config.name]][key])
248
  explanation_row = explanations[names[self.config.name]][key]
249
- if self.config.name in ["aqua_rat", "sat_math"]:
250
  yield key, {
251
  "question": data["question"],
252
  "options": data["options"],
@@ -304,7 +314,7 @@ class AgiEval(datasets.GeneratorBasedBuilder):
304
  for key, row in enumerate(f):
305
  data = json.loads(row)
306
 
307
- if self.config.name in ["aqua_rat","sat_math"]:
308
  yield key, {
309
  "question": data["question"],
310
  "options": data["options"],
 
46
  "sat_en": {
47
  "test": HEAD+'sat-en.jsonl',
48
  },
49
+ "sat_en_without_passage": {
50
+ "test": HEAD+'sat-en-without-passage.jsonl',
51
+ },
52
  "sat_math": {
53
  "test": HEAD+'sat-math.jsonl'
54
  },
 
102
  version=VERSION,
103
  description="",
104
  ),
105
+ datasets.BuilderConfig(
106
+ name="sat_en_without_passage",
107
+ version=VERSION,
108
+ description="",
109
+ ),
110
  datasets.BuilderConfig(
111
  name="lsat_ar",
112
  version=VERSION,
 
160
  "solution": datasets.Value("string"),
161
  }
162
  )
163
+ elif self.config.name in ["sat_math", "sat_en_without_passage"]:
164
  # remove solution from other
165
  features = datasets.Features(
166
  {"question": datasets.Value("string"),
 
169
  "solution": datasets.Value("string"),
170
  }
171
  )
172
+
173
  elif self.config.name == "logiqa_en":
174
  # remove solution from other
175
  features = datasets.Features(
 
241
  # Mapping for column names in CSV to dataset names
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
 
256
  try:
257
  data = ast.literal_eval(samples[names[self.config.name]][key])
258
  explanation_row = explanations[names[self.config.name]][key]
259
+ if self.config.name in ["aqua_rat", "sat_math", "sat_en_without_passage"]:
260
  yield key, {
261
  "question": data["question"],
262
  "options": data["options"],
 
314
  for key, row in enumerate(f):
315
  data = json.loads(row)
316
 
317
+ if self.config.name in ["aqua_rat","sat_math", "sat_en_without_passage"]:
318
  yield key, {
319
  "question": data["question"],
320
  "options": data["options"],