Repository navigation
fix(speaker): treat raw "Speaker N" diarization labels as unknown speakers - #362
Open
thestumonkey wants to merge 1 commit into
Open
thestumonkey wants to merge 1 commit into
thestumonkey wants to merge 1 commit into
Conversation
…akers
When speaker recognition has not run, a transcript keeps the provider's raw
diarization labels: Deepgram's "Speaker 0" and pyannote's "SPEAKER_00".
is_unknown_speaker_label only matched "Unknown Speaker N", so:
- unknown-speaker discovery ("Scan corpus") found nothing in such a corpus;
- "Speaker 0" was not guarded as non-enrollable, so it could be enrolled as a
real voiceprint that merges different people;
- the transcript editor's "hide unknown speakers" left them visible.
The rule now also matches "speaker" followed by a number. "Speaker" alone and
names such as "Guest Speaker 1" remain real labels.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
This branch has not been deployed
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.
Problem
When speaker recognition has not run on a conversation, its transcript keeps the transcription provider's raw diarization labels: Deepgram's
Speaker 0and pyannote'sSPEAKER_00.is_unknown_speaker_labelonly matchedUnknown Speaker N. As a result:Speaker Nlabels, so the discovery job skipped every segment.Speaker 0was not guarded as non-enrollable.is_non_enrollable_speakercould let it through and create a voiceprint that merges different people under one placeholder name.Change
backend/src/backend/constants.py:_UNKNOWN_SPEAKER_REalso matchesspeakerfollowed by a number (Speaker 0,speaker 12,SPEAKER_00), case-insensitive.webui/.../TranscriptEditor.tsx: the frontendisUnknownSpeakerLabeltwin gets the same rule.backend/tests/test_unknown_speaker_label.py: new parametrised tests.Speakeralone,Speakerphone 2, andGuest Speaker 1stay real labels.This keeps the unknown-speaker invariant: a
Speaker Nlabel is conversation-local, likeUnknown Speaker N, and is never used as a cross-conversation identity.Testing
tests/test_*speaker*.py,test_*enroll*.py,test_*diariz*.py,test_*audit*.py).ruffis clean.tsc --noEmitreports no errors inTranscriptEditor.tsx.🤖 Generated with Claude Code