1
0
forked from tdwojak/Python2018
Python2018/labs04/zad5.py
2018-06-05 07:39:01 +02:00

24 lines
419 B
Python

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()])