Datasets:
Tasks:
Question Answering
Modalities:
Text
Formats:
parquet
Languages:
Polish
Size:
10K - 100K
License:
Update poquad_v2.py
Browse files- poquad_v2.py +6 -6
poquad_v2.py
CHANGED
@@ -41,7 +41,7 @@ class SquadV2(datasets.GeneratorBasedBuilder):
|
|
41 |
|
42 |
# TODO(squad_v2): Set up version.
|
43 |
BUILDER_CONFIGS = [
|
44 |
-
SquadV2Config(name="
|
45 |
]
|
46 |
|
47 |
def _info(self):
|
@@ -56,7 +56,7 @@ class SquadV2(datasets.GeneratorBasedBuilder):
|
|
56 |
"title": datasets.Value("string"),
|
57 |
"context": datasets.Value("string"),
|
58 |
"question": datasets.Value("string"),
|
59 |
-
"is_impossible": datasets.Value("
|
60 |
"answers": datasets.features.Sequence(
|
61 |
{
|
62 |
"text": datasets.Value("string"),
|
@@ -109,9 +109,9 @@ class SquadV2(datasets.GeneratorBasedBuilder):
|
|
109 |
question = qa["question"]
|
110 |
is_impossible = qa["is_impossible"]
|
111 |
|
112 |
-
answers = [
|
113 |
-
answer_starts = [
|
114 |
-
generative_answers = [
|
115 |
|
116 |
check_ans = "answers"
|
117 |
if is_impossible is False:
|
@@ -124,7 +124,7 @@ class SquadV2(datasets.GeneratorBasedBuilder):
|
|
124 |
"title": title,
|
125 |
"context": context,
|
126 |
"question": question,
|
127 |
-
"is_impossible" : is_impossible,
|
128 |
# "paragraph_id": paragraph_id,
|
129 |
"answers": {
|
130 |
"answer_start": answer_starts,
|
|
|
41 |
|
42 |
# TODO(squad_v2): Set up version.
|
43 |
BUILDER_CONFIGS = [
|
44 |
+
SquadV2Config(name="poquad_v2", version=datasets.Version("1.0.0"), description="PoQuaD plaint text"),
|
45 |
]
|
46 |
|
47 |
def _info(self):
|
|
|
56 |
"title": datasets.Value("string"),
|
57 |
"context": datasets.Value("string"),
|
58 |
"question": datasets.Value("string"),
|
59 |
+
"is_impossible": datasets.Value("string"),
|
60 |
"answers": datasets.features.Sequence(
|
61 |
{
|
62 |
"text": datasets.Value("string"),
|
|
|
109 |
question = qa["question"]
|
110 |
is_impossible = qa["is_impossible"]
|
111 |
|
112 |
+
answers = []
|
113 |
+
answer_starts = []
|
114 |
+
generative_answers = []
|
115 |
|
116 |
check_ans = "answers"
|
117 |
if is_impossible is False:
|
|
|
124 |
"title": title,
|
125 |
"context": context,
|
126 |
"question": question,
|
127 |
+
"is_impossible" : str(is_impossible),
|
128 |
# "paragraph_id": paragraph_id,
|
129 |
"answers": {
|
130 |
"answer_start": answer_starts,
|