Convert dataset to Parquet

#2
by albertvillanova HF staff - opened
README.md CHANGED
@@ -5,8 +5,6 @@ language_creators:
5
  - crowdsourced
6
  language:
7
  - ar
8
- language_bcp47:
9
- - ar-SA
10
  license:
11
  - mit
12
  multilinguality:
@@ -21,7 +19,10 @@ task_ids:
21
  - extractive-qa
22
  paperswithcode_id: arcd
23
  pretty_name: ARCD
 
 
24
  dataset_info:
 
25
  features:
26
  - name: id
27
  dtype: string
@@ -37,16 +38,23 @@ dataset_info:
37
  dtype: string
38
  - name: answer_start
39
  dtype: int32
40
- config_name: plain_text
41
  splits:
42
  - name: train
43
- num_bytes: 811064
44
  num_examples: 693
45
  - name: validation
46
- num_bytes: 885648
47
  num_examples: 702
48
- download_size: 1942399
49
- dataset_size: 1696712
 
 
 
 
 
 
 
 
50
  ---
51
 
52
  # Dataset Card for "arcd"
 
5
  - crowdsourced
6
  language:
7
  - ar
 
 
8
  license:
9
  - mit
10
  multilinguality:
 
19
  - extractive-qa
20
  paperswithcode_id: arcd
21
  pretty_name: ARCD
22
+ language_bcp47:
23
+ - ar-SA
24
  dataset_info:
25
+ config_name: plain_text
26
  features:
27
  - name: id
28
  dtype: string
 
38
  dtype: string
39
  - name: answer_start
40
  dtype: int32
 
41
  splits:
42
  - name: train
43
+ num_bytes: 811036
44
  num_examples: 693
45
  - name: validation
46
+ num_bytes: 885620
47
  num_examples: 702
48
+ download_size: 365858
49
+ dataset_size: 1696656
50
+ configs:
51
+ - config_name: plain_text
52
+ data_files:
53
+ - split: train
54
+ path: plain_text/train-*
55
+ - split: validation
56
+ path: plain_text/validation-*
57
+ default: true
58
  ---
59
 
60
  # Dataset Card for "arcd"
arcd.py DELETED
@@ -1,123 +0,0 @@
1
- """ARCD: Arabic Reading Comprehension Dataset."""
2
-
3
-
4
- import json
5
-
6
- import datasets
7
- from datasets.tasks import QuestionAnsweringExtractive
8
-
9
-
10
- logger = datasets.logging.get_logger(__name__)
11
-
12
-
13
- _CITATION = """\
14
- @inproceedings{mozannar-etal-2019-neural,
15
- title = {Neural {A}rabic Question Answering},
16
- author = {Mozannar, Hussein and Maamary, Elie and El Hajal, Karl and Hajj, Hazem},
17
- booktitle = {Proceedings of the Fourth Arabic Natural Language Processing Workshop},
18
- month = {aug},
19
- year = {2019},
20
- address = {Florence, Italy},
21
- publisher = {Association for Computational Linguistics},
22
- url = {https://www.aclweb.org/anthology/W19-4612},
23
- doi = {10.18653/v1/W19-4612},
24
- pages = {108--118},
25
- 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.}
26
- }
27
- """
28
-
29
- _DESCRIPTION = """\
30
- Arabic Reading Comprehension Dataset (ARCD) composed of 1,395 questions\
31
- posed by crowdworkers on Wikipedia articles.
32
- """
33
-
34
- _URL = "https://raw.githubusercontent.com/husseinmozannar/SOQAL/master/data/"
35
- _URLs = {
36
- "train": _URL + "arcd-train.json",
37
- "dev": _URL + "arcd-test.json",
38
- }
39
-
40
-
41
- class ArcdConfig(datasets.BuilderConfig):
42
- """BuilderConfig for ARCD."""
43
-
44
- def __init__(self, **kwargs):
45
- """BuilderConfig for ARCD.
46
-
47
- Args:
48
- **kwargs: keyword arguments forwarded to super.
49
- """
50
- super(ArcdConfig, self).__init__(**kwargs)
51
-
52
-
53
- class Arcd(datasets.GeneratorBasedBuilder):
54
- """ARCD: Arabic Reading Comprehension Dataset."""
55
-
56
- BUILDER_CONFIGS = [
57
- ArcdConfig(
58
- name="plain_text",
59
- version=datasets.Version("1.0.0", ""),
60
- description="Plain text",
61
- )
62
- ]
63
-
64
- def _info(self):
65
- return datasets.DatasetInfo(
66
- description=_DESCRIPTION,
67
- features=datasets.Features(
68
- {
69
- "id": datasets.Value("string"),
70
- "title": datasets.Value("string"),
71
- "context": datasets.Value("string"),
72
- "question": datasets.Value("string"),
73
- "answers": datasets.features.Sequence(
74
- {"text": datasets.Value("string"), "answer_start": datasets.Value("int32")}
75
- ),
76
- }
77
- ),
78
- # No default supervised_keys (as we have to pass both question
79
- # and context as input).
80
- supervised_keys=None,
81
- homepage="https://github.com/husseinmozannar/SOQAL/tree/master/data",
82
- citation=_CITATION,
83
- task_templates=[
84
- QuestionAnsweringExtractive(
85
- question_column="question", context_column="context", answers_column="answers"
86
- )
87
- ],
88
- )
89
-
90
- def _split_generators(self, dl_manager):
91
- urls_to_download = _URLs
92
- downloaded_files = dl_manager.download_and_extract(urls_to_download)
93
-
94
- return [
95
- datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
96
- datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["dev"]}),
97
- ]
98
-
99
- def _generate_examples(self, filepath):
100
- """This function returns the examples in the raw (text) form."""
101
- logger.info("generating examples from = %s", filepath)
102
- with open(filepath, encoding="utf-8") as f:
103
- arcd = json.load(f)
104
- for article in arcd["data"]:
105
- title = article.get("title", "").strip()
106
- for paragraph in article["paragraphs"]:
107
- context = paragraph["context"].strip()
108
- for qa in paragraph["qas"]:
109
- question = qa["question"].strip()
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
- "title": title,
119
- "context": context,
120
- "question": question,
121
- "id": id_,
122
- "answers": {"answer_start": answer_starts, "text": answers},
123
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dataset_infos.json DELETED
@@ -1 +0,0 @@
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}}
 
 
plain_text/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8167f99702ed6b2457ba74b044b2b04bce61e70ac3df5fe46c0386a31a307490
3
+ size 173521
plain_text/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a74775a55a6b13d8430c2127be32efeb5c463a201c864b876d6eec29067072f8
3
+ size 192337