Assign recording-wide speaker IDs with Whisper and pyannote #18

Merged
mike merged 20 commits from mike-bot/whisper-pyannote into master 2026-11-24 21:30:07 -05:00 AGit
Collaborator

Both .#transcribe and .#transcribe-cloud use faster-whisper large-v3 for English transcription and pyannote Community-1 for recording-wide speaker IDs. Every transcript entry has a speaker. The apps prefer exclusive turn overlap, then use regular overlap or the nearest turn when needed. Nearby words with unambiguous matches help break ties. If neither timeline has turns, transcribed words use a recording-local UNKNOWN label.

Each recording has one compact JSON file containing the transcript and both diarization timelines. Transcript entries contain a speaker index and words with timestamps, Whisper confidence scores, and the method used to match each word to its speaker. The transcript and timelines share one speaker_labels array. The function that writes the recording JSON documents the schema and matching rules; the README explains how to run and resume transcription.

Rerun the same command to reuse completed Whisper word checkpoints. Run nix run .#download-pyannote-model -- ./data/models with an authorized HF_TOKEN to download the pinned Community-1 model, or pass --pyannote-model DIR to select a model directory. Vast.ai receives the model files, not Hugging Face credentials.

Both `.#transcribe` and `.#transcribe-cloud` use faster-whisper large-v3 for English transcription and pyannote Community-1 for recording-wide speaker IDs. Every transcript entry has a speaker. The apps prefer exclusive turn overlap, then use regular overlap or the nearest turn when needed. Nearby words with unambiguous matches help break ties. If neither timeline has turns, transcribed words use a recording-local `UNKNOWN` label. Each recording has one compact JSON file containing the transcript and both diarization timelines. Transcript entries contain a speaker index and words with timestamps, Whisper confidence scores, and the method used to match each word to its speaker. The transcript and timelines share one `speaker_labels` array. The function that writes the recording JSON documents the schema and matching rules; the README explains how to run and resume transcription. Rerun the same command to reuse completed Whisper word checkpoints. Run `nix run .#download-pyannote-model -- ./data/models` with an authorized `HF_TOKEN` to download the pinned Community-1 model, or pass `--pyannote-model DIR` to select a model directory. Vast.ai receives the model files, not Hugging Face credentials.
Assign recording-wide speaker IDs with Whisper and pyannote
Some checks failed
ci/crow/pr/build Pipeline failed
adaab19fef
Previously, VibeVoice labeled speakers independently in each chunk, so
one voice could receive different labels throughout the same meeting.

Both transcription commands now use faster-whisper large-v3 to time
words and pyannote Community-1 to identify speakers across the full
recording. The final transcript uses integer IDs and leaves ambiguous
speech unlabeled. Resume interrupted Whisper jobs from word checkpoints.

Stage the authorized Community-1 model files for Vast.ai without
forwarding Hugging Face credentials. Remove VibeVoice's model controls
and packaging, and document the new model setup and checkpoint format.

AI-Model: openai/gpt-6.2-sol-fast
AI-Model: openai/gpt-6-luna
mike-bot changed title from Assign recording-wide speaker IDs with Whisper and pyannote to WIP: Assign recording-wide speaker IDs with Whisper and pyannote 2026-11-24 18:42:50 -05:00
Accept faster-whisper's NumPy timestamps and scores
All checks were successful
ci/crow/pr/build Pipeline was successful
ca3b4b037e
Whisper's alignment code returns NumPy scalars, which the transcript
validator rejected. Convert them to Python floats at the model boundary.
Assign IDs in the order speakers appear in the transcript so detected
voices with no assigned text do not consume IDs.

In the cloud test, mock only the rental retry clock so the SSH child's
process wait can sleep without failing the test on slower hosts.

AI-Model: openai/gpt-6.2-sol-fast
Preserve each Whisper word's confidence in the final transcript
All checks were successful
ci/crow/pr/build Pipeline was successful
9d3fe4b5b8
Previously, grouping words by speaker averaged their scores, so callers
couldn't identify the low-confidence words within an entry.

