tencentcloud-sdk-ocr 3.0.791 → 3.0.792
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/VERSION +1 -1
- data/lib/v20181119/client.rb +24 -0
- data/lib/v20181119/models.rb +213 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fde01fbb012c7545d3c136874e3b0eaeb0c0df23
|
4
|
+
data.tar.gz: a1b585b55bb81237e361d46bc91ca1a99497bf5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30a875dd2193b6ec3c1e5163062845029943588b79565f9ba434bcec10b0334650ffc08884d9af4a687567ac4d2bb91d88ada8b7fa2aca8eee365d4a7a0f4e93
|
7
|
+
data.tar.gz: 5dcb4ace437d38a118569de98017909cc2f0f6b2f3d1e81a18f5d949c5b6811cab79137a6629fb2896cb7d1113ce92cfd9ebc629859a684152ef5f6abde8fc31
|
data/lib/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.
|
1
|
+
3.0.792
|
data/lib/v20181119/client.rb
CHANGED
@@ -2062,6 +2062,30 @@ module TencentCloud
|
|
2062
2062
|
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
2063
2063
|
end
|
2064
2064
|
|
2065
|
+
# 支持将图片或PDF文件转换成Markdown格式文件,可解析包括表格、公式、图片、标题、段落、页眉、页脚等内容元素,并将内容智能转换成阅读顺序。
|
2066
|
+
|
2067
|
+
# @param request: Request instance for ReconstructDocument.
|
2068
|
+
# @type request: :class:`Tencentcloud::ocr::V20181119::ReconstructDocumentRequest`
|
2069
|
+
# @rtype: :class:`Tencentcloud::ocr::V20181119::ReconstructDocumentResponse`
|
2070
|
+
def ReconstructDocument(request)
|
2071
|
+
body = send_request('ReconstructDocument', request.serialize)
|
2072
|
+
response = JSON.parse(body)
|
2073
|
+
if response['Response'].key?('Error') == false
|
2074
|
+
model = ReconstructDocumentResponse.new
|
2075
|
+
model.deserialize(response['Response'])
|
2076
|
+
model
|
2077
|
+
else
|
2078
|
+
code = response['Response']['Error']['Code']
|
2079
|
+
message = response['Response']['Error']['Message']
|
2080
|
+
reqid = response['Response']['RequestId']
|
2081
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
2082
|
+
end
|
2083
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
2084
|
+
raise e
|
2085
|
+
rescue StandardError => e
|
2086
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
2087
|
+
end
|
2088
|
+
|
2065
2089
|
# 本接口支持居民户口簿户主页及成员页关键字段的识别,包括姓名、户别、地址、籍贯、身份证号码等。
|
2066
2090
|
|
2067
2091
|
# 默认接口请求频率限制:5次/秒。
|
data/lib/v20181119/models.rb
CHANGED
@@ -1453,6 +1453,125 @@ module TencentCloud
|
|
1453
1453
|
end
|
1454
1454
|
end
|
1455
1455
|
|
1456
|
+
# 文档元素字段
|
1457
|
+
class DocumentElement < TencentCloud::Common::AbstractModel
|
1458
|
+
# @param Index: 文档元素索引
|
1459
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
1460
|
+
# @type Index: Integer
|
1461
|
+
# @param Type: 元素类型,包括paragraph、table、formula、figure、title、header、footer、figure_text
|
1462
|
+
|
1463
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
1464
|
+
# @type Type: String
|
1465
|
+
# @param Text: 元素内容,当type为figure或formula(公式识别关闭)时该字段内容为图片的位置
|
1466
|
+
|
1467
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
1468
|
+
# @type Text: String
|
1469
|
+
# @param Polygon: 元素坐标,左上角(x1, y1),右上角(x2, y2),右下角(x3, y3),左下角(x4, y4)
|
1470
|
+
|
1471
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
1472
|
+
# @type Polygon: :class:`Tencentcloud::Ocr.v20181119.models.Polygon`
|
1473
|
+
# @param Level: 元素层级
|
1474
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
1475
|
+
# @type Level: Integer
|
1476
|
+
# @param Elements: 嵌套的文档元素信息,一般包含的是文档内嵌入图片的文字识别结果
|
1477
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
1478
|
+
# @type Elements: Array
|
1479
|
+
|
1480
|
+
attr_accessor :Index, :Type, :Text, :Polygon, :Level, :Elements
|
1481
|
+
|
1482
|
+
def initialize(index=nil, type=nil, text=nil, polygon=nil, level=nil, elements=nil)
|
1483
|
+
@Index = index
|
1484
|
+
@Type = type
|
1485
|
+
@Text = text
|
1486
|
+
@Polygon = polygon
|
1487
|
+
@Level = level
|
1488
|
+
@Elements = elements
|
1489
|
+
end
|
1490
|
+
|
1491
|
+
def deserialize(params)
|
1492
|
+
@Index = params['Index']
|
1493
|
+
@Type = params['Type']
|
1494
|
+
@Text = params['Text']
|
1495
|
+
unless params['Polygon'].nil?
|
1496
|
+
@Polygon = Polygon.new
|
1497
|
+
@Polygon.deserialize(params['Polygon'])
|
1498
|
+
end
|
1499
|
+
@Level = params['Level']
|
1500
|
+
unless params['Elements'].nil?
|
1501
|
+
@Elements = []
|
1502
|
+
params['Elements'].each do |i|
|
1503
|
+
documentelement_tmp = DocumentElement.new
|
1504
|
+
documentelement_tmp.deserialize(i)
|
1505
|
+
@Elements << documentelement_tmp
|
1506
|
+
end
|
1507
|
+
end
|
1508
|
+
end
|
1509
|
+
end
|
1510
|
+
|
1511
|
+
# 单页文档识别的内容
|
1512
|
+
class DocumentRecognizeInfo < TencentCloud::Common::AbstractModel
|
1513
|
+
# @param PageNumber: 输入PDF文件的页码,从1开始。输入图片的话值始终为1
|
1514
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
1515
|
+
# @type PageNumber: Integer
|
1516
|
+
# @param Angle: 旋转角度
|
1517
|
+
|
1518
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
1519
|
+
# @type Angle: Integer
|
1520
|
+
# @param Height: AI算法识别处理后的图片高度
|
1521
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
1522
|
+
# @type Height: Integer
|
1523
|
+
# @param Width: AI算法识别处理后的图片宽度
|
1524
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
1525
|
+
# @type Width: Integer
|
1526
|
+
# @param OriginHeight: 图片的原始高度,输入PDF文件则表示单页PDF转图片之后的图片高度
|
1527
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
1528
|
+
# @type OriginHeight: Integer
|
1529
|
+
# @param OriginWidth: 图片的原始宽度,输入PDF文件则表示单页PDF转图片之后的图片宽度
|
1530
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
1531
|
+
# @type OriginWidth: Integer
|
1532
|
+
# @param Elements: 文档元素信息
|
1533
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
1534
|
+
# @type Elements: Array
|
1535
|
+
# @param RotatedAngle: 旋转角度
|
1536
|
+
|
1537
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
1538
|
+
# @type RotatedAngle: Float
|
1539
|
+
|
1540
|
+
attr_accessor :PageNumber, :Angle, :Height, :Width, :OriginHeight, :OriginWidth, :Elements, :RotatedAngle
|
1541
|
+
extend Gem::Deprecate
|
1542
|
+
deprecate :Angle, :none, 2024, 3
|
1543
|
+
deprecate :Angle=, :none, 2024, 3
|
1544
|
+
|
1545
|
+
def initialize(pagenumber=nil, angle=nil, height=nil, width=nil, originheight=nil, originwidth=nil, elements=nil, rotatedangle=nil)
|
1546
|
+
@PageNumber = pagenumber
|
1547
|
+
@Angle = angle
|
1548
|
+
@Height = height
|
1549
|
+
@Width = width
|
1550
|
+
@OriginHeight = originheight
|
1551
|
+
@OriginWidth = originwidth
|
1552
|
+
@Elements = elements
|
1553
|
+
@RotatedAngle = rotatedangle
|
1554
|
+
end
|
1555
|
+
|
1556
|
+
def deserialize(params)
|
1557
|
+
@PageNumber = params['PageNumber']
|
1558
|
+
@Angle = params['Angle']
|
1559
|
+
@Height = params['Height']
|
1560
|
+
@Width = params['Width']
|
1561
|
+
@OriginHeight = params['OriginHeight']
|
1562
|
+
@OriginWidth = params['OriginWidth']
|
1563
|
+
unless params['Elements'].nil?
|
1564
|
+
@Elements = []
|
1565
|
+
params['Elements'].each do |i|
|
1566
|
+
documentelement_tmp = DocumentElement.new
|
1567
|
+
documentelement_tmp.deserialize(i)
|
1568
|
+
@Elements << documentelement_tmp
|
1569
|
+
end
|
1570
|
+
end
|
1571
|
+
@RotatedAngle = params['RotatedAngle']
|
1572
|
+
end
|
1573
|
+
end
|
1574
|
+
|
1456
1575
|
# DriverLicenseOCR请求参数结构体
|
1457
1576
|
class DriverLicenseOCRRequest < TencentCloud::Common::AbstractModel
|
1458
1577
|
# @param ImageBase64: 图片的 Base64 值。要求图片经Base64编码后不超过 7M,分辨率建议500*800以上,支持PNG、JPG、JPEG、BMP格式。建议卡片部分占据图片2/3以上。
|
@@ -8270,6 +8389,100 @@ module TencentCloud
|
|
8270
8389
|
end
|
8271
8390
|
end
|
8272
8391
|
|
8392
|
+
# ReconstructDocument配置选项
|
8393
|
+
class ReconstructDocumentConfig < TencentCloud::Common::AbstractModel
|
8394
|
+
# @param EnableInsetImage: 生成的Markdown中是否嵌入图片
|
8395
|
+
# @type EnableInsetImage: Boolean
|
8396
|
+
|
8397
|
+
attr_accessor :EnableInsetImage
|
8398
|
+
|
8399
|
+
def initialize(enableinsetimage=nil)
|
8400
|
+
@EnableInsetImage = enableinsetimage
|
8401
|
+
end
|
8402
|
+
|
8403
|
+
def deserialize(params)
|
8404
|
+
@EnableInsetImage = params['EnableInsetImage']
|
8405
|
+
end
|
8406
|
+
end
|
8407
|
+
|
8408
|
+
# ReconstructDocument请求参数结构体
|
8409
|
+
class ReconstructDocumentRequest < TencentCloud::Common::AbstractModel
|
8410
|
+
# @param FileType: PDF,Image
|
8411
|
+
# @type FileType: String
|
8412
|
+
# @param FileBase64: 图片的 Base64 值。 支持的图片格式:PNG、JPG、JPEG、PDF,暂不支持 GIF 格式。 支持的图片大小:所下载图片经Base64编码后不超过 8M。图片下载时间不超过 3 秒。 支持的图片像素:单边介于20-10000px之间。 图片的 ImageUrl、ImageBase64 必须提供一个,如果都提供,只使用 ImageUrl。
|
8413
|
+
# @type FileBase64: String
|
8414
|
+
# @param FileUrl: 图片的 Url 地址。 支持的图片格式:PNG、JPG、JPEG、PDF,暂不支持 GIF 格式。 支持的图片大小:所下载图片经 Base64 编码后不超过 8M。图片下载时间不超过 3 秒。 支持的图片像素:单边介于20-10000px之间。 图片存储于腾讯云的 Url 可保障更高的下载速度和稳定性,建议图片存储于腾讯云。 非腾讯云存储的 Url 速度和稳定性可能受一定影响。
|
8415
|
+
# @type FileUrl: String
|
8416
|
+
# @param FileStartPageNumber: 当传入文件是PDF类型(IsPdf=true)时,用来指定pdf识别的起始页码,识别的页码包含当前值。
|
8417
|
+
# @type FileStartPageNumber: Integer
|
8418
|
+
# @param FileEndPageNumber: 当传入文件是PDF类型(IsPdf=true)时,用来指定pdf识别的结束页码,识别的页码包含当前值。
|
8419
|
+
# 单次调用,最多支持10页pdf的智能识别。
|
8420
|
+
# @type FileEndPageNumber: Integer
|
8421
|
+
# @param Config: 配置选项,支持配置是否在生成的Markdown中是否嵌入图片
|
8422
|
+
# @type Config: :class:`Tencentcloud::Ocr.v20181119.models.ReconstructDocumentConfig`
|
8423
|
+
|
8424
|
+
attr_accessor :FileType, :FileBase64, :FileUrl, :FileStartPageNumber, :FileEndPageNumber, :Config
|
8425
|
+
|
8426
|
+
def initialize(filetype=nil, filebase64=nil, fileurl=nil, filestartpagenumber=nil, fileendpagenumber=nil, config=nil)
|
8427
|
+
@FileType = filetype
|
8428
|
+
@FileBase64 = filebase64
|
8429
|
+
@FileUrl = fileurl
|
8430
|
+
@FileStartPageNumber = filestartpagenumber
|
8431
|
+
@FileEndPageNumber = fileendpagenumber
|
8432
|
+
@Config = config
|
8433
|
+
end
|
8434
|
+
|
8435
|
+
def deserialize(params)
|
8436
|
+
@FileType = params['FileType']
|
8437
|
+
@FileBase64 = params['FileBase64']
|
8438
|
+
@FileUrl = params['FileUrl']
|
8439
|
+
@FileStartPageNumber = params['FileStartPageNumber']
|
8440
|
+
@FileEndPageNumber = params['FileEndPageNumber']
|
8441
|
+
unless params['Config'].nil?
|
8442
|
+
@Config = ReconstructDocumentConfig.new
|
8443
|
+
@Config.deserialize(params['Config'])
|
8444
|
+
end
|
8445
|
+
end
|
8446
|
+
end
|
8447
|
+
|
8448
|
+
# ReconstructDocument返回参数结构体
|
8449
|
+
class ReconstructDocumentResponse < TencentCloud::Common::AbstractModel
|
8450
|
+
# @param MarkdownBase64: 识别生成的Markdown文件base64编码的字符串
|
8451
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
8452
|
+
# @type MarkdownBase64: String
|
8453
|
+
# @param InsetImagePackage: 输入文件中嵌入的图片放在一个文件夹中打包为.zip压缩文件,识别生成的Markdown文件通过路径关联插入本文件夹中的图片。
|
8454
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
8455
|
+
# @type InsetImagePackage: String
|
8456
|
+
# @param DocumentRecognizeInfo: 输入文件中嵌入的图片中文字内容的识别结果
|
8457
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
8458
|
+
# @type DocumentRecognizeInfo: Array
|
8459
|
+
# @param RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
|
8460
|
+
# @type RequestId: String
|
8461
|
+
|
8462
|
+
attr_accessor :MarkdownBase64, :InsetImagePackage, :DocumentRecognizeInfo, :RequestId
|
8463
|
+
|
8464
|
+
def initialize(markdownbase64=nil, insetimagepackage=nil, documentrecognizeinfo=nil, requestid=nil)
|
8465
|
+
@MarkdownBase64 = markdownbase64
|
8466
|
+
@InsetImagePackage = insetimagepackage
|
8467
|
+
@DocumentRecognizeInfo = documentrecognizeinfo
|
8468
|
+
@RequestId = requestid
|
8469
|
+
end
|
8470
|
+
|
8471
|
+
def deserialize(params)
|
8472
|
+
@MarkdownBase64 = params['MarkdownBase64']
|
8473
|
+
@InsetImagePackage = params['InsetImagePackage']
|
8474
|
+
unless params['DocumentRecognizeInfo'].nil?
|
8475
|
+
@DocumentRecognizeInfo = []
|
8476
|
+
params['DocumentRecognizeInfo'].each do |i|
|
8477
|
+
documentrecognizeinfo_tmp = DocumentRecognizeInfo.new
|
8478
|
+
documentrecognizeinfo_tmp.deserialize(i)
|
8479
|
+
@DocumentRecognizeInfo << documentrecognizeinfo_tmp
|
8480
|
+
end
|
8481
|
+
end
|
8482
|
+
@RequestId = params['RequestId']
|
8483
|
+
end
|
8484
|
+
end
|
8485
|
+
|
8273
8486
|
# 矩形坐标
|
8274
8487
|
class Rect < TencentCloud::Common::AbstractModel
|
8275
8488
|
# @param X: 左上角x
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tencentcloud-sdk-ocr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.792
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tencent Cloud
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tencentcloud-sdk-common
|