Crystina commited on
Commit
e2c0008
·
1 Parent(s): b069949
Files changed (4) hide show
  1. .gitattributes +2 -0
  2. dev.jsonl.gz +3 -0
  3. quora.py +92 -0
  4. test.jsonl.gz +3 -0
.gitattributes CHANGED
@@ -36,3 +36,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
36
  *.mp3 filter=lfs diff=lfs merge=lfs -text
37
  *.ogg filter=lfs diff=lfs merge=lfs -text
38
  *.wav filter=lfs diff=lfs merge=lfs -text
 
 
 
36
  *.mp3 filter=lfs diff=lfs merge=lfs -text
37
  *.ogg filter=lfs diff=lfs merge=lfs -text
38
  *.wav filter=lfs diff=lfs merge=lfs -text
39
+ dev.jsonl.gz filter=lfs diff=lfs merge=lfs -text
40
+ test.jsonl.gz filter=lfs diff=lfs merge=lfs -text
dev.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:99b13852a1e01c79f7b5f9091c1ec76b36501385add3a25137e19060d9c49366
3
+ size 130997
quora.py ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.Wikipedia
15
+
16
+ # Lint as: python3
17
+ """MsMarco Passage dataset."""
18
+
19
+ import json
20
+
21
+ import datasets
22
+
23
+ _CITATION = """
24
+ @misc{bajaj2018ms,
25
+ title={MS MARCO: A Human Generated MAchine Reading COmprehension Dataset},
26
+ author={Payal Bajaj and Daniel Campos and Nick Craswell and Li Deng and Jianfeng Gao and Xiaodong Liu
27
+ and Rangan Majumder and Andrew McNamara and Bhaskar Mitra and Tri Nguyen and Mir Rosenberg and Xia Song
28
+ and Alina Stoica and Saurabh Tiwary and Tong Wang},
29
+ year={2018},
30
+ eprint={1611.09268},
31
+ archivePrefix={arXiv},
32
+ primaryClass={cs.CL}
33
+ }
34
+ """
35
+
36
+ _DESCRIPTION = "dataset load script for MSMARCO Passage"
37
+
38
+ _DATASET_URLS = {
39
+ 'dev': "https://huggingface.co/datasets/crystina-z/quora/resolve/main/dev.jsonl.gz",
40
+ 'test': "https://huggingface.co/datasets/crystina-z/quora/resolve/main/testt.jsonl.gz",
41
+ }
42
+
43
+
44
+ class MsMarcoPassage(datasets.GeneratorBasedBuilder):
45
+ VERSION = datasets.Version("0.0.1")
46
+
47
+ BUILDER_CONFIGS = [
48
+ datasets.BuilderConfig(version=VERSION,
49
+ description="QUORA dev/test datasets"),
50
+ ]
51
+
52
+ def _info(self):
53
+ features = datasets.Features({
54
+ 'query_id': datasets.Value('string'),
55
+ 'query': datasets.Value('string'),
56
+ })
57
+ return datasets.DatasetInfo(
58
+ # This is the description that will appear on the datasets page.
59
+ description=_DESCRIPTION,
60
+ # This defines the different columns of the dataset and their types
61
+ features=features, # Here we define them above because they are different between the two configurations
62
+ supervised_keys=None,
63
+ # Homepage of the dataset for documentation
64
+ homepage="",
65
+ # License for the dataset if available
66
+ license="",
67
+ # Citation for the dataset
68
+ citation=_CITATION,
69
+ )
70
+
71
+ def _split_generators(self, dl_manager):
72
+ if self.config.data_files:
73
+ downloaded_files = self.config.data_files
74
+ else:
75
+ downloaded_files = dl_manager.download_and_extract(_DATASET_URLS)
76
+ splits = [
77
+ datasets.SplitGenerator(
78
+ name=split,
79
+ gen_kwargs={
80
+ "files": [downloaded_files[split]] if isinstance(downloaded_files[split], str) else downloaded_files[split],
81
+ },
82
+ ) for split in downloaded_files
83
+ ]
84
+ return splits
85
+
86
+ def _generate_examples(self, files):
87
+ """Yields examples."""
88
+ for filepath in files:
89
+ with open(filepath, encoding="utf-8") as f:
90
+ for line in f:
91
+ data = json.loads(line)
92
+ yield data['query_id'], data
test.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:57fa810ae2c47eeb92b740225e619c1f35c00a8d2a77980c3ab03f7bd9d6233c
3
+ size 259516