问答题

更新时间:

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

本题型适用场景:

  • 先描述一段场景,然后从描述的场景中提出一个问题,让回答者根据听到的场景回答问题;

  • 问答题和扩展选择题的区别是: 扩展选择题有可供选择的项,让用户适度自由的回答。问答题则没有任何选项参考,只是根据听到的场景回答问题。

参数说明:

字段

类型

可选

说明

coreType

String

必选

en.pqan.score表示英文问答题题型

rank

int

可选

总分评分分制

precision

double

可选

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

quest_ans

String

可选

提问问题的文本

key

array

必选

key包括关键点可能的表述方式;关键点对打分的影响很大;

para

String

可选

描述情景的文本

lm

array

必选

设置可能的正确回答;lm中的每个text表示一种正确的回答 (注:lm字段是LM的小写形式)

phones

String

可选

指定单词的发音。如果单词有多发音,要用”|”符号分隔开;每个音素之间及音素与音节分隔符”-“之间,必须使用空格隔开。 例:"phones":{"directory":"d ih - 'r eh k - tr ih|d ax - 'r eh k - t ax - r ih"};

attachAudioUrl

int

可选

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

unkey

Array

可选

unkey表示错误答案,用户发音命中其中任一错误答案,对得分影响很大(得分会较低)

rateScale

float

可选

打分宽松度,设置的范围0.8~1.5,默认1.0;如果设置值小于0.8,按0.8计算;如果大于1.5则按1.5计算。这个参数可以看作是个乘数,值越高打分越高。

参数示例

{
      "coreType": "en.pqan.score",
      "attachAudioUrl":1,
      "para": "It's unbelievable. He looks stupid, but in fact, he is such a great and humorous actor. What's going on? You know what? Mr. Bean graduate from Oxford University. Exactly, I am also very crazy about Mr. Bean. He is really a funny guy and he does have a great sense of humor. In my eyes, he is a genius. I really admire him. I couldn't agree more, and it's his giftedness and hard works that make him succeed. After seeing his interesting films, I feel cheerful and excited, he brings happiness to us. Yes, I hope we can bring laughter to people too, just like Mr. Bean. I can't wait to see more his films after class. But first thing first, let's get our homework done.",
            "quest_ans": "What makes Mr. Bean so successful?",
            "lm": [
                {
                    "text": "It's his giftedness and hard works that make him succeed."
                },
                {
                    "text": "his talents and hard works."
                },
                {
                    "text": "is talent and hard work."
                },
                {
                    "text": "His giftedness and hard works."
                },
                {
                    "text": "His giftedness and hard works makes Mr. Bean so successful."
                },
                {
                    "text": "His talent and hard work makes him successful."
                },
                {
                    "text": "His body language is so funny, he makes people laugh, feel happy and relaxed."
                },
                {
                    "text": "Hard work and giftedness."
                },
                {
                    "text": "His giftedness and hard work."
                },
                {
                    "text": "his talents and he is very hard working."
                },
                {
                    "text": "His gift and hard works."
                }
            ],
            "key": [    
                {
                    "text": "giftedness hard work"
                },
                {
                    "text": "gift hard work"
                },
                {
                    "text": "talent hard work"
                }
            ] , 
            "unkey":[
                {
                    "text":"no"
                }
            ]
        }


返回结果示例

{
    "tokenId": "612f300a88bf5b0000010001",
    "applicationId": "a148",
    "audioUrl": "http:\/\/files.cloud.ssapi.cn:8080\/a148\/11ec0af8d87bb60e915ba14862618bc6",
    "connect": {
        "param": {
            "app": {
                "timestamp": "1630482442",
                "applicationId": "a148",
                "sig": "b49047a625766bce5467fb292c3902b7d8373452"
            },
            "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": "1630482442",
            "userId": "ssound_text",
            "sig": "b49047a625766bce5467fb292c3902b7d8373452",
            "connect_id": "612f300a88bf5b0000030002",
            "clientId": "",
            "applicationId": "a148"
        },
        "audio": {
            "sampleBytes": 2,
            "audioType": "ogg",
            "sampleRate": 16000,
            "channel": 1
        },
        "request": {
            "quest_ans": "What makes Mr. Bean so successful?",
            "tokenId": "612f300a88bf5b0000010001",
            "para": "It's unbelievable. He looks stupid, but in fact, he is such a great and humorous actor. What's going on? You know what? Mr. Bean graduate from Oxford University. Exactly, I am also very crazy about Mr. Bean. He is really a funny guy and he does have a great sense of humor. In my eyes, he is a genius. I really admire him. I couldn't agree more, and it's his giftedness and hard works that make him succeed. After seeing his interesting films, I feel cheerful and excited, he brings happiness to us. Yes, I hope we can bring laughter to people too, just like Mr. Bean. I can't wait to see more his films after class. But first thing first, let's get our homework done.",
            "coreType": "en.pqan.score",
            "attachAudioUrl": 1,
            "request_id": "612f300a88bf5b0000020001",
            "key": [
                {
                    "text": "giftedness hard work"
                },
                {
                    "text": "gift hard work"
                },
                {
                    "text": "talent hard work"
                }
            ],
            "lm": [
                {
                    "text": "It's his giftedness and hard works that make him succeed."
                },
                {
                    "text": "his talents and hard works."
                },
                {
                    "text": "is talent and hard work."
                },
                {
                    "text": "His giftedness and hard works."
                },
                {
                    "text": "His giftedness and hard works makes Mr. Bean so successful."
                },
                {
                    "text": "His talent and hard work makes him successful."
                },
                {
                    "text": "His body language is so funny, he makes people laugh, feel happy and relaxed."
                },
                {
                    "text": "Hard work and giftedness."
                },
                {
                    "text": "His giftedness and hard work."
                },
                {
                    "text": "his talents and he is very hard working."
                },
                {
                    "text": "His gift and hard works."
                }
            ]
        }
    },
    "recordId": "11ec0af8d87bb60e915ba14862618bc6",
    "eof": 1,
    "result": {
        "overall": 99,
        "wavetime": 4990,
        "precision": 1,
        "pron": 90,
        "systime": 1521,
        "res": "eng.pqan.mfcc.0.1",
        "version": "0.0.80.2021.8.27.04:29:39",
        "fake_words": {
            "char": "giftedness"
        },
        "info": {
            "tipId": 0,
            "clip": 0,
            "snr": 17.190611,
            "volume": 83
        },
        "fluency": 93,
        "rank": 100,
        "rhythm": 0,
        "integrity": 100,
        "pretime": 621,
        "delaytime": 82
    },
    "dtLastResponse": "2021-09-01 15:47:25:709",
    "cloud_platform": {
        "origin_audio_length": 19132
    }
}

测评返回结果

类型

说明

使用建议

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

总分

建议字段

- fluency

float

流利度分

内部参数

- pron

float

发音分

内部参数

- rhythm

float

韵律分(暂未使用)

内部参数

- integrity

float

完整度分

内部参数

- fake_words

object

单词不在词典(集外词),才会输出此字段。如果需要对集外词进行评测,可以通过refText传音标的方式进行评测。

- -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,需要根据相应错误码进行后续判断和处理。

错误码

错误码参考:评测错误码