1
0
forked from tdwojak/Python2018
Python2018/zadaniedomowe1/labs04/cwiczenie5.py

24 lines
419 B
Python
Raw Normal View History

2018-06-01 22:59:45 +02:00
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()])