Skip to content

fix(speaker): treat raw "Speaker N" diarization labels as unknown speakers - #362

Open
thestumonkey wants to merge 1 commit into
SimpleOpenSoftware:devfrom
Ushadow-io:fix/speaker-n-unknown-label
Open

thestumonkey wants to merge 1 commit into
SimpleOpenSoftware:devfrom
Ushadow-io:fix/speaker-n-unknown-label

Conversation

@thestumonkey

Copy link
Copy Markdown
Contributor

Problem

When speaker recognition has not run on a conversation, its transcript keeps the transcription provider's raw diarization labels: Deepgram's Speaker 0 and pyannote's SPEAKER_00. is_unknown_speaker_label only matched Unknown Speaker N. As a result:

  • Unknown-speaker discovery ("Scan corpus") found nothing. A corpus transcribed before speaker recognition was enabled has only Speaker N labels, so the discovery job skipped every segment.
  • Speaker 0 was not guarded as non-enrollable. is_non_enrollable_speaker could let it through and create a voiceprint that merges different people under one placeholder name.
  • The transcript editor's "hide unknown speakers" left these labels visible.

Change

  • backend/src/backend/constants.py: _UNKNOWN_SPEAKER_RE also matches speaker followed by a number (Speaker 0, speaker 12, SPEAKER_00), case-insensitive.
  • webui/.../TranscriptEditor.tsx: the frontend isUnknownSpeakerLabel twin gets the same rule.
  • backend/tests/test_unknown_speaker_label.py: new parametrised tests. Speaker alone, Speakerphone 2, and Guest Speaker 1 stay real labels.

This keeps the unknown-speaker invariant: a Speaker N label is conversation-local, like Unknown Speaker N, and is never used as a cross-conversation identity.

Testing

  • New tests pass.
  • 189 speaker, enrollment, diarization, and data-audit tests pass (tests/test_*speaker*.py, test_*enroll*.py, test_*diariz*.py, test_*audit*.py).
  • ruff is clean. tsc --noEmit reports no errors in TranscriptEditor.tsx.

🤖 Generated with Claude Code

…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>
@coderabbitai

coderabbitai Bot commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 812c7106-8985-4db1-83c3-aa5c4242b623

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant