kumapo commited on
Commit
5ab001a
1 Parent(s): b4f4ace

Upload JAQKET.py

Browse files
Files changed (1) hide show
  1. JAQKET.py +6 -2
JAQKET.py CHANGED
@@ -44,7 +44,8 @@ def dataset_info_v2() -> ds.Features:
44
  "qid": ds.Value("string"),
45
  "question": ds.Value("string"),
46
  "answers": ds.Sequence({
47
- "text": ds.Value("string")
 
48
  }),
49
  "ctxs": ds.Sequence({
50
  "id": ds.Value("string"),
@@ -107,7 +108,10 @@ class JAQKET(ds.GeneratorBasedBuilder):
107
  for json_dict in json_data:
108
  q_id = json_dict["qid"]
109
  question = json_dict["question"]
110
- answers = [{"text": answer} for answer in json_dict["answers"]]
 
 
 
111
  ctxs = [
112
  {
113
  "id": ctx["id"],
 
44
  "qid": ds.Value("string"),
45
  "question": ds.Value("string"),
46
  "answers": ds.Sequence({
47
+ "text": ds.Value("string"),
48
+ "answer_start": ds.Value("int32"),
49
  }),
50
  "ctxs": ds.Sequence({
51
  "id": ds.Value("string"),
 
108
  for json_dict in json_data:
109
  q_id = json_dict["qid"]
110
  question = json_dict["question"]
111
+ answers = [
112
+ {"text": answer, "answer_start": -1 } # -1: dummy
113
+ for answer in json_dict["answers"]
114
+ ]
115
  ctxs = [
116
  {
117
  "id": ctx["id"],