hiyouga / hiyouga/MathRuler

grade_answe 测试有纰漏

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
88
Forks
12
PR merge metrics
No merged PRs in 30d

Description

我在使用 `grade.grade_answer` 函数比对 `0.5 + \\frac{\\pi}{8}` 和 `\\pi \\div 8 + 1 \\div 2` 并不被判断为相等的表达式

使用的版本应该是 mathrule 0.1.0

我跟踪到函数中,发现执行到的分支是
```
else:
for ground_truth_elem, given_elem in zip(ground_truth_elems, given_elems):
if _is_frac(ground_truth_elem) and _is_frac(given_elem):
# if fractions aren't reduced, then shouldn't be marked as correct
# so, we don't want to allow sympy.simplify in this case
is_correct = ground_truth_elem == given_elem
elif _str_is_int(ground_truth_elem) != _str_is_int(given_elem):
# if the ground truth answer is an integer, we require the given answer to be a strict match (no sympy.simplify)
is_correct = False
else:
# ! 执行到这里
is_correct = are_equal_under_sympy(ground_truth_elem, given_elem)
if not is_correct:
break

```

也就是 smpy 没有将这两个表达式当成一样的,请问有没有什么调整的方法?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.