Check script file
Browse files- klue-mrc.py +17 -16
klue-mrc.py
CHANGED
@@ -73,19 +73,20 @@ class KoreanNewspaper(datasets.GeneratorBasedBuilder):
|
|
73 |
context = paragraphs[0]['context']
|
74 |
qas = paragraphs[0]['qas']
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
|
|
|
73 |
context = paragraphs[0]['context']
|
74 |
qas = paragraphs[0]['qas']
|
75 |
|
76 |
+
for q in qas :
|
77 |
+
question = q['question']
|
78 |
+
|
79 |
+
answer_key = 'answers' if len(qas['answers']) > 0 else 'plausible_answers'
|
80 |
+
answer = qas[answer_key][0]
|
81 |
+
answer_text = answer['text']
|
82 |
+
answer_start = answer['answer_start']
|
83 |
+
guid = qas['guid']
|
84 |
+
|
85 |
+
yield key, {
|
86 |
+
"guid" : guid,
|
87 |
+
"context" : context,
|
88 |
+
"question" : question,
|
89 |
+
"answer_text" : answer_text,
|
90 |
+
"answer_start" : answer_start,
|
91 |
+
}
|
92 |
+
key += 1
|