Both transcription commands now keep the original words, timestamps and
confidence scores in each entry's words array. Keep the entry-level text
and speaker label for readers and don't report an aggregate confidence.

Match the Vast driver filter to the worker's CUDA 12.9 runtime.

AI-Model: openai/gpt-6.2-sol-fast
AI-Model: openai/gpt-6-luna
Allow more time to download word-level cloud transcripts
All checks were successful
ci/crow/pr/build Pipeline was successful
9688c1f129
The final JSON now contains the word timings and scores from every
checkpoint. Give this larger result up to a minute to download, without
changing the limits for checkpoint sync. Write the speaker and text
before the word details for readability.

AI-Model: openai/gpt-6.2-sol-fast
mike-bot changed title from WIP: Assign recording-wide speaker IDs with Whisper and pyannote to Assign recording-wide speaker IDs with Whisper and pyannote 2026-11-24 18:59:21 -05:00
Document model setup and checkpoint behavior in the README
All checks were successful
ci/crow/pr/build Pipeline was successful
2876a8f24e
AI-Model: openai/gpt-6.2-sol-fast
Select the pyannote model directory from the command line
All checks were successful
ci/crow/pr/build Pipeline was successful
7f5e3b5880
Both commands now read the model from ./data/models/ by default and
accept --pyannote-model to select a different directory. Validate the
files before converting the recording or renting a cloud GPU. Pass the
staged model directory to the Vast worker with the same flag.

AI-Model: openai/gpt-6.2-sol-fast
Download Community-1 with the Hugging Face CLI in the Nix dev shell
All checks were successful
ci/crow/pr/build Pipeline was successful
6ede6b6f09
Use the packaged CLI instead of requiring a separate installation or
interactive login. The model download still requires an authorized token.

AI-Model: openai/gpt-6.2-sol-fast
Run download-pyannote-model with a destination directory to fetch the
pinned Community-1 model. Read HF_TOKEN from the environment without
putting it on the download command line.

AI-Model: openai/gpt-6.2-sol-fast
Show how to set HF_TOKEN from the host secret file
All checks were successful
ci/crow/pr/build Pipeline was successful
5cc5b8383e
AI-Model: openai/gpt-6.2-sol-fast
Save raw pyannote speaker turns alongside transcripts
All checks were successful
ci/crow/pr/build Pipeline was successful
f66aa01fb9
Both commands now write a diarization file under intermediate/ with the
original timing and speaker labels, including overlapping turns. Include
only the original labels that received an integer ID in the transcript's
speaker mapping. Keep this output separate from the Whisper checkpoints
and validate both results before installing them from a Vast worker.

AI-Model: openai/gpt-6.2-sol-fast
AI-Model: openai/gpt-6-luna
Keep expected pyannote startup warnings out of transcription logs
All checks were successful
ci/crow/pr/build Pipeline was successful
a8b3c4e67e
Disable TF32 before pyannote runs on CUDA, matching the precision policy
it would otherwise apply itself. The speaker model's minimum-length
probe tries single-frame inputs, so suppress its pooling warning only
while computing and caching that limit. Leave warnings during actual
diarization visible.

Describe Whisper startup as loading weights, not downloading them.

AI-Model: openai/gpt-6.2-sol-fast
Write raw speaker turns in the main transcript JSON
All checks were successful
ci/crow/pr/build Pipeline was successful
f12f373792
Store the transcript entries and the original pyannote turns in one
recording result. Validate and replace the two sections together, and
leave the format and location of resumable Whisper checkpoints unchanged.

AI-Model: openai/gpt-6.2-sol-fast
Previously, Whisper large-v3 used float16 on both local and cloud GPUs.
Local transcription failed with `CUDA failed with error out of memory`
on an 8 GiB RTX 4060 even with five-minute chunks.

