shuttie commited on
Commit
ef2223e
1 Parent(s): 5454dd4

migrate to flat schema

Browse files
README.md CHANGED
@@ -18,17 +18,9 @@ dataset_info:
18
  - name: query
19
  dtype: string
20
  - name: pos
21
- list:
22
- - name: doc
23
- dtype: string
24
- - name: score
25
- dtype: float
26
  - name: neg
27
- list:
28
- - name: doc
29
- dtype: string
30
- - name: score
31
- dtype: float
32
  splits:
33
  - name: train
34
  num_bytes: 89609915
@@ -54,20 +46,11 @@ A dataset in a [nixietune](https://github.com/nixiesearch/nixietune) compatible
54
  {
55
  "query": ")what was the immediate impact of the success of the manhattan project?",
56
  "pos": [
57
- {
58
- "doc": "The presence of communication amid scientific minds was equally important to the success of the Manhattan Project as scientific intellect was. The only cloud hanging over the impressive achievement of the atomic researchers and engineers is what their success truly meant; hundreds of thousands of innocent lives obliterated.",
59
- "score": 1
60
- }
61
  ],
62
  "neg": [
63
- {
64
- "doc": "Abstract. The pivotal engineering and scientific success of the Twentieth century was the Manhattan Project. The Manhattan Project assimilated concepts and leaders from all scientific fields and engineering disciplines to construct the first two atomic bombs.",
65
- "score": 0.0
66
- },
67
- {
68
- "doc": "The pivotal engineering and scientific success of the Twentieth century was the Manhattan Project. The Manhattan Project assimilated concepts and leaders from all scientific fields and engineering disciplines to construct the first two atomic bombs.",
69
- "score": 0.0
70
- }
71
  ]
72
  }
73
  ```
 
18
  - name: query
19
  dtype: string
20
  - name: pos
21
+ sequence: string
 
 
 
 
22
  - name: neg
23
+ sequence: string
 
 
 
 
24
  splits:
25
  - name: train
26
  num_bytes: 89609915
 
46
  {
47
  "query": ")what was the immediate impact of the success of the manhattan project?",
48
  "pos": [
49
+ "The presence of communication amid scientific minds was equally important to the success of the Manhattan Project as scientific intellect was. The only cloud hanging over the impressive achievement of the atomic researchers and engineers is what their success truly meant; hundreds of thousands of innocent lives obliterated."
 
 
 
50
  ],
51
  "neg": [
52
+ "Abstract. The pivotal engineering and scientific success of the Twentieth century was the Manhattan Project. The Manhattan Project assimilated concepts and leaders from all scientific fields and engineering disciplines to construct the first two atomic bombs.",
53
+ "The pivotal engineering and scientific success of the Twentieth century was the Manhattan Project. The Manhattan Project assimilated concepts and leaders from all scientific fields and engineering disciplines to construct the first two atomic bombs."
 
 
 
 
 
 
54
  ]
55
  }
56
  ```
convert.py CHANGED
@@ -1,12 +1,10 @@
1
- from datasets import load_dataset, Features, Value, Sequence
2
  from dataclasses import dataclass, field
3
  import logging
4
  from transformers import HfArgumentParser
5
  from tqdm import tqdm
6
  from typing import Dict, List
7
  import json
8
- import numpy as np
9
- from itertools import islice
10
 
11
  logger = logging.getLogger()
12
  logger.setLevel(logging.INFO)
@@ -60,17 +58,9 @@ def process_raw(
60
  ) -> List[Dict]:
61
  result = []
62
  for query, rels in tqdm(qrels.items(), desc="processing split"):
63
- pos = [
64
- {"doc": corpus[rel.doc], "score": rel.score}
65
- for rel in rels
66
- if rel.doc in corpus and rel.score > 0
67
- ]
68
- neg = [
69
- {"doc": corpus[doc], "score": 0.0}
70
- for doc in hardneg.get(query, [])
71
- if doc in corpus
72
- ]
73
- group = {"query": queries[query], "pos": pos, "neg": neg}
74
  result.append(group)
75
  return result
76
 
 
1
+ from datasets import load_dataset
2
  from dataclasses import dataclass, field
3
  import logging
4
  from transformers import HfArgumentParser
5
  from tqdm import tqdm
6
  from typing import Dict, List
7
  import json
 
 
8
 
9
  logger = logging.getLogger()
10
  logger.setLevel(logging.INFO)
 
58
  ) -> List[Dict]:
59
  result = []
60
  for query, rels in tqdm(qrels.items(), desc="processing split"):
61
+ pos = [corpus[rel.doc] for rel in rels if rel.doc in corpus and rel.score > 0]
62
+ neg = [corpus[doc] for doc in hardneg.get(query, []) if doc in corpus]
63
+ group = {"query": queries[query], "positive": pos, "negative": neg}
 
 
 
 
 
 
 
 
64
  result.append(group)
65
  return result
66
 
data/train/train-00.jsonl.gz CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c6034fd0aff6eda2d9ac8a5c3e304aec0183f127141a4cd49cd22c0c4a936fc2
3
- size 371800261
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:422dc130d928c5192573ab25f38a3460a3a0e0fef7eb8e5d6ffce29f576226c4
3
+ size 213978845
data/train/train-01.jsonl.gz CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:183d9bf9fdad674a537d9ba566c11b84281d35f9a6e07e46736bc7869d3fefdb
3
- size 373548650
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:32fe5e83f9506d9fc4ac5b4c169c20a864e86bc3b53d3a594c62a43c4d553f24
3
+ size 213769265
data/train/train-02.jsonl.gz CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c394b2ed33aca6ded6d9acf4504cf721b452aa7045b455951b387ac51870d2d1
3
- size 373875202
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:52534f7d3f1e9f08cf0577586cd51f547062eb2765fba95cd7ac14aecf28994d
3
+ size 215647325
data/train/train-03.jsonl.gz CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:da8771ccb47e681181fc8c7aa23fcab74f0566e1f953a3aa454298cbc4c4a1f9
3
- size 371204499
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:846bc61d859247170d57828fce884f797aa95bab28dd3dfd4f691fa215eef008
3
+ size 215496272
data/train/train-04.jsonl.gz CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:150cccc543b38f0d8b612ba688b4ffada310c239d95c931644b8a9550a300e5c
3
- size 368843006
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:35c23435c982b1f2cb3bae6d3a1d557c77699869dc1995ea1e5088d224f2ffcc
3
+ size 215376422
data/train/train-05.jsonl.gz CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:513aa76ff5395eebbd4acaa48ab31b3ae7682a952c0ff1309e15f23b2ed292c9
3
- size 10942759
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9b4e38bdc57315f2335be069d0d94b367fd60b4b1a4132144cea1624738cc418
3
+ size 214472237
data/train/train-06.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:90a18576296c482c2f5cc9809c026b4bf5d3953cba144ce78fb05d1246281a19
3
+ size 211141192
data/train/train-07.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cb277cd6ca866d75b71b469aad85ffa683b63fa96003add843a1e5f6f99db269
3
+ size 212784973