tencentcloud-sdk-nlp 3.0.559 → 3.0.561

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
  SHA1:
3
- metadata.gz: 2735c8a8fc4cc2b12a286a40a765304b709ae978
4
- data.tar.gz: 464753a5ed65316e42ea2ce5684d172a58b12827
3
+ metadata.gz: a6a7a0240623660baf7a55d0c74ae3133564de3c
4
+ data.tar.gz: 1bd7cd1455763545dcaf338b1686177ebc0aa0a5
5
5
  SHA512:
6
- metadata.gz: 50ebb2cbbf47be88fa01a40eea18fb242293e697051059c413fcd267048980b477355b666e9560c0475f218d28f286c558abe31917f6bf3df59e566cf9055d0c
7
- data.tar.gz: e199a35f8f799c0fbae0e394ca53d0ec26891baf4606f85836cc2f68252e07b09963fd84969f4640f6fc4ed50dd3e15e394bcc707d3e3555fca73963b0b34525
6
+ metadata.gz: 386dfbeda665c80235f9160e17b23a555d2117c525a363e1f55a4c7fe55db2fe74d52fc90d8c5307722201be4da4fe31182c5a006470e8b06b7e7ba52543ca2f
7
+ data.tar.gz: e49444462310d2b18846a194e4678fb4c63666e3abe6f0f0cf820058ad5fa9bbb413e9a88c01e5a8cffcb5868c0ee15c839d53b52c78b99c907cea2e7d03fa5e
data/lib/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.559
1
+ 3.0.561
@@ -270,6 +270,54 @@ module TencentCloud
270
270
  raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
271
271
  end
272
272
 
273
+ # 通过计算句子间的语义相似性,帮助您快速找到文本中重复或相似的句子,用于文本聚类、相似问题检索等应用场景。
274
+
275
+ # @param request: Request instance for EvaluateSentenceSimilarity.
276
+ # @type request: :class:`Tencentcloud::nlp::V20190408::EvaluateSentenceSimilarityRequest`
277
+ # @rtype: :class:`Tencentcloud::nlp::V20190408::EvaluateSentenceSimilarityResponse`
278
+ def EvaluateSentenceSimilarity(request)
279
+ body = send_request('EvaluateSentenceSimilarity', request.serialize)
280
+ response = JSON.parse(body)
281
+ if response['Response'].key?('Error') == false
282
+ model = EvaluateSentenceSimilarityResponse.new
283
+ model.deserialize(response['Response'])
284
+ model
285
+ else
286
+ code = response['Response']['Error']['Code']
287
+ message = response['Response']['Error']['Message']
288
+ reqid = response['Response']['RequestId']
289
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
290
+ end
291
+ rescue TencentCloud::Common::TencentCloudSDKException => e
292
+ raise e
293
+ rescue StandardError => e
294
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
295
+ end
296
+
297
+ # 评估两个词语在语义空间的相似程度,为您的场景应用提供有力支持,如关键词过滤、热门话题挖掘等。(目前仅支持中文)
298
+
299
+ # @param request: Request instance for EvaluateWordSimilarity.
300
+ # @type request: :class:`Tencentcloud::nlp::V20190408::EvaluateWordSimilarityRequest`
301
+ # @rtype: :class:`Tencentcloud::nlp::V20190408::EvaluateWordSimilarityResponse`
302
+ def EvaluateWordSimilarity(request)
303
+ body = send_request('EvaluateWordSimilarity', request.serialize)
304
+ response = JSON.parse(body)
305
+ if response['Response'].key?('Error') == false
306
+ model = EvaluateWordSimilarityResponse.new
307
+ model.deserialize(response['Response'])
308
+ model
309
+ else
310
+ code = response['Response']['Error']['Code']
311
+ message = response['Response']['Error']['Message']
312
+ reqid = response['Response']['RequestId']
313
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
314
+ end
315
+ rescue TencentCloud::Common::TencentCloudSDKException => e
316
+ raise e
317
+ rescue StandardError => e
318
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
319
+ end
320
+
273
321
  # 根据用户输入的命题关键词自动生成一副春联,包括上联、下联和横批。(如需开通请联系商务)
274
322
 
275
323
  # @param request: Request instance for GenerateCouplet.
@@ -294,6 +342,30 @@ module TencentCloud
294
342
  raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
295
343
  end
296
344
 
345
+ # 提取文本中的关键信息,生成简洁明了的关键句子,便于用户快速获取核心观点。
346
+
347
+ # @param request: Request instance for GenerateKeywordSentence.
348
+ # @type request: :class:`Tencentcloud::nlp::V20190408::GenerateKeywordSentenceRequest`
349
+ # @rtype: :class:`Tencentcloud::nlp::V20190408::GenerateKeywordSentenceResponse`
350
+ def GenerateKeywordSentence(request)
351
+ body = send_request('GenerateKeywordSentence', request.serialize)
352
+ response = JSON.parse(body)
353
+ if response['Response'].key?('Error') == false
354
+ model = GenerateKeywordSentenceResponse.new
355
+ model.deserialize(response['Response'])
356
+ model
357
+ else
358
+ code = response['Response']['Error']['Code']
359
+ message = response['Response']['Error']['Message']
360
+ reqid = response['Response']['RequestId']
361
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
362
+ end
363
+ rescue TencentCloud::Common::TencentCloudSDKException => e
364
+ raise e
365
+ rescue StandardError => e
366
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
367
+ end
368
+
297
369
  # 根据用户输入的命题关键词自动生成一首七言律诗或五言律诗。(如需开通请联系商务)
