/docs
cn.pred.raw
Kernel Description
Evaluate the Chinese paragraph/chapter, outputting scores of overall, fluency, accuracy, integrity, each sentence and ench Chinese character;
- Support difficulty adjustment;
- Support missed reading detection;
- Support real-time feedback of Chinese characters that have been read and evaluation scores;
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| coreType | String | true | cn.pred.raw means Chinese paragraph kernel. |
| refText | String | true | Supports scoring of Chinese paragraphs within 1000 words, punctuation marks need to be passed in, supported punctuation marksClick to view |
| rank | int | false | Point system,support 100 |
| attachAudioUrl | number | false | Enable to return audio url or not.
|
| result | object | false | Return result detailed settings |
| - details | object | false | Detailed scoring options |
| - - word | int | false | Whether to output the score of each Chinese character, Default is 0
|
| - - gop_adjust | number | false | Increase or reduce the evaluation scores. value range[-1,-0.9, ... 0.9, 1]。 Default value is 0, which means using original scores. The passing parameter is a positive number to increase the scoring score. The larger the passing parameter, the more the score will be improved. Pass parameter is negative, reduce the scoring score, the smaller the pass parameter, the more the score will be reduced |
| - - ext_cur_wrd | number | false | Enable to return the words that have been read in real time,Default value is 0. Support multiple modes 0: Disable.1: General mode, the returned results are output from front to back in the order of the text; 2: Recitation mode, the returned results are strictly in accordance with the text order from front to back; if the previous sentence is missed, even if the following sentence is read normally, it will not be returned; 3: Free mode, returns the content of reference text actually read by users, regardless of the order of text; |
Sample Code
Sample1 Chinese text
{
"coreType": "cn.pred.raw",
"refText": "今天天气很好,特别好。",
"rank": 100,
"attachAudioUrl": 1,
"result": {
"details": {
"word": 1,
"ext_cur_wrd":1,
"gop_adjust":0
}
}
}
Sample2 Customize the pinyin of a Chinese character
{
"coreType": "cn.pred.raw",
"refText": "今天天气很好,特别好。风吹草低见(xian4)牛羊,思援弓缴(zhuo2)而射之。",
"rank": 100,
"attachAudioUrl": 1,
"result": {
"details": {
"word": 1,
"ext_cur_wrd":0,
"gop_adjust":0
}
}
}
Sample3 Customize the pinyin of non-Chinese character text
{
"coreType": "cn.pred.raw",
"refText": {
"text": "今天天气很好,特别好。呼叫10087,hello一心以为有鸿鹄将至。",
"prons": [
{
"10087": "yao1 ling2 ling2 ba1 qi1"
},
{
"hello": "ha1 lou2"
}
]
},
"rank": 100,
"attachAudioUrl": 1,
"result": {
"details": {
"word": 1,
"ext_cur_wrd":0,
"gop_adjust":0
}
}
}
Sample4 Custom pinyin for single characters and non-single Chinese characters
{
"coreType": "cn.pred.raw",
"refText": {
"text": "今天天气很好,特别好。呼叫10087,hello一心以为有鸿鹄将至。真牛X(cha1)。",
"prons": [
{
"10087": "yao1 ling2 ling2 ba1 qi1"
},
{
"hello": "ha1 lou2"
}
]
},
"rank": 100,
"attachAudioUrl": 1,
"result": {
"details": {
"word": 1,
"ext_cur_wrd":0,
"gop_adjust":0
}
}
}
Introduction to Real-time return Results
| Key | Type | Description | Recommendations |
|---|---|---|---|
| eof | int | Whether the final evaluation result0: Indicates that the result is returned in real time during the recording process;1: Indicates that the result is the final evaluation result after the recording is completed; | Suggest to display |
| result | object | Scoring result | |
| - rec | string | During the evaluation process, the newly-recognized Chinese characters will be returned in real time | Suggest to display |
| - phnspeed | string | Current speaking rate | For reference |
| - details | object | Real-time return the content that has been read | |
| - - chn_char | string | Chinese character | Suggest to display |
| - - char | string | Pinyin | Suggest to display |
| - - tone | number | Standard tone value (0~4) | Suggest to display |
| - - score | number | Chinese character score | Suggest to display |
| - - beginindex | number | Take refText as a character array, beginindex represents the index of the first character of the word in refText, and the index starts from 0. For convenience The application layer echoes refText as it is |
Suggest to display |
| - - endindex | number | Regarding the refText field as a character array, endindex represents the index of the end of Chinese character in refText, starting from 0. For convenience The application layer echoes refText as it is |
Example of Real-time return Results
{
"sdk": {
"protocol": "websocket",
"version": 16777216,
"source": 4
},
"tokenId": "29****a1-****-****-****-****7e****fc",
"result": {
"details": [[{
"chn_char": "快",
"tone": 4,
"endindex": 2,
"char": "kuai",
"score": 100,
"group": 0,
"beginindex": 0
},
......
{
"chn_char": "年",
"tone": 2,
"endindex": 8,
"char": "nian",
"score": 100,
"group": 0,
"beginindex": 6
}]],
"rec": "快过年",
"phnspeed": 338
},
"eof": 0,
"time": {
"callback": "2021-04-13 15:03:31:325",
"start": "2021-04-13 15:03:28:283",
"connect": "2021-04-13 15:03:28:203"
}
}
Example of Returned Results
- The results are returned using the JSON structure,Example
Introduction to Returned Results
| Key | Type | Description | Recommendations |
|---|---|---|---|
| uuid | string | Unique id of audio. Save uuid in database in case of need. | For reference |
| audioUrl | string | Audio url.Download audio in http protocol: Just add ".mp3" at the end of the URL. Download audio in https protocol: Remove the port number, add ".mp3" at the end, and add "https://" to the prefix. e.g.https://download.cloud.chivox.com/XXXXXXXX.mp3 Tips:
|
For reference |
| - wavetime | number | Audio duration (Unit:milliseconds) | For reference |
| - overall | number | Overall score | Suggest to display |
| - fluency | object | Score of fluency. | |
| - - pause | number | Number of pauses. | Suggest to display |
| - - overall | number | Overall score of fluency | Suggest to display |
| - - speed | number | Speech rate, which is the number of words read per minute. | Suggest to display |
| - integrity | number | Score of integrity. | Suggest to display |
| - accuracy | number | Score of accuracy(pronunciation evaluation of the read parts). | Suggest to display |
| - tone | number | Tone score | Suggest to display |
| - phn | number | Pronunciation score without tone | Suggest to display |
| - details | array | object | |
| - - chn_text | string | Chinese sentence | |
| - - py_text | string | Chinese Sentence Pinyin | For reference |
| - - phn | number | Pronunciation score without tone | For reference |
| - - overall | number | sentence score | For reference |
| - - tone | number | Tone score | For reference |
| - - start | number | Start time of the sentence in the audio (Unit: milliseconds) | For reference |
| - - end | number | End time of the sentence in the audio (Unit: milliseconds) | For reference |
| - - dur | number | duration (Unit: milliseconds). | For reference |
| - - is_leak | number | Mark if this sentence is missed
|
For reference |
| - - beginindex | number | Take refText as a character array, beginindex represents the index of the first character of the word in refText, and the index starts from 0. For convenience The application layer echoes refText as it is |
For reference |
| - - endindex | number | Regarding the refText field as a character array, endindex represents the index of the end of Chinese character in refText, starting from 0. For convenience The application layer echoes refText as it is |
For reference |
| - - words | array | Result of each Chinese character | |
| - - - chn_char | string | Chinese character | For reference |
| - - - char | string | Pinyin | For reference |
| - - - overall | number | Chinese character score | For reference |
| - - - is_err | number | Error Type 0: Correct 1: superfluous reading 2: missing reading |
For reference |
| - - - tonescore | number | Tone score | For reference |
| - - - phn | number | Pronunciation score without tone | For reference |
| - - - confidence | array | Pronunciation tone confidence, a total of 5 digits, respectively indicate the probability of being pronounced as soft, one, two, three, and four tones. The tone with the largest number is the actual tone of the pronunciation. |
Suggest to display |
| - - - tone | number | Standard tone value (0~4) | For reference |
| - - - start | number | The start time of the word in audio (Unit:milliseconds). | For reference |
| - - - end | number | The end time of the word in audio (Unit: milliseconds). | For reference |
| - - - dur | number | duration (Unit: milliseconds). | For reference |
| - - - beginindex | number | Take refText as a character array, beginindex represents the index of the first character of the word in refText, and the index starts from 0. For convenience The application layer echoes refText as it is |
For reference |
| - - - endindex | number | Regarding the refText field as a character array, endindex represents the index of the end of Chinese character in refText, starting from 0. For convenience The application layer echoes refText as it is |
For reference |
| - info | object | ||
| - - tipId | number | Audio quality For details, please refer toTipId field description |
For reference |
| - - tips | string | Error message promptWhen prompted "post proc failed", it may be that the audio was not successfully recorded or the engine did not detect the user’s valid voice. Prompt the user to re-record | For reference |
Note: The other returned parameters that are not shown above are internal ones, which you don't need to pay much atttention to.
