parquet-converter
commited on
Commit
•
1ffc8a5
1
Parent(s):
e73506d
Update parquet files
Browse files- trivia-dev.jsonl.gz → default/wikipedia-trivia-dev.parquet +2 -2
- trivia-test.jsonl.gz → default/wikipedia-trivia-test.parquet +2 -2
- trivia-train.jsonl.gz → default/wikipedia-trivia-train-00000-of-00008.parquet +2 -2
- default/wikipedia-trivia-train-00001-of-00008.parquet +3 -0
- default/wikipedia-trivia-train-00002-of-00008.parquet +3 -0
- default/wikipedia-trivia-train-00003-of-00008.parquet +3 -0
- default/wikipedia-trivia-train-00004-of-00008.parquet +3 -0
- default/wikipedia-trivia-train-00005-of-00008.parquet +3 -0
- default/wikipedia-trivia-train-00006-of-00008.parquet +3 -0
- default/wikipedia-trivia-train-00007-of-00008.parquet +3 -0
- wikipedia-trivia.py +0 -120
trivia-dev.jsonl.gz → default/wikipedia-trivia-dev.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d4548771ed415e9d68952e43c1c8c7c018672f05555291262bffec02dcbd3862
|
3 |
+
size 240281696
|
trivia-test.jsonl.gz → default/wikipedia-trivia-test.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:882017e6b63c6d5789e1f21b65960305b6cb9c7a3bd7d0fcf0c15b1e50d1d0fb
|
3 |
+
size 2547403
|
trivia-train.jsonl.gz → default/wikipedia-trivia-train-00000-of-00008.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:eb4e9d587b448b2fc6379a7086980087d552e12b71f055bfba7a5a20468be8eb
|
3 |
+
size 283568670
|
default/wikipedia-trivia-train-00001-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d750e5d83f06db36b4ce29dbeca2b571d3effdb9c71021875967b43dd36eb000
|
3 |
+
size 284600995
|
default/wikipedia-trivia-train-00002-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:87dadb2c05448406705a155dff325796663d677d143305200778b1b5f9c2428e
|
3 |
+
size 287011404
|
default/wikipedia-trivia-train-00003-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:84101b8a2c6651828129e88acdcd98fef20ea9e40cb0259c4c2441cfed8ac99b
|
3 |
+
size 286375976
|
default/wikipedia-trivia-train-00004-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c551b23b9784db77fc57ef937d1e845c9d82a0ffa99832c1e4111c694edf5149
|
3 |
+
size 283415288
|
default/wikipedia-trivia-train-00005-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:df27e3b82b2d4a0e1c5540165c6ac361f06486885247f3d1b22bb82acadcd1f1
|
3 |
+
size 283900667
|
default/wikipedia-trivia-train-00006-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d4ccc54fae60452f3e57892ed0b4448288cc1ca8ed1075af7bd75c90f47f2381
|
3 |
+
size 282713415
|
default/wikipedia-trivia-train-00007-of-00008.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e9a5d1c80f621d5cd6aff61a0a7c96c109fbaf489d3b0f819744bdf0be072b30
|
3 |
+
size 153284640
|
wikipedia-trivia.py
DELETED
@@ -1,120 +0,0 @@
|
|
1 |
-
# coding=utf-8
|
2 |
-
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
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 |
-
"""Wikipedia TriviaQA dataset."""
|
18 |
-
|
19 |
-
import json
|
20 |
-
|
21 |
-
import datasets
|
22 |
-
|
23 |
-
_CITATION = """
|
24 |
-
@inproceedings{karpukhin-etal-2020-dense,
|
25 |
-
title = "Dense Passage Retrieval for Open-Domain Question Answering",
|
26 |
-
author = "Karpukhin, Vladimir and Oguz, Barlas and Min, Sewon and Lewis, Patrick and Wu, Ledell and Edunov,
|
27 |
-
Sergey and Chen, Danqi and Yih, Wen-tau",
|
28 |
-
booktitle = "Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)",
|
29 |
-
month = nov,
|
30 |
-
year = "2020",
|
31 |
-
address = "Online",
|
32 |
-
publisher = "Association for Computational Linguistics",
|
33 |
-
url = "https://www.aclweb.org/anthology/2020.emnlp-main.550",
|
34 |
-
doi = "10.18653/v1/2020.emnlp-main.550",
|
35 |
-
pages = "6769--6781",
|
36 |
-
}
|
37 |
-
"""
|
38 |
-
|
39 |
-
_DESCRIPTION = "dataset load script for Wikipedia Trivia"
|
40 |
-
|
41 |
-
_DATASET_URLS = {
|
42 |
-
'train': "https://huggingface.co/datasets/Tevatron/wikipedia-trivia/resolve/main/trivia-train.jsonl.gz",
|
43 |
-
'dev': "https://huggingface.co/datasets/Tevatron/wikipedia-trivia/resolve/main/trivia-dev.jsonl.gz",
|
44 |
-
'test': "https://huggingface.co/datasets/Tevatron/wikipedia-trivia/resolve/main/trivia-test.jsonl.gz",
|
45 |
-
}
|
46 |
-
|
47 |
-
|
48 |
-
class WikipediaTrivia(datasets.GeneratorBasedBuilder):
|
49 |
-
VERSION = datasets.Version("0.0.1")
|
50 |
-
|
51 |
-
BUILDER_CONFIGS = [
|
52 |
-
datasets.BuilderConfig(version=VERSION,
|
53 |
-
description="Wikipedia Trivia train/dev/test datasets"),
|
54 |
-
]
|
55 |
-
|
56 |
-
def _info(self):
|
57 |
-
features = datasets.Features({
|
58 |
-
'query_id': datasets.Value('string'),
|
59 |
-
'query': datasets.Value('string'),
|
60 |
-
'answers': [datasets.Value('string')],
|
61 |
-
'positive_passages': [
|
62 |
-
{'docid': datasets.Value('string'), 'text': datasets.Value('string'),
|
63 |
-
'title': datasets.Value('string')}
|
64 |
-
],
|
65 |
-
'negative_passages': [
|
66 |
-
{'docid': datasets.Value('string'), 'text': datasets.Value('string'),
|
67 |
-
'title': datasets.Value('string')}
|
68 |
-
],
|
69 |
-
})
|
70 |
-
|
71 |
-
return datasets.DatasetInfo(
|
72 |
-
# This is the description that will appear on the datasets page.
|
73 |
-
description=_DESCRIPTION,
|
74 |
-
# This defines the different columns of the dataset and their types
|
75 |
-
features=features, # Here we define them above because they are different between the two configurations
|
76 |
-
supervised_keys=None,
|
77 |
-
# Homepage of the dataset for documentation
|
78 |
-
homepage="",
|
79 |
-
# License for the dataset if available
|
80 |
-
license="",
|
81 |
-
# Citation for the dataset
|
82 |
-
citation=_CITATION,
|
83 |
-
)
|
84 |
-
|
85 |
-
def _split_generators(self, dl_manager):
|
86 |
-
downloaded_files = dl_manager.download_and_extract(_DATASET_URLS)
|
87 |
-
splits = [
|
88 |
-
datasets.SplitGenerator(
|
89 |
-
name="train",
|
90 |
-
gen_kwargs={
|
91 |
-
"filepath": downloaded_files["train"],
|
92 |
-
},
|
93 |
-
),
|
94 |
-
datasets.SplitGenerator(
|
95 |
-
name='dev',
|
96 |
-
gen_kwargs={
|
97 |
-
"filepath": downloaded_files["dev"],
|
98 |
-
},
|
99 |
-
),
|
100 |
-
datasets.SplitGenerator(
|
101 |
-
name='test',
|
102 |
-
gen_kwargs={
|
103 |
-
"filepath": downloaded_files["test"],
|
104 |
-
},
|
105 |
-
),
|
106 |
-
]
|
107 |
-
return splits
|
108 |
-
|
109 |
-
def _generate_examples(self, filepath):
|
110 |
-
"""Yields examples."""
|
111 |
-
with open(filepath, encoding="utf-8") as f:
|
112 |
-
for line in f:
|
113 |
-
data = json.loads(line)
|
114 |
-
if data.get('negative_passages') is None:
|
115 |
-
data['negative_passages'] = []
|
116 |
-
if data.get('positive_passages') is None:
|
117 |
-
data['positive_passages'] = []
|
118 |
-
if data.get('answers') is None:
|
119 |
-
data['answers'] = []
|
120 |
-
yield data['query_id'], data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|