Skip to main content

Module der

Module der 

Source
Expand description

Diarization Error Rate (DER) and word-level attribution metrics.

Frame-based DER with forgiveness collar and optimal speaker mapping, plus WDER (Word Diarization Error Rate) for who-said-what evaluation.

Structs§

DerDecomposition
Overlap-aware DER decomposition: the headline DER plus single-speaker- and overlap-region DERs and per-speaker recall.
DerResult
DER evaluation result.
SpeakerRecall
Per-speaker recall: how much of one reference speaker’s speech the mapped hypothesis speaker recovered.
WderResult
Word Diarization Error Rate (WDER) result.

Functions§

compute_der
{ collar >= 0.0 } pub fn compute_der( reference: &SpeakerTurn, hypothesis: &SpeakerTurn, collar: f64, ) -> DerResult { ret.der >= 0.0 && ret.der <= 1.0 } Compute DER between reference and hypothesis annotations.
compute_der_decomposition
{ collar >= 0.0 } pub fn compute_der_decomposition( reference: &SpeakerTurn, hypothesis: &SpeakerTurn, collar: f64, ) -> DerDecomposition { ret.total.der >= 0.0 && ret.total.der <= 1.0 } Compute the overlap-aware DER decomposition (total / single-speaker / overlap DER + per-speaker recall) in one call. Intended for bench artifacts and the long-form AMI gate; the headline path stays on super::compute_der.
compute_der_from_rttm
{ collar >= 0.0 } pub fn compute_der_from_rttm( reference: &[(f64, f64, &str)], hypothesis: &SpeakerTurn, collar: f64, ) -> DerResult { ret.der >= 0.0 && ret.der <= 1.0 } Convenience: compute DER from RTTM segments (string speaker labels).
compute_der_single_speaker_regions
{ collar >= 0.0 } pub fn compute_der_single_speaker_regions( reference: &SpeakerTurn, hypothesis: &SpeakerTurn, collar: f64, ) -> DerResult { ret.der >= 0.0 && ret.der <= 1.0 } Overlap-excluded DER: DER computed only over reference frames where exactly ONE speaker is active.
compute_der_with_uem
{ collar >= 0.0 } pub fn compute_der_with_uem( reference: &SpeakerTurn, hypothesis: &SpeakerTurn, collar: f64, scored: &TimeRange, ) -> DerResult { ret.der >= 0.0 && ret.der <= 1.0 } DER restricted to the UEM (Un-partitioned Evaluation Map) scored regions.
compute_wder
{ true } pub fn compute_wder( reference: &WordAlignment, hypothesis: &WordAlignment, ) -> WderResult { ret.wder >= 0.0 && ret.wder <= 1.0 } Compute Word Diarization Error Rate between reference and hypothesis word alignments.
parse_uem
Parse a UEM (Un-partitioned Evaluation Map) file body into per-file scored regions, keyed by file id. Lines are <file-id> <channel> <start> <end>; blank lines and ;/# comments are skipped, and malformed/degenerate lines are ignored. Pure-Rust and wasm-clean — callers read the file and pass the text here, then feed the per-file Vec<TimeRange> to compute_der_with_uem.