Extension Selection
This document provides technical details to help developers integrate the English extended multiple-choice speech assessment feature into their products.
Applicable scenarios:
You can set multiple answer options. A score is awarded only if the correct option is spoken with complete and accurate pronunciation.
Users can provide pronunciations that are not exact matches to the predefined answers. The engine identifies the closest matching answer and scores the pronunciation accordingly.
You can define incorrect answers. If a user provides one of these incorrect answers, it is marked as wrong.
If a user says multiple words or phrases that could be answers, the last one spoken is considered the final answer. For example, if a user says "key unkey", the final answer is "unkey".
Parameter description
Field | Type | Optional | Description |
coreType | String | Required | en.pche.score indicates an English extended multiple-choice question. |
rank | int | Optional | The scoring system for the total score. |
precision | double | Optional | Sets the scoring precision. Supported values are 0.1, 0.5, and 1. The default value is 1. If you set a value other than 0.1 or 0.5, the system processes it as 1. |
pronScale | int | Optional | 1: The total score includes the pronunciation score. The formula is 50% + (50% × pronunciation score). 0: Default. The total score can only be the full score or 0. This field only accepts 0 or 1. |
lm | array | Required | An array of dictionaries that sets the options for the extended multiple-choice question. |
key | array | Required | An array of dictionaries that sets the correct answers. Multiple correct answers are supported. |
unkey | array | Required | An array of dictionaries that sets the incorrect answers. |
phones | object | Optional | Specifies the pronunciation of a word. If a word has multiple pronunciations, separate them with the "|" symbol. Use a space between each phoneme and between phonemes and the syllable separator "-". Example: "phones":{"directory":"d ih - 'r eh k - tr ih|d ax - 'r eh k - t ax - r ih"}; |
attachAudioUrl | int | Optional | Specifies whether to return the audio URL in the assessment result. |
Parameter example
{
"coreType": "en.pche.score",
"rank": 2,
"precision": 0.5,
"attachAudioUrl":1,
"lm": [
{"text": "(Tokyo|Beijing|London)." },
{"text": "Linda is from (Tokyo|Beijing|London)." },
{"text": "Linda comes from (Tokyo|Beijing|London)." },
{"text": "She is from (Tokyo|Beijing|London)." },
{"text": "She comes from (Tokyo|Beijing|London)." }
],
"key": [{ "text": "Tokyo" }],
"unkey": [
{"text": "Beijing"},
{"text": "London"}
]
}Sample response
Response description
Key | Type | Description | Recommendation |
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. | Internal parameter. |
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 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. |
params | object | Echoes the assessment request parameters sent by the client. | |
- app | object | ||
- - applicationId | string | The authorized assessment account, which is the AppKey. | |
- - userId | string | The user ID. A custom string for easier troubleshooting. | |
- - timestamp | string | The start time. | |
- - sig | string | The verification code. | |
- - clientId | string | ||
- request | object | The node for scoring request parameters. | |
- audio | object | The node for audio parameters in the scoring request. | |
result | object | The assessment result. | |
- res | string | The name of the resource used for assessing this question type. | Internal parameter. |
- version | string | The engine version, including the release date. | Internal parameter. |
- rank | int | The scoring system. | Internal parameter. |
- precision | float | The scoring precision. | 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 from when the audio feed ends to when the result is obtained on the cloud, in ms. | Internal parameter. |
- wavetime | int | The duration of the audio, in ms. | For reference. |
- overall | float | The total score. | Recommended field. |
- fake_words | object | (This field is returned only if fake_words exist in the assessment text. Each word has a separate entry.) | |
- -char | string | A word that does not exist in the dictionary. The pronunciation is predicted or forged. | |
- 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 value 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 value is set. | Internal parameter. |
- - volume | int | The recording volume. Range: 0 dB to 180 dB. | For reference. |
- - tipId | int | Audio quality. For more information, see tipId message descriptions. | Recommended field. |
Suggestions for displaying assessment results
Dimension | Description | Details |
overall | Total score | The assessment score for the question type. |
Scoring failure
If the result structure in the response is empty, the assessment has failed. You can retrieve the errId and error from the response and handle the error according to the error code.
Error codes
For more information about error codes, see Assessment error codes.