tencentcloud-sdk-ruby 0.3.4 → 0.3.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f169c93d2c71967f4fef2b1278c60887acbc4228dd015af3abc8d7eca0cde3b7
4
- data.tar.gz: 21122698511bbc18f6161b818a216f9194f43e0680825f8e40bd4967eead2ed3
3
+ metadata.gz: 47dcff18eb491fc54a7245fbde3797859ec7b83011c861000a647694a77a6896
4
+ data.tar.gz: 7f7fa4e1f522f04e7adae9dcd4910f65bf7efd04632e921a8bdc83c816f0aa52
5
5
  SHA512:
6
- metadata.gz: 2a6452e0c87da7069004458a69a1ba55490d6338c175e472bdc3c0c2e54bcc74b3ddb4e0ecd29de035ff48120f64b1709f00f762abdad9eb3d4d09a8a70b7ff1
7
- data.tar.gz: b5523fe9a6cacf1d1740ab5379e1a8d37f1d937a924df3e8c92da156c8280dd71ea3aef51bf78d47faecf3bb957640578d02c79272499f1a5f2b7650d7d9bfef
6
+ metadata.gz: 56adc3b2428d5108b27c1edc9ddae500dc0ee0ba92eda22c93bf68184c77b96559ff38b8c7cfb7939e6651f2e15c6b24d3c3513ff6ef62455e058777c37e3353
7
+ data.tar.gz: 6eb392b2e55868edb8d500672ea4dd7a82715ef5c32a6a9cbf563427a45654770060feb11d6cee7e17bcd25c6217dd74779577c64d96746af0ec2703d086afef
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tencentcloud-sdk-ruby (0.3.4)
4
+ tencentcloud-sdk-ruby (0.3.5)
5
5
  typhoeus (~> 1.0)
6
6
 
7
7
  GEM
@@ -11,7 +11,7 @@ GEM
11
11
  diff-lcs (1.3)
12
12
  ethon (0.14.0)
13
13
  ffi (>= 1.15.0)
14
- ffi (1.15.3)
14
+ ffi (1.15.4)
15
15
  method_source (1.0.0)
16
16
  pry (0.13.1)
17
17
  coderay (~> 1.1)
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/setup'
4
+ require 'tencent_cloud'
5
+ require 'tencent_cloud/nlp/v20190408/nlp_client'
6
+ # replace secret_id secret_key
7
+ secret_id = ENV['TENCENT_SECRET_ID']
8
+ secret_key = ENV['TENCENT_SECRET_KEY']
9
+ credential = TencentCloud::Common::Credential.new(secret_id, secret_key)
10
+ payload = {
11
+ 'Text' => '阿森纳俱乐部的成立则晚于热刺4年。它最早成立的地方并不是伦敦北部,而是伦敦东南部的戴尔广场的皇家兵工厂地带。它最早的名字叫做皇家阿森纳队。
12
+ 1891年,这支球队才完成了职业化改革,成为了职业俱乐部,球队名称更名为:“伍尔维奇阿森纳”(Woolwich Arsenal)。加入乙级联赛(当时英格兰最高赛事是英甲)。
13
+ 阿森纳和热刺的矛盾是在1913年的那次搬迁。1910年,亨利-诺里斯爵士成为了伍尔维奇-阿森纳的最大股东,而这个诺里斯爵士在当时还有个身份——富勒姆主席。',
14
+ 'Flag' => 2
15
+ }
16
+ resp = TencentCloud::NlpClient.new(credential, 'ap-guangzhou').lexical_analysis(payload)
17
+ pp JSON.parse(resp.body)
@@ -4,8 +4,8 @@ require 'bundler/setup'
4
4
  require 'tencent_cloud'
5
5
  require 'tencent_cloud/ocr/v20181119/ocr_client'
6
6
  # replace secret_id secret_key
7
- secret_id = 'SECRET_ID'
8
- secret_key = 'SECRET_KEY'
7
+ secret_id = ENV['TENCENT_SECRET_ID']
8
+ secret_key = ENV['TENCENT_SECRET_KEY']
9
9
  credential = TencentCloud::Common::Credential.new(secret_id, secret_key)
