fix(voice_worker): the wake word hint may never add, drop or create a wake word

Hotword occurrences were counted with fuzzy matching, which never counted a one-letter wake word
(so a hinted "봇 ..." was accepted over a plain decode without it) and counted the real word
"서비스" as "자비스" (so the hint could turn it into the wake word). Occurrences are now counted
exactly (case, spacing and punctuation ignored); near misses are left as heard for call detection.
The real-noise eval now plays each recording as recorded and at -25 dBFS and reports how many clips
reached the model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-11 10:40:42 +09:00
parent 590cd07268
commit 1309525aa8
5 changed files with 49 additions and 35 deletions

View File

@@ -51,9 +51,27 @@ def test_a_wake_word_the_hint_adds_to_real_speech_is_dropped():
@pytest.mark.unit
def test_the_hint_may_fix_how_a_spoken_wake_word_is_spelt():
fixed = "자비스, 오늘 서울 날씨 어때?"
assert choose_with_hint(fixed, -0.1, "자비수, 오늘 서울 날씨 어때?", -0.2, HINT) == fixed
def test_a_one_letter_wake_word_the_hint_adds_is_dropped():
assert choose_with_hint("봇 오늘 날씨 알려 줘", -0.1, "오늘 날씨 알려 줘", -0.1, ("봇",)) == "오늘 날씨 알려 줘"
@pytest.mark.unit
def test_the_hint_may_not_turn_a_similar_real_word_into_the_wake_word():
assert choose_with_hint("자비스 신청해 줘", -0.1, "서비스 신청해 줘", -0.1, HINT) == "서비스 신청해 줘"
@pytest.mark.unit
def test_a_near_miss_spelling_is_left_as_heard_rather_than_guessed():
# "자비수" may be the wake word or another word; text alone cannot tell, so the plain decode stands
# and fuzzy wake word matching is left to the call detection that reads it.
plain = "자비수, 오늘 서울 날씨 어때?"
assert choose_with_hint("자비스, 오늘 서울 날씨 어때?", -0.1, plain, -0.2, HINT) == plain
@pytest.mark.unit
def test_the_hint_is_used_when_it_keeps_the_wake_words_as_they_were():
hinted = "자비스, 철수 화면 공유 보여 줘"
assert choose_with_hint(hinted, -0.1, "자비스 철수 화면공유 보여줘", -0.15, HINT) == hinted
@pytest.mark.unit