Expand description
Word→speaker attribution: join raw ASR words to diarization turns.
Pure-Rust and wasm-clean, behind the opt-in attribution feature — no models,
no ort, no I/O. Just interval arithmetic on TimeRange/SpeakerId,
reusing the same overlap definition as der::compute_der.
The join is an O(W+T) two-pointer sweep over time-sorted words and turns (max-overlap tagging, bit-identical to the historical linear scan). Optional extras: missing-timestamp interpolation, sentence-level speaker smoothing, and a configurable word anchor for turn-text placement.
Structs§
- Attribution
Config - Configuration for the word→speaker join.
- Speaker
Embedding - L2-normalized mean embedding for one speaker (opt-in attribution export).
- WhoSaid
What - Result of the who-said-what cascade: ASR words tagged with speakers, plus the
diarization turns with
SpeakerTurn::textfilled from those words.
Enums§
- Word
Anchor - Which point on a word interval is used for turn-text placement.
Functions§
- attribute_
and_ fill - Join raw ASR
wordsto diarizationturns: attribute each word to a speaker (overlap-region words go to the dominant speaker only — seeattribute_words), then fill each turn’s text. Pure — no ASR, no I/O. - attribute_
and_ fill_ with_ config - Like
attribute_and_fillwith an explicitAttributionConfig. - attribute_
words - Attribute each ASR word to a diarization speaker turn, returning a
WordAlignmentper input word in the same order and length. - attribute_
words_ with_ config - Like
attribute_words, but with explicitAttributionConfig. - fill_
turn_ text - Assemble
SpeakerTurn::textfor each turn fromalignedwords. A word belongs to a turn when it was attributed to that turn’s speaker and its midpoint falls within the turn’s span; words are joined in time order. Turns with no words keeptext: None. - fill_
turn_ text_ with_ config - Like
fill_turn_text, but the word point tested for turn membership is selected byconfig.word_anchor. - interpolate_
word_ timestamps - Fill missing/zero-duration word timestamps with nearest-neighbor values.
- speaker_
embeddings_ from_ segments - Average and L2-normalize embeddings per speaker label.
- who_
said_ what - Cascaded who-said-what: run one ASR pass over the whole audio, then join
its word timestamps to the already-computed diarization
turns. - who_
said_ what_ with_ config - Like
who_said_whatwith an explicitAttributionConfig.