system HF staff commited on
Commit
e5fbb72
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
+ {"v1.1": {"description": "\nStarting with a paper released at NIPS 2016, MS MARCO is a collection of datasets focused on deep learning in search.\n\nThe first dataset was a question answering dataset featuring 100,000 real Bing questions and a human generated answer. \nSince then we released a 1,000,000 question dataset, a natural langauge generation dataset, a passage ranking dataset, \nkeyphrase extraction dataset, crawling dataset, and a conversational search.\n\nThere have been 277 submissions. 20 KeyPhrase Extraction submissions, 87 passage ranking submissions, 0 document ranking \nsubmissions, 73 QnA V2 submissions, 82 NLGEN submisions, and 15 QnA V1 submissions\n\nThis data comes in three tasks/forms: Original QnA dataset(v1.1), Question Answering(v2.1), Natural Language Generation(v2.1). \n\nThe original question answering datset featured 100,000 examples and was released in 2016. Leaderboard is now closed but data is availible below.\n\nThe current competitive tasks are Question Answering and Natural Language Generation. Question Answering features over 1,000,000 queries and \nis much like the original QnA dataset but bigger and with higher quality. The Natural Language Generation dataset features 180,000 examples and \nbuilds upon the QnA dataset to deliver answers that could be spoken by a smart speaker.\n\n\nversion v1.1", "citation": "\n@article{DBLP:journals/corr/NguyenRSGTMD16,\n author = {Tri Nguyen and\n Mir Rosenberg and\n Xia Song and\n Jianfeng Gao and\n Saurabh Tiwary and\n Rangan Majumder and\n Li Deng},\n title = {{MS} {MARCO:} {A} Human Generated MAchine Reading COmprehension Dataset},\n journal = {CoRR},\n volume = {abs/1611.09268},\n year = {2016},\n url = {http://arxiv.org/abs/1611.09268},\n archivePrefix = {arXiv},\n eprint = {1611.09268},\n timestamp = {Mon, 13 Aug 2018 16:49:03 +0200},\n biburl = {https://dblp.org/rec/journals/corr/NguyenRSGTMD16.bib},\n bibsource = {dblp computer science bibliography, https://dblp.org}\n}\n}\n", "homepage": "https://microsoft.github.io/msmarco/", "license": "", "features": {"answers": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "passages": {"feature": {"is_selected": {"dtype": "int32", "id": null, "_type": "Value"}, "passage_text": {"dtype": "string", "id": null, "_type": "Value"}, "url": {"dtype": "string", "id": null, "_type": "Value"}}, "length": -1, "id": null, "_type": "Sequence"}, "query": {"dtype": "string", "id": null, "_type": "Value"}, "query_id": {"dtype": "int32", "id": null, "_type": "Value"}, "query_type": {"dtype": "string", "id": null, "_type": "Value"}, "wellFormedAnswers": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "supervised_keys": null, "builder_name": "ms_marco", "config_name": "v1.1", "version": {"version_str": "1.1.0", "description": "", "datasets_version_to_prepare": null, "major": 1, "minor": 1, "patch": 0}, "splits": {"validation": {"name": "validation", "num_bytes": 42710107, "num_examples": 10047, "dataset_name": "ms_marco"}, "train": {"name": "train", "num_bytes": 350884446, "num_examples": 82326, "dataset_name": "ms_marco"}, "test": {"name": "test", "num_bytes": 41020711, "num_examples": 9650, "dataset_name": "ms_marco"}}, "download_checksums": {"https://msmarco.blob.core.windows.net/msmsarcov1/train_v1.1.json.gz": {"num_bytes": 110704491, "checksum": "2aaa60df3a758137f0bb7c01fe334858477eb46fa8665ea01588e553cda6aa9f"}, "https://msmarco.blob.core.windows.net/msmsarcov1/dev_v1.1.json.gz": {"num_bytes": 13493661, "checksum": "c70fcb1de78e635cf501264891a1a56d52e7f63e69623da7dd41d89a785d67ca"}, "https://msmarco.blob.core.windows.net/msmsarcov1/test_hidden_v1.1.json": {"num_bytes": 44499856, "checksum": "083aa4f4d86ba0cedb830ca9972eff69f73cbc32b1da26b8617205f0dedea757"}}, "download_size": 168698008, "dataset_size": 434615264, "size_in_bytes": 603313272}, "v2.1": {"description": "\nStarting with a paper released at NIPS 2016, MS MARCO is a collection of datasets focused on deep learning in search.\n\nThe first dataset was a question answering dataset featuring 100,000 real Bing questions and a human generated answer. \nSince then we released a 1,000,000 question dataset, a natural langauge generation dataset, a passage ranking dataset, \nkeyphrase extraction dataset, crawling dataset, and a conversational search.\n\nThere have been 277 submissions. 20 KeyPhrase Extraction submissions, 87 passage ranking submissions, 0 document ranking \nsubmissions, 73 QnA V2 submissions, 82 NLGEN submisions, and 15 QnA V1 submissions\n\nThis data comes in three tasks/forms: Original QnA dataset(v1.1), Question Answering(v2.1), Natural Language Generation(v2.1). \n\nThe original question answering datset featured 100,000 examples and was released in 2016. Leaderboard is now closed but data is availible below.\n\nThe current competitive tasks are Question Answering and Natural Language Generation. Question Answering features over 1,000,000 queries and \nis much like the original QnA dataset but bigger and with higher quality. The Natural Language Generation dataset features 180,000 examples and \nbuilds upon the QnA dataset to deliver answers that could be spoken by a smart speaker.\n\n\nversion v2.1", "citation": "\n@article{DBLP:journals/corr/NguyenRSGTMD16,\n author = {Tri Nguyen and\n Mir Rosenberg and\n Xia Song and\n Jianfeng Gao and\n Saurabh Tiwary and\n Rangan Majumder and\n Li Deng},\n title = {{MS} {MARCO:} {A} Human Generated MAchine Reading COmprehension Dataset},\n journal = {CoRR},\n volume = {abs/1611.09268},\n year = {2016},\n url = {http://arxiv.org/abs/1611.09268},\n archivePrefix = {arXiv},\n eprint = {1611.09268},\n timestamp = {Mon, 13 Aug 2018 16:49:03 +0200},\n biburl = {https://dblp.org/rec/journals/corr/NguyenRSGTMD16.bib},\n bibsource = {dblp computer science bibliography, https://dblp.org}\n}\n}\n", "homepage": "https://microsoft.github.io/msmarco/", "license": "", "features": {"answers": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "passages": {"feature": {"is_selected": {"dtype": "int32", "id": null, "_type": "Value"}, "passage_text": {"dtype": "string", "id": null, "_type": "Value"}, "url": {"dtype": "string", "id": null, "_type": "Value"}}, "length": -1, "id": null, "_type": "Sequence"}, "query": {"dtype": "string", "id": null, "_type": "Value"}, "query_id": {"dtype": "int32", "id": null, "_type": "Value"}, "query_type": {"dtype": "string", "id": null, "_type": "Value"}, "wellFormedAnswers": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "supervised_keys": null, "builder_name": "ms_marco", "config_name": "v2.1", "version": {"version_str": "2.1.0", "description": "", "datasets_version_to_prepare": null, "major": 2, "minor": 1, "patch": 0}, "splits": {"validation": {"name": "validation", "num_bytes": 414286005, "num_examples": 101093, "dataset_name": "ms_marco"}, "train": {"name": "train", "num_bytes": 3466972085, "num_examples": 808731, "dataset_name": "ms_marco"}, "test": {"name": "test", "num_bytes": 406197152, "num_examples": 101092, "dataset_name": "ms_marco"}}, "download_checksums": {"https://msmarco.blob.core.windows.net/msmarco/train_v2.1.json.gz": {"num_bytes": 1112116929, "checksum": "e91745411ca81e441a3bb75deb71ce000dc2fc31334085b7d499982f14218fe2"}, "https://msmarco.blob.core.windows.net/msmarco/dev_v2.1.json.gz": {"num_bytes": 138303699, "checksum": "5b3c9c20d1808ee199a930941b0d96f79e397e9234f77a1496890b138df7cb3c"}, "https://msmarco.blob.core.windows.net/msmarco/eval_v2.1_public.json.gz": {"num_bytes": 133851237, "checksum": "05ac0e448450d507e7ff8e37f48a41cc2d015f5bd2c7974d2445f00a53625db6"}}, "download_size": 1384271865, "dataset_size": 4287455242, "size_in_bytes": 5671727107}}
dummy/v1.1/1.1.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:71d7896b3eb81d0d2d0fc8766e3f1a7a0a656c9d16e9fa26b9a5d217c5f7fc76
3
+ size 6646
ms_marco.py ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """MS MARCO dataset."""
18
+
19
+ from __future__ import absolute_import, division, print_function
20
+
21
+ import json
22
+
23
+ import datasets
24
+
25
+
26
+ _CITATION = """
27
+ @article{DBLP:journals/corr/NguyenRSGTMD16,
28
+ author = {Tri Nguyen and
29
+ Mir Rosenberg and
30
+ Xia Song and
31
+ Jianfeng Gao and
32
+ Saurabh Tiwary and
33
+ Rangan Majumder and
34
+ Li Deng},
35
+ title = {{MS} {MARCO:} {A} Human Generated MAchine Reading COmprehension Dataset},
36
+ journal = {CoRR},
37
+ volume = {abs/1611.09268},
38
+ year = {2016},
39
+ url = {http://arxiv.org/abs/1611.09268},
40
+ archivePrefix = {arXiv},
41
+ eprint = {1611.09268},
42
+ timestamp = {Mon, 13 Aug 2018 16:49:03 +0200},
43
+ biburl = {https://dblp.org/rec/journals/corr/NguyenRSGTMD16.bib},
44
+ bibsource = {dblp computer science bibliography, https://dblp.org}
45
+ }
46
+ }
47
+ """
48
+
49
+ _DESCRIPTION = """
50
+ Starting with a paper released at NIPS 2016, MS MARCO is a collection of datasets focused on deep learning in search.
51
+
52
+ The first dataset was a question answering dataset featuring 100,000 real Bing questions and a human generated answer.
53
+ Since then we released a 1,000,000 question dataset, a natural langauge generation dataset, a passage ranking dataset,
54
+ keyphrase extraction dataset, crawling dataset, and a conversational search.
55
+
56
+ There have been 277 submissions. 20 KeyPhrase Extraction submissions, 87 passage ranking submissions, 0 document ranking
57
+ submissions, 73 QnA V2 submissions, 82 NLGEN submisions, and 15 QnA V1 submissions
58
+
59
+ This data comes in three tasks/forms: Original QnA dataset(v1.1), Question Answering(v2.1), Natural Language Generation(v2.1).
60
+
61
+ The original question answering datset featured 100,000 examples and was released in 2016. Leaderboard is now closed but data is availible below.
62
+
63
+ The current competitive tasks are Question Answering and Natural Language Generation. Question Answering features over 1,000,000 queries and
64
+ is much like the original QnA dataset but bigger and with higher quality. The Natural Language Generation dataset features 180,000 examples and
65
+ builds upon the QnA dataset to deliver answers that could be spoken by a smart speaker.
66
+
67
+ """
68
+ _V2_URLS = {
69
+ "train": "https://msmarco.blob.core.windows.net/msmarco/train_v2.1.json.gz",
70
+ "dev": "https://msmarco.blob.core.windows.net/msmarco/dev_v2.1.json.gz",
71
+ "test": "https://msmarco.blob.core.windows.net/msmarco/eval_v2.1_public.json.gz",
72
+ }
73
+
74
+ _V1_URLS = {
75
+ "train": "https://msmarco.blob.core.windows.net/msmsarcov1/train_v1.1.json.gz",
76
+ "dev": "https://msmarco.blob.core.windows.net/msmsarcov1/dev_v1.1.json.gz",
77
+ "test": "https://msmarco.blob.core.windows.net/msmsarcov1/test_hidden_v1.1.json",
78
+ }
79
+
80
+
81
+ class MsMarcoConfig(datasets.BuilderConfig):
82
+ """BuilderConfig for MS MARCO."""
83
+
84
+ def __init__(self, **kwargs):
85
+ """BuilderConfig for MS MARCO
86
+
87
+ Args:
88
+ **kwargs: keyword arguments forwarded to super.
89
+ """
90
+ super(MsMarcoConfig, self).__init__(**kwargs)
91
+
92
+
93
+ class MsMarco(datasets.GeneratorBasedBuilder):
94
+
95
+ BUILDER_CONFIGS = [
96
+ MsMarcoConfig(
97
+ name="v1.1",
98
+ description="""version v1.1""",
99
+ version=datasets.Version("1.1.0", ""),
100
+ ),
101
+ MsMarcoConfig(
102
+ name="v2.1",
103
+ description="""version v2.1""",
104
+ version=datasets.Version("2.1.0", ""),
105
+ ),
106
+ ]
107
+
108
+ def _info(self):
109
+ return datasets.DatasetInfo(
110
+ description=_DESCRIPTION + "\n" + self.config.description,
111
+ features=datasets.Features(
112
+ {
113
+ "answers": datasets.features.Sequence(datasets.Value("string")),
114
+ "passages": datasets.features.Sequence(
115
+ {
116
+ "is_selected": datasets.Value("int32"),
117
+ "passage_text": datasets.Value("string"),
118
+ "url": datasets.Value("string"),
119
+ }
120
+ ),
121
+ "query": datasets.Value("string"),
122
+ "query_id": datasets.Value("int32"),
123
+ "query_type": datasets.Value("string"),
124
+ "wellFormedAnswers": datasets.features.Sequence(datasets.Value("string")),
125
+ }
126
+ ),
127
+ homepage="https://microsoft.github.io/msmarco/",
128
+ citation=_CITATION,
129
+ )
130
+
131
+ def _split_generators(self, dl_manager):
132
+ """Returns SplitGenerators."""
133
+ if self.config.name == "v2.1":
134
+ dl_path = dl_manager.download_and_extract(_V2_URLS)
135
+ else:
136
+ dl_path = dl_manager.download_and_extract(_V1_URLS)
137
+ return [
138
+ datasets.SplitGenerator(
139
+ name=datasets.Split.VALIDATION,
140
+ gen_kwargs={"filepath": dl_path["dev"]},
141
+ ),
142
+ datasets.SplitGenerator(
143
+ name=datasets.Split.TRAIN,
144
+ gen_kwargs={"filepath": dl_path["train"]},
145
+ ),
146
+ datasets.SplitGenerator(
147
+ name=datasets.Split.TEST,
148
+ gen_kwargs={"filepath": dl_path["test"]},
149
+ ),
150
+ ]
151
+
152
+ def _generate_examples(self, filepath):
153
+ """Yields examples."""
154
+ with open(filepath, encoding="utf-8") as f:
155
+ if self.config.name == "v2.1":
156
+ data = json.load(f)
157
+ questions = data["query"]
158
+ answers = data.get("answers", {})
159
+ passages = data["passages"]
160
+ query_ids = data["query_id"]
161
+ query_types = data["query_type"]
162
+ wellFormedAnswers = data.get("wellFormedAnswers", {})
163
+ for key in questions:
164
+
165
+ is_selected = [passage.get("is_selected", -1) for passage in passages[key]]
166
+ passage_text = [passage["passage_text"] for passage in passages[key]]
167
+ urls = [passage["url"] for passage in passages[key]]
168
+ question = questions[key]
169
+ answer = answers.get(key, [])
170
+ query_id = query_ids[key]
171
+ query_type = query_types[key]
172
+ wellFormedAnswer = wellFormedAnswers.get(key, [])
173
+ if wellFormedAnswer == "[]":
174
+ wellFormedAnswer = []
175
+ yield query_id, {
176
+ "answers": answer,
177
+ "passages": {"is_selected": is_selected, "passage_text": passage_text, "url": urls},
178
+ "query": question,
179
+ "query_id": query_id,
180
+ "query_type": query_type,
181
+ "wellFormedAnswers": wellFormedAnswer,
182
+ }
183
+ if self.config.name == "v1.1":
184
+ for row in f:
185
+ data = json.loads(row)
186
+ question = data["query"]
187
+ answer = data.get("answers", [])
188
+ passages = data["passages"]
189
+ query_id = data["query_id"]
190
+ query_type = data["query_type"]
191
+ wellFormedAnswer = data.get("wellFormedAnswers", [])
192
+
193
+ is_selected = [passage.get("is_selected", -1) for passage in passages]
194
+ passage_text = [passage["passage_text"] for passage in passages]
195
+ urls = [passage["url"] for passage in passages]
196
+ if wellFormedAnswer == "[]":
197
+ wellFormedAnswer = []
198
+ yield query_id, {
199
+ "answers": answer,
200
+ "passages": {"is_selected": is_selected, "passage_text": passage_text, "url": urls},
201
+ "query": question,
202
+ "query_id": query_id,
203
+ "query_type": query_type,
204
+ "wellFormedAnswers": wellFormedAnswer,
205
+ }