tencentcloud-sdk-nlp 1.0.274 → 1.0.277

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1453bf50634c4456f468720962411633ac30e05c
4
- data.tar.gz: b8670a5bc7e859bc9141899ac387976861a87b43
3
+ metadata.gz: 5f4b45498f9d8924d24ca928856e712d4dd7c015
4
+ data.tar.gz: 6764ae5134776707d6ce4f04a4ce957509e5719d
5
5
  SHA512:
6
- metadata.gz: d74b36bf3c2ccc3bb8bc99e16223db764e314ccf273c33386f6c8edf531f40df359076161093e518761a39ae254f7456c887980df13d050869aa12cd445f4aa4
7
- data.tar.gz: 7354ae41c41b937a33e3c092bed274f6c843c399bab8b650aeeee94bab670e86d3a7cdc731b58baae59722ca1a28e5215a5201915f55b6dfc01de82866b9dd0e
6
+ metadata.gz: 27e7aa333a161de223b2642a576756bb1019bb1c060b5edc1b95f04cdb97278aaf24cc2e65fe7581e0ffeac149e036b9ccc15de5a8c10dbb4a681b6dc1b20ff7
7
+ data.tar.gz: 9f1d6ad663d3d5c2894893e0fe8157089b4667da4aaac23928c8ed3a1445cf312f124243e63906108a28b3bb525c8d4f6007609fc2f7f144bafec80df254cfe7
data/lib/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.274
1
+ 1.0.277
@@ -584,6 +584,34 @@ module TencentCloud
584
584
  raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
585
585
  end
586
586
 
587
+ # 句子相似度接口能够基于深度学习技术来计算一个源句子和多个目标句子的相似度,相似度分值越大的两个句子在语义上越相似。目前仅支持短文本(不超过128字符)的相似度计算,长文本的相似度计算也即将推出。
588
+
589
+ # 鉴于句子相似度是一个应用非常广泛的功能,腾讯云自然语言处理团队在Bert等领先的深度神经网络模型的基础上,专门针对文本相似任务进行了优化,并持续迭代更新。基于句子相似度,可以轻松实现诸如文本去重、相似推荐等功能。
590
+
591
+ # 接口将以句子数量为单位消耗资源包,而不是调用接口次数为单位。
592
+
593
+ # @param request: Request instance for TextSimilarityPro.
594
+ # @type request: :class:`Tencentcloud::nlp::V20190408::TextSimilarityProRequest`
595
+ # @rtype: :class:`Tencentcloud::nlp::V20190408::TextSimilarityProResponse`
596
+ def TextSimilarityPro(request)
597
+ body = send_request('TextSimilarityPro', request.serialize)
598
+ response = JSON.parse(body)
599
+ if response['Response'].key?('Error') == false
600
+ model = TextSimilarityProResponse.new
601
+ model.deserialize(response['Response'])
602
+ model
603
+ else
604
+ code = response['Response']['Error']['Code']
605
+ message = response['Response']['Error']['Message']
606
+ reqid = response['Response']['RequestId']
607
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
608
+ end
609
+ rescue TencentCloud::Common::TencentCloudSDKException => e
610
+ raise e
611
+ rescue StandardError => e
612
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
613
+ end
614
+
587
615
  # 修改自定义词库元数据信息,包括名称、描述。
588
616
 
589
617
  # @param request: Request instance for UpdateDict.
@@ -1393,6 +1393,53 @@ module TencentCloud
1393
1393
  end
1394
1394
  end
1395
1395
 
1396
+ # TextSimilarityPro请求参数结构体
1397
+ class TextSimilarityProRequest < TencentCloud::Common::AbstractModel
1398
+ # @param SrcText: 需要与目标句子计算相似度的源句子(仅支持UTF-8格式,不超过128字符)
1399
+ # @type SrcText: String
1400
+ # @param TargetText: 目标句子(仅支持UTF-8格式,不超过128字符)
1401
+ # @type TargetText: Array
1402
+
1403
+ attr_accessor :SrcText, :TargetText
1404
+
1405
+ def initialize(srctext=nil, targettext=nil)
1406
+ @SrcText = srctext
1407
+ @TargetText = targettext
1408
+ end
1409
+
1410
+ def deserialize(params)
1411
+ @SrcText = params['SrcText']
1412
+ @TargetText = params['TargetText']
1413
+ end
1414
+ end
1415
+
1416
+ # TextSimilarityPro返回参数结构体
1417
+ class TextSimilarityProResponse < TencentCloud::Common::AbstractModel
1418
+ # @param Similarity: 每个目标句子与源句子的相似度分值,按照分值降序排列
1419
+ # @type Similarity: Array
1420
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
1421
+ # @type RequestId: String
1422
+
1423
+ attr_accessor :Similarity, :RequestId
1424
+
1425
+ def initialize(similarity=nil, requestid=nil)
1426
+ @Similarity = similarity
1427
+ @RequestId = requestid
1428
+ end
1429
+
1430
+ def deserialize(params)
1431
+ unless params['Similarity'].nil?
1432
+ @Similarity = []
1433
+ params['Similarity'].each do |i|
1434
+ similarity_tmp = Similarity.new
1435
+ similarity_tmp.deserialize(i)
1436
+ @Similarity << similarity_tmp
1437
+ end
1438
+ end
1439
+ @RequestId = params['RequestId']
1440
+ end
1441
+ end
1442
+
1396
1443
  # TextSimilarity请求参数结构体
1397
1444
  class TextSimilarityRequest < TencentCloud::Common::AbstractModel
1398
1445
  # @param SrcText: 需要与目标句子计算相似度的源句子(仅支持UTF-8格式,不超过500字符)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tencentcloud-sdk-nlp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.274
4
+ version: 1.0.277
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tencent Cloud
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-10 00:00:00.000000000 Z
11
+ date: 2022-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tencentcloud-sdk-common