Serhii commited on
Commit
a70d1e9
·
1 Parent(s): 90d3763
Files changed (1) hide show
  1. Custom_SQuAD.py +19 -0
Custom_SQuAD.py CHANGED
@@ -76,6 +76,15 @@ class ShellcodeIA32(datasets.GeneratorBasedBuilder):
76
  DEFAULT_CONFIG_NAME = "default" # It's not mandatory to have a default configuration. Just use one if it make sense.
77
  def _info(self):
78
  # TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
 
 
 
 
 
 
 
 
 
79
  features = datasets.Features(
80
  {
81
  "id": datasets.Value("string"),
@@ -88,6 +97,7 @@ class ShellcodeIA32(datasets.GeneratorBasedBuilder):
88
  }
89
  }
90
  )
 
91
  return datasets.DatasetInfo(
92
  # This is the description that will appear on the datasets page.
93
  description=_DESCRIPTION,
@@ -159,6 +169,14 @@ class ShellcodeIA32(datasets.GeneratorBasedBuilder):
159
  data = dev
160
  elif split == 'test':
161
  data = test
 
 
 
 
 
 
 
 
162
  for idx, row in data.iterrows():
163
  yield idx, {
164
  "id": row["id"],
@@ -170,3 +188,4 @@ class ShellcodeIA32(datasets.GeneratorBasedBuilder):
170
  "answer_start": row["answers"]["answer_start"]
171
  }
172
  }
 
 
76
  DEFAULT_CONFIG_NAME = "default" # It's not mandatory to have a default configuration. Just use one if it make sense.
77
  def _info(self):
78
  # TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
79
+ features = datasets.Features(
80
+ {
81
+ "id": datasets.Value("string"),
82
+ "question": datasets.Value("string"),
83
+ "answers": datasets.Sequence(datasets.Value("string"))
84
+ }
85
+ )
86
+
87
+ """
88
  features = datasets.Features(
89
  {
90
  "id": datasets.Value("string"),
 
97
  }
98
  }
99
  )
100
+ """
101
  return datasets.DatasetInfo(
102
  # This is the description that will appear on the datasets page.
103
  description=_DESCRIPTION,
 
169
  data = dev
170
  elif split == 'test':
171
  data = test
172
+ for idx, row in data.iterrows():
173
+ yield idx, {
174
+ "id": row["id"],
175
+ "question": row["question"],
176
+ "answers": row["answers"]["text"]
177
+ }
178
+
179
+ """
180
  for idx, row in data.iterrows():
181
  yield idx, {
182
  "id": row["id"],
 
188
  "answer_start": row["answers"]["answer_start"]
189
  }
190
  }
191
+ """