mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-19 12:58:07 +00:00
fix score function
This commit is contained in:
parent
95d86464f2
commit
85b4601b57
3 changed files with 31 additions and 4 deletions
|
|
@ -92,3 +92,13 @@ def test_string_insertion_answer():
|
|||
|
||||
# No reuse of newly inserted characters
|
||||
assert dataset._get_answer("ABCDBCD") == "ABCDABCD"
|
||||
|
||||
# Test score_answer with correct answer
|
||||
answer = "AABCDAEEEEEEEBCDEBAAAAA"
|
||||
entry = {"answer": "AABCDAEEEEEEEBCDEBAAAAA"}
|
||||
assert dataset.score_answer(answer, entry) == 1.0
|
||||
|
||||
# Test score_answer with correct answer as python list of characters (partial correct)
|
||||
answer = "['A', 'A', 'B', 'C', 'D', 'A', 'E', 'E', 'E', 'E', 'E', 'E', 'E', 'B', 'C', 'D', 'E', 'B', 'A', 'A', 'A', 'A', 'A']"
|
||||
entry = {"answer": "AABCDAEEEEEEEBCDEBAAAAA"}
|
||||
assert dataset.score_answer(answer, entry) == 0.5
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue