Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions opencompass/openicl/icl_evaluator/math_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ def score(self, predictions, references):
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(),
Expand All @@ -32,16 +33,16 @@ def score(self, predictions, references):
)
# 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(),
# ],
# )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the comments

if len(gold_parsed) != 0:
# We require the answer to be provided in correct
# latex (no malformed operators)
Expand Down