qanastek commited on
Commit
2079e1a
1 Parent(s): 05222b3

Update FrenchMedMCQA.py

Browse files
Files changed (1) hide show
  1. FrenchMedMCQA.py +5 -2
FrenchMedMCQA.py CHANGED
@@ -86,23 +86,26 @@ class FrenchMedMCQA(datasets.GeneratorBasedBuilder):
86
  name=datasets.Split.TRAIN,
87
  gen_kwargs={
88
  "filepath": data_dir + "/train.json",
 
89
  },
90
  ),
91
  datasets.SplitGenerator(
92
  name=datasets.Split.VALIDATION,
93
  gen_kwargs={
94
  "filepath": data_dir + "/dev.json",
 
95
  },
96
  ),
97
  datasets.SplitGenerator(
98
  name=datasets.Split.TEST,
99
  gen_kwargs={
100
  "filepath": data_dir + "/test.json",
 
101
  },
102
  ),
103
  ]
104
 
105
- def _generate_examples(self, filepath):
106
 
107
  with open(filepath, encoding="utf-8") as f:
108
 
@@ -120,6 +123,6 @@ class FrenchMedMCQA(datasets.GeneratorBasedBuilder):
120
  "answer_e": d["answers"]["e"],
121
  "correct_answers": d["correct_answers"],
122
  "number_correct_answers": str(len(d["correct_answers"])),
123
- "type": d["type"],
124
  "subject_name": d["subject_name"],
125
  }
 
86
  name=datasets.Split.TRAIN,
87
  gen_kwargs={
88
  "filepath": data_dir + "/train.json",
89
+ "split": "train",
90
  },
91
  ),
92
  datasets.SplitGenerator(
93
  name=datasets.Split.VALIDATION,
94
  gen_kwargs={
95
  "filepath": data_dir + "/dev.json",
96
+ "split": "validation",
97
  },
98
  ),
99
  datasets.SplitGenerator(
100
  name=datasets.Split.TEST,
101
  gen_kwargs={
102
  "filepath": data_dir + "/test.json",
103
+ "split": "test",
104
  },
105
  ),
106
  ]
107
 
108
+ def _generate_examples(self, filepath, split):
109
 
110
  with open(filepath, encoding="utf-8") as f:
111
 
 
123
  "answer_e": d["answers"]["e"],
124
  "correct_answers": d["correct_answers"],
125
  "number_correct_answers": str(len(d["correct_answers"])),
126
+ "type": d["type"] if split != "test" else "unknown",
127
  "subject_name": d["subject_name"],
128
  }