feat(ambient): Tier-1 capture-quality gate (drop far-field blips / hallucinated-language) - #43
Merged
Merged
Conversation
…ucinated-lang) Soak analysis of live SenseVoice capture (5 days, ~6k rows) showed ~30% is far-field garbage: sub-second blips SenseVoice hallucinates CJK on, and absent languages (ja/ko in a Mandarin+English house) invented on noise. Add an opt-in Tier-1 gate that drops these before they become rows. - config: min_utterance_s (blip floor), asr_drop_langs (DENY-list of KNOWN-ABSENT languages — never an allow-list, which false-drops mis-tagged real speech like Mandarin tagged "yue"), drop_bgm. All default to no-op → existing installs unchanged; the edge opts in via drop-in. - pipeline: pure _passes_capture_gate() called after the ASR/empty-text skip in _process_sync (diar-safe — mirrors the existing `if not text: continue`). - 7 tests (gate truth table + knob parsing); README documents the knobs. Offline E2E over the real soak rows (min=1.0s, drop_langs=ja,ko, drop_bgm=0): 28% dropped, all genuine garbage, ZERO false-drops of real speech. drop_bgm stays OFF here — SenseVoice mis-tags far-field speech-over-background as BGM. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A 5-day soak of a live SenseVoice ambient capture (~6k rows) showed ~30% of stored rows are far-field garbage: sub-second blips that SenseVoice hallucinates CJK text on, and absent languages (tags for languages measured absent at the deploy site) invented on noise/silence. This adds an opt-in Tier-1 capture gate that drops those before they become rows, so every downstream stage (and the future ambient-memory nursery) works on cleaner input.
Change
config.py— three knobs, all defaulting to a no-op so existing installs are byte-for-byte unaffected; a multilingual/far-field edge opts in via a systemd drop-in:AMBIENT_MIN_UTTERANCE_S— duration floor (real speech is ~4s, garbage ~0.7s).AMBIENT_ASR_DROP_LANGS— a deny-list of language tags measured absent at the deploy site (their appearance ⇒ SenseVoice hallucinated). Deliberately not an allow-list, which would false-drop real speech mis-tagged as a neighbouring language.AMBIENT_DROP_BGM— drop rows SenseVoice tags as background music (see caveat below).pipeline.py— a pure, unit-testable_passes_capture_gate()called in_process_syncright after the ASR / empty-text skip. Placement is diarization-safe: it mirrors the existingif not text: continue, before the diar-window bookkeeping.Why the deny-list, and why
DROP_BGMships OFF hereMeasured on the real rows: of 1,275 rows tagged with absent-or-neighbouring languages only 31 were long+substantial; the truly-absent-language tags are all hallucinated garbage, but several rows tagged as a neighbouring dialect are real primary-language speech mis-tagged — so an allow-list would delete real speech. And an offline replay of the gate over the full soak set found
DROP_BGM=1false-dropping ~30 real speech-with-background rows (far-field speech over TV/music gets an event=BGM tag). So the deny-list is scoped to the truly-absent tags only, andDROP_BGMstays off on far-field installs (knob retained + documented for installs with cleanly-separated music).Testing
min=1.0s,drop_langs=<absent-tags>,drop_bgm=0): 28% dropped, all genuine garbage, zero false-drops of real speech; every real-language row retained.Deploy
No-op for existing installs (defaults). A far-field edge sets
AMBIENT_MIN_UTTERANCE_S=1.0,AMBIENT_ASR_DROP_LANGSto the site's measured-absent tags,AMBIENT_DROP_BGM=0via a drop-in and restarts the ambient bridge.🤖 Generated with Claude Code