From 01b0ee6ee66817804eaac69661967d7e02f28b7f Mon Sep 17 00:00:00 2001 From: Myhs-phz Date: Mon, 7 Apr 2025 02:36:51 +0000 Subject: [PATCH] fix --- .../openicl/icl_evaluator/math_evaluator.py | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/opencompass/openicl/icl_evaluator/math_evaluator.py b/opencompass/openicl/icl_evaluator/math_evaluator.py index 48764252..fd93a7c9 100644 --- a/opencompass/openicl/icl_evaluator/math_evaluator.py +++ b/opencompass/openicl/icl_evaluator/math_evaluator.py @@ -22,8 +22,9 @@ class MATHEvaluator(BaseEvaluator): details = [] for i, j in zip(predictions, references): count += 1 + j_with_env = f'${j}$' gold_parsed = parse( - j, + j_with_env, extraction_mode='first_match', extraction_config=[ LatexExtractionConfig(), @@ -32,16 +33,16 @@ class MATHEvaluator(BaseEvaluator): ) # If parsing result is empty, try adding LaTeX # environment and parse again - if len(gold_parsed) == 0: - j_with_env = f'${j}$' - gold_parsed = parse( - j_with_env, - extraction_mode='first_match', - extraction_config=[ - LatexExtractionConfig(), - ExprExtractionConfig(), - ], - ) + # if len(gold_parsed) == 0: + # j_with_env = f'${j}$' + # gold_parsed = parse( + # j_with_env, + # extraction_mode='first_match', + # extraction_config=[ + # LatexExtractionConfig(), + # ExprExtractionConfig(), + # ], + # ) if len(gold_parsed) != 0: # We require the answer to be provided in correct # latex (no malformed operators)