Phonetic symbols
This document is for developers who are integrating speech evaluation for tasks that involve reading English phonetic symbols aloud.
Question type description
This feature evaluates and scores English phonetic symbols. The response provides a total score, a pronunciation score, and scores for individual phonemes.
Evaluation request parameters
Field | Type | Optional | Description |
coreType | String | Required | en.alpha.score indicates an English phonetic symbol evaluation. |
refText | String | Required | The reference text for scoring. Only phonetic symbols are supported. To evaluate multiple phonetic symbols, separate them with spaces. |
rank | int | Optional | The scoring scale. You can set this to any value. The system recalculates the final score on a scale of 100. |
precision | double | Optional | The scoring precision. Valid values are 0.1, 0.5, and 1. The default value is 1. If you specify an invalid value, the system uses 1. |
Parameter example
{
"coreType": "en.alpha.score",
"refText": "ih",
"rank": 100,
"precision": 0.1
}Sample response
{
"applicationId": "aXXX", // The authorized AppKey
"tokenId": "5a4edc47000df30000090004", // The unique ID of the request
"recordId": "5a4edc9d28c338dabd000008", // The unique ID of the audio file
"dtLastResponse": "2021-08-09 10:02:08:609", // The timestamp of the cloud response
"result": { // The evaluation result node
"forceout": 0,
"pron": 97.3, // The pronunciation score, which indicates accuracy.
"version": "0.0.80.2018.1.3.11:10:55", // The version of the resource used for the evaluation.
"rank": 100,
"pretime": 2,
"delaytime": 51, // The time in milliseconds (ms) from when the audio feed ends to when the cloud returns a result.
"overall": 97.3, // The total score.
"info": {
"tipId": 10006, // The audio quality. For more information, see the description of the tipId field.
"clip": 0, // Audio clipping occurred because the volume was too high. The range is 0 to 1. If this parameter affects the score, a corresponding tipId value is set.
"snr": 2.888726, // The signal-to-noise ratio (SNR). A higher value indicates clearer audio. The range is 0 to 40 dB. If this parameter affects the score, a corresponding tipId value is set.
"volume": 84 // The recording volume. The range is 0 to 180 dB.
},
"wavetime": 1990, // The audio duration, in ms.
"systime": 2774,
"details": [ // Feedback for the phoneme node.
{
"dur": 330, // The pronunciation duration of the phonetic symbol, in ms.
"phone": [ // The phoneme-level scoring result. The internal phoneme is returned. For more information, see the Phoneme mapping table.
{
"char": "ih",
"score": 97 // The pronunciation score.
}
],
"char": "ih", // The internal phoneme.
"end": 1030, // The end time of the phoneme pronunciation, in ms.
"start": 700, // The start time of the phoneme pronunciation, in ms.
"score": 97 // The phoneme score.
}
],
"precision": 0.1, // The scoring precision set in the evaluation request. Valid values are 0.1, 0.5, and 1. The default is 1. If you specify an invalid value, the system uses 1.
"res": "eng.alpha.online.0.1" // The name of the resource used for the evaluation.
},
"eof": 1,
"params": {
"app": { // Internal parameter node. You can ignore this.
"timestamp": "1515117639",
"sig": "76f93b03334e890f7fcd683e02b5c8c619d87e97",
"applicationId": "aXXX",
"userId": "ssound_text",
"clientId": ""
},
"request": {
"coreType": "en.alpha.score",
"tokenId": "5a4edc47000df30000090004",
"refText": "ih",
"precision": 0.1,
"rank": 100
},
"audio": { // The audio parameter node.
"sampleRate": 16000, // The sample rate.
"channel": 1, // Mono channel. The evaluation supports only mono audio.
"sampleBytes": 2, // The number of bytes per sample. Single-byte and double-byte formats are supported.
"audioType": "ogg" // The audio format type.
}
},
"refText": "ih"
}Response description
Key | Type | Description | Recommended use |
recordId | string | The unique ID of the audio file. | For reference. |
tokenId | string | The unique ID of the user request. | For reference. |
applicationId | string | Evaluation AppKey for the authorized account | Internal parameter. |
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 evaluation have been returned. | Internal parameter. |
refText | string | The evaluation text that was passed in. | For reference. |
params | object | Echoes the evaluation request parameters passed in by the client. | |
- app | object | ||
- - applicationId | string | An authorized account and an evaluation Appkey | |
- - userId | string | The user ID. | |
- - timestamp | string | The start time. | |
- - sig | string | The verification code. | |
- request | object | The scoring request parameter node. | |
- audio | object | The audio parameter node for the scoring request. | |
result | object | The evaluation result. | |
- version | string | The version of the engine, including the release time. | 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 evaluating this question type. | Internal parameter. |
- forceout | int | 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 evaluation process, in ms. | Internal parameter. |
- delaytime | int | The time elapsed from the end of the audio feed to receiving the result from the cloud, in ms. | Internal parameter. |
- wavetime | int | The audio duration, in ms. | For reference. |
- overall | float | The total score. | Recommended field. |
- pron | float | The pronunciation score. | Internal parameter. |
- details | array | ||
- - start | int | The start time of the phonetic symbol in the audio, in ms. | For reference. |
- - end | int | The end time of the phonetic symbol in the audio, in ms. | For reference. |
- - dur | int | The pronunciation duration of the phonetic symbol, in ms. | For reference. |
- - char | string | The normalized phonetic symbol text. | For reference. |
- - score | int | The score for the phonetic symbol. | For reference. |
- - phone | array | The phoneme-level scoring result node. | |
- - - char | string | The phoneme. | For reference. |
- - - score | int | The phoneme score (0-100). | For reference. |
- info | object | ||
- - snr | float | The signal-to-noise ratio (SNR). A higher value indicates clearer audio. The range is 0 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. The range is 0 to 1. If this parameter affects the score, a corresponding tipId value is set. | Internal parameter. |
- - volume | int | The recording volume. The range is 0 to 180 dB. | For reference. |
- - tipId | int | The audio quality. For more information, see tipId message descriptions. | Recommended field. |
Suggestions for displaying evaluation results
Dimension | Description | Details |
overall | Total score | A total score for the overall pronunciation of the phonetic symbols. |
pron | Pronunciation score | A score for the overall pronunciation of the phonetic symbols. |
details[i].score | Score | A score for the pronunciation of each phonetic symbol. Before you retrieve the score, check that the value is not empty. |
details[i].phone[i].score | Score | A score for the pronunciation of each phoneme. |
Response when evaluation fails
If the result structure in the response is empty, the evaluation failed.
The response contains the errId and error fields. Your application can use the error code to determine the next steps.
Error codes
For more information, see Evaluation error codes.