1
0
forked from tdwojak/Python2017
Python2017/labs03/task05.py

20 lines
525 B
Python
Raw Permalink Normal View History

2017-12-10 15:12:51 +01:00
from glob import glob
iteracje = 0
for plik in glob('scores/model.iter*.npz.bleu'):
with open(plik,'r') as otwarty_plik:
fl = otwarty_plik.readline()
current_bleu = float(fl[fl.find("=")+1:fl.find(",")])
if iteracje == 0:
max_bleu = current_bleu
max_bleu_file = plik
else:
if current_bleu > max_bleu:
max_bleu = current_bleu
max_bleu_file = plik
iteracje += 1
otwarty_plik.close()
print(max_bleu_file)