forked from tdwojak/Python2018
labs04
labs04
This commit is contained in:
parent
4d8e263857
commit
efe847fcae
23
zadaniedomowe1/labs04/cwiczenie5.py
Normal file
23
zadaniedomowe1/labs04/cwiczenie5.py
Normal 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()])
|
Loading…
Reference in New Issue
Block a user