feat(diar): min-cut-interval to suppress spurious rapid turn cuts#4
Merged
Conversation
Don't fire a turn boundary within 1.5s of the previous cut (and don't update the tracked speaker while suppressed). A short cross-talk excursion is absorbed when the original speaker returns before the interval elapses; debounce already guards single-update flicker, this guards rapid real flips. Same-audio A/B (production build without it, vs this): sub-1.5s inter-boundary gaps drop 14% -> 0%, and diarizer flicker no longer chops a single speaker's phrase into a tiny standalone record. Normal turns (>1.5s apart) are unaffected. Note: this does NOT move the overall share of <=5-char records — measurement shows those are mostly SpeechAnalyzer-side short finals, not diar over-cuts. Trimming those is a separate lever (the Transcriber min-length filter). Doc updated to record the finding. 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.
What
Don't fire a turn boundary within 1.5s of the previous cut (and don't update
the tracked speaker while suppressed). A short cross-talk excursion is absorbed
when the original speaker returns before the interval elapses. Debounce already
guards single-update flicker; this guards rapid real flips and diarizer
flicker.
Why / validation
Same-audio A/B — the production build (no min-cut) vs this — over a full day of
real calls:
standalone record (observed: a phrase that production cut into its own 5-char
record stays attached to its sentence here)
Honest caveat
This does not move the overall share of ≤5-char records. Measurement shows
those are mostly
SpeechAnalyzer-side short finals, not diarizer over-cuts —trimming them is a separate lever (the
Transcribermin-length filter), not inscope here. So this is a clean, low-risk quality fix (removes spurious
fragmentation, no downside on normal turns) rather than a fix for the
micro-fragment count.
minCutIntervalis a single tunable constant inSpeakerSegmenter.Test plan
swift buildcleanmake install, production app runs with it