-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.py
More file actions
22 lines (16 loc) · 770 Bytes
/
utils.py
File metadata and controls
22 lines (16 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# create a function that load results from folder and print forward transfer, backward transfer, average performance, and later generalization performance
from prettytable import PrettyTable
def print_argparse_args(parser):
table = PrettyTable()
table.field_names = ["Argument", "Value"]
for arg in vars(parser.parse_args()):
arg_value = getattr(parser.parse_args(), arg)
table.add_row([arg, arg_value])
print(table)
def print_result_table(result_dict):
table = PrettyTable()
table.field_names = ["Task", "Language", "Metric Type", "Score"]
#print(table)
for result in result_dict:
table.add_row([result["task"], result['language'], result['score']['metrics'], result['score']['score']])
print(table)