kimvu commited on
Commit
242aff5
·
1 Parent(s): f03b804

Update agieval.py

Browse files
Files changed (1) hide show
  1. agieval.py +100 -46
agieval.py CHANGED
@@ -54,14 +54,92 @@ class AgiEval(datasets.GeneratorBasedBuilder):
54
  DEFAULT_CONFIG_NAME = "aqua_rat"
55
 
56
  def _info(self):
57
- features = datasets.Features(
58
- {
59
- "question": datasets.Value("string"),
60
- "options": datasets.features.Sequence(datasets.Value("string")),
61
- "label": datasets.ClassLabel(num_classes=5, names=["A", "B", "C", "D", "E"]),
62
- "solution": datasets.Value("string"),
63
- }
64
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  if self.config.name == "aqua_rat":
66
  features = datasets.Features(
67
  {
@@ -71,7 +149,7 @@ class AgiEval(datasets.GeneratorBasedBuilder):
71
  "solution": datasets.Value("string"),
72
  }
73
  )
74
- elif self.config.name in ["sat_en", "sat_math", "sat-en-without-passage"]:
75
  features = datasets.Features(
76
  {"passage": datasets.Value("string"),
77
  "question": datasets.Value("string"),
@@ -80,66 +158,42 @@ class AgiEval(datasets.GeneratorBasedBuilder):
80
  "solution": datasets.Value("string"),
81
  }
82
  )
83
- elif self.config.name in ['logiqa-en', 'logiqa-zh']:
84
  # remove solution from other
85
  features = datasets.Features(
86
- {"passage": datasets.Value("string"),
87
- "question": datasets.Value("string"),
88
  "options": datasets.features.Sequence(datasets.Value("string")),
89
  "label": datasets.ClassLabel(num_classes=4, names=["A", "B", "C", "D"]),
90
  "solution": datasets.Value("string"),
91
  }
92
  )
93
- elif self.config.name == 'math':
 
94
  features = datasets.Features(
95
- {
96
- "passage": datasets.Value("string"),
97
- "question": datasets.Value("string"),
98
- "answer": datasets.Value("string"),
99
  "solution": datasets.Value("string"),
100
- "level": datasets.Value("int32"),
101
- "type": datasets.Value("string"),
102
  }
103
  )
104
- elif self.config.name == 'gaokao-mathcloze':
105
  features = datasets.Features(
106
- {
107
- "passage": datasets.Value("string"),
108
- "question": datasets.Value("string"),
109
  "answer": datasets.Value("string"),
110
  "solution": datasets.Value("string"),
 
 
111
  }
112
  )
113
  elif self.config.name in ['lsat_lr', 'lsat_rc', 'lsat_ar']:
114
  features = datasets.Features(
115
- {
116
- "passage": datasets.Value("string"),
117
- "question": datasets.Value("string"),
118
  "options": datasets.features.Sequence(datasets.Value("string")),
119
  "label": datasets.ClassLabel(num_classes=5, names=["A", "B", "C", "D", "E"]),
120
  "solution": datasets.Value("string"),
121
  }
122
  )
123
- elif self.config.name in ['gaokao-mathqa', 'gaokao-chinese', 'gaokao-history', 'gaokao-geography', 'gaokao-biology', 'gaokao-chemistry', 'gaokao-english']:
124
- features = datasets.Features(
125
- {
126
- "passage": datasets.Value("string"),
127
- "question": datasets.Value("string"),
128
- "options": datasets.features.Sequence(datasets.Value("string")),
129
- "label": datasets.ClassLabel(num_classes=4, names=["A", "B", "C", "D"]),
130
- "solution": datasets.Value("string"),
131
- }
132
- )
133
- elif self.config.name in ['gaokao-physics', 'jec-qa-ca', 'jec-qa-kd']:
134
- features = datasets.Features(
135
- {
136
- "passage": datasets.Value("string"),
137
- "question": datasets.Value("string"),
138
- "options": datasets.features.Sequence(datasets.Value("string")),
139
- "label": datasets.features.Sequence(datasets.Value("string")),
140
- "solution": datasets.Value("string"),
141
- }
142
- )
143
 
144
 
145
  return datasets.DatasetInfo(
 
54
  DEFAULT_CONFIG_NAME = "aqua_rat"
55
 
56
  def _info(self):
57
+ # features = datasets.Features(
58
+ # {
59
+ # "question": datasets.Value("string"),
60
+ # "options": datasets.features.Sequence(datasets.Value("string")),
61
+ # "label": datasets.ClassLabel(num_classes=5, names=["A", "B", "C", "D", "E"]),
62
+ # "solution": datasets.Value("string"),
63
+ # }
64
+ # )
65
+ # if self.config.name == "aqua_rat":
66
+ # features = datasets.Features(
67
+ # {
68
+ # "question": datasets.Value("string"),
69
+ # "options": datasets.features.Sequence(datasets.Value("string")),
70
+ # "label": datasets.ClassLabel(num_classes=5, names=["A", "B", "C", "D", "E"]),
71
+ # "solution": datasets.Value("string"),
72
+ # }
73
+ # )
74
+ # elif self.config.name in ["sat_en", "sat_math", "sat-en-without-passage"]:
75
+ # features = datasets.Features(
76
+ # {"passage": datasets.Value("string"),
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 ['logiqa-en', 'logiqa-zh']:
84
+ # # remove solution from other
85
+ # features = datasets.Features(
86
+ # {"passage": datasets.Value("string"),
87
+ # "question": datasets.Value("string"),
88
+ # "options": datasets.features.Sequence(datasets.Value("string")),
89
+ # "label": datasets.ClassLabel(num_classes=4, names=["A", "B", "C", "D"]),
90
+ # "solution": datasets.Value("string"),
91
+ # }
92
+ # )
93
+ # elif self.config.name == 'math':
94
+ # features = datasets.Features(
95
+ # {
96
+ # "passage": datasets.Value("string"),
97
+ # "question": datasets.Value("string"),
98
+ # "answer": datasets.Value("string"),
99
+ # "solution": datasets.Value("string"),
100
+ # "level": datasets.Value("int32"),
101
+ # "type": datasets.Value("string"),
102
+ # }
103
+ # )
104
+ # elif self.config.name == 'gaokao-mathcloze':
105
+ # features = datasets.Features(
106
+ # {
107
+ # "passage": datasets.Value("string"),
108
+ # "question": datasets.Value("string"),
109
+ # "answer": datasets.Value("string"),
110
+ # "solution": datasets.Value("string"),
111
+ # }
112
+ # )
113
+ # elif self.config.name in ['lsat_lr', 'lsat_rc', 'lsat_ar']:
114
+ # features = datasets.Features(
115
+ # {
116
+ # "passage": datasets.Value("string"),
117
+ # "question": datasets.Value("string"),
118
+ # "options": datasets.features.Sequence(datasets.Value("string")),
119
+ # "label": datasets.ClassLabel(num_classes=5, names=["A", "B", "C", "D", "E"]),
120
+ # "solution": datasets.Value("string"),
121
+ # }
122
+ # )
123
+ # elif self.config.name in ['gaokao-mathqa', 'gaokao-chinese', 'gaokao-history', 'gaokao-geography', 'gaokao-biology', 'gaokao-chemistry', 'gaokao-english']:
124
+ # features = datasets.Features(
125
+ # {
126
+ # "passage": datasets.Value("string"),
127
+ # "question": datasets.Value("string"),
128
+ # "options": datasets.features.Sequence(datasets.Value("string")),
129
+ # "label": datasets.ClassLabel(num_classes=4, names=["A", "B", "C", "D"]),
130
+ # "solution": datasets.Value("string"),
131
+ # }
132
+ # )
133
+ # elif self.config.name in ['gaokao-physics', 'jec-qa-ca', 'jec-qa-kd']:
134
+ # features = datasets.Features(
135
+ # {
136
+ # "passage": datasets.Value("string"),
137
+ # "question": datasets.Value("string"),
138
+ # "options": datasets.features.Sequence(datasets.Value("string")),
139
+ # "label": datasets.features.Sequence(datasets.Value("string")),
140
+ # "solution": datasets.Value("string"),
141
+ # }
142
+ # )
143
  if self.config.name == "aqua_rat":
144
  features = datasets.Features(
145
  {
 
149
  "solution": datasets.Value("string"),
150
  }
151
  )
152
+ elif self.config.name == "sat_en":
153
  features = datasets.Features(
154
  {"passage": datasets.Value("string"),
155
  "question": datasets.Value("string"),
 
158
  "solution": datasets.Value("string"),
159
  }
160
  )
161
+ elif self.config.name == "sat_math":
162
  # remove solution from other
163
  features = datasets.Features(
164
+ {"question": datasets.Value("string"),
 
165
  "options": datasets.features.Sequence(datasets.Value("string")),
166
  "label": datasets.ClassLabel(num_classes=4, names=["A", "B", "C", "D"]),
167
  "solution": datasets.Value("string"),
168
  }
169
  )
170
+ elif self.config.name == "logiqa":
171
+ # remove solution from other
172
  features = datasets.Features(
173
+ {"passage": datasets.Value("string"),
174
+ "question": datasets.Value("string"),
175
+ "options": datasets.features.Sequence(datasets.Value("string")),
176
+ "label": datasets.ClassLabel(num_classes=4, names=["A", "B", "C", "D"]),
177
  "solution": datasets.Value("string"),
 
 
178
  }
179
  )
180
+ elif self.config.name == "math_agieval":
181
  features = datasets.Features(
182
+ {"question": datasets.Value("string"),
 
 
183
  "answer": datasets.Value("string"),
184
  "solution": datasets.Value("string"),
185
+ "level": datasets.Value("int32"),
186
+ "type": datasets.Value("string"),
187
  }
188
  )
189
  elif self.config.name in ['lsat_lr', 'lsat_rc', 'lsat_ar']:
190
  features = datasets.Features(
191
+ {"question": datasets.Value("string"),
 
 
192
  "options": datasets.features.Sequence(datasets.Value("string")),
193
  "label": datasets.ClassLabel(num_classes=5, names=["A", "B", "C", "D", "E"]),
194
  "solution": datasets.Value("string"),
195
  }
196
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
 
198
 
199
  return datasets.DatasetInfo(