Skip to content

Conversation

lewtun
Copy link
Member

@lewtun lewtun commented Apr 20, 2024

Closes #140 by using the official _fix_fracs() function from the MATH repo.

Colab to test out the fix: https://colab.research.google.com/drive/1WumhmGpAoKbA-YaWwDB4gSSgKBZHF_i1?usp=sharing

Here's the code snippet that was triggering the error and now produces the correct output:

s = "The fraction $\\frac{1}{2y+1}$ fails to be defined only if the denominator is zero. This occurs when $y$ is the solution of the equation $$2y+1=0,$$ which is $y=-\\frac 12$. Thus the domain of $k(y)$ is $$\\boxed{\\left(-\\infty,-\\frac 12\\right)\\cup \\left(-\\frac 12,\\infty\\right)}.$$"
math_normalizer(s, is_gold=True)
 # (-\infty,-\frac{1}{2})\cup(-\frac{1}{2},\infty) 

TODO

  • Run over some public models to validate scores look OK.

@lewtun lewtun changed the title [MATH] Fix _fix_fracs in MATH normalization [MATH] Fix MATH normalization Apr 20, 2024
@lewtun lewtun requested a review from clefourrier April 20, 2024 14:09
Copy link
Member

@clefourrier clefourrier left a comment

Choose a reason for hiding this comment

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

LGTM! (and thanks for the docstring)
If tests pass, feel free to merge

@clefourrier clefourrier merged commit fc428f6 into main Apr 20, 2024
hynky1999 pushed a commit that referenced this pull request May 22, 2025
NathanHB pushed a commit that referenced this pull request Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[MATH] Too many values to unpack (expected 2)
2 participants