tencentcloud-sdk-soe 1.0.200

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5140aca6c7e2fec99ed0400b1ccc7d8be5111bf5
4
+ data.tar.gz: 02a4860f0e6ba6b8ee6c03aa2424bcaade981f16
5
+ SHA512:
6
+ metadata.gz: f09a60f818530d3da9b8dbcdb5ca4dc8cd6d722993f8ecc7270d6a2f694fd1f194480a0f57819aa9f45bc4fc30a44342b299019821da64938692da1514629e83
7
+ data.tar.gz: 072969d960195988a7d577be71cde94b8d6b61be74666284cfb1c8baa908ad494f9cb5a0ea30d32d246ed9640c4e54928a68204e42e133a226c739227bcee24e
data/lib/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.0.200
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'tencentcloud-sdk-common'
4
+
5
+ require_relative 'v20180724/client'
6
+ require_relative 'v20180724/models'
7
+
8
+ module TencentCloud
9
+ module Soe
10
+ end
11
+ end
@@ -0,0 +1,132 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ require 'json'
18
+
19
+ module TencentCloud
20
+ module Soe
21
+ module V20180724
22
+ class Client < TencentCloud::Common::AbstractClient
23
+
24
+ def initialize(credential, region, profile = nil)
25
+ api_version = '2018-07-24'
26
+ api_endpoint = 'soe.tencentcloudapi.com'
27
+ sdk_version = 'SOE_' + File.read(File.expand_path('../VERSION', __dir__)).strip
28
+ super(credential, region, api_version, api_endpoint, sdk_version, profile)
29
+ end
30
+
31
+
32
+ # 初始化发音评估过程,每一轮评估前进行调用。语音输入模式分为流式模式和非流式模式,流式模式支持数据分片传输,可以加快评估响应速度。评估模式分为词模式和句子模式,词模式会标注每个音节的详细信息;句子模式会有完整度和流利度的评估。
33
+
34
+ # @param request: Request instance for InitOralProcess.
35
+ # @type request: :class:`Tencentcloud::soe::V20180724::InitOralProcessRequest`
36
+ # @rtype: :class:`Tencentcloud::soe::V20180724::InitOralProcessResponse`
37
+ def InitOralProcess(request)
38
+ body = send_request('InitOralProcess', request.serialize)
39
+ response = JSON.parse(body)
40
+ if response['Response'].key?('Error') == false
41
+ model = InitOralProcessResponse.new
42
+ model.deserialize(response['Response'])
43
+ model
44
+ else
45
+ code = response['Response']['Error']['Code']
46
+ message = response['Response']['Error']['Message']
47
+ reqid = response['Response']['RequestId']
48
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
49
+ end
50
+ rescue TencentCloud::Common::TencentCloudSDKException => e
51
+ raise e
52
+ rescue StandardError => e
53
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
54
+ end
55
+
56
+ # 指定主题关键词词汇评估,分析语音与关键词的切合程度,可指定多个关键词,支持中文英文同时评测。分片传输时,尽量保证纯异步调用,即不等待上一个分片的传输结果边录边传,这样可以尽可能早的提供音频数据。音频源目前仅支持16k采样率16bit单声道编码方式,如有不一致可能导致评估不准确或失败。
57
+
58
+ # @param request: Request instance for KeywordEvaluate.
59
+ # @type request: :class:`Tencentcloud::soe::V20180724::KeywordEvaluateRequest`
60
+ # @rtype: :class:`Tencentcloud::soe::V20180724::KeywordEvaluateResponse`
61
+ def KeywordEvaluate(request)
62
+ body = send_request('KeywordEvaluate', request.serialize)
63
+ response = JSON.parse(body)
64
+ if response['Response'].key?('Error') == false
65
+ model = KeywordEvaluateResponse.new
66
+ model.deserialize(response['Response'])
67
+ model
68
+ else
69
+ code = response['Response']['Error']['Code']
70
+ message = response['Response']['Error']['Message']
71
+ reqid = response['Response']['RequestId']
72
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
73
+ end
74
+ rescue TencentCloud::Common::TencentCloudSDKException => e
75
+ raise e
76
+ rescue StandardError => e
77
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
78
+ end
79
+
80
+ # 本接口可用于中英文发音评测数据传输。在使用本接口时需要注意:传输音频数据,必须在完成发音评估初始化接口之后调用,且SessonId要与初始化接口保持一致。分片传输时,尽量保证SeqId顺序传输(请确认SeqId由1开始)。音频源目前仅支持16k采样率16bit单声道编码方式,如有不一致可能导致评估不准确或失败。
81
+
82
+ # @param request: Request instance for TransmitOralProcess.
83
+ # @type request: :class:`Tencentcloud::soe::V20180724::TransmitOralProcessRequest`
84
+ # @rtype: :class:`Tencentcloud::soe::V20180724::TransmitOralProcessResponse`
85
+ def TransmitOralProcess(request)
86
+ body = send_request('TransmitOralProcess', request.serialize)
87
+ response = JSON.parse(body)
88
+ if response['Response'].key?('Error') == false
89
+ model = TransmitOralProcessResponse.new
90
+ model.deserialize(response['Response'])
91
+ model
92
+ else
93
+ code = response['Response']['Error']['Code']
94
+ message = response['Response']['Error']['Message']
95
+ reqid = response['Response']['RequestId']
96
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
97
+ end
98
+ rescue TencentCloud::Common::TencentCloudSDKException => e
99
+ raise e
100
+ rescue StandardError => e
101
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
102
+ end
103
+
104
+ # 本接口可用于中英文发音评测。在使用本接口时需要注意:初始化并传输音频数据,分片传输时,尽量保证SeqId顺序传输(请确认SeqId由1开始)。音频源目前仅支持16k采样率16bit单声道编码方式,如有不一致可能导致评估不准确或失败。
105
+
106
+ # @param request: Request instance for TransmitOralProcessWithInit.
107
+ # @type request: :class:`Tencentcloud::soe::V20180724::TransmitOralProcessWithInitRequest`
108
+ # @rtype: :class:`Tencentcloud::soe::V20180724::TransmitOralProcessWithInitResponse`
109
+ def TransmitOralProcessWithInit(request)
110
+ body = send_request('TransmitOralProcessWithInit', request.serialize)
111
+ response = JSON.parse(body)
112
+ if response['Response'].key?('Error') == false
113
+ model = TransmitOralProcessWithInitResponse.new
114
+ model.deserialize(response['Response'])
115
+ model
116
+ else
117
+ code = response['Response']['Error']['Code']
118
+ message = response['Response']['Error']['Message']
119
+ reqid = response['Response']['RequestId']
120
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
121
+ end
122
+ rescue TencentCloud::Common::TencentCloudSDKException => e
123
+ raise e
124
+ rescue StandardError => e
125
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
126
+ end
127
+
128
+
129
+ end
130
+ end
131
+ end
132
+ end
@@ -0,0 +1,756 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ module TencentCloud
18
+ module Soe
19
+ module V20180724
20
+ # InitOralProcess请求参数结构体
21
+ class InitOralProcessRequest < TencentCloud::Common::AbstractModel
22
+ # @param SessionId: 语音段唯一标识,一段完整语音使用一个SessionId,不同语音段的评测需要使用不同的SessionId。一般使用uuid(通用唯一识别码)来作为它的值,要尽量保证SessionId的唯一性。
23
+ # @type SessionId: String
24
+ # @param RefText: 被评估语音对应的文本,仅支持中文和英文。
25
+ # 句子模式下不超过个 30 单词或者中文文字,段落模式不超过 120 单词或者中文文字,中文评估使用 utf-8 编码,自由说模式该值无效。
26
+ # 关于RefText的文本键入要求,请参考[评测模式介绍](https://cloud.tencent.com/document/product/884/56131)。
27
+ # 如需要在评测模式下使用自定义注音(支持中英文),可以通过设置「TextMode」参数实现,设置方式请参考[音素标注](https://cloud.tencent.com/document/product/884/33698)。
28
+ # @type RefText: String
29
+ # @param WorkMode: 语音输入模式
30
+ # 0:流式分片
31
+ # 1:非流式一次性评估
32
+ # 推荐使用流式分片传输。
33
+ # @type WorkMode: Integer
34
+ # @param EvalMode: 评测模式
35
+ # 0:单词/单字模式(中文评测模式下为单字模式)
36
+ # 1:句子模式
37
+ # 2:段落模式
38
+ # 3:自由说模式
39
+ # 4:单词音素纠错模式
40
+ # 5:情景评测模式
41
+ # 6:句子多分支评测模式
42
+ # 7:单词实时评测模式
43
+ # 8:拼音评测模式
44
+ # 关于每种评测模式的详细介绍,以及适用场景,请参考[评测模式介绍](https://cloud.tencent.com/document/product/884/56131)。
45
+ # @type EvalMode: Integer
46
+ # @param ScoreCoeff: 评价苛刻指数。取值为[1.0 - 4.0]范围内的浮点数,用于平滑不同年龄段的分数。
47
+ # 1.0:适用于最小年龄段用户,一般对应儿童应用场景;
48
+ # 4.0:适用于最高年龄段用户,一般对应成人严格打分场景。
49
+ # @type ScoreCoeff: Float
50
+ # @param SoeAppId: 业务应用ID,与账号应用APPID无关,是用来方便客户管理服务的参数,新的 SoeAppId 可以在[控制台](https://console.cloud.tencent.com/soe)【应用管理】下新建。如果没有新建SoeAppId,请勿填入该参数,否则会报欠费错误。
51
+ # @type SoeAppId: String
52
+ # @param IsLongLifeSession: 长效session标识,当该参数为1时,session的持续时间为300s,但会一定程度上影响第一个数据包的返回速度,且TransmitOralProcess必须同时为1才可生效。
53
+ # @type IsLongLifeSession: Integer
54
+ # @param StorageMode: 音频存储模式
55
+ # 0:不存储
56
+ # 1:存储到公共对象存储,不会产生费用,存储时间为一个月。输出结果为该会话最后一个分片TransmitOralProcess 返回结果 AudioUrl 字段;
57
+ # 2:永久存储音频,需要提工单申请,会产生一定的存储费用;
58
+ # 3:自定义存储,将音频存储到自定义的腾讯云[对象存储](https://cloud.tencent.com/product/cos)中。
59
+ # 注:对可用性要求较高的用户建议自行存储至腾讯云COS。
60
+ # @type StorageMode: Integer
61
+ # @param SentenceInfoEnabled: 输出断句中间结果标识
62
+ # 0:不输出
63
+ # 1:输出,通过设置该参数
64
+ # 可以在评估过程中的分片传输请求中,返回已经评估断句的中间结果,中间结果可用于客户端 UI 更新,输出结果为TransmitOralProcess请求返回结果 SentenceInfoSet 字段。
65
+ # @type SentenceInfoEnabled: Integer
66
+ # @param ServerType: 评估语言
67
+ # 0:英文
68
+ # 1:中文
69
+ # @type ServerType: Integer
70
+ # @param IsAsync: 异步模式标识
71
+ # 0:同步模式
72
+ # 1:异步模式(一般情况不建议使用异步模式)
73
+ # 可选值参考[服务模式](https://cloud.tencent.com/document/product/884/33697)。
74
+ # @type IsAsync: Integer
75
+ # @param TextMode: 输入文本模式
76
+ # 0: 普通文本
77
+ # 1:[音素结构](https://cloud.tencent.com/document/product/884/33698)文本
78
+ # 2:音素注册模式(提工单注册需要使用音素的单词)。
79
+ # @type TextMode: Integer
80
+
81
+ attr_accessor :SessionId, :RefText, :WorkMode, :EvalMode, :ScoreCoeff, :SoeAppId, :IsLongLifeSession, :StorageMode, :SentenceInfoEnabled, :ServerType, :IsAsync, :TextMode
82
+
83
+ def initialize(sessionid=nil, reftext=nil, workmode=nil, evalmode=nil, scorecoeff=nil, soeappid=nil, islonglifesession=nil, storagemode=nil, sentenceinfoenabled=nil, servertype=nil, isasync=nil, textmode=nil)
84
+ @SessionId = sessionid
85
+ @RefText = reftext
86
+ @WorkMode = workmode
87
+ @EvalMode = evalmode
88
+ @ScoreCoeff = scorecoeff
89
+ @SoeAppId = soeappid
90
+ @IsLongLifeSession = islonglifesession
91
+ @StorageMode = storagemode
92
+ @SentenceInfoEnabled = sentenceinfoenabled
93
+ @ServerType = servertype
94
+ @IsAsync = isasync
95
+ @TextMode = textmode
96
+ end
97
+
98
+ def deserialize(params)
99
+ @SessionId = params['SessionId']
100
+ @RefText = params['RefText']
101
+ @WorkMode = params['WorkMode']
102
+ @EvalMode = params['EvalMode']
103
+ @ScoreCoeff = params['ScoreCoeff']
104
+ @SoeAppId = params['SoeAppId']
105
+ @IsLongLifeSession = params['IsLongLifeSession']
106
+ @StorageMode = params['StorageMode']
107
+ @SentenceInfoEnabled = params['SentenceInfoEnabled']
108
+ @ServerType = params['ServerType']
109
+ @IsAsync = params['IsAsync']
110
+ @TextMode = params['TextMode']
111
+ end
112
+ end
113
+
114
+ # InitOralProcess返回参数结构体
115
+ class InitOralProcessResponse < TencentCloud::Common::AbstractModel
116
+ # @param SessionId: 语音段唯一标识,一个完整语音一个SessionId
117
+ # @type SessionId: String
118
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
119
+ # @type RequestId: String
120
+
121
+ attr_accessor :SessionId, :RequestId
122
+
123
+ def initialize(sessionid=nil, requestid=nil)
124
+ @SessionId = sessionid
125
+ @RequestId = requestid
126
+ end
127
+
128
+ def deserialize(params)
129
+ @SessionId = params['SessionId']
130
+ @RequestId = params['RequestId']
131
+ end
132
+ end
133
+
134
+ # 评测关键词
135
+ class Keyword < TencentCloud::Common::AbstractModel
136
+ # @param RefText: 被评估语音对应的文本,句子模式下不超过个 20 单词或者中文文字,段落模式不超过 120 单词或者中文文字,中文评估使用 utf-8 编码,自由说模式该值无效。如需要在单词模式和句子模式下使用自定义音素,可以通过设置 TextMode 使用[音素标注](https://cloud.tencent.com/document/product/884/33698)。
137
+ # @type RefText: String
138
+ # @param EvalMode: 评估模式,0:词模式(中文评测模式下为文字模式),1:句子模式,2:段落模式,3:自由说模式,当为词模式评估时,能够提供每个音节的评估信息,当为句子模式时,能够提供完整度和流利度信息。
139
+ # @type EvalMode: Integer
140
+ # @param ScoreCoeff: 评价苛刻指数,取值为[1.0 - 4.0]范围内的浮点数,用于平滑不同年龄段的分数,1.0为小年龄段,4.0为最高年龄段
141
+ # @type ScoreCoeff: Float
142
+ # @param ServerType: 评估语言,0:英文,1:中文。
143
+ # @type ServerType: Integer
144
+ # @param TextMode: 输入文本模式,0: 普通文本,1:[音素结构](https://cloud.tencent.com/document/product/884/33698)文本。
145
+ # @type TextMode: Integer
146
+
147
+ attr_accessor :RefText, :EvalMode, :ScoreCoeff, :ServerType, :TextMode
148
+
149
+ def initialize(reftext=nil, evalmode=nil, scorecoeff=nil, servertype=nil, textmode=nil)
150
+ @RefText = reftext
151
+ @EvalMode = evalmode
152
+ @ScoreCoeff = scorecoeff
153
+ @ServerType = servertype
154
+ @TextMode = textmode
155
+ end
156
+
157
+ def deserialize(params)
158
+ @RefText = params['RefText']
159
+ @EvalMode = params['EvalMode']
160
+ @ScoreCoeff = params['ScoreCoeff']
161
+ @ServerType = params['ServerType']
162
+ @TextMode = params['TextMode']
163
+ end
164
+ end
165
+
166
+ # KeywordEvaluate请求参数结构体
167
+ class KeywordEvaluateRequest < TencentCloud::Common::AbstractModel
168
+ # @param SeqId: 流式数据包的序号,从1开始,当IsEnd字段为1后后续序号无意义,当IsLongLifeSession不为1且为非流式模式时无意义。
169
+ # 注意:序号上限为3000,不能超过上限。
170
+ # @type SeqId: Integer
171
+ # @param IsEnd: 是否传输完毕标志,若为0表示未完毕,若为1则传输完毕开始评估,非流式模式下无意义。
172
+ # @type IsEnd: Integer
173
+ # @param VoiceFileType: 语音文件类型
174
+ # 1: raw
175
+ # 2: wav
176
+ # 3: mp3
177
+ # 4: speex
178
+ # 语音文件格式目前仅支持 16k 采样率 16bit 编码单声道,如有不一致可能导致评估不准确或失败。
179
+ # @type VoiceFileType: Integer
180
+ # @param VoiceEncodeType: 语音编码类型
181
+ # 1:pcm
182
+ # @type VoiceEncodeType: Integer
183
+ # @param UserVoiceData: 当前数据包数据, 流式模式下数据包大小可以按需设置,在网络良好的情况下,建议设置为1k,且必须保证分片帧完整(16bit的数据必须保证音频长度为偶数),编码格式要求为BASE64。
184
+ # @type UserVoiceData: String
185
+ # @param SessionId: 语音段唯一标识,一段完整语音使用一个SessionId,不同语音段的评测需要使用不同的SessionId。一般使用uuid(通用唯一识别码)来作为它的值,要尽量保证SessionId的唯一性。
186
+ # @type SessionId: String
187
+ # @param Keywords: 关键词列表
188
+ # @type Keywords: Array
189
+ # @param SoeAppId: 业务应用ID,与账号应用APPID无关,是用来方便客户管理服务的参数,新的 SoeAppId 可以在[控制台](https://console.cloud.tencent.com/soe)【应用管理】下新建。如果没有新建SoeAppId,请勿填入该参数,否则会报欠费错误。
190
+ # @type SoeAppId: String
191
+ # @param IsQuery: 查询标识,当该参数为1时,该请求为查询请求,请求返回该 Session 评估结果。
192
+ # @type IsQuery: Integer
193
+
194
+ attr_accessor :SeqId, :IsEnd, :VoiceFileType, :VoiceEncodeType, :UserVoiceData, :SessionId, :Keywords, :SoeAppId, :IsQuery
195
+
196
+ def initialize(seqid=nil, isend=nil, voicefiletype=nil, voiceencodetype=nil, uservoicedata=nil, sessionid=nil, keywords=nil, soeappid=nil, isquery=nil)
197
+ @SeqId = seqid
198
+ @IsEnd = isend
199
+ @VoiceFileType = voicefiletype
200
+ @VoiceEncodeType = voiceencodetype
201
+ @UserVoiceData = uservoicedata
202
+ @SessionId = sessionid
203
+ @Keywords = keywords
204
+ @SoeAppId = soeappid
205
+ @IsQuery = isquery
206
+ end
207
+
208
+ def deserialize(params)
209
+ @SeqId = params['SeqId']
210
+ @IsEnd = params['IsEnd']
211
+ @VoiceFileType = params['VoiceFileType']
212
+ @VoiceEncodeType = params['VoiceEncodeType']
213
+ @UserVoiceData = params['UserVoiceData']
214
+ @SessionId = params['SessionId']
215
+ unless params['Keywords'].nil?
216
+ @Keywords = []
217
+ params['Keywords'].each do |i|
218
+ keyword_tmp = Keyword.new
219
+ keyword_tmp.deserialize(i)
220
+ @Keywords << keyword_tmp
221
+ end
222
+ end
223
+ @SoeAppId = params['SoeAppId']
224
+ @IsQuery = params['IsQuery']
225
+ end
226
+ end
227
+
228
+ # KeywordEvaluate返回参数结构体
229
+ class KeywordEvaluateResponse < TencentCloud::Common::AbstractModel
230
+ # @param KeywordScores: 关键词得分
231
+ # @type KeywordScores: Array
232
+ # @param SessionId: 语音段唯一标识,一段完整语音使用一个SessionId,不同语音段的评测需要使用不同的SessionId。一般使用uuid(通用唯一识别码)来作为它的值,要尽量保证SessionId的唯一性。
233
+ # @type SessionId: String
234
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
235
+ # @type RequestId: String
236
+
237
+ attr_accessor :KeywordScores, :SessionId, :RequestId
238
+
239
+ def initialize(keywordscores=nil, sessionid=nil, requestid=nil)
240
+ @KeywordScores = keywordscores
241
+ @SessionId = sessionid
242
+ @RequestId = requestid
243
+ end
244
+
245
+ def deserialize(params)
246
+ unless params['KeywordScores'].nil?
247
+ @KeywordScores = []
248
+ params['KeywordScores'].each do |i|
249
+ keywordscore_tmp = KeywordScore.new
250
+ keywordscore_tmp.deserialize(i)
251
+ @KeywordScores << keywordscore_tmp
252
+ end
253
+ end
254
+ @SessionId = params['SessionId']
255
+ @RequestId = params['RequestId']
256
+ end
257
+ end
258
+
259
+ # 关键词得分
260
+ class KeywordScore < TencentCloud::Common::AbstractModel
261
+ # @param Keyword: 关键词
262
+ # @type Keyword: String
263
+ # @param PronAccuracy: 发音精准度,取值范围[-1, 100],当取-1时指完全不匹配,当为句子模式时,是所有已识别单词准确度的加权平均值,在reftext中但未识别出来的词不计入分数中。当为流式模式且请求中IsEnd未置1时,取值无意义。
264
+ # @type PronAccuracy: Float
265
+ # @param PronFluency: 发音流利度,取值范围[0, 1],当为词模式时,取值无意义;当为流式模式且请求中IsEnd未置1时,取值无意义
266
+ # @type PronFluency: Float
267
+ # @param PronCompletion: 发音完整度,取值范围[0, 1],当为词模式时,取值无意义;当为流式模式且请求中IsEnd未置1时,取值无意义
268
+ # @type PronCompletion: Float
269
+ # @param Words: 详细发音评估结果
270
+ # 注意:此字段可能返回 null,表示取不到有效值。
271
+ # @type Words: Array
272
+ # @param SuggestedScore: 建议评分,取值范围[0,100],评分方式为建议评分 = 准确度(PronAccuracyfloat)× 完整度(PronCompletionfloat)×(2 - 完整度(PronCompletionfloat)),如若评分策略不符合请参考Words数组中的详细分数自定义评分逻辑。
273
+ # @type SuggestedScore: Float
274
+
275
+ attr_accessor :Keyword, :PronAccuracy, :PronFluency, :PronCompletion, :Words, :SuggestedScore
276
+
277
+ def initialize(keyword=nil, pronaccuracy=nil, pronfluency=nil, proncompletion=nil, words=nil, suggestedscore=nil)
278
+ @Keyword = keyword
279
+ @PronAccuracy = pronaccuracy
280
+ @PronFluency = pronfluency
281
+ @PronCompletion = proncompletion
282
+ @Words = words
283
+ @SuggestedScore = suggestedscore
284
+ end
285
+
286
+ def deserialize(params)
287
+ @Keyword = params['Keyword']
288
+ @PronAccuracy = params['PronAccuracy']
289
+ @PronFluency = params['PronFluency']
290
+ @PronCompletion = params['PronCompletion']
291
+ unless params['Words'].nil?
292
+ @Words = []
293
+ params['Words'].each do |i|
294
+ wordrsp_tmp = WordRsp.new
295
+ wordrsp_tmp.deserialize(i)
296
+ @Words << wordrsp_tmp
297
+ end
298
+ end
299
+ @SuggestedScore = params['SuggestedScore']
300
+ end
301
+ end
302
+
303
+ # 单音节评价结果
304
+ class PhoneInfo < TencentCloud::Common::AbstractModel
305
+ # @param MemBeginTime: 当前音节语音起始时间点,单位为ms
306
+ # @type MemBeginTime: Integer
307
+ # @param MemEndTime: 当前音节语音终止时间点,单位为ms
308
+ # @type MemEndTime: Integer
309
+ # @param PronAccuracy: 音节发音准确度,取值范围[-1, 100],当取-1时指完全不匹配
310
+ # @type PronAccuracy: Float
311
+ # @param DetectedStress: 当前音节是否检测为重音
312
+ # @type DetectedStress: Boolean
313
+ # @param Phone: 当前音节,当前评测识别的音素
314
+ # @type Phone: String
315
+ # @param Stress: 当前音节是否应为重音
316
+ # @type Stress: Boolean
317
+ # @param ReferencePhone: 参考音素,在单词诊断模式下,代表标准音素
318
+ # @type ReferencePhone: String
319
+ # @param MatchTag: 当前词与输入语句的匹配情况,0:匹配单词、1:新增单词、2:缺少单词、3:错读的词、4:未录入单词。
320
+ # @type MatchTag: Integer
321
+ # @param ReferenceLetter: 参考字符,在单词诊断模式下,代表音素对应的原始文本
322
+ # @type ReferenceLetter: String
323
+
324
+ attr_accessor :MemBeginTime, :MemEndTime, :PronAccuracy, :DetectedStress, :Phone, :Stress, :ReferencePhone, :MatchTag, :ReferenceLetter
325
+
326
+ def initialize(membegintime=nil, memendtime=nil, pronaccuracy=nil, detectedstress=nil, phone=nil, stress=nil, referencephone=nil, matchtag=nil, referenceletter=nil)
327
+ @MemBeginTime = membegintime
328
+ @MemEndTime = memendtime
329
+ @PronAccuracy = pronaccuracy
330
+ @DetectedStress = detectedstress
331
+ @Phone = phone
332
+ @Stress = stress
333
+ @ReferencePhone = referencephone
334
+ @MatchTag = matchtag
335
+ @ReferenceLetter = referenceletter
336
+ end
337
+
338
+ def deserialize(params)
339
+ @MemBeginTime = params['MemBeginTime']
340
+ @MemEndTime = params['MemEndTime']
341
+ @PronAccuracy = params['PronAccuracy']
342
+ @DetectedStress = params['DetectedStress']
343
+ @Phone = params['Phone']
344
+ @Stress = params['Stress']
345
+ @ReferencePhone = params['ReferencePhone']
346
+ @MatchTag = params['MatchTag']
347
+ @ReferenceLetter = params['ReferenceLetter']
348
+ end
349
+ end
350
+
351
+ # 语音过程中断句的中间结果
352
+ class SentenceInfo < TencentCloud::Common::AbstractModel
353
+ # @param SentenceId: 句子序号,在段落、自由说模式下有效,表示断句序号,最后的综合结果的为-1.
354
+ # @type SentenceId: Integer
355
+ # @param Words: 详细发音评估结果
356
+ # @type Words: Array
357
+ # @param PronAccuracy: 发音精准度,取值范围[-1, 100],当取-1时指完全不匹配,当为句子模式时,是所有已识别单词准确度的加权平均值,在reftext中但未识别出来的词不计入分数中。
358
+ # @type PronAccuracy: Float
359
+ # @param PronFluency: 发音流利度,取值范围[0, 1],当为词模式时,取值无意义;当为流式模式且请求中IsEnd未置1时,取值无意义
360
+ # @type PronFluency: Float
361
+ # @param PronCompletion: 发音完整度,取值范围[0, 1],当为词模式时,取值无意义;当为流式模式且请求中IsEnd未置1时,取值无意义
362
+ # @type PronCompletion: Float
363
+ # @param SuggestedScore: 建议评分,取值范围[0,100],评分方式为建议评分 = 准确度(PronAccuracyfloat)* 完整度(PronCompletionfloat)*(2 - 完整度(PronCompletionfloat)),如若评分策略不符合请参考Words数组中的详细分数自定义评分逻辑。
364
+ # @type SuggestedScore: Float
365
+
366
+ attr_accessor :SentenceId, :Words, :PronAccuracy, :PronFluency, :PronCompletion, :SuggestedScore
367
+
368
+ def initialize(sentenceid=nil, words=nil, pronaccuracy=nil, pronfluency=nil, proncompletion=nil, suggestedscore=nil)
369
+ @SentenceId = sentenceid
370
+ @Words = words
371
+ @PronAccuracy = pronaccuracy
372
+ @PronFluency = pronfluency
373
+ @PronCompletion = proncompletion
374
+ @SuggestedScore = suggestedscore
375
+ end
376
+
377
+ def deserialize(params)
378
+ @SentenceId = params['SentenceId']
379
+ unless params['Words'].nil?
380
+ @Words = []
381
+ params['Words'].each do |i|
382
+ wordrsp_tmp = WordRsp.new
383
+ wordrsp_tmp.deserialize(i)
384
+ @Words << wordrsp_tmp
385
+ end
386
+ end
387
+ @PronAccuracy = params['PronAccuracy']
388
+ @PronFluency = params['PronFluency']
389
+ @PronCompletion = params['PronCompletion']
390
+ @SuggestedScore = params['SuggestedScore']
391
+ end
392
+ end
393
+
394
+ # TransmitOralProcess请求参数结构体
395
+ class TransmitOralProcessRequest < TencentCloud::Common::AbstractModel
396
+ # @param SeqId: 流式数据包的序号,从1开始,当IsEnd字段为1后后续序号无意义,当IsLongLifeSession不为1且为非流式模式时无意义。
397
+ # 注意:序号上限为3000,不能超过上限。
398
+ # @type SeqId: Integer
399
+ # @param IsEnd: 是否传输完毕标志,若为0表示未完毕,若为1则传输完毕开始评估,非流式模式下无意义。
400
+ # @type IsEnd: Integer
401
+ # @param VoiceFileType: 语音文件类型
402
+ # 1: raw
403
+ # 2: wav
404
+ # 3: mp3
405
+ # 4: speex
406
+ # 语音文件格式目前仅支持 16k 采样率 16bit 编码单声道,如有不一致可能导致评估不准确或失败。
407
+ # @type VoiceFileType: Integer
408
+ # @param VoiceEncodeType: 语音编码类型
409
+ # 1:pcm
410
+ # @type VoiceEncodeType: Integer
411
+ # @param UserVoiceData: 当前数据包数据, 流式模式下数据包大小可以按需设置,在网络稳定时,分片大小建议设置0.5k,且必须保证分片帧完整(16bit的数据必须保证音频长度为偶数),编码格式要求为BASE64。
412
+ # @type UserVoiceData: String
413
+ # @param SessionId: 语音段唯一标识,一段完整语音使用一个SessionId,不同语音段的评测需要使用不同的SessionId。一般使用uuid(通用唯一识别码)来作为它的值,要尽量保证SessionId的唯一性。
414
+ # @type SessionId: String
415
+ # @param SoeAppId: 业务应用ID,与账号应用APPID无关,是用来方便客户管理服务的参数,新的 SoeAppId 可以在[控制台](https://console.cloud.tencent.com/soe)【应用管理】下新建。如果没有新建SoeAppId,请勿填入该参数,否则会报欠费错误。
416
+ # @type SoeAppId: String
417
+ # @param IsLongLifeSession: 长效session标识,当该参数为1时,session的持续时间为300s,但会一定程度上影响第一个数据包的返回速度。当InitOralProcess接口调用时此项为1时,此项必填1才可生效。
418
+ # @type IsLongLifeSession: Integer
419
+ # @param IsQuery: 查询标识,当该参数为1时,该请求为查询请求,请求返回该 Session 的评估结果。
420
+ # @type IsQuery: Integer
421
+
422
+ attr_accessor :SeqId, :IsEnd, :VoiceFileType, :VoiceEncodeType, :UserVoiceData, :SessionId, :SoeAppId, :IsLongLifeSession, :IsQuery
423
+
424
+ def initialize(seqid=nil, isend=nil, voicefiletype=nil, voiceencodetype=nil, uservoicedata=nil, sessionid=nil, soeappid=nil, islonglifesession=nil, isquery=nil)
425
+ @SeqId = seqid
426
+ @IsEnd = isend
427
+ @VoiceFileType = voicefiletype
428
+ @VoiceEncodeType = voiceencodetype
429
+ @UserVoiceData = uservoicedata
430
+ @SessionId = sessionid
431
+ @SoeAppId = soeappid
432
+ @IsLongLifeSession = islonglifesession
433
+ @IsQuery = isquery
434
+ end
435
+
436
+ def deserialize(params)
437
+ @SeqId = params['SeqId']
438
+ @IsEnd = params['IsEnd']
439
+ @VoiceFileType = params['VoiceFileType']
440
+ @VoiceEncodeType = params['VoiceEncodeType']
441
+ @UserVoiceData = params['UserVoiceData']
442
+ @SessionId = params['SessionId']
443
+ @SoeAppId = params['SoeAppId']
444
+ @IsLongLifeSession = params['IsLongLifeSession']
445
+ @IsQuery = params['IsQuery']
446
+ end
447
+ end
448
+
449
+ # TransmitOralProcess返回参数结构体
450
+ class TransmitOralProcessResponse < TencentCloud::Common::AbstractModel
451
+ # @param PronAccuracy: 发音精准度,取值范围[-1, 100],当取-1时指完全不匹配,当为句子模式时,是所有已识别单词准确度的加权平均值,在reftext中但未识别出来的词不计入分数中。当为流式模式且请求中IsEnd未置1时,取值无意义。
452
+ # @type PronAccuracy: Float
453
+ # @param PronFluency: 发音流利度,取值范围[0, 1],当为词模式时,取值无意义;当为流式模式且请求中IsEnd未置1时,取值无意义
454
+ # @type PronFluency: Float
455
+ # @param PronCompletion: 发音完整度,取值范围[0, 1],当为词模式时,取值无意义;当为流式模式且请求中IsEnd未置1时,取值无意义
456
+ # @type PronCompletion: Float
457
+ # @param Words: 详细发音评估结果
458
+ # @type Words: Array
459
+ # @param SessionId: 语音段唯一标识,一段语音一个SessionId
460
+ # @type SessionId: String
461
+ # @param AudioUrl: 保存语音音频文件下载地址
462
+ # @type AudioUrl: String
463
+ # @param SentenceInfoSet: 断句中间结果,中间结果是局部最优而非全局最优的结果,所以中间结果有可能和最终整体结果对应部分不一致;中间结果的输出便于客户端UI更新;待用户发音完全结束后,系统会给出一个综合所有句子的整体结果。
464
+ # @type SentenceInfoSet: Array
465
+ # @param Status: 评估 session 状态,“Evaluating":评估中、"Failed":评估失败、"Finished":评估完成
466
+ # @type Status: String
467
+ # @param SuggestedScore: 建议评分,取值范围[0,100],评分方式为建议评分 = 准确度(PronAccuracyfloat)× 完整度(PronCompletionfloat)×(2 - 完整度(PronCompletionfloat)),如若评分策略不符合请参考Words数组中的详细分数自定义评分逻辑。
468
+ # @type SuggestedScore: Float
469
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
470
+ # @type RequestId: String
471
+
472
+ attr_accessor :PronAccuracy, :PronFluency, :PronCompletion, :Words, :SessionId, :AudioUrl, :SentenceInfoSet, :Status, :SuggestedScore, :RequestId
473
+
474
+ def initialize(pronaccuracy=nil, pronfluency=nil, proncompletion=nil, words=nil, sessionid=nil, audiourl=nil, sentenceinfoset=nil, status=nil, suggestedscore=nil, requestid=nil)
475
+ @PronAccuracy = pronaccuracy
476
+ @PronFluency = pronfluency
477
+ @PronCompletion = proncompletion
478
+ @Words = words
479
+ @SessionId = sessionid
480
+ @AudioUrl = audiourl
481
+ @SentenceInfoSet = sentenceinfoset
482
+ @Status = status
483
+ @SuggestedScore = suggestedscore
484
+ @RequestId = requestid
485
+ end
486
+
487
+ def deserialize(params)
488
+ @PronAccuracy = params['PronAccuracy']
489
+ @PronFluency = params['PronFluency']
490
+ @PronCompletion = params['PronCompletion']
491
+ unless params['Words'].nil?
492
+ @Words = []
493
+ params['Words'].each do |i|
494
+ wordrsp_tmp = WordRsp.new
495
+ wordrsp_tmp.deserialize(i)
496
+ @Words << wordrsp_tmp
497
+ end
498
+ end
499
+ @SessionId = params['SessionId']
500
+ @AudioUrl = params['AudioUrl']
501
+ unless params['SentenceInfoSet'].nil?
502
+ @SentenceInfoSet = []
503
+ params['SentenceInfoSet'].each do |i|
504
+ sentenceinfo_tmp = SentenceInfo.new
505
+ sentenceinfo_tmp.deserialize(i)
506
+ @SentenceInfoSet << sentenceinfo_tmp
507
+ end
508
+ end
509
+ @Status = params['Status']
510
+ @SuggestedScore = params['SuggestedScore']
511
+ @RequestId = params['RequestId']
512
+ end
513
+ end
514
+
515
+ # TransmitOralProcessWithInit请求参数结构体
516
+ class TransmitOralProcessWithInitRequest < TencentCloud::Common::AbstractModel
517
+ # @param SeqId: 流式数据包的序号,从1开始,当IsEnd字段为1后后续序号无意义,当IsLongLifeSession不为1且为非流式模式时无意义。
518
+ # 注意:序号上限为3000,不能超过上限。
519
+ # @type SeqId: Integer
520
+ # @param IsEnd: 是否传输完毕标志,若为0表示未完毕,若为1则传输完毕开始评估,非流式模式下无意义。
521
+ # @type IsEnd: Integer
522
+ # @param VoiceFileType: 语音文件类型
523
+ # 1: raw
524
+ # 2: wav
525
+ # 3: mp3
526
+ # 4: speex
527
+ # 语音文件格式目前仅支持 16k 采样率 16bit 编码单声道,如有不一致可能导致评估不准确或失败。
528
+ # @type VoiceFileType: Integer
529
+ # @param VoiceEncodeType: 语音编码类型
530
+ # 1:pcm
531
+ # @type VoiceEncodeType: Integer
532
+ # @param UserVoiceData: 当前数据包数据, 流式模式下数据包大小可以按需设置,在网络良好的情况下,建议设置为1k,且必须保证分片帧完整(16bit的数据必须保证音频长度为偶数),编码格式要求为BASE64。
533
+ # @type UserVoiceData: String
534
+ # @param SessionId: 语音段唯一标识,一段完整语音使用一个SessionId,不同语音段的评测需要使用不同的SessionId。一般使用uuid(通用唯一识别码)来作为它的值,要尽量保证SessionId的唯一性。
535
+ # @type SessionId: String
536
+ # @param RefText: 被评估语音对应的文本,仅支持中文和英文。
537
+ # 句子模式下不超过个 30 单词或者中文文字,段落模式不超过 120 单词或者中文文字,中文评估使用 utf-8 编码,自由说模式该值无效。
538
+ # 关于RefText的文本键入要求,请参考[评测模式介绍](https://cloud.tencent.com/document/product/884/56131)。
539
+ # 如需要在评测模式下使用自定义注音(支持中英文),可以通过设置「TextMode」参数实现,设置方式请参考[音素标注](https://cloud.tencent.com/document/product/884/33698)。
540
+ # @type RefText: String
541
+ # @param WorkMode: 语音输入模式
542
+ # 0:流式分片
543
+ # 1:非流式一次性评估
544
+ # 推荐使用流式分片传输。
545
+ # @type WorkMode: Integer
546
+ # @param EvalMode: 评测模式
547
+ # 0:单词/单字模式(中文评测模式下为单字模式)
548
+ # 1:句子模式
549
+ # 2:段落模式
550
+ # 3:自由说模式
551
+ # 4:单词音素纠错模式
552
+ # 5:情景评测模式
553
+ # 6:句子多分支评测模式
554
+ # 7:单词实时评测模式
555
+ # 8:拼音评测模式
556
+ # 关于每种评测模式的详细介绍,以及适用场景,请参考[评测模式介绍](https://cloud.tencent.com/document/product/884/56131)。
557
+ # @type EvalMode: Integer
558
+ # @param ScoreCoeff: 评价苛刻指数。取值为[1.0 - 4.0]范围内的浮点数,用于平滑不同年龄段的分数。
559
+ # 1.0:适用于最小年龄段用户,一般对应儿童应用场景;
560
+ # 4.0:适用于最高年龄段用户,一般对应成人严格打分场景。
561
+ # @type ScoreCoeff: Float
562
+ # @param SoeAppId: 业务应用ID,与账号应用APPID无关,是用来方便客户管理服务的参数,新的 SoeAppId 可以在[控制台](https://console.cloud.tencent.com/soe)【应用管理】下新建。如果没有新建SoeAppId,请勿填入该参数,否则会报欠费错误。
563
+ # @type SoeAppId: String
564
+ # @param StorageMode: 音频存储模式
565
+ # 0:不存储
566
+ # 1:存储到公共对象存储,不会产生费用,存储时间为一个月。输出结果为该会话最后一个分片TransmitOralProcess 返回结果 AudioUrl 字段;
567
+ # 2:永久存储音频,需要提工单申请,会产生一定的存储费用;
568
+ # 3:自定义存储,将音频存储到自定义的腾讯云[对象存储](https://cloud.tencent.com/product/cos)中。
569
+ # 注:对可用性要求较高的用户建议自行存储至腾讯云COS。
570
+ # @type StorageMode: Integer
571
+ # @param SentenceInfoEnabled: 输出断句中间结果标识
572
+ # 0:不输出
573
+ # 1:输出,通过设置该参数
574
+ # 可以在评估过程中的分片传输请求中,返回已经评估断句的中间结果,中间结果可用于客户端 UI 更新,输出结果为TransmitOralProcess请求返回结果 SentenceInfoSet 字段。
575
+ # @type SentenceInfoEnabled: Integer
576
+ # @param ServerType: 评估语言
577
+ # 0:英文
578
+ # 1:中文
579
+ # @type ServerType: Integer
580
+ # @param IsAsync: 异步模式标识
581
+ # 0:同步模式
582
+ # 1:异步模式(一般情况不建议使用异步模式)
583
+ # 可选值参考[服务模式](https://cloud.tencent.com/document/product/884/33697)。
584
+ # @type IsAsync: Integer
585
+ # @param IsQuery: 查询标识,当该参数为1时,该请求为查询请求,请求返回该 Session 评估结果。
586
+ # @type IsQuery: Integer
587
+ # @param TextMode: 输入文本模式
588
+ # 0: 普通文本
589
+ # 1:[音素结构](https://cloud.tencent.com/document/product/884/33698)文本
590
+ # 2:音素注册模式(提工单注册需要使用音素的单词)。
591
+ # @type TextMode: Integer
592
+
593
+ attr_accessor :SeqId, :IsEnd, :VoiceFileType, :VoiceEncodeType, :UserVoiceData, :SessionId, :RefText, :WorkMode, :EvalMode, :ScoreCoeff, :SoeAppId, :StorageMode, :SentenceInfoEnabled, :ServerType, :IsAsync, :IsQuery, :TextMode
594
+
595
+ def initialize(seqid=nil, isend=nil, voicefiletype=nil, voiceencodetype=nil, uservoicedata=nil, sessionid=nil, reftext=nil, workmode=nil, evalmode=nil, scorecoeff=nil, soeappid=nil, storagemode=nil, sentenceinfoenabled=nil, servertype=nil, isasync=nil, isquery=nil, textmode=nil)
596
+ @SeqId = seqid
597
+ @IsEnd = isend
598
+ @VoiceFileType = voicefiletype
599
+ @VoiceEncodeType = voiceencodetype
600
+ @UserVoiceData = uservoicedata
601
+ @SessionId = sessionid
602
+ @RefText = reftext
603
+ @WorkMode = workmode
604
+ @EvalMode = evalmode
605
+ @ScoreCoeff = scorecoeff
606
+ @SoeAppId = soeappid
607
+ @StorageMode = storagemode
608
+ @SentenceInfoEnabled = sentenceinfoenabled
609
+ @ServerType = servertype
610
+ @IsAsync = isasync
611
+ @IsQuery = isquery
612
+ @TextMode = textmode
613
+ end
614
+
615
+ def deserialize(params)
616
+ @SeqId = params['SeqId']
617
+ @IsEnd = params['IsEnd']
618
+ @VoiceFileType = params['VoiceFileType']
619
+ @VoiceEncodeType = params['VoiceEncodeType']
620
+ @UserVoiceData = params['UserVoiceData']
621
+ @SessionId = params['SessionId']
622
+ @RefText = params['RefText']
623
+ @WorkMode = params['WorkMode']
624
+ @EvalMode = params['EvalMode']
625
+ @ScoreCoeff = params['ScoreCoeff']
626
+ @SoeAppId = params['SoeAppId']
627
+ @StorageMode = params['StorageMode']
628
+ @SentenceInfoEnabled = params['SentenceInfoEnabled']
629
+ @ServerType = params['ServerType']
630
+ @IsAsync = params['IsAsync']
631
+ @IsQuery = params['IsQuery']
632
+ @TextMode = params['TextMode']
633
+ end
634
+ end
635
+
636
+ # TransmitOralProcessWithInit返回参数结构体
637
+ class TransmitOralProcessWithInitResponse < TencentCloud::Common::AbstractModel
638
+ # @param PronAccuracy: 发音精准度,取值范围[-1, 100],当取-1时指完全不匹配,当为句子模式时,是所有已识别单词准确度的加权平均值,在reftext中但未识别出来的词不计入分数中。当为流式模式且请求中IsEnd未置1时,取值无意义。
639
+ # @type PronAccuracy: Float
640
+ # @param PronFluency: 发音流利度,取值范围[0, 1],当为词模式时,取值无意义;当为流式模式且请求中IsEnd未置1时,取值无意义
641
+ # @type PronFluency: Float
642
+ # @param PronCompletion: 发音完整度,取值范围[0, 1],当为词模式时,取值无意义;当为流式模式且请求中IsEnd未置1时,取值无意义
643
+ # @type PronCompletion: Float
644
+ # @param Words: 详细发音评估结果
645
+ # @type Words: Array
646
+ # @param SessionId: 语音段唯一标识,一段语音一个SessionId
647
+ # @type SessionId: String
648
+ # @param AudioUrl: 保存语音音频文件下载地址
649
+ # @type AudioUrl: String
650
+ # @param SentenceInfoSet: 断句中间结果,中间结果是局部最优而非全局最优的结果,所以中间结果有可能和最终整体结果对应部分不一致;中间结果的输出便于客户端UI更新;待用户发音完全结束后,系统会给出一个综合所有句子的整体结果。
651
+ # @type SentenceInfoSet: Array
652
+ # @param Status: 评估 session 状态,“Evaluating":评估中、"Failed":评估失败、"Finished":评估完成
653
+ # @type Status: String
654
+ # @param SuggestedScore: 建议评分,取值范围[0,100],评分方式为建议评分 = 准确度(PronAccuracyfloat)× 完整度(PronCompletionfloat)×(2 - 完整度(PronCompletionfloat)),如若评分策略不符合请参考Words数组中的详细分数自定义评分逻辑。
655
+ # @type SuggestedScore: Float
656
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
657
+ # @type RequestId: String
658
+
659
+ attr_accessor :PronAccuracy, :PronFluency, :PronCompletion, :Words, :SessionId, :AudioUrl, :SentenceInfoSet, :Status, :SuggestedScore, :RequestId
660
+
661
+ def initialize(pronaccuracy=nil, pronfluency=nil, proncompletion=nil, words=nil, sessionid=nil, audiourl=nil, sentenceinfoset=nil, status=nil, suggestedscore=nil, requestid=nil)
662
+ @PronAccuracy = pronaccuracy
663
+ @PronFluency = pronfluency
664
+ @PronCompletion = proncompletion
665
+ @Words = words
666
+ @SessionId = sessionid
667
+ @AudioUrl = audiourl
668
+ @SentenceInfoSet = sentenceinfoset
669
+ @Status = status
670
+ @SuggestedScore = suggestedscore
671
+ @RequestId = requestid
672
+ end
673
+
674
+ def deserialize(params)
675
+ @PronAccuracy = params['PronAccuracy']
676
+ @PronFluency = params['PronFluency']
677
+ @PronCompletion = params['PronCompletion']
678
+ unless params['Words'].nil?
679
+ @Words = []
680
+ params['Words'].each do |i|
681
+ wordrsp_tmp = WordRsp.new
682
+ wordrsp_tmp.deserialize(i)
683
+ @Words << wordrsp_tmp
684
+ end
685
+ end
686
+ @SessionId = params['SessionId']
687
+ @AudioUrl = params['AudioUrl']
688
+ unless params['SentenceInfoSet'].nil?
689
+ @SentenceInfoSet = []
690
+ params['SentenceInfoSet'].each do |i|
691
+ sentenceinfo_tmp = SentenceInfo.new
692
+ sentenceinfo_tmp.deserialize(i)
693
+ @SentenceInfoSet << sentenceinfo_tmp
694
+ end
695
+ end
696
+ @Status = params['Status']
697
+ @SuggestedScore = params['SuggestedScore']
698
+ @RequestId = params['RequestId']
699
+ end
700
+ end
701
+
702
+ # 单词评分细则
703
+ class WordRsp < TencentCloud::Common::AbstractModel
704
+ # @param MemBeginTime: 当前单词语音起始时间点,单位为ms,该字段段落模式下无意义。
705
+ # @type MemBeginTime: Integer
706
+ # @param MemEndTime: 当前单词语音终止时间点,单位为ms,该字段段落模式下无意义。
707
+ # @type MemEndTime: Integer
708
+ # @param PronAccuracy: 单词发音准确度,取值范围[-1, 100],当取-1时指完全不匹配
709
+ # @type PronAccuracy: Float
710
+ # @param PronFluency: 单词发音流利度,取值范围[0, 1]
711
+ # @type PronFluency: Float
712
+ # @param Word: 当前词
713
+ # @type Word: String
714
+ # @param MatchTag: 当前词与输入语句的匹配情况,0:匹配单词、1:新增单词、2:缺少单词、3:错读的词、4:未录入单词。
715
+ # @type MatchTag: Integer
716
+ # @param PhoneInfos: 音节评估详情
717
+ # @type PhoneInfos: Array
718
+ # @param ReferenceWord: 参考词,目前为保留字段。
719
+ # @type ReferenceWord: String
720
+
721
+ attr_accessor :MemBeginTime, :MemEndTime, :PronAccuracy, :PronFluency, :Word, :MatchTag, :PhoneInfos, :ReferenceWord
722
+
723
+ def initialize(membegintime=nil, memendtime=nil, pronaccuracy=nil, pronfluency=nil, word=nil, matchtag=nil, phoneinfos=nil, referenceword=nil)
724
+ @MemBeginTime = membegintime
725
+ @MemEndTime = memendtime
726
+ @PronAccuracy = pronaccuracy
727
+ @PronFluency = pronfluency
728
+ @Word = word
729
+ @MatchTag = matchtag
730
+ @PhoneInfos = phoneinfos
731
+ @ReferenceWord = referenceword
732
+ end
733
+
734
+ def deserialize(params)
735
+ @MemBeginTime = params['MemBeginTime']
736
+ @MemEndTime = params['MemEndTime']
737
+ @PronAccuracy = params['PronAccuracy']
738
+ @PronFluency = params['PronFluency']
739
+ @Word = params['Word']
740
+ @MatchTag = params['MatchTag']
741
+ unless params['PhoneInfos'].nil?
742
+ @PhoneInfos = []
743
+ params['PhoneInfos'].each do |i|
744
+ phoneinfo_tmp = PhoneInfo.new
745
+ phoneinfo_tmp.deserialize(i)
746
+ @PhoneInfos << phoneinfo_tmp
747
+ end
748
+ end
749
+ @ReferenceWord = params['ReferenceWord']
750
+ end
751
+ end
752
+
753
+ end
754
+ end
755
+ end
756
+
metadata ADDED
@@ -0,0 +1,66 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tencentcloud-sdk-soe
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.200
5
+ platform: ruby
6
+ authors:
7
+ - Tencent Cloud
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-11-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: tencentcloud-sdk-common
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ description: Tencent Cloud Ruby SDK is the official software development kit, which
28
+ allows Ruby developers to write software that makes use of Tencent Cloud service
29
+ SOE.
30
+ email:
31
+ - tencentcloudapi@tencent.com
32
+ executables: []
33
+ extensions: []
34
+ extra_rdoc_files: []
35
+ files:
36
+ - lib/VERSION
37
+ - lib/tencentcloud-sdk-soe.rb
38
+ - lib/v20180724/client.rb
39
+ - lib/v20180724/models.rb
40
+ homepage: https://github.com/TencentCloud/tencentcloud-sdk-ruby
41
+ licenses:
42
+ - Apache-2.0
43
+ metadata:
44
+ source_code_uri: https://github.com/TencentCloud/tencentcloud-sdk-ruby/tencentcloud-sdk-soe
45
+ changelog_uri: https://github.com/TencentCloud/tencentcloud-sdk-ruby/blob/master/CHANGELOG.md
46
+ post_install_message:
47
+ rdoc_options: []
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ requirements: []
61
+ rubyforge_project:
62
+ rubygems_version: 2.6.14
63
+ signing_key:
64
+ specification_version: 4
65
+ summary: Tencent Cloud SDK for Ruby - SOE
66
+ test_files: []