sh110495 commited on
Commit
44c7a01
·
1 Parent(s): e8770a0

Check script file

Browse files
Files changed (1) hide show
  1. klue-mrc.py +7 -12
klue-mrc.py CHANGED
@@ -30,10 +30,14 @@ class KoreanNewspaper(datasets.GeneratorBasedBuilder):
30
  description=_DESCRIPTION,
31
  features=datasets.Features(
32
  {
33
- "title": datasets.Value("string"),
34
  "source": datasets.Value("string"),
35
  "news_category": datasets.Value("string"),
36
- "paragraphs": datasets.Sequence(dict)
 
 
 
 
37
  }
38
  ),
39
  # No default supervised_keys (as we have to pass both question
@@ -56,11 +60,9 @@ class KoreanNewspaper(datasets.GeneratorBasedBuilder):
56
  with open(filepath, encoding="utf-8") as f :
57
  data = json.load(f)
58
 
59
- print(data.keys())
60
  data = data['data']
61
 
62
  for info in data :
63
- print(info)
64
  guid = info['title']
65
  news_category = info['news_category']
66
  source = info['source']
@@ -76,7 +78,7 @@ class KoreanNewspaper(datasets.GeneratorBasedBuilder):
76
  answer_start = answer['answer_start']
77
  guid = qas['guid']
78
 
79
- print({
80
  "guid" : guid,
81
  "news_category" : news_category,
82
  "source" : source,
@@ -84,12 +86,5 @@ class KoreanNewspaper(datasets.GeneratorBasedBuilder):
84
  "question" : question,
85
  "answer_text" : answer_text,
86
  "answer_start" : answer_start,
87
- })
88
-
89
- yield key, {
90
- "guid" : guid,
91
- "news_category" : news_category,
92
- "source" : source,
93
- 'paragraphs' : paragraphs
94
  }
95
  key += 1
 
30
  description=_DESCRIPTION,
31
  features=datasets.Features(
32
  {
33
+ "guid": datasets.Value("string"),
34
  "source": datasets.Value("string"),
35
  "news_category": datasets.Value("string"),
36
+ "context": datasets.Value("string"),
37
+ "question": datasets.Value("string"),
38
+ "answer_text":datasets.Value("string"),
39
+ "answer_start":datasets.Value("int32"),
40
+
41
  }
42
  ),
43
  # No default supervised_keys (as we have to pass both question
 
60
  with open(filepath, encoding="utf-8") as f :
61
  data = json.load(f)
62
 
 
63
  data = data['data']
64
 
65
  for info in data :
 
66
  guid = info['title']
67
  news_category = info['news_category']
68
  source = info['source']
 
78
  answer_start = answer['answer_start']
79
  guid = qas['guid']
80
 
81
+ yield key, {
82
  "guid" : guid,
83
  "news_category" : news_category,
84
  "source" : source,
 
86
  "question" : question,
87
  "answer_text" : answer_text,
88
  "answer_start" : answer_start,
 
 
 
 
 
 
 
89
  }
90
  key += 1