1
0
forked from tdwojak/Python2018
labs04
This commit is contained in:
Michał Budny 2018-06-02 08:22:34 +00:00
parent 4d8e263857
commit efe847fcae

View File

@ -0,0 +1,23 @@
import os
import glob
import re
import pandas
if __name__ == "__main__":
bleu_files = glob.glob('./scores/model.iter*.npz.bleu')
lines = []
for bleu_file in bleu_files:
lines += [[os.path.abspath(bleu_file), float(re.sub(r'.*?=\s*([^,]+).*', '\\1', line.rstrip('\n')))] for line in open(bleu_file)]
df = pandas.DataFrame(lines, columns=list('AB'))
print(df['A'].loc[df['B'].idxmax()])