Speechace
  • Introduction
    • Overview
    • Use-Cases
  • Getting Started
    • Pre-requisites
      • API Features
      • Getting the API Key
      • API Regions and endpoints
      • API Limits
    • API Samples
    • Supported Languages
    • API Versioning
    • Authentication
    • Try the Speechace API
    • Error Handling
      • Common Errors
      • Retry Strategies
  • Solutions
    • Speaking Practice for Language Learning
    • Automated Language Assessment with AI
    • Voice AI for Early Literacy
    • Test Prep for Standardized tests
      • PTE Speaking Questions
      • IELTS Speaking Questions
      • TOEFL Speaking Questions
      • CEFR Speaking Questions
      • TOEIC Speaking Questions
    • Speaking Practice in Spanish and French
  • Features
    • Introduction
    • Scripted activities
      • Pronunciation Scoring
        • Word and Sentence pronunciation
        • Multiple choice
        • Custom pronunciations
        • Phoneme list
      • Fluency scoring
        • Passage scoring
      • Lexical stress and intonation
    • Spontaneous activities
      • Open-ended scoring
        • Language scoring
        • Relevance scoring
        • Language detection
      • Task achievement scoring
        • Describe Image
        • Re-tell Lecture
        • Answer Question
  • API Reference
    • Postman API reference
    • Score Text/Pronunciation
      • Handling overall scores
      • Handling word scores
      • Handling phoneme and syllable scores
    • Score Text/Multiple choice
      • Handling multiple choice response
    • Score Text/Markup Language
      • Handling Markup Response
    • Score Text/Stress & Intonation
      • Handing stress and intonation response
    • Score Text/Phoneme list
      • Handling phoneme list response
    • Score Text/Fluency
      • Handling fluency response
      • Fidelity detection
    • Score Text/Validate Text
    • Score Speech/Open-ended
      • Handling language scores
      • Per metric feedback
        • Grammar metrics
        • Vocabulary metrics
        • Coherence metrics
    • Score Speech/Relevance
      • Handling relevance response
    • Score Speech/Language Detection
    • Score Task/Task Achievement
  • Guides on common topics
    • Intepreting quality score
    • Interpreting overall scores
      • Pronunciation Bands
      • Fluency Bands
      • Vocabulary Bands
      • Grammar Bands
      • Coherence Bands
    • Scoring rubrics
    • Interpreting fidelity class
    • Phonetic notation
      • US English (en-us)
      • UK English (en-gb)
      • French (fr-fr, fr-ca)
      • Spanish (es-es, es-mx)
    • Getting word timestamps in audio
    • Automatic handling of unknown words
    • Phoneme to letter mapping
    • Markup Language
  • Other Resources
    • Requesting Support
    • Rate Limiting
    • Data Retention
    • FAQs
    • Appendices
Powered by GitBook
On this page
  1. Guides on common topics

Phoneme to letter mapping

Some applications may highlight letters in a word where pronunciation errors occurred to help learners visualize their mistakes, especially if they are unfamiliar with phonemes.

For example, if a user mispronounces the /sh/ sound in "shift," the application could display the word with the problematic letters crossed out or color-coded to indicate errors:

Incorrect Example:

**sh**ift (where "sh" is highlighted to show the pronunciation issue)

The Speechace API does not score individual letters; instead, it decomposes each scored word into its phonemes and scores them at the phoneme level.

To identify which letter(s) in a word correspond to a specific phoneme:

  1. Access Phoneme Data:

    • Retrieve phoneme-level scores from the word_score_list[].phone_score_list[] array.

  2. Locate Letter Mapping:

    • For each phoneme, use the phone_score_list[].word_extent[] field to find the character indices within the word that this phoneme maps to. This field contains the [begin, end] character indices.

By checking these indices, the application can map the phoneme to its corresponding letters in the word.

In the above example of the word "shift", the contents of phone_score_list[] would be:

phone
word_extent
letter(s)

sh

[0,2]

sh

ih

[2,3]

i

f

[3,4]

f

t

[4,5]

t

The letters column is built using the character indices specified in word_extent. Notice that a phoneme may correspond to more than one letter. For instance, a phoneme like /sh/ in "shift" covers two letters (e.g., 'sh') as shown above.

There are multiple possibilities of phoneme to letter mapping that the API caller should be prepared for:

Case
word_extent
Example

Phoneme maps to zero letters

[n, n] where the begin and end indices are the same. The value of n depends on the phoneme's position in the word

The word "#" (i.e. hashtag) which is phonetically expanded to ['hh', 'ae', 'sh', 't', 'ae', 'g']

Phoneme maps to 1 letter

[n, n+1]

/f/ in "shift"

Phoneme maps to 2 letters

[n, n+2]

/sh/ in "shift"

2 Phonemes map to 1 letter

Each phoneme will have the same word_extent: [n, n+1] [n, n+1]

letter 'x' in the word "exempt" maps to the phonemes /g/, /z/

2 or more Phonemes map to zero letters

Each phoneme will have the same word_extent: [n, n]

The word "w" which is phonetically expanded to ['d', 'ah', 'b', 'ah', 'l', 'y', 'u', 'w']

No Phoneme to letter mapping available

word_extent field will be missing

Words outside of the Speechace lexicon processed with markup_language or include_unknown_words handling.

PreviousAutomatic handling of unknown wordsNextMarkup Language

Last updated 8 months ago