298
370
 
299
371
  # @param request: Request instance for GeneratePoetry.
@@ -374,6 +446,54 @@ module TencentCloud
374
446
  raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
375
447
  end
376
448
 
449
+ # 通过精准地对文本进行分词、词性标注、命名实体识别等功能,助您更好地理解文本内容,挖掘出潜在的价值信息。
450
+
451
+ # @param request: Request instance for ParseWords.
452
+ # @type request: :class:`Tencentcloud::nlp::V20190408::ParseWordsRequest`
453
+ # @rtype: :class:`Tencentcloud::nlp::V20190408::ParseWordsResponse`
454
+ def ParseWords(request)
455
+ body = send_request('ParseWords', request.serialize)
456
+ response = JSON.parse(body)
457
+ if response['Response'].key?('Error') == false
458
+ model = ParseWordsResponse.new
459
+ model.deserialize(response['Response'])
460
+ model
461
+ else
462
+ code = response['Response']['Error']['Code']
463
+ message = response['Response']['Error']['Message']
464
+ reqid = response['Response']['RequestId']
465
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
466
+ end
467
+ rescue TencentCloud::Common::TencentCloudSDKException => e
468
+ raise e
469
+ rescue StandardError => e
470
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
471
+ end
472
+
473
+ # 基于大数据和深度学习技术,可以快速地找到与给定词语高度相似的其他词语,有助于提高搜索和推荐的准确性。(目前仅支持中文)
474
+
475
+ # @param request: Request instance for RetrieveSimilarWords.
476
+ # @type request: :class:`Tencentcloud::nlp::V20190408::RetrieveSimilarWordsRequest`
477
+ # @rtype: :class:`Tencentcloud::nlp::V20190408::RetrieveSimilarWordsResponse`
478
+ def RetrieveSimilarWords(request)
479
+ body = send_request('RetrieveSimilarWords', request.serialize)
480
+ response = JSON.parse(body)
481
+ if response['Response'].key?('Error') == false
482
+ model = RetrieveSimilarWordsResponse.new
483
+ model.deserialize(response['Response'])
484
+ model
485
+ else
486
+ code = response['Response']['Error']['Code']
487
+ message = response['Response']['Error']['Message']
488
+ reqid = response['Response']['RequestId']
489
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
490
+ end
491
+ rescue TencentCloud::Common::TencentCloudSDKException => e
492
+ raise e
493
+ rescue StandardError => e
494
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
495
+ end
496
+
377
497
  # 查询指定自定义词库中的词条是否存在。
378
498
 
379
499
  # @param request: Request instance for SearchWordItems.
@@ -398,6 +518,30 @@ module TencentCloud
398
518
  raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
399
519
  end
400
520
 
521
+ # 智能识别并纠正句子中的语法、拼写、用词等错误,确保文本的准确性和可读性。
522
+
523
+ # @param request: Request instance for SentenceCorrection.
524
+ # @type request: :class:`Tencentcloud::nlp::V20190408::SentenceCorrectionRequest`
525
+ # @rtype: :class:`Tencentcloud::nlp::V20190408::SentenceCorrectionResponse`
526
+ def SentenceCorrection(request)
527
+ body = send_request('SentenceCorrection', request.serialize)
528
+ response = JSON.parse(body)
529
+ if response['Response'].key?('Error') == false
530
+ model = SentenceCorrectionResponse.new
531
+ model.deserialize(response['Response'])
532
+ model
533
+ else
534
+ code = response['Response']['Error']['Code']
535
+ message = response['Response']['Error']['Message']
536
+ reqid = response['Response']['RequestId']
537
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
538
+ end
539
+ rescue TencentCloud::Common::TencentCloudSDKException => e
540
+ raise e
541
+ rescue StandardError => e
542
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
543
+ end
544
+
401
545
  # 句向量接口能够将输入的句子映射成一个固定维度的向量,用来表示这个句子的语义特征,可用于文本聚类、文本相似度、文本分类等任务,能够显著提高它们的效果。
402
546
 
403
547
  # 该句向量服务由腾讯云自然语言处理团队联合微信智言团队共同打造,基于千亿级大规模互联网语料并采用Bert等领先的深度神经网络模型训练而成,在腾讯内部诸多业务的NLP任务上实测效果显著。
@@ -556,6 +700,30 @@ module TencentCloud
556
700
  raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
557
701
  end
558
702
 
703
+ # 运用先进的自然语言处理技术,对原始文本进行优化润色,提升文本的通顺性、表达力和语言质量。
704
+
705
+ # @param request: Request instance for TextEmbellish.
706
+ # @type request: :class:`Tencentcloud::nlp::V20190408::TextEmbellishRequest`
707
+ # @rtype: :class:`Tencentcloud::nlp::V20190408::TextEmbellishResponse`
708
+ def TextEmbellish(request)
709
+ body = send_request('TextEmbellish', request.serialize)
710
+ response = JSON.parse(body)
711
+ if response['Response'].key?('Error') == false
712
+ model = TextEmbellishResponse.new
713
+ model.deserialize(response['Response'])
714
+ model
715
+ else
716
+ code = response['Response']['Error']['Code']
717
+ message = response['Response']['Error']['Message']
718
+ reqid = response['Response']['RequestId']
719
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
720
+ end
721
+ rescue TencentCloud::Common::TencentCloudSDKException => e
722
+ raise e
723
+ rescue StandardError => e
724
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
725
+ end
726
+
559
727
  # 句子相似度接口能够基于深度学习技术来计算一个源句子和多个目标句子的相似度,相似度分值越大的两个句子在语义上越相似。目前仅支持短文本(不超过500字符)的相似度计算,长文本的相似度计算也即将推出。
