Convert dataset to Parquet
#3
by
albertvillanova
HF staff
- opened
- README.md +12 -7
- dataset_infos.json +0 -1
- piaf.py +0 -139
- plain_text/train-00000-of-00001.parquet +3 -0
README.md
CHANGED
@@ -5,8 +5,6 @@ language_creators:
|
|
5 |
- crowdsourced
|
6 |
language:
|
7 |
- fr
|
8 |
-
language_bcp47:
|
9 |
-
- fr-FR
|
10 |
license:
|
11 |
- mit
|
12 |
multilinguality:
|
@@ -20,9 +18,11 @@ task_categories:
|
|
20 |
task_ids:
|
21 |
- extractive-qa
|
22 |
- open-domain-qa
|
23 |
-
paperswithcode_id: null
|
24 |
pretty_name: Piaf
|
|
|
|
|
25 |
dataset_info:
|
|
|
26 |
features:
|
27 |
- name: id
|
28 |
dtype: string
|
@@ -38,13 +38,18 @@ dataset_info:
|
|
38 |
dtype: string
|
39 |
- name: answer_start
|
40 |
dtype: int32
|
41 |
-
config_name: plain_text
|
42 |
splits:
|
43 |
- name: train
|
44 |
-
num_bytes:
|
45 |
num_examples: 3835
|
46 |
-
download_size:
|
47 |
-
dataset_size:
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
---
|
49 |
|
50 |
# Dataset Card for Piaf
|
|
|
5 |
- crowdsourced
|
6 |
language:
|
7 |
- fr
|
|
|
|
|
8 |
license:
|
9 |
- mit
|
10 |
multilinguality:
|
|
|
18 |
task_ids:
|
19 |
- extractive-qa
|
20 |
- open-domain-qa
|
|
|
21 |
pretty_name: Piaf
|
22 |
+
language_bcp47:
|
23 |
+
- fr-FR
|
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: 3332877
|
44 |
num_examples: 3835
|
45 |
+
download_size: 650352
|
46 |
+
dataset_size: 3332877
|
47 |
+
configs:
|
48 |
+
- config_name: plain_text
|
49 |
+
data_files:
|
50 |
+
- split: train
|
51 |
+
path: plain_text/train-*
|
52 |
+
default: true
|
53 |
---
|
54 |
|
55 |
# Dataset Card for Piaf
|
dataset_infos.json
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"plain_text": {"description": "Piaf is a reading comprehension dataset. This version, published in February 2020, contains 3835 questions on French Wikipedia.\n", "citation": "@InProceedings{keraron-EtAl:2020:LREC,\n author = {Keraron, Rachel and Lancrenon, Guillaume and Bras, Mathilde and Allary, Fr\u00e9d\u00e9ric and Moyse, Gilles and Scialom, Thomas and Soriano-Morales, Edmundo-Pavel and Staiano, Jacopo},\n title = {Project PIAF: Building a Native French Question-Answering Dataset},\n booktitle = {Proceedings of The 12th Language Resources and Evaluation Conference},\n month = {May},\n year = {2020},\n address = {Marseille, France},\n publisher = {European Language Resources Association},\n pages = {5483--5492},\n abstract = {Motivated by the lack of data for non-English languages, in particular for the evaluation of downstream tasks such as Question Answering, we present a participatory effort to collect a native French Question Answering Dataset. Furthermore, we describe and publicly release the annotation tool developed for our collection effort, along with the data obtained and preliminary baselines.},\n url = {https://www.aclweb.org/anthology/2020.lrec-1.673}\n}\n", "homepage": "https://piaf.etalab.studio", "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": "piaf", "config_name": "plain_text", "version": {"version_str": "1.0.0", "description": "", "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 3332905, "num_examples": 3835, "dataset_name": "piaf"}}, "download_checksums": {"https://github.com/etalab-ia/piaf-code/raw/master/piaf-v1.0.json": {"num_bytes": 1370384, "checksum": "008229ccefa0195d7e809d777d33149cab03433059c9477bdbadb4838a277cd2"}}, "download_size": 1370384, "post_processing_size": null, "dataset_size": 3332905, "size_in_bytes": 4703289}}
|
|
|
|
piaf.py
DELETED
@@ -1,139 +0,0 @@
|
|
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 |
-
"""PIAF Question Answering Dataset"""
|
18 |
-
|
19 |
-
|
20 |
-
import json
|
21 |
-
|
22 |
-
import datasets
|
23 |
-
from datasets.tasks import QuestionAnsweringExtractive
|
24 |
-
|
25 |
-
|
26 |
-
logger = datasets.logging.get_logger(__name__)
|
27 |
-
|
28 |
-
|
29 |
-
_CITATION = """\
|
30 |
-
@InProceedings{keraron-EtAl:2020:LREC,
|
31 |
-
author = {Keraron, Rachel and Lancrenon, Guillaume and Bras, Mathilde and Allary, Frédéric and Moyse, Gilles and Scialom, Thomas and Soriano-Morales, Edmundo-Pavel and Staiano, Jacopo},
|
32 |
-
title = {Project PIAF: Building a Native French Question-Answering Dataset},
|
33 |
-
booktitle = {Proceedings of The 12th Language Resources and Evaluation Conference},
|
34 |
-
month = {May},
|
35 |
-
year = {2020},
|
36 |
-
address = {Marseille, France},
|
37 |
-
publisher = {European Language Resources Association},
|
38 |
-
pages = {5483--5492},
|
39 |
-
abstract = {Motivated by the lack of data for non-English languages, in particular for the evaluation of downstream tasks such as Question Answering, we present a participatory effort to collect a native French Question Answering Dataset. Furthermore, we describe and publicly release the annotation tool developed for our collection effort, along with the data obtained and preliminary baselines.},
|
40 |
-
url = {https://www.aclweb.org/anthology/2020.lrec-1.673}
|
41 |
-
}
|
42 |
-
"""
|
43 |
-
|
44 |
-
_DESCRIPTION = """\
|
45 |
-
Piaf is a reading comprehension \
|
46 |
-
dataset. This version, published in February 2020, contains 3835 questions on French Wikipedia.
|
47 |
-
"""
|
48 |
-
|
49 |
-
_URLS = {"train": "https://github.com/etalab-ia/piaf-code/raw/master/piaf-v1.0.json"}
|
50 |
-
|
51 |
-
|
52 |
-
class PiafConfig(datasets.BuilderConfig):
|
53 |
-
"""BuilderConfig for PIAF."""
|
54 |
-
|
55 |
-
def __init__(self, **kwargs):
|
56 |
-
"""BuilderConfig for PIAF.
|
57 |
-
|
58 |
-
Args:
|
59 |
-
**kwargs: keyword arguments forwarded to super.
|
60 |
-
"""
|
61 |
-
super(PiafConfig, self).__init__(**kwargs)
|
62 |
-
|
63 |
-
|
64 |
-
class Piaf(datasets.GeneratorBasedBuilder):
|
65 |
-
"""The Piaf Question Answering Dataset. Version 1.0."""
|
66 |
-
|
67 |
-
BUILDER_CONFIGS = [
|
68 |
-
PiafConfig(
|
69 |
-
name="plain_text",
|
70 |
-
version=datasets.Version("1.0.0", ""),
|
71 |
-
description="Plain text",
|
72 |
-
),
|
73 |
-
]
|
74 |
-
|
75 |
-
def _info(self):
|
76 |
-
return datasets.DatasetInfo(
|
77 |
-
description=_DESCRIPTION,
|
78 |
-
features=datasets.Features(
|
79 |
-
{
|
80 |
-
"id": datasets.Value("string"),
|
81 |
-
"title": datasets.Value("string"),
|
82 |
-
"context": datasets.Value("string"),
|
83 |
-
"question": datasets.Value("string"),
|
84 |
-
"answers": datasets.features.Sequence(
|
85 |
-
{
|
86 |
-
"text": datasets.Value("string"),
|
87 |
-
"answer_start": datasets.Value("int32"),
|
88 |
-
}
|
89 |
-
),
|
90 |
-
}
|
91 |
-
),
|
92 |
-
# No default supervised_keys (as we have to pass both question
|
93 |
-
# and context as input).
|
94 |
-
supervised_keys=None,
|
95 |
-
homepage="https://piaf.etalab.studio",
|
96 |
-
citation=_CITATION,
|
97 |
-
task_templates=[
|
98 |
-
QuestionAnsweringExtractive(
|
99 |
-
question_column="question", context_column="context", answers_column="answers"
|
100 |
-
)
|
101 |
-
],
|
102 |
-
)
|
103 |
-
|
104 |
-
def _split_generators(self, dl_manager):
|
105 |
-
urls_to_download = _URLS
|
106 |
-
downloaded_files = dl_manager.download_and_extract(urls_to_download)
|
107 |
-
|
108 |
-
return [
|
109 |
-
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
|
110 |
-
]
|
111 |
-
|
112 |
-
def _generate_examples(self, filepath):
|
113 |
-
"""This function returns the examples in the raw (text) form."""
|
114 |
-
logger.info("generating examples from = %s", filepath)
|
115 |
-
with open(filepath, encoding="utf-8") as f:
|
116 |
-
dataset = json.load(f)
|
117 |
-
for article in dataset["data"]:
|
118 |
-
title = article.get("title", "").strip()
|
119 |
-
for paragraph in article["paragraphs"]:
|
120 |
-
context = paragraph["context"].strip()
|
121 |
-
for qa in paragraph["qas"]:
|
122 |
-
question = qa["question"].strip()
|
123 |
-
id_ = qa["id"]
|
124 |
-
|
125 |
-
answer_starts = [answer["answer_start"] for answer in qa["answers"]]
|
126 |
-
answers = [answer["text"].strip() for answer in qa["answers"]]
|
127 |
-
|
128 |
-
# Features currently used are "context", "question", and "answers".
|
129 |
-
# Others are extracted here for the ease of future expansions.
|
130 |
-
yield id_, {
|
131 |
-
"title": title,
|
132 |
-
"context": context,
|
133 |
-
"question": question,
|
134 |
-
"id": id_,
|
135 |
-
"answers": {
|
136 |
-
"answer_start": answer_starts,
|
137 |
-
"text": answers,
|
138 |
-
},
|
139 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plain_text/train-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:868b00642fd947182dd406becee1f7981c4ab69c2dc78ee5f0e6e7a42d98ebad
|
3 |
+
size 650352
|