sh110495 commited on
Commit
7366bc9
1 Parent(s): e0c8ea0

make dataset type squad metric format

Browse files
Files changed (1) hide show
  1. klue-mrc.py +3 -3
klue-mrc.py CHANGED
@@ -34,8 +34,8 @@ class KoreanNewspaper(datasets.GeneratorBasedBuilder):
34
  "question": datasets.Value("string"),
35
  "answers":
36
  {
37
- "answer_start" : datasets.Value("int32"),
38
- "text":datasets.Value("string")
39
  },
40
  "guid":datasets.Value("string"),
41
 
@@ -83,7 +83,7 @@ class KoreanNewspaper(datasets.GeneratorBasedBuilder):
83
  answer = q[answer_key][0]
84
  answer_text = answer['text']
85
  answer_start = answer['answer_start']
86
- answer_data = {'answer_start' : answer_start, 'text': answer_text}
87
  guid = q['guid']
88
 
89
  yield key, {
 
34
  "question": datasets.Value("string"),
35
  "answers":
36
  {
37
+ "answer_start" : datasets.Sequence(datasets.Value("int32")),
38
+ "text":datasets.Sequence(datasets.Value("string"))
39
  },
40
  "guid":datasets.Value("string"),
41
 
 
83
  answer = q[answer_key][0]
84
  answer_text = answer['text']
85
  answer_start = answer['answer_start']
86
+ answer_data = {'answer_start' : [answer_start], 'text': [answer_text]}
87
  guid = q['guid']
88
 
89
  yield key, {