560
728
 
561
729
  # 鉴于句子相似度是一个应用非常广泛的功能,腾讯云自然语言处理团队在Bert等领先的深度神经网络模型的基础上,专门针对文本相似任务进行了优化,并持续迭代更新。基于句子相似度,可以轻松实现诸如文本去重、相似推荐等功能。
@@ -612,6 +780,30 @@ module TencentCloud
612
780
  raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
613
781
  end
614
782
 
783
+ # 通过自动补全文本片段,帮助用户快速生成高质量、连贯的完整文本,提高创作效率。
784
+
785
+ # @param request: Request instance for TextWriting.
786
+ # @type request: :class:`Tencentcloud::nlp::V20190408::TextWritingRequest`
787
+ # @rtype: :class:`Tencentcloud::nlp::V20190408::TextWritingResponse`
788
+ def TextWriting(request)
789
+ body = send_request('TextWriting', request.serialize)
790
+ response = JSON.parse(body)
791
+ if response['Response'].key?('Error') == false
792
+ model = TextWritingResponse.new
793
+ model.deserialize(response['Response'])
794
+ model
795
+ else
796
+ code = response['Response']['Error']['Code']
797
+ message = response['Response']['Error']['Message']
798
+ reqid = response['Response']['RequestId']
799
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
800
+ end
801
+ rescue TencentCloud::Common::TencentCloudSDKException => e
802
+ raise e
803
+ rescue StandardError => e
804
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
805
+ end
806
+
615
807
  # 修改自定义词库元数据信息,包括名称、描述。
616
808
 
617
809
  # @param request: Request instance for UpdateDict.
@@ -58,6 +58,34 @@ module TencentCloud
58
58
  end
59
59
  end
60
60
 
61
+ # 基础粒度分词和词性标注的结果
62
+ class BasicParticiple < TencentCloud::Common::AbstractModel
63
+ # @param Word: 基础词。
64
+ # @type Word: String
65
+ # @param BeginOffset: 基础词在NormalText中的起始位置。
66
+ # @type BeginOffset: Integer
67
+ # @param Length: 基础词的长度。
68
+ # @type Length: Integer
69
+ # @param Pos: 词性。
70
+ # @type Pos: String
71
+
72
+ attr_accessor :Word, :BeginOffset, :Length, :Pos
73
+
74
+ def initialize(word=nil, beginoffset=nil, length=nil, pos=nil)
75
+ @Word = word
76
+ @BeginOffset = beginoffset
77
+ @Length = length
78
+ @Pos = pos
79
+ end
80
+
81
+ def deserialize(params)
82
+ @Word = params['Word']
83
+ @BeginOffset = params['BeginOffset']
84
+ @Length = params['Length']
85
+ @Pos = params['Pos']
86
+ end
87
+ end
88
+
61
89
  # 文本纠错结果
62
90
  class CCIToken < TencentCloud::Common::AbstractModel
63
91
  # @param Word: 错别字内容
@@ -182,6 +210,85 @@ module TencentCloud
182
210
  end
183
211
  end
184
212
 
213
+ # 复合粒度分词和词性标注的结果。
214
+ class CompoundParticiple < TencentCloud::Common::AbstractModel
215
+ # @param Word: 基础词。
216
+ # @type Word: String
217
+ # @param BeginOffset: 基础词在NormalText中的起始位置。
218
+ # @type BeginOffset: Integer
219
+ # @param Length: 基础词的长度。
220
+ # @type Length: Integer
221
+ # @param Pos: 词性。
222
+ # @type Pos: String
223
+
224
+ attr_accessor :Word, :BeginOffset, :Length, :Pos
225
+
226
+ def initialize(word=nil, beginoffset=nil, length=nil, pos=nil)
227
+ @Word = word
228
+ @BeginOffset = beginoffset
229
+ @Length = length
230
+ @Pos = pos
231
+ end
232
+
233
+ def deserialize(params)
234
+ @Word = params['Word']
235
+ @BeginOffset = params['BeginOffset']
236
+ @Length = params['Length']
237
+ @Pos = params['Pos']
238
+ end
239
+ end
240
+
241
+ # 纠错结果列表
242
+ class CorrectionItem < TencentCloud::Common::AbstractModel
243
+ # @param Order: 纠错句子的序号。
244
+ # @type Order: Integer
245
+ # @param BeginOffset: 错误的起始位置,从0开始。
246
+ # @type BeginOffset: Integer
247
+ # @param Len: 错误内容长度。
248
+ # @type Len: Integer
249
+ # @param Word: 错误内容。
250
+ # @type Word: String
251
+ # @param CorrectWord: 纠错结果,当为删除类错误时,结果为null。
252
+ # 注意:此字段可能返回 null,表示取不到有效值。
253
+ # @type CorrectWord: Array
254
+ # @param CorrectionType: 纠错类型。0:替换;1:插入;2:删除。
255
+ # @type CorrectionType: Integer
256
+ # @param Confidence: 纠错信息置信度。0:error;1:warning;error的置信度更高。(仅供参考)
257
+ # @type Confidence: Integer
258
+ # @param DescriptionZh: 纠错信息中文描述。
259
+ # 注意:此字段可能返回 null,表示取不到有效值。
260
+ # @type DescriptionZh: String
261
+ # @param DescriptionEn: 纠错信息英文描述。
262
+ # 注意:此字段可能返回 null,表示取不到有效值。
263
+ # @type DescriptionEn: String
264
+
265
+ attr_accessor :Order, :BeginOffset, :Len, :Word, :CorrectWord, :CorrectionType, :Confidence, :DescriptionZh, :DescriptionEn
266
+
267
+ def initialize(order=nil, beginoffset=nil, len=nil, word=nil, correctword=nil, correctiontype=nil, confidence=nil, descriptionzh=nil, descriptionen=nil)
268
+ @Order = order
269
+ @BeginOffset = beginoffset
270
+ @Len = len
271
+ @Word = word
272
+ @CorrectWord = correctword
273
+ @CorrectionType = correctiontype
274
+ @Confidence = confidence
275
+ @DescriptionZh = descriptionzh
276
+ @DescriptionEn = descriptionen
277
+ end
278
+
279
+ def deserialize(params)
280
+ @Order = params['Order']
281
+ @BeginOffset = params['BeginOffset']
282
+ @Len = params['Len']
283
+ @Word = params['Word']
284
+ @CorrectWord = params['CorrectWord']
285
+ @CorrectionType = params['CorrectionType']
286
+ @Confidence = params['Confidence']
287
+ @DescriptionZh = params['DescriptionZh']
288
+ @DescriptionEn = params['DescriptionEn']
289
+ end
290
+ end
291
+
185
292
  # CreateDict请求参数结构体
