tencentcloud-sdk-ocr 1.0.200

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1964 @@
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 Ocr
21
+ module V20181119
22
+ class Client < TencentCloud::Common::AbstractClient
23
+
24
+ def initialize(credential, region, profile = nil)
25
+ api_version = '2018-11-19'
26
+ api_endpoint = 'ocr.tencentcloudapi.com'
27
+ sdk_version = 'OCR_' + 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
+ # 产品优势:针对广告商品图片普遍存在较多繁体字、艺术字的特点,进行了识别能力的增强。支持中英文、横排、竖排以及倾斜场景文字识别。文字识别的召回率和准确率能达到96%以上。
35
+
36
+ # @param request: Request instance for AdvertiseOCR.
37
+ # @type request: :class:`Tencentcloud::ocr::V20181119::AdvertiseOCRRequest`
38
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::AdvertiseOCRResponse`
39
+ def AdvertiseOCR(request)
40
+ body = send_request('AdvertiseOCR', request.serialize)
41
+ response = JSON.parse(body)
42
+ if response['Response'].key?('Error') == false
43
+ model = AdvertiseOCRResponse.new
44
+ model.deserialize(response['Response'])
45
+ model
46
+ else
47
+ code = response['Response']['Error']['Code']
48
+ message = response['Response']['Error']['Message']
49
+ reqid = response['Response']['RequestId']
50
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
51
+ end
52
+ rescue TencentCloud::Common::TencentCloudSDKException => e
53
+ raise e
54
+ rescue StandardError => e
55
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
56
+ end
57
+
58
+ # 本接口支持作业算式题目的自动识别和判分,目前覆盖 K12 学力范围内的 11 种题型,包括加减乘除四则、加减乘除已知结果求运算因子、判断大小、约等于估算、带余数除法、分数四则运算、单位换算、竖式加减法、竖式乘除法、脱式计算和解方程,平均识别精度达到93%以上。
59
+
60
+ # @param request: Request instance for ArithmeticOCR.
61
+ # @type request: :class:`Tencentcloud::ocr::V20181119::ArithmeticOCRRequest`
62
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::ArithmeticOCRResponse`
63
+ def ArithmeticOCR(request)
64
+ body = send_request('ArithmeticOCR', request.serialize)
65
+ response = JSON.parse(body)
66
+ if response['Response'].key?('Error') == false
67
+ model = ArithmeticOCRResponse.new
68
+ model.deserialize(response['Response'])
69
+ model
70
+ else
71
+ code = response['Response']['Error']['Code']
72
+ message = response['Response']['Error']['Message']
73
+ reqid = response['Response']['RequestId']
74
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
75
+ end
76
+ rescue TencentCloud::Common::TencentCloudSDKException => e
77
+ raise e
78
+ rescue StandardError => e
79
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
80
+ end
81
+
82
+ # 本接口支持对中国大陆主流银行卡正反面关键字段的检测与识别,包括卡号、卡类型、卡名字、银行信息、有效期。支持竖排异形卡识别、多角度旋转图片识别。支持对复印件、翻拍件、边框遮挡的银行卡进行告警,可应用于各种银行卡信息有效性校验场景,如金融行业身份认证、第三方支付绑卡等场景。
83
+
84
+ # @param request: Request instance for BankCardOCR.
85
+ # @type request: :class:`Tencentcloud::ocr::V20181119::BankCardOCRRequest`
86
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::BankCardOCRResponse`
87
+ def BankCardOCR(request)
88
+ body = send_request('BankCardOCR', request.serialize)
89
+ response = JSON.parse(body)
90
+ if response['Response'].key?('Error') == false
91
+ model = BankCardOCRResponse.new
92
+ model.deserialize(response['Response'])
93
+ model
94
+ else
95
+ code = response['Response']['Error']['Code']
96
+ message = response['Response']['Error']['Message']
97
+ reqid = response['Response']['RequestId']
98
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
99
+ end
100
+ rescue TencentCloud::Common::TencentCloudSDKException => e
101
+ raise e
102
+ rescue StandardError => e
103
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
104
+ end
105
+
106
+ # 本接口支持银行回单全字段的识别,包括付款开户行、收款开户行、付款账号、收款账号、回单类型、回单编号、币种、流水号、凭证号码、交易机构、交易金额、手续费、日期等字段信息。
107
+
108
+
109
+ # @param request: Request instance for BankSlipOCR.
110
+ # @type request: :class:`Tencentcloud::ocr::V20181119::BankSlipOCRRequest`
111
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::BankSlipOCRResponse`
112
+ def BankSlipOCR(request)
113
+ body = send_request('BankSlipOCR', request.serialize)
114
+ response = JSON.parse(body)
115
+ if response['Response'].key?('Error') == false
116
+ model = BankSlipOCRResponse.new
117
+ model.deserialize(response['Response'])
118
+ model
119
+ else
120
+ code = response['Response']['Error']['Code']
121
+ message = response['Response']['Error']['Message']
122
+ reqid = response['Response']['RequestId']
123
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
124
+ end
125
+ rescue TencentCloud::Common::TencentCloudSDKException => e
126
+ raise e
127
+ rescue StandardError => e
128
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
129
+ end
130
+
131
+ # 本接口支持快速精准识别营业执照上的字段,包括统一社会信用代码、公司名称、经营场所、主体类型、法定代表人、注册资金、组成形式、成立日期、营业期限和经营范围等字段。
132
+
133
+ # @param request: Request instance for BizLicenseOCR.
134
+ # @type request: :class:`Tencentcloud::ocr::V20181119::BizLicenseOCRRequest`
135
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::BizLicenseOCRResponse`
136
+ def BizLicenseOCR(request)
137
+ body = send_request('BizLicenseOCR', request.serialize)
138
+ response = JSON.parse(body)
139
+ if response['Response'].key?('Error') == false
140
+ model = BizLicenseOCRResponse.new
141
+ model.deserialize(response['Response'])
142
+ model
143
+ else
144
+ code = response['Response']['Error']['Code']
145
+ message = response['Response']['Error']['Message']
146
+ reqid = response['Response']['RequestId']
147
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
148
+ end
149
+ rescue TencentCloud::Common::TencentCloudSDKException => e
150
+ raise e
151
+ rescue StandardError => e
152
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
153
+ end
154
+
155
+ # 本接口支持识别公路汽车客票的发票代码、发票号码、日期、姓名、票价等字段。
156
+
157
+ # @param request: Request instance for BusInvoiceOCR.
158
+ # @type request: :class:`Tencentcloud::ocr::V20181119::BusInvoiceOCRRequest`
159
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::BusInvoiceOCRResponse`
160
+ def BusInvoiceOCR(request)
161
+ body = send_request('BusInvoiceOCR', request.serialize)
162
+ response = JSON.parse(body)
163
+ if response['Response'].key?('Error') == false
164
+ model = BusInvoiceOCRResponse.new
165
+ model.deserialize(response['Response'])
166
+ model
167
+ else
168
+ code = response['Response']['Error']['Code']
169
+ message = response['Response']['Error']['Message']
170
+ reqid = response['Response']['RequestId']
171
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
172
+ end
173
+ rescue TencentCloud::Common::TencentCloudSDKException => e
174
+ raise e
175
+ rescue StandardError => e
176
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
177
+ end
178
+
179
+ # 本接口支持名片各字段的自动定位与识别,包含姓名、电话、手机号、邮箱、公司、部门、职位、网址、地址、QQ、微信、MSN等。
180
+
181
+ # @param request: Request instance for BusinessCardOCR.
182
+ # @type request: :class:`Tencentcloud::ocr::V20181119::BusinessCardOCRRequest`
183
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::BusinessCardOCRResponse`
184
+ def BusinessCardOCR(request)
185
+ body = send_request('BusinessCardOCR', request.serialize)
186
+ response = JSON.parse(body)
187
+ if response['Response'].key?('Error') == false
188
+ model = BusinessCardOCRResponse.new
189
+ model.deserialize(response['Response'])
190
+ model
191
+ else
192
+ code = response['Response']['Error']['Code']
193
+ message = response['Response']['Error']['Message']
194
+ reqid = response['Response']['RequestId']
195
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
196
+ end
197
+ rescue TencentCloud::Common::TencentCloudSDKException => e
198
+ raise e
199
+ rescue StandardError => e
200
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
201
+ end
202
+
203
+ # 本接口支持机动车销售统一发票和二手车销售统一发票的识别,包括发票号码、发票代码、合计金额、合计税额等二十多个字段。
204
+
205
+ # @param request: Request instance for CarInvoiceOCR.
206
+ # @type request: :class:`Tencentcloud::ocr::V20181119::CarInvoiceOCRRequest`
207
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::CarInvoiceOCRResponse`
208
+ def CarInvoiceOCR(request)
209
+ body = send_request('CarInvoiceOCR', request.serialize)
210
+ response = JSON.parse(body)
211
+ if response['Response'].key?('Error') == false
212
+ model = CarInvoiceOCRResponse.new
213
+ model.deserialize(response['Response'])
214
+ model
215
+ else
216
+ code = response['Response']['Error']['Code']
217
+ message = response['Response']['Error']['Message']
218
+ reqid = response['Response']['RequestId']
219
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
220
+ end
221
+ rescue TencentCloud::Common::TencentCloudSDKException => e
222
+ raise e
223
+ rescue StandardError => e
224
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
225
+ end
226
+
227
+ # 支持身份证、护照、名片、银行卡、行驶证、驾驶证、港澳台通行证、户口本、港澳台来往内地通行证、港澳台居住证、不动产证、营业执照的智能分类。
228
+
229
+ # @param request: Request instance for ClassifyDetectOCR.
230
+ # @type request: :class:`Tencentcloud::ocr::V20181119::ClassifyDetectOCRRequest`
231
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::ClassifyDetectOCRResponse`
232
+ def ClassifyDetectOCR(request)
233
+ body = send_request('ClassifyDetectOCR', request.serialize)
234
+ response = JSON.parse(body)
235
+ if response['Response'].key?('Error') == false
236
+ model = ClassifyDetectOCRResponse.new
237
+ model.deserialize(response['Response'])
238
+ model
239
+ else
240
+ code = response['Response']['Error']['Code']
241
+ message = response['Response']['Error']['Message']
242
+ reqid = response['Response']['RequestId']
243
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
244
+ end
245
+ rescue TencentCloud::Common::TencentCloudSDKException => e
246
+ raise e
247
+ rescue StandardError => e
248
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
249
+ end
250
+
251
+ # 本接口支持驾驶证主页和副页所有字段的自动定位与识别,重点字段的识别准确度达到99%以上。
252
+
253
+ # 驾驶证主页:包括证号、姓名、性别、国籍、住址、出生日期、初次领证日期、准驾车型、有效期限、发证单位
254
+
255
+ # 驾驶证副页:包括证号、姓名、档案编号、记录。
256
+
257
+ # 另外,本接口还支持复印件、翻拍和PS告警功能。
258
+
259
+ # @param request: Request instance for DriverLicenseOCR.
260
+ # @type request: :class:`Tencentcloud::ocr::V20181119::DriverLicenseOCRRequest`
261
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::DriverLicenseOCRResponse`
262
+ def DriverLicenseOCR(request)
263
+ body = send_request('DriverLicenseOCR', request.serialize)
264
+ response = JSON.parse(body)
265
+ if response['Response'].key?('Error') == false
266
+ model = DriverLicenseOCRResponse.new
267
+ model.deserialize(response['Response'])
268
+ model
269
+ else
270
+ code = response['Response']['Error']['Code']
271
+ message = response['Response']['Error']['Message']
272
+ reqid = response['Response']['RequestId']
273
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
274
+ end
275
+ rescue TencentCloud::Common::TencentCloudSDKException => e
276
+ raise e
277
+ rescue StandardError => e
278
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
279
+ end
280
+
281
+ # 本接口支持对完税证明的税号、纳税人识别号、纳税人名称、金额合计大写、金额合计小写、填发日期、税务机关、填票人等关键字段的识别。
282
+
283
+ # @param request: Request instance for DutyPaidProofOCR.
284
+ # @type request: :class:`Tencentcloud::ocr::V20181119::DutyPaidProofOCRRequest`
285
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::DutyPaidProofOCRResponse`
286
+ def DutyPaidProofOCR(request)
287
+ body = send_request('DutyPaidProofOCR', request.serialize)
288
+ response = JSON.parse(body)
289
+ if response['Response'].key?('Error') == false
290
+ model = DutyPaidProofOCRResponse.new
291
+ model.deserialize(response['Response'])
292
+ model
293
+ else
294
+ code = response['Response']['Error']['Code']
295
+ message = response['Response']['Error']['Message']
296
+ reqid = response['Response']['RequestId']
297
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
298
+ end
299
+ rescue TencentCloud::Common::TencentCloudSDKException => e
300
+ raise e
301
+ rescue StandardError => e
302
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
303
+ end
304
+
305
+ # 本接口支持数学试题内容的识别和结构化输出,包括通用文本解析和小学/初中/高中数学公式解析能力(包括91种题型,180种符号),公式返回格式为 Latex 格式文本。
306
+
307
+ # @param request: Request instance for EduPaperOCR.
308
+ # @type request: :class:`Tencentcloud::ocr::V20181119::EduPaperOCRRequest`
309
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::EduPaperOCRResponse`
310
+ def EduPaperOCR(request)
311
+ body = send_request('EduPaperOCR', request.serialize)
312
+ response = JSON.parse(body)
313
+ if response['Response'].key?('Error') == false
314
+ model = EduPaperOCRResponse.new
315
+ model.deserialize(response['Response'])
316
+ model
317
+ else
318
+ code = response['Response']['Error']['Code']
319
+ message = response['Response']['Error']['Message']
320
+ reqid = response['Response']['RequestId']
321
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
322
+ end
323
+ rescue TencentCloud::Common::TencentCloudSDKException => e
324
+ raise e
325
+ rescue StandardError => e
326
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
327
+ end
328
+
329
+ # 本接口支持图像英文文字的检测和识别,返回文字框位置与文字内容。支持多场景、任意版面下的英文、字母、数字和常见字符的识别,同时覆盖英文印刷体和英文手写体识别。
330
+
331
+ # @param request: Request instance for EnglishOCR.
332
+ # @type request: :class:`Tencentcloud::ocr::V20181119::EnglishOCRRequest`
333
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::EnglishOCRResponse`
334
+ def EnglishOCR(request)
335
+ body = send_request('EnglishOCR', request.serialize)
336
+ response = JSON.parse(body)
337
+ if response['Response'].key?('Error') == false
338
+ model = EnglishOCRResponse.new
339
+ model.deserialize(response['Response'])
340
+ model
341
+ else
342
+ code = response['Response']['Error']['Code']
343
+ message = response['Response']['Error']['Message']
344
+ reqid = response['Response']['RequestId']
345
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
346
+ end
347
+ rescue TencentCloud::Common::TencentCloudSDKException => e
348
+ raise e
349
+ rescue StandardError => e
350
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
351
+ end
352
+
353
+ # 本接口支持智能化识别各类企业登记证书、许可证书、企业执照、三证合一类证书,结构化输出统一社会信用代码、公司名称、法定代表人、公司地址、注册资金、企业类型、经营范围等关键字段。
354
+
355
+ # @param request: Request instance for EnterpriseLicenseOCR.
356
+ # @type request: :class:`Tencentcloud::ocr::V20181119::EnterpriseLicenseOCRRequest`
357
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::EnterpriseLicenseOCRResponse`
358
+ def EnterpriseLicenseOCR(request)
359
+ body = send_request('EnterpriseLicenseOCR', request.serialize)
360
+ response = JSON.parse(body)
361
+ if response['Response'].key?('Error') == false
362
+ model = EnterpriseLicenseOCRResponse.new
363
+ model.deserialize(response['Response'])
364
+ model
365
+ else
366
+ code = response['Response']['Error']['Code']
367
+ message = response['Response']['Error']['Message']
368
+ reqid = response['Response']['RequestId']
369
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
370
+ end
371
+ rescue TencentCloud::Common::TencentCloudSDKException => e
372
+ raise e
373
+ rescue StandardError => e
374
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
375
+ end
376
+
377
+ # 本接口支持不动产权证关键字段的识别,包括使用期限、面积、用途、权利性质、权利类型、坐落、共有情况、权利人、权利其他状况等。
378
+
379
+
380
+
381
+ # @param request: Request instance for EstateCertOCR.
382
+ # @type request: :class:`Tencentcloud::ocr::V20181119::EstateCertOCRRequest`
383
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::EstateCertOCRResponse`
384
+ def EstateCertOCR(request)
385
+ body = send_request('EstateCertOCR', request.serialize)
386
+ response = JSON.parse(body)
387
+ if response['Response'].key?('Error') == false
388
+ model = EstateCertOCRResponse.new
389
+ model.deserialize(response['Response'])
390
+ model
391
+ else
392
+ code = response['Response']['Error']['Code']
393
+ message = response['Response']['Error']['Message']
394
+ reqid = response['Response']['RequestId']
395
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
396
+ end
397
+ rescue TencentCloud::Common::TencentCloudSDKException => e
398
+ raise e
399
+ rescue StandardError => e
400
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
401
+ end
402
+
403
+ # 本接口支持常见银行票据的自动分类和识别。整单识别包括支票(含现金支票、普通支票、转账支票),承兑汇票(含银行承兑汇票、商业承兑汇票)以及进账单等,适用于中国人民银行印发的 2010 版银行票据凭证版式(银发[2010]299 号)。
404
+
405
+ # @param request: Request instance for FinanBillOCR.
406
+ # @type request: :class:`Tencentcloud::ocr::V20181119::FinanBillOCRRequest`
407
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::FinanBillOCRResponse`
408
+ def FinanBillOCR(request)
409
+ body = send_request('FinanBillOCR', request.serialize)
410
+ response = JSON.parse(body)
411
+ if response['Response'].key?('Error') == false
412
+ model = FinanBillOCRResponse.new
413
+ model.deserialize(response['Response'])
414
+ model
415
+ else
416
+ code = response['Response']['Error']['Code']
417
+ message = response['Response']['Error']['Message']
418
+ reqid = response['Response']['RequestId']
419
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
420
+ end
421
+ rescue TencentCloud::Common::TencentCloudSDKException => e
422
+ raise e
423
+ rescue StandardError => e
424
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
425
+ end
426
+
427
+ # 本接口支持常见银行票据的自动分类和识别。切片识别包括金融行业常见票据的重要切片字段识别,包括金额、账号、日期、凭证号码等。(金融票据切片:金融票据中待识别字段及其周围局部区域的裁剪图像。)
428
+
429
+ # @param request: Request instance for FinanBillSliceOCR.
430
+ # @type request: :class:`Tencentcloud::ocr::V20181119::FinanBillSliceOCRRequest`
431
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::FinanBillSliceOCRResponse`
432
+ def FinanBillSliceOCR(request)
433
+ body = send_request('FinanBillSliceOCR', request.serialize)
434
+ response = JSON.parse(body)
435
+ if response['Response'].key?('Error') == false
436
+ model = FinanBillSliceOCRResponse.new
437
+ model.deserialize(response['Response'])
438
+ model
439
+ else
440
+ code = response['Response']['Error']['Code']
441
+ message = response['Response']['Error']['Message']
442
+ reqid = response['Response']['RequestId']
443
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
444
+ end
445
+ rescue TencentCloud::Common::TencentCloudSDKException => e
446
+ raise e
447
+ rescue StandardError => e
448
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
449
+ end
450
+
451
+ # 本接口支持机票行程单关键字段的识别,包括旅客姓名、有效身份证件号码、电子客票号码、验证码、填开单位、其他税费、燃油附加费、民航发展基金、保险费、销售单位代号、始发地、目的地、航班号、时间、日期、座位等级、承运人、发票消费类型、票价、合计金额、填开日期、国内国际标签、印刷序号、客票级别/类别、客票生效日期、有效期截止日期、免费行李等字段,支持航班信息多行明细输出。
452
+
453
+ # @param request: Request instance for FlightInvoiceOCR.
454
+ # @type request: :class:`Tencentcloud::ocr::V20181119::FlightInvoiceOCRRequest`
455
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::FlightInvoiceOCRResponse`
456
+ def FlightInvoiceOCR(request)
457
+ body = send_request('FlightInvoiceOCR', request.serialize)
458
+ response = JSON.parse(body)
459
+ if response['Response'].key?('Error') == false
460
+ model = FlightInvoiceOCRResponse.new
461
+ model.deserialize(response['Response'])
462
+ model
463
+ else
464
+ code = response['Response']['Error']['Code']
465
+ message = response['Response']['Error']['Message']
466
+ reqid = response['Response']['RequestId']
467
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
468
+ end
469
+ rescue TencentCloud::Common::TencentCloudSDKException => e
470
+ raise e
471
+ rescue StandardError => e
472
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
473
+ end
474
+
475
+ # 本接口支持识别主流初高中数学符号和公式,返回公式的 Latex 格式文本。
476
+
477
+ # @param request: Request instance for FormulaOCR.
478
+ # @type request: :class:`Tencentcloud::ocr::V20181119::FormulaOCRRequest`
479
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::FormulaOCRResponse`
480
+ def FormulaOCR(request)
481
+ body = send_request('FormulaOCR', request.serialize)
482
+ response = JSON.parse(body)
483
+ if response['Response'].key?('Error') == false
484
+ model = FormulaOCRResponse.new
485
+ model.deserialize(response['Response'])
486
+ model
487
+ else
488
+ code = response['Response']['Error']['Code']
489
+ message = response['Response']['Error']['Message']
490
+ reqid = response['Response']['RequestId']
491
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
492
+ end
493
+ rescue TencentCloud::Common::TencentCloudSDKException => e
494
+ raise e
495
+ rescue StandardError => e
496
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
497
+ end
498
+
499
+ # 本接口支持图像整体文字的检测和识别。支持中文、英文、中英文、数字和特殊字符号的识别,并返回文字框位置和文字内容。
500
+
501
+ # 适用于文字较多、版式复杂、对识别准召率要求较高的场景,如试卷试题、网络图片、街景店招牌、法律卷宗等场景。
502
+
503
+ # 产品优势:与通用印刷体识别相比,提供更高精度的文字识别服务,在文字较多、长串数字、小字、模糊字、倾斜文本等困难场景下,高精度版的准确率和召回率更高。
504
+
505
+ # 通用印刷体识别不同版本的差异如下:
506
+ # <table style="width:715px">
507
+ # <thead>
508
+ # <tr>
509
+ # <th style="width:150px"></th>
510
+ # <th >【荐】通用印刷体识别(高精度版)</th>
511
+ # <th style="width:200px"><a href="https://cloud.tencent.com/document/product/866/33526">【荐】通用印刷体识别</a></th>
512
+ # <th><a href="https://cloud.tencent.com/document/product/866/37831">通用印刷体识别(精简版)</a></th>
513
+ # </tr>
514
+ # </thead>
515
+ # <tbody>
516
+ # <tr>
517
+ # <td> 适用场景</td>
518
+ # <td>适用于文字较多、长串数字、小字、模糊字、倾斜文本等困难场景</td>
519
+ # <td>适用于所有通用场景的印刷体识别</td>
520
+ # <td>适用于快速文本识别场景,准召率有一定损失,价格更优惠</td>
521
+ # </tr>
522
+ # <tr>
523
+ # <td>识别准确率</td>
524
+ # <td>99%</td>
525
+ # <td>96%</td>
526
+ # <td>91%</td>
527
+ # </tr>
528
+ # <tr>
529
+ # <td>价格</td>
530
+ # <td>高</td>
531
+ # <td>中</td>
532
+ # <td>低</td>
533
+ # </tr>
534
+ # <tr>
535
+ # <td>支持的语言</td>
536
+ # <td>中文、英文、中英文</td>
537
+ # <td>中文、英文、中英文、日语、韩语、西班牙语、法语、德语、葡萄牙语、越南语、马来语、俄语、意大利语、荷兰语、瑞典语、芬兰语、丹麦语、挪威语、匈牙利语、泰语</td>
538
+ # <td>中文、英文、中英文</td>
539
+ # </tr>
540
+ # <tr>
541
+ # <td>自动语言检测</td>
542
+ # <td>支持</td>
543
+ # <td>支持</td>
544
+ # <td>支持</td>
545
+ # </tr>
546
+ # <tr>
547
+ # <td>返回文本行坐标</td>
548
+ # <td>支持</td>
549
+ # <td>支持</td>
550
+ # <td>支持</td>
551
+ # </tr>
552
+ # <tr>
553
+ # <td>自动旋转纠正</td>
554
+ # <td>支持旋转识别,返回角度信息</td>
555
+ # <td>支持旋转识别,返回角度信息</td>
556
+ # <td>支持旋转识别,返回角度信息</td>
557
+ # </tr>
558
+ # </tbody>
559
+ # </table>
560
+
561
+ # @param request: Request instance for GeneralAccurateOCR.
562
+ # @type request: :class:`Tencentcloud::ocr::V20181119::GeneralAccurateOCRRequest`
563
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::GeneralAccurateOCRResponse`
564
+ def GeneralAccurateOCR(request)
565
+ body = send_request('GeneralAccurateOCR', request.serialize)
566
+ response = JSON.parse(body)
567
+ if response['Response'].key?('Error') == false
568
+ model = GeneralAccurateOCRResponse.new
569
+ model.deserialize(response['Response'])
570
+ model
571
+ else
572
+ code = response['Response']['Error']['Code']
573
+ message = response['Response']['Error']['Message']
574
+ reqid = response['Response']['RequestId']
575
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
576
+ end
577
+ rescue TencentCloud::Common::TencentCloudSDKException => e
578
+ raise e
579
+ rescue StandardError => e
580
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
581
+ end
582
+
583
+ # 本接口支持图像整体文字的检测和识别。可以识别中文、英文、中英文、日语、韩语、西班牙语、法语、德语、葡萄牙语、越南语、马来语、俄语、意大利语、荷兰语、瑞典语、芬兰语、丹麦语、挪威语、匈牙利语、泰语,阿拉伯语20种语言,且各种语言均支持与英文混合的文字识别。
584
+
585
+ # 适用于印刷文档识别、网络图片识别、广告图文字识别、街景店招牌识别、菜单识别、视频标题识别、头像文字识别等场景。
586
+
587
+ # 产品优势:支持自动识别语言类型,可返回文本框坐标信息,对于倾斜文本支持自动旋转纠正。
588
+
589
+ # 通用印刷体识别不同版本的差异如下:
590
+ # <table style="width:715px">
591
+ # <thead>
592
+ # <tr>
593
+ # <th style="width:150px"></th>
594
+ # <th style="width:200px">【荐】通用印刷体识别</th>
595
+ # <th ><a href="https://cloud.tencent.com/document/product/866/34937">【荐】通用印刷体识别(高精度版)</a></th>
596
+ # <th><a href="https://cloud.tencent.com/document/product/866/37831">通用印刷体识别(精简版)</a></th>
597
+ # </tr>
598
+ # </thead>
599
+ # <tbody>
600
+ # <tr>
601
+ # <td> 适用场景</td>
602
+ # <td>适用于所有通用场景的印刷体识别</td>
603
+ # <td>适用于文字较多、长串数字、小字、模糊字、倾斜文本等困难场景</td>
604
+ # <td>适用于快速文本识别场景,准召率有一定损失,价格更优惠</td>
605
+ # </tr>
606
+ # <tr>
607
+ # <td>识别准确率</td>
608
+ # <td>96%</td>
609
+ # <td>99%</td>
610
+ # <td>91%</td>
611
+ # </tr>
612
+ # <tr>
613
+ # <td>价格</td>
614
+ # <td>中</td>
615
+ # <td>高</td>
616
+ # <td>低</td>
617
+ # </tr>
618
+ # <tr>
619
+ # <td>支持的语言</td>
620
+ # <td>中文、英文、中英文、日语、韩语、西班牙语、法语、德语、葡萄牙语、越南语、马来语、俄语、意大利语、荷兰语、瑞典语、芬兰语、丹麦语、挪威语、匈牙利语、泰语</td>
621
+ # <td>中文、英文、中英文</td>
622
+ # <td>中文、英文、中英文</td>
623
+ # </tr>
624
+ # <tr>
625
+ # <td>自动语言检测</td>
626
+ # <td>支持</td>
627
+ # <td>支持</td>
628
+ # <td>支持</td>
629
+ # </tr>
630
+ # <tr>
631
+ # <td>返回文本行坐标</td>
632
+ # <td>支持</td>
633
+ # <td>支持</td>
634
+ # <td>支持</td>
635
+ # </tr>
636
+ # <tr>
637
+ # <td>自动旋转纠正</td>
638
+ # <td>支持旋转识别,返回角度信息</td>
639
+ # <td>支持旋转识别,返回角度信息</td>
640
+ # <td>支持旋转识别,返回角度信息</td>
641
+ # </tr>
642
+ # </tbody>
643
+ # </table>
644
+
645
+ # @param request: Request instance for GeneralBasicOCR.
646
+ # @type request: :class:`Tencentcloud::ocr::V20181119::GeneralBasicOCRRequest`
647
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::GeneralBasicOCRResponse`
648
+ def GeneralBasicOCR(request)
649
+ body = send_request('GeneralBasicOCR', request.serialize)
650
+ response = JSON.parse(body)
651
+ if response['Response'].key?('Error') == false
652
+ model = GeneralBasicOCRResponse.new
653
+ model.deserialize(response['Response'])
654
+ model
655
+ else
656
+ code = response['Response']['Error']['Code']
657
+ message = response['Response']['Error']['Message']
658
+ reqid = response['Response']['RequestId']
659
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
660
+ end
661
+ rescue TencentCloud::Common::TencentCloudSDKException => e
662
+ raise e
663
+ rescue StandardError => e
664
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
665
+ end
666
+
667
+ # 本接口支持图像整体文字的检测和识别。支持中文、英文、中英文、数字和特殊字符号的识别,并返回文字框位置和文字内容。
668
+
669
+ # 适用于快速文本识别场景。
670
+
671
+ # 产品优势:与通用印刷体识别接口相比,精简版虽然在准确率和召回率上有一定损失,但价格更加优惠。
672
+
673
+ # 通用印刷体识别不同版本的差异如下:
674
+ # <table style="width:715px">
675
+ # <thead>
676
+ # <tr>
677
+ # <th style="width:150px"></th>
678
+ # <th >通用印刷体识别(精简版)</th>
679
+ # <th style="width:200px"><a href="https://cloud.tencent.com/document/product/866/33526">【荐】通用印刷体识别</a></th>
680
+ # <th><a href="https://cloud.tencent.com/document/product/866/34937">【荐】通用印刷体识别(高精度版)</a></th>
681
+ # </tr>
682
+ # </thead>
683
+ # <tbody>
684
+ # <tr>
685
+ # <td> 适用场景</td>
686
+ # <td>适用于快速文本识别场景,准召率有一定损失,价格更优惠</td>
687
+ # <td>适用于所有通用场景的印刷体识别</td>
688
+ # <td>适用于文字较多、长串数字、小字、模糊字、倾斜文本等困难场景</td>
689
+
690
+
691
+ # </tr>
692
+ # <tr>
693
+ # <td>识别准确率</td>
694
+ # <td>91%</td>
695
+ # <td>96%</td>
696
+ # <td>99%</td>
697
+
698
+
699
+ # </tr>
700
+ # <tr>
701
+ # <td>价格</td>
702
+ # <td>低</td>
703
+ # <td>中</td>
704
+ # <td>高</td>
705
+
706
+
707
+ # </tr>
708
+ # <tr>
709
+ # <td>支持的语言</td>
710
+ # <td>中文、英文、中英文</td>
711
+ # <td>中文、英文、中英文、日语、韩语、西班牙语、法语、德语、葡萄牙语、越南语、马来语、俄语、意大利语、荷兰语、瑞典语、芬兰语、丹麦语、挪威语、匈牙利语、泰语</td>
712
+ # <td>中文、英文、中英文</td>
713
+
714
+
715
+ # </tr>
716
+ # <tr>
717
+ # <td>自动语言检测</td>
718
+ # <td>支持</td>
719
+ # <td>支持</td>
720
+ # <td>支持</td>
721
+
722
+
723
+ # </tr>
724
+ # <tr>
725
+ # <td>返回文本行坐标</td>
726
+ # <td>支持</td>
727
+ # <td>支持</td>
728
+ # <td>支持</td>
729
+
730
+
731
+ # </tr>
732
+ # <tr>
733
+ # <td>自动旋转纠正</td>
734
+ # <td>支持旋转识别,返回角度信息</td>
735
+ # <td>支持旋转识别,返回角度信息</td>
736
+ # <td>支持旋转识别,返回角度信息</td>
737
+
738
+
739
+ # </tr>
740
+ # </tbody>
741
+ # </table>
742
+
743
+ # @param request: Request instance for GeneralEfficientOCR.
744
+ # @type request: :class:`Tencentcloud::ocr::V20181119::GeneralEfficientOCRRequest`
745
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::GeneralEfficientOCRResponse`
746
+ def GeneralEfficientOCR(request)
747
+ body = send_request('GeneralEfficientOCR', request.serialize)
748
+ response = JSON.parse(body)
749
+ if response['Response'].key?('Error') == false
750
+ model = GeneralEfficientOCRResponse.new
751
+ model.deserialize(response['Response'])
752
+ model
753
+ else
754
+ code = response['Response']['Error']['Code']
755
+ message = response['Response']['Error']['Message']
756
+ reqid = response['Response']['RequestId']
757
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
758
+ end
759
+ rescue TencentCloud::Common::TencentCloudSDKException => e
760
+ raise e
761
+ rescue StandardError => e
762
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
763
+ end
764
+
765
+ # 本接口支持图片中整体文字的检测和识别,返回文字框位置与文字内容。相比通用印刷体识别接口,识别速度更快、支持的 QPS 更高。
766
+
767
+ # @param request: Request instance for GeneralFastOCR.
768
+ # @type request: :class:`Tencentcloud::ocr::V20181119::GeneralFastOCRRequest`
769
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::GeneralFastOCRResponse`
770
+ def GeneralFastOCR(request)
771
+ body = send_request('GeneralFastOCR', request.serialize)
772
+ response = JSON.parse(body)
773
+ if response['Response'].key?('Error') == false
774
+ model = GeneralFastOCRResponse.new
775
+ model.deserialize(response['Response'])
776
+ model
777
+ else
778
+ code = response['Response']['Error']['Code']
779
+ message = response['Response']['Error']['Message']
780
+ reqid = response['Response']['RequestId']
781
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
782
+ end
783
+ rescue TencentCloud::Common::TencentCloudSDKException => e
784
+ raise e
785
+ rescue StandardError => e
786
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
787
+ end
788
+
789
+ # 本接口支持图片内手写体文字的检测和识别,针对手写字体无规则、字迹潦草、模糊等特点进行了识别能力的增强。
790
+
791
+ # @param request: Request instance for GeneralHandwritingOCR.
792
+ # @type request: :class:`Tencentcloud::ocr::V20181119::GeneralHandwritingOCRRequest`
793
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::GeneralHandwritingOCRResponse`
794
+ def GeneralHandwritingOCR(request)
795
+ body = send_request('GeneralHandwritingOCR', request.serialize)
796
+ response = JSON.parse(body)
797
+ if response['Response'].key?('Error') == false
798
+ model = GeneralHandwritingOCRResponse.new
799
+ model.deserialize(response['Response'])
800
+ model
801
+ else
802
+ code = response['Response']['Error']['Code']
803
+ message = response['Response']['Error']['Message']
804
+ reqid = response['Response']['RequestId']
805
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
806
+ end
807
+ rescue TencentCloud::Common::TencentCloudSDKException => e
808
+ raise e
809
+ rescue StandardError => e
810
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
811
+ end
812
+
813
+ # 本接口支持中国香港身份证人像面中关键字段的识别,包括中文姓名、英文姓名、姓名电码、出生日期、性别、证件符号、首次签发日期、最近领用日期、身份证号、是否是永久性居民身份证;具备防伪识别、人像照片裁剪等扩展功能。
814
+ # 本接口暂未完全对外开放,如需咨询,请[联系商务](https://cloud.tencent.com/about/connect)
815
+
816
+ # @param request: Request instance for HKIDCardOCR.
817
+ # @type request: :class:`Tencentcloud::ocr::V20181119::HKIDCardOCRRequest`
818
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::HKIDCardOCRResponse`
819
+ def HKIDCardOCR(request)
820
+ body = send_request('HKIDCardOCR', request.serialize)
821
+ response = JSON.parse(body)
822
+ if response['Response'].key?('Error') == false
823
+ model = HKIDCardOCRResponse.new
824
+ model.deserialize(response['Response'])
825
+ model
826
+ else
827
+ code = response['Response']['Error']['Code']
828
+ message = response['Response']['Error']['Message']
829
+ reqid = response['Response']['RequestId']
830
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
831
+ end
832
+ rescue TencentCloud::Common::TencentCloudSDKException => e
833
+ raise e
834
+ rescue StandardError => e
835
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
836
+ end
837
+
838
+ # 港澳台居住证OCR支持港澳台居住证正反面全字段内容检测识别功能,包括姓名、性别、出生日期、地址、身份证ID、签发机关、有效期限、签发次数、通行证号码关键字段识别。可以应用于港澳台居住证信息有效性校验场景,例如银行开户、用户注册等场景。
839
+
840
+ # @param request: Request instance for HmtResidentPermitOCR.
841
+ # @type request: :class:`Tencentcloud::ocr::V20181119::HmtResidentPermitOCRRequest`
842
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::HmtResidentPermitOCRResponse`
843
+ def HmtResidentPermitOCR(request)
844
+ body = send_request('HmtResidentPermitOCR', request.serialize)
845
+ response = JSON.parse(body)
846
+ if response['Response'].key?('Error') == false
847
+ model = HmtResidentPermitOCRResponse.new
848
+ model.deserialize(response['Response'])
849
+ model
850
+ else
851
+ code = response['Response']['Error']['Code']
852
+ message = response['Response']['Error']['Message']
853
+ reqid = response['Response']['RequestId']
854
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
855
+ end
856
+ rescue TencentCloud::Common::TencentCloudSDKException => e
857
+ raise e
858
+ rescue StandardError => e
859
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
860
+ end
861
+
862
+ # 本接口支持中国大陆居民二代身份证正反面所有字段的识别,包括姓名、性别、民族、出生日期、住址、公民身份证号、签发机关、有效期限,识别准确度达到99%以上。
863
+
864
+ # 另外,本接口还支持多种增值能力,满足不同场景的需求。如身份证照片、人像照片的裁剪功能,同时具备9种告警功能,如下表所示。
865
+
866
+ # <table style="width:650px">
867
+ # <thead>
868
+ # <tr>
869
+ # <th width="150">增值能力</th>
870
+ # <th width="500">能力项</th>
871
+ # </tr>
872
+ # </thead>
873
+ # <tbody>
874
+ # <tr>
875
+ # <td rowspan="2">裁剪功能</td>
876
+ # <td>身份证照片裁剪(去掉证件外多余的边缘、自动矫正拍摄角度)</td>
877
+ # </tr>
878
+ # <tr>
879
+ # <td>人像照片裁剪(自动抠取身份证头像区域)</td>
880
+ # </tr>
881
+ # <tr>
882
+ # <td rowspan="9">告警功能</td>
883
+ # <td>身份证有效日期不合法告警</td>
884
+ # </tr>
885
+ # <tr>
886
+ # <td>身份证边框不完整告警</td>
887
+ # </tr>
888
+ # <tr>
889
+ # <td>身份证复印件告警</td>
890
+ # </tr>
891
+ # <tr>
892
+ # <td>身份证翻拍告警</td>
893
+ # </tr>
894
+ # <tr>
895
+ # <td>身份证框内遮挡告警</td>
896
+ # </tr>
897
+ # <tr>
898
+ # <td>临时身份证告警</td>
899
+ # </tr>
900
+ # <tr>
901
+ # <td>身份证 PS 告警</td>
902
+ # </tr>
903
+ # <tr>
904
+ # <td>图片模糊告警(可根据图片质量分数判断)</td>
905
+ # </tr>
906
+ # </tbody>
907
+ # </table>
908
+
909
+ # @param request: Request instance for IDCardOCR.
910
+ # @type request: :class:`Tencentcloud::ocr::V20181119::IDCardOCRRequest`
911
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::IDCardOCRResponse`
912
+ def IDCardOCR(request)
913
+ body = send_request('IDCardOCR', request.serialize)
914
+ response = JSON.parse(body)
915
+ if response['Response'].key?('Error') == false
916
+ model = IDCardOCRResponse.new
917
+ model.deserialize(response['Response'])
918
+ model
919
+ else
920
+ code = response['Response']['Error']['Code']
921
+ message = response['Response']['Error']['Message']
922
+ reqid = response['Response']['RequestId']
923
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
924
+ end
925
+ rescue TencentCloud::Common::TencentCloudSDKException => e
926
+ raise e
927
+ rescue StandardError => e
928
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
929
+ end
930
+
931
+ # 本接口支持事业单位法人证书关键字段识别,包括注册号、有效期、住所、名称、法定代表人等。
932
+
933
+ # @param request: Request instance for InstitutionOCR.
934
+ # @type request: :class:`Tencentcloud::ocr::V20181119::InstitutionOCRRequest`
935
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::InstitutionOCRResponse`
936
+ def InstitutionOCR(request)
937
+ body = send_request('InstitutionOCR', request.serialize)
938
+ response = JSON.parse(body)
939
+ if response['Response'].key?('Error') == false
940
+ model = InstitutionOCRResponse.new
941
+ model.deserialize(response['Response'])
942
+ model
943
+ else
944
+ code = response['Response']['Error']['Code']
945
+ message = response['Response']['Error']['Message']
946
+ reqid = response['Response']['RequestId']
947
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
948
+ end
949
+ rescue TencentCloud::Common::TencentCloudSDKException => e
950
+ raise e
951
+ rescue StandardError => e
952
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
953
+ end
954
+
955
+ # 本接口支持病案首页、费用清单、结算单、医疗发票四种保险理赔单据的文本识别和结构化输出。
956
+
957
+ # @param request: Request instance for InsuranceBillOCR.
958
+ # @type request: :class:`Tencentcloud::ocr::V20181119::InsuranceBillOCRRequest`
959
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::InsuranceBillOCRResponse`
960
+ def InsuranceBillOCR(request)
961
+ body = send_request('InsuranceBillOCR', request.serialize)
962
+ response = JSON.parse(body)
963
+ if response['Response'].key?('Error') == false
964
+ model = InsuranceBillOCRResponse.new
965
+ model.deserialize(response['Response'])
966
+ model
967
+ else
968
+ code = response['Response']['Error']['Code']
969
+ message = response['Response']['Error']['Message']
970
+ reqid = response['Response']['RequestId']
971
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
972
+ end
973
+ rescue TencentCloud::Common::TencentCloudSDKException => e
974
+ raise e
975
+ rescue StandardError => e
976
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
977
+ end
978
+
979
+ # 本接口支持对通用机打发票的发票代码、发票号码、日期、购买方识别号、销售方识别号、校验码、小写金额等关键字段的识别。
980
+
981
+ # @param request: Request instance for InvoiceGeneralOCR.
982
+ # @type request: :class:`Tencentcloud::ocr::V20181119::InvoiceGeneralOCRRequest`
983
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::InvoiceGeneralOCRResponse`
984
+ def InvoiceGeneralOCR(request)
985
+ body = send_request('InvoiceGeneralOCR', request.serialize)
986
+ response = JSON.parse(body)
987
+ if response['Response'].key?('Error') == false
988
+ model = InvoiceGeneralOCRResponse.new
989
+ model.deserialize(response['Response'])
990
+ model
991
+ else
992
+ code = response['Response']['Error']['Code']
993
+ message = response['Response']['Error']['Message']
994
+ reqid = response['Response']['RequestId']
995
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
996
+ end
997
+ rescue TencentCloud::Common::TencentCloudSDKException => e
998
+ raise e
999
+ rescue StandardError => e
1000
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1001
+ end
1002
+
1003
+ # 本接口支持对中国大陆机动车车牌的自动定位和识别,返回地域编号和车牌号信息。
1004
+
1005
+ # @param request: Request instance for LicensePlateOCR.
1006
+ # @type request: :class:`Tencentcloud::ocr::V20181119::LicensePlateOCRRequest`
1007
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::LicensePlateOCRResponse`
1008
+ def LicensePlateOCR(request)
1009
+ body = send_request('LicensePlateOCR', request.serialize)
1010
+ response = JSON.parse(body)
1011
+ if response['Response'].key?('Error') == false
1012
+ model = LicensePlateOCRResponse.new
1013
+ model.deserialize(response['Response'])
1014
+ model
1015
+ else
1016
+ code = response['Response']['Error']['Code']
1017
+ message = response['Response']['Error']['Message']
1018
+ reqid = response['Response']['RequestId']
1019
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1020
+ end
1021
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1022
+ raise e
1023
+ rescue StandardError => e
1024
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1025
+ end
1026
+
1027
+ # 本接口支持马来西亚身份证识别,识别字段包括身份证号、姓名、性别、地址;具备身份证人像照片的裁剪功能和翻拍、复印件告警功能。
1028
+ # 本接口暂未完全对外开放,如需咨询,请[联系商务](https://cloud.tencent.com/about/connect)
1029
+
1030
+ # @param request: Request instance for MLIDCardOCR.
1031
+ # @type request: :class:`Tencentcloud::ocr::V20181119::MLIDCardOCRRequest`
1032
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::MLIDCardOCRResponse`
1033
+ def MLIDCardOCR(request)
1034
+ body = send_request('MLIDCardOCR', request.serialize)
1035
+ response = JSON.parse(body)
1036
+ if response['Response'].key?('Error') == false
1037
+ model = MLIDCardOCRResponse.new
1038
+ model.deserialize(response['Response'])
1039
+ model
1040
+ else
1041
+ code = response['Response']['Error']['Code']
1042
+ message = response['Response']['Error']['Message']
1043
+ reqid = response['Response']['RequestId']
1044
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1045
+ end
1046
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1047
+ raise e
1048
+ rescue StandardError => e
1049
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1050
+ end
1051
+
1052
+ # 本接口支持中国港澳台地区以及其他国家、地区的护照识别。识别字段包括护照ID、姓名、出生日期、性别、有效期、发行国、国籍,具备护照人像照片的裁剪功能和翻拍、复印件告警功能。
1053
+
1054
+ # @param request: Request instance for MLIDPassportOCR.
1055
+ # @type request: :class:`Tencentcloud::ocr::V20181119::MLIDPassportOCRRequest`
1056
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::MLIDPassportOCRResponse`
1057
+ def MLIDPassportOCR(request)
1058
+ body = send_request('MLIDPassportOCR', request.serialize)
1059
+ response = JSON.parse(body)
1060
+ if response['Response'].key?('Error') == false
1061
+ model = MLIDPassportOCRResponse.new
1062
+ model.deserialize(response['Response'])
1063
+ model
1064
+ else
1065
+ code = response['Response']['Error']['Code']
1066
+ message = response['Response']['Error']['Message']
1067
+ reqid = response['Response']['RequestId']
1068
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1069
+ end
1070
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1071
+ raise e
1072
+ rescue StandardError => e
1073
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1074
+ end
1075
+
1076
+ # 智能识别并结构化港澳台居民来往内地通行证正面全部字段,包含中文姓名、英文姓名、性别、出生日期、签发机关、有效期限、证件号、签发地点、签发次数、证件类别。
1077
+
1078
+ # @param request: Request instance for MainlandPermitOCR.
1079
+ # @type request: :class:`Tencentcloud::ocr::V20181119::MainlandPermitOCRRequest`
1080
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::MainlandPermitOCRResponse`
1081
+ def MainlandPermitOCR(request)
1082
+ body = send_request('MainlandPermitOCR', request.serialize)
1083
+ response = JSON.parse(body)
1084
+ if response['Response'].key?('Error') == false
1085
+ model = MainlandPermitOCRResponse.new
1086
+ model.deserialize(response['Response'])
1087
+ model
1088
+ else
1089
+ code = response['Response']['Error']['Code']
1090
+ message = response['Response']['Error']['Message']
1091
+ reqid = response['Response']['RequestId']
1092
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1093
+ end
1094
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1095
+ raise e
1096
+ rescue StandardError => e
1097
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1098
+ end
1099
+
1100
+ # 本接口支持多张、多类型票据的混合检测和自动分类,返回对应票据类型。目前已支持增值税发票、增值税发票(卷票)、定额发票、通用机打发票、购车发票、火车票、出租车发票、机票行程单、汽车票、轮船票、过路过桥费发票、酒店账单、客运限额发票、购物小票、完税证明共15种票据。
1101
+
1102
+ # @param request: Request instance for MixedInvoiceDetect.
1103
+ # @type request: :class:`Tencentcloud::ocr::V20181119::MixedInvoiceDetectRequest`
1104
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::MixedInvoiceDetectResponse`
1105
+ def MixedInvoiceDetect(request)
1106
+ body = send_request('MixedInvoiceDetect', request.serialize)
1107
+ response = JSON.parse(body)
1108
+ if response['Response'].key?('Error') == false
1109
+ model = MixedInvoiceDetectResponse.new
1110
+ model.deserialize(response['Response'])
1111
+ model
1112
+ else
1113
+ code = response['Response']['Error']['Code']
1114
+ message = response['Response']['Error']['Message']
1115
+ reqid = response['Response']['RequestId']
1116
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1117
+ end
1118
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1119
+ raise e
1120
+ rescue StandardError => e
1121
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1122
+ end
1123
+
1124
+ # 本接口支持多张、多类型票据的混合识别,系统自动实现分割、分类和识别,同时支持自选需要识别的票据类型。目前已支持增值税发票、增值税发票(卷票)、定额发票、通用机打发票、购车发票、火车票、出租车发票、机票行程单、汽车票、轮船票、过路过桥费发票共11种票据。
1125
+
1126
+ # @param request: Request instance for MixedInvoiceOCR.
1127
+ # @type request: :class:`Tencentcloud::ocr::V20181119::MixedInvoiceOCRRequest`
1128
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::MixedInvoiceOCRResponse`
1129
+ def MixedInvoiceOCR(request)
1130
+ body = send_request('MixedInvoiceOCR', request.serialize)
1131
+ response = JSON.parse(body)
1132
+ if response['Response'].key?('Error') == false
1133
+ model = MixedInvoiceOCRResponse.new
1134
+ model.deserialize(response['Response'])
1135
+ model
1136
+ else
1137
+ code = response['Response']['Error']['Code']
1138
+ message = response['Response']['Error']['Message']
1139
+ reqid = response['Response']['RequestId']
1140
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1141
+ end
1142
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1143
+ raise e
1144
+ rescue StandardError => e
1145
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1146
+ end
1147
+
1148
+ # 本接口支持组织机构代码证关键字段的识别,包括代码、有效期、地址、机构名称等。
1149
+
1150
+ # @param request: Request instance for OrgCodeCertOCR.
1151
+ # @type request: :class:`Tencentcloud::ocr::V20181119::OrgCodeCertOCRRequest`
1152
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::OrgCodeCertOCRResponse`
1153
+ def OrgCodeCertOCR(request)
1154
+ body = send_request('OrgCodeCertOCR', request.serialize)
1155
+ response = JSON.parse(body)
1156
+ if response['Response'].key?('Error') == false
1157
+ model = OrgCodeCertOCRResponse.new
1158
+ model.deserialize(response['Response'])
1159
+ model
1160
+ else
1161
+ code = response['Response']['Error']['Code']
1162
+ message = response['Response']['Error']['Message']
1163
+ reqid = response['Response']['RequestId']
1164
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1165
+ end
1166
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1167
+ raise e
1168
+ rescue StandardError => e
1169
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1170
+ end
1171
+
1172
+ # 本接口支持中国大陆地区护照个人资料页多个字段的检测与识别。已支持字段包括英文姓名、中文姓名、国家码、护照号、出生地、出生日期、国籍英文、性别英文、有效期、签发地点英文、签发日期、持证人签名、护照机读码(MRZ码)等。
1173
+
1174
+ # @param request: Request instance for PassportOCR.
1175
+ # @type request: :class:`Tencentcloud::ocr::V20181119::PassportOCRRequest`
1176
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::PassportOCRResponse`
1177
+ def PassportOCR(request)
1178
+ body = send_request('PassportOCR', request.serialize)
1179
+ response = JSON.parse(body)
1180
+ if response['Response'].key?('Error') == false
1181
+ model = PassportOCRResponse.new
1182
+ model.deserialize(response['Response'])
1183
+ model
1184
+ else
1185
+ code = response['Response']['Error']['Code']
1186
+ message = response['Response']['Error']['Message']
1187
+ reqid = response['Response']['RequestId']
1188
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1189
+ end
1190
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1191
+ raise e
1192
+ rescue StandardError => e
1193
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1194
+ end
1195
+
1196
+ # 本接口支持对卡式港澳台通行证的识别,包括签发地点、签发机关、有效期限、性别、出生日期、英文姓名、姓名、证件号等字段。
1197
+
1198
+ # @param request: Request instance for PermitOCR.
1199
+ # @type request: :class:`Tencentcloud::ocr::V20181119::PermitOCRRequest`
1200
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::PermitOCRResponse`
1201
+ def PermitOCR(request)
1202
+ body = send_request('PermitOCR', request.serialize)
1203
+ response = JSON.parse(body)
1204
+ if response['Response'].key?('Error') == false
1205
+ model = PermitOCRResponse.new
1206
+ model.deserialize(response['Response'])
1207
+ model
1208
+ else
1209
+ code = response['Response']['Error']['Code']
1210
+ message = response['Response']['Error']['Message']
1211
+ reqid = response['Response']['RequestId']
1212
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1213
+ end
1214
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1215
+ raise e
1216
+ rescue StandardError => e
1217
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1218
+ end
1219
+
1220
+ # 本接口支持房产证关键字段的识别,包括房地产权利人、共有情况、登记时间、规划用途、房屋性质、房屋坐落等。
1221
+ # 目前接口对合肥、成都、佛山三个城市的房产证版式识别较好。
1222
+
1223
+ # @param request: Request instance for PropOwnerCertOCR.
1224
+ # @type request: :class:`Tencentcloud::ocr::V20181119::PropOwnerCertOCRRequest`
1225
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::PropOwnerCertOCRResponse`
1226
+ def PropOwnerCertOCR(request)
1227
+ body = send_request('PropOwnerCertOCR', request.serialize)
1228
+ response = JSON.parse(body)
1229
+ if response['Response'].key?('Error') == false
1230
+ model = PropOwnerCertOCRResponse.new
1231
+ model.deserialize(response['Response'])
1232
+ model
1233
+ else
1234
+ code = response['Response']['Error']['Code']
1235
+ message = response['Response']['Error']['Message']
1236
+ reqid = response['Response']['RequestId']
1237
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1238
+ end
1239
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1240
+ raise e
1241
+ rescue StandardError => e
1242
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1243
+ end
1244
+
1245
+ # 本接口支持条形码和二维码的识别(包括 DataMatrix 和 PDF417)。
1246
+
1247
+ # @param request: Request instance for QrcodeOCR.
1248
+ # @type request: :class:`Tencentcloud::ocr::V20181119::QrcodeOCRRequest`
1249
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::QrcodeOCRResponse`
1250
+ def QrcodeOCR(request)
1251
+ body = send_request('QrcodeOCR', request.serialize)
1252
+ response = JSON.parse(body)
1253
+ if response['Response'].key?('Error') == false
1254
+ model = QrcodeOCRResponse.new
1255
+ model.deserialize(response['Response'])
1256
+ model
1257
+ else
1258
+ code = response['Response']['Error']['Code']
1259
+ message = response['Response']['Error']['Message']
1260
+ reqid = response['Response']['RequestId']
1261
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1262
+ end
1263
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1264
+ raise e
1265
+ rescue StandardError => e
1266
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1267
+ end
1268
+
1269
+ # 本接口支持条形码备案信息查询,返回条形码查询结果的相关信息,包括产品名称、产品英文名称、品牌名称、规格型号、宽度、高度、深度、关键字、产品描述、厂家名称、厂家地址、企业社会信用代码13个字段信息。
1270
+
1271
+ # 产品优势:直联中国物品编码中心,查询结果更加准确、可靠。
1272
+
1273
+ # @param request: Request instance for QueryBarCode.
1274
+ # @type request: :class:`Tencentcloud::ocr::V20181119::QueryBarCodeRequest`
1275
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::QueryBarCodeResponse`
1276
+ def QueryBarCode(request)
1277
+ body = send_request('QueryBarCode', request.serialize)
1278
+ response = JSON.parse(body)
1279
+ if response['Response'].key?('Error') == false
1280
+ model = QueryBarCodeResponse.new
1281
+ model.deserialize(response['Response'])
1282
+ model
1283
+ else
1284
+ code = response['Response']['Error']['Code']
1285
+ message = response['Response']['Error']['Message']
1286
+ reqid = response['Response']['RequestId']
1287
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1288
+ end
1289
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1290
+ raise e
1291
+ rescue StandardError => e
1292
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1293
+ end
1294
+
1295
+ # 本接口支持定额发票的发票号码、发票代码、金额(大小写)、发票消费类型、地区及是否有公司印章等关键字段的识别。
1296
+
1297
+ # @param request: Request instance for QuotaInvoiceOCR.
1298
+ # @type request: :class:`Tencentcloud::ocr::V20181119::QuotaInvoiceOCRRequest`
1299
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::QuotaInvoiceOCRResponse`
1300
+ def QuotaInvoiceOCR(request)
1301
+ body = send_request('QuotaInvoiceOCR', request.serialize)
1302
+ response = JSON.parse(body)
1303
+ if response['Response'].key?('Error') == false
1304
+ model = QuotaInvoiceOCRResponse.new
1305
+ model.deserialize(response['Response'])
1306
+ model
1307
+ else
1308
+ code = response['Response']['Error']['Code']
1309
+ message = response['Response']['Error']['Message']
1310
+ reqid = response['Response']['RequestId']
1311
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1312
+ end
1313
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1314
+ raise e
1315
+ rescue StandardError => e
1316
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1317
+ end
1318
+
1319
+ # 本接口支持集装箱箱门信息识别,识别字段包括集装箱箱号、类型、总重量、有效承重、容量、自身重量,具备集装箱箱号、类型不完整或者不清晰的告警功能。
1320
+
1321
+ # @param request: Request instance for RecognizeContainerOCR.
1322
+ # @type request: :class:`Tencentcloud::ocr::V20181119::RecognizeContainerOCRRequest`
1323
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::RecognizeContainerOCRResponse`
1324
+ def RecognizeContainerOCR(request)
1325
+ body = send_request('RecognizeContainerOCR', request.serialize)
1326
+ response = JSON.parse(body)
1327
+ if response['Response'].key?('Error') == false
1328
+ model = RecognizeContainerOCRResponse.new
1329
+ model.deserialize(response['Response'])
1330
+ model
1331
+ else
1332
+ code = response['Response']['Error']['Code']
1333
+ message = response['Response']['Error']['Message']
1334
+ reqid = response['Response']['RequestId']
1335
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1336
+ end
1337
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1338
+ raise e
1339
+ rescue StandardError => e
1340
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1341
+ end
1342
+
1343
+ # 本接口支持网约车行程单关键字段的识别,包括行程起止日期、上车时间、起点、终点、里程、金额等字段。
1344
+
1345
+ # @param request: Request instance for RecognizeOnlineTaxiItineraryOCR.
1346
+ # @type request: :class:`Tencentcloud::ocr::V20181119::RecognizeOnlineTaxiItineraryOCRRequest`
1347
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::RecognizeOnlineTaxiItineraryOCRResponse`
1348
+ def RecognizeOnlineTaxiItineraryOCR(request)
1349
+ body = send_request('RecognizeOnlineTaxiItineraryOCR', request.serialize)
1350
+ response = JSON.parse(body)
1351
+ if response['Response'].key?('Error') == false
1352
+ model = RecognizeOnlineTaxiItineraryOCRResponse.new
1353
+ model.deserialize(response['Response'])
1354
+ model
1355
+ else
1356
+ code = response['Response']['Error']['Code']
1357
+ message = response['Response']['Error']['Message']
1358
+ reqid = response['Response']['RequestId']
1359
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1360
+ end
1361
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1362
+ raise e
1363
+ rescue StandardError => e
1364
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1365
+ end
1366
+
1367
+ # 本接口支持中英文图片/ PDF内常规表格、无线表格、多表格的检测和识别,支持日文有线表格识别,返回每个单元格的文字内容,支持旋转的表格图片识别,且支持将识别结果保存为 Excel 格式。
1368
+
1369
+ # @param request: Request instance for RecognizeTableOCR.
1370
+ # @type request: :class:`Tencentcloud::ocr::V20181119::RecognizeTableOCRRequest`
1371
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::RecognizeTableOCRResponse`
1372
+ def RecognizeTableOCR(request)
1373
+ body = send_request('RecognizeTableOCR', request.serialize)
1374
+ response = JSON.parse(body)
1375
+ if response['Response'].key?('Error') == false
1376
+ model = RecognizeTableOCRResponse.new
1377
+ model.deserialize(response['Response'])
1378
+ model
1379
+ else
1380
+ code = response['Response']['Error']['Code']
1381
+ message = response['Response']['Error']['Message']
1382
+ reqid = response['Response']['RequestId']
1383
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1384
+ end
1385
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1386
+ raise e
1387
+ rescue StandardError => e
1388
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1389
+ end
1390
+
1391
+ # 本接口支持泰国身份证识别,识别字段包括泰文姓名、英文姓名、地址、出生日期、身份证号码。
1392
+ # 本接口暂未完全对外开放,如需咨询,请[联系商务](https://cloud.tencent.com/about/connect)
1393
+
1394
+ # @param request: Request instance for RecognizeThaiIDCardOCR.
1395
+ # @type request: :class:`Tencentcloud::ocr::V20181119::RecognizeThaiIDCardOCRRequest`
1396
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::RecognizeThaiIDCardOCRResponse`
1397
+ def RecognizeThaiIDCardOCR(request)
1398
+ body = send_request('RecognizeThaiIDCardOCR', request.serialize)
1399
+ response = JSON.parse(body)
1400
+ if response['Response'].key?('Error') == false
1401
+ model = RecognizeThaiIDCardOCRResponse.new
1402
+ model.deserialize(response['Response'])
1403
+ model
1404
+ else
1405
+ code = response['Response']['Error']['Code']
1406
+ message = response['Response']['Error']['Message']
1407
+ reqid = response['Response']['RequestId']
1408
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1409
+ end
1410
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1411
+ raise e
1412
+ rescue StandardError => e
1413
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1414
+ end
1415
+
1416
+ # 本接口支持居民户口簿户主页及成员页关键字段的识别,包括姓名、户别、地址、籍贯、身份证号码等。
1417
+
1418
+ # @param request: Request instance for ResidenceBookletOCR.
1419
+ # @type request: :class:`Tencentcloud::ocr::V20181119::ResidenceBookletOCRRequest`
1420
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::ResidenceBookletOCRResponse`
1421
+ def ResidenceBookletOCR(request)
1422
+ body = send_request('ResidenceBookletOCR', request.serialize)
1423
+ response = JSON.parse(body)
1424
+ if response['Response'].key?('Error') == false
1425
+ model = ResidenceBookletOCRResponse.new
1426
+ model.deserialize(response['Response'])
1427
+ model
1428
+ else
1429
+ code = response['Response']['Error']['Code']
1430
+ message = response['Response']['Error']['Message']
1431
+ reqid = response['Response']['RequestId']
1432
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1433
+ end
1434
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1435
+ raise e
1436
+ rescue StandardError => e
1437
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1438
+ end
1439
+
1440
+ # 本接口支持网约车驾驶证关键字段的识别,包括姓名、证号、起始日期、截止日期、发证日期。
1441
+
1442
+ # @param request: Request instance for RideHailingDriverLicenseOCR.
1443
+ # @type request: :class:`Tencentcloud::ocr::V20181119::RideHailingDriverLicenseOCRRequest`
1444
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::RideHailingDriverLicenseOCRResponse`
1445
+ def RideHailingDriverLicenseOCR(request)
1446
+ body = send_request('RideHailingDriverLicenseOCR', request.serialize)
1447
+ response = JSON.parse(body)
1448
+ if response['Response'].key?('Error') == false
1449
+ model = RideHailingDriverLicenseOCRResponse.new
1450
+ model.deserialize(response['Response'])
1451
+ model
1452
+ else
1453
+ code = response['Response']['Error']['Code']
1454
+ message = response['Response']['Error']['Message']
1455
+ reqid = response['Response']['RequestId']
1456
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1457
+ end
1458
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1459
+ raise e
1460
+ rescue StandardError => e
1461
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1462
+ end
1463
+
1464
+ # 本接口支持网约车运输证关键字段的识别,包括交运管许可字号、车辆所有人、车辆号牌、起始日期、截止日期、发证日期。
1465
+
1466
+
1467
+ # @param request: Request instance for RideHailingTransportLicenseOCR.
1468
+ # @type request: :class:`Tencentcloud::ocr::V20181119::RideHailingTransportLicenseOCRRequest`
1469
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::RideHailingTransportLicenseOCRResponse`
1470
+ def RideHailingTransportLicenseOCR(request)
1471
+ body = send_request('RideHailingTransportLicenseOCR', request.serialize)
1472
+ response = JSON.parse(body)
1473
+ if response['Response'].key?('Error') == false
1474
+ model = RideHailingTransportLicenseOCRResponse.new
1475
+ model.deserialize(response['Response'])
1476
+ model
1477
+ else
1478
+ code = response['Response']['Error']['Code']
1479
+ message = response['Response']['Error']['Message']
1480
+ reqid = response['Response']['RequestId']
1481
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1482
+ end
1483
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1484
+ raise e
1485
+ rescue StandardError => e
1486
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1487
+ end
1488
+
1489
+ # 印章识别已支持各类印章,包括发票章,财务章等,适用于公文,票据等场景。
1490
+
1491
+ # @param request: Request instance for SealOCR.
1492
+ # @type request: :class:`Tencentcloud::ocr::V20181119::SealOCRRequest`
1493
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::SealOCRResponse`
1494
+ def SealOCR(request)
1495
+ body = send_request('SealOCR', request.serialize)
1496
+ response = JSON.parse(body)
1497
+ if response['Response'].key?('Error') == false
1498
+ model = SealOCRResponse.new
1499
+ model.deserialize(response['Response'])
1500
+ model
1501
+ else
1502
+ code = response['Response']['Error']['Code']
1503
+ message = response['Response']['Error']['Message']
1504
+ reqid = response['Response']['RequestId']
1505
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1506
+ end
1507
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1508
+ raise e
1509
+ rescue StandardError => e
1510
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1511
+ end
1512
+
1513
+ # 本接口支持识别轮船票的发票代码、发票号码、日期、姓名、票价、始发地、目的地、姓名、时间、发票消费类型、省、市、币种字段。
1514
+
1515
+ # @param request: Request instance for ShipInvoiceOCR.
1516
+ # @type request: :class:`Tencentcloud::ocr::V20181119::ShipInvoiceOCRRequest`
1517
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::ShipInvoiceOCRResponse`
1518
+ def ShipInvoiceOCR(request)
1519
+ body = send_request('ShipInvoiceOCR', request.serialize)
1520
+ response = JSON.parse(body)
1521
+ if response['Response'].key?('Error') == false
1522
+ model = ShipInvoiceOCRResponse.new
1523
+ model.deserialize(response['Response'])
1524
+ model
1525
+ else
1526
+ code = response['Response']['Error']['Code']
1527
+ message = response['Response']['Error']['Message']
1528
+ reqid = response['Response']['RequestId']
1529
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1530
+ end
1531
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1532
+ raise e
1533
+ rescue StandardError => e
1534
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1535
+ end
1536
+
1537
+ # 本接口支持识别并提取各类证照、票据、表单、合同等结构化场景的字段信息。无需任何配置,灵活高效。适用于各类结构化信息录入场景。
1538
+
1539
+ # @param request: Request instance for SmartStructuralOCR.
1540
+ # @type request: :class:`Tencentcloud::ocr::V20181119::SmartStructuralOCRRequest`
1541
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::SmartStructuralOCRResponse`
1542
+ def SmartStructuralOCR(request)
1543
+ body = send_request('SmartStructuralOCR', request.serialize)
1544
+ response = JSON.parse(body)
1545
+ if response['Response'].key?('Error') == false
1546
+ model = SmartStructuralOCRResponse.new
1547
+ model.deserialize(response['Response'])
1548
+ model
1549
+ else
1550
+ code = response['Response']['Error']['Code']
1551
+ message = response['Response']['Error']['Message']
1552
+ reqid = response['Response']['RequestId']
1553
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1554
+ end
1555
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1556
+ raise e
1557
+ rescue StandardError => e
1558
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1559
+ end
1560
+
1561
+ # <b>此接口为表格识别的旧版本服务,不再进行服务升级,建议您使用识别能力更强、服务性能更优的<a href="https://cloud.tencent.com/document/product/866/49525">新版表格识别</a>。</b>
1562
+
1563
+ # 本接口支持图片内表格文档的检测和识别,返回每个单元格的文字内容,支持将识别结果保存为 Excel 格式。
1564
+
1565
+
1566
+ # @param request: Request instance for TableOCR.
1567
+ # @type request: :class:`Tencentcloud::ocr::V20181119::TableOCRRequest`
1568
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::TableOCRResponse`
1569
+ def TableOCR(request)
1570
+ body = send_request('TableOCR', request.serialize)
1571
+ response = JSON.parse(body)
1572
+ if response['Response'].key?('Error') == false
1573
+ model = TableOCRResponse.new
1574
+ model.deserialize(response['Response'])
1575
+ model
1576
+ else
1577
+ code = response['Response']['Error']['Code']
1578
+ message = response['Response']['Error']['Message']
1579
+ reqid = response['Response']['RequestId']
1580
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1581
+ end
1582
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1583
+ raise e
1584
+ rescue StandardError => e
1585
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1586
+ end
1587
+
1588
+ # 本接口支持出租车发票关键字段的识别,包括发票号码、发票代码、金额、日期、上下车时间、里程、车牌号、发票类型及所属地区等字段。
1589
+
1590
+ # @param request: Request instance for TaxiInvoiceOCR.
1591
+ # @type request: :class:`Tencentcloud::ocr::V20181119::TaxiInvoiceOCRRequest`
1592
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::TaxiInvoiceOCRResponse`
1593
+ def TaxiInvoiceOCR(request)
1594
+ body = send_request('TaxiInvoiceOCR', request.serialize)
1595
+ response = JSON.parse(body)
1596
+ if response['Response'].key?('Error') == false
1597
+ model = TaxiInvoiceOCRResponse.new
1598
+ model.deserialize(response['Response'])
1599
+ model
1600
+ else
1601
+ code = response['Response']['Error']['Code']
1602
+ message = response['Response']['Error']['Message']
1603
+ reqid = response['Response']['RequestId']
1604
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1605
+ end
1606
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1607
+ raise e
1608
+ rescue StandardError => e
1609
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1610
+ end
1611
+
1612
+ # 本接口通过检测图片中的文字信息特征,快速判断图片中有无文字并返回判断结果,帮助用户过滤无文字的图片。
1613
+
1614
+ # @param request: Request instance for TextDetect.
1615
+ # @type request: :class:`Tencentcloud::ocr::V20181119::TextDetectRequest`
1616
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::TextDetectResponse`
1617
+ def TextDetect(request)
1618
+ body = send_request('TextDetect', request.serialize)
1619
+ response = JSON.parse(body)
1620
+ if response['Response'].key?('Error') == false
1621
+ model = TextDetectResponse.new
1622
+ model.deserialize(response['Response'])
1623
+ model
1624
+ else
1625
+ code = response['Response']['Error']['Code']
1626
+ message = response['Response']['Error']['Message']
1627
+ reqid = response['Response']['RequestId']
1628
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1629
+ end
1630
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1631
+ raise e
1632
+ rescue StandardError => e
1633
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1634
+ end
1635
+
1636
+ # 本接口支持对过路过桥费发票的发票代码、发票号码、日期、小写金额等关键字段的识别。
1637
+
1638
+ # @param request: Request instance for TollInvoiceOCR.
1639
+ # @type request: :class:`Tencentcloud::ocr::V20181119::TollInvoiceOCRRequest`
1640
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::TollInvoiceOCRResponse`
1641
+ def TollInvoiceOCR(request)
1642
+ body = send_request('TollInvoiceOCR', request.serialize)
1643
+ response = JSON.parse(body)
1644
+ if response['Response'].key?('Error') == false
1645
+ model = TollInvoiceOCRResponse.new
1646
+ model.deserialize(response['Response'])
1647
+ model
1648
+ else
1649
+ code = response['Response']['Error']['Code']
1650
+ message = response['Response']['Error']['Message']
1651
+ reqid = response['Response']['RequestId']
1652
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1653
+ end
1654
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1655
+ raise e
1656
+ rescue StandardError => e
1657
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1658
+ end
1659
+
1660
+ # 本接口支持火车票全字段的识别,包括编号、票价、姓名、座位号、出发时间、出发站、到达站、车次、席别、发票类型及序列号等。
1661
+
1662
+ # @param request: Request instance for TrainTicketOCR.
1663
+ # @type request: :class:`Tencentcloud::ocr::V20181119::TrainTicketOCRRequest`
1664
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::TrainTicketOCRResponse`
1665
+ def TrainTicketOCR(request)
1666
+ body = send_request('TrainTicketOCR', request.serialize)
1667
+ response = JSON.parse(body)
1668
+ if response['Response'].key?('Error') == false
1669
+ model = TrainTicketOCRResponse.new
1670
+ model.deserialize(response['Response'])
1671
+ model
1672
+ else
1673
+ code = response['Response']['Error']['Code']
1674
+ message = response['Response']['Error']['Message']
1675
+ reqid = response['Response']['RequestId']
1676
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1677
+ end
1678
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1679
+ raise e
1680
+ rescue StandardError => e
1681
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1682
+ end
1683
+
1684
+ # 本接口支持增值税专用发票、增值税普通发票、增值税电子发票全字段的内容检测和识别,包括发票代码、发票号码、打印发票代码、打印发票号码、开票日期、合计金额、校验码、税率、合计税额、价税合计、购买方识别号、复核、销售方识别号、开票人、密码区1、密码区2、密码区3、密码区4、发票名称、购买方名称、销售方名称、服务名称、备注、规格型号、数量、单价、金额、税额、收款人等字段。
1685
+
1686
+ # @param request: Request instance for VatInvoiceOCR.
1687
+ # @type request: :class:`Tencentcloud::ocr::V20181119::VatInvoiceOCRRequest`
1688
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::VatInvoiceOCRResponse`
1689
+ def VatInvoiceOCR(request)
1690
+ body = send_request('VatInvoiceOCR', request.serialize)
1691
+ response = JSON.parse(body)
1692
+ if response['Response'].key?('Error') == false
1693
+ model = VatInvoiceOCRResponse.new
1694
+ model.deserialize(response['Response'])
1695
+ model
1696
+ else
1697
+ code = response['Response']['Error']['Code']
1698
+ message = response['Response']['Error']['Message']
1699
+ reqid = response['Response']['RequestId']
1700
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1701
+ end
1702
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1703
+ raise e
1704
+ rescue StandardError => e
1705
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1706
+ end
1707
+
1708
+ # 本接口支持增值税发票的准确性核验,您可以通过输入增值税发票的关键字段提供所需的验证信息,接口返回真实的票面相关信息,包括发票代码、发票号码、开票日期、金额、消费类型、购方名称、购方税号、销方名称、销方税号等多个常用字段。支持多种发票类型核验,包括增值税专用发票、增值税普通发票(含电子普通发票、卷式发票、通行费发票)、机动车销售统一发票、货物运输业增值税专用发票、二手车销售统一发票。
1709
+
1710
+ # @param request: Request instance for VatInvoiceVerify.
1711
+ # @type request: :class:`Tencentcloud::ocr::V20181119::VatInvoiceVerifyRequest`
1712
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::VatInvoiceVerifyResponse`
1713
+ def VatInvoiceVerify(request)
1714
+ body = send_request('VatInvoiceVerify', request.serialize)
1715
+ response = JSON.parse(body)
1716
+ if response['Response'].key?('Error') == false
1717
+ model = VatInvoiceVerifyResponse.new
1718
+ model.deserialize(response['Response'])
1719
+ model
1720
+ else
1721
+ code = response['Response']['Error']['Code']
1722
+ message = response['Response']['Error']['Message']
1723
+ reqid = response['Response']['RequestId']
1724
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1725
+ end
1726
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1727
+ raise e
1728
+ rescue StandardError => e
1729
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1730
+ end
1731
+
1732
+ # 本接口支持对增值税发票(卷票)的发票代码、发票号码、日期、校验码、合计金额(小写)等关键字段的识别。
1733
+
1734
+ # @param request: Request instance for VatRollInvoiceOCR.
1735
+ # @type request: :class:`Tencentcloud::ocr::V20181119::VatRollInvoiceOCRRequest`
1736
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::VatRollInvoiceOCRResponse`
1737
+ def VatRollInvoiceOCR(request)
1738
+ body = send_request('VatRollInvoiceOCR', request.serialize)
1739
+ response = JSON.parse(body)
1740
+ if response['Response'].key?('Error') == false
1741
+ model = VatRollInvoiceOCRResponse.new
1742
+ model.deserialize(response['Response'])
1743
+ model
1744
+ else
1745
+ code = response['Response']['Error']['Code']
1746
+ message = response['Response']['Error']['Message']
1747
+ reqid = response['Response']['RequestId']
1748
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1749
+ end
1750
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1751
+ raise e
1752
+ rescue StandardError => e
1753
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1754
+ end
1755
+
1756
+ # 本接口支持行驶证主页和副页所有字段的自动定位与识别。
1757
+
1758
+ # 行驶证主页:车牌号码、车辆类型、所有人、住址、使用性质、品牌型号、识别代码、发动机号、注册日期、发证日期、发证单位。
1759
+
1760
+ # 行驶证副页:号牌号码、档案编号、核定载人数、总质量、整备质量、核定载质量、外廓尺寸、准牵引总质量、备注、检验记录。
1761
+
1762
+ # 另外,本接口还支持复印件、翻拍和PS告警功能。
1763
+
1764
+ # @param request: Request instance for VehicleLicenseOCR.
1765
+ # @type request: :class:`Tencentcloud::ocr::V20181119::VehicleLicenseOCRRequest`
1766
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::VehicleLicenseOCRResponse`
1767
+ def VehicleLicenseOCR(request)
1768
+ body = send_request('VehicleLicenseOCR', request.serialize)
1769
+ response = JSON.parse(body)
1770
+ if response['Response'].key?('Error') == false
1771
+ model = VehicleLicenseOCRResponse.new
1772
+ model.deserialize(response['Response'])
1773
+ model
1774
+ else
1775
+ code = response['Response']['Error']['Code']
1776
+ message = response['Response']['Error']['Message']
1777
+ reqid = response['Response']['RequestId']
1778
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1779
+ end
1780
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1781
+ raise e
1782
+ rescue StandardError => e
1783
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1784
+ end
1785
+
1786
+ # 本接口支持国内机动车登记证书主要字段的结构化识别,包括机动车所有人、身份证明名称、号码、车辆型号、车辆识别代号、发动机号、制造厂名称等。
1787
+
1788
+ # @param request: Request instance for VehicleRegCertOCR.
1789
+ # @type request: :class:`Tencentcloud::ocr::V20181119::VehicleRegCertOCRRequest`
1790
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::VehicleRegCertOCRResponse`
1791
+ def VehicleRegCertOCR(request)
1792
+ body = send_request('VehicleRegCertOCR', request.serialize)
1793
+ response = JSON.parse(body)
1794
+ if response['Response'].key?('Error') == false
1795
+ model = VehicleRegCertOCRResponse.new
1796
+ model.deserialize(response['Response'])
1797
+ model
1798
+ else
1799
+ code = response['Response']['Error']['Code']
1800
+ message = response['Response']['Error']['Message']
1801
+ reqid = response['Response']['RequestId']
1802
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1803
+ end
1804
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1805
+ raise e
1806
+ rescue StandardError => e
1807
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1808
+ end
1809
+
1810
+ # 本接口支持营业执照信息的识别与准确性核验。
1811
+
1812
+ # 您可以通过输入营业执照注册号或营业执照图片(若两者都输入则只用注册号做查询)进行核验,接口返回查询到的工商照面信息,并比对要校验的字段与查询结果的一致性。查询到工商信息包括:统一社会信用代码、经营期限、法人姓名、经营状态、经营业务范围、注册资本等。
1813
+
1814
+ # @param request: Request instance for VerifyBasicBizLicense.
1815
+ # @type request: :class:`Tencentcloud::ocr::V20181119::VerifyBasicBizLicenseRequest`
1816
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::VerifyBasicBizLicenseResponse`
1817
+ def VerifyBasicBizLicense(request)
1818
+ body = send_request('VerifyBasicBizLicense', request.serialize)
1819
+ response = JSON.parse(body)
1820
+ if response['Response'].key?('Error') == false
1821
+ model = VerifyBasicBizLicenseResponse.new
1822
+ model.deserialize(response['Response'])
1823
+ model
1824
+ else
1825
+ code = response['Response']['Error']['Code']
1826
+ message = response['Response']['Error']['Message']
1827
+ reqid = response['Response']['RequestId']
1828
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1829
+ end
1830
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1831
+ raise e
1832
+ rescue StandardError => e
1833
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1834
+ end
1835
+
1836
+ # 本接口支持营业执照信息的识别与准确性核验,返回的真实工商照面信息比营业执照识别及核验(基础版)接口更详细。
1837
+
1838
+ # 您可以输入营业执照注册号或营业执照图片(若两者都输入则只用注册号做查询),接口返回查询到的工商照面信息,并比对要校验的字段与查询结果的一致性。
1839
+
1840
+ # 查询到工商信息包括:统一社会信用代码、组织机构代码、经营期限、法人姓名、经营状态、经营业务范围及方式、注册资金、注册币种、登记机关、开业日期、企业(机构)类型、注销日期、吊销日期、许可经营项目、一般经营项目、核准时间、省、地级市、区/县、住所所在行政区划代码、行业门类代码、行业门类名称、国民经济行业代码、国民经济行业名称、经营(业务)范围等。
1841
+
1842
+ # @param request: Request instance for VerifyBizLicense.
1843
+ # @type request: :class:`Tencentcloud::ocr::V20181119::VerifyBizLicenseRequest`
1844
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::VerifyBizLicenseResponse`
1845
+ def VerifyBizLicense(request)
1846
+ body = send_request('VerifyBizLicense', request.serialize)
1847
+ response = JSON.parse(body)
1848
+ if response['Response'].key?('Error') == false
1849
+ model = VerifyBizLicenseResponse.new
1850
+ model.deserialize(response['Response'])
1851
+ model
1852
+ else
1853
+ code = response['Response']['Error']['Code']
1854
+ message = response['Response']['Error']['Message']
1855
+ reqid = response['Response']['RequestId']
1856
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1857
+ end
1858
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1859
+ raise e
1860
+ rescue StandardError => e
1861
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1862
+ end
1863
+
1864
+ # 此接口基于企业四要素授权“姓名、证件号码、企业标识、企业全称”,验证企业信息是否一致。
1865
+
1866
+ # @param request: Request instance for VerifyEnterpriseFourFactors.
1867
+ # @type request: :class:`Tencentcloud::ocr::V20181119::VerifyEnterpriseFourFactorsRequest`
1868
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::VerifyEnterpriseFourFactorsResponse`
1869
+ def VerifyEnterpriseFourFactors(request)
1870
+ body = send_request('VerifyEnterpriseFourFactors', request.serialize)
1871
+ response = JSON.parse(body)
1872
+ if response['Response'].key?('Error') == false
1873
+ model = VerifyEnterpriseFourFactorsResponse.new
1874
+ model.deserialize(response['Response'])
1875
+ model
1876
+ else
1877
+ code = response['Response']['Error']['Code']
1878
+ message = response['Response']['Error']['Message']
1879
+ reqid = response['Response']['RequestId']
1880
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1881
+ end
1882
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1883
+ raise e
1884
+ rescue StandardError => e
1885
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1886
+ end
1887
+
1888
+ # 本接口支持OFD格式的增值税电子普通发票和增值税电子专用发票的识别,返回发票代码、发票号码、开票日期、验证码、机器编号、密码区,购买方和销售方信息,包括名称、纳税人识别号、地址电话、开户行及账号,以及价税合计、开票人、收款人、复核人、税额、不含税金额等字段信息。
1889
+
1890
+ # @param request: Request instance for VerifyOfdVatInvoiceOCR.
1891
+ # @type request: :class:`Tencentcloud::ocr::V20181119::VerifyOfdVatInvoiceOCRRequest`
1892
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::VerifyOfdVatInvoiceOCRResponse`
1893
+ def VerifyOfdVatInvoiceOCR(request)
1894
+ body = send_request('VerifyOfdVatInvoiceOCR', request.serialize)
1895
+ response = JSON.parse(body)
1896
+ if response['Response'].key?('Error') == false
1897
+ model = VerifyOfdVatInvoiceOCRResponse.new
1898
+ model.deserialize(response['Response'])
1899
+ model
1900
+ else
1901
+ code = response['Response']['Error']['Code']
1902
+ message = response['Response']['Error']['Message']
1903
+ reqid = response['Response']['RequestId']
1904
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1905
+ end
1906
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1907
+ raise e
1908
+ rescue StandardError => e
1909
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1910
+ end
1911
+
1912
+ # 本接口支持图片内车辆识别代号(VIN)的检测和识别。
1913
+
1914
+ # @param request: Request instance for VinOCR.
1915
+ # @type request: :class:`Tencentcloud::ocr::V20181119::VinOCRRequest`
1916
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::VinOCRResponse`
1917
+ def VinOCR(request)
1918
+ body = send_request('VinOCR', request.serialize)
1919
+ response = JSON.parse(body)
1920
+ if response['Response'].key?('Error') == false
1921
+ model = VinOCRResponse.new
1922
+ model.deserialize(response['Response'])
1923
+ model
1924
+ else
1925
+ code = response['Response']['Error']['Code']
1926
+ message = response['Response']['Error']['Message']
1927
+ reqid = response['Response']['RequestId']
1928
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1929
+ end
1930
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1931
+ raise e
1932
+ rescue StandardError => e
1933
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1934
+ end
1935
+
1936
+ # 本接口支持市面上主流版式电子运单的识别,包括收件人和寄件人的姓名、电话、地址以及运单号等字段。
1937
+
1938
+ # @param request: Request instance for WaybillOCR.
1939
+ # @type request: :class:`Tencentcloud::ocr::V20181119::WaybillOCRRequest`
1940
+ # @rtype: :class:`Tencentcloud::ocr::V20181119::WaybillOCRResponse`
1941
+ def WaybillOCR(request)
1942
+ body = send_request('WaybillOCR', request.serialize)
1943
+ response = JSON.parse(body)
1944
+ if response['Response'].key?('Error') == false
1945
+ model = WaybillOCRResponse.new
1946
+ model.deserialize(response['Response'])
1947
+ model
1948
+ else
1949
+ code = response['Response']['Error']['Code']
1950
+ message = response['Response']['Error']['Message']
1951
+ reqid = response['Response']['RequestId']
1952
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1953
+ end
1954
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1955
+ raise e
1956
+ rescue StandardError => e
1957
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1958
+ end
1959
+
1960
+
1961
+ end
1962
+ end
1963
+ end
1964
+ end