speaker_helper.eardrum.report module

The report: every take, side by side, for the ear that has the last word.

Module summary

The loop’s scores point; they do not decide. The report puts, for every word, the target pronunciation, each attempt with its score and what the recogniser heard, and the audio — the whole carrier sentence and the word cut out of it — so whoever owns the voice can listen and overrule. Three files:

  • index.html — self-contained, plays the clips in place;

  • report.json — the same, for scripts;

  • report.md — a summary table for a terminal or a commit message.

Usage example

>>> verdict_label("fixed")
'corrigé'

Author

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

speaker_helper.eardrum.report.label(code)[source]

The French label of a reason, origin or source code.

Parameters:

code (str) – A code from the loop ("proper", "written", "builtin"…).

Returns:

Its label, or the code itself when unknown.

Return type:

str

Examples

>>> label("proper"), label("zzz")
('nom propre', 'zzz')
speaker_helper.eardrum.report.render_html(results, meta)[source]

The self-contained HTML report.

Parameters:
  • results (list of WordResult) – One per word.

  • meta (dict) – engine, language, threshold, date, saved_to.

Returns:

A complete HTML document.

Return type:

str

speaker_helper.eardrum.report.render_markdown(results, meta)[source]

A summary table in Markdown.

Parameters:
Returns:

Markdown.

Return type:

str

speaker_helper.eardrum.report.render_prosody_html(results, meta)[source]

The prosody report: per segment, what the text asks, what the voice did.

Parameters:
Returns:

A complete HTML document.

Return type:

str

speaker_helper.eardrum.report.verdict_label(verdict)[source]

The human label of a verdict.

Parameters:

verdict (str) – A WordResult verdict.

Returns:

The French label, or the verdict itself when unknown.

Return type:

str

speaker_helper.eardrum.report.write_prosody_report(out_dir, results, meta)[source]

Write index.html and report.json for a prosody run.

Parameters:
  • out_dir (Path) – The run’s directory.

  • results (list of ExpressionResult) – One per segment.

  • meta (dict) – Run metadata (with agreement).

Returns:

The HTML report’s path.

Return type:

Path

speaker_helper.eardrum.report.write_report(out_dir, results, meta)[source]

Write index.html, report.json and report.md.

Parameters:
  • out_dir (Path) – The run’s directory (audio already inside).

  • results (list of WordResult) – One per word.

  • meta (dict) – Run metadata.

Returns:

The HTML report’s path.

Return type:

Path