system
HF staff
commited on
Commit
b589a50
0 Parent(s):

Update files from the datasets library (from 1.0.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.0.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
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
1
+ {"default": {"description": "Portuguese translation of the SQuAD dataset. The translation was performed automatically using the Google Cloud API.\n", "citation": "@article{2016arXiv160605250R,\n author = {{Rajpurkar}, Pranav and {Zhang}, Jian and {Lopyrev},\n Konstantin and {Liang}, Percy},\n title = \"{SQuAD: 100,000+ Questions for Machine Comprehension of Text}\",\n journal = {arXiv e-prints},\n year = 2016,\n eid = {arXiv:1606.05250},\n pages = {arXiv:1606.05250},\narchivePrefix = {arXiv},\n eprint = {1606.05250},\n}\n", "homepage": "https://github.com/nunorc/squad-v1.1-pt", "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"}}, "supervised_keys": null, "builder_name": "squad_v1_pt", "config_name": "default", "version": {"version_str": "1.1.0", "description": null, "datasets_version_to_prepare": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 85432513, "num_examples": 87599, "dataset_name": "squad_v1_pt"}, "validation": {"name": "validation", "num_bytes": 11284704, "num_examples": 10570, "dataset_name": "squad_v1_pt"}}, "download_checksums": {"https://github.com/nunorc/squad-v1.1-pt/raw/master/train-v1.1-pt.json": {"num_bytes": 34143290, "checksum": "3ffd847d1a210836f5d3c5b6ee3d93dbc873eece463738820158dc721b67ed2f"}, "https://github.com/nunorc/squad-v1.1-pt/raw/master/dev-v1.1-pt.json": {"num_bytes": 5389305, "checksum": "cc27ce3bba8b06056bdd1c042944beb9cc926f21f53b47f21760989be9aa90cf"}}, "download_size": 39532595, "dataset_size": 96717217, "size_in_bytes": 136249812}}
dummy/1.1.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c0d7bd3b065f8e60bcabc670746060e68fbaa16627bc2af808cb3ffd6f01fdf1
3
+ size 3062
squad_v1_pt.py ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """TODO(squad_v1_pt): Add a description here."""
2
+
3
+ from __future__ import absolute_import, division, print_function
4
+
5
+ import json
6
+ import os
7
+
8
+ import datasets
9
+
10
+
11
+ # TODO(squad_v1_pt): BibTeX citation
12
+ _CITATION = """\
13
+ @article{2016arXiv160605250R,
14
+ author = {{Rajpurkar}, Pranav and {Zhang}, Jian and {Lopyrev},
15
+ Konstantin and {Liang}, Percy},
16
+ title = "{SQuAD: 100,000+ Questions for Machine Comprehension of Text}",
17
+ journal = {arXiv e-prints},
18
+ year = 2016,
19
+ eid = {arXiv:1606.05250},
20
+ pages = {arXiv:1606.05250},
21
+ archivePrefix = {arXiv},
22
+ eprint = {1606.05250},
23
+ }
24
+ """
25
+
26
+ # TODO(squad_v1_pt):
27
+ _DESCRIPTION = """\
28
+ Portuguese translation of the SQuAD dataset. The translation was performed automatically using the Google Cloud API.
29
+ """
30
+ _URL = "https://github.com/nunorc/squad-v1.1-pt/raw/master"
31
+ _TRAIN_FILE = "train-v1.1-pt.json"
32
+ _DEV_FILE = "dev-v1.1-pt.json"
33
+
34
+
35
+ class SquadV1Pt(datasets.GeneratorBasedBuilder):
36
+ """TODO(squad_v1_pt): Short description of my dataset."""
37
+
38
+ # TODO(squad_v1_pt): Set up version.
39
+ VERSION = datasets.Version("1.1.0")
40
+
41
+ def _info(self):
42
+ # TODO(squad_v1_pt): Specifies the datasets.DatasetInfo object
43
+ return datasets.DatasetInfo(
44
+ # This is the description that will appear on the datasets page.
45
+ description=_DESCRIPTION,
46
+ # datasets.features.FeatureConnectors
47
+ features=datasets.Features(
48
+ {
49
+ "id": datasets.Value("string"),
50
+ "title": datasets.Value("string"),
51
+ "context": datasets.Value("string"),
52
+ "question": datasets.Value("string"),
53
+ "answers": datasets.features.Sequence(
54
+ {
55
+ "text": datasets.Value("string"),
56
+ "answer_start": datasets.Value("int32"),
57
+ }
58
+ ),
59
+ # These are the features of your dataset like images, labels ...
60
+ }
61
+ ),
62
+ # If there's a common (input, target) tuple from the features,
63
+ # specify them here. They'll be used if as_supervised=True in
64
+ # builder.as_dataset.
65
+ supervised_keys=None,
66
+ # Homepage of the dataset for documentation
67
+ homepage="https://github.com/nunorc/squad-v1.1-pt",
68
+ citation=_CITATION,
69
+ )
70
+
71
+ def _split_generators(self, dl_manager):
72
+ """Returns SplitGenerators."""
73
+ # TODO(squad_v1_pt): Downloads the data and defines the splits
74
+ # dl_manager is a datasets.download.DownloadManager that can be used to
75
+ # download and extract URLs
76
+ urls_to_download = {"train": os.path.join(_URL, _TRAIN_FILE), "dev": os.path.join(_URL, _DEV_FILE)}
77
+ downloaded_files = dl_manager.download_and_extract(urls_to_download)
78
+
79
+ return [
80
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
81
+ datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["dev"]}),
82
+ ]
83
+
84
+ def _generate_examples(self, filepath):
85
+ """Yields examples."""
86
+ # TODO(squad_v1_pt): Yields (key, example) tuples from the dataset
87
+ with open(filepath, encoding="utf-8") as f:
88
+ data = json.load(f)
89
+ for example in data["data"]:
90
+ title = example.get("title", "").strip()
91
+ for paragraph in example["paragraphs"]:
92
+ context = paragraph["context"].strip()
93
+ for qa in paragraph["qas"]:
94
+ question = qa["question"].strip()
95
+ id_ = qa["id"]
96
+
97
+ answer_starts = [answer["answer_start"] for answer in qa["answers"]]
98
+ answers = [answer["text"].strip() for answer in qa["answers"]]
99
+
100
+ yield id_, {
101
+ "title": title,
102
+ "context": context,
103
+ "question": question,
104
+ "id": id_,
105
+ "answers": {
106
+ "answer_start": answer_starts,
107
+ "text": answers,
108
+ },
109
+ }