feat: SpeakerTracker — ephemeral friendly labels + overlap detection for diarization #1
Labels
No labels
a11y
acoustic
backlog
bug
cf-core-dep
diarization
enhancement
inference
privacy
stt
testing
tier:paid
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Circuit-Forge/cf-voice#1
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Linnet#8 covers end-to-end diarization for Linnet. Two gaps exist in
diarize.pythat block the issue from being closed:Changes needed
1.
SpeakerTracker— ephemeral friendly label mappingDiarizerreturns raw pyannote segment labels likeSPEAKER_00,SPEAKER_01. These should be mapped to stable per-session friendly labels (Speaker A,Speaker B, ...) so:Add
SpeakerTrackerclass todiarize.py:2. Overlap detection in
speaker_at()When two
SpeakerSegments cover the same timestamp (simultaneous speech), the currentspeaker_at()silently returns the first match. The correct behavior:"Multiple""speaker_a"(silence/VAD miss)Rename or add
speaker_at_window()with this logic.3. Tests
Add
tests/test_diarize.py:SpeakerTrackermapping stability across callsSpeakerTrackerhandles >26 speakers gracefullyspeaker_at()single speakerspeaker_at()overlap →"Multiple"speaker_at()silence →"speaker_a"Diarizer.from_env()raisesEnvironmentErrorwhenHF_TOKENabsent_noop_diarize()returns[]Out of scope
Env vars
CF_VOICE_DIARIZE=1— opt-in, default offHF_TOKEN— required when diarize is enabledTracking
Linnet#8