Local CUDA runs now use int8_float16 to reduce VRAM use. Cloud workers
keep float16, and local CPU runs keep int8.

To verify on the affected GPU, retry the recording with
`--max-segment-minutes 5` and confirm it completes without a CUDA OOM.

AI-Model: openai/gpt-6.2-sol-fast
Transcribe English meetings without a hotword prompt
All checks were successful
ci/crow/pr/build Pipeline was successful
654f88dcea
Whisper used the entire local name list in each decoding window and
inferred the language separately for every chunk. The hotwords competed
with previous text and new speech for decoder space.

Transcribe English without the hotword list. Use a new checkpoint suffix
so local and cloud runs don't reuse words produced with the old prompt.
Report when a damaged checkpoint needs to be regenerated.

Run diarization without poking pyannote's private embedding object.
Normalize diarization timestamps and validate checkpoint words separately
from completed transcripts. Leave ambiguous speaker assignments unlabeled.

On a 90-second public meeting excerpt, both pinned models ran on CPU.
The new transcript retained a short announcement omitted by the old
configuration. This comparison does not measure name accuracy or CUDA
precision differences.

AI-Model: openai/gpt-6.2-sol-fast
AI-Model: anthropic/claude-fable-5-2
Keep readable transcript text above word details
All checks were successful
ci/crow/pr/build Pipeline was successful
f1b32727fc
The entry grouping cleanup moved the word array ahead of the speaker and
text. Keep the useful summary first in the indented JSON for local and
cloud transcripts, without changing the entry's data.

AI-Model: openai/gpt-6.2-sol-fast
AI-Model: anthropic/claude-fable-5-2
Previously, transcript entries repeated text and time bounds from their words, and each diarization turn repeated its original speaker label.

Local and cloud outputs now let readers derive entry text and bounds from the words. Both the transcript and diarization turns use integer IDs that index the original labels, including labels that never match a word. The Easthampton School Committee sample is 7.6% smaller and expands to the original data.

Readers of the final JSON must switch to the new schema. Existing output files and reusable Whisper checkpoints do not change.

AI-Model: openai/gpt-6.2-sol-fast
AI-Model: openai/gpt-6-luna-fast#low
Assign a speaker to every transcript segment
All checks were successful
ci/crow/pr/build Pipeline was successful
ca517f3f22
Previously, the app omitted a speaker when no single diarization turn
covered most of a word or when multiple voices met that threshold. This
left 631 segments unlabeled in the Easthampton School Committee sample.

Local and cloud runs now use pyannote's exclusive timeline to assign
words before grouping them. Regular turns, nearby turns, and nearby
unambiguous words cover gaps and ties. If pyannote detects no speakers,
entries use a recording-local UNKNOWN label rather than inventing a turn.

Every entry in the compact output from 262d443 now requires a speaker
index. The JSON saves both timelines under the same label table so
readers can inspect the evidence behind the assignments. Existing
Whisper checkpoints still work without another transcription pass.

AI-Model: openai/gpt-6.2-sol-fast
AI-Model: openai/gpt-6-luna-fast#low
Record how each word matches its speaker in transcript JSON
All checks were successful
ci/crow/pr/build Pipeline was successful
d700ab41f0
Previously, the run log reported match methods only as recording-wide totals. Readers could not tell which words needed a fallback, even if they knew how many did.

Each word in the final JSON now carries a speaker_match_method. Words can share a transcript segment while retaining different methods. Whisper checkpoints stay unchanged, and the method describes the evidence used, not a confidence score.

AI-Model: openai/gpt-6.2-sol-fast
Keep the README focused on running and resuming transcription
All checks were successful
ci/crow/pr/build Pipeline was successful
4c555826ad
Document the JSON schema and speaker matching rules next to the code that
writes the recording. Output and checkpoint behavior are unchanged.

AI-Model: openai/gpt-6.2-sol-fast
mike merged commit 57f0f76126 into master 2026-11-24 21:30:07 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
oe/transcribe-meetings!18
No description provided.