186
293
  class CreateDictRequest < TencentCloud::Common::AbstractModel
187
294
  # @param Name: 自定义词库名称,不超过20字。
@@ -619,6 +726,149 @@ module TencentCloud
619
726
  end
620
727
  end
621
728
 
729
+ # 文本润色结果
730
+ class Embellish < TencentCloud::Common::AbstractModel
731
+ # @param Text: 润色后的文本。
732
+ # 注意:此字段可能返回 null,表示取不到有效值。
733
+ # @type Text: String
734
+ # @param EmbellishType: 润色类型。类型列表
735
+ # expansion:扩写
736
+ # rewriting:改写
737
+ # translation_m2a:从现代文改写为古文
738
+ # translation_a2m:从古文改写为现代文
739
+
740
+
741
+ # 注意:此字段可能返回 null,表示取不到有效值。
742
+ # @type EmbellishType: String
743
+
744
+ attr_accessor :Text, :EmbellishType
745
+
746
+ def initialize(text=nil, embellishtype=nil)
747
+ @Text = text
748
+ @EmbellishType = embellishtype
749
+ end
750
+
751
+ def deserialize(params)
752
+ @Text = params['Text']
753
+ @EmbellishType = params['EmbellishType']
754
+ end
755
+ end
756
+
757
+ # 实体识别结果。
758
+ class Entity < TencentCloud::Common::AbstractModel
759
+ # @param Word: 基础词。
760
+ # @type Word: String
761
+ # @param BeginOffset: 基础词在NormalText中的起始位置。
762
+ # @type BeginOffset: Integer
763
+ # @param Length: 基础词的长度。
764
+ # @type Length: Integer
765
+ # @param Type: 实体类型的标准名字。
766
+ # @type Type: String
767
+ # @param Name: 类型名字的自然语言表达。(中文或英文)
768
+ # @type Name: String
769
+
770
+ attr_accessor :Word, :BeginOffset, :Length, :Type, :Name
771
+
772
+ def initialize(word=nil, beginoffset=nil, length=nil, type=nil, name=nil)
773
+ @Word = word
774
+ @BeginOffset = beginoffset
775
+ @Length = length
776
+ @Type = type
777
+ @Name = name
778
+ end
779
+
780
+ def deserialize(params)
781
+ @Word = params['Word']
782
+ @BeginOffset = params['BeginOffset']
783
+ @Length = params['Length']
784
+ @Type = params['Type']
785
+ @Name = params['Name']
786
+ end
787
+ end
788
+
789
+ # EvaluateSentenceSimilarity请求参数结构体
790
+ class EvaluateSentenceSimilarityRequest < TencentCloud::Common::AbstractModel
791
+ # @param SentencePairList: 待分析的句子对数组。句子对应不超过5对,支持中英文文本,原句子与目标句子均应不超过500字符。
792
+ # @type SentencePairList: Array
793
+
794
+ attr_accessor :SentencePairList
795
+
796
+ def initialize(sentencepairlist=nil)
797
+ @SentencePairList = sentencepairlist
798
+ end
799
+
800
+ def deserialize(params)
801
+ unless params['SentencePairList'].nil?
802
+ @SentencePairList = []
803
+ params['SentencePairList'].each do |i|
804
+ sentencepair_tmp = SentencePair.new
805
+ sentencepair_tmp.deserialize(i)
806
+ @SentencePairList << sentencepair_tmp
807
+ end
808
+ end
809
+ end
810
+ end
811
+
812
+ # EvaluateSentenceSimilarity返回参数结构体
813
+ class EvaluateSentenceSimilarityResponse < TencentCloud::Common::AbstractModel
814
+ # @param ScoreList: 每个句子对的相似度分值。
815
+ # @type ScoreList: Array
816
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
817
+ # @type RequestId: String
818
+
819
+ attr_accessor :ScoreList, :RequestId
820
+
821
+ def initialize(scorelist=nil, requestid=nil)
822
+ @ScoreList = scorelist
823
+ @RequestId = requestid
824
+ end
825
+
826
+ def deserialize(params)
827
+ @ScoreList = params['ScoreList']
828
+ @RequestId = params['RequestId']
829
+ end
830
+ end
831
+
832
+ # EvaluateWordSimilarity请求参数结构体
833
+ class EvaluateWordSimilarityRequest < TencentCloud::Common::AbstractModel
834
+ # @param SourceWord: 计算相似度的源词。(仅支持UTF-8格式,不超过10字符)
835
+ # @type SourceWord: String
836
+ # @param TargetWord: 计算相似度的目标词。(仅支持UTF-8格式,不超过10字符)
837
+ # @type TargetWord: String
838
+
839
+ attr_accessor :SourceWord, :TargetWord
840
+
841
+ def initialize(sourceword=nil, targetword=nil)
842
+ @SourceWord = sourceword
843
+ @TargetWord = targetword
844
+ end
845
+
846
+ def deserialize(params)
847
+ @SourceWord = params['SourceWord']
848
+ @TargetWord = params['TargetWord']
849
+ end
850
+ end
851
+
852
+ # EvaluateWordSimilarity返回参数结构体
853
+ class EvaluateWordSimilarityResponse < TencentCloud::Common::AbstractModel
854
+ # @param Similarity: 词相似度分值。
855
+ # @type Similarity: Float
856
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
857
+ # @type RequestId: String
858
+
859
+ attr_accessor :Similarity, :RequestId
860
+
861
+ def initialize(similarity=nil, requestid=nil)
862
+ @Similarity = similarity
863
+ @RequestId = requestid
864
+ end
865
+
866
+ def deserialize(params)
867
+ @Similarity = params['Similarity']
868
+ @RequestId = params['RequestId']
869
+ end
870
+ end
871
+
622
872
  # GenerateCouplet请求参数结构体
