1
0
forked from tdwojak/Python2018
Python2018/labs04/task05.py

14 lines
383 B
Python
Raw Normal View History

2018-06-01 21:56:38 +02:00
import glob
import os
scores_files = glob.glob('./scores/model.iter*[0-9].npz.bleu')
max_result = { 'path': '', 'score': 0.0 }
for f in scores_files:
read_file = open(f, 'r').read().split()
result = float(read_file[2][:-1])
if(result > max_result['score']):
max_result['score'] = result
max_result['path'] = f
print(os.path.abspath(max_result['path']))