-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathpost_process_results.py
46 lines (41 loc) · 1.46 KB
/
post_process_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
import glob
import json
files = ["tmp/train_9_2_roberta-large",
"tmp/train_9_1_roberta-large",
"tmp/train_9_0_roberta-large",
"tmp/train_8_0_roberta-large",
"tmp/train_8_1_roberta-large",
"tmp/train_8_2_roberta-large",
"tmp/train_7_2_roberta-large",
"tmp/train_7_1_roberta-large",
"tmp/train_7_0_roberta-large",
"tmp/train_10_0_roberta-large",
"tmp/train_10_1_roberta-large",
"tmp/train_10_2_roberta-large",
"tmp/train_10_2_roberta-base",
"tmp/train_10_1_roberta-base",
"tmp/train_10_0_roberta-base",
"tmp/train_9_0_roberta-base",
"tmp/train_9_1_roberta-base",
"tmp/train_9_2_roberta-base",
"tmp/train_8_2_roberta-base",
"tmp/train_8_1_roberta-base",
"tmp/train_8_0_roberta-base",
"tmp/train_7_0_roberta-base",
"tmp/train_7_1_roberta-base",
"tmp/train_7_2_roberta-base"]
for fi in files: #glob.glob("tmp/*"):
print(fi)
_, shot, rep, model = fi.split("_")
print(shot, rep, model)
res = json.load(open(f"{fi}/eval_results.json","r"))
temp = {
"score": {
"MacroF1": res["eval_MacroF1"]*100,
"MicroF1": res["eval_MicroF1"]*100,
"WeightedF1": res["eval_WeightedF1"]*100,
"acc": res["eval_acc"]*100
}
}
with open(f'../generations/skill-selector_{shot}_{model}_1_{rep}.json', 'w') as fp:
json.dump(temp, fp, indent=4)