1
0
forked from tdwojak/Python2018

Task 05 lab04 ready

This commit is contained in:
Kuba 2018-06-01 21:56:38 +02:00
parent d0595e3128
commit 076f5e462b

14
labs04/task05.py Normal file
View File

@ -0,0 +1,14 @@
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']))