Skip to content

Instantly share code, notes, and snippets.

@felipessalvatore
Created September 4, 2018 01:07
Show Gist options
  • Save felipessalvatore/4509ad2fb23afcc0986eaba735d7de8a to your computer and use it in GitHub Desktop.
Save felipessalvatore/4509ad2fb23afcc0986eaba735d7de8a to your computer and use it in GitHub Desktop.
read COntraQA
import os
folder = "RandomSeq"
seq = os.listdir(folder)
seq.sort()
for file in seq:
path = os.path.join(folder, file, "model.test")
with open(path, "r") as f:
line = f.readline()
name, acc = line.split()[2:4]
acc = float(acc[:-1]) * 100
acc = "{:.1f}".format(acc)
print(file, name, acc)
# GRUSeqTask1 'accuracy': 59.9
# GRUSeqTask2 'accuracy': 63.2
# GRUSeqTask12 'accuracy': 81.1
# GenAttSeqTask9 'accuracy': 74.7
# GenAttSeqTask10 'accuracy': 74.5
# GenAttSeqTask12 'accuracy': 76.8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment