Word correction

Updated at:

This document describes how to integrate the English word correction speech evaluation feature.

Question type description

  • Scores each phoneme in an English word and provides feedback on mispronounced phonemes.

Evaluation request parameters

Field

Type

Optional

Description

coreType

String

Required

en.mpd.score indicates English word correction.

refText

String

Required

The reference text for scoring.

rank

int

Optional

The scoring scale. This value can be set arbitrarily. The final score is recalculated as a proportion of 100.

attachAudioUrl

int

Optional

Specifies whether to return the audio URL in the evaluation result.
0: Do not return.
1: Return.

precision

double

Optional

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

Parameter example

{
    "coreType":"en.mpd.score",
    "refText":"hot",
    "rank":100,
    "precision":1,
    "attachAudioUrl":1
}

Response result example

{
    "tokenId": "6126571488bf5b0000090001",
    "applicationId": "a148",
    "audioUrl": "http:\/\/files.cloud.ssapi.cn:8080\/a148\/11ec05b2d06325249b36a148o261e7ba",
    "connect": {
        "param": {
            "app": {
                "timestamp": "1629902612",
                "applicationId": "a148",
                "sig": "c93d876e1038ae3c6cde0bfee24ca64570187188"
            },
            "sdk": {
                "os": "6.2(9200)1",
                "product": "",
                "source": 7,
                "protocol": 1,
                "os_version": "6.2(9200)",
                "arch": "586",
                "version": 16778752
            }
        },
        "cmd": "connect"
    },
    "params": {
        "app": {
            "timestamp": "1629902612",
            "userId": "ssound_text",
            "sig": "c93d876e1038ae3c6cde0bfee24ca64570187188",
            "connect_id": "6126571488bf5b00000b0002",
            "clientId": "",
            "applicationId": "a148"
        },
        "audio": {
            "sampleBytes": 2,
            "audioType": "ogg",
            "sampleRate": 16000,
            "channel": 1
        },
        "request": {
            "request_id": "6126571488bf5b00000a0001",
            "tokenId": "6126571488bf5b0000090001",
            "precision": 1,
            "attachAudioUrl": 1,
            "refText": "hot",
            "coreType": "en.mpd.score",
            "rank": 100
        }
    },
    "recordId": "11ec05b2d06325249b36a148o261e7ba",
    "refText": "hot",
    "dtLastResponse": "2021-08-25 22:43:32:490",
    "cloud_platform": {
        "origin_audio_length": 7807
    },
    "result": {
        "accent": "am",
        "wavetime": 1990,
        "precision": 1,
        "systime": 1814,
        "rec": "hh aa t",
        "version": "0.0.80.2021.7.24.00:01:28",
        "rank": 100,
        "info": {
            "tipId": 10004,
            "clip": 0,
            "snr": 17.149954,
            "volume": 77
        },
        "delaytime": 19,
        "phone_str": "hh aa t",
        "res": "eng.mpd.online.0.2",
        "details": [
            {
                "char": "hh",
                "type": 0
            },
            {
                "char": "aa",
                "type": 0
            },
            {
                "char": "t",
                "type": 0
            }
        ],
        "pretime": 34,
        "overall": 100
    },
    "eof": 1
}

Response result 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

audioUrl

string

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

For reference

applicationId

string

The authorized account, which is the user's AppKey.

Internal parameter

dtLastResponse

string

The timestamp of the cloud response.

Internal parameter

eof

int

0: The response is not complete. More results will follow. 1: All results for this evaluation have been returned.

Internal parameter

refText

string

The input text for evaluation.

For reference

params

object

Echoes the evaluation request parameters sent by the client.

- app

object

- - applicationId

string

The authorized account, which is the provided evaluation AppKey.

- - userId

string

The user ID from your product. This can be a custom string. Use a unique ID for each user to make troubleshooting easier.

- - timestamp

string

The start time.

- - sig

string

The verification code.

- request

object

The node for scoring request parameters.

- audio

object

The node for audio parameters in the scoring request.

result

object

The evaluation result.

- version

string

The DPI engine version, including the release 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 evaluation.

Internal parameter

- pretime

int

The time taken by the cloud to call the Start API. Unit: ms.

Internal parameter

- systime

int

The total time taken for the entire evaluation process. Unit: ms.

Internal parameter

- delaytime

int

The time from when the cloud finishes feeding the audio to when it gets the result. Unit: ms.

Internal parameter

- wavetime

int

The duration of the audio. Unit: ms.

For reference

- overall

float

The overall score.

Recommended field

- rec

string

The recognition result.

Internal parameter

-phone_str

string

The phonemes corresponding to the word.

Internal parameter

- details

array

- - char

string

The recognized phoneme.

For reference

- - type

int

0: Normal (the recognized phoneme matches the expected phoneme). 1: Insertion. 2: Deletion. 3: Substitution.

For reference

Suggestions for displaying evaluation results

Dimension

Description

Details

overall

Overall score

The overall evaluation score.

Response on evaluation failure

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

  • The response contains the `errId` and `error`. You can use the error code to determine the next steps for your application.

Error codes