update
Browse files- augment_negative.py +12 -0
- dataset/train.jsonl +0 -0
- dataset/valid.jsonl +0 -0
- stats.md +0 -1
augment_negative.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import json
|
2 |
+
from glob import glob
|
3 |
+
from itertools import chain
|
4 |
+
|
5 |
+
for i in glob("dataset/*.jsonl"):
|
6 |
+
with open(i) as f:
|
7 |
+
tmp = [json.loads(o) for o in f.read().split('\n') if len(o) > 0]
|
8 |
+
for r in tmp:
|
9 |
+
r['negatives'] = r['negatives'] + list(
|
10 |
+
chain(*[o['positives'] for o in tmp if o['relation_type'] != r['relation_type']]))
|
11 |
+
with open(i, 'w') as f:
|
12 |
+
f.write('\n'.join([json.dumps(r) for r in tmp]))
|
dataset/train.jsonl
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
dataset/valid.jsonl
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
stats.md
CHANGED
@@ -22,5 +22,4 @@
|
|
22 |
| ReceivesAction | 18 | 16 | 8 | 6 |
|
23 |
| SymbolOf | 0 | 0 | 2 | 3 |
|
24 |
| UsedFor | 249 | 269 | 81 | 74 |
|
25 |
-
|:-----------------|-------------------:|-------------------:|------------------------:|------------------------:|
|
26 |
| SUM | 1795 | 1791 | 595 | 595 |
|
|
|
22 |
| ReceivesAction | 18 | 16 | 8 | 6 |
|
23 |
| SymbolOf | 0 | 0 | 2 | 3 |
|
24 |
| UsedFor | 249 | 269 | 81 | 74 |
|
|
|
25 |
| SUM | 1795 | 1791 | 595 | 595 |
|