baber commited on
Commit
c7f4ef8
1 Parent(s): 8f1beb7

Update agieval.py

Browse files
Files changed (1) hide show
  1. agieval.py +16 -2
agieval.py CHANGED
@@ -148,7 +148,7 @@ class LogiQA2(datasets.GeneratorBasedBuilder):
148
  "solution": datasets.Value("string"),
149
  }
150
  )
151
- elif self.config.name in ["sat_math", "logiqa"]:
152
  # remove solution from other
153
  features = datasets.Features(
154
  {"question": datasets.Value("string"),
@@ -157,6 +157,14 @@ class LogiQA2(datasets.GeneratorBasedBuilder):
157
  "solution": datasets.Value("string"),
158
  }
159
  )
 
 
 
 
 
 
 
 
160
  elif self.config.name == "math_agieval":
161
  features = datasets.Features(
162
  {"question": datasets.Value("string"),
@@ -201,13 +209,19 @@ class LogiQA2(datasets.GeneratorBasedBuilder):
201
  for key, row in enumerate(f):
202
  data = json.loads(row)
203
 
204
- if self.config.name in ["aqua_rat","sat_math", "logiqa"]:
205
  yield key, {
206
  "question": data["question"],
207
  "options": data["options"],
208
  "label": data["label"],
209
  "solution": data["other"]["solution"],
210
  }
 
 
 
 
 
 
211
  elif self.config.name == "math_agieval":
212
  yield key, {
213
  "question": data["question"],
 
148
  "solution": datasets.Value("string"),
149
  }
150
  )
151
+ elif self.config.name == "sat_math":
152
  # remove solution from other
153
  features = datasets.Features(
154
  {"question": datasets.Value("string"),
 
157
  "solution": datasets.Value("string"),
158
  }
159
  )
160
+ elif self.config.name == "logiqa":
161
+ # remove solution from other
162
+ features = datasets.Features(
163
+ {"question": datasets.Value("string"),
164
+ "options": datasets.features.Sequence(datasets.Value("string")),
165
+ "label": datasets.ClassLabel(num_classes=4, names=["A", "B", "C", "D"]),
166
+ }
167
+ )
168
  elif self.config.name == "math_agieval":
169
  features = datasets.Features(
170
  {"question": datasets.Value("string"),
 
209
  for key, row in enumerate(f):
210
  data = json.loads(row)
211
 
212
+ if self.config.name in ["aqua_rat","sat_math"]:
213
  yield key, {
214
  "question": data["question"],
215
  "options": data["options"],
216
  "label": data["label"],
217
  "solution": data["other"]["solution"],
218
  }
219
+ elif self.config.name == "logiqa":
220
+ yield key, {
221
+ "question": data["question"],
222
+ "options": data["options"],
223
+ "label": data["label"],
224
+ }
225
  elif self.config.name == "math_agieval":
226
  yield key, {
227
  "question": data["question"],