mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-24 17:05:03 +00:00
Remove strip from ProceduralDataset::core score_answer() (#250)
* remove strip from ProceduralDataset::core score_answer(), strip in extract answer (optional, default=True) * test: Move test_extract_answer() from test_dataset.py to test_utils.py * refactor: Improve decimal reward computation with more flexible comparison * fix: Implement rounding for format_number when round_if_needed is True * test: Add test case for compute_decimal_reward with sign and zeros
This commit is contained in:
parent
16a4ea1193
commit
ece6990709
6 changed files with 80 additions and 26 deletions
|
|
@ -111,7 +111,8 @@ class ChainSumDataset(ProceduralDataset):
|
|||
return expression, result
|
||||
|
||||
def score_answer(self, answer: Optional[str], entry: dict[str, Any]) -> float:
|
||||
return utils.compute_decimal_reward(answer, oracle_answer=entry["answer"])
|
||||
# tolerate sign, leading zeros and trailing decimals, strip commas "+01,000.00" == "1000"
|
||||
return utils.compute_decimal_reward(answer, oracle_answer=entry["answer"], strip_commas=True)
|
||||
|
||||
|
||||
class ChainSumCurriculum(BaseCurriculum):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue