tencentcloud-sdk-nlp 3.0.599 → 3.0.600
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/VERSION +1 -1
- data/lib/v20190408/client.rb +96 -0
- data/lib/v20190408/models.rb +237 -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: 1469a428e2dd06cb477e5de34b5df1add3bb3331
|
4
|
+
data.tar.gz: 0fb6b38f1cfd4a25d86505f727071cd26b4f992c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f584bf598ac06a32b14655e5a24baa9650461c111b24104bd3044d9189e90a1ddcd4144ed3f90fc60f0de1a9d11ca67661eca70d3c92ea97e2dc1dc077ad1f2
|
7
|
+
data.tar.gz: f4390c1f6dacc3c0a4b86a9a908b920d08ecac9a8f9d1eeab03b0bf8266ca4d5e8524e6881b4e587b53538fe459b084bee0d981b7f5243f7a0d255480746219c
|
data/lib/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.
|
1
|
+
3.0.600
|
data/lib/v20190408/client.rb
CHANGED
@@ -29,6 +29,30 @@ module TencentCloud
|
|
29
29
|
end
|
30
30
|
|
31
31
|
|
32
|
+
# 情感分析接口能够对带有情感色彩的主观性文本进行分析、处理、归纳和推理,识别出用户的情感倾向,是积极、中性还是消极,并且提供各自概率。
|
33
|
+
|
34
|
+
# @param request: Request instance for AnalyzeSentiment.
|
35
|
+
# @type request: :class:`Tencentcloud::nlp::V20190408::AnalyzeSentimentRequest`
|
36
|
+
# @rtype: :class:`Tencentcloud::nlp::V20190408::AnalyzeSentimentResponse`
|
37
|
+
def AnalyzeSentiment(request)
|
38
|
+
body = send_request('AnalyzeSentiment', request.serialize)
|
39
|
+
response = JSON.parse(body)
|
40
|
+
if response['Response'].key?('Error') == false
|
41
|
+
model = AnalyzeSentimentResponse.new
|
42
|
+
model.deserialize(response['Response'])
|
43
|
+
model
|
44
|
+
else
|
45
|
+
code = response['Response']['Error']['Code']
|
46
|
+
message = response['Response']['Error']['Message']
|
47
|
+
reqid = response['Response']['RequestId']
|
48
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
49
|
+
end
|
50
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
51
|
+
raise e
|
52
|
+
rescue StandardError => e
|
53
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
54
|
+
end
|
55
|
+
|
32
56
|
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
33
57
|
|
34
58
|
# 利用人工智能算法,自动抽取文本中的关键信息并生成指定长度的文本摘要。可用于新闻标题生成、科技文献摘要生成和商品评论摘要等。
|
@@ -82,6 +106,78 @@ module TencentCloud
|
|
82
106
|
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
83
107
|
end
|
84
108
|
|
109
|
+
# 文本分类接口能够对用户输入的文章进行自动分类,将其映射到具体的类目上,用户只需要提供待分类的文本,而无需关注具体实现。该功能定义了一套较为完备的[三级分类体系](https://cloud.tencent.com/document/product/271/94286),积累了数百万的语料,经过多轮迭代优化打造了较先进的深度学习模型,以保证效果不断提升。
|
110
|
+
|
111
|
+
# @param request: Request instance for ClassifyContent.
|
112
|
+
# @type request: :class:`Tencentcloud::nlp::V20190408::ClassifyContentRequest`
|
113
|
+
# @rtype: :class:`Tencentcloud::nlp::V20190408::ClassifyContentResponse`
|
114
|
+
def ClassifyContent(request)
|
115
|
+
body = send_request('ClassifyContent', request.serialize)
|
116
|
+
response = JSON.parse(body)
|
117
|
+
if response['Response'].key?('Error') == false
|
118
|
+
model = ClassifyContentResponse.new
|
119
|
+
model.deserialize(response['Response'])
|
120
|
+
model
|
121
|
+
else
|
122
|
+
code = response['Response']['Error']['Code']
|
123
|
+
message = response['Response']['Error']['Message']
|
124
|
+
reqid = response['Response']['RequestId']
|
125
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
126
|
+
end
|
127
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
128
|
+
raise e
|
129
|
+
rescue StandardError => e
|
130
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
131
|
+
end
|
132
|
+
|
133
|
+
# 对联生成接口根据用户输入的命题关键词,智能生成一副完整的春联,包括上联、下联和横批。该接口利用先进的自然语言处理技术,确保生成的春联既符合传统对仗、对韵、对义的要求,又具有新意和创意,为用户提供独特的春节祝福。
|
134
|
+
|
135
|
+
# @param request: Request instance for ComposeCouplet.
|
136
|
+
# @type request: :class:`Tencentcloud::nlp::V20190408::ComposeCoupletRequest`
|
137
|
+
# @rtype: :class:`Tencentcloud::nlp::V20190408::ComposeCoupletResponse`
|
138
|
+
def ComposeCouplet(request)
|
139
|
+
body = send_request('ComposeCouplet', request.serialize)
|
140
|
+
response = JSON.parse(body)
|
141
|
+
if response['Response'].key?('Error') == false
|
142
|
+
model = ComposeCoupletResponse.new
|
143
|
+
model.deserialize(response['Response'])
|
144
|
+
model
|
145
|
+
else
|
146
|
+
code = response['Response']['Error']['Code']
|
147
|
+
message = response['Response']['Error']['Message']
|
148
|
+
reqid = response['Response']['RequestId']
|
149
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
150
|
+
end
|
151
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
152
|
+
raise e
|
153
|
+
rescue StandardError => e
|
154
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
155
|
+
end
|
156
|
+
|
157
|
+
# 诗词生成接口利用现代的自然语言处理和深度学习技术,模仿了古代著名诗人的风格,为用户产生独特的诗词。用户只需输入的命题关键词,接口就能自动生成一首七言律诗或五言律诗。
|
158
|
+
|
159
|
+
# @param request: Request instance for ComposePoetry.
|
160
|
+
# @type request: :class:`Tencentcloud::nlp::V20190408::ComposePoetryRequest`
|
161
|
+
# @rtype: :class:`Tencentcloud::nlp::V20190408::ComposePoetryResponse`
|
162
|
+
def ComposePoetry(request)
|
163
|
+
body = send_request('ComposePoetry', request.serialize)
|
164
|
+
response = JSON.parse(body)
|
165
|
+
if response['Response'].key?('Error') == false
|
166
|
+
model = ComposePoetryResponse.new
|
167
|
+
model.deserialize(response['Response'])
|
168
|
+
model
|
169
|
+
else
|
170
|
+
code = response['Response']['Error']['Code']
|
171
|
+
message = response['Response']['Error']['Message']
|
172
|
+
reqid = response['Response']['RequestId']
|
173
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
174
|
+
end
|
175
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
176
|
+
raise e
|
177
|
+
rescue StandardError => e
|
178
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
179
|
+
end
|
180
|
+
|
85
181
|
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
86
182
|
|
87
183
|
# 根据指定的名称、描述创建自定义词库。
|
data/lib/v20190408/models.rb
CHANGED
@@ -17,6 +17,57 @@
|
|
17
17
|
module TencentCloud
|
18
18
|
module Nlp
|
19
19
|
module V20190408
|
20
|
+
# AnalyzeSentiment请求参数结构体
|
21
|
+
class AnalyzeSentimentRequest < TencentCloud::Common::AbstractModel
|
22
|
+
# @param Text: 待分析的文本(仅支持UTF-8格式,不超过200字)。
|
23
|
+
# @type Text: String
|
24
|
+
|
25
|
+
attr_accessor :Text
|
26
|
+
|
27
|
+
def initialize(text=nil)
|
28
|
+
@Text = text
|
29
|
+
end
|
30
|
+
|
31
|
+
def deserialize(params)
|
32
|
+
@Text = params['Text']
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
# AnalyzeSentiment返回参数结构体
|
37
|
+
class AnalyzeSentimentResponse < TencentCloud::Common::AbstractModel
|
38
|
+
# @param Positive: 正面情感概率。
|
39
|
+
# @type Positive: Float
|
40
|
+
# @param Neutral: 中性情感概率。
|
41
|
+
# @type Neutral: Float
|
42
|
+
# @param Negative: 负面情感概率。
|
43
|
+
# @type Negative: Float
|
44
|
+
# @param Sentiment: 情感分类结果:
|
45
|
+
# positive:正面情感
|
46
|
+
# negative:负面情感
|
47
|
+
# neutral:中性、无情感
|
48
|
+
# @type Sentiment: String
|
49
|
+
# @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
|
50
|
+
# @type RequestId: String
|
51
|
+
|
52
|
+
attr_accessor :Positive, :Neutral, :Negative, :Sentiment, :RequestId
|
53
|
+
|
54
|
+
def initialize(positive=nil, neutral=nil, negative=nil, sentiment=nil, requestid=nil)
|
55
|
+
@Positive = positive
|
56
|
+
@Neutral = neutral
|
57
|
+
@Negative = negative
|
58
|
+
@Sentiment = sentiment
|
59
|
+
@RequestId = requestid
|
60
|
+
end
|
61
|
+
|
62
|
+
def deserialize(params)
|
63
|
+
@Positive = params['Positive']
|
64
|
+
@Neutral = params['Neutral']
|
65
|
+
@Negative = params['Negative']
|
66
|
+
@Sentiment = params['Sentiment']
|
67
|
+
@RequestId = params['RequestId']
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
20
71
|
# AutoSummarization请求参数结构体
|
21
72
|
class AutoSummarizationRequest < TencentCloud::Common::AbstractModel
|
22
73
|
# @param Text: 待处理的文本(仅支持UTF-8格式,不超过2000字)
|
@@ -110,6 +161,38 @@ module TencentCloud
|
|
110
161
|
end
|
111
162
|
end
|
112
163
|
|
164
|
+
# 分类详细信息
|
165
|
+
class Category < TencentCloud::Common::AbstractModel
|
166
|
+
# @param Id: 分类id。
|
167
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
168
|
+
# @type Id: Integer
|
169
|
+
# @param Label: 分类英文名。
|
170
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
171
|
+
# @type Label: String
|
172
|
+
# @param Name: 分类中文名。
|
173
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
174
|
+
# @type Name: String
|
175
|
+
# @param Score: 分类置信度。
|
176
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
177
|
+
# @type Score: Float
|
178
|
+
|
179
|
+
attr_accessor :Id, :Label, :Name, :Score
|
180
|
+
|
181
|
+
def initialize(id=nil, label=nil, name=nil, score=nil)
|
182
|
+
@Id = id
|
183
|
+
@Label = label
|
184
|
+
@Name = name
|
185
|
+
@Score = score
|
186
|
+
end
|
187
|
+
|
188
|
+
def deserialize(params)
|
189
|
+
@Id = params['Id']
|
190
|
+
@Label = params['Label']
|
191
|
+
@Name = params['Name']
|
192
|
+
@Score = params['Score']
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
113
196
|
# ChatBot请求参数结构体
|
114
197
|
class ChatBotRequest < TencentCloud::Common::AbstractModel
|
115
198
|
# @param Query: 用户请求的query
|
@@ -210,6 +293,160 @@ module TencentCloud
|
|
210
293
|
end
|
211
294
|
end
|
212
295
|
|
296
|
+
# ClassifyContent请求参数结构体
|
297
|
+
class ClassifyContentRequest < TencentCloud::Common::AbstractModel
|
298
|
+
# @param Title: 待分类的文章的标题(仅支持UTF-8格式,不超过100字符)。
|
299
|
+
# @type Title: String
|
300
|
+
# @param Content: 待分类文章的内容, 每个元素对应一个段落。(仅支持UTF-8格式,文章内容长度总和不超过2000字符)
|
301
|
+
# @type Content: Array
|
302
|
+
|
303
|
+
attr_accessor :Title, :Content
|
304
|
+
|
305
|
+
def initialize(title=nil, content=nil)
|
306
|
+
@Title = title
|
307
|
+
@Content = content
|
308
|
+
end
|
309
|
+
|
310
|
+
def deserialize(params)
|
311
|
+
@Title = params['Title']
|
312
|
+
@Content = params['Content']
|
313
|
+
end
|
314
|
+
end
|
315
|
+
|
316
|
+
# ClassifyContent返回参数结构体
|
317
|
+
class ClassifyContentResponse < TencentCloud::Common::AbstractModel
|
318
|
+
# @param FirstClassification: 一级分类。分类详情见附录-三级分类体系表。
|
319
|
+
# @type FirstClassification: :class:`Tencentcloud::Nlp.v20190408.models.Category`
|
320
|
+
# @param SecondClassification: 二级分类。分类详情见附录-三级分类体系表。
|
321
|
+
# @type SecondClassification: :class:`Tencentcloud::Nlp.v20190408.models.Category`
|
322
|
+
# @param ThirdClassification: 三级分类。分类详情见附录-三级分类体系表。
|
323
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
324
|
+
# @type ThirdClassification: :class:`Tencentcloud::Nlp.v20190408.models.Category`
|
325
|
+
# @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
|
326
|
+
# @type RequestId: String
|
327
|
+
|
328
|
+
attr_accessor :FirstClassification, :SecondClassification, :ThirdClassification, :RequestId
|
329
|
+
|
330
|
+
def initialize(firstclassification=nil, secondclassification=nil, thirdclassification=nil, requestid=nil)
|
331
|
+
@FirstClassification = firstclassification
|
332
|
+
@SecondClassification = secondclassification
|
333
|
+
@ThirdClassification = thirdclassification
|
334
|
+
@RequestId = requestid
|
335
|
+
end
|
336
|
+
|
337
|
+
def deserialize(params)
|
338
|
+
unless params['FirstClassification'].nil?
|
339
|
+
@FirstClassification = Category.new
|
340
|
+
@FirstClassification.deserialize(params['FirstClassification'])
|
341
|
+
end
|
342
|
+
unless params['SecondClassification'].nil?
|
343
|
+
@SecondClassification = Category.new
|
344
|
+
@SecondClassification.deserialize(params['SecondClassification'])
|
345
|
+
end
|
346
|
+
unless params['ThirdClassification'].nil?
|
347
|
+
@ThirdClassification = Category.new
|
348
|
+
@ThirdClassification.deserialize(params['ThirdClassification'])
|
349
|
+
end
|
350
|
+
@RequestId = params['RequestId']
|
351
|
+
end
|
352
|
+
end
|
353
|
+
|
354
|
+
# ComposeCouplet请求参数结构体
|
355
|
+
class ComposeCoupletRequest < TencentCloud::Common::AbstractModel
|
356
|
+
# @param Text: 生成对联的关键词。长度需>=2,当长度>2时,自动截取前两个字作为关键字。内容需为常用汉字(不含有数字、英文、韩语、日语、符号等等其他)。
|
357
|
+
# @type Text: String
|
358
|
+
# @param TargetType: 返回的文本结果为繁体还是简体。0:简体;1:繁体。默认为0。
|
359
|
+
# @type TargetType: Integer
|
360
|
+
|
361
|
+
attr_accessor :Text, :TargetType
|
362
|
+
|
363
|
+
def initialize(text=nil, targettype=nil)
|
364
|
+
@Text = text
|
365
|
+
@TargetType = targettype
|
366
|
+
end
|
367
|
+
|
368
|
+
def deserialize(params)
|
369
|
+
@Text = params['Text']
|
370
|
+
@TargetType = params['TargetType']
|
371
|
+
end
|
372
|
+
end
|
373
|
+
|
374
|
+
# ComposeCouplet返回参数结构体
|
375
|
+
class ComposeCoupletResponse < TencentCloud::Common::AbstractModel
|
376
|
+
# @param TopScroll: 横批。
|
377
|
+
# @type TopScroll: String
|
378
|
+
# @param Content: 上联与下联。
|
379
|
+
# @type Content: Array
|
380
|
+
# @param RandomCause: 当对联随机生成时,展示随机生成原因。
|
381
|
+
# @type RandomCause: String
|
382
|
+
# @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
|
383
|
+
# @type RequestId: String
|
384
|
+
|
385
|
+
attr_accessor :TopScroll, :Content, :RandomCause, :RequestId
|
386
|
+
|
387
|
+
def initialize(topscroll=nil, content=nil, randomcause=nil, requestid=nil)
|
388
|
+
@TopScroll = topscroll
|
389
|
+
@Content = content
|
390
|
+
@RandomCause = randomcause
|
391
|
+
@RequestId = requestid
|
392
|
+
end
|
393
|
+
|
394
|
+
def deserialize(params)
|
395
|
+
@TopScroll = params['TopScroll']
|
396
|
+
@Content = params['Content']
|
397
|
+
@RandomCause = params['RandomCause']
|
398
|
+
@RequestId = params['RequestId']
|
399
|
+
end
|
400
|
+
end
|
401
|
+
|
402
|
+
# ComposePoetry请求参数结构体
|
403
|
+
class ComposePoetryRequest < TencentCloud::Common::AbstractModel
|
404
|
+
# @param Text: 生成诗词的关键词。
|
405
|
+
# @type Text: String
|
406
|
+
# @param PoetryType: 生成诗词的类型。0:藏头或藏身;1:藏头;2:藏身。默认为0。
|
407
|
+
# @type PoetryType: Integer
|
408
|
+
# @param Genre: 诗的体裁。0:五言律诗或七言律诗;5:五言律诗;7:七言律诗。默认为0。
|
409
|
+
# @type Genre: Integer
|
410
|
+
|
411
|
+
attr_accessor :Text, :PoetryType, :Genre
|
412
|
+
|
413
|
+
def initialize(text=nil, poetrytype=nil, genre=nil)
|
414
|
+
@Text = text
|
415
|
+
@PoetryType = poetrytype
|
416
|
+
@Genre = genre
|
417
|
+
end
|
418
|
+
|
419
|
+
def deserialize(params)
|
420
|
+
@Text = params['Text']
|
421
|
+
@PoetryType = params['PoetryType']
|
422
|
+
@Genre = params['Genre']
|
423
|
+
end
|
424
|
+
end
|
425
|
+
|
426
|
+
# ComposePoetry返回参数结构体
|
427
|
+
class ComposePoetryResponse < TencentCloud::Common::AbstractModel
|
428
|
+
# @param Title: 诗题,即输入的生成诗词的关键词。
|
429
|
+
# @type Title: String
|
430
|
+
# @param Content: 诗的内容。
|
431
|
+
# @type Content: Array
|
432
|
+
# @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
|
433
|
+
# @type RequestId: String
|
434
|
+
|
435
|
+
attr_accessor :Title, :Content, :RequestId
|
436
|
+
|
437
|
+
def initialize(title=nil, content=nil, requestid=nil)
|
438
|
+
@Title = title
|
439
|
+
@Content = content
|
440
|
+
@RequestId = requestid
|
441
|
+
end
|
442
|
+
|
443
|
+
def deserialize(params)
|
444
|
+
@Title = params['Title']
|
445
|
+
@Content = params['Content']
|
446
|
+
@RequestId = params['RequestId']
|
447
|
+
end
|
448
|
+
end
|
449
|
+
|
213
450
|
# 复合粒度分词和词性标注的结果。
|
214
451
|
class CompoundParticiple < TencentCloud::Common::AbstractModel
|
215
452
|
# @param Word: 基础词。
|
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.
|
4
|
+
version: 3.0.600
|
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-06-
|
11
|
+
date: 2023-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tencentcloud-sdk-common
|