19 lines
478 B
Python
19 lines
478 B
Python
|
import glob, os
|
||
|
|
||
|
# print(glob.glob('./scores/model.iter[0-9][0-9][0-9][0-9][0-9][0-9][0-9].npz.bleu'))
|
||
|
|
||
|
|
||
|
|
||
|
def extract_BLEU_score(fn):
|
||
|
'''
|
||
|
:param fn - path to file with :
|
||
|
:return:
|
||
|
'''
|
||
|
with open(fn, 'r') as fd:
|
||
|
line = fd.readline()
|
||
|
return (os.path.abspath(fn), float(line[6:line.index(',')]))
|
||
|
|
||
|
print max([ t for t in map(extract_BLEU_score, glob.iglob('./scores/model.iter[0-9][0-9][0-9][0-9][0-9]*.npz.bleu'))], key = lambda tpl: tpl[1])[0]
|
||
|
|
||
|
|