diff --git a/labs04/task05.py b/labs04/task05.py new file mode 100644 index 0000000..2e8a055 --- /dev/null +++ b/labs04/task05.py @@ -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'])) \ No newline at end of file