tencentcloud-sdk-ims 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.
@@ -0,0 +1,647 @@
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 Ims
19
+ module V20201229
20
+ # 用于表示业务用户对应的设备信息
21
+ class Device < TencentCloud::Common::AbstractModel
22
+ # @param Ip: 该字段表示业务用户对应设备的IP地址,同时**支持IPv4和IPv6**地址的记录;需要与IpType参数配合使用。
23
+ # @type Ip: String
24
+ # @param Mac: 该字段表示业务用户对应的MAC地址,以方便设备识别与管理;其格式与取值与标准MAC地址一致。
25
+ # @type Mac: String
26
+ # @param TokenId: *内测中,敬请期待。*
27
+ # @type TokenId: String
28
+ # @param DeviceId: *内测中,敬请期待。*
29
+ # @type DeviceId: String
30
+ # @param IMEI: 该字段表示业务用户对应设备的**IMEI码**(国际移动设备识别码),该识别码可用于识别每一部独立的手机等移动通信设备,方便设备识别与管理。<br>备注:格式为**15-17位纯数字**。
31
+ # @type IMEI: String
32
+ # @param IDFA: **iOS设备专用**,该字段表示业务用户对应的**IDFA**(广告标识符),这是由苹果公司提供的用于追踪用户的广告标识符,由一串16进制的32位数字和字母组成。<br>
33
+ # 备注:苹果公司自2021年iOS14更新后允许用户手动关闭或者开启IDFA,故此字符串标记有效性可能有所降低。
34
+ # @type IDFA: String
35
+ # @param IDFV: **iOS设备专用**,该字段表示业务用户对应的**IDFV**(应用开发商标识符),这是由苹果公司提供的用于标注应用开发商的标识符,由一串16进制的32位数字和字母组成,可被用于唯一标识设备。
36
+ # @type IDFV: String
37
+ # @param IpType: 该字段表示记录的IP地址的类型,取值:**0**(代表IPv4地址)、**1**(代表IPv6地址);需要与IpType参数配合使用。
38
+ # @type IpType: Integer
39
+
40
+ attr_accessor :Ip, :Mac, :TokenId, :DeviceId, :IMEI, :IDFA, :IDFV, :IpType
41
+
42
+ def initialize(ip=nil, mac=nil, tokenid=nil, deviceid=nil, imei=nil, idfa=nil, idfv=nil, iptype=nil)
43
+ @Ip = ip
44
+ @Mac = mac
45
+ @TokenId = tokenid
46
+ @DeviceId = deviceid
47
+ @IMEI = imei
48
+ @IDFA = idfa
49
+ @IDFV = idfv
50
+ @IpType = iptype
51
+ end
52
+
53
+ def deserialize(params)
54
+ @Ip = params['Ip']
55
+ @Mac = params['Mac']
56
+ @TokenId = params['TokenId']
57
+ @DeviceId = params['DeviceId']
58
+ @IMEI = params['IMEI']
59
+ @IDFA = params['IDFA']
60
+ @IDFV = params['IDFV']
61
+ @IpType = params['IpType']
62
+ end
63
+ end
64
+
65
+ # ImageModeration请求参数结构体
66
+ class ImageModerationRequest < TencentCloud::Common::AbstractModel
67
+ # @param BizType: 该字段表示策略的具体编号,用于接口调度,在内容安全控制台中可配置。若不传入Biztype参数(留空),则代表采用默认的识别策略;传入则会在审核时根据业务场景采取不同的审核策略。<br>备注:Biztype仅为数字、字母与下划线的组合,长度为3-32个字符;不同Biztype关联不同的业务场景与识别能力策略,调用前请确认正确的Biztype。
68
+ # @type BizType: String
69
+ # @param DataId: 该字段表示您为待检测对象分配的数据ID,传入后可方便您对文件进行标识和管理。<br>取值:由英文字母(大小写均可)、数字及四个特殊符号(_,-,@,#)组成,**长度不超过64个字符**。
70
+ # @type DataId: String
71
+ # @param FileContent: 该字段表示待检测图片文件内容的Base64编码,图片**大小不超过5MB**,建议**分辨率不低于256x256**,否则可能会影响识别效果。<br>备注: **该字段与FileUrl必须选择输入其中一个**。
72
+ # @type FileContent: String
73
+ # @param FileUrl: 该字段表示待检测图片文件的访问链接,图片支持PNG、JPG、JPEG、BMP、GIF、WEBP格式,**大小不超过5MB**,建议**分辨率不低于256x256**;图片下载时间限制为3秒,超过则会返回下载超时。<br>备注:**该字段与FileContent必须选择输入其中一个**。
74
+ # @type FileUrl: String
75
+ # @param Interval: **GIF/长图检测专用**,用于表示GIF截帧频率(每隔多少张图片抽取一帧进行检测),长图则按照长边:短边取整计算要切割的总图数;默认值为0,此时只会检测GIF的第一帧或对长图不进行切分处理。<br>备注:Interval与MaxFrames参数需要组合使用。例如,Interval=3, MaxFrames=400,则代表在检测GIF/长图时,将每间隔2帧检测一次且最多检测400帧。
76
+ # @type Interval: Integer
77
+ # @param MaxFrames: **GIF/长图检测专用**,用于标识最大截帧数量;默认值为1,此时只会检测输入GIF的第一帧或对长图不进行切分处理(可能会造成处理超时)。<br>备注:Interval与MaxFrames参数需要组合使用。例如,Interval=3, MaxFrames=400,则代表在检测GIF/长图时,将每间隔2帧检测一次且最多检测400帧。
78
+ # @type MaxFrames: Integer
79
+ # @param User: 该字段表示待检测对象对应的用户相关信息,若填入则可甄别相应违规风险用户。
80
+ # @type User: :class:`Tencentcloud::Ims.v20201229.models.User`
81
+ # @param Device: 该字段表示待检测对象对应的设备相关信息,若填入则可甄别相应违规风险设备。
82
+ # @type Device: :class:`Tencentcloud::Ims.v20201229.models.Device`
83
+
84
+ attr_accessor :BizType, :DataId, :FileContent, :FileUrl, :Interval, :MaxFrames, :User, :Device
85
+
86
+ def initialize(biztype=nil, dataid=nil, filecontent=nil, fileurl=nil, interval=nil, maxframes=nil, user=nil, device=nil)
87
+ @BizType = biztype
88
+ @DataId = dataid
89
+ @FileContent = filecontent
90
+ @FileUrl = fileurl
91
+ @Interval = interval
92
+ @MaxFrames = maxframes
93
+ @User = user
94
+ @Device = device
95
+ end
96
+
97
+ def deserialize(params)
98
+ @BizType = params['BizType']
99
+ @DataId = params['DataId']
100
+ @FileContent = params['FileContent']
101
+ @FileUrl = params['FileUrl']
102
+ @Interval = params['Interval']
103
+ @MaxFrames = params['MaxFrames']
104
+ unless params['User'].nil?
105
+ @User = User.new
106
+ @User.deserialize(params['User'])
107
+ end
108
+ unless params['Device'].nil?
109
+ @Device = Device.new
110
+ @Device.deserialize(params['Device'])
111
+ end
112
+ end
113
+ end
114
+
115
+ # ImageModeration返回参数结构体
116
+ class ImageModerationResponse < TencentCloud::Common::AbstractModel
117
+ # @param Suggestion: 该字段用于返回Label标签下的后续操作建议。当您获取到判定结果后,返回值表示系统推荐的后续操作;建议您按照业务所需,对不同违规类型与建议值进行处理。<br>返回值:**Block**:建议屏蔽,**Review** :建议人工复审,**Pass**:建议通过
118
+ # @type Suggestion: String
119
+ # @param Label: 该字段用于返回检测结果(LabelResults)中所对应的**优先级最高的恶意标签**,表示模型推荐的审核结果,建议您按照业务所需,对不同违规类型与建议值进行处理。<br>返回值:**Normal**:正常,**Porn**:色情,**Abuse**:谩骂,**Ad**:广告,**Custom**:自定义违规;以及其他令人反感、不安全或不适宜的内容类型。
120
+ # @type Label: String
121
+ # @param SubLabel: 该字段用于返回检测结果所命中优先级最高的恶意标签下的子标签名称,如:*色情--性行为*;若未命中任何子标签则返回空字符串。
122
+ # @type SubLabel: String
123
+ # @param Score: 该字段用于返回当前标签(Label)下的置信度,取值范围:0(**置信度最低**)-100(**置信度最高** ),越高代表文本越有可能属于当前返回的标签;如:*色情 99*,则表明该文本非常有可能属于色情内容;*色情 0*,则表明该文本不属于色情内容。
124
+ # @type Score: Integer
125
+ # @param LabelResults: 该字段用于返回分类模型命中的恶意标签的详细识别结果,包括涉黄、广告等令人反感、不安全或不适宜的内容类型识别结果。
126
+ # 注意:此字段可能返回 null,表示取不到有效值。
127
+ # @type LabelResults: Array
128
+ # @param ObjectResults: 该字段用于返回物体检测模型的详细检测结果;包括:实体、广告台标、二维码等内容命中的标签名称、标签分数、坐标信息、场景识别结果、建议操作等内容审核信息;详细返回值信息可参阅对应的数据结构(ObjectResults)描述。
129
+ # 注意:此字段可能返回 null,表示取不到有效值。
130
+ # @type ObjectResults: Array
131
+ # @param OcrResults: 该字段用于返回OCR文本识别的详细检测结果;包括:文本坐标信息、文本识别结果、建议操作等内容审核信息;详细返回值信息可参阅对应的数据结构(OcrResults)描述。
132
+ # 注意:此字段可能返回 null,表示取不到有效值。
133
+ # @type OcrResults: Array
134
+ # @param LibResults: 该字段用于返回基于图片风险库(风险黑库与正常白库)识别的结果,详细返回值信息可参阅对应的数据结构(LibResults)描述。<br>备注:图片风险库目前**暂不支持自定义库**。
135
+ # 注意:此字段可能返回 null,表示取不到有效值。
136
+ # @type LibResults: Array
137
+ # @param DataId: 该字段用于返回检测对象对应请求参数中的DataId。
138
+ # @type DataId: String
139
+ # @param BizType: 该字段用于返回检测对象对应请求参数中的BizType。
140
+ # @type BizType: String
141
+ # @param Extra: 该字段用于返回根据您的需求配置的额外附加信息(Extra),如未配置则默认返回值为空。<br>备注:不同客户或Biztype下返回信息不同,如需配置该字段请提交工单咨询或联系售后专员处理。
142
+ # 注意:此字段可能返回 null,表示取不到有效值。
143
+ # @type Extra: String
144
+ # @param FileMD5: 该字段用于返回检测对象对应的MD5校验值,以方便校验文件完整性。
145
+ # @type FileMD5: String
146
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
147
+ # @type RequestId: String
148
+
149
+ attr_accessor :Suggestion, :Label, :SubLabel, :Score, :LabelResults, :ObjectResults, :OcrResults, :LibResults, :DataId, :BizType, :Extra, :FileMD5, :RequestId
150
+
151
+ def initialize(suggestion=nil, label=nil, sublabel=nil, score=nil, labelresults=nil, objectresults=nil, ocrresults=nil, libresults=nil, dataid=nil, biztype=nil, extra=nil, filemd5=nil, requestid=nil)
152
+ @Suggestion = suggestion
153
+ @Label = label
154
+ @SubLabel = sublabel
155
+ @Score = score
156
+ @LabelResults = labelresults
157
+ @ObjectResults = objectresults
158
+ @OcrResults = ocrresults
159
+ @LibResults = libresults
160
+ @DataId = dataid
161
+ @BizType = biztype
162
+ @Extra = extra
163
+ @FileMD5 = filemd5
164
+ @RequestId = requestid
165
+ end
166
+
167
+ def deserialize(params)
168
+ @Suggestion = params['Suggestion']
169
+ @Label = params['Label']
170
+ @SubLabel = params['SubLabel']
171
+ @Score = params['Score']
172
+ unless params['LabelResults'].nil?
173
+ @LabelResults = []
174
+ params['LabelResults'].each do |i|
175
+ labelresult_tmp = LabelResult.new
176
+ labelresult_tmp.deserialize(i)
177
+ @LabelResults << labelresult_tmp
178
+ end
179
+ end
180
+ unless params['ObjectResults'].nil?
181
+ @ObjectResults = []
182
+ params['ObjectResults'].each do |i|
183
+ objectresult_tmp = ObjectResult.new
184
+ objectresult_tmp.deserialize(i)
185
+ @ObjectResults << objectresult_tmp
186
+ end
187
+ end
188
+ unless params['OcrResults'].nil?
189
+ @OcrResults = []
190
+ params['OcrResults'].each do |i|
191
+ ocrresult_tmp = OcrResult.new
192
+ ocrresult_tmp.deserialize(i)
193
+ @OcrResults << ocrresult_tmp
194
+ end
195
+ end
196
+ unless params['LibResults'].nil?
197
+ @LibResults = []
198
+ params['LibResults'].each do |i|
199
+ libresult_tmp = LibResult.new
200
+ libresult_tmp.deserialize(i)
201
+ @LibResults << libresult_tmp
202
+ end
203
+ end
204
+ @DataId = params['DataId']
205
+ @BizType = params['BizType']
206
+ @Extra = params['Extra']
207
+ @FileMD5 = params['FileMD5']
208
+ @RequestId = params['RequestId']
209
+ end
210
+ end
211
+
212
+ # 用于返回分类模型命中子标签的详细结果
213
+ class LabelDetailItem < TencentCloud::Common::AbstractModel
214
+ # @param Id: 该字段用于返回识别对象的ID以方便识别和区分。
215
+ # 注意:此字段可能返回 null,表示取不到有效值。
216
+ # @type Id: Integer
217
+ # @param Name: 该字段用于返回识命中的子标签名称。
218
+ # 注意:此字段可能返回 null,表示取不到有效值。
219
+ # @type Name: String
220
+ # @param Score: 该字段用于返回对应子标签命中的分值,取值为**0-100**,如:*Porn-SexBehavior 99* 则代表相应识别内容命中色情-性行为标签的分值为99。
221
+ # 注意:此字段可能返回 null,表示取不到有效值。
222
+ # @type Score: Integer
223
+
224
+ attr_accessor :Id, :Name, :Score
225
+
226
+ def initialize(id=nil, name=nil, score=nil)
227
+ @Id = id
228
+ @Name = name
229
+ @Score = score
230
+ end
231
+
232
+ def deserialize(params)
233
+ @Id = params['Id']
234
+ @Name = params['Name']
235
+ @Score = params['Score']
236
+ end
237
+ end
238
+
239
+ # 分类模型命中结果
240
+ class LabelResult < TencentCloud::Common::AbstractModel
241
+ # @param Scene: 该字段用于返回模型识别出的场景结果,如广告、色情、有害内容等场景。
242
+ # @type Scene: String
243
+ # @param Suggestion: 该字段用于返回针对当前恶意标签的后续操作建议。当您获取到判定结果后,返回值表示系统推荐的后续操作;建议您按照业务所需,对不同违规类型与建议值进行处理。<br>返回值:**Block**:建议屏蔽,**Review** :建议人工复审,**Pass**:建议通过
244
+ # @type Suggestion: String
245
+ # @param Label: 该字段用于返回检测结果所对应的恶意标签。<br>返回值:**Normal**:正常,**Porn**:色情,**Abuse**:谩骂,**Ad**:广告,**Custom**:自定义违规;以及其他令人反感、不安全或不适宜的内容类型。
246
+ # @type Label: String
247
+ # @param SubLabel: 该字段用于返回对应恶意标签下的子标签的检测结果,如:*Porn-SexBehavior*等子标签。
248
+ # @type SubLabel: String
249
+ # @param Score: 该字段用于返回当前标签(Label)下的置信度,取值范围:0(**置信度最低**)-100(**置信度最高** ),越高代表文本越有可能属于当前返回的标签;如:*色情 99*,则表明该文本非常有可能属于色情内容;*色情 0*,则表明该文本不属于色情内容。
250
+ # @type Score: Integer
251
+ # @param Details: 该字段用于返回分类模型命中子标签的详细信息,如:序号、命中标签名称、分数等信息。
252
+ # 注意:此字段可能返回 null,表示取不到有效值。
253
+ # @type Details: Array
254
+
255
+ attr_accessor :Scene, :Suggestion, :Label, :SubLabel, :Score, :Details
256
+
257
+ def initialize(scene=nil, suggestion=nil, label=nil, sublabel=nil, score=nil, details=nil)
258
+ @Scene = scene
259
+ @Suggestion = suggestion
260
+ @Label = label
261
+ @SubLabel = sublabel
262
+ @Score = score
263
+ @Details = details
264
+ end
265
+
266
+ def deserialize(params)
267
+ @Scene = params['Scene']
268
+ @Suggestion = params['Suggestion']
269
+ @Label = params['Label']
270
+ @SubLabel = params['SubLabel']
271
+ @Score = params['Score']
272
+ unless params['Details'].nil?
273
+ @Details = []
274
+ params['Details'].each do |i|
275
+ labeldetailitem_tmp = LabelDetailItem.new
276
+ labeldetailitem_tmp.deserialize(i)
277
+ @Details << labeldetailitem_tmp
278
+ end
279
+ end
280
+ end
281
+ end
282
+
283
+ # 用于返回自定义库/黑白库的明细信息
284
+ class LibDetail < TencentCloud::Common::AbstractModel
285
+ # @param Id: 该字段用于返回识别对象的ID以方便识别和区分。
286
+ # @type Id: Integer
287
+ # @param LibId: 该字段**仅当Label为Custom:自定义关键词时该参数有效**,用于返回自定义库的ID,以方便自定义库管理和配置。
288
+ # @type LibId: String
289
+ # @param LibName: 该字段**仅当Label为Custom:自定义关键词时该参数有效**,用于返回自定义库的名称,以方便自定义库管理和配置。
290
+ # 注意:此字段可能返回 null,表示取不到有效值。
291
+ # @type LibName: String
292
+ # @param ImageId: 该字段用于返回识别图像对象的ID以方便文件管理。
293
+ # @type ImageId: String
294
+ # @param Label: 该字段用于返回检测结果所对应的恶意标签。<br>返回值:**Normal**:正常,**Porn**:色情,**Abuse**:谩骂,**Ad**:广告,**Custom**:自定义违规;以及其他令人反感、不安全或不适宜的内容类型。
295
+ # @type Label: String
296
+ # @param Tag: 该字段用于返回其他自定义标签以满足您的定制化场景需求,若无需求则可略过。
297
+ # 注意:此字段可能返回 null,表示取不到有效值。
298
+ # @type Tag: String
299
+ # @param Score: 该字段用于返回对应模型命中的分值,取值为**0-100**,如:*Porn 99* 则代表相应识别内容命中色情标签的分值为99。
300
+ # @type Score: Integer
301
+
302
+ attr_accessor :Id, :LibId, :LibName, :ImageId, :Label, :Tag, :Score
303
+
304
+ def initialize(id=nil, libid=nil, libname=nil, imageid=nil, label=nil, tag=nil, score=nil)
305
+ @Id = id
306
+ @LibId = libid
307
+ @LibName = libname
308
+ @ImageId = imageid
309
+ @Label = label
310
+ @Tag = tag
311
+ @Score = score
312
+ end
313
+
314
+ def deserialize(params)
315
+ @Id = params['Id']
316
+ @LibId = params['LibId']
317
+ @LibName = params['LibName']
318
+ @ImageId = params['ImageId']
319
+ @Label = params['Label']
320
+ @Tag = params['Tag']
321
+ @Score = params['Score']
322
+ end
323
+ end
324
+
325
+ # 用于返回黑白库比对结果的详细信息
326
+ class LibResult < TencentCloud::Common::AbstractModel
327
+ # @param Scene: 该字段表示模型的场景识别结果,默认取值为Similar。
328
+ # @type Scene: String
329
+ # @param Suggestion: 该字段用于返回后续操作建议。当您获取到判定结果后,返回值表示系统推荐的后续操作;建议您按照业务所需,对不同违规类型与建议值进行处理。<br>返回值:**Block**:建议屏蔽,**Review** :建议人工复审,**Pass**:建议通过
330
+ # @type Suggestion: String
331
+ # @param Label: 该字段用于返回检测结果所对应的恶意标签。<br>返回值:**Normal**:正常,**Porn**:色情,**Abuse**:谩骂,**Ad**:广告,**Custom**:自定义违规;以及其他令人反感、不安全或不适宜的内容类型。
332
+ # @type Label: String
333
+ # @param SubLabel: 该字段用于返回恶意标签下对应的子标签的检测结果,如:*Porn-SexBehavior*等子标签。
334
+ # 注意:此字段可能返回 null,表示取不到有效值。
335
+ # @type SubLabel: String
336
+ # @param Score: 该字段用于返回图片检索模型识别的分值,取值为**0-100**,表示该审核图片**与库中样本的相似分值**,得分越高,代表当前内容越有可能命中相似图库内的样本。
337
+ # @type Score: Integer
338
+ # @param Details: 该字段用于返回黑白库比对结果的详细信息,如:序号、库名称、恶意标签等信息;详细返回信息敬请参考对应数据结构([LibDetail](https://cloud.tencent.com/document/product/1125/53274#LibDetail))的描述文档
339
+ # 注意:此字段可能返回 null,表示取不到有效值。
340
+ # @type Details: Array
341
+
342
+ attr_accessor :Scene, :Suggestion, :Label, :SubLabel, :Score, :Details
343
+
344
+ def initialize(scene=nil, suggestion=nil, label=nil, sublabel=nil, score=nil, details=nil)
345
+ @Scene = scene
346
+ @Suggestion = suggestion
347
+ @Label = label
348
+ @SubLabel = sublabel
349
+ @Score = score
350
+ @Details = details
351
+ end
352
+
353
+ def deserialize(params)
354
+ @Scene = params['Scene']
355
+ @Suggestion = params['Suggestion']
356
+ @Label = params['Label']
357
+ @SubLabel = params['SubLabel']
358
+ @Score = params['Score']
359
+ unless params['Details'].nil?
360
+ @Details = []
361
+ params['Details'].each do |i|
362
+ libdetail_tmp = LibDetail.new
363
+ libdetail_tmp.deserialize(i)
364
+ @Details << libdetail_tmp
365
+ end
366
+ end
367
+ end
368
+ end
369
+
370
+ # 坐标
371
+ class Location < TencentCloud::Common::AbstractModel
372
+ # @param X: 该参数用于返回检测框**左上角位置的横坐标**(x)所在的像素位置,结合剩余参数可唯一确定检测框的大小和位置。
373
+ # @type X: Float
374
+ # @param Y: 该参数用于返回检测框**左上角位置的纵坐标**(y)所在的像素位置,结合剩余参数可唯一确定检测框的大小和位置。
375
+ # @type Y: Float
376
+ # @param Width: 该参数用于返回**检测框的宽度**(由左上角出发在x轴向右延伸的长度),结合剩余参数可唯一确定检测框的大小和位置。
377
+ # @type Width: Float
378
+ # @param Height: 该参数用于返回**检测框的高度**(由左上角出发在y轴向下延伸的长度),结合剩余参数可唯一确定检测框的大小和位置。
379
+ # @type Height: Float
380
+ # @param Rotate: 该参数用于返回**检测框的旋转角度**,该参数结合X和Y两个坐标参数可唯一确定检测框的具体位置;取值:**0-360**(**角度制**),方向为**逆时针旋转**。
381
+ # @type Rotate: Float
382
+
383
+ attr_accessor :X, :Y, :Width, :Height, :Rotate
384
+
385
+ def initialize(x=nil, y=nil, width=nil, height=nil, rotate=nil)
386
+ @X = x
387
+ @Y = y
388
+ @Width = width
389
+ @Height = height
390
+ @Rotate = rotate
391
+ end
392
+
393
+ def deserialize(params)
394
+ @X = params['X']
395
+ @Y = params['Y']
396
+ @Width = params['Width']
397
+ @Height = params['Height']
398
+ @Rotate = params['Rotate']
399
+ end
400
+ end
401
+
402
+ # 实体检测结果明细,当检测场景为实体、广告台标、二维码时表示模型检测目标框的标签名称、标签值、标签分数以及检测框的位置信息。
403
+ class ObjectDetail < TencentCloud::Common::AbstractModel
404
+ # @param Id: 该参数用于返回识别对象的ID以方便识别和区分。
405
+ # @type Id: Integer
406
+ # @param Name: 该参数用于返回命中的实体标签。
407
+ # @type Name: String
408
+ # @param Value: 该参数用于返回对应实体标签所对应的值或内容。如:当标签为*二维码(QrCode)*时,该字段为识别出的二维码对应的URL地址。
409
+ # @type Value: String
410
+ # @param Score: 该参数用于返回对应实体标签命中的分值,取值为**0-100**,如:*QrCode 99* 则代表相应识别内容命中二维码场景标签的概率非常高。
411
+ # @type Score: Integer
412
+ # @param Location: 该字段用于返回实体检测框的坐标位置(左上角xy坐标、长宽、旋转角度)以方便快速定位实体的相关信息。
413
+ # @type Location: :class:`Tencentcloud::Ims.v20201229.models.Location`
414
+ # @param SubLabel: 该参数用于返回命中的实体二级标签。
415
+ # @type SubLabel: String
416
+
417
+ attr_accessor :Id, :Name, :Value, :Score, :Location, :SubLabel
418
+
419
+ def initialize(id=nil, name=nil, value=nil, score=nil, location=nil, sublabel=nil)
420
+ @Id = id
421
+ @Name = name
422
+ @Value = value
423
+ @Score = score
424
+ @Location = location
425
+ @SubLabel = sublabel
426
+ end
427
+
428
+ def deserialize(params)
429
+ @Id = params['Id']
430
+ @Name = params['Name']
431
+ @Value = params['Value']
432
+ @Score = params['Score']
433
+ unless params['Location'].nil?
434
+ @Location = Location.new
435
+ @Location.deserialize(params['Location'])
436
+ end
437
+ @SubLabel = params['SubLabel']
438
+ end
439
+ end
440
+
441
+ # 用于返回实体检测结果详情
442
+ class ObjectResult < TencentCloud::Common::AbstractModel
443
+ # @param Scene: 该字段用于返回实体识别出的实体场景结果,如二维码、logo、图片OCR等场景。
444
+ # @type Scene: String
445
+ # @param Suggestion: 该字段用于返回针对当前恶意标签的后续操作建议。当您获取到判定结果后,返回值表示系统推荐的后续操作;建议您按照业务所需,对不同违规类型与建议值进行处理。<br>返回值:**Block**:建议屏蔽,**Review** :建议人工复审,**Pass**:建议通过
446
+ # @type Suggestion: String
447
+ # @param Label: 该字段用于返回检测结果所对应的恶意标签,表示模型推荐的审核结果,建议您按照业务所需,对不同违规类型与建议值进行处理。<br>返回值:**Normal**:正常,**Porn**:色情,**Abuse**:谩骂,**Ad**:广告,**Custom**:自定义违规;以及其他令人反感、不安全或不适宜的内容类型。
448
+ # @type Label: String
449
+ # @param SubLabel: 该字段用于返回当前恶意标签下对应的子标签的检测结果,如:*Porn-SexBehavior* 等子标签。
450
+ # @type SubLabel: String
451
+ # @param Score: 该字段用于返回命中当前恶意标签下子标签的分值,取值为**0-100**,如:*Porn-SexBehavior 99* 则代表相应识别内容命中色情-性行为标签的分值为99。
452
+ # @type Score: Integer
453
+ # @param Names: 该标签用于返回所识别出的实体名称。
454
+ # 注意:此字段可能返回 null,表示取不到有效值。
455
+ # @type Names: Array
456
+ # @param Details: 该标签用于返回所识别出实体的详细信息,如:序号、命中标签名称、位置坐标等信息,详细返回内容敬请参考相应数据结构([ObjectDetail
457
+ # ](https://cloud.tencent.com/document/api/1125/53274#ObjectDetail))。
458
+ # 注意:此字段可能返回 null,表示取不到有效值。
459
+ # @type Details: Array
460
+
461
+ attr_accessor :Scene, :Suggestion, :Label, :SubLabel, :Score, :Names, :Details
462
+
463
+ def initialize(scene=nil, suggestion=nil, label=nil, sublabel=nil, score=nil, names=nil, details=nil)
464
+ @Scene = scene
465
+ @Suggestion = suggestion
466
+ @Label = label
467
+ @SubLabel = sublabel
468
+ @Score = score
469
+ @Names = names
470
+ @Details = details
471
+ end
472
+
473
+ def deserialize(params)
474
+ @Scene = params['Scene']
475
+ @Suggestion = params['Suggestion']
476
+ @Label = params['Label']
477
+ @SubLabel = params['SubLabel']
478
+ @Score = params['Score']
479
+ @Names = params['Names']
480
+ unless params['Details'].nil?
481
+ @Details = []
482
+ params['Details'].each do |i|
483
+ objectdetail_tmp = ObjectDetail.new
484
+ objectdetail_tmp.deserialize(i)
485
+ @Details << objectdetail_tmp
486
+ end
487
+ end
488
+ end
489
+ end
490
+
491
+ # 用于返回OCR结果检测详情
492
+ class OcrResult < TencentCloud::Common::AbstractModel
493
+ # @param Scene: 该字段表示识别场景,取值默认为OCR(图片OCR识别)。
494
+ # @type Scene: String
495
+ # @param Suggestion: 该字段用于返回优先级最高的恶意标签对应的后续操作建议。当您获取到判定结果后,返回值表示系统推荐的后续操作;建议您按照业务所需,对不同违规类型与建议值进行处理。<br>返回值:**Block**:建议屏蔽,**Review** :建议人工复审,**Pass**:建议通过
496
+ # @type Suggestion: String
497
+ # @param Label: 该字段用于返回OCR检测结果所对应的优先级最高的恶意标签,表示模型推荐的审核结果,建议您按照业务所需,对不同违规类型与建议值进行处理。<br>返回值:**Normal**:正常,**Porn**:色情,**Abuse**:谩骂,**Ad**:广告,**Custom**:自定义违规;以及其他令人反感、不安全或不适宜的内容类型。
498
+ # @type Label: String
499
+ # @param SubLabel: 该字段用于返回当前标签(Label)下对应的子标签的检测结果,如:*Porn-SexBehavior*等子标签。
500
+ # @type SubLabel: String
501
+ # @param Score: 该字段用于返回当前标签(Label)下的置信度,取值范围:0(**置信度最低**)-100(**置信度最高** ),越高代表文本越有可能属于当前返回的标签;如:*色情 99*,则表明该文本非常有可能属于色情内容;*色情 0*,则表明该文本不属于色情内容。
502
+ # @type Score: Integer
503
+ # @param Details: 该字段用于返回OCR识别出的结果的详细内容,如:文本内容、对应标签、识别框位置等信息。
504
+ # 注意:此字段可能返回 null,表示取不到有效值。
505
+ # @type Details: Array
506
+ # @param Text: 该字段用于返回OCR识别出的文字信息。
507
+ # @type Text: String
508
+
509
+ attr_accessor :Scene, :Suggestion, :Label, :SubLabel, :Score, :Details, :Text
510
+
511
+ def initialize(scene=nil, suggestion=nil, label=nil, sublabel=nil, score=nil, details=nil, text=nil)
512
+ @Scene = scene
513
+ @Suggestion = suggestion
514
+ @Label = label
515
+ @SubLabel = sublabel
516
+ @Score = score
517
+ @Details = details
518
+ @Text = text
519
+ end
520
+
521
+ def deserialize(params)
522
+ @Scene = params['Scene']
523
+ @Suggestion = params['Suggestion']
524
+ @Label = params['Label']
525
+ @SubLabel = params['SubLabel']
526
+ @Score = params['Score']
527
+ unless params['Details'].nil?
528
+ @Details = []
529
+ params['Details'].each do |i|
530
+ ocrtextdetail_tmp = OcrTextDetail.new
531
+ ocrtextdetail_tmp.deserialize(i)
532
+ @Details << ocrtextdetail_tmp
533
+ end
534
+ end
535
+ @Text = params['Text']
536
+ end
537
+ end
538
+
539
+ # 用于返回OCR文本结果详情,图片中的文本越多,可能导致接口返回时间增加。
540
+ class OcrTextDetail < TencentCloud::Common::AbstractModel
541
+ # @param Text: 该字段用于返回OCR识别出的文本内容。<br>备注:OCR文本识别上限在**5000字节内**。
542
+ # @type Text: String
543
+ # @param Label: 该字段用于返回检测结果所对应的恶意标签。<br>返回值:**Normal**:正常,**Porn**:色情,**Abuse**:谩骂,**Ad**:广告,**Custom**:自定义违规;以及其他令人反感、不安全或不适宜的内容类型。
544
+ # @type Label: String
545
+ # @param LibId: 该字段**仅当Label为Custom自定义关键词时有效**,用于返回自定义库的ID,以方便自定义库管理和配置。
546
+ # @type LibId: String
547
+ # @param LibName: 该字段**仅当Label为Custom自定义关键词时有效**,用于返回自定义库的名称,以方便自定义库管理和配置。
548
+ # @type LibName: String
549
+ # @param Keywords: 该参数用于返回在当前label下命中的关键词。
550
+ # @type Keywords: Array
551
+ # @param Score: 该参数用于返回在当前恶意标签下模型命中的分值,取值为**0-100**;分数越高,代表当前场景越符合该恶意标签所对应的场景。
552
+ # @type Score: Integer
553
+ # @param Location: 该参数用于返回OCR检测框在图片中的位置(左上角xy坐标、长宽、旋转角度),以方便快速定位识别文字的相关信息。
554
+ # @type Location: :class:`Tencentcloud::Ims.v20201229.models.Location`
555
+ # @param Rate: 该参数用于返回OCR文本识别结果的置信度,取值在**0**(**置信度最低**)-**100**(**置信度最高**),越高代表对应图像越有可能是识别出的文字;如:*你好 99*,则表明OCR识别框内的文字大概率是”你好“。
556
+ # @type Rate: Integer
557
+ # @param SubLabel: 该字段用于返回检测结果所对应的恶意二级标签。
558
+ # @type SubLabel: String
559
+
560
+ attr_accessor :Text, :Label, :LibId, :LibName, :Keywords, :Score, :Location, :Rate, :SubLabel
561
+
562
+ def initialize(text=nil, label=nil, libid=nil, libname=nil, keywords=nil, score=nil, location=nil, rate=nil, sublabel=nil)
563
+ @Text = text
564
+ @Label = label
565
+ @LibId = libid
566
+ @LibName = libname
567
+ @Keywords = keywords
568
+ @Score = score
569
+ @Location = location
570
+ @Rate = rate
571
+ @SubLabel = sublabel
572
+ end
573
+
574
+ def deserialize(params)
575
+ @Text = params['Text']
576
+ @Label = params['Label']
577
+ @LibId = params['LibId']
578
+ @LibName = params['LibName']
579
+ @Keywords = params['Keywords']
580
+ @Score = params['Score']
581
+ unless params['Location'].nil?
582
+ @Location = Location.new
583
+ @Location.deserialize(params['Location'])
584
+ end
585
+ @Rate = params['Rate']
586
+ @SubLabel = params['SubLabel']
587
+ end
588
+ end
589
+
590
+ # 用于表示业务用户的账号相关信息
591
+ class User < TencentCloud::Common::AbstractModel
592
+ # @param UserId: 该字段表示业务用户ID,填写后,系统可根据账号过往违规历史优化审核结果判定,有利于存在可疑违规风险时的辅助判断。<br>
593
+ # 备注:该字段可传入微信openid、QQopenid、字符串等账号信息,与账号类别参数(AccountType)配合使用可确定唯一账号。
594
+ # @type UserId: String
595
+ # @param Nickname: 该字段表示业务用户对应的账号昵称信息。
596
+ # @type Nickname: String
597
+ # @param AccountType: 该字段表示业务用户ID对应的账号类型,取值:**1**-微信uin,**2**-QQ号,**3**-微信群uin,**4**-qq群号,**5**-微信openid,**6**-QQopenid,**7**-其它string。<br>
598
+ # 该字段与账号ID参数(UserId)配合使用可确定唯一账号。
599
+ # @type AccountType: String
600
+ # @param Gender: 该字段表示业务用户对应账号的性别信息。<br>
601
+ # 取值:**0**(默认值,代表性别未知)、**1**(男性)、**2**(女性)。
602
+ # @type Gender: Integer
603
+ # @param Age: 该字段表示业务用户对应账号的年龄信息。<br>
604
+ # 取值:**0**(默认值,代表年龄未知)-(**自定义年龄上限**)之间的整数。
605
+ # @type Age: Integer
606
+ # @param Level: 该字段表示业务用户对应账号的等级信息。<br>
607
+ # 取值:**0**(默认值,代表等级未知)、**1**(等级较低)、**2**(等级中等)、**3**(等级较高),目前**暂不支持自定义等级**。
608
+ # @type Level: Integer
609
+ # @param Phone: 该字段表示业务用户对应账号的手机号信息,支持全球各地区手机号的记录。<br>
610
+ # 备注:请保持手机号格式的统一,如区号格式(086/+86)等。
611
+ # @type Phone: String
612
+ # @param Desc: 该字段表示业务用户的简介信息,支持汉字、英文及特殊符号,**长度不超过5000个汉字字符**。
613
+ # @type Desc: String
614
+ # @param HeadUrl: 该字段表示业务用户头像图片的访问链接(URL),支持PNG、JPG、JPEG、BMP、GIF、WEBP格式。<br>备注:头像图片**大小不超过5MB**,建议**分辨率不低于256x256**;图片下载时间限制为3秒,超过则会返回下载超时。
615
+ # @type HeadUrl: String
616
+
617
+ attr_accessor :UserId, :Nickname, :AccountType, :Gender, :Age, :Level, :Phone, :Desc, :HeadUrl
618
+
619
+ def initialize(userid=nil, nickname=nil, accounttype=nil, gender=nil, age=nil, level=nil, phone=nil, desc=nil, headurl=nil)
620
+ @UserId = userid
621
+ @Nickname = nickname
622
+ @AccountType = accounttype
623
+ @Gender = gender
624
+ @Age = age
625
+ @Level = level
626
+ @Phone = phone
627
+ @Desc = desc
628
+ @HeadUrl = headurl
629
+ end
630
+
631
+ def deserialize(params)
632
+ @UserId = params['UserId']
633
+ @Nickname = params['Nickname']
634
+ @AccountType = params['AccountType']
635
+ @Gender = params['Gender']
636
+ @Age = params['Age']
637
+ @Level = params['Level']
638
+ @Phone = params['Phone']
639
+ @Desc = params['Desc']
640
+ @HeadUrl = params['HeadUrl']
641
+ end
642
+ end
643
+
644
+ end
645
+ end
646
+ end
647
+