tune(translation): set latin acceptance floor to 0.80 (#1376)
Calibrated against fresh probes once Interpreter returned real langdetect confidence: genuine German detected at 1.0, a correctly-detected but ambiguous latin string at 0.86. Set _MIN_LATIN_CONFIDENCE to 0.80 (below that band) so legitimate ambiguous non-English still translates while genuinely-unsure guesses are rejected. Real langdetect also fixed the original mis-flag at the source, so this floor is a safety net, not the primary fix. Pin 0.86-accepted in the gate test to guard against bumping the floor back up. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CgZP9v2otxVJymiYsnVuMy
This commit is contained in:
@@ -17,6 +17,7 @@ def test_accept_trusts_cjk_regardless_of_confidence():
|
||||
|
||||
def test_accept_requires_floor_for_latin():
|
||||
assert _accept("de", 0.98) is True
|
||||
assert _accept("de", 0.86) is True # calibrated: ambiguous-but-correct German stays
|
||||
assert _accept("de", _MIN_LATIN_CONFIDENCE) is True # exactly at floor
|
||||
assert _accept("de", _MIN_LATIN_CONFIDENCE - 0.01) is False
|
||||
assert _accept("fr", 0.40) is False # short mis-flag
|
||||
|
||||
Reference in New Issue
Block a user