Add mutiple answer dataset
Browse files- klue-mrc.py +10 -4
klue-mrc.py
CHANGED
@@ -80,10 +80,16 @@ class KoreanNewspaper(datasets.GeneratorBasedBuilder):
|
|
80 |
question = q['question']
|
81 |
|
82 |
answer_key = 'answers' if len(q['answers']) > 0 else 'plausible_answers'
|
83 |
-
answer = q[answer_key]
|
84 |
-
|
85 |
-
|
86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
guid = q['guid']
|
88 |
|
89 |
yield key, {
|
|
|
80 |
question = q['question']
|
81 |
|
82 |
answer_key = 'answers' if len(q['answers']) > 0 else 'plausible_answers'
|
83 |
+
answer = q[answer_key]
|
84 |
+
|
85 |
+
answer_text_list = []
|
86 |
+
answer_start_list = []
|
87 |
+
|
88 |
+
for ans in answer :
|
89 |
+
answer_text_list.append(ans['text'])
|
90 |
+
answer_start_list.append(ans['answer_start'])
|
91 |
+
|
92 |
+
answer_data = {'text' : answer_text_list, 'answer_start' : answer_start_list}
|
93 |
guid = q['guid']
|
94 |
|
95 |
yield key, {
|