623
873
  class GenerateCoupletRequest < TencentCloud::Common::AbstractModel
624
874
  # @param Text: 生成对联的关键词。长度需>=2,当长度>2时,自动截取前两个字作为关键字。内容需为常用汉字(不含有数字、英文、韩语、日语、符号等等其他)。
@@ -667,6 +917,61 @@ module TencentCloud
667
917
  end
668
918
  end
669
919
 
920
+ # GenerateKeywordSentence请求参数结构体
921
+ class GenerateKeywordSentenceRequest < TencentCloud::Common::AbstractModel
922
+ # @param WordList: 生成句子的关键词,关键词个数需不超过4个,中文关键词长度应不超过10字符,英文关键词长度不超过3个单词。关键词中不可包含标点符号。
923
+ # @type WordList: Array
924
+ # @param Number: 返回生成句子的个数。数量需>=1且<=5。
925
+ # (注意实际结果可能小于指定个数)
926
+ # @type Number: Integer
927
+ # @param Domain: 指定生成句子的领域,支持领域列表
928
+ # general:通用领域,支持中英文
929
+ # academic:学术领域,仅支持英文
930
+ # 默认为general(通用领域)。
931
+ # @type Domain: String
932
+
933
+ attr_accessor :WordList, :Number, :Domain
934
+
935
+ def initialize(wordlist=nil, number=nil, domain=nil)
936
+ @WordList = wordlist
937
+ @Number = number
938
+ @Domain = domain
939
+ end
940
+
941
+ def deserialize(params)
942
+ @WordList = params['WordList']
943
+ @Number = params['Number']
944
+ @Domain = params['Domain']
945
+ end
946
+ end
947
+
948
+ # GenerateKeywordSentence返回参数结构体
949
+ class GenerateKeywordSentenceResponse < TencentCloud::Common::AbstractModel
950
+ # @param KeywordSentenceList: 生成的句子列表。
951
+ # @type KeywordSentenceList: Array
952
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
953
+ # @type RequestId: String
954
+
955
+ attr_accessor :KeywordSentenceList, :RequestId
956
+
957
+ def initialize(keywordsentencelist=nil, requestid=nil)
958
+ @KeywordSentenceList = keywordsentencelist
959
+ @RequestId = requestid
960
+ end
961
+
962
+ def deserialize(params)
963
+ unless params['KeywordSentenceList'].nil?
964
+ @KeywordSentenceList = []
965
+ params['KeywordSentenceList'].each do |i|
966
+ keywordsentence_tmp = KeywordSentence.new
967
+ keywordsentence_tmp.deserialize(i)
968
+ @KeywordSentenceList << keywordsentence_tmp
969
+ end
970
+ end
971
+ @RequestId = params['RequestId']
972
+ end
973
+ end
974
+
670
975
  # GeneratePoetry请求参数结构体
671
976
  class GeneratePoetryRequest < TencentCloud::Common::AbstractModel
672
977
  # @param Text: 生成诗词的关键词。
@@ -735,6 +1040,22 @@ module TencentCloud
735
1040
  end
736
1041
  end
737
1042
 
1043
+ # 通过关键词生成的句子信息
1044
+ class KeywordSentence < TencentCloud::Common::AbstractModel
1045
+ # @param TargetText: 通过关键词生成的句子。
1046
+ # @type TargetText: String
1047
+
1048
+ attr_accessor :TargetText
1049
+
1050
+ def initialize(targettext=nil)
1051
+ @TargetText = targettext
1052
+ end
1053
+
1054
+ def deserialize(params)
1055
+ @TargetText = params['TargetText']
1056
+ end
1057
+ end
1058
+
738
1059
  # KeywordsExtraction请求参数结构体
