Single character
This document provides technical specifications for the read-aloud assessment of Chinese single characters, words, and idioms. It is intended for developers during product integration.
Description
Supports read-aloud assessment for characters, words, and idioms, including polyphonic characters.
Returns the overall score, the score for each character, the initial and final scores for each pinyin, the tone score, and the URL of the user's audio.
Assessment request parameters
Field | Type | Optional | Description |
coreType | String | Required | cn.word.score indicates a Chinese single-character assessment. |
refText | String | Required | Scoring reference: To count (shu3) |
rank | int | Optional | The scoring scale. The final score is rescaled to a 100-point system. You can set this to any integer. |
precision | double | Optional | Scoring precision. Valid values are 0.1, 0.5, and 1. The default is 1. |
attachAudioUrl | int | Optional | Specifies whether to return the audio URL in the assessment result. |
outputPhones | int | Optional | Specifies whether the output includes scores for the initials and finals of each character. The default value is 1.1: The returned initial and final characters require mapping to correspond to the actual phonemes.2: The actual initial and final information is returned.For example, if outputPhones is 1: {"chn_char":"you","char":"you","phn":0,"overall":0,"pron":0,"tone":3,"tonescore":0,"confidence":[0,0,0,0,0],"score":0,"dp_type":1,"start":0,"end":0,"dur":0,"fluency":0,"phone":[{"char":"ii","score":0},{"char":"iu","score":0}]}If outputPhones is 2: {"chn_char":"you","char":"you","phn":0,"overall":0,"pron":0,"tone":3,"tonescore":0,"confidence":[0,0,0,0,0],"score":0,"dp_type":1,"start":0,"end":0,"dur":0,"fluency":0,"phone":[{"char":"y","score":0},{"char":"ou","score":0}]} |
symbol | int | Optional | If multiple consecutive punctuation marks precede a character, only the first is displayed. If multiple consecutive punctuation marks follow a character, only the three closest to the character are output. Valid values are 0 and 1. The default is 0, which disables this feature. |
typeThres | int | Optional | Scoring strictness. A higher value has less impact on the score.1: Strict2: Loose3: Very Strict4: Very Loose0: Default (feature disabled) |
use_cws | int | Optional | Enables the Chinese word segmentation (CWS) feature for better support of polyphonic characters and numbers. Valid values are 0 and 1. The default is 0, which disables this feature. |
Parameter example
{
"coreType": "en.word.score",
"refText": "number",
"rank": 100,
"precision": 1,
"outputPhones":1,
"attachAudioUrl":1
}
Example response
{
"tokenId": "6124bfae88bf5b0000010001", // The unique ID of the user request
"applicationId": "a148", // The authorized AppKey
"dtLastResponse": "2021-08-24 17:45:20:300",
"audioUrl": "http:\/\/files.cloud.ssapi.cn:8080\/a148\/11ec01828d53e9a1808aa148v2618ae7", // The user's audio URL
"connect": { // Internal parameter node. You can ignore this.
"param": {
"app": {
"timestamp": "1629798318",
"applicationId": "a148",
"sig": "bbce9709c2315ba2feddef73de75f4aa2f1b726a"
},
"sdk": {
"os": "6.2(9200)1",
"product": "",
"source": 7,
"protocol": 1,
"os_version": "6.2(9200)",
"arch": "586",
"version": 16778752
}
},
"cmd": "connect"
},
"params": {
"app": { // Internal parameter node. You can ignore this.
"timestamp": "1629798318",
"userId": "ssound_text",
"sig": "bbce9709c2315ba2feddef73de75f4aa2f1b726a",
"connect_id": "6124bfae88bf5b0000030002",
"clientId": "",
"applicationId": "a148"
},
"audio": { // Audio parameter node
"sampleBytes": 2, // Bytes per sample. Supports 1 or 2 bytes.
"audioType": "ogg", // Audio format type
"sampleRate": 16000, // Sample rate
"channel": 1 // Mono channel. The assessment only supports mono.
},
"request": { // Scoring request. Parameters passed in by the client.
"request_id": "6124bfae88bf5b0000020001",
"tokenId": "6124bfae88bf5b0000010001",
"rank": 100,
"precision": 1,
"coreType": "cn.word.score", // Question type
"refText": "shu(shu3)", // Assessment text
"rank": 100,
"precision": 1,
"outputPhones":1,
"attachAudioUrl":1
}
},
"recordId": "11ec04bffc5c410d8ceca148c2619a1a",
"refText": "shu(shu3)",
"result": {
"overall": 67, // Overall score
"wavetime": 1990, // Audio duration in ms
"precision": 1, // The scoring precision set in the assessment request. Only 0.1, 0.5, or 1 is supported. The default is 1. If the value is not 0.1 or 0.5, it is treated as 1.
"forceout": 0,
"phn": 85, // Pronunciation score without tone
"res": "chn.wrd.online.1.0", // The name of the resource used for the assessment
"details": [ // Details for each character
{
"dp_type": 2, // 0: Normal pronunciation (usually not displayed). 1: The word was missed. 2: The word was repeated. 3: This character is not scored and serves as a comment.
"pron": 67, // Pronunciation score
"dur": 300, // Pronunciation duration of the character
"chn_char": "shu", // The assessed Chinese character
"phn": 85,
"confidence": [ // Confidence level. The values represent the probabilities of the character having a neutral, first, second, third, or fourth tone, respectively.
0,
3,
97,
0,
0
],
"overall": 67, // Overall score
"tone": 3, // The tone of a single pinyin, initial, or final. 0 to 4 correspond to neutral, first, second, third, and fourth tones.
"char": "shu", // A single pinyin, initial, or final
"score": 67,
"tonescore": 20, // The tone score of the character
"phone": [ // Detailed scoring information for initials and finals
{
"char": "sh", // Initial or final
"score": 93, // Score for the initial or final
"end": 400,
"start": 260
},
{
"char": "u",
"score": 78,
"end": 410,
"start": 400
}
],
"end": 820,
"start": 520
}
],
"pretime": 6,
"info": {
"tipId": 0,
"clip": 0,
"snr": 31.557388,
"volume": 84
},
"rank": 100,
"delaytime": 49,
"systime": 2528,
"version": "0.0.80.2021.7.24.00:01:28",
"tone": 20,
"pron": 67
},
"eof": 1,
"cloud_platform": {
"origin_audio_length": 7807
}
}Response description
Key | Type | Description | Recommendations |
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 |
dtLastResponse | string | The time when the cloud responded. | Internal parameter |
audioUrl | string | The download URL for the user's audio. | |
eof | int | Internal parameter | |
refText | string | The assessment text that was passed in. | For reference |
params | object | Echoes the assessment request parameters passed in by the client. | |
- app | object | ||
- - applicationId | string | The authorized assessment account, which is the AppKey. | |
- - userId | string | A custom string. We recommend setting a unique string for each user to help with troubleshooting. | |
- - timestamp | string | Start time. | |
- - sig | string | Verification code. | |
- request | object | ||
- - coreType | string | The question type used. | |
- - tokenId | string | The unique ID of the user request. | |
- - refText | string | Reference text for scoring. | |
- audio | object | ||
- - sampleRate | int | Sample rate. | |
- - channel | int | Sound channel. | |
- - sampleBytes | int | Bytes per sample. Supports 1 or 2 bytes. | |
- - audioType | string | Audio format. | |
result | object | Assessment result. | |
- version | string | The engine version, including the release date. | Internal parameter |
- rank | int | Scoring scale. | Internal parameter |
- res | string | The name of the resource used for this assessment type. | Internal parameter |
- forceout | int | Internal parameter | |
- pretime | int | The time taken by the cloud to call the Start API, in ms. | Internal parameter |
- delaytime | int | The time from when the cloud finishes feeding the audio to when it gets the result, in ms. | Internal parameter |
- systime | int | The total time for the entire assessment process, in ms. | |
- wavetime | int | Audio duration, in ms. | For reference |
- overall | float | Overall score. | Recommended field |
- tone | float | Sentence intonation score (0-100). | |
- pron | float | Character pronunciation score. | |
- phn | float | Phoneme pronunciation score. | |
- precision | float | Scoring precision. | |
- details | array | ||
- - pron | int | Pronunciation score with tone. | For reference |
- - confidence | array | Confidence level. | The values represent the probabilities of the character having a neutral, first, second, third, or fourth tone, respectively. |
- - dur | int | Indicates the end time of a word in the audio, in milliseconds (ms). | |
- - chn_char | string | Single character. | |
- - phn | int | Pronunciation score without tone. | |
- - overall | int | Overall score for the character. | |
- - tone | int | The tone corresponding to the character. | 0 to 4 correspond to neutral, first, second, third, and fourth tones. |
- - char | string | The pinyin corresponding to the character. | |
- - tonescore | int | The tone score of the character. | |
- - end | int | The duration of each word, in milliseconds (ms). | |
- - start | int | The start time of the character in the audio, in milliseconds (ms). | |
- - dp_type | int | Indicates insertions or omissions. | 0: Normal pronunciation (usually not displayed). 1: The word was missed. 2: The word was repeated. 3: This character is not scored and serves as a comment. |
- - phone | array | Detailed scoring information for initials and finals. | |
- - - char | string | Initial or final. | For reference |
- - - score | int | Score for the initial or final. | For reference |
- info | object | ||
- - snr | float | Signal-to-noise ratio (SNR). | For reference |
- - clip | float | Internal parameter | |
- - volume | int | Recording volume. | For reference |
- - tipId | int | Audio quality. | Recommended field |
Key response fields
Dimension | Description | Details |
overall | Overall score for the character. | The overall score for the character. |
pron | Pronunciation score. | |
details.score | Character score. | The score for a specific character. Check if it is empty before retrieving. |
details.phn | Pronunciation score without tone. | |
details.phone.score | Initial and final score. | The score for the initials and finals corresponding to the character. |
Response for a failed assessment
If the result structure in the response is empty, the assessment failed.
Retrieve the errId and error from the response. Use the error code to determine the next steps.
Error codes
For more information, see Assessment error codes.