feat(stt/voice): better recognition, sustained barge-in, fragment discard
STT (whisper_worker): add VAD tuning (speech_pad_ms so soft first/last words
aren't clipped), condition_on_previous_text=False + temperature fallback +
no_speech/logprob/compression thresholds to reject noisy/quiet decodes, drop
per-segment non-speech, and a hallucination guard that blanks Whisper's classic
Korean silence/noise boilerplate ("감사합니다" 등) when no_speech_prob is high.
Barge-in (bot.mjs): stop the bot's TTS only when the speaking (green ring) stays
on for >= WSAI_BARGE_IN_MS (default 700ms), not on the first blip — cancelled if
speaking stops in time. AfterSilence 800->1000ms so trailing soft words finish.
Fragment gate (dashboard): a lone connective filler ("그러면") carries no
answerable intent -> discard as [대기] instead of replying; hidden by the noise
filter like [잡음].
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -49,6 +49,20 @@ def _thought_summary(reply: str) -> str:
|
||||
return "감정 태그 없음 · 기본 톤으로 답변"
|
||||
|
||||
|
||||
# Lone connective/fillers that clearly expect more to come ("그러면…"). On their
|
||||
# own they carry no answerable intent, so we discard them instead of blurting a
|
||||
# confused reply. (A fuller version would buffer and wait for the continuation.)
|
||||
_FRAGMENT_FILLERS = {
|
||||
"그러면", "그래서", "그런데", "근데", "그리고", "그러니까", "그럼", "그게",
|
||||
"저기", "있잖아", "그", "음", "어", "저", "그러", "그니까",
|
||||
}
|
||||
|
||||
|
||||
def _is_fragment(text: str) -> bool:
|
||||
t = (text or "").strip().rstrip(" .,!?…~").strip()
|
||||
return t in _FRAGMENT_FILLERS
|
||||
|
||||
|
||||
def _make_handler(dash: "Dashboard"):
|
||||
monitor = dash.monitor
|
||||
|
||||
@@ -722,6 +736,13 @@ class Dashboard:
|
||||
turn.replied("[잡음]")
|
||||
turn.finish()
|
||||
return {"heard": heard, "reply": "[잡음]", "wav": b""}
|
||||
if _is_fragment(heard):
|
||||
# A lone connective ("그러면") — no answerable intent yet. Discard
|
||||
# rather than reply to a fragment.
|
||||
turn.thought("불완전한 말(연결어) — 대답하지 않고 폐기")
|
||||
turn.replied("[대기]")
|
||||
turn.finish()
|
||||
return {"heard": heard, "reply": "[대기]", "wav": b""}
|
||||
t_llm = time.monotonic()
|
||||
reply_text = self._think(heard)
|
||||
self._step(turn, "LLM" if self.brain else "echo", (time.monotonic() - t_llm) * 1000)
|
||||
@@ -1305,7 +1326,7 @@ function turnFilter(){
|
||||
text:$('tfText').value.trim().toLowerCase() };
|
||||
}
|
||||
function isNoiseTurn(t){
|
||||
return (t.heard==='(빈 결과)') || (t.reply==='[잡음]');
|
||||
return (t.heard==='(빈 결과)') || (t.reply==='[잡음]') || (t.reply==='[대기]');
|
||||
}
|
||||
function turnMatches(t, f){
|
||||
if(hideNoise && isNoiseTurn(t)) return false; // 잡음 로그 표시 안 함 토글
|
||||
|
||||
Reference in New Issue
Block a user