单项选择

更新时间:

该文档是开发者在产品功能集成阶段 使用的英文选择题型的语音评测技术文档

本题型适用场景:

  • 有多个选项,只有读正确的字段并且发音正确、完整才会得分。

  • 用户只能按事先设定的固定答案进行发音;检查到读的是哪个答案,就会有对应的得分。

评测请求参数

字段

类型

可选

说明

coreType

String

必选

en.choc.score表示英文选择题题型

rank

int

可选

评分分制,这个值可以任意设置,最终会根据与100的比例重新计算制

precision

double

可选

设置打分精度,只支持0.1、0.5或者1,默认值为1(如果设置的值不是0.10.5则按1处理)

lm

array

必选

数组字典,设置选择题的选项:1、lm的子字段answer0的表示错误答案,非0的表示正确答案(注:lm字段是LM的小写形式) 2、只有读正确的text字段并且发音正确、完整,overall才会有得分

cmd_word

int

可选

0:表示使用常规的解码网络(默认是0) 1:表示使用精简的解码网络(解码速度会快一些,但是效果会下降;当参数文本较多时,可以设置此项)

attachAudioUrl

int

可选

评测结果中是否返回音频url
0: 不返回
1: 返回

参数示例

{
    "coreType": "en.choc.score",
    "rank": 2,
    "precision": 0.5,
    "attachAudioUrl":1,
    "lm": [
        {"answer": 0, "text": "In an office." },
        {"answer": 2, "text": "In a store." },
        {"answer": 0, "text": "In the street." }
    ]
}

返回结果示例

{
    "tokenId": "61265ea188bf5b00000e0001",
    "applicationId": "a148",
    "audioUrl": "http:\/\/files.cloud.ssapi.cn:8080\/a148\/11ec05b74ec73b88a52ea1484261e844",
    "connect": {
        "param": {
            "app": {
                "timestamp": "1629904545",
                "applicationId": "a148",
                "sig": "234dac26e7e6ee712eae6cae644531047c27dfd3"
            },
            "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": "1629904545",
            "userId": "ssound_text",
            "sig": "234dac26e7e6ee712eae6cae644531047c27dfd3",
            "connect_id": "61265ea188bf5b0000100002",
            "clientId": "",
            "applicationId": "a148"
        },
        "audio": {
            "sampleBytes": 2,
            "audioType": "ogg",
            "sampleRate": 16000,
            "channel": 1
        },
        "request": {
            "lm": [
                {
                    "text": "In an office.",
                    "answer": 0
                },
                {
                    "text": "In a store.",
                    "answer": 2
                },
                {
                    "text": "In the street.",
                    "answer": 0
                }
            ],
            "tokenId": "61265ea188bf5b00000e0001",
            "precision": 0.5,
            "attachAudioUrl": 1,
            "request_id": "61265ea188bf5b00000f0001",
            "rank": 2,
            "coreType": "en.choc.score"
        }
    },
    "recordId": "11ec05b74ec73b88a52ea1484261e844",
    "eof": 1,
    "result": {
        "overall": 0,
        "wavetime": 2990,
        "precision": 0.5,
        "systime": 3610,
        "res": "eng.choc.mfcc.0.1",
        "version": "0.0.80.2021.7.24.00:01:28",
        "info": {
            "tipId": 0,
            "clip": 0,
            "snr": 29.888056,
            "volume": 84
        },
        "rank": 2,
        "pretime": 3,
        "delaytime": 67
    },
    "dtLastResponse": "2021-08-25 23:15:43:906",
    "cloud_platform": {
        "origin_audio_length": 11600
    }
}

返回结果说明

类型

说明

使用建议

recordId

string

音频文件的唯一标识

可供参考

tokenId

string

用户请求的唯一标识

可供参考

applicationId

string

授权账号,提供的Appkey

内部参数

audioUrl

string

用户音频地址,在云端默认只保存一个月,建议保存到产品端服务器

可供参考

dtLastResponse

string

云端响应的时间点

内部参数

eof

int

0表示返回未结束,后续还有其它的返回结果 1:表示本次评测所有的返回结束

内部参数

params

object

回显客户端传入的评测请求参数

- app

object

- - applicationId

string

授权账号,提供的Appkey

- - userId

string

用户标识 ,自定义字符串,方便定位排查问题

- - timestamp

string

start时间

- - sig

string

校验码

- - clientId

string

- request

object

评分请求参数节点

- audio

object

评分请求的音频参数节点

result

object

评测结果

- res

string

评测本题型时,使用的资源名称

内部参数

- version

string

引擎的版本,包含发布时间

内部参数

- rank

int

评分分制

内部参数

- precision

float

评分精度

内部参数

- pretime

int

云端调用Start接口本身耗时,单位ms

内部参数

- systime

int

评测整个过程的总耗时,单位ms

内部参数

- delaytime

int

云端从feed音频结束到获取结果的耗时,单位ms

内部参数

- wavetime

int

音频时长,单位ms

可供参考

- overall

float

总分

建议字段

- fake_words

object

(只有测评文本中有非法词时,才有此字段,每个单词一个节点)

- - char

string

词典中不存在的单词

- info

object

- - snr

float

信噪比,值越高越清晰,范围(0~40dB) 此参数影响评分时,会设置相应的tipId

可供参考

- - clip

float

音频声音太高,出现截幅,范围(0\~1)。 此参数影响评分时,会设置相应的tipId

内部参数

- - volume

int

录音音量,范围(0~180dB)

可供参考

- - tipId

int

音频质量,详情请参考 tipId提示信息说明

建议字段

评测结果展现建议

维度

说明

详细

overall

发音总分

对选读句子的发音情况进行总体评价

评测失败时的返回结果

  • 如果返回的评测结果中result结构为空,说明评测失败。

  • 通过返回结果可以获取 errId 和 error,产品端可以根据相应错误码做续判断和处理。

错误码