forked from tdwojak/Python2017
21 lines
424 B
Python
21 lines
424 B
Python
|
from glob import glob as g
|
||
|
|
||
|
i = 0
|
||
|
|
||
|
for file in g('scores/model.iter*.npz.bleu'):
|
||
|
with open(file, 'r') as of:
|
||
|
fl = of.readline()
|
||
|
cB = float(fl[fl.find("=") + 1:fl.find(",")])
|
||
|
|
||
|
if i == 0:
|
||
|
maxB = cB
|
||
|
maxBF =file
|
||
|
else:
|
||
|
if cB > maxB:
|
||
|
maxB = cB
|
||
|
maxBF = file
|
||
|
i += 1
|
||
|
of.close()
|
||
|
|
||
|
print(maxBF)
|