739
1060
  class KeywordsExtractionRequest < TencentCloud::Common::AbstractModel
740
1061
  # @param Text: 待处理的文本(仅支持UTF-8格式,不超过10000字符)
@@ -880,6 +1201,75 @@ module TencentCloud
880
1201
  end
881
1202
  end
882
1203
 
1204
+ # ParseWords请求参数结构体
1205
+ class ParseWordsRequest < TencentCloud::Common::AbstractModel
1206
+ # @param Text: 待分析的文本(支持中英文文本,不超过500字符)
1207
+ # @type Text: String
1208
+
1209
+ attr_accessor :Text
1210
+
1211
+ def initialize(text=nil)
1212
+ @Text = text
1213
+ end
1214
+
1215
+ def deserialize(params)
1216
+ @Text = params['Text']
1217
+ end
1218
+ end
1219
+
1220
+ # ParseWords返回参数结构体
1221
+ class ParseWordsResponse < TencentCloud::Common::AbstractModel
1222
+ # @param NormalText: 输入文本正则化的结果。(包括对英文文本中的开头和实体进行大写等)
1223
+ # @type NormalText: String
1224
+ # @param BasicParticiples: 基础粒度分词和词性标注的结果。(词性表请参见附录)
1225
+ # @type BasicParticiples: Array
1226
+ # @param CompoundParticiples: 复合粒度分词和词性标注的结果。(词性表请参见附录)
1227
+ # @type CompoundParticiples: Array
1228
+ # @param Entities: 实体识别结果。(实体类型数据请参见附录)
1229
+ # @type Entities: Array
1230
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
1231
+ # @type RequestId: String
1232
+
1233
+ attr_accessor :NormalText, :BasicParticiples, :CompoundParticiples, :Entities, :RequestId
1234
+
1235
+ def initialize(normaltext=nil, basicparticiples=nil, compoundparticiples=nil, entities=nil, requestid=nil)
1236
+ @NormalText = normaltext
1237
+ @BasicParticiples = basicparticiples
1238
+ @CompoundParticiples = compoundparticiples
1239
+ @Entities = entities
1240
+ @RequestId = requestid
1241
+ end
1242
+
1243
+ def deserialize(params)
1244
+ @NormalText = params['NormalText']
1245
+ unless params['BasicParticiples'].nil?
1246
+ @BasicParticiples = []
1247
+ params['BasicParticiples'].each do |i|
1248
+ basicparticiple_tmp = BasicParticiple.new
1249
+ basicparticiple_tmp.deserialize(i)
1250
+ @BasicParticiples << basicparticiple_tmp
1251
+ end
1252
+ end
1253
+ unless params['CompoundParticiples'].nil?
1254
+ @CompoundParticiples = []
1255
+ params['CompoundParticiples'].each do |i|
1256
+ compoundparticiple_tmp = CompoundParticiple.new
1257
+ compoundparticiple_tmp.deserialize(i)
1258
+ @CompoundParticiples << compoundparticiple_tmp
1259
+ end
1260
+ end
1261
+ unless params['Entities'].nil?
1262
+ @Entities = []
1263
+ params['Entities'].each do |i|
1264
+ entity_tmp = Entity.new
1265
+ entity_tmp.deserialize(i)
1266
+ @Entities << entity_tmp
1267
+ end
1268
+ end
1269
+ @RequestId = params['RequestId']
1270
+ end
1271
+ end
1272
+
883
1273
  # 分词&词性标注结果
884
1274
  class PosToken < TencentCloud::Common::AbstractModel
885
1275
  # @param Word: 基础词
@@ -908,6 +1298,46 @@ module TencentCloud
908
1298
  end
909
1299
  end
910
1300
 
1301
+ # RetrieveSimilarWords请求参数结构体
1302
+ class RetrieveSimilarWordsRequest < TencentCloud::Common::AbstractModel
1303
+ # @param Text: 输入的词语。(仅支持UTF-8格式,不超过10字符)
1304
+ # @type Text: String
1305
+ # @param Number: 召回的相似词个数,取值范围为1-20。
1306
+ # @type Number: Integer
1307
+
1308
+ attr_accessor :Text, :Number
1309
+
1310
+ def initialize(text=nil, number=nil)
1311
+ @Text = text
1312
+ @Number = number
1313
+ end
1314
+
1315
+ def deserialize(params)
1316
+ @Text = params['Text']
1317
+ @Number = params['Number']
1318
+ end
1319
+ end
1320
+
1321
+ # RetrieveSimilarWords返回参数结构体
1322
+ class RetrieveSimilarWordsResponse < TencentCloud::Common::AbstractModel
1323
+ # @param WordList: 召回的相似词数组。
1324
+ # @type WordList: Array
1325
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
1326
+ # @type RequestId: String
1327
+
1328
+ attr_accessor :WordList, :RequestId
1329
+
1330
+ def initialize(wordlist=nil, requestid=nil)
1331
+ @WordList = wordlist
1332
+ @RequestId = requestid
1333
+ end
1334
+
1335
+ def deserialize(params)
1336
+ @WordList = params['WordList']
1337
+ @RequestId = params['RequestId']
1338
+ end
1339
+ end
1340
+
911
1341
  # 词条搜索的结果,主要描述该词条是否存在以及相关的词性。
912
1342
  class SearchResult < TencentCloud::Common::AbstractModel
913
1343
  # @param Text: 被搜索的词条文本。
