Require data manual download
#5
by
albertvillanova
HF staff
- opened
- README.md +14 -4
- dataset_infos.json +1 -1
- fquad.py +27 -35
README.md
CHANGED
@@ -36,13 +36,13 @@ dataset_info:
|
|
36 |
dtype: int32
|
37 |
splits:
|
38 |
- name: train
|
39 |
-
num_bytes:
|
40 |
num_examples: 4921
|
41 |
- name: validation
|
42 |
-
num_bytes:
|
43 |
num_examples: 768
|
44 |
-
download_size:
|
45 |
-
dataset_size:
|
46 |
---
|
47 |
|
48 |
# Dataset Card for FQuAD
|
@@ -89,6 +89,16 @@ FQuAD contains 25,000+ question and answer pairs.
|
|
89 |
Finetuning CamemBERT on FQuAD yields a F1 score of 88% and an exact match of 77.9%.
|
90 |
Developped to provide a SQuAD equivalent in the French language. Questions are original and based on high quality Wikipedia articles.
|
91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
### Supported Tasks and Leaderboards
|
93 |
|
94 |
- `closed-domain-qa`, `text-retrieval`: This dataset is intended to be used for `closed-domain-qa`, but can also be used for information retrieval tasks.
|
|
|
36 |
dtype: int32
|
37 |
splits:
|
38 |
- name: train
|
39 |
+
num_bytes: 5898752
|
40 |
num_examples: 4921
|
41 |
- name: validation
|
42 |
+
num_bytes: 1031456
|
43 |
num_examples: 768
|
44 |
+
download_size: 0
|
45 |
+
dataset_size: 6930208
|
46 |
---
|
47 |
|
48 |
# Dataset Card for FQuAD
|
|
|
89 |
Finetuning CamemBERT on FQuAD yields a F1 score of 88% and an exact match of 77.9%.
|
90 |
Developped to provide a SQuAD equivalent in the French language. Questions are original and based on high quality Wikipedia articles.
|
91 |
|
92 |
+
Please, note this dataset is licensed for non-commercial purposes and users must agree to the following terms and conditions:
|
93 |
+
1. Use FQuAD only for internal research purposes.
|
94 |
+
2. Not make any copy except a safety one.
|
95 |
+
3. Not redistribute it (or part of it) in any way, even for free.
|
96 |
+
4. Not sell it or use it for any commercial purpose. Contact us for a possible commercial licence.
|
97 |
+
5. Mention the corpus origin and Illuin Technology in all publications about experiments using FQuAD.
|
98 |
+
6. Redistribute to Illuin Technology any improved or enriched version you could make of that corpus.
|
99 |
+
|
100 |
+
Request manually download of the data from: https://fquad.illuin.tech/
|
101 |
+
|
102 |
### Supported Tasks and Leaderboards
|
103 |
|
104 |
- `closed-domain-qa`, `text-retrieval`: This dataset is intended to be used for `closed-domain-qa`, but can also be used for information retrieval tasks.
|
dataset_infos.json
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"default": {"description": "FQuAD: French Question Answering Dataset\nWe introduce FQuAD, a native French Question Answering Dataset. FQuAD contains 25,000+ question and answer pairs.\nFinetuning CamemBERT on FQuAD yields a F1 score of 88% and an exact match of 77.9%.\n
|
|
|
1 |
+
{"default": {"description": "FQuAD: French Question Answering Dataset\nWe introduce FQuAD, a native French Question Answering Dataset. FQuAD contains 25,000+ question and answer pairs.\nFinetuning CamemBERT on FQuAD yields a F1 score of 88% and an exact match of 77.9%.\n", "citation": "@ARTICLE{2020arXiv200206071\n author = {Martin, d'Hoffschmidt and Maxime, Vidal and\n Wacim, Belblidia and Tom, Brendl\u00e9},\n title = \"{FQuAD: French Question Answering Dataset}\",\n journal = {arXiv e-prints},\n keywords = {Computer Science - Computation and Language},\n year = \"2020\",\n month = \"Feb\",\n eid = {arXiv:2002.06071},\n pages = {arXiv:2002.06071},\narchivePrefix = {arXiv},\n eprint = {2002.06071},\n primaryClass = {cs.CL}\n}\n", "homepage": "https://fquad.illuin.tech/", "license": "", "features": {"context": {"dtype": "string", "id": null, "_type": "Value"}, "questions": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "answers": {"feature": {"texts": {"dtype": "string", "id": null, "_type": "Value"}, "answers_starts": {"dtype": "int32", "id": null, "_type": "Value"}}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "fquad", "config_name": "default", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 5898752, "num_examples": 4921, "dataset_name": "fquad"}, "validation": {"name": "validation", "num_bytes": 1031456, "num_examples": 768, "dataset_name": "fquad"}}, "download_checksums": {}, "download_size": 0, "post_processing_size": null, "dataset_size": 6930208, "size_in_bytes": 6930208}}
|
fquad.py
CHANGED
@@ -1,13 +1,21 @@
|
|
1 |
-
"""
|
2 |
|
3 |
|
4 |
import json
|
5 |
import os
|
|
|
6 |
|
7 |
import datasets
|
8 |
|
9 |
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
_CITATION = """\
|
12 |
@ARTICLE{2020arXiv200206071
|
13 |
author = {Martin, d'Hoffschmidt and Maxime, Vidal and
|
@@ -25,33 +33,28 @@ archivePrefix = {arXiv},
|
|
25 |
}
|
26 |
"""
|
27 |
|
28 |
-
# TODO(fquad):
|
29 |
-
_DESCRIPTION = """\
|
30 |
-
FQuAD: French Question Answering Dataset
|
31 |
-
We introduce FQuAD, a native French Question Answering Dataset. FQuAD contains 25,000+ question and answer pairs.
|
32 |
-
Finetuning CamemBERT on FQuAD yields a F1 score of 88% and an exact match of 77.9%.
|
33 |
|
34 |
-
|
|
|
35 |
|
36 |
-
|
37 |
-
_URLS = {
|
38 |
-
"train": _URL + "train.json.zip",
|
39 |
-
"valid": _URL + "valid.json.zip",
|
40 |
-
}
|
41 |
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
-
|
44 |
-
|
45 |
|
46 |
-
|
47 |
-
|
|
|
48 |
|
49 |
def _info(self):
|
50 |
-
# TODO(fquad): Specifies the datasets.DatasetInfo object
|
51 |
return datasets.DatasetInfo(
|
52 |
-
# This is the description that will appear on the datasets page.
|
53 |
description=_DESCRIPTION,
|
54 |
-
# datasets.features.FeatureConnectors
|
55 |
features=datasets.Features(
|
56 |
{
|
57 |
"context": datasets.Value("string"),
|
@@ -62,39 +65,28 @@ class Fquad(datasets.GeneratorBasedBuilder):
|
|
62 |
# These are the features of your dataset like images, labels ...
|
63 |
}
|
64 |
),
|
65 |
-
|
66 |
-
# specify them here. They'll be used if as_supervised=True in
|
67 |
-
# builder.as_dataset.
|
68 |
-
supervised_keys=None,
|
69 |
-
# Homepage of the dataset for documentation
|
70 |
-
homepage="https://fquad.illuin.tech/",
|
71 |
citation=_CITATION,
|
72 |
)
|
73 |
|
74 |
def _split_generators(self, dl_manager):
|
75 |
"""Returns SplitGenerators."""
|
76 |
-
|
77 |
-
# dl_manager is a datasets.download.DownloadManager that can be used to
|
78 |
-
# download and extract URLs
|
79 |
-
download_urls = _URLS
|
80 |
-
dl_dir = dl_manager.download_and_extract(download_urls)
|
81 |
return [
|
82 |
datasets.SplitGenerator(
|
83 |
name=datasets.Split.TRAIN,
|
84 |
# These kwargs will be passed to _generate_examples
|
85 |
-
gen_kwargs={"filepath": os.path.join(
|
86 |
),
|
87 |
datasets.SplitGenerator(
|
88 |
name=datasets.Split.VALIDATION,
|
89 |
# These kwargs will be passed to _generate_examples
|
90 |
-
gen_kwargs={"filepath": os.path.join(
|
91 |
),
|
92 |
]
|
93 |
|
94 |
def _generate_examples(self, filepath):
|
95 |
-
|
96 |
"""Yields examples."""
|
97 |
-
# TODO(fquad): Yields (key, example) tuples from the dataset
|
98 |
with open(filepath, encoding="utf-8") as f:
|
99 |
data = json.load(f)
|
100 |
for id1, examples in enumerate(data["data"]):
|
|
|
1 |
+
"""FQuAD dataset."""
|
2 |
|
3 |
|
4 |
import json
|
5 |
import os
|
6 |
+
from textwrap import dedent
|
7 |
|
8 |
import datasets
|
9 |
|
10 |
|
11 |
+
_HOMEPAGE = "https://fquad.illuin.tech/"
|
12 |
+
|
13 |
+
_DESCRIPTION = """\
|
14 |
+
FQuAD: French Question Answering Dataset
|
15 |
+
We introduce FQuAD, a native French Question Answering Dataset. FQuAD contains 25,000+ question and answer pairs.
|
16 |
+
Finetuning CamemBERT on FQuAD yields a F1 score of 88% and an exact match of 77.9%.
|
17 |
+
"""
|
18 |
+
|
19 |
_CITATION = """\
|
20 |
@ARTICLE{2020arXiv200206071
|
21 |
author = {Martin, d'Hoffschmidt and Maxime, Vidal and
|
|
|
33 |
}
|
34 |
"""
|
35 |
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
+
class Fquad(datasets.GeneratorBasedBuilder):
|
38 |
+
"""FQuAD dataset."""
|
39 |
|
40 |
+
VERSION = datasets.Version("1.0.0")
|
|
|
|
|
|
|
|
|
41 |
|
42 |
+
@property
|
43 |
+
def manual_download_instructions(self):
|
44 |
+
return dedent("""\
|
45 |
+
To access the data for this dataset, you need to request it at:
|
46 |
+
https://fquad.illuin.tech/#download
|
47 |
|
48 |
+
Unzip the downloaded file with `unzip download-form-fquad1.0.zip -d <path/to/directory>`, into a destination
|
49 |
+
directory <path/to/directory>, which will contain the two data files train.json and valid.json.
|
50 |
|
51 |
+
To load the dataset, pass the full path to the destination directory
|
52 |
+
in your call to the loading function: `datasets.load_dataset("fquad", data_dir="<path/to/directory>")`
|
53 |
+
""")
|
54 |
|
55 |
def _info(self):
|
|
|
56 |
return datasets.DatasetInfo(
|
|
|
57 |
description=_DESCRIPTION,
|
|
|
58 |
features=datasets.Features(
|
59 |
{
|
60 |
"context": datasets.Value("string"),
|
|
|
65 |
# These are the features of your dataset like images, labels ...
|
66 |
}
|
67 |
),
|
68 |
+
homepage=_HOMEPAGE,
|
|
|
|
|
|
|
|
|
|
|
69 |
citation=_CITATION,
|
70 |
)
|
71 |
|
72 |
def _split_generators(self, dl_manager):
|
73 |
"""Returns SplitGenerators."""
|
74 |
+
data_dir = os.path.abspath(os.path.expanduser(dl_manager.manual_dir))
|
|
|
|
|
|
|
|
|
75 |
return [
|
76 |
datasets.SplitGenerator(
|
77 |
name=datasets.Split.TRAIN,
|
78 |
# These kwargs will be passed to _generate_examples
|
79 |
+
gen_kwargs={"filepath": os.path.join(data_dir, "train.json")},
|
80 |
),
|
81 |
datasets.SplitGenerator(
|
82 |
name=datasets.Split.VALIDATION,
|
83 |
# These kwargs will be passed to _generate_examples
|
84 |
+
gen_kwargs={"filepath": os.path.join(data_dir, "valid.json")},
|
85 |
),
|
86 |
]
|
87 |
|
88 |
def _generate_examples(self, filepath):
|
|
|
89 |
"""Yields examples."""
|
|
|
90 |
with open(filepath, encoding="utf-8") as f:
|
91 |
data = json.load(f)
|
92 |
for id1, examples in enumerate(data["data"]):
|