Xinyu Crystina ZHANG
commited on
Commit
•
b36139f
1
Parent(s):
cc65cf5
init
Browse files- .gitattributes +16 -0
- miracl-bm25-negative.py +99 -0
- miracl_train_bm25_neg_top100_random30.ar.jsonl.gz +3 -0
- miracl_train_bm25_neg_top100_random30.bn.jsonl.gz +3 -0
- miracl_train_bm25_neg_top100_random30.en.jsonl.gz +3 -0
- miracl_train_bm25_neg_top100_random30.es.jsonl.gz +3 -0
- miracl_train_bm25_neg_top100_random30.fa.jsonl.gz +3 -0
- miracl_train_bm25_neg_top100_random30.fi.jsonl.gz +3 -0
- miracl_train_bm25_neg_top100_random30.fr.jsonl.gz +3 -0
- miracl_train_bm25_neg_top100_random30.hi.jsonl.gz +3 -0
- miracl_train_bm25_neg_top100_random30.id.jsonl.gz +3 -0
- miracl_train_bm25_neg_top100_random30.ja.jsonl.gz +3 -0
- miracl_train_bm25_neg_top100_random30.ko.jsonl.gz +3 -0
- miracl_train_bm25_neg_top100_random30.ru.jsonl.gz +3 -0
- miracl_train_bm25_neg_top100_random30.sw.jsonl.gz +3 -0
- miracl_train_bm25_neg_top100_random30.te.jsonl.gz +3 -0
- miracl_train_bm25_neg_top100_random30.th.jsonl.gz +3 -0
- miracl_train_bm25_neg_top100_random30.zh.jsonl.gz +3 -0
.gitattributes
CHANGED
@@ -52,3 +52,19 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
52 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
53 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
54 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
53 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
54 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
55 |
+
miracl_train_bm25_neg_top100_random30.fa.jsonl.gz filter=lfs diff=lfs merge=lfs -text
|
56 |
+
miracl_train_bm25_neg_top100_random30.fi.jsonl.gz filter=lfs diff=lfs merge=lfs -text
|
57 |
+
miracl_train_bm25_neg_top100_random30.ru.jsonl.gz filter=lfs diff=lfs merge=lfs -text
|
58 |
+
miracl_train_bm25_neg_top100_random30.te.jsonl.gz filter=lfs diff=lfs merge=lfs -text
|
59 |
+
miracl_train_bm25_neg_top100_random30.bn.jsonl.gz filter=lfs diff=lfs merge=lfs -text
|
60 |
+
miracl_train_bm25_neg_top100_random30.id.jsonl.gz filter=lfs diff=lfs merge=lfs -text
|
61 |
+
miracl_train_bm25_neg_top100_random30.en.jsonl.gz filter=lfs diff=lfs merge=lfs -text
|
62 |
+
miracl_train_bm25_neg_top100_random30.es.jsonl.gz filter=lfs diff=lfs merge=lfs -text
|
63 |
+
miracl_train_bm25_neg_top100_random30.hi.jsonl.gz filter=lfs diff=lfs merge=lfs -text
|
64 |
+
miracl_train_bm25_neg_top100_random30.ko.jsonl.gz filter=lfs diff=lfs merge=lfs -text
|
65 |
+
miracl_train_bm25_neg_top100_random30.zh.jsonl.gz filter=lfs diff=lfs merge=lfs -text
|
66 |
+
miracl_train_bm25_neg_top100_random30.ar.jsonl.gz filter=lfs diff=lfs merge=lfs -text
|
67 |
+
miracl_train_bm25_neg_top100_random30.fr.jsonl.gz filter=lfs diff=lfs merge=lfs -text
|
68 |
+
miracl_train_bm25_neg_top100_random30.ja.jsonl.gz filter=lfs diff=lfs merge=lfs -text
|
69 |
+
miracl_train_bm25_neg_top100_random30.sw.jsonl.gz filter=lfs diff=lfs merge=lfs -text
|
70 |
+
miracl_train_bm25_neg_top100_random30.th.jsonl.gz filter=lfs diff=lfs merge=lfs -text
|
miracl-bm25-negative.py
ADDED
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
opyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
2 |
+
#
|
3 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4 |
+
# you may not use this file except in compliance with the License.
|
5 |
+
# You may obtain a copy of the License at
|
6 |
+
#
|
7 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8 |
+
#
|
9 |
+
# Unless required by applicable law or agreed to in writing, software
|
10 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12 |
+
# See the License for the specific language governing permissions and
|
13 |
+
# limitations under the License.Wikipedia
|
14 |
+
|
15 |
+
# Lint as: python3
|
16 |
+
"""MsMarco Passage dataset."""
|
17 |
+
|
18 |
+
import json
|
19 |
+
|
20 |
+
import datasets
|
21 |
+
|
22 |
+
_CITATION = """
|
23 |
+
"""
|
24 |
+
|
25 |
+
_DESCRIPTION = "dataset load script for MIRACL"
|
26 |
+
|
27 |
+
LANGS = "ar bn en es fa fi fr hi id ja ko ru sw te th zh".split()
|
28 |
+
assert len(LANGS) == 16
|
29 |
+
|
30 |
+
_DATASET_URLS = {
|
31 |
+
lang_abbr: {
|
32 |
+
'train': "https://huggingface.co/datasets/Tevatron/msmarco-passage/resolve/main/train.jsonl.gz",
|
33 |
+
# 'dev': "https://huggingface.co/datasets/Tevatron/msmarco-passage/resolve/main/dev.jsonl.gz",
|
34 |
+
} for lang_abbr in LANGS
|
35 |
+
}
|
36 |
+
|
37 |
+
|
38 |
+
class MsMarcoPassage(datasets.GeneratorBasedBuilder):
|
39 |
+
VERSION = datasets.Version("0.0.1")
|
40 |
+
|
41 |
+
BUILDER_CONFIGS = [
|
42 |
+
datasets.BuilderConfig(version=VERSION,
|
43 |
+
description=f"MIRACL ({lang_abbr}) training datasets")
|
44 |
+
for lang_abbr in LANGS
|
45 |
+
]
|
46 |
+
|
47 |
+
def _info(self):
|
48 |
+
features = datasets.Features({
|
49 |
+
'query_id': datasets.Value('string'),
|
50 |
+
'query': datasets.Value('string'),
|
51 |
+
'positive_passages': [
|
52 |
+
{'docid': datasets.Value('string'), 'title': datasets.Value('string'), 'text': datasets.Value('string')}
|
53 |
+
],
|
54 |
+
'negative_passages': [
|
55 |
+
{'docid': datasets.Value('string'), 'title': datasets.Value('string'), 'text': datasets.Value('string')}
|
56 |
+
],
|
57 |
+
})
|
58 |
+
return datasets.DatasetInfo(
|
59 |
+
# This is the description that will appear on the datasets page.
|
60 |
+
description=_DESCRIPTION,
|
61 |
+
# This defines the different columns of the dataset and their types
|
62 |
+
features=features, # Here we define them above because they are different between the two configurations
|
63 |
+
supervised_keys=None,
|
64 |
+
# Homepage of the dataset for documentation
|
65 |
+
homepage="",
|
66 |
+
# License for the dataset if available
|
67 |
+
license="",
|
68 |
+
# Citation for the dataset
|
69 |
+
citation=_CITATION,
|
70 |
+
)
|
71 |
+
|
72 |
+
def _split_generators(self, dl_manager):
|
73 |
+
lang_abbr = self.config.name
|
74 |
+
|
75 |
+
if self.config.data_files:
|
76 |
+
downloaded_files = self.config.data_files
|
77 |
+
else:
|
78 |
+
downloaded_files = dl_manager.download_and_extract(_DATASET_URLS[lang_abbr])
|
79 |
+
splits = [
|
80 |
+
datasets.SplitGenerator(
|
81 |
+
name=split,
|
82 |
+
gen_kwargs={
|
83 |
+
"files": [downloaded_files[split]] if isinstance(downloaded_files[split], str) else downloaded_files[split],
|
84 |
+
},
|
85 |
+
) for split in downloaded_files
|
86 |
+
]
|
87 |
+
return splits
|
88 |
+
|
89 |
+
def _generate_examples(self, files):
|
90 |
+
"""Yields examples."""
|
91 |
+
for filepath in files:
|
92 |
+
with open(filepath, encoding="utf-8") as f:
|
93 |
+
for line in f:
|
94 |
+
data = json.loads(line)
|
95 |
+
if data.get('negative_passages') is None:
|
96 |
+
data['negative_passages'] = []
|
97 |
+
if data.get('positive_passages') is None:
|
98 |
+
data['positive_passages'] = []
|
99 |
+
yield data['query_id'], data
|
miracl_train_bm25_neg_top100_random30.ar.jsonl.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2bae5f879997d36ff2d4f15f53d6ea0b674da66a1401786c0ce7b485b9f71ac0
|
3 |
+
size 29759016
|
miracl_train_bm25_neg_top100_random30.bn.jsonl.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5c207397f6d280027cc257f658f35d7fc416a3347a6de94ba066c475b70f51a0
|
3 |
+
size 16536601
|
miracl_train_bm25_neg_top100_random30.en.jsonl.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:81e7e690a9bd49da166ac1ea45d29caad62df9c49918cb6fcb23173d98a35a73
|
3 |
+
size 23858488
|
miracl_train_bm25_neg_top100_random30.es.jsonl.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:255182b485f9e806b776e960785f105d8c0b2c7eafafdbd2b61ae8323be6670d
|
3 |
+
size 17086457
|
miracl_train_bm25_neg_top100_random30.fa.jsonl.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d56f32195a4d163f0ba2fc8f05d6c1db958240b82a83ab5b8fe703f9229f4484
|
3 |
+
size 15231395
|
miracl_train_bm25_neg_top100_random30.fi.jsonl.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:33b575a3b683fa3d2700a42eb6fdb5031e93e8143f8bb8fcb5e17ce79dce1048
|
3 |
+
size 17637730
|
miracl_train_bm25_neg_top100_random30.fr.jsonl.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5c128987eb1e29186598985e5c811f7792f70945290bf925c6306a912342b468
|
3 |
+
size 7355189
|
miracl_train_bm25_neg_top100_random30.hi.jsonl.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fe4d59ea56c33958e80de0dc8ba81f25b0873895e364ff3cec6b8b27ffe67670
|
3 |
+
size 12805087
|
miracl_train_bm25_neg_top100_random30.id.jsonl.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3faacbe688529d1b252824cc257c9e47452ec1d6c5a30213974f24922269a4be
|
3 |
+
size 28427988
|
miracl_train_bm25_neg_top100_random30.ja.jsonl.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:095a515c4f94b06b372f635c43210eec616e6cf33bef32b32d25da223fbe7e49
|
3 |
+
size 25917644
|
miracl_train_bm25_neg_top100_random30.ko.jsonl.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:29e23f6010925047196e30be2dd20d24ef5f3872fa1a8c6b6ac042d1e87312f4
|
3 |
+
size 6735328
|
miracl_train_bm25_neg_top100_random30.ru.jsonl.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:48fd14bced11c367039a7c92862bc5950d81048e4b09038716666201236fdef6
|
3 |
+
size 38961484
|
miracl_train_bm25_neg_top100_random30.sw.jsonl.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:082d2c2b17ef1e1435c2233ed5fbb644aef44651d82bddef40e6db9feee3f36a
|
3 |
+
size 7646459
|
miracl_train_bm25_neg_top100_random30.te.jsonl.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:be2d1be9777deecb919bfc7c88dccbe08c99558a96a10388787cfa642da136e5
|
3 |
+
size 30441850
|
miracl_train_bm25_neg_top100_random30.th.jsonl.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:894bada335652040ab71ad6b7a6bab0dc5f8cb152cd8257a4643645534327a5d
|
3 |
+
size 29283595
|
miracl_train_bm25_neg_top100_random30.zh.jsonl.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3ee4ca81448bd7852a17bdcea5dac1bd7060dd6b870e3f05fe1441f8903d5b33
|
3 |
+
size 9001918
|