关键词评测

最近更新时间:2019-07-24 15:32:11

1. 接口描述

接口请求域名: soe.tencentcloudapi.com 。

指定主题关键词词汇评估,分析语音与关键词的切合程度,可指定多个关键词,支持中文英文同时评测。分片传输时,尽量保证纯异步调用,即不等待上一个分片的传输结果边录边传,这样可以尽可能早的提供音频数据。音频源目前仅支持16k采样率16bit单声道编码方式,如有不一致可能导致评估不准确或失败。

默认接口请求频率限制:20次/秒。

2. 输入参数

以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见 公共请求参数

参数名称 必选 类型 描述
Action String 公共参数,本接口取值:KeywordEvaluate
Version String 公共参数,本接口取值:2018-07-24
Region String 公共参数,本接口不需要传递此参数。
SeqId Integer 流式数据包的序号,从1开始,当IsEnd字段为1后后续序号无意义,当IsLongLifeSession不为1且为非流式模式时无意义。
IsEnd Integer 是否传输完毕标志,若为0表示未完毕,若为1则传输完毕开始评估,非流式模式下无意义。
VoiceFileType Integer 语音文件类型 1: raw, 2: wav, 3: mp3, 4: speex (语言文件格式目前仅支持 16k 采样率 16bit 编码单声道,如有不一致可能导致评估不准确或失败)。
VoiceEncodeType Integer 语音编码类型 1:pcm。
UserVoiceData String 当前数据包数据, 流式模式下数据包大小可以按需设置,在网络良好的情况下,建议设置为0.5k,且必须保证分片帧完整(16bit的数据必须保证音频长度为偶数),编码格式要求为BASE64。
SessionId String 语音段唯一标识,一个完整语音一个SessionId。
Keywords.N Array of Keyword 关键词列表
SoeAppId String 业务应用ID,与账号应用APPID无关,是用来方便客户管理服务的参数,新的 SoeAppId 可以在控制台【应用管理】下新建。
IsQuery Integer 查询标识,当该参数为1时,该请求为查询请求,请求返回该 Session 评估结果。

3. 输出参数

参数名称 类型 描述
KeywordScores Array of KeywordScore 关键词得分
SessionId String 语音段唯一标识,一段语音一个SessionId
RequestId String 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。

4. 示例

示例1 关键词评测

评测中文和英文关键词,返回关键词切题分数

输入示例

https://soe.tencentcloudapi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qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo%3D
&SessionId=12345
&SoeAppId=default
&Keywords.0.RefText=bike
&Keywords.0.EvalMode=0
&Keywords.0.ServerType=0
&Keywords.0.ScoreCoeff=1.0
&Keywords.1.RefText=百科
&Keywords.1.EvalMode=0
&Keywords.1.ServerType=1
&Keywords.1.ScoreCoeff=1.0
&<公共请求参数>

输出示例

{
  "Response": {
    "RequestId": "9c887cc0-0c1c-4f46-a80b-ac732ad9a3b3",
    "SessionId": "12345",
    "KeywordScores": [
      {
        "Keyword": "bike",
        "SuggestedScore": 56.918514,
        "PronAccuracy": 56.918514,
        "PronFluency": 0.8546912,
        "PronCompletion": 1,
        "Words": [
          {
            "MemBeginTime": 0,
            "MemEndTime": 620,
            "PronAccuracy": 56.918514,
            "PronFluency": 0.8546912,
            "Word": "bike",
            "MatchTag": 0,
            "PhoneInfos": [
              {
                "MemBeginTime": 0,
                "MemEndTime": 160,
                "PronAccuracy": 21.924847,
                "DetectedStress": false,
                "Phone": "b",
                "Stress": false
              },
              {
                "MemBeginTime": 160,
                "MemEndTime": 310,
                "PronAccuracy": 49.780193,
                "DetectedStress": false,
                "Phone": "ay",
                "Stress": false
              },
              {
                "MemBeginTime": 310,
                "MemEndTime": 620,
                "PronAccuracy": 99.05051,
                "DetectedStress": false,
                "Phone": "k",
                "Stress": false
              }
            ]
          }
        ]
      },
      {
        "Keyword": "百",
        "SuggestedScore": 27.858376,
        "PronAccuracy": 27.858376,
        "PronFluency": 0.9544449,
        "PronCompletion": 1,
        "Words": [
          {
            "MemBeginTime": 0,
            "MemEndTime": 410,
            "PronAccuracy": 27.858376,
            "PronFluency": 0.9544449,
            "Word": "百",
            "MatchTag": 0,
            "PhoneInfos": [
              {
                "MemBeginTime": 0,
                "MemEndTime": 150,
                "PronAccuracy": 61.201637,
                "DetectedStress": false,
                "Phone": "b",
                "Stress": false
              },
              {
                "MemBeginTime": 150,
                "MemEndTime": 410,
                "PronAccuracy": 11.186747,
                "DetectedStress": false,
                "Phone": "ai3",
                "Stress": false
              }
            ]
          }
        ]
      }
    ]
  }
}

5. 开发者资源

API Explorer

该工具提供了在线调用、签名验证、SDK 代码生成和快速检索接口等能力,能显著降低使用云 API 的难度,推荐使用。

SDK

云 API 3.0 提供了配套的开发工具集(SDK),支持多种编程语言,能更方便的调用 API。

命令行工具

6. 错误码

该接口暂无业务逻辑相关的错误码,其他错误码详见 公共错误码