From e66ea9865421ab5b7add1f5392ecbfd244eebc3a Mon Sep 17 00:00:00 2001 From: chenxuyi Date: Sun, 29 Sep 2019 11:04:09 +0800 Subject: [PATCH] python3.5 compat --- utils/cmrc2018_eval.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/cmrc2018_eval.py b/utils/cmrc2018_eval.py index e35dc50..4373635 100644 --- a/utils/cmrc2018_eval.py +++ b/utils/cmrc2018_eval.py @@ -155,8 +155,8 @@ def calc_em_score(answers, prediction): def eval_file(dataset_file, prediction_file): - ground_truth_file = json.load(open(dataset_file, 'rb')) - prediction_file = json.load(open(prediction_file, 'rb')) + ground_truth_file = json.load(open(dataset_file, 'r')) + prediction_file = json.load(open(prediction_file, 'r')) F1, EM, TOTAL, SKIP = evaluate(ground_truth_file, prediction_file) AVG = (EM + F1) * 0.5 return EM, F1, AVG, TOTAL -- GitLab