Commit
·
0e27810
0
Parent(s):
Update files from the datasets library (from 1.2.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.2.0
- .gitattributes +27 -0
- README.md +146 -0
- dataset_infos.json +1 -0
- dummy/plain_text/1.0.0/dummy_data.zip +3 -0
- wiki_qa_ar.py +119 -0
.gitattributes
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
20 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
+
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- crowdsourced
|
4 |
+
language_creators:
|
5 |
+
- crowdsourced
|
6 |
+
languages:
|
7 |
+
- ar
|
8 |
+
licenses:
|
9 |
+
- unknown
|
10 |
+
multilinguality:
|
11 |
+
- monolingual
|
12 |
+
size_categories:
|
13 |
+
- 10K<n<100K
|
14 |
+
source_datasets:
|
15 |
+
- original
|
16 |
+
task_categories:
|
17 |
+
- question-answering
|
18 |
+
task_ids:
|
19 |
+
- open-domain-qa
|
20 |
+
---
|
21 |
+
|
22 |
+
# Dataset Card for WikiQAar
|
23 |
+
|
24 |
+
## Table of Contents
|
25 |
+
- [Dataset Description](#dataset-description)
|
26 |
+
- [Dataset Summary](#dataset-summary)
|
27 |
+
- [Supported Tasks](#supported-tasks-and-leaderboards)
|
28 |
+
- [Languages](#languages)
|
29 |
+
- [Dataset Structure](#dataset-structure)
|
30 |
+
- [Data Instances](#data-instances)
|
31 |
+
- [Data Fields](#data-instances)
|
32 |
+
- [Data Splits](#data-instances)
|
33 |
+
- [Dataset Creation](#dataset-creation)
|
34 |
+
- [Curation Rationale](#curation-rationale)
|
35 |
+
- [Source Data](#source-data)
|
36 |
+
- [Annotations](#annotations)
|
37 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
38 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
39 |
+
- [Discussion of Social Impact and Biases](#discussion-of-social-impact-and-biases)
|
40 |
+
- [Other Known Limitations](#other-known-limitations)
|
41 |
+
- [Additional Information](#additional-information)
|
42 |
+
- [Dataset Curators](#dataset-curators)
|
43 |
+
- [Licensing Information](#licensing-information)
|
44 |
+
- [Citation Information](#citation-information)
|
45 |
+
|
46 |
+
## Dataset Description
|
47 |
+
|
48 |
+
- **Homepage:** [WikiQaAr](https://github.com/qcri/WikiQAar)
|
49 |
+
- **Repository:** [WikiQaAr](https://github.com/qcri/WikiQAar)
|
50 |
+
- **Paper:**
|
51 |
+
- **Point of Contact:** [Ines Abbes
|
52 |
+
](abbes.ines@yahoo.com)
|
53 |
+
|
54 |
+
### Dataset Summary
|
55 |
+
|
56 |
+
Arabic Version of WikiQA by automatic automatic machine translators
|
57 |
+
and crowdsourced the selection of the best one to be incorporated into the corpus
|
58 |
+
|
59 |
+
### Supported Tasks and Leaderboards
|
60 |
+
|
61 |
+
[More Information Needed]
|
62 |
+
|
63 |
+
### Languages
|
64 |
+
|
65 |
+
The dataset is based on Arabic.
|
66 |
+
|
67 |
+
## Dataset Structure
|
68 |
+
|
69 |
+
### Data Instances
|
70 |
+
|
71 |
+
Each data point contains the question and whether the answer is a valid or not.
|
72 |
+
|
73 |
+
### Data Fields
|
74 |
+
|
75 |
+
- `question_id`: the question id.
|
76 |
+
- `question`: the question text.
|
77 |
+
- `document_id`: the wikipedia document id.
|
78 |
+
- `answer_id` : the answer id.
|
79 |
+
- `answer` : a candidate answer to the question.
|
80 |
+
- `label` : 1 if the `answer` is correct or 0 otherwise.
|
81 |
+
|
82 |
+
### Data Splits
|
83 |
+
|
84 |
+
The dataset is not split.
|
85 |
+
|
86 |
+
| | Tain | Dev | Test |
|
87 |
+
|---------- | ------ | ------| ------|
|
88 |
+
|Data split | 70,264 | 20,632| 10,387|
|
89 |
+
|
90 |
+
## Dataset Creation
|
91 |
+
|
92 |
+
### Curation Rationale
|
93 |
+
|
94 |
+
[More Information Needed]
|
95 |
+
|
96 |
+
### Source Data
|
97 |
+
|
98 |
+
[More Information Needed]
|
99 |
+
|
100 |
+
#### Initial Data Collection and Normalization
|
101 |
+
|
102 |
+
Translation of WikiQA.
|
103 |
+
|
104 |
+
#### Who are the source language producers?
|
105 |
+
|
106 |
+
Translation of WikiQA.
|
107 |
+
|
108 |
+
### Annotations
|
109 |
+
|
110 |
+
The dataset does not contain any additional annotations.
|
111 |
+
|
112 |
+
#### Annotation process
|
113 |
+
|
114 |
+
[More Information Needed]
|
115 |
+
|
116 |
+
#### Who are the annotators?
|
117 |
+
|
118 |
+
[More Information Needed]
|
119 |
+
|
120 |
+
### Personal and Sensitive Information
|
121 |
+
|
122 |
+
[More Information Needed]
|
123 |
+
|
124 |
+
## Considerations for Using the Data
|
125 |
+
|
126 |
+
### Discussion of Social Impact and Biases
|
127 |
+
|
128 |
+
[More Information Needed]
|
129 |
+
|
130 |
+
### Other Known Limitations
|
131 |
+
|
132 |
+
[More Information Needed]
|
133 |
+
|
134 |
+
## Additional Information
|
135 |
+
|
136 |
+
### Dataset Curators
|
137 |
+
|
138 |
+
[More Information Needed]
|
139 |
+
|
140 |
+
### Licensing Information
|
141 |
+
|
142 |
+
[More Information Needed]
|
143 |
+
|
144 |
+
### Citation Information
|
145 |
+
|
146 |
+
[More Information Needed]
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"plain_text": {"description": "Arabic Version of WikiQA by automatic automatic machine translators and crowdsourced the selection of the best one to be incorporated into the corpus\n", "citation": "@InProceedings{YangYihMeek:EMNLP2015:WikiQA,\n author = {{Yi}, Yang and {Wen-tau}, Yih and {Christopher} Meek},\n title = \"{WikiQA: A Challenge Dataset for Open-Domain Question Answering}\",\n journal = {Association for Computational Linguistics},\n year = 2015,\n doi = {10.18653/v1/D15-1237},\n pages = {2013\u20132018},\n}\n", "homepage": "https://github.com/qcri/WikiQAar", "license": "", "features": {"question_id": {"dtype": "string", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "document_id": {"dtype": "string", "id": null, "_type": "Value"}, "answer_id": {"dtype": "string", "id": null, "_type": "Value"}, "answer": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"num_classes": 2, "names": ["0", "1"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "wiki_qa_ar", "config_name": "plain_text", "version": {"version_str": "1.0.0", "description": "", "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 7563127, "num_examples": 20632, "dataset_name": "wiki_qa_ar"}, "validation": {"name": "validation", "num_bytes": 3740721, "num_examples": 10387, "dataset_name": "wiki_qa_ar"}, "train": {"name": "train", "num_bytes": 26009979, "num_examples": 70264, "dataset_name": "wiki_qa_ar"}}, "download_checksums": {"https://raw.githubusercontent.com/qcri/WikiQAar/master/WikiQAar-train.tsv": {"num_bytes": 24563518, "checksum": "4e7ab63b071859ecbd314d34076e9f3968bc09a9673950f8f24be6490d3fba27"}, "https://raw.githubusercontent.com/qcri/WikiQAar/master/WikiQAar-dev.tsv": {"num_bytes": 3531039, "checksum": "3cc65e6e4544190e8e81fab79ba7f30042b59c97b3002f3724de4791c2f7ceee"}, "https://raw.githubusercontent.com/qcri/WikiQAar/master/WikiQAar-test.tsv": {"num_bytes": 7131879, "checksum": "2d8ce9995ba1821eda3ba3734b04e57c19b6ca014ec1f57b36ce86ae9f8de3e3"}}, "download_size": 35226436, "post_processing_size": null, "dataset_size": 37313827, "size_in_bytes": 72540263}}
|
dummy/plain_text/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7aef8e70fe4170ec099417bcec3bdad859a0f20ebf5c04c9e770a3f8c48951fd
|
3 |
+
size 3985
|
wiki_qa_ar.py
ADDED
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
# Copyright 2020 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors.
|
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 |
+
|
16 |
+
# Lint as: python3
|
17 |
+
"""Arabic Wiki Question Answering corpus."""
|
18 |
+
|
19 |
+
from __future__ import absolute_import, division, print_function
|
20 |
+
|
21 |
+
import csv
|
22 |
+
|
23 |
+
import datasets
|
24 |
+
|
25 |
+
|
26 |
+
_CITATION = """\
|
27 |
+
@InProceedings{YangYihMeek:EMNLP2015:WikiQA,
|
28 |
+
author = {{Yi}, Yang and {Wen-tau}, Yih and {Christopher} Meek},
|
29 |
+
title = "{WikiQA: A Challenge Dataset for Open-Domain Question Answering}",
|
30 |
+
journal = {Association for Computational Linguistics},
|
31 |
+
year = 2015,
|
32 |
+
doi = {10.18653/v1/D15-1237},
|
33 |
+
pages = {2013–2018},
|
34 |
+
}
|
35 |
+
"""
|
36 |
+
|
37 |
+
_DESCRIPTION = """\
|
38 |
+
Arabic Version of WikiQA by automatic automatic machine translators \
|
39 |
+
and crowdsourced the selection of the best one to be incorporated into the corpus
|
40 |
+
"""
|
41 |
+
|
42 |
+
_URL = "https://raw.githubusercontent.com/qcri/WikiQAar/master/"
|
43 |
+
_URL_FILES = {
|
44 |
+
"train": _URL + "WikiQAar-train.tsv",
|
45 |
+
"dev": _URL + "WikiQAar-dev.tsv",
|
46 |
+
"test": _URL + "WikiQAar-test.tsv",
|
47 |
+
}
|
48 |
+
|
49 |
+
|
50 |
+
class WikiQaArConfig(datasets.BuilderConfig):
|
51 |
+
"""BuilderConfig for WikiQaAr."""
|
52 |
+
|
53 |
+
def __init__(self, **kwargs):
|
54 |
+
"""BuilderConfig for WikiQaAr.
|
55 |
+
|
56 |
+
Args:
|
57 |
+
**kwargs: keyword arguments forwarded to super.
|
58 |
+
"""
|
59 |
+
super(WikiQaArConfig, self).__init__(version=datasets.Version("1.0.0", ""), **kwargs)
|
60 |
+
|
61 |
+
|
62 |
+
class WikiQaAr(datasets.GeneratorBasedBuilder):
|
63 |
+
"""WikiQaAr dataset."""
|
64 |
+
|
65 |
+
BUILDER_CONFIGS = [
|
66 |
+
WikiQaArConfig(
|
67 |
+
name="plain_text",
|
68 |
+
description="Plain text",
|
69 |
+
)
|
70 |
+
]
|
71 |
+
|
72 |
+
def _info(self):
|
73 |
+
return datasets.DatasetInfo(
|
74 |
+
description=_DESCRIPTION,
|
75 |
+
features=datasets.Features(
|
76 |
+
{
|
77 |
+
"question_id": datasets.Value("string"),
|
78 |
+
"question": datasets.Value("string"),
|
79 |
+
"document_id": datasets.Value("string"),
|
80 |
+
"answer_id": datasets.Value("string"),
|
81 |
+
"answer": datasets.Value("string"),
|
82 |
+
"label": datasets.features.ClassLabel(num_classes=2),
|
83 |
+
}
|
84 |
+
),
|
85 |
+
supervised_keys=None,
|
86 |
+
homepage="https://github.com/qcri/WikiQAar",
|
87 |
+
citation=_CITATION,
|
88 |
+
)
|
89 |
+
|
90 |
+
def _split_generators(self, dl_manager):
|
91 |
+
"""Returns SplitGenerators."""
|
92 |
+
|
93 |
+
dl_dir = dl_manager.download_and_extract(_URL_FILES)
|
94 |
+
|
95 |
+
return [
|
96 |
+
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": dl_dir["test"]}),
|
97 |
+
datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": dl_dir["dev"]}),
|
98 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": dl_dir["train"]}),
|
99 |
+
]
|
100 |
+
|
101 |
+
def _generate_examples(self, filepath):
|
102 |
+
"""Yields examples."""
|
103 |
+
|
104 |
+
with open(filepath, encoding="utf-8") as f:
|
105 |
+
reader = csv.DictReader(f, delimiter="\t", quoting=csv.QUOTE_NONE)
|
106 |
+
for _id, row in enumerate(reader):
|
107 |
+
|
108 |
+
# ignore some entries with errors
|
109 |
+
if len(row) > 6 or len(row["Label"]) == 0:
|
110 |
+
continue
|
111 |
+
|
112 |
+
yield str(_id), {
|
113 |
+
"question_id": row["QuestionID"],
|
114 |
+
"question": row["Question"],
|
115 |
+
"document_id": row["DocumentID"],
|
116 |
+
"answer_id": row["SentenceID"],
|
117 |
+
"answer": row["Sentence"],
|
118 |
+
"label": row["Label"],
|
119 |
+
}
|