assess_pronunciation
Compare spoken English with the expected text to score pronunciation and pinpoint phoneme substitutions, deletions, insertions, and missed words.
Instructions
Compares the pronounced phonemes with the expected ones for a text read aloud (English).
Args:
audio: audio path or a name returned by record_audio (up to 60 s; short sentences work best).
expected_text: the exact text that was read.
language: "en-US" (default) or "en-GB".
Returns `summary` (overall_score 0–100, words_with_errors, error counts by type,
frequent_confusions expected→detected) and `words`: word, score, t (s) and, when there are
errors, expected/detected in IPA and errors [{type: substitution|deletion|insertion,
expected, detected}]; `missing` when the word was not said. `phonemes` holds both full
sequences. Word score = 100·(1 − (S + D + 0.5·I)/expected phonemes). Allophonic variants
(flap, schwa, linking r) do not count as errors. The text_mismatch warning means a
different text was probably read. Backend: local wav2vec2, or Azure when
VOICE_COACH_PRONUNCIATION_BACKEND=azure (then the audio is sent to Azure).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| audio | Yes | ||
| language | No | en-US | |
| expected_text | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |