Skip to main content

Module bench

Module bench 

Source
Expand description

The speaking bench: synthesize a corpus’s transcripts, transcribe them back through a caller-supplied recognizer, and score the round trip with its first-audio time, realtime factor and the resident set it needed.

The recognizer is a parameter because this crate is a leaf and owns no model of the other direction.

Re-exportsΒ§

use std::sync::Arc; πŸ”’
use std::sync::atomic::AtomicBool; πŸ”’
use std::sync::atomic::AtomicU64; πŸ”’
use std::sync::atomic::Ordering; πŸ”’
use std::time::Duration; πŸ”’
use std::time::Instant; πŸ”’
use sysinfo::Pid; πŸ”’
use sysinfo::ProcessesToUpdate; πŸ”’
use sysinfo::System; πŸ”’
use crate::Engine; πŸ”’
use crate::Error; πŸ”’
use crate::SpeakRequest; πŸ”’

StructsΒ§

BenchClip
One clip to score: the words to say.
PeakRss πŸ”’
A resident-set sampler that runs beside the bench for its duration.
TtsBenchResult
What one run measured.

FunctionsΒ§

edits πŸ”’
Word-level Levenshtein distance: the edits between two word sequences.
ratio πŸ”’
Edits over the truth’s own words; a truth with no words is no error rather than a division by zero.
resident_bytes πŸ”’
This process’s resident set, in bytes; zero where the platform will not answer.
run
Synthesize every transcript, transcribe the audio back, and score it.
words πŸ”’
A string’s words: lowercased, split on anything that is not a letter or a digit, blanks dropped.