Paragraphs

Updated at:

This document provides technical guidance for developers on integrating the paragraph read-aloud speech assessment feature.

Assessment type description

  • Scores English paragraphs and provides real-time feedback.

  • Feedback dimensions include overall pronunciation score, accuracy, integrity, and fluency.

Assessment request parameters

Field

Type

Optional

Description

coreType

string

Required

en.pred.score indicates English paragraph reading.

refText

string

Required

The reference text for scoring, which can include punctuation marks.
For example, "I want to know the past and present of Hong Kong." Symbol description
There are two ways to specify a custom pronunciation:
1. directory(z:d ih 'r eh k tr ih): The phonetic transcription follows the internal phonetic standards of the DPI engine.
2. directory(p:dəˈrektəri): The pronunciation is specified using the original phonetic symbols. If the original phonetic symbols map to multiple standards, the standards are processed in the following order of priority: IP88 > KK > IP66.




attachAudioUrl

int

Optional

Specifies whether to return the audio URL in the assessment result.
0: No.
1: Yes.

rank

int

Optional

The scoring scale. You can set this to any value. The final score is recalculated based on its ratio to 100.

precision

double

Optional

The scoring precision. Valid values are 0.1, 0.5, and 1. The default value is 1. If you set this to a value other than 0.1 or 0.5, it is processed as 1.

symbol

int

Optional

If a word is preceded by multiple consecutive punctuation marks, only the first one is displayed. If a word is followed by multiple consecutive punctuation marks, only the three closest to the word are returned. Valid values are 0 and 1. The default value is 0, which disables this feature.

typeThres

int

Optional

The scoring strictness. A higher value has less impact on the score. 1: Strict. 2: Loose. 3: Very Strict. 4: Very Loose. The default value is 0, which disables this feature.

feedback

int

Optional

1: Enables real-time feedback, which provides the text position corresponding to the current audio being read. 0: The default value, which disables this feature.

accent

string

Optional

"accent":"en" specifies a British English pronunciation assessment.
"accent":"am" specifies an American English pronunciation assessment.

Parameter example

{
    "coreType": "en.pred.score",
    "refText": "Learning another language may seem more challenge than it's worth. The advantages of knowing another language, however, make it well worth the hard work. A foreign language is a window into another culture. It expresses the way people in that society think and view the world. To know another language is thus to view life through new lens. Knowing another language also provides access to different ways of dealing with problems common to us all. It is also an advantage in the business world, where multinational partners are becoming more common. Finally, understanding a different language enables you to look at your own culture from a fresh perspective.",
    "rank": 100,
    "precision": 0.5,
    "attachAudioUrl":1
}

Example response

{
    "applicationId": "axxx",    // The authorized assessment account, which is the AppKey.
    "tokenId": "59b0ff9796ddf81da4000001",    // The unique ID of the user request.
    "recordId": "11e793a4881333c4974ca120320158d",   // The unique ID of the audio file.
    "dtLastResponse": "2021-08-05 16:14:24:21",   // The timestamp of the cloud response.
    "result": {                    // The assessment result node.
        "fluency": 81,          // The fluency score.
        "pron": 77,              // The pronunciation score, which is the same as the accuracy score.
        "version": "0.0.80.2021.5.28.13:23:19",  // The version of the DPI engine, including the release time.
        "wavetime": 49990,       // The audio duration in ms.
        "rank": 100,           // The scoring scale. You can set this to any value in the request. The final score is recalculated based on its ratio to 100.
        "res": "eng.snt.online.1.0",   // The resource version.
        "delaytime": 81,         // The time taken by the cloud from the end of audio feeding to result retrieval, in ms.
        "integrity": 81,         // The integrity score.
        "overall": 77,           // The overall score.
        "systime": 11423,    // The total time taken for the entire assessment process, in ms.
        "pretime": 165,         // The time taken by the cloud to call the Start API, in ms.
        "accuracy": 77,         // The pronunciation score, which is the same as the accuracy score.
        "details": [            // The node for sentence score details.
            {
                "fluency": {     // The node for sentence fluency feedback.
                    "pause": 2,    // The number of pauses.
                    "overall": 71,  // The sentence fluency score.
                    "speed": 2      // The sentence speech rate. 0: Slow. 1: Normal. 2: Fast. The default is 0. The value is also 0 for missed words.
                },
                "snt_details": [   // The node for word score details in the sentence.
                    {
                        "char": "Learning",  // The word text.
                        "score": 42           // The word pronunciation score.
                    },
                    ......
                    {
                        "char": "worth",
                        "score": 68
                    }
                ],
                "score": 57,            // The sentence pronunciation score.
                "text": "Learning another language may seem more challenge than it's worth"
            },
            {
                "fluency": {
                    "pause": 0,
                    "overall": 87,
                    "speed": 1
                },
                "snt_details": [
                    {
                        "char": "The",
                        "score": 94
                    },
                    ......
                    {
                        "char": "language",
                        "score": 88
                    }
                ],
                "score": 70,
                "text": "The advantages of knowing another language"
            }
......
        ],
        "precision": 1,   // The scoring precision set in the request. Valid values are 0.1, 0.5, and 1. The default value is 1. If you set this to a value other than 0.1 or 0.5, it is processed as 1.
        "info": {
            "volume": 54,    // The recording volume. Range: 0 dB to 180 dB.
            "clip": 0,          // Audio clipping occurred because the volume was too high. Range: 0 to 1. If this parameter affects the score, a corresponding tipId is set.
            "snr": 12.811419,  // The signal-to-noise ratio (SNR). A higher value indicates clearer audio. Range: 0 dB to 40 dB. If this parameter affects the score, a corresponding tipId is set.
            "tipId": 10004     // The audio quality. For more information, see the tipId description table.
        }
    }, 
    "eof": 1,     // 0 indicates that the response is not complete and more results will follow. 1 indicates that all results for this assessment have been returned.

    "params": {
        "app": {
            "timestamp": "1504772030",
            "sig": "d2d96b467ab7b6d110335478516c4f2f3f181687",
           "applicationId": "aXXX",
            "userId": "ssound_text",
            "clientId": "000c2933841a"
        },
        "request": {                // The scoring request node.
            "coreType": "en.pred.score",
            "tokenId": "59b0ff9796ddf81da4000001",
            "refText": "Learning another language may seem more challenge than it's worth. The advantages of knowing another language, however, make it well worth the hard work. A foreign language is a window into another culture. It expresses the way people in that society think and view the world. To know another language is thus to view life through new lens. Knowing another  language also provides access to different ways of dealing with problems common to us all. It is also an advantage in the business world, where multinational partners are becoming more common. Finally, understanding a different language enables you to look at your own culture from a fresh perspective.",
            "rank": 100,
            "precision": 1
        },
        "audio": {    // The audio parameter node for the scoring request.
            "sampleRate": 16000,
            "channel": 1,
            "sampleBytes": 2,
            "audioType": "ogg"  
        }
    },
    "refText": "Learning another language may seem more challenge than it's worth. The advantages of knowing another language, however, make it well worth the hard work. A foreign language is a window into another culture. It expresses the way people in that society think and view the world. To know another language is thus to view life through new lens. Knowing another  language also provides access to different ways of dealing with problems common to us all. It is also an advantage in the business world, where multinational partners are becoming more common. Finally, understanding a different language enables you to look at your own culture from a fresh perspective."
}

Response description

Key

Type

Description

Usage suggestion

recordId

string

The unique ID of the audio file.

For reference.

tokenId

string

The unique ID of the user request.

For reference.

applicationId

string

The authorized assessment account, which is the AppKey.

For reference.

audioUrl

string

The URL of the user's audio. By default, it is stored in the cloud for one month. Save it to your product server for long-term storage.

For reference.

dtLastResponse

string

The timestamp of the cloud response.

Internal parameter.

eof

int

0 indicates that the response is not complete and more results will follow. 1 indicates that all results for this assessment have been returned.

Internal parameter.

refText

string

The assessment text that was passed in.

For reference.

params

object

- app

object

- - applicationId

string

The authorized assessment account, which is the AppKey.

- - userId

string

A custom string. Use a unique userId for each user.

- - timestamp

string

The start time.

- - sig

string

The verification code.

- request

object

See the "Parameter description" section in this topic.

- audio

object

result

object

The assessment result.

- version

string

The engine version and its publication date

Internal parameter.

- rank

int

The scoring scale.

Internal parameter.

- precision

float

The scoring precision.

Internal parameter.

- res

string

The name of the resource used for this assessment type.

Internal parameter.

- pretime

int

The time taken by the cloud to call the Start API, in ms.

Internal parameter.

- systime

int

The total time taken for the entire assessment process, in ms.

Internal parameter.

- delaytime

int

The time taken by the cloud from the end of audio feeding to result retrieval, in ms.

Internal parameter.

- wavetime

int

The audio duration in ms.

For reference.

- overall

float

The overall score.

Recommended field.

- pron

float

The pronunciation score.

Internal parameter.

- integrity

float

The integrity score.

Recommended field.

- fluency

float

The fluency score.

Recommended field.

- accuracy

float

The pronunciation score (same as the pron field).

Recommended field.

-realtime_details

array

Real-time feedback information.

-- char

string

The word.

For reference.

-- dp_type

int

0: Read normally. 1: Missed or not read. 2: Repeated.

For reference.

- details

array

Score details for each sentence in the paragraph.

Recommended field.

- - score

float

The sentence pronunciation score.

Recommended field.

- - text

string

The sentence text.

For reference.

- - fluency

object

The fluency score. If the integrity score is 0, the fluency score is also 0.

Recommended field.

- - - overall

float

The overall fluency score (0–100).

Recommended field.

- - - pause

int

The number of pauses.

For reference.

- - - speed

int

The speech rate. 0: Slow. 1: Normal. 2: Fast. The default is 0. The value is also 0 for missed words.

For reference.

- - snt_details

array

Score details for the sentence.

For reference.

- - - accent

string

This field is not returned if accent is configured in the request parameters. Otherwise, "accent":"ea" is returned.

- - - char

string

Each word in the sentence.

For reference.

- - - fake_pron

int

This field is returned only for out-of-vocabulary (OOV) words. To assess OOV words, pass their phonetic transcription in the refText parameter.

- - - score

int

The score for each word in the sentence (0–100).

For reference.

- - - is_pause

int

A pause marker.
If a pause occurs at a word in the sentence, the JSON field for that word includes "is_pause": 1. This field is not present under normal circumstances.

For reference.

- - - dp_type

int

Indicates if a word was read normally (dp_type field is not returned), missed (1), or repeated (2).
Normal: This field is not returned. Missed word: dp_type is 1. Repeated word: dp_type is 2.

For reference.

- info

object

- - snr

float

The signal-to-noise ratio (SNR). A higher value indicates clearer audio. Range: 0 dB to 40 dB. If this parameter affects the score, a corresponding tipId is set.

For reference.

- - clip

float

Audio clipping occurred because the volume was too high. Range: 0 to 1. If this parameter affects the score, a corresponding tipId is set.

Internal parameter.

- - volume

int

The recording volume. Range: 0 dB to 180 dB.

For reference.

- - tipId

int

The audio quality.

Recommended field.
For more information, see tipId message description.

Suggestions for displaying assessment results

Dimension

Description

Details

overall

Overall pronunciation score

An overall evaluation of the pronunciation for the entire paragraph.

pron

Accuracy

An evaluation of the pronunciation of sentences in the entire paragraph.

integrity

Integrity

Evaluates how completely the recorded content matches the reference text. It only assesses whether the text was read in its entirety.

fluency.overall

Fluency

Evaluates the fluency of the recording, regardless of the content read.

details[i].score

Sentence score

An evaluation of the pronunciation for each sentence. Check for null values before retrieving.

details[i] .snt_details[n].dp_type

Word insertion/omission

Indicates whether a word was repeated or missed. See the response description for the corresponding assessment type.

Response for a failed assessment

  • If the result structure in the response is empty, the assessment failed.

  • You can retrieve the errId and error from the response. Your product can then perform further checks and handle the error based on the error code.

Error codes