Datasets:
Commit
•
7bb1125
1
Parent(s):
a677fd5
Bismillah
Browse files- README.md +209 -0
- dataset_infos.json +1 -0
- quranqa.py +131 -0
README.md
ADDED
@@ -0,0 +1,209 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- expert-generated
|
4 |
+
language:
|
5 |
+
- ar
|
6 |
+
language_creators:
|
7 |
+
- expert-generated
|
8 |
+
license:
|
9 |
+
- cc-by-nd-4.0
|
10 |
+
multilinguality:
|
11 |
+
- monolingual
|
12 |
+
pretty_name: Qur'anic Reading Comprehension Dataset
|
13 |
+
size_categories:
|
14 |
+
- n<1K
|
15 |
+
- 1K<n<10K
|
16 |
+
source_datasets:
|
17 |
+
- original
|
18 |
+
tags:
|
19 |
+
- quran
|
20 |
+
- qa
|
21 |
+
task_categories:
|
22 |
+
- question-answering
|
23 |
+
task_ids:
|
24 |
+
- extractive-qa
|
25 |
+
---
|
26 |
+
|
27 |
+
# Dataset Card for [Dataset Name]
|
28 |
+
|
29 |
+
## Table of Contents
|
30 |
+
- [Table of Contents](#table-of-contents)
|
31 |
+
- [Dataset Description](#dataset-description)
|
32 |
+
- [Dataset Summary](#dataset-summary)
|
33 |
+
- [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
|
34 |
+
- [Languages](#languages)
|
35 |
+
- [Dataset Structure](#dataset-structure)
|
36 |
+
- [Data Instances](#data-instances)
|
37 |
+
- [Data Fields](#data-fields)
|
38 |
+
- [Data Splits](#data-splits)
|
39 |
+
- [Dataset Creation](#dataset-creation)
|
40 |
+
- [Curation Rationale](#curation-rationale)
|
41 |
+
- [Source Data](#source-data)
|
42 |
+
- [Annotations](#annotations)
|
43 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
44 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
45 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
46 |
+
- [Discussion of Biases](#discussion-of-biases)
|
47 |
+
- [Other Known Limitations](#other-known-limitations)
|
48 |
+
- [Additional Information](#additional-information)
|
49 |
+
- [Dataset Curators](#dataset-curators)
|
50 |
+
- [Licensing Information](#licensing-information)
|
51 |
+
- [Citation Information](#citation-information)
|
52 |
+
- [Contributions](#contributions)
|
53 |
+
|
54 |
+
## Dataset Description
|
55 |
+
|
56 |
+
- **Homepage:** https://sites.google.com/view/quran-qa-2022/home
|
57 |
+
- **Repository:** https://gitlab.com/bigirqu/quranqa/-/tree/main/
|
58 |
+
- **Paper:** https://dl.acm.org/doi/10.1145/3400396
|
59 |
+
- **Leaderboard:**
|
60 |
+
- **Point of Contact:** @piraka9011
|
61 |
+
|
62 |
+
### Dataset Summary
|
63 |
+
|
64 |
+
The QRCD (Qur'anic Reading Comprehension Dataset) is composed of 1,093 tuples of question-passage pairs that are
|
65 |
+
coupled with their extracted answers to constitute 1,337 question-passage-answer triplets.
|
66 |
+
|
67 |
+
The distribution of the dataset into training, development and test sets is shown below.
|
68 |
+
|
69 |
+
| **Dataset** | **%** | **# Question-Passage Pairs** | **# Question-Passage-Answer Triplets** |
|
70 |
+
|-------------|:-----:|:-----------------------------:|:---------------------------------------:|
|
71 |
+
| Training | 65% | 710 | 861 |
|
72 |
+
| Development | 10% | 109 | 128 |
|
73 |
+
| Test | 25% | 274 | 348 |
|
74 |
+
| All | 100% | 1,093 | 1,337 |
|
75 |
+
|
76 |
+
### Supported Tasks and Leaderboards
|
77 |
+
|
78 |
+
[More Information Needed]
|
79 |
+
|
80 |
+
### Languages
|
81 |
+
|
82 |
+
* Arabic
|
83 |
+
|
84 |
+
## Dataset Structure
|
85 |
+
|
86 |
+
### Data Instances
|
87 |
+
|
88 |
+
To simplify the structure of the dataset, each tuple contains one passage, one question and a list that may contain
|
89 |
+
one or more answers to that question, as shown below:
|
90 |
+
|
91 |
+
```json
|
92 |
+
{
|
93 |
+
"pq_id": "38:41-44_105",
|
94 |
+
"passage": "واذكر عبدنا أيوب إذ نادى ربه أني مسني الشيطان بنصب وعذاب. اركض برجلك هذا مغتسل بارد وشراب. ووهبنا له أهله ومثلهم معهم رحمة منا وذكرى لأولي الألباب. وخذ بيدك ضغثا فاضرب به ولا تحنث إنا وجدناه صابرا نعم العبد إنه أواب.",
|
95 |
+
"surah": 38,
|
96 |
+
"verses": "41-44",
|
97 |
+
"question": "من هو النبي المعروف بالصبر؟",
|
98 |
+
"answers": [
|
99 |
+
{
|
100 |
+
"text": "أيوب",
|
101 |
+
"start_char": 12
|
102 |
+
}
|
103 |
+
]
|
104 |
+
}
|
105 |
+
```
|
106 |
+
|
107 |
+
Each Qur’anic passage in QRCD may have more than one occurrence; and each passage occurrence is paired with a different
|
108 |
+
question.
|
109 |
+
Likewise, each question in QRCD may have more than one occurrence; and each question occurrence is paired with a
|
110 |
+
different Qur’anic passage.
|
111 |
+
The source of the Qur'anic text in QRCD is the Tanzil project download page, which provides verified versions of the
|
112 |
+
Holy Qur'an in several scripting styles.
|
113 |
+
We have chosen the simple-clean text style of Tanzil version 1.0.2.
|
114 |
+
|
115 |
+
### Data Fields
|
116 |
+
|
117 |
+
* `pq_id`: Sample ID
|
118 |
+
* `passage`: Context text
|
119 |
+
* `surah`: Surah number
|
120 |
+
* `verses`: Verse range
|
121 |
+
* `question`: Question text
|
122 |
+
* `answers`: List of answers and their start character
|
123 |
+
|
124 |
+
### Data Splits
|
125 |
+
|
126 |
+
* Training (65%)
|
127 |
+
* Development (10%)
|
128 |
+
* Test (25%)
|
129 |
+
|
130 |
+
## Dataset Creation
|
131 |
+
|
132 |
+
### Curation Rationale
|
133 |
+
|
134 |
+
[More Information Needed]
|
135 |
+
|
136 |
+
### Source Data
|
137 |
+
|
138 |
+
#### Initial Data Collection and Normalization
|
139 |
+
|
140 |
+
[More Information Needed]
|
141 |
+
|
142 |
+
#### Who are the source language producers?
|
143 |
+
|
144 |
+
[More Information Needed]
|
145 |
+
|
146 |
+
### Annotations
|
147 |
+
|
148 |
+
#### Annotation process
|
149 |
+
|
150 |
+
[More Information Needed]
|
151 |
+
|
152 |
+
#### Who are the annotators?
|
153 |
+
|
154 |
+
[More Information Needed]
|
155 |
+
|
156 |
+
### Personal and Sensitive Information
|
157 |
+
|
158 |
+
[More Information Needed]
|
159 |
+
|
160 |
+
## Considerations for Using the Data
|
161 |
+
|
162 |
+
### Social Impact of Dataset
|
163 |
+
|
164 |
+
[More Information Needed]
|
165 |
+
|
166 |
+
### Discussion of Biases
|
167 |
+
|
168 |
+
[More Information Needed]
|
169 |
+
|
170 |
+
### Other Known Limitations
|
171 |
+
|
172 |
+
[More Information Needed]
|
173 |
+
|
174 |
+
## Additional Information
|
175 |
+
|
176 |
+
### Dataset Curators
|
177 |
+
|
178 |
+
[More Information Needed]
|
179 |
+
|
180 |
+
### Licensing Information
|
181 |
+
|
182 |
+
The QRCD v1.1 dataset is distributed under the CC-BY-ND 4.0 License https://creativecommons.org/licenses/by-nd/4.0/legalcode
|
183 |
+
For a human-readable summary of (and not a substitute for) the above CC-BY-ND 4.0 License, please refer to https://creativecommons.org/licenses/by-nd/4.0/
|
184 |
+
|
185 |
+
### Citation Information
|
186 |
+
|
187 |
+
```
|
188 |
+
@article{malhas2020ayatec,
|
189 |
+
author = {Malhas, Rana and Elsayed, Tamer},
|
190 |
+
title = {AyaTEC: Building a Reusable Verse-Based Test Collection for Arabic Question Answering on the Holy Qur’an},
|
191 |
+
year = {2020},
|
192 |
+
issue_date = {November 2020},
|
193 |
+
publisher = {Association for Computing Machinery},
|
194 |
+
address = {New York, NY, USA},
|
195 |
+
volume = {19},
|
196 |
+
number = {6},
|
197 |
+
issn = {2375-4699},
|
198 |
+
url = {https://doi.org/10.1145/3400396},
|
199 |
+
doi = {10.1145/3400396},
|
200 |
+
journal = {ACM Trans. Asian Low-Resour. Lang. Inf. Process.},
|
201 |
+
month = {oct},
|
202 |
+
articleno = {78},
|
203 |
+
numpages = {21},
|
204 |
+
keywords = {evaluation, Classical Arabic}
|
205 |
+
}
|
206 |
+
```
|
207 |
+
### Contributions
|
208 |
+
|
209 |
+
Thanks to [@piraka9011](https://github.com/piraka9011) for adding this dataset.
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"shared_task": {"description": "The absence of publicly available reusable test collections for Arabic question answering on the Holy Qur\u2019an has impeded the possibility of fairly comparing the performance of systems in that domain. In this article, we introduce AyaTEC, a reusable test collection for verse-based question answering on the Holy Qur\u2019an, which serves as a common experimental testbed for this task. AyaTEC includes 207 questions (with their corresponding 1,762 answers) covering 11 topic categories of the Holy Qur\u2019an that target the information needs of both curious and skeptical users. To the best of our effort, the answers to the questions (each represented as a sequence of verses) in AyaTEC were exhaustive\u2014that is, all qur\u2019anic verses that directly answered the questions were exhaustively extracted and annotated. To facilitate the use of AyaTEC in evaluating the systems designed for that task, we propose several evaluation measures to support the different types of questions and the nature of verse-based answers while integrating the concept of partial matching of answers in the evaluation.\n", "citation": "@article{malhas2020ayatec,\n author = {Malhas, Rana and Elsayed, Tamer},\n title = {AyaTEC: Building a Reusable Verse-Based Test Collection for Arabic Question Answering on the Holy Qur\u2019an},\n year = {2020},\n issue_date = {November 2020},\n publisher = {Association for Computing Machinery},\n address = {New York, NY, USA},\n volume = {19},\n number = {6},\n issn = {2375-4699},\n url = {https://doi.org/10.1145/3400396},\n doi = {10.1145/3400396},\n journal = {ACM Trans. Asian Low-Resour. Lang. Inf. Process.},\n month = {oct},\n articleno = {78},\n numpages = {21},\n keywords = {evaluation, Classical Arabic}\n}\n", "homepage": "https://sites.google.com/view/quran-qa-2022/home", "license": "CC-BY-ND 4.0", "features": {"pq_id": {"dtype": "string", "id": null, "_type": "Value"}, "passage": {"dtype": "string", "id": null, "_type": "Value"}, "surah": {"dtype": "int8", "id": null, "_type": "Value"}, "verses": {"dtype": "string", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "answers": {"feature": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "start_char": {"dtype": "int32", "id": null, "_type": "Value"}}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": [{"task": "question-answering-extractive", "question_column": "question", "context_column": "passage", "answers_column": "answers"}], "builder_name": "quranqa", "config_name": "shared_task", "version": {"version_str": "1.1.0", "description": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 692719, "num_examples": 710, "dataset_name": "quranqa"}, "validation": {"name": "validation", "num_bytes": 107785, "num_examples": 109, "dataset_name": "quranqa"}, "test": {"name": "test", "num_bytes": 216975, "num_examples": 238, "dataset_name": "quranqa"}, "test_noAnswers": {"name": "test_noAnswers", "num_bytes": 227799, "num_examples": 274, "dataset_name": "quranqa"}}, "download_checksums": {"https://gitlab.com/bigirqu/quranqa/-/raw/main/datasets/qrcd_v1.1_train.jsonl": {"num_bytes": 756171, "checksum": "3e867fb2c999cdb2bbbbbd5fd1f9f11141106993256bb991b07a524c3e63be83"}, "https://gitlab.com/bigirqu/quranqa/-/raw/main/datasets/qrcd_v1.1_dev.jsonl": {"num_bytes": 117412, "checksum": "20709f850d9eb42e94ffba7190607f43ced485057c73df705a20fd0a71a34dcd"}, "https://gitlab.com/bigirqu/quranqa/-/raw/main/datasets/qrcd_v1.1_test_gold.jsonl": {"num_bytes": 238439, "checksum": "c84cda2227d2f90fb25c91fc6a0611b26b4d02ba6d2c07b7b86f86be90846049"}, "https://gitlab.com/bigirqu/quranqa/-/raw/main/datasets/qrcd_v1.1_test_noAnswers.jsonl": {"num_bytes": 244683, "checksum": "f461e9eee7281edf411566c6322a62f7722ef153fe59d4ee269c783c4ae70e87"}}, "download_size": 1356705, "post_processing_size": null, "dataset_size": 1245278, "size_in_bytes": 2601983}}
|
quranqa.py
ADDED
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import json
|
2 |
+
|
3 |
+
import datasets
|
4 |
+
from datasets.tasks import QuestionAnsweringExtractive
|
5 |
+
|
6 |
+
|
7 |
+
_CITATION = """\
|
8 |
+
@article{malhas2020ayatec,
|
9 |
+
author = {Malhas, Rana and Elsayed, Tamer},
|
10 |
+
title = {AyaTEC: Building a Reusable Verse-Based Test Collection for Arabic Question Answering on the Holy Qur’an},
|
11 |
+
year = {2020},
|
12 |
+
issue_date = {November 2020},
|
13 |
+
publisher = {Association for Computing Machinery},
|
14 |
+
address = {New York, NY, USA},
|
15 |
+
volume = {19},
|
16 |
+
number = {6},
|
17 |
+
issn = {2375-4699},
|
18 |
+
url = {https://doi.org/10.1145/3400396},
|
19 |
+
doi = {10.1145/3400396},
|
20 |
+
journal = {ACM Trans. Asian Low-Resour. Lang. Inf. Process.},
|
21 |
+
month = {oct},
|
22 |
+
articleno = {78},
|
23 |
+
numpages = {21},
|
24 |
+
keywords = {evaluation, Classical Arabic}
|
25 |
+
}
|
26 |
+
"""
|
27 |
+
|
28 |
+
_DESCRIPTION = """\
|
29 |
+
The absence of publicly available reusable test collections for Arabic question answering on the Holy Qur’an has \
|
30 |
+
impeded the possibility of fairly comparing the performance of systems in that domain. In this article, we introduce \
|
31 |
+
AyaTEC, a reusable test collection for verse-based question answering on the Holy Qur’an, which serves as a common \
|
32 |
+
experimental testbed for this task. AyaTEC includes 207 questions (with their corresponding 1,762 answers) covering 11 \
|
33 |
+
topic categories of the Holy Qur’an that target the information needs of both curious and skeptical users. To the best \
|
34 |
+
of our effort, the answers to the questions (each represented as a sequence of verses) in AyaTEC were exhaustive—that \
|
35 |
+
is, all qur’anic verses that directly answered the questions were exhaustively extracted and annotated. To facilitate \
|
36 |
+
the use of AyaTEC in evaluating the systems designed for that task, we propose several evaluation measures to support \
|
37 |
+
the different types of questions and the nature of verse-based answers while integrating the concept of partial \
|
38 |
+
matching of answers in the evaluation.
|
39 |
+
"""
|
40 |
+
|
41 |
+
_HOMEPAGE = "https://sites.google.com/view/quran-qa-2022/home"
|
42 |
+
|
43 |
+
_LICENSE = "CC-BY-ND 4.0"
|
44 |
+
|
45 |
+
_URL = "https://gitlab.com/bigirqu/quranqa/-/raw/main/datasets/"
|
46 |
+
_URLS = {
|
47 |
+
"train": _URL + "qrcd_v1.1_train.jsonl",
|
48 |
+
"dev": _URL + "qrcd_v1.1_dev.jsonl",
|
49 |
+
"test": _URL + "qrcd_v1.1_test_gold.jsonl",
|
50 |
+
"test_noAnswers": _URL + "qrcd_v1.1_test_noAnswers.jsonl",
|
51 |
+
}
|
52 |
+
|
53 |
+
|
54 |
+
class QuranQAConfig(datasets.BuilderConfig):
|
55 |
+
"""BuilderConfig for QuranQA."""
|
56 |
+
|
57 |
+
def __init__(self, **kwargs):
|
58 |
+
"""BuilderConfig for QuranQA.
|
59 |
+
Args:
|
60 |
+
**kwargs: keyword arguments forwarded to super.
|
61 |
+
"""
|
62 |
+
super(QuranQAConfig, self).__init__(**kwargs)
|
63 |
+
|
64 |
+
|
65 |
+
class QuranQA(datasets.GeneratorBasedBuilder):
|
66 |
+
"""QuranQA: Qur'anic Reading Comprehension Dataset. Version 1.1.0"""
|
67 |
+
|
68 |
+
VERSION = datasets.Version("1.1.0")
|
69 |
+
|
70 |
+
BUILDER_CONFIGS = [
|
71 |
+
QuranQAConfig(name="shared_task", version=VERSION, description="Shared task (LREC 2022)"),
|
72 |
+
]
|
73 |
+
|
74 |
+
def _info(self):
|
75 |
+
return datasets.DatasetInfo(
|
76 |
+
description=_DESCRIPTION,
|
77 |
+
features=datasets.Features(
|
78 |
+
{
|
79 |
+
"pq_id": datasets.Value("string"),
|
80 |
+
"passage": datasets.Value("string"),
|
81 |
+
"surah": datasets.Value("int8"),
|
82 |
+
"verses": datasets.Value("string"),
|
83 |
+
"question": datasets.Value("string"),
|
84 |
+
"answers": datasets.features.Sequence(
|
85 |
+
{
|
86 |
+
"text": datasets.Value("string"),
|
87 |
+
"start_char": datasets.Value("int32"),
|
88 |
+
}
|
89 |
+
),
|
90 |
+
}
|
91 |
+
),
|
92 |
+
homepage=_HOMEPAGE,
|
93 |
+
license=_LICENSE,
|
94 |
+
citation=_CITATION,
|
95 |
+
task_templates=[
|
96 |
+
QuestionAnsweringExtractive(
|
97 |
+
question_column="question", context_column="passage", answers_column="answers"
|
98 |
+
)
|
99 |
+
],
|
100 |
+
)
|
101 |
+
|
102 |
+
def _split_generators(self, dl_manager):
|
103 |
+
downloaded_files = dl_manager.download(_URLS)
|
104 |
+
|
105 |
+
return [
|
106 |
+
datasets.SplitGenerator(
|
107 |
+
name=datasets.Split.TRAIN,
|
108 |
+
gen_kwargs={"filepath": downloaded_files["train"]},
|
109 |
+
),
|
110 |
+
datasets.SplitGenerator(
|
111 |
+
name=datasets.Split.VALIDATION,
|
112 |
+
gen_kwargs={"filepath": downloaded_files["dev"]},
|
113 |
+
),
|
114 |
+
datasets.SplitGenerator(
|
115 |
+
name=datasets.Split.TEST,
|
116 |
+
gen_kwargs={"filepath": downloaded_files["test"]},
|
117 |
+
),
|
118 |
+
datasets.SplitGenerator(
|
119 |
+
name="test_noAnswers",
|
120 |
+
gen_kwargs={"filepath": downloaded_files["test_noAnswers"]},
|
121 |
+
),
|
122 |
+
]
|
123 |
+
|
124 |
+
def _generate_examples(self, filepath):
|
125 |
+
key = 0
|
126 |
+
with open(filepath, encoding="utf-8") as f:
|
127 |
+
samples = f.readlines()
|
128 |
+
samples = [json.loads(s) for s in samples]
|
129 |
+
for sample in samples:
|
130 |
+
yield key, sample
|
131 |
+
key += 1
|