diff --git a/utils/cmrc2018_eval.py b/utils/cmrc2018_eval.py index e35dc50daf3eb078acaeabffd07a0ae71836700f..4373635c17f27282ce0290aa836f84aa0cde6ea4 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