2017-12-16 00:56:43 +01:00
|
|
|
import glob
|
|
|
|
|
|
|
|
path = 'scores/model.iter*.npz.bleu'
|
|
|
|
|
2017-12-16 09:14:44 +01:00
|
|
|
for file in glob.glob(path):
|
|
|
|
with open(file, 'r') as f:
|
|
|
|
for line in f.readlines():
|
|
|
|
num = float(line[line.find("=") + 1:line.find(",")])
|
2017-12-16 00:56:43 +01:00
|
|
|
|
2017-12-16 09:14:44 +01:00
|
|
|
if num > 0:
|
2017-12-16 00:56:43 +01:00
|
|
|
max_num = num
|
|
|
|
max_num_file = file
|
|
|
|
|
2017-12-16 09:14:44 +01:00
|
|
|
f.close()
|
2017-12-16 00:56:43 +01:00
|
|
|
|
|
|
|
print(max_num_file)
|