tencentcloud-sdk-nlp 1.0.278 → 1.0.279
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/v20190408/client.rb +26 -0
- data/lib/v20190408/models.rb +48 -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: 63d76b94053c12861de8254cacdc2bb4e4d76887
|
4
|
+
data.tar.gz: cde4cfe16c324cf594d85109feb586b2dd886897
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6a7a84e1e918b29e54ce3905136e3e5de5dd4b25ce162de1b314b90b650834c6d1f3a9b05dfdb25cc80d9dbee15f7365275514aa040b6348969949b585f476b
|
7
|
+
data.tar.gz: 99dcfd7a0c863b03bb0185405ab4cc8f0ab24c6c01c77526c009de6313a06b285665dd2fab8f866f04dd485c87a4945a77f70b0302e38b968b119ab1d4b3db3c
|
data/lib/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.279
|
data/lib/v20190408/client.rb
CHANGED
@@ -556,6 +556,32 @@ module TencentCloud
|
|
556
556
|
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
557
557
|
end
|
558
558
|
|
559
|
+
# 提供对中文文本的自动纠错功能,能够识别输入文本中的错误片段,定位错误并给出正确的文本结果;支持长度不超过128字符(含标点符号)的长文本纠错。
|
560
|
+
|
561
|
+
# 此功能是基于千亿级大规模互联网语料和LSTM、BERT等深度神经网络模型进行训练,并持续迭代更新,以保证效果不断提升,是搜索引擎、语音识别、内容审核等功能更好运行的基础之一。
|
562
|
+
|
563
|
+
# @param request: Request instance for TextCorrectionPro.
|
564
|
+
# @type request: :class:`Tencentcloud::nlp::V20190408::TextCorrectionProRequest`
|
565
|
+
# @rtype: :class:`Tencentcloud::nlp::V20190408::TextCorrectionProResponse`
|
566
|
+
def TextCorrectionPro(request)
|
567
|
+
body = send_request('TextCorrectionPro', request.serialize)
|
568
|
+
response = JSON.parse(body)
|
569
|
+
if response['Response'].key?('Error') == false
|
570
|
+
model = TextCorrectionProResponse.new
|
571
|
+
model.deserialize(response['Response'])
|
572
|
+
model
|
573
|
+
else
|
574
|
+
code = response['Response']['Error']['Code']
|
575
|
+
message = response['Response']['Error']['Message']
|
576
|
+
reqid = response['Response']['RequestId']
|
577
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
578
|
+
end
|
579
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
580
|
+
raise e
|
581
|
+
rescue StandardError => e
|
582
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
583
|
+
end
|
584
|
+
|
559
585
|
# 句子相似度接口能够基于深度学习技术来计算一个源句子和多个目标句子的相似度,相似度分值越大的两个句子在语义上越相似。目前仅支持短文本(不超过500字符)的相似度计算,长文本的相似度计算也即将推出。
|
560
586
|
|
561
587
|
# 鉴于句子相似度是一个应用非常广泛的功能,腾讯云自然语言处理团队在Bert等领先的深度神经网络模型的基础上,专门针对文本相似任务进行了优化,并持续迭代更新。基于句子相似度,可以轻松实现诸如文本去重、相似推荐等功能。
|
data/lib/v20190408/models.rb
CHANGED
@@ -1345,6 +1345,54 @@ module TencentCloud
|
|
1345
1345
|
end
|
1346
1346
|
end
|
1347
1347
|
|
1348
|
+
# TextCorrectionPro请求参数结构体
|
1349
|
+
class TextCorrectionProRequest < TencentCloud::Common::AbstractModel
|
1350
|
+
# @param Text: 待纠错的文本(仅支持UTF-8格式,不超过128字符)
|
1351
|
+
# @type Text: String
|
1352
|
+
|
1353
|
+
attr_accessor :Text
|
1354
|
+
|
1355
|
+
def initialize(text=nil)
|
1356
|
+
@Text = text
|
1357
|
+
end
|
1358
|
+
|
1359
|
+
def deserialize(params)
|
1360
|
+
@Text = params['Text']
|
1361
|
+
end
|
1362
|
+
end
|
1363
|
+
|
1364
|
+
# TextCorrectionPro返回参数结构体
|
1365
|
+
class TextCorrectionProResponse < TencentCloud::Common::AbstractModel
|
1366
|
+
# @param CCITokens: 纠错详情
|
1367
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
1368
|
+
# @type CCITokens: Array
|
1369
|
+
# @param ResultText: 纠错后的文本
|
1370
|
+
# @type ResultText: String
|
1371
|
+
# @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
|
1372
|
+
# @type RequestId: String
|
1373
|
+
|
1374
|
+
attr_accessor :CCITokens, :ResultText, :RequestId
|
1375
|
+
|
1376
|
+
def initialize(ccitokens=nil, resulttext=nil, requestid=nil)
|
1377
|
+
@CCITokens = ccitokens
|
1378
|
+
@ResultText = resulttext
|
1379
|
+
@RequestId = requestid
|
1380
|
+
end
|
1381
|
+
|
1382
|
+
def deserialize(params)
|
1383
|
+
unless params['CCITokens'].nil?
|
1384
|
+
@CCITokens = []
|
1385
|
+
params['CCITokens'].each do |i|
|
1386
|
+
ccitoken_tmp = CCIToken.new
|
1387
|
+
ccitoken_tmp.deserialize(i)
|
1388
|
+
@CCITokens << ccitoken_tmp
|
1389
|
+
end
|
1390
|
+
end
|
1391
|
+
@ResultText = params['ResultText']
|
1392
|
+
@RequestId = params['RequestId']
|
1393
|
+
end
|
1394
|
+
end
|
1395
|
+
|
1348
1396
|
# TextCorrection请求参数结构体
|
1349
1397
|
class TextCorrectionRequest < TencentCloud::Common::AbstractModel
|
1350
1398
|
# @param Text: 待纠错的文本(仅支持UTF-8格式,不超过2000字符)
|
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.
|
4
|
+
version: 1.0.279
|
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-
|
11
|
+
date: 2022-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tencentcloud-sdk-common
|