10
10
  payload = {
11
11
  'ImageUrl' => 'IMAGE URL'
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/setup'
4
+ require 'tencent_cloud'
5
+ require 'tencent_cloud/ocr/v20181119/ocr_client'
6
+ # replace secret_id secret_key
7
+ secret_id = ENV['TENCENT_SECRET_ID']
8
+ secret_key = ENV['TENCENT_SECRET_KEY']
9
+ credential = TencentCloud::Common::Credential.new(secret_id, secret_key)
10
+ payload = {
11
+ 'ImageUrl' => '',
12
+ 'IsPdf' => true
13
+ }
14
+ resp = TencentCloud::OcrClient.new(credential, 'ap-beijing').recognize_table_ocr(payload)
15
+ pp JSON.parse(resp.body)
@@ -5,8 +5,8 @@ require 'tencent_cloud'
5
5
  require 'tencent_cloud/tms/v20200713/tms_client'
6
6
  require 'base64'
7
7
  # replace secret_id secret_key
8
- secret_id = 'SECRET_ID'
9
- secret_key = 'SECRET_KEY'
8
+ secret_id = ENV['TENCENT_SECRET_ID']
9
+ secret_key = ENV['TENCENT_SECRET_KEY']
10
10
  credential = TencentCloud::Common::Credential.new(secret_id, secret_key)
11
11
  str = Base64.encode64('
12
12
  北京时间12月16日,在马刺对阵火箭的比赛中,马刺遗憾输掉比赛。不过马刺也不是没有惊喜,他们的首轮秀瓦塞尔继续有精彩表现,全场打了31分钟,拿到了11分4板4抢断,8投4中的命中率。虽然球队输球,但是瓦塞尔的表现不错,不仅进攻端表现出色,面对哈登也不胆怯,哈登全场10投3中,被成功防死,瓦塞尔功不可没。
@@ -4,8 +4,8 @@ require 'bundler/setup'
4
4
  require 'tencent_cloud'
5
5
  require 'tencent_cloud/trtc/v20190722/trtc_client'
6
6
  # replace secret_id secret_key
7
- secret_id = 'SECRET_ID'
8
- secret_key = 'SECRET_KEY'
7
+ secret_id = ENV['TENCENT_SECRET_ID']
8
+ secret_key = ENV['TENCENT_SECRET_KEY']
9
9
  credential = TencentCloud::Common::Credential.new(secret_id, secret_key)
10
10
  payload = {
11
11
  'SdkAppId' => 'SDKAPPID',
@@ -4,8 +4,8 @@ require 'bundler/setup'
4
4
  require 'tencent_cloud'
5
5
  require 'tencent_cloud/trtc/v20190722/trtc_client'
6
6
  # replace secret_id secret_key
7
- secret_id = 'SECRET_ID'
8
- secret_key = 'SECRET_KEY'
7
+ secret_id = ENV['TENCENT_SECRET_ID']
8
+ secret_key = ENV['TENCENT_SECRET_KEY']
9
9
  credential = TencentCloud::Common::Credential.new(secret_id, secret_key)
10
10
 
11
11
  payload = {
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'tencent_cloud/common/base_client'
4
+ module TencentCloud
5
+ class NlpClient < Common::BaseClient
6
+ API_VERSION = '2019-04-08'
7
+ ENDPOINT = 'nlp.tencentcloudapi.com'
8
+ SERVICE_NAME = 'nlp'
9
+ APIS = {
10
+ #################### 自然语言处理 > 词法分析相关接口
11
+ # 词法分析
12
+ # https://cloud.tencent.com/document/api/271/35494
13
+ lexical_analysis: 'LexicalAnalysis',
14
+
15
+ # 相似词
16
+ # https://cloud.tencent.com/document/api/271/35493
17
+ similar_words: 'SimilarWords',
18
+
19
+ #################### 自然语言处理 > 篇章分析相关接口
20
+ # 自动摘要
21
+ # https://cloud.tencent.com/document/api/271/35499
22
+ auto_summarization: 'AutoSummarization',
23
+
24
+ # 情感分析
25
+ # https://cloud.tencent.com/document/api/271/35497
26
+ sentiment_analysis: 'SentimentAnalysis',
27
+
28
+ # 关键词提取
29
+ # https://cloud.tencent.com/document/api/271/35498
30
+ keywords_extraction: 'KeywordsExtraction',
31
+
32
+ # 文本分类
33
+ # https://cloud.tencent.com/document/api/271/35496
34
+ text_classification: 'TextClassification'
35
+ }.freeze
36
+ end
37
+ end
@@ -121,6 +121,11 @@ module TencentCloud
121
121
  ## 金融票据整单识别
122
122
  ## https://cloud.tencent.com/document/api/866/38296
123
123
  finan_bill_ocr: 'FinanBillOCR',
124
+
125
+ #################### 行业文档识别相关接口
126
+ ## 表格识别(V2)
127
+ ## https://cloud.tencent.com/document/product/866/49525
128
+ recognize_table_ocr: 'RecognizeTableOCR'
124
129
  }.freeze
125
130
  end
126
131
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TencentCloud
4
- VERSION = '0.3.4'
4
+ VERSION = '0.3.5'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tencentcloud-sdk-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - FengCe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-17 00:00:00.000000000 Z
11
+ date: 2021-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -99,7 +99,9 @@ files:
99
99
  - Rakefile
100
100
  - bin/console
101
101
  - bin/setup
102
+ - examples/nlp/v20190408/lexical_analysis.rb
102
103
  - examples/ocr/v20181119/bussiness_card.rb
104
+ - examples/ocr/v20181119/recognize_table_ocr.rb
103
105
  - examples/tms/v20190722/text_moderation.rb
104
106
  - examples/trtc/v20190722/describe_room_information.rb
105
107
  - examples/trtc/v20190722/start_mcu_mix_transcode.rb
@@ -109,6 +111,7 @@ files:
109
111
  - lib/tencent_cloud/common/exception/tencent_cloud_sdk_exception.rb
110
112
  - lib/tencent_cloud/common/http/request.rb
111
113
  - lib/tencent_cloud/common/http/sign.rb
114
+ - lib/tencent_cloud/nlp/v20190408/nlp_client.rb
112
115
  - lib/tencent_cloud/ocr/v20181119/ocr_client.rb
113
116
  - lib/tencent_cloud/tms/v20200713/tms_client.rb
114
117
  - lib/tencent_cloud/tpns/v20210422/tpns_client.rb