use e-s-c as positive examples
Browse files- finetune.py +15 -6
- pytorch_model.bin +1 -1
- pytorch_model.onnx +1 -1
finetune.py
CHANGED
@@ -25,12 +25,21 @@ class ESCIDataset(Dataset):
|
|
25 |
with gzip.open(input) as jsonfile:
|
26 |
for line in jsonfile.readlines():
|
27 |
query = json.loads(line)
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
def __getitem__(self, item):
|
36 |
return self.queries[item]
|
|
|
25 |
with gzip.open(input) as jsonfile:
|
26 |
for line in jsonfile.readlines():
|
27 |
query = json.loads(line)
|
28 |
+
for p in query['e']:
|
29 |
+
positive = p['title']
|
30 |
+
for n in query['i']:
|
31 |
+
negative = n['title']
|
32 |
+
self.queries.append(InputExample(texts=[query['query'], positive, negative]))
|
33 |
+
for p in query['s']:
|
34 |
+
positive = p['title']
|
35 |
+
for n in query['i']:
|
36 |
+
negative = n['title']
|
37 |
+
self.queries.append(InputExample(texts=[query['query'], positive, negative]))
|
38 |
+
for p in query['c']:
|
39 |
+
positive = p['title']
|
40 |
+
for n in query['i']:
|
41 |
+
negative = n['title']
|
42 |
+
self.queries.append(InputExample(texts=[query['query'], positive, negative]))
|
43 |
|
44 |
def __getitem__(self, item):
|
45 |
return self.queries[item]
|
pytorch_model.bin
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 90891565
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:32be7d4ded580fffe92bfff7e8dc865b17dc0cfbba3dd598865adc54dd89d0c3
|
3 |
size 90891565
|
pytorch_model.onnx
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 90984263
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b1abb2047d142c643ed10c33b6a1517171dab1ffb3d3a57bc2043437d3f5bf77
|
3 |
size 90984263
|