Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import _pickle as cPickle
- os.chdir('C://Users//DK//DATA1')
- from collections import defaultdict
- import numpy as np
- ans = defaultdict(list)
- for folder in os.listdir(os.getcwd()):
- if True:#'Out' in folder:
- for file in os.listdir(folder):
- if '.pkl' in file:
- results= cPickle.load(open(folder+'/'+file,'rb'))
- if 'sts' in file:
- max_key='spearman'
- elif 'mrpc' in file or 'qqp' in file:
- max_key = 'eval_f1'
- else:
- max_key='eval_accuracy'
- max_results = [ sum(results[j][max_key])/len(results[j][max_key]) for j in range(len(results))]
- ans[file].append(np.argmax(max_results))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement