Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple and intermediate integration problems dataset generators #46

Merged

Conversation

joesharratt1229
Copy link
Collaborator

Linked to issue #36.

** Files Added **

  • algebra/simple_integration.py - implements the SimpleIntegrationConfig and SimpleIntegrationDataset for basic indefinite integration tasks
  • algebra/intermediate_integration.py - Implementation of intermediate tasks.
  • tests/test_simple_integration.py - Testing of simple integration tasks
  • tests/test_intermediate_integration.py - Testing of intermediate tasks

@andreaskoepf
Copy link
Contributor

Thanks a lot for the integration datasets!

Could you add score_answer() functions to parse the result and compare simplified with sympy? This would be much better than just string comparison (which the default score_answer method of the base class does).

for a simple example of score_answer() see:

def score_answer(self, answer: Optional[str], metadata: Dict[str, Any]) -> float:
"""Determine if the solution provided solves the problem"""
reward = 0.0
if answer is not None:
try:
user_answer = int(parse_expr(answer))
solved = user_answer == metadata["target"]
if solved:
reward = 1.0
elif len(answer.strip()) > 0: # encourage partial solutions
reward = 0.05
else:
reward = 0.01
except:
reward = 0.01
return reward

Copy link
Contributor

@andreaskoepf andreaskoepf left a comment

Choose a reason for hiding this comment

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

🔢 🥇

@andreaskoepf andreaskoepf merged commit abd4181 into open-thought:main Feb 2, 2025
3 checks passed
@andreaskoepf andreaskoepf linked an issue Feb 2, 2025 that may be closed by this pull request
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.

Add simple and intermediate Integral Calculus datasets
2 participants