forked from tdwojak/Python2017
18 lines
359 B
Python
18 lines
359 B
Python
![]() |
import glob
|
||
|
|
||
|
path = 'scores/model.iter*.npz.bleu'
|
||
|
|
||
|
for file in glob(path):
|
||
|
with open(file, 'r') as f:
|
||
|
for line in f.readlines():
|
||
|
num = float(line[line.find("=")+1:line.find(",")])
|
||
|
|
||
|
if num > 0:
|
||
|
max_num = num
|
||
|
max_num_file = file
|
||
|
|
||
|
file.close()
|
||
|
|
||
|
print(max_num_file)
|
||
|
|