Severine commited on
Commit
93cb36d
1 Parent(s): c2e0a45
Files changed (1) hide show
  1. SuperLim.py +74 -14
SuperLim.py CHANGED
@@ -188,19 +188,39 @@ class SuperLim(datasets.GeneratorBasedBuilder):
188
  elif self.config.name == "sweana":
189
  features = datasets.Features(
190
  {
191
- "A": datasets.Value("string"),
192
- "B": datasets.Value("string"),
193
- "C": datasets.Value("string"),
194
- "D": datasets.Value("string"),
195
  "relation": datasets.Value("string"),
196
  }
197
  )
198
  elif self.config.name == "swediag":
199
  features = datasets.Features(
200
  {
201
- "Premise": datasets.Value("string"),
202
- "Hypothesis": datasets.Value("string"),
203
- "Label": datasets.Value("string"),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
  }
205
  )
206
  else: # This is an example to show how to have different features for "first_domain" and "second_domain"
@@ -301,17 +321,57 @@ class SuperLim(datasets.GeneratorBasedBuilder):
301
  }
302
  elif self.config.name == "sweana":
303
  yield key, {
304
- "A": row["A"],
305
- "B": row["B"],
306
- "C": row["C"],
307
- "D": row["D"],
308
  "relation": row["relation"],
309
  }
310
  elif self.config.name == "swediag":
311
  yield key, {
312
- "Premise": row["Premise_SE"],
313
- "Hypothesis": row["Hypothesis_SE"],
314
- "Label": row["Label"],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315
  }
316
  else:
317
  yield key, {
 
188
  elif self.config.name == "sweana":
189
  features = datasets.Features(
190
  {
191
+ "a": datasets.Value("string"),
192
+ "b": datasets.Value("string"),
193
+ "c": datasets.Value("string"),
194
+ "d": datasets.Value("string"),
195
  "relation": datasets.Value("string"),
196
  }
197
  )
198
  elif self.config.name == "swediag":
199
  features = datasets.Features(
200
  {
201
+ "premise": datasets.Value("string"),
202
+ "hypothesis": datasets.Value("string"),
203
+ "label": datasets.Value("string"),
204
+ }
205
+ )
206
+ elif self.config.name == "swefaq":
207
+ features = datasets.Features(
208
+ {
209
+ "question": datasets.Value("string"),
210
+ "candidate answer": datasets.Value("string"),
211
+ "correct answer": datasets.Value("string"),
212
+ }
213
+ )
214
+ elif self.config.name == "swefracas":
215
+ features = datasets.Features(
216
+ {
217
+ "answer": datasets.Value("string"),
218
+ "question": datasets.Value("string"),
219
+ "premiss_1": datasets.Value("string"),
220
+ "premiss_2": datasets.Value("string"),
221
+ "premiss_3": datasets.Value("string"),
222
+ "premiss_4": datasets.Value("string"),
223
+ "premiss_5": datasets.Value("string"),
224
  }
225
  )
226
  else: # This is an example to show how to have different features for "first_domain" and "second_domain"
 
321
  }
322
  elif self.config.name == "sweana":
323
  yield key, {
324
+ "a": row["A"],
325
+ "b": row["B"],
326
+ "c": row["C"],
327
+ "d": row["D"],
328
  "relation": row["relation"],
329
  }
330
  elif self.config.name == "swediag":
331
  yield key, {
332
+ "premise": row["Premise_SE"],
333
+ "hypothesis": row["Hypothesis_SE"],
334
+ "label": row["Label"],
335
+ }
336
+ elif self.config.name == "swefaq":
337
+ yield key, {
338
+ "question": row["question"],
339
+ "candidate answer": row["candidate_answer"],
340
+ "correct answer": row["correct_answer"],
341
+ }
342
+ elif self.config.name == "swefaq":
343
+ yield key, {
344
+ "answer": row["svar"],
345
+ "question": row["fråga"],
346
+ "premiss_1": row["premiss_1"],
347
+ "premiss_2": row["premiss_2"],
348
+ "premiss_3": row["premiss_3"],
349
+ "premiss_4": row["premiss_4"],
350
+ "premiss_5": row["premiss_5"],
351
+ }
352
+ elif self.config.name == "swefaq":
353
+ yield key, {
354
+ "question": row["question"],
355
+ "candidate answer": row["candidate answer"],
356
+ "correct answer": row["correct answer"],
357
+ }
358
+ elif self.config.name == "swefaq":
359
+ yield key, {
360
+ "question": row["question"],
361
+ "candidate answer": row["candidate answer"],
362
+ "correct answer": row["correct answer"],
363
+ }
364
+ elif self.config.name == "swefaq":
365
+ yield key, {
366
+ "question": row["question"],
367
+ "candidate answer": row["candidate answer"],
368
+ "correct answer": row["correct answer"],
369
+ }
370
+ elif self.config.name == "swefaq":
371
+ yield key, {
372
+ "question": row["question"],
373
+ "candidate answer": row["candidate answer"],
374
+ "correct answer": row["correct answer"],
375
  }
376
  else:
377
  yield key, {