@@ -991,6 +1421,50 @@ module TencentCloud
991
1421
  end
992
1422
  end
993
1423
 
1424
+ # SentenceCorrection请求参数结构体
1425
+ class SentenceCorrectionRequest < TencentCloud::Common::AbstractModel
1426
+ # @param TextList: 待纠错的句子列表。可以以数组方式在一次请求中填写多个待纠错的句子。文本统一使用utf-8格式编码,每个中文句子的长度不超过150字符,每个英文句子的长度不超过100个单词,且数组长度需小于150,即句子总数需少于150句。
1427
+ # @type TextList: Array
1428
+
1429
+ attr_accessor :TextList
1430
+
1431
+ def initialize(textlist=nil)
1432
+ @TextList = textlist
1433
+ end
1434
+
1435
+ def deserialize(params)
1436
+ @TextList = params['TextList']
1437
+ end
1438
+ end
1439
+
1440
+ # SentenceCorrection返回参数结构体
1441
+ class SentenceCorrectionResponse < TencentCloud::Common::AbstractModel
1442
+ # @param CorrectionList: 纠错结果列表。
1443
+ # (注意仅展示错误句子的纠错结果,若句子无错则不展示,若全部待纠错句子都被认为无错,则可能返回数组为空)
1444
+ # @type CorrectionList: Array
1445
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
1446
+ # @type RequestId: String
1447
+
1448
+ attr_accessor :CorrectionList, :RequestId
1449
+
1450
+ def initialize(correctionlist=nil, requestid=nil)
1451
+ @CorrectionList = correctionlist
1452
+ @RequestId = requestid
1453
+ end
1454
+
1455
+ def deserialize(params)
1456
+ unless params['CorrectionList'].nil?
1457
+ @CorrectionList = []
1458
+ params['CorrectionList'].each do |i|
1459
+ correctionitem_tmp = CorrectionItem.new
1460
+ correctionitem_tmp.deserialize(i)
1461
+ @CorrectionList << correctionitem_tmp
1462
+ end
1463
+ end
1464
+ @RequestId = params['RequestId']
1465
+ end
1466
+ end
1467
+
994
1468
  # SentenceEmbedding请求参数结构体
995
1469
  class SentenceEmbeddingRequest < TencentCloud::Common::AbstractModel
996
1470
  # @param Text: 输入的文本(仅支持UTF-8格式,不超过500字)
@@ -1031,6 +1505,26 @@ module TencentCloud
1031
1505
  end
1032
1506
  end
1033
1507
 
1508
+ # 待分析的句子对
1509
+ class SentencePair < TencentCloud::Common::AbstractModel
1510
+ # @param SourceText: 需要与目标句子计算相似度的源句子。(仅支持UTF-8格式,不超过500字符)
1511
+ # @type SourceText: String
1512
+ # @param TargetText: 目标句子。(仅支持UTF-8格式,不超过500字符)
1513
+ # @type TargetText: String
1514
+
1515
+ attr_accessor :SourceText, :TargetText
1516
+
1517
+ def initialize(sourcetext=nil, targettext=nil)
1518
+ @SourceText = sourcetext
1519
+ @TargetText = targettext
1520
+ end
1521
+
1522
+ def deserialize(params)
1523
+ @SourceText = params['SourceText']
1524
+ @TargetText = params['TargetText']
1525
+ end
1526
+ end
1527
+
1034
1528
  # SentimentAnalysis请求参数结构体
1035
1529
  class SentimentAnalysisRequest < TencentCloud::Common::AbstractModel
1036
1530
  # @param Text: 待分析的文本(仅支持UTF-8格式,不超过200字)
@@ -1302,6 +1796,70 @@ module TencentCloud
1302
1796
  end
1303
1797
  end
1304
1798
 
1799
+ # TextEmbellish请求参数结构体
1800
+ class TextEmbellishRequest < TencentCloud::Common::AbstractModel
1801
+ # @param Text: 待润色的文本。中文文本长度需<=50字符;英文文本长度需<=30个单词。
1802
+ # @type Text: String
1803
+ # @param SourceLang: 待润色文本的语言类型,支持语言列表
1804
+ # zh:中文
1805
+ # en:英文
1806
+ # @type SourceLang: String
1807
+ # @param Number: 返回润色结果的个数。数量需>=1且<=5。
1808
+ # (注意实际结果可能小于指定个数)
1809
+ # @type Number: Integer
1810
+ # @param Style: 控制润色类型,类型列表
1811
+ # both:同时返回改写和扩写
1812
+ # expansion:扩写
1813
+ # rewriting:改写
1814
+ # m2a:从现代文改写为古文
1815
+ # a2m:从古文改写为现代文
1816
+ # 默认为both。
1817
+ # @type Style: String
1818
+
1819
+ attr_accessor :Text, :SourceLang, :Number, :Style
1820
+
1821
+ def initialize(text=nil, sourcelang=nil, number=nil, style=nil)
1822
+ @Text = text
1823
+ @SourceLang = sourcelang
1824
+ @Number = number
1825
+ @Style = style
1826
+ end
1827
+
1828
+ def deserialize(params)
1829
+ @Text = params['Text']
1830
+ @SourceLang = params['SourceLang']
1831
+ @Number = params['Number']
1832
+ @Style = params['Style']
1833
+ end
1834
+ end
1835
+
1836
+ # TextEmbellish返回参数结构体
1837
+ class TextEmbellishResponse < TencentCloud::Common::AbstractModel
1838
+ # @param EmbellishList: 润色结果列表。
1839
+ # @type EmbellishList: Array
1840
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
1841
+ # @type RequestId: String
1842
+
1843
+ attr_accessor :EmbellishList, :RequestId
1844
+
1845
+ def initialize(embellishlist=nil, requestid=nil)
1846
+ @EmbellishList = embellishlist
1847
+ @RequestId = requestid
1848
+ end
1849
+
1850
+ def deserialize(params)
1851
+ unless params['EmbellishList'].nil?
1852
+ @EmbellishList = []
1853
+ params['EmbellishList'].each do |i|
1854
+ embellish_tmp = Embellish.new
1855
+ embellish_tmp.deserialize(i)
1856
+ @EmbellishList << embellish_tmp
1857
+ end
1858
+ end
1859
+ @RequestId = params['RequestId']
1860
+ end
1861
+ end
1862
+
1305
1863
  # TextSimilarityPro请求参数结构体
