-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathgenerate_results.py
55 lines (40 loc) · 1.42 KB
/
generate_results.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import os
from pos_eval import pos_eval
import argparse
def generate_results(path):
# def = ../../data/current_outcome
chunk_train = path + 'chunk_pred_train.txt'
chunk_val = path + 'chunk_pred_val.txt'
chunk_comb = path + 'chunk_pred_combined.txt'
chunk_test = path + 'chunk_pred_test.txt'
pos_train = path + 'pos_pred_train.txt'
pos_val = path + 'pos_pred_val.txt'
pos_comb = path + 'pos_pred_combined.txt'
pos_test = path + 'pos_pred_test.txt'
print('generating latex tables - chunk train')
cmd = 'perl eval.pl -l < ' + chunk_train
os.system(cmd)
print('generating latex tables - chunk valid')
cmd = 'perl eval.pl -l < ' + chunk_val
os.system(cmd)
print('generating latex tables - chunk combined')
cmd = 'perl eval.pl -l < ' + chunk_comb
os.system(cmd)
print('generating latex tables - chunk test')
cmd = 'perl eval.pl -l < ' + chunk_test
os.system(cmd)
print('generating accuracy - pos train')
print(pos_eval(pos_train))
print('generating accruacy - pos valid')
print(pos_eval(pos_val))
print('generating accruacy - pos combined')
print(pos_eval(pos_comb))
print('generating accruacy - pos test')
print(pos_eval(pos_test))
print('done')
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("--path")
args = parser.parse_args()
path = args.path
generate_results(path)