-
Notifications
You must be signed in to change notification settings - Fork 690
/
Copy pathevaluate_batch_guis.py
29 lines (22 loc) · 988 Bytes
/
evaluate_batch_guis.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python
from __future__ import print_function
from argparse import ArgumentParser
from classes.inference.Evaluator import *
def build_parser():
parser = ArgumentParser()
parser.add_argument('--original_guis_filepath', type=str,
dest='original_guis_filepath', help='dir with all original guis',
required=True)
parser.add_argument('--predicted_guis_filepath', type=str,
dest='predicted_guis_filepath', help='dir with all predicted guis',
required=True)
return parser
def main():
parser = build_parser()
options = parser.parse_args()
original_guis_filepath = options.original_guis_filepath
predicted_guis_filepath = options.predicted_guis_filepath
bleu_score = Evaluator.get_corpus_bleu(original_guis_filepath, predicted_guis_filepath)
print("BLEU score for batch of GUIs: {}".format(bleu_score))
if __name__ == "__main__":
main()