Commit
·
264fdd7
1
Parent(s):
791e650
remove voided questions
Browse files- oab_exams_no_train.py +4 -0
oab_exams_no_train.py
CHANGED
@@ -39,6 +39,7 @@ class OABExamsNoTrain(datasets.GeneratorBasedBuilder):
|
|
39 |
"exam_id": datasets.Value("string"),
|
40 |
"exam_year": datasets.Value("string"),
|
41 |
"question_type": datasets.Value("string"),
|
|
|
42 |
"question": datasets.Value("string"),
|
43 |
"choices": datasets.Sequence(feature={
|
44 |
"text": datasets.Value("string"),
|
@@ -53,6 +54,9 @@ class OABExamsNoTrain(datasets.GeneratorBasedBuilder):
|
|
53 |
|
54 |
def _split_generators(self, dl_manager):
|
55 |
dataset = datasets.load_dataset(_URL, split="train")
|
|
|
|
|
|
|
56 |
dataset_dev = dataset.filter(lambda example: example['exam_id'] in _EXAM_IDS_DEV)
|
57 |
dataset_test = dataset.filter(lambda example: example['exam_id'] not in _EXAM_IDS_DEV)
|
58 |
|
|
|
39 |
"exam_id": datasets.Value("string"),
|
40 |
"exam_year": datasets.Value("string"),
|
41 |
"question_type": datasets.Value("string"),
|
42 |
+
"nullified": datasets.Value("bool"),
|
43 |
"question": datasets.Value("string"),
|
44 |
"choices": datasets.Sequence(feature={
|
45 |
"text": datasets.Value("string"),
|
|
|
54 |
|
55 |
def _split_generators(self, dl_manager):
|
56 |
dataset = datasets.load_dataset(_URL, split="train")
|
57 |
+
#remove voided questions
|
58 |
+
dataset = dataset.filter(lambda example: not example['nullified'])
|
59 |
+
|
60 |
dataset_dev = dataset.filter(lambda example: example['exam_id'] in _EXAM_IDS_DEV)
|
61 |
dataset_test = dataset.filter(lambda example: example['exam_id'] not in _EXAM_IDS_DEV)
|
62 |
|