1306
1864
  class TextSimilarityProRequest < TencentCloud::Common::AbstractModel
1307
1865
  # @param SrcText: 需要与目标句子计算相似度的源句子(仅支持UTF-8格式,不超过128字符)
@@ -1396,6 +1954,76 @@ module TencentCloud
1396
1954
  end
1397
1955
  end
1398
1956
 
1957
+ # TextWriting请求参数结构体
1958
+ class TextWritingRequest < TencentCloud::Common::AbstractModel
1959
+ # @param Text: 待续写的句子,文本统一使用utf-8格式编码,长度不超过200字符。
1960
+ # @type Text: String
1961
+ # @param SourceLang: 待续写文本的语言类型,支持语言列表
1962
+ # zh:中文
1963
+ # en:英文
1964
+ # @type SourceLang: String
1965
+ # @param Number: 返回续写结果的个数。数量需>=1且<=5。
1966
+ # (注意实际结果可能小于指定个数)
1967
+ # @type Number: Integer
1968
+ # @param Domain: 指定续写领域,支持领域列表
1969
+ # general:通用领域,支持中英文补全
1970
+ # academic:学术领域,仅支持英文补全
1971
+ # 默认为general(通用领域)。
1972
+ # @type Domain: String
1973
+ # @param Style: 指定续写风格,支持风格列表
1974
+ # science_fiction:科幻
1975
+ # military_history:军事
1976
+ # xuanhuan_wuxia:武侠
1977
+ # urban_officialdom:职场
1978
+ # 默认为xuanhuan_wuxia(武侠)。
1979
+ # @type Style: String
1980
+
1981
+ attr_accessor :Text, :SourceLang, :Number, :Domain, :Style
1982
+
1983
+ def initialize(text=nil, sourcelang=nil, number=nil, domain=nil, style=nil)
1984
+ @Text = text
1985
+ @SourceLang = sourcelang
1986
+ @Number = number
1987
+ @Domain = domain
1988
+ @Style = style
1989
+ end
1990
+
1991
+ def deserialize(params)
1992
+ @Text = params['Text']
1993
+ @SourceLang = params['SourceLang']
1994
+ @Number = params['Number']
1995
+ @Domain = params['Domain']
1996
+ @Style = params['Style']
1997
+ end
1998
+ end
1999
+
2000
+ # TextWriting返回参数结构体
2001
+ class TextWritingResponse < TencentCloud::Common::AbstractModel
2002
+ # @param WritingList: 续写结果列表。
2003
+ # @type WritingList: Array
2004
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
2005
+ # @type RequestId: String
2006
+
2007
+ attr_accessor :WritingList, :RequestId
2008
+
2009
+ def initialize(writinglist=nil, requestid=nil)
2010
+ @WritingList = writinglist
2011
+ @RequestId = requestid
2012
+ end
2013
+
2014
+ def deserialize(params)
2015
+ unless params['WritingList'].nil?
2016
+ @WritingList = []
2017
+ params['WritingList'].each do |i|
2018
+ writing_tmp = Writing.new
2019
+ writing_tmp.deserialize(i)
2020
+ @WritingList << writing_tmp
2021
+ end
2022
+ end
2023
+ @RequestId = params['RequestId']
2024
+ end
2025
+ end
2026
+
1399
2027
  # UpdateDict请求参数结构体
1400
2028
  class UpdateDictRequest < TencentCloud::Common::AbstractModel
1401
2029
  # @param DictId: 自定义词库ID。
@@ -1540,6 +2168,26 @@ module TencentCloud
1540
2168
  end
1541
2169
  end
1542
2170
 
2171
+ # 文本续写结果
2172
+ class Writing < TencentCloud::Common::AbstractModel
2173
+ # @param TargetText: 续写的文本。
2174
+ # @type TargetText: String
2175
+ # @param PrefixText: 续写的前缀。
2176
+ # @type PrefixText: String
2177
+
2178
+ attr_accessor :TargetText, :PrefixText
2179
+
2180
+ def initialize(targettext=nil, prefixtext=nil)
2181
+ @TargetText = targettext
2182
+ @PrefixText = prefixtext
2183
+ end
2184
+
2185
+ def deserialize(params)
2186
+ @TargetText = params['TargetText']
2187
+ @PrefixText = params['PrefixText']
2188
+ end
2189
+ end
2190
+
1543
2191
  end
1544
2192
  end
1545
2193
  end
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: 3.0.559
4
+ version: 3.0.561
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tencent Cloud
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-25 00:00:00.000000000 Z
11
+ date: 2023-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tencentcloud-sdk-common