mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-04 15:59:59 +08:00
fix(learning): keep a numeric mismatch open when an accepted answer may match
exact_verdict settled a final "incorrect" from the first key alone, so "416,67" against "417,00" with an accepted "≈ 417" was incorrect at confidence 1 although the accepted answer leaves it ambiguous. A final incorrect now requires that no key is ambiguous. Signed-off-by: Benjamin Schwing <63053132+BenjiAvH@users.noreply.github.com>
This commit is contained in:
@@ -118,7 +118,8 @@ def exact_verdict(question, answer):
|
||||
# ambiguous reading may still be right, and multi-part answers may earn
|
||||
# partial credit, so all of those stay semantic.
|
||||
first = numeric[0]
|
||||
if question.question_type == "short" and len(first.parts) == 1 and not first.ambiguous:
|
||||
settled = len(first.parts) == 1 and not any(n.ambiguous for n in numeric)
|
||||
if question.question_type == "short" and settled:
|
||||
return Verdict(
|
||||
result="incorrect",
|
||||
confidence=1,
|
||||
|
||||
@@ -391,6 +391,10 @@ class TestExactVerdictNumeric:
|
||||
assert self._verdict(answer, expected) is None
|
||||
assert self._verdict("1.251.000", "1.250").result == "incorrect"
|
||||
|
||||
def test_ambiguous_accepted_answer_keeps_the_mismatch_open(self):
|
||||
assert self._verdict("416,67", "417,00", accepted=["≈ 417"]) is None
|
||||
assert self._verdict("415,20", "417,00", accepted=["≈ 417"]).result == "incorrect"
|
||||
|
||||
def test_multi_part_mismatch_keeps_partial_credit_open(self):
|
||||
assert self._verdict("a) 1.000; b) 260", "a) 1.000; b) 250") is None
|
||||
assert self._verdict("1250", "Goodwill = 1.250; NCI = 300") is None
|
||||
|
||||
Reference in New Issue
Block a user