提交 e66ea986 编写于 作者: C chenxuyi

python3.5 compat

上级 b3d65206
...@@ -155,8 +155,8 @@ def calc_em_score(answers, prediction): ...@@ -155,8 +155,8 @@ def calc_em_score(answers, prediction):
def eval_file(dataset_file, prediction_file): def eval_file(dataset_file, prediction_file):
ground_truth_file = json.load(open(dataset_file, 'rb')) ground_truth_file = json.load(open(dataset_file, 'r'))
prediction_file = json.load(open(prediction_file, 'rb')) prediction_file = json.load(open(prediction_file, 'r'))
F1, EM, TOTAL, SKIP = evaluate(ground_truth_file, prediction_file) F1, EM, TOTAL, SKIP = evaluate(ground_truth_file, prediction_file)
AVG = (EM + F1) * 0.5 AVG = (EM + F1) * 0.5
return EM, F1, AVG, TOTAL return EM, F1, AVG, TOTAL
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册