speaker_helper.eval.priors module

Quality priors and Pareto selection for choosing an engine.

Module summary

Two ideas make engine choice operational:

  1. A quality axis even without a reference. When no transcriber is wired in, fidelity is estimated from per-engine priors — order-of-magnitude scores in [0, 1], recalibrated from real runs. This keeps every evaluation reporting both speed and quality.

  2. Pareto selection. To pick an engine/voice you want the non-dominated set on the quality↔RTF plane — high quality and fast. pareto_front() extracts it.

Together these turn a batch of EvalReport (one per engine) into an actionable “which engine should I ship?” answer.

Usage example

>>> from speaker_helper.eval.priors import engine_quality_prior
>>> engine_quality_prior("kokoro")
0.75

Author

Warith HARCHAOUI — https://linkedin.com/in/warith-harchaoui

speaker_helper.eval.priors.engine_quality_prior(engine)[source]

Return the prior quality score in [0, 1] for a TTS engine.

Parameters:

engine (str) – Engine id (e.g. "kokoro").

Returns:

The inherited prior, or 0.80 for an unknown engine.

Return type:

float

speaker_helper.eval.priors.pareto_front(points)[source]

Return the non-dominated points: maximise quality, minimise RTF.

A point A dominates B if A is at least as good on both axes (higher or equal quality, lower or equal mean_rtf) and strictly better on one.

Parameters:

points (sequence) – Candidates, each exposing quality and mean_rtf (e.g. EvalReport).

Returns:

The Pareto-optimal subset, in input order.

Return type:

list