mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-24 17:05:03 +00:00
fix(env): Remove custom score function in bf (#418)
* remove custom score function in bf * pre commit
This commit is contained in:
parent
290bfc4fdd
commit
71787c6a0e
1 changed files with 0 additions and 30 deletions
|
|
@ -117,36 +117,6 @@ int main() {{
|
|||
# bf = Minify.minify(bf) # Is this necessary?
|
||||
return bf
|
||||
|
||||
def score_answer(self, answer: Optional[str], entry: dict[str, Any]) -> float:
|
||||
"""Determine if the solution provided solves the BF task.
|
||||
|
||||
The function awards 1.0 for a correct answer.
|
||||
|
||||
Args:
|
||||
answer (Optional[str]): The user's answer.
|
||||
entry (dict[str, Any]): The original dataset entry containing the correct answer.
|
||||
|
||||
Returns:
|
||||
float: The computed score between 0.0 and 1.0.
|
||||
"""
|
||||
|
||||
if not isinstance(answer, str):
|
||||
return 0.0
|
||||
|
||||
if answer == entry["answer"]:
|
||||
return 1.0 # Yay
|
||||
|
||||
if entry["answer"] in answer.splitlines():
|
||||
# We can be quite confident that the correct answer was given
|
||||
# It was likely just given alongside an explanation
|
||||
return max(0.9 * len(answer) / len(entry["answer"]), 0.1)
|
||||
|
||||
if entry["answer"] in answer:
|
||||
# Since answers are English words, some risk of the response coincidentally containing the answer
|
||||
return max(0.5 * len(answer) / len(entry["answer"]), 0.1)
|
||||
|
||||
return 0.0
|
||||
|
||||
|
||||
class BFCurriculum(BaseCurriculum):
|
||||
def __init__(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue