Datasets:
Commit
•
be51d91
1
Parent(s):
e1e05fb
Convert dataset to Parquet (#3)
Browse files- Convert dataset to Parquet (b26034a708655e76c45699e50055e0faa01ea205)
- Delete loading script (ceec078df1da90e04973644a60ab20144f97500a)
- README.md +10 -5
- covid_qa_deepset.py +0 -127
- covid_qa_deepset/train-00000-of-00001.parquet +3 -0
README.md
CHANGED
@@ -18,9 +18,9 @@ task_categories:
|
|
18 |
task_ids:
|
19 |
- closed-domain-qa
|
20 |
- extractive-qa
|
21 |
-
paperswithcode_id: null
|
22 |
pretty_name: COVID-QA
|
23 |
dataset_info:
|
|
|
24 |
features:
|
25 |
- name: document_id
|
26 |
dtype: int32
|
@@ -38,13 +38,18 @@ dataset_info:
|
|
38 |
dtype: string
|
39 |
- name: answer_start
|
40 |
dtype: int32
|
41 |
-
config_name: covid_qa_deepset
|
42 |
splits:
|
43 |
- name: train
|
44 |
-
num_bytes:
|
45 |
num_examples: 2019
|
46 |
-
download_size:
|
47 |
-
dataset_size:
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
---
|
49 |
|
50 |
|
|
|
18 |
task_ids:
|
19 |
- closed-domain-qa
|
20 |
- extractive-qa
|
|
|
21 |
pretty_name: COVID-QA
|
22 |
dataset_info:
|
23 |
+
config_name: covid_qa_deepset
|
24 |
features:
|
25 |
- name: document_id
|
26 |
dtype: int32
|
|
|
38 |
dtype: string
|
39 |
- name: answer_start
|
40 |
dtype: int32
|
|
|
41 |
splits:
|
42 |
- name: train
|
43 |
+
num_bytes: 65151242
|
44 |
num_examples: 2019
|
45 |
+
download_size: 2274275
|
46 |
+
dataset_size: 65151242
|
47 |
+
configs:
|
48 |
+
- config_name: covid_qa_deepset
|
49 |
+
data_files:
|
50 |
+
- split: train
|
51 |
+
path: covid_qa_deepset/train-*
|
52 |
+
default: true
|
53 |
---
|
54 |
|
55 |
|
covid_qa_deepset.py
DELETED
@@ -1,127 +0,0 @@
|
|
1 |
-
# coding=utf-8
|
2 |
-
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
3 |
-
#
|
4 |
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
-
# you may not use this file except in compliance with the License.
|
6 |
-
# You may obtain a copy of the License at
|
7 |
-
#
|
8 |
-
# http://www.apache.org/licenses/LICENSE-2.0
|
9 |
-
#
|
10 |
-
# Unless required by applicable law or agreed to in writing, software
|
11 |
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
-
# See the License for the specific language governing permissions and
|
14 |
-
# limitations under the License.
|
15 |
-
"""COVID-QA: A Question Answering Dataset for COVID-19."""
|
16 |
-
|
17 |
-
|
18 |
-
import json
|
19 |
-
|
20 |
-
import datasets
|
21 |
-
from datasets.tasks import QuestionAnsweringExtractive
|
22 |
-
|
23 |
-
|
24 |
-
logger = datasets.logging.get_logger(__name__)
|
25 |
-
|
26 |
-
|
27 |
-
_CITATION = """\
|
28 |
-
@inproceedings{moller2020covid,
|
29 |
-
title={COVID-QA: A Question Answering Dataset for COVID-19},
|
30 |
-
author={M{\"o}ller, Timo and Reina, Anthony and Jayakumar, Raghavan and Pietsch, Malte},
|
31 |
-
booktitle={Proceedings of the 1st Workshop on NLP for COVID-19 at ACL 2020},
|
32 |
-
year={2020}
|
33 |
-
}
|
34 |
-
"""
|
35 |
-
|
36 |
-
# You can copy an official description
|
37 |
-
_DESCRIPTION = """\
|
38 |
-
COVID-QA is a Question Answering dataset consisting of 2,019 question/answer pairs annotated by volunteer biomedical \
|
39 |
-
experts on scientific articles related to COVID-19.
|
40 |
-
"""
|
41 |
-
|
42 |
-
_HOMEPAGE = "https://github.com/deepset-ai/COVID-QA"
|
43 |
-
|
44 |
-
_LICENSE = "Apache License 2.0"
|
45 |
-
|
46 |
-
_URL = "https://raw.githubusercontent.com/deepset-ai/COVID-QA/master/data/question-answering/"
|
47 |
-
_URLs = {"covid_qa_deepset": _URL + "COVID-QA.json"}
|
48 |
-
|
49 |
-
|
50 |
-
class CovidQADeepset(datasets.GeneratorBasedBuilder):
|
51 |
-
VERSION = datasets.Version("1.0.0")
|
52 |
-
|
53 |
-
BUILDER_CONFIGS = [
|
54 |
-
datasets.BuilderConfig(name="covid_qa_deepset", version=VERSION, description="COVID-QA deepset"),
|
55 |
-
]
|
56 |
-
|
57 |
-
def _info(self):
|
58 |
-
features = datasets.Features(
|
59 |
-
{
|
60 |
-
"document_id": datasets.Value("int32"),
|
61 |
-
"context": datasets.Value("string"),
|
62 |
-
"question": datasets.Value("string"),
|
63 |
-
"is_impossible": datasets.Value("bool"),
|
64 |
-
"id": datasets.Value("int32"),
|
65 |
-
"answers": datasets.features.Sequence(
|
66 |
-
{
|
67 |
-
"text": datasets.Value("string"),
|
68 |
-
"answer_start": datasets.Value("int32"),
|
69 |
-
}
|
70 |
-
),
|
71 |
-
}
|
72 |
-
)
|
73 |
-
return datasets.DatasetInfo(
|
74 |
-
description=_DESCRIPTION,
|
75 |
-
features=features,
|
76 |
-
supervised_keys=None,
|
77 |
-
homepage=_HOMEPAGE,
|
78 |
-
license=_LICENSE,
|
79 |
-
citation=_CITATION,
|
80 |
-
task_templates=[
|
81 |
-
QuestionAnsweringExtractive(
|
82 |
-
question_column="question", context_column="context", answers_column="answers"
|
83 |
-
)
|
84 |
-
],
|
85 |
-
)
|
86 |
-
|
87 |
-
def _split_generators(self, dl_manager):
|
88 |
-
url = _URLs[self.config.name]
|
89 |
-
downloaded_filepath = dl_manager.download_and_extract(url)
|
90 |
-
|
91 |
-
return [
|
92 |
-
datasets.SplitGenerator(
|
93 |
-
name=datasets.Split.TRAIN,
|
94 |
-
gen_kwargs={"filepath": downloaded_filepath},
|
95 |
-
),
|
96 |
-
]
|
97 |
-
|
98 |
-
def _generate_examples(self, filepath):
|
99 |
-
"""This function returns the examples in the raw (text) form."""
|
100 |
-
logger.info("generating examples from = %s", filepath)
|
101 |
-
with open(filepath, encoding="utf-8") as f:
|
102 |
-
covid_qa = json.load(f)
|
103 |
-
for article in covid_qa["data"]:
|
104 |
-
for paragraph in article["paragraphs"]:
|
105 |
-
context = paragraph["context"].strip()
|
106 |
-
document_id = paragraph["document_id"]
|
107 |
-
for qa in paragraph["qas"]:
|
108 |
-
question = qa["question"].strip()
|
109 |
-
is_impossible = qa["is_impossible"]
|
110 |
-
id_ = qa["id"]
|
111 |
-
|
112 |
-
answer_starts = [answer["answer_start"] for answer in qa["answers"]]
|
113 |
-
answers = [answer["text"].strip() for answer in qa["answers"]]
|
114 |
-
|
115 |
-
# Features currently used are "context", "question", and "answers".
|
116 |
-
# Others are extracted here for the ease of future expansions.
|
117 |
-
yield id_, {
|
118 |
-
"document_id": document_id,
|
119 |
-
"context": context,
|
120 |
-
"question": question,
|
121 |
-
"is_impossible": is_impossible,
|
122 |
-
"id": id_,
|
123 |
-
"answers": {
|
124 |
-
"answer_start": answer_starts,
|
125 |
-
"text": answers,
|
126 |
-
},
|
127 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
covid_qa_deepset/train-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c1662a83af1bd1fc14bf86af1c60386ad8c836ec26896b189765ffe0c92836df
|
3 |
+
size 2274275
|