sh110495 commited on
Commit
fcd37c6
·
1 Parent(s): 2df2d46

Check script file

Browse files
Files changed (1) hide show
  1. 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
- question = qas['question']
77
-
78
- answer_key = 'answers' if len(qas['answers']) > 0 else 'plausible_answers'
79
- answer = qas[answer_key][0]
80
- answer_text = answer['text']
81
- answer_start = answer['answer_start']
82
- guid = qas['guid']
83
-
84
- yield key, {
85
- "guid" : guid,
86
- "context" : context,
87
- "question" : question,
88
- "answer_text" : answer_text,
89
- "answer_start" : answer_start,
90
- }
91
- key += 1
 
 
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