system HF staff commited on
Commit
a36bd1b
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
+ {"winogrande_xs": {"description": "WinoGrande is a new collection of 44k problems, inspired by Winograd Schema Challenge (Levesque, Davis, and Morgenstern\n 2011), but adjusted to improve the scale and robustness against the dataset-specific bias. Formulated as a \nfill-in-a-blank task with binary options, the goal is to choose the right option for a given sentence which requires \ncommonsense reasoning. \n", "citation": "@InProceedings{ai2:winogrande,\ntitle = {WinoGrande: An Adversarial Winograd Schema Challenge at Scale},\nauthors={Keisuke, Sakaguchi and Ronan, Le Bras and Chandra, Bhagavatula and Yejin, Choi\n},\nyear={2019}\n}\n", "homepage": "https://leaderboard.allenai.org/winogrande/submissions/get-started", "license": "", "features": {"sentence": {"dtype": "string", "id": null, "_type": "Value"}, "option1": {"dtype": "string", "id": null, "_type": "Value"}, "option2": {"dtype": "string", "id": null, "_type": "Value"}, "answer": {"dtype": "string", "id": null, "_type": "Value"}}, "supervised_keys": null, "builder_name": "winogrande", "config_name": "winogrande_xs", "version": {"version_str": "1.0.0", "description": "", "datasets_version_to_prepare": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 228754, "num_examples": 1767, "dataset_name": "winogrande"}, "train": {"name": "train", "num_bytes": 20804, "num_examples": 160, "dataset_name": "winogrande"}, "validation": {"name": "validation", "num_bytes": 164994, "num_examples": 1267, "dataset_name": "winogrande"}}, "download_checksums": {"https://storage.googleapis.com/ai2-mosaic/public/winogrande/winogrande_1.1.zip": {"num_bytes": 2797793, "checksum": "d5699402a41de2b4e6b3c6e2a1e6b4faab2130543a12019a8c5d4f35ec502d47"}}, "download_size": 2797793, "dataset_size": 414552, "size_in_bytes": 3212345}, "winogrande_s": {"description": "WinoGrande is a new collection of 44k problems, inspired by Winograd Schema Challenge (Levesque, Davis, and Morgenstern\n 2011), but adjusted to improve the scale and robustness against the dataset-specific bias. Formulated as a \nfill-in-a-blank task with binary options, the goal is to choose the right option for a given sentence which requires \ncommonsense reasoning. \n", "citation": "@InProceedings{ai2:winogrande,\ntitle = {WinoGrande: An Adversarial Winograd Schema Challenge at Scale},\nauthors={Keisuke, Sakaguchi and Ronan, Le Bras and Chandra, Bhagavatula and Yejin, Choi\n},\nyear={2019}\n}\n", "homepage": "https://leaderboard.allenai.org/winogrande/submissions/get-started", "license": "", "features": {"sentence": {"dtype": "string", "id": null, "_type": "Value"}, "option1": {"dtype": "string", "id": null, "_type": "Value"}, "option2": {"dtype": "string", "id": null, "_type": "Value"}, "answer": {"dtype": "string", "id": null, "_type": "Value"}}, "supervised_keys": null, "builder_name": "winogrande", "config_name": "winogrande_s", "version": {"version_str": "1.0.0", "description": "", "datasets_version_to_prepare": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 228754, "num_examples": 1767, "dataset_name": "winogrande"}, "train": {"name": "train", "num_bytes": 82708, "num_examples": 640, "dataset_name": "winogrande"}, "validation": {"name": "validation", "num_bytes": 164994, "num_examples": 1267, "dataset_name": "winogrande"}}, "download_checksums": {"https://storage.googleapis.com/ai2-mosaic/public/winogrande/winogrande_1.1.zip": {"num_bytes": 2797793, "checksum": "d5699402a41de2b4e6b3c6e2a1e6b4faab2130543a12019a8c5d4f35ec502d47"}}, "download_size": 2797793, "dataset_size": 476456, "size_in_bytes": 3274249}, "winogrande_m": {"description": "WinoGrande is a new collection of 44k problems, inspired by Winograd Schema Challenge (Levesque, Davis, and Morgenstern\n 2011), but adjusted to improve the scale and robustness against the dataset-specific bias. Formulated as a \nfill-in-a-blank task with binary options, the goal is to choose the right option for a given sentence which requires \ncommonsense reasoning. \n", "citation": "@InProceedings{ai2:winogrande,\ntitle = {WinoGrande: An Adversarial Winograd Schema Challenge at Scale},\nauthors={Keisuke, Sakaguchi and Ronan, Le Bras and Chandra, Bhagavatula and Yejin, Choi\n},\nyear={2019}\n}\n", "homepage": "https://leaderboard.allenai.org/winogrande/submissions/get-started", "license": "", "features": {"sentence": {"dtype": "string", "id": null, "_type": "Value"}, "option1": {"dtype": "string", "id": null, "_type": "Value"}, "option2": {"dtype": "string", "id": null, "_type": "Value"}, "answer": {"dtype": "string", "id": null, "_type": "Value"}}, "supervised_keys": null, "builder_name": "winogrande", "config_name": "winogrande_m", "version": {"version_str": "1.0.0", "description": "", "datasets_version_to_prepare": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 228754, "num_examples": 1767, "dataset_name": "winogrande"}, "train": {"name": "train", "num_bytes": 330601, "num_examples": 2558, "dataset_name": "winogrande"}, "validation": {"name": "validation", "num_bytes": 164994, "num_examples": 1267, "dataset_name": "winogrande"}}, "download_checksums": {"https://storage.googleapis.com/ai2-mosaic/public/winogrande/winogrande_1.1.zip": {"num_bytes": 2797793, "checksum": "d5699402a41de2b4e6b3c6e2a1e6b4faab2130543a12019a8c5d4f35ec502d47"}}, "download_size": 2797793, "dataset_size": 724349, "size_in_bytes": 3522142}, "winogrande_l": {"description": "WinoGrande is a new collection of 44k problems, inspired by Winograd Schema Challenge (Levesque, Davis, and Morgenstern\n 2011), but adjusted to improve the scale and robustness against the dataset-specific bias. Formulated as a \nfill-in-a-blank task with binary options, the goal is to choose the right option for a given sentence which requires \ncommonsense reasoning. \n", "citation": "@InProceedings{ai2:winogrande,\ntitle = {WinoGrande: An Adversarial Winograd Schema Challenge at Scale},\nauthors={Keisuke, Sakaguchi and Ronan, Le Bras and Chandra, Bhagavatula and Yejin, Choi\n},\nyear={2019}\n}\n", "homepage": "https://leaderboard.allenai.org/winogrande/submissions/get-started", "license": "", "features": {"sentence": {"dtype": "string", "id": null, "_type": "Value"}, "option1": {"dtype": "string", "id": null, "_type": "Value"}, "option2": {"dtype": "string", "id": null, "_type": "Value"}, "answer": {"dtype": "string", "id": null, "_type": "Value"}}, "supervised_keys": null, "builder_name": "winogrande", "config_name": "winogrande_l", "version": {"version_str": "1.0.0", "description": "", "datasets_version_to_prepare": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 228754, "num_examples": 1767, "dataset_name": "winogrande"}, "train": {"name": "train", "num_bytes": 1325960, "num_examples": 10234, "dataset_name": "winogrande"}, "validation": {"name": "validation", "num_bytes": 164994, "num_examples": 1267, "dataset_name": "winogrande"}}, "download_checksums": {"https://storage.googleapis.com/ai2-mosaic/public/winogrande/winogrande_1.1.zip": {"num_bytes": 2797793, "checksum": "d5699402a41de2b4e6b3c6e2a1e6b4faab2130543a12019a8c5d4f35ec502d47"}}, "download_size": 2797793, "dataset_size": 1719708, "size_in_bytes": 4517501}, "winogrande_xl": {"description": "WinoGrande is a new collection of 44k problems, inspired by Winograd Schema Challenge (Levesque, Davis, and Morgenstern\n 2011), but adjusted to improve the scale and robustness against the dataset-specific bias. Formulated as a \nfill-in-a-blank task with binary options, the goal is to choose the right option for a given sentence which requires \ncommonsense reasoning. \n", "citation": "@InProceedings{ai2:winogrande,\ntitle = {WinoGrande: An Adversarial Winograd Schema Challenge at Scale},\nauthors={Keisuke, Sakaguchi and Ronan, Le Bras and Chandra, Bhagavatula and Yejin, Choi\n},\nyear={2019}\n}\n", "homepage": "https://leaderboard.allenai.org/winogrande/submissions/get-started", "license": "", "features": {"sentence": {"dtype": "string", "id": null, "_type": "Value"}, "option1": {"dtype": "string", "id": null, "_type": "Value"}, "option2": {"dtype": "string", "id": null, "_type": "Value"}, "answer": {"dtype": "string", "id": null, "_type": "Value"}}, "supervised_keys": null, "builder_name": "winogrande", "config_name": "winogrande_xl", "version": {"version_str": "1.0.0", "description": "", "datasets_version_to_prepare": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 228754, "num_examples": 1767, "dataset_name": "winogrande"}, "train": {"name": "train", "num_bytes": 5211018, "num_examples": 40398, "dataset_name": "winogrande"}, "validation": {"name": "validation", "num_bytes": 164994, "num_examples": 1267, "dataset_name": "winogrande"}}, "download_checksums": {"https://storage.googleapis.com/ai2-mosaic/public/winogrande/winogrande_1.1.zip": {"num_bytes": 2797793, "checksum": "d5699402a41de2b4e6b3c6e2a1e6b4faab2130543a12019a8c5d4f35ec502d47"}}, "download_size": 2797793, "dataset_size": 5604766, "size_in_bytes": 8402559}}
dummy/winogrande_l/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:93a8550b5319d9df44fd6623c827fd1e7d3dd337f1d4c55dd59f2cab06fa09d2
3
+ size 1816
dummy/winogrande_m/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5939d73a5a32253d54116d2f0a6820461e044949a256ca0b2d896fba5d20469e
3
+ size 1816
dummy/winogrande_s/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:23e04d6c30095d9c77d596d2d8a408f7f2dcf5de1dcb20c3e8941a847627c359
3
+ size 1816
dummy/winogrande_xl/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e43f23583c3807810e7d58416ff630112dcc5d796474f273616a6409ccb79017
3
+ size 1818
dummy/winogrande_xs/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e4e0b3d3f86d323ec8598f02f8b2f132a23516e3938a51c3c2e894fd4c58c1d2
3
+ size 1818
winogrande.py ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """TODO(winogrande): 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(winogrande): BibTeX citation
12
+ _CITATION = """\
13
+ @InProceedings{ai2:winogrande,
14
+ title = {WinoGrande: An Adversarial Winograd Schema Challenge at Scale},
15
+ authors={Keisuke, Sakaguchi and Ronan, Le Bras and Chandra, Bhagavatula and Yejin, Choi
16
+ },
17
+ year={2019}
18
+ }
19
+ """
20
+
21
+ # TODO(winogrande):
22
+ _DESCRIPTION = """\
23
+ WinoGrande is a new collection of 44k problems, inspired by Winograd Schema Challenge (Levesque, Davis, and Morgenstern
24
+ 2011), but adjusted to improve the scale and robustness against the dataset-specific bias. Formulated as a
25
+ fill-in-a-blank task with binary options, the goal is to choose the right option for a given sentence which requires
26
+ commonsense reasoning.
27
+ """
28
+
29
+ _URL = "https://storage.googleapis.com/ai2-mosaic/public/winogrande/winogrande_1.1.zip"
30
+ _SIZES = ["xs", "s", "m", "l", "xl"]
31
+
32
+
33
+ class WinograndeConfig(datasets.BuilderConfig):
34
+
35
+ """ BuilderConfig for Discofuse"""
36
+
37
+ def __init__(self, data_size, **kwargs):
38
+ """
39
+
40
+ Args:
41
+ data_size: the size of the training set we want to us (xs, s, m, l, xl)
42
+ **kwargs: keyword arguments forwarded to super.
43
+ """
44
+ super(WinograndeConfig, self).__init__(version=datasets.Version("1.0.0", ""), **kwargs)
45
+ self.data_size = data_size
46
+
47
+
48
+ class Winogrande(datasets.GeneratorBasedBuilder):
49
+ """TODO(winogrande): Short description of my dataset."""
50
+
51
+ # TODO(winogrande): Set up version.
52
+ VERSION = datasets.Version("1.1.0")
53
+ BUILDER_CONFIGS = [
54
+ WinograndeConfig(name="winogrande_" + size, description="AI2 dataset", data_size=size) for size in _SIZES
55
+ ]
56
+
57
+ def _info(self):
58
+ # TODO(winogrande): Specifies the datasets.DatasetInfo object
59
+ return datasets.DatasetInfo(
60
+ # This is the description that will appear on the datasets page.
61
+ description=_DESCRIPTION,
62
+ # datasets.features.FeatureConnectors
63
+ features=datasets.Features(
64
+ {
65
+ "sentence": datasets.Value("string"),
66
+ "option1": datasets.Value("string"),
67
+ "option2": datasets.Value("string"),
68
+ "answer": datasets.Value("string")
69
+ # These are the features of your dataset like images, labels ...
70
+ }
71
+ ),
72
+ # If there's a common (input, target) tuple from the features,
73
+ # specify them here. They'll be used if as_supervised=True in
74
+ # builder.as_dataset.
75
+ supervised_keys=None,
76
+ # Homepage of the dataset for documentation
77
+ homepage="https://leaderboard.allenai.org/winogrande/submissions/get-started",
78
+ citation=_CITATION,
79
+ )
80
+
81
+ def _split_generators(self, dl_manager):
82
+ """Returns SplitGenerators."""
83
+ # TODO(winogrande): Downloads the data and defines the splits
84
+ # dl_manager is a datasets.download.DownloadManager that can be used to
85
+ # download and extract URLs
86
+ dl_dir = dl_manager.download_and_extract(_URL)
87
+ data_dir = os.path.join(dl_dir, "winogrande_1.1")
88
+ return [
89
+ datasets.SplitGenerator(
90
+ name=datasets.Split.TRAIN,
91
+ # These kwargs will be passed to _generate_examples
92
+ gen_kwargs={
93
+ "filepath": os.path.join(data_dir, "train_{}.jsonl".format(self.config.data_size)),
94
+ # 'labelpath': os.path.join(data_dir, 'train_{}-labels.lst'.format(self.config.data_size)),
95
+ "split": "train",
96
+ },
97
+ ),
98
+ datasets.SplitGenerator(
99
+ name=datasets.Split.TEST,
100
+ # These kwargs will be passed to _generate_examples
101
+ gen_kwargs={"filepath": os.path.join(data_dir, "test.jsonl"), "split": "test"},
102
+ ),
103
+ datasets.SplitGenerator(
104
+ name=datasets.Split.VALIDATION,
105
+ # These kwargs will be passed to _generate_examples
106
+ gen_kwargs={
107
+ "filepath": os.path.join(data_dir, "dev.jsonl"),
108
+ # 'labelpath': os.path.join(data_dir, 'dev-labels.lst'),
109
+ "split": "dev",
110
+ },
111
+ ),
112
+ ]
113
+
114
+ def _generate_examples(self, filepath, split):
115
+ """Yields examples."""
116
+ # TODO(winogrande): Yields (key, example) tuples from the dataset
117
+ with open(filepath, encoding="utf-8") as f:
118
+ for id_, row in enumerate(f):
119
+ data = json.loads(row)
120
+ if split == "test":
121
+ yield id_, {
122
+ "sentence": data["sentence"],
123
+ "option1": data["option1"],
124
+ "option2": data["option2"],
125
+ "answer": "",
126
+ }
127
+ else:
128
+ yield id_, {
129
+ "sentence": data["sentence"],
130
+ "option1": data["option1"],
131
+ "option2": data["option2"],
132
+ "answer": data["answer"],
133
+ }
134
+
135
+
136
+ # def _generate_test_example(filepath, split, labelpath=None):
137
+ # with open(filepath, encoding="utf-8") as f:
138
+ # for id_, row in enumerate(f):
139
+ # data = json.loads(row)
140
+ # yield id_,{
141
+ # 'sentence': data['sentence'],
142
+ # 'option1': data['option1'],
143
+ # 'option2': data['option2'],
144
+ # 'answer': None
145
+ # }