Datasets:
Update files from the datasets library (from 1.7.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.7.0
- README.md +4 -3
- covid_qa_castorini.py +3 -3
README.md
CHANGED
@@ -18,6 +18,7 @@ task_categories:
|
|
18 |
task_ids:
|
19 |
- open-domain-qa
|
20 |
- extractive-qa
|
|
|
21 |
---
|
22 |
|
23 |
|
@@ -26,12 +27,12 @@ task_ids:
|
|
26 |
## Table of Contents
|
27 |
- [Dataset Description](#dataset-description)
|
28 |
- [Dataset Summary](#dataset-summary)
|
29 |
-
- [Supported Tasks](#supported-tasks-and-leaderboards)
|
30 |
- [Languages](#languages)
|
31 |
- [Dataset Structure](#dataset-structure)
|
32 |
- [Data Instances](#data-instances)
|
33 |
-
- [Data Fields](#data-
|
34 |
-
- [Data Splits](#data-
|
35 |
- [Dataset Creation](#dataset-creation)
|
36 |
- [Curation Rationale](#curation-rationale)
|
37 |
- [Source Data](#source-data)
|
|
|
18 |
task_ids:
|
19 |
- open-domain-qa
|
20 |
- extractive-qa
|
21 |
+
paperswithcode_id: covidqa
|
22 |
---
|
23 |
|
24 |
|
|
|
27 |
## Table of Contents
|
28 |
- [Dataset Description](#dataset-description)
|
29 |
- [Dataset Summary](#dataset-summary)
|
30 |
+
- [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
|
31 |
- [Languages](#languages)
|
32 |
- [Dataset Structure](#dataset-structure)
|
33 |
- [Data Instances](#data-instances)
|
34 |
+
- [Data Fields](#data-fields)
|
35 |
+
- [Data Splits](#data-splits)
|
36 |
- [Dataset Creation](#dataset-creation)
|
37 |
- [Curation Rationale](#curation-rationale)
|
38 |
- [Source Data](#source-data)
|
covid_qa_castorini.py
CHANGED
@@ -96,9 +96,9 @@ class CovidQaCastorini(datasets.GeneratorBasedBuilder):
|
|
96 |
logger.info("generating examples from = %s", filepath)
|
97 |
with open(filepath, encoding="utf-8") as f:
|
98 |
covid_qa = json.load(f)
|
99 |
-
for article in covid_qa["categories"]:
|
100 |
category_name = article["name"]
|
101 |
-
for
|
102 |
question_query = paragraph["nq_name"]
|
103 |
keyword_query = paragraph["kq_name"]
|
104 |
|
@@ -106,7 +106,7 @@ class CovidQaCastorini(datasets.GeneratorBasedBuilder):
|
|
106 |
titles = [answer["title"] for answer in paragraph["answers"]]
|
107 |
exact_answers = [answer["exact_answer"] for answer in paragraph["answers"]]
|
108 |
|
109 |
-
yield
|
110 |
"category_name": category_name,
|
111 |
"question_query": question_query,
|
112 |
"keyword_query": keyword_query,
|
|
|
96 |
logger.info("generating examples from = %s", filepath)
|
97 |
with open(filepath, encoding="utf-8") as f:
|
98 |
covid_qa = json.load(f)
|
99 |
+
for article_idx, article in enumerate(covid_qa["categories"]):
|
100 |
category_name = article["name"]
|
101 |
+
for paragraph_idx, paragraph in enumerate(article["sub_categories"]):
|
102 |
question_query = paragraph["nq_name"]
|
103 |
keyword_query = paragraph["kq_name"]
|
104 |
|
|
|
106 |
titles = [answer["title"] for answer in paragraph["answers"]]
|
107 |
exact_answers = [answer["exact_answer"] for answer in paragraph["answers"]]
|
108 |
|
109 |
+
yield f"{article_idx}_{paragraph_idx}", {
|
110 |
"category_name": category_name,
|
111 |
"question_query": question_query,
|
112 |
"keyword_query": keyword_query,
|