Serhii commited on
Commit
f6110d7
·
1 Parent(s): 1f545b4
Files changed (1) hide show
  1. Custom_SQuAD.py +9 -2
Custom_SQuAD.py CHANGED
@@ -16,6 +16,7 @@
16
  import csv
17
  import json
18
  import os
 
19
  import pandas as pd
20
  import datasets
21
  # TODO: Add BibTeX citation
@@ -81,7 +82,10 @@ class ShellcodeIA32(datasets.GeneratorBasedBuilder):
81
  "title": datasets.Value("string"),
82
  "context": datasets.Value("string"),
83
  "question": datasets.Value("string"),
84
- "answers": dict()
 
 
 
85
  }
86
  )
87
  return datasets.DatasetInfo(
@@ -161,5 +165,8 @@ class ShellcodeIA32(datasets.GeneratorBasedBuilder):
161
  "title": row["title"],
162
  "context": row["context"],
163
  "question": row["question"],
164
- "answers": {"text": row["answers"]["text"], "answer_start": row["answers"]["answer_start"]}
 
 
 
165
  }
 
16
  import csv
17
  import json
18
  import os
19
+ from typing import Sequence
20
  import pandas as pd
21
  import datasets
22
  # TODO: Add BibTeX citation
 
82
  "title": datasets.Value("string"),
83
  "context": datasets.Value("string"),
84
  "question": datasets.Value("string"),
85
+ "answers": {
86
+ "text": Sequence(datasets.Value("string")),
87
+ "answer_start": Sequence(datasets.Value("int32"))
88
+ }
89
  }
90
  )
91
  return datasets.DatasetInfo(
 
165
  "title": row["title"],
166
  "context": row["context"],
167
  "question": row["question"],
168
+ "answers": {
169
+ "text": row["answers"]["text"],
170
+ "answer_start": row["answers"]["answer_start"]
171
+ }
172
  }