Datasets:
Tasks:
Question Answering
Modalities:
Text
Formats:
parquet
Sub-tasks:
extractive-qa
Languages:
Arabic
Size:
1K - 10K
License:
Convert dataset to Parquet
#2
by albertvillanova HF Staff - opened
Files changed (5)
- README.md+15-7
- arcd.pyDeleted-123
- dataset_infos.jsonDeleted-1
- plain_text/train-00000-of-00001.parquetAdded+3
- plain_text/validation-00000-of-00001.parquetAdded+3
4 unmodified lines567891011128 unmodified lines212223242526279 unmodified lines373839404142434445464748495051524 unmodified lines- crowdsourcedlanguage:- arlanguage_bcp47:- ar-SAlicense:- mitmultilinguality:8 unmodified lines- extractive-qapaperswithcode_id: arcdpretty_name: ARCDdataset_info:features:- name: iddtype: string9 unmodified linesdtype: string- name: answer_startdtype: int32config_name: plain_textsplits:- name: trainnum_bytes: 811064num_examples: 693- name: validationnum_bytes: 885648num_examples: 702download_size: 1942399dataset_size: 1696712---# Dataset Card for "arcd"4 unmodified lines56789108 unmodified lines192021222324252627289 unmodified lines38394041424344454647484950515253545556575859604 unmodified lines- crowdsourcedlanguage:- arlicense:- mitmultilinguality:8 unmodified lines- extractive-qapaperswithcode_id: arcdpretty_name: ARCDlanguage_bcp47:- ar-SAdataset_info:config_name: plain_textfeatures:- name: iddtype: string9 unmodified linesdtype: string- name: answer_startdtype: int32splits:- name: trainnum_bytes: 811036num_examples: 693- name: validationnum_bytes: 885620num_examples: 702download_size: 365858dataset_size: 1696656configs:- config_name: plain_textdata_files:- split: trainpath: plain_text/train-*- split: validationpath: plain_text/validation-*default: true---# Dataset Card for "arcd"
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123"""ARCD: Arabic Reading Comprehension Dataset."""
import json
import datasetsfrom datasets.tasks import QuestionAnsweringExtractive
logger = datasets.logging.get_logger(__name__)
_CITATION = """\@inproceedings{mozannar-etal-2019-neural, title = {Neural {A}rabic Question Answering}, author = {Mozannar, Hussein and Maamary, Elie and El Hajal, Karl and Hajj, Hazem}, booktitle = {Proceedings of the Fourth Arabic Natural Language Processing Workshop}, month = {aug}, year = {2019}, address = {Florence, Italy}, publisher = {Association for Computational Linguistics}, url = {https://www.aclweb.org/anthology/W19-4612}, doi = {10.18653/v1/W19-4612}, pages = {108--118}, abstract = {This paper tackles the problem of open domain factual Arabic question answering (QA) using Wikipedia as our knowledge source. This constrains the answer of any question to be a span of text in Wikipedia. Open domain QA for Arabic entails three challenges: annotated QA datasets in Arabic, large scale efficient information retrieval and machine reading comprehension. To deal with the lack of Arabic QA datasets we present the Arabic Reading Comprehension Dataset (ARCD) composed of 1,395 questions posed by crowdworkers on Wikipedia articles, and a machine translation of the Stanford Question Answering Dataset (Arabic-SQuAD). Our system for open domain question answering in Arabic (SOQAL) is based on two components: (1) a document retriever using a hierarchical TF-IDF approach and (2) a neural reading comprehension model using the pre-trained bi-directional transformer BERT. Our experiments on ARCD indicate the effectiveness of our approach with our BERT-based reader achieving a 61.3 F1 score, and our open domain system SOQAL achieving a 27.6 F1 score.}}"""
_DESCRIPTION = """\ Arabic Reading Comprehension Dataset (ARCD) composed of 1,395 questions\ posed by crowdworkers on Wikipedia articles."""
_URL = "https://raw.githubusercontent.com/husseinmozannar/SOQAL/master/data/"_URLs = { "train": _URL + "arcd-train.json", "dev": _URL + "arcd-test.json",}
class ArcdConfig(datasets.BuilderConfig): """BuilderConfig for ARCD."""
def __init__(self, **kwargs): """BuilderConfig for ARCD.
Args: **kwargs: keyword arguments forwarded to super. """ super(ArcdConfig, self).__init__(**kwargs)
class Arcd(datasets.GeneratorBasedBuilder): """ARCD: Arabic Reading Comprehension Dataset."""
BUILDER_CONFIGS = [ ArcdConfig( name="plain_text", version=datasets.Version("1.0.0", ""), description="Plain text", ) ]
def _info(self): return datasets.DatasetInfo( description=_DESCRIPTION, features=datasets.Features( { "id": datasets.Value("string"), "title": datasets.Value("string"), "context": datasets.Value("string"), "question": datasets.Value("string"), "answers": datasets.features.Sequence( {"text": datasets.Value("string"), "answer_start": datasets.Value("int32")} ), } ), # No default supervised_keys (as we have to pass both question # and context as input). supervised_keys=None, homepage="https://github.com/husseinmozannar/SOQAL/tree/master/data", citation=_CITATION, task_templates=[ QuestionAnsweringExtractive( question_column="question", context_column="context", answers_column="answers" ) ], )
def _split_generators(self, dl_manager): urls_to_download = _URLs downloaded_files = dl_manager.download_and_extract(urls_to_download)
return [ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}), datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["dev"]}), ]
def _generate_examples(self, filepath): """This function returns the examples in the raw (text) form.""" logger.info("generating examples from = %s", filepath) with open(filepath, encoding="utf-8") as f: arcd = json.load(f) for article in arcd["data"]: title = article.get("title", "").strip() for paragraph in article["paragraphs"]: context = paragraph["context"].strip() for qa in paragraph["qas"]: question = qa["question"].strip() id_ = qa["id"]
answer_starts = [answer["answer_start"] for answer in qa["answers"]] answers = [answer["text"].strip() for answer in qa["answers"]]
# Features currently used are "context", "question", and "answers". # Others are extracted here for the ease of future expansions. yield id_, { "title": title, "context": context, "question": question, "id": id_, "answers": {"answer_start": answer_starts, "text": answers}, }1{"plain_text": {"description": " Arabic Reading Comprehension Dataset (ARCD) composed of 1,395 questions posed by crowdworkers on Wikipedia articles.\n", "citation": "@inproceedings{mozannar-etal-2019-neural,\n title = {Neural {A}rabic Question Answering},\n author = {Mozannar, Hussein and Maamary, Elie and El Hajal, Karl and Hajj, Hazem},\n booktitle = {Proceedings of the Fourth Arabic Natural Language Processing Workshop},\n month = {aug},\n year = {2019},\n address = {Florence, Italy},\n publisher = {Association for Computational Linguistics},\n url = {https://www.aclweb.org/anthology/W19-4612},\n doi = {10.18653/v1/W19-4612},\n pages = {108--118},\n abstract = {This paper tackles the problem of open domain factual Arabic question answering (QA) using Wikipedia as our knowledge source. This constrains the answer of any question to be a span of text in Wikipedia. Open domain QA for Arabic entails three challenges: annotated QA datasets in Arabic, large scale efficient information retrieval and machine reading comprehension. To deal with the lack of Arabic QA datasets we present the Arabic Reading Comprehension Dataset (ARCD) composed of 1,395 questions posed by crowdworkers on Wikipedia articles, and a machine translation of the Stanford Question Answering Dataset (Arabic-SQuAD). Our system for open domain question answering in Arabic (SOQAL) is based on two components: (1) a document retriever using a hierarchical TF-IDF approach and (2) a neural reading comprehension model using the pre-trained bi-directional transformer BERT. Our experiments on ARCD indicate the effectiveness of our approach with our BERT-based reader achieving a 61.3 F1 score, and our open domain system SOQAL achieving a 27.6 F1 score.}\n}\n", "homepage": "https://github.com/husseinmozannar/SOQAL/tree/master/data", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "title": {"dtype": "string", "id": null, "_type": "Value"}, "context": {"dtype": "string", "id": null, "_type": "Value"}, "question": {"dtype": "string", "id": null, "_type": "Value"}, "answers": {"feature": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "answer_start": {"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": "context", "answers_column": "answers"}], "builder_name": "arcd", "config_name": "plain_text", "version": {"version_str": "1.0.0", "description": "", "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 811064, "num_examples": 693, "dataset_name": "arcd"}, "validation": {"name": "validation", "num_bytes": 885648, "num_examples": 702, "dataset_name": "arcd"}}, "download_checksums": {"https://raw.githubusercontent.com/husseinmozannar/SOQAL/master/data/arcd-train.json": {"num_bytes": 939840, "checksum": "6a973fda9f0b066e0547a85a3396e7294fa917e24b6efd7ce430769033a6ce15"}, "https://raw.githubusercontent.com/husseinmozannar/SOQAL/master/data/arcd-test.json": {"num_bytes": 1002559, "checksum": "b4ba4fb4227841bbce71e01b3eaecb33e9f17a08cde1ec91e5bc335da2c75135"}}, "download_size": 1942399, "post_processing_size": null, "dataset_size": 1696712, "size_in_bytes": 3639111}}123version https://git-lfs.github.com/spec/v1oid sha256:8167f99702ed6b2457ba74b044b2b04bce61e70ac3df5fe46c0386a31a307490size 173521123version https://git-lfs.github.com/spec/v1oid sha256:a74775a55a6b13d8430c2127be32efeb5c463a201c864b876d6eec29067072f8size 192337README.md+15-7
arcd.pyDeleted-123
dataset_infos.jsonDeleted-1
plain_text/train-00000-of-00001.parquetAdded+3
plain_text/validation-00000-of-00001.parquetAdded+3