Clémentine commited on
Commit
6ba3cb1
·
1 Parent(s): 3499b42

init, helm version

Browse files
ms_marco.py ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import datasets
2
+ import os
3
+ import json
4
+
5
+
6
+ _CITATION = """
7
+
8
+ """
9
+
10
+ _DESCRIPTION = """
11
+
12
+ """
13
+
14
+ class Builder(datasets.GeneratorBasedBuilder):
15
+ VERSION = datasets.Version("1.0.0")
16
+
17
+ BUILDER_CONFIGS = [
18
+ datasets.BuilderConfig(name=name, version=datasets.Version("1.0.0"), description=_DESCRIPTION)
19
+ for name in ["regular", "trec"]
20
+ ]
21
+
22
+ def _info(self):
23
+ features = datasets.Features(
24
+ {
25
+ "text": datasets.Value("string"),
26
+ "references": datasets.Sequence(datasets.Value("string")),
27
+ "golds": datasets.Sequence(datasets.Value("string")),
28
+ }
29
+ )
30
+ return datasets.DatasetInfo(
31
+ description=_DESCRIPTION,
32
+ features=features,
33
+ homepage="",
34
+ license="",
35
+ citation=_CITATION,
36
+ )
37
+
38
+ def _split_generators(self, dl_manager):
39
+ train_json = dl_manager.download(os.path.join(self.config.name, "train.jsonl"))
40
+ valid_json = dl_manager.download(os.path.join(self.config.name, "valid.jsonl"))
41
+
42
+ return [
43
+ datasets.SplitGenerator(
44
+ name=datasets.Split.TRAIN,
45
+ gen_kwargs={"path": train_json},
46
+ ),
47
+ datasets.SplitGenerator(
48
+ name=datasets.Split.VALIDATION,
49
+ gen_kwargs={"path": valid_json},
50
+ ),
51
+ ]
52
+
53
+ # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
54
+ def _generate_examples(self, path):
55
+ with open(path, encoding="utf-8") as f:
56
+ for key, row in enumerate(f):
57
+ yield key, json.loads(row)
regular/train.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
regular/valid.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
trec/train.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
trec/valid.jsonl ADDED
The diff for this file is too large to render. See raw diff