tencentcloud-sdk-nlp 3.0.625 → 3.0.626
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 +0 -709
- data/lib/v20190408/models.rb +228 -1751
- metadata +2 -2
data/lib/v20190408/client.rb
CHANGED
@@ -53,59 +53,6 @@ module TencentCloud
|
|
53
53
|
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
54
54
|
end
|
55
55
|
|
56
|
-
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
57
|
-
|
58
|
-
# 利用人工智能算法,自动抽取文本中的关键信息并生成指定长度的文本摘要。可用于新闻标题生成、科技文献摘要生成和商品评论摘要等。
|
59
|
-
|
60
|
-
# @param request: Request instance for AutoSummarization.
|
61
|
-
# @type request: :class:`Tencentcloud::nlp::V20190408::AutoSummarizationRequest`
|
62
|
-
# @rtype: :class:`Tencentcloud::nlp::V20190408::AutoSummarizationResponse`
|
63
|
-
def AutoSummarization(request)
|
64
|
-
body = send_request('AutoSummarization', request.serialize)
|
65
|
-
response = JSON.parse(body)
|
66
|
-
if response['Response'].key?('Error') == false
|
67
|
-
model = AutoSummarizationResponse.new
|
68
|
-
model.deserialize(response['Response'])
|
69
|
-
model
|
70
|
-
else
|
71
|
-
code = response['Response']['Error']['Code']
|
72
|
-
message = response['Response']['Error']['Message']
|
73
|
-
reqid = response['Response']['RequestId']
|
74
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
75
|
-
end
|
76
|
-
rescue TencentCloud::Common::TencentCloudSDKException => e
|
77
|
-
raise e
|
78
|
-
rescue StandardError => e
|
79
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
80
|
-
end
|
81
|
-
|
82
|
-
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
83
|
-
|
84
|
-
# 闲聊服务基于腾讯领先的NLP引擎能力、数据运算能力和千亿级互联网语料数据的支持,同时集成了广泛的知识问答能力,可实现上百种自定义属性配置,以及儿童语言风格及说话方式,从而让聊天变得更睿智、简单和有趣。
|
85
|
-
|
86
|
-
|
87
|
-
# @param request: Request instance for ChatBot.
|
88
|
-
# @type request: :class:`Tencentcloud::nlp::V20190408::ChatBotRequest`
|
89
|
-
# @rtype: :class:`Tencentcloud::nlp::V20190408::ChatBotResponse`
|
90
|
-
def ChatBot(request)
|
91
|
-
body = send_request('ChatBot', request.serialize)
|
92
|
-
response = JSON.parse(body)
|
93
|
-
if response['Response'].key?('Error') == false
|
94
|
-
model = ChatBotResponse.new
|
95
|
-
model.deserialize(response['Response'])
|
96
|
-
model
|
97
|
-
else
|
98
|
-
code = response['Response']['Error']['Code']
|
99
|
-
message = response['Response']['Error']['Message']
|
100
|
-
reqid = response['Response']['RequestId']
|
101
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
102
|
-
end
|
103
|
-
rescue TencentCloud::Common::TencentCloudSDKException => e
|
104
|
-
raise e
|
105
|
-
rescue StandardError => e
|
106
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
107
|
-
end
|
108
|
-
|
109
56
|
# 文本分类接口能够对用户输入的文章进行自动分类,将其映射到具体的类目上,用户只需要提供待分类的文本,而无需关注具体实现。该功能定义了一套较为完备的[三级分类体系](https://cloud.tencent.com/document/product/271/94286),积累了数百万的语料,经过多轮迭代优化打造了较先进的深度学习模型,以保证效果不断提升。
|
110
57
|
|
111
58
|
# @param request: Request instance for ClassifyContent.
|
@@ -178,214 +125,6 @@ module TencentCloud
|
|
178
125
|
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
179
126
|
end
|
180
127
|
|
181
|
-
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
182
|
-
|
183
|
-
# 根据指定的名称、描述创建自定义词库。
|
184
|
-
|
185
|
-
# @param request: Request instance for CreateDict.
|
186
|
-
# @type request: :class:`Tencentcloud::nlp::V20190408::CreateDictRequest`
|
187
|
-
# @rtype: :class:`Tencentcloud::nlp::V20190408::CreateDictResponse`
|
188
|
-
def CreateDict(request)
|
189
|
-
body = send_request('CreateDict', request.serialize)
|
190
|
-
response = JSON.parse(body)
|
191
|
-
if response['Response'].key?('Error') == false
|
192
|
-
model = CreateDictResponse.new
|
193
|
-
model.deserialize(response['Response'])
|
194
|
-
model
|
195
|
-
else
|
196
|
-
code = response['Response']['Error']['Code']
|
197
|
-
message = response['Response']['Error']['Message']
|
198
|
-
reqid = response['Response']['RequestId']
|
199
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
200
|
-
end
|
201
|
-
rescue TencentCloud::Common::TencentCloudSDKException => e
|
202
|
-
raise e
|
203
|
-
rescue StandardError => e
|
204
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
205
|
-
end
|
206
|
-
|
207
|
-
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
208
|
-
|
209
|
-
# 向指定的词库中添加词条。
|
210
|
-
|
211
|
-
# @param request: Request instance for CreateWordItems.
|
212
|
-
# @type request: :class:`Tencentcloud::nlp::V20190408::CreateWordItemsRequest`
|
213
|
-
# @rtype: :class:`Tencentcloud::nlp::V20190408::CreateWordItemsResponse`
|
214
|
-
def CreateWordItems(request)
|
215
|
-
body = send_request('CreateWordItems', request.serialize)
|
216
|
-
response = JSON.parse(body)
|
217
|
-
if response['Response'].key?('Error') == false
|
218
|
-
model = CreateWordItemsResponse.new
|
219
|
-
model.deserialize(response['Response'])
|
220
|
-
model
|
221
|
-
else
|
222
|
-
code = response['Response']['Error']['Code']
|
223
|
-
message = response['Response']['Error']['Message']
|
224
|
-
reqid = response['Response']['RequestId']
|
225
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
226
|
-
end
|
227
|
-
rescue TencentCloud::Common::TencentCloudSDKException => e
|
228
|
-
raise e
|
229
|
-
rescue StandardError => e
|
230
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
231
|
-
end
|
232
|
-
|
233
|
-
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
234
|
-
|
235
|
-
# 删除自定义词库,会附带相应删除词库包含的所有词条。
|
236
|
-
|
237
|
-
# @param request: Request instance for DeleteDict.
|
238
|
-
# @type request: :class:`Tencentcloud::nlp::V20190408::DeleteDictRequest`
|
239
|
-
# @rtype: :class:`Tencentcloud::nlp::V20190408::DeleteDictResponse`
|
240
|
-
def DeleteDict(request)
|
241
|
-
body = send_request('DeleteDict', request.serialize)
|
242
|
-
response = JSON.parse(body)
|
243
|
-
if response['Response'].key?('Error') == false
|
244
|
-
model = DeleteDictResponse.new
|
245
|
-
model.deserialize(response['Response'])
|
246
|
-
model
|
247
|
-
else
|
248
|
-
code = response['Response']['Error']['Code']
|
249
|
-
message = response['Response']['Error']['Message']
|
250
|
-
reqid = response['Response']['RequestId']
|
251
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
252
|
-
end
|
253
|
-
rescue TencentCloud::Common::TencentCloudSDKException => e
|
254
|
-
raise e
|
255
|
-
rescue StandardError => e
|
256
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
257
|
-
end
|
258
|
-
|
259
|
-
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
260
|
-
|
261
|
-
# 用于删除自定义词库中的词条。
|
262
|
-
|
263
|
-
# @param request: Request instance for DeleteWordItems.
|
264
|
-
# @type request: :class:`Tencentcloud::nlp::V20190408::DeleteWordItemsRequest`
|
265
|
-
# @rtype: :class:`Tencentcloud::nlp::V20190408::DeleteWordItemsResponse`
|
266
|
-
def DeleteWordItems(request)
|
267
|
-
body = send_request('DeleteWordItems', request.serialize)
|
268
|
-
response = JSON.parse(body)
|
269
|
-
if response['Response'].key?('Error') == false
|
270
|
-
model = DeleteWordItemsResponse.new
|
271
|
-
model.deserialize(response['Response'])
|
272
|
-
model
|
273
|
-
else
|
274
|
-
code = response['Response']['Error']['Code']
|
275
|
-
message = response['Response']['Error']['Message']
|
276
|
-
reqid = response['Response']['RequestId']
|
277
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
278
|
-
end
|
279
|
-
rescue TencentCloud::Common::TencentCloudSDKException => e
|
280
|
-
raise e
|
281
|
-
rescue StandardError => e
|
282
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
283
|
-
end
|
284
|
-
|
285
|
-
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
286
|
-
|
287
|
-
# 句法依存分析接口能够分析出句子中词与词之间的相互依存关系,并揭示其句法结构,包括主谓关系、动宾关系、核心关系等等,可用于提取句子主干、提取句子核心词等,在机器翻译、自动问答、知识抽取等领域都有很好的应用。
|
288
|
-
|
289
|
-
# @param request: Request instance for DependencyParsing.
|
290
|
-
# @type request: :class:`Tencentcloud::nlp::V20190408::DependencyParsingRequest`
|
291
|
-
# @rtype: :class:`Tencentcloud::nlp::V20190408::DependencyParsingResponse`
|
292
|
-
def DependencyParsing(request)
|
293
|
-
body = send_request('DependencyParsing', request.serialize)
|
294
|
-
response = JSON.parse(body)
|
295
|
-
if response['Response'].key?('Error') == false
|
296
|
-
model = DependencyParsingResponse.new
|
297
|
-
model.deserialize(response['Response'])
|
298
|
-
model
|
299
|
-
else
|
300
|
-
code = response['Response']['Error']['Code']
|
301
|
-
message = response['Response']['Error']['Message']
|
302
|
-
reqid = response['Response']['RequestId']
|
303
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
304
|
-
end
|
305
|
-
rescue TencentCloud::Common::TencentCloudSDKException => e
|
306
|
-
raise e
|
307
|
-
rescue StandardError => e
|
308
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
309
|
-
end
|
310
|
-
|
311
|
-
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
312
|
-
|
313
|
-
# 根据id或名称查询自定义词库信息。
|
314
|
-
|
315
|
-
# @param request: Request instance for DescribeDict.
|
316
|
-
# @type request: :class:`Tencentcloud::nlp::V20190408::DescribeDictRequest`
|
317
|
-
# @rtype: :class:`Tencentcloud::nlp::V20190408::DescribeDictResponse`
|
318
|
-
def DescribeDict(request)
|
319
|
-
body = send_request('DescribeDict', request.serialize)
|
320
|
-
response = JSON.parse(body)
|
321
|
-
if response['Response'].key?('Error') == false
|
322
|
-
model = DescribeDictResponse.new
|
323
|
-
model.deserialize(response['Response'])
|
324
|
-
model
|
325
|
-
else
|
326
|
-
code = response['Response']['Error']['Code']
|
327
|
-
message = response['Response']['Error']['Message']
|
328
|
-
reqid = response['Response']['RequestId']
|
329
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
330
|
-
end
|
331
|
-
rescue TencentCloud::Common::TencentCloudSDKException => e
|
332
|
-
raise e
|
333
|
-
rescue StandardError => e
|
334
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
335
|
-
end
|
336
|
-
|
337
|
-
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
338
|
-
|
339
|
-
# 返回属于当前用户的所有自定义词库列表。
|
340
|
-
|
341
|
-
# @param request: Request instance for DescribeDicts.
|
342
|
-
# @type request: :class:`Tencentcloud::nlp::V20190408::DescribeDictsRequest`
|
343
|
-
# @rtype: :class:`Tencentcloud::nlp::V20190408::DescribeDictsResponse`
|
344
|
-
def DescribeDicts(request)
|
345
|
-
body = send_request('DescribeDicts', request.serialize)
|
346
|
-
response = JSON.parse(body)
|
347
|
-
if response['Response'].key?('Error') == false
|
348
|
-
model = DescribeDictsResponse.new
|
349
|
-
model.deserialize(response['Response'])
|
350
|
-
model
|
351
|
-
else
|
352
|
-
code = response['Response']['Error']['Code']
|
353
|
-
message = response['Response']['Error']['Message']
|
354
|
-
reqid = response['Response']['RequestId']
|
355
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
356
|
-
end
|
357
|
-
rescue TencentCloud::Common::TencentCloudSDKException => e
|
358
|
-
raise e
|
359
|
-
rescue StandardError => e
|
360
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
361
|
-
end
|
362
|
-
|
363
|
-
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
364
|
-
|
365
|
-
# 依据自定义词库的ID,查询对应的词条信息。
|
366
|
-
|
367
|
-
# @param request: Request instance for DescribeWordItems.
|
368
|
-
# @type request: :class:`Tencentcloud::nlp::V20190408::DescribeWordItemsRequest`
|
369
|
-
# @rtype: :class:`Tencentcloud::nlp::V20190408::DescribeWordItemsResponse`
|
370
|
-
def DescribeWordItems(request)
|
371
|
-
body = send_request('DescribeWordItems', request.serialize)
|
372
|
-
response = JSON.parse(body)
|
373
|
-
if response['Response'].key?('Error') == false
|
374
|
-
model = DescribeWordItemsResponse.new
|
375
|
-
model.deserialize(response['Response'])
|
376
|
-
model
|
377
|
-
else
|
378
|
-
code = response['Response']['Error']['Code']
|
379
|
-
message = response['Response']['Error']['Message']
|
380
|
-
reqid = response['Response']['RequestId']
|
381
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
382
|
-
end
|
383
|
-
rescue TencentCloud::Common::TencentCloudSDKException => e
|
384
|
-
raise e
|
385
|
-
rescue StandardError => e
|
386
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
387
|
-
end
|
388
|
-
|
389
128
|
# 通过计算句子间的语义相似性,帮助您快速找到文本中重复或相似的句子,用于文本聚类、相似问题检索等应用场景。
|
390
129
|
|
391
130
|
# @param request: Request instance for EvaluateSentenceSimilarity.
|
@@ -434,32 +173,6 @@ module TencentCloud
|
|
434
173
|
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
435
174
|
end
|
436
175
|
|
437
|
-
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
438
|
-
|
439
|
-
# 根据用户输入的命题关键词自动生成一副春联,包括上联、下联和横批。(如需开通请联系商务)
|
440
|
-
|
441
|
-
# @param request: Request instance for GenerateCouplet.
|
442
|
-
# @type request: :class:`Tencentcloud::nlp::V20190408::GenerateCoupletRequest`
|
443
|
-
# @rtype: :class:`Tencentcloud::nlp::V20190408::GenerateCoupletResponse`
|
444
|
-
def GenerateCouplet(request)
|
445
|
-
body = send_request('GenerateCouplet', request.serialize)
|
446
|
-
response = JSON.parse(body)
|
447
|
-
if response['Response'].key?('Error') == false
|
448
|
-
model = GenerateCoupletResponse.new
|
449
|
-
model.deserialize(response['Response'])
|
450
|
-
model
|
451
|
-
else
|
452
|
-
code = response['Response']['Error']['Code']
|
453
|
-
message = response['Response']['Error']['Message']
|
454
|
-
reqid = response['Response']['RequestId']
|
455
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
456
|
-
end
|
457
|
-
rescue TencentCloud::Common::TencentCloudSDKException => e
|
458
|
-
raise e
|
459
|
-
rescue StandardError => e
|
460
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
461
|
-
end
|
462
|
-
|
463
176
|
# 提取文本中的关键信息,生成简洁明了的关键句子,便于用户快速获取核心观点。
|
464
177
|
|
465
178
|
# @param request: Request instance for GenerateKeywordSentence.
|
@@ -484,92 +197,6 @@ module TencentCloud
|
|
484
197
|
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
485
198
|
end
|
486
199
|
|
487
|
-
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
488
|
-
|
489
|
-
# 根据用户输入的命题关键词自动生成一首七言律诗或五言律诗。(如需开通请联系商务)
|
490
|
-
|
491
|
-
# @param request: Request instance for GeneratePoetry.
|
492
|
-
# @type request: :class:`Tencentcloud::nlp::V20190408::GeneratePoetryRequest`
|
493
|
-
# @rtype: :class:`Tencentcloud::nlp::V20190408::GeneratePoetryResponse`
|
494
|
-
def GeneratePoetry(request)
|
495
|
-
body = send_request('GeneratePoetry', request.serialize)
|
496
|
-
response = JSON.parse(body)
|
497
|
-
if response['Response'].key?('Error') == false
|
498
|
-
model = GeneratePoetryResponse.new
|
499
|
-
model.deserialize(response['Response'])
|
500
|
-
model
|
501
|
-
else
|
502
|
-
code = response['Response']['Error']['Code']
|
503
|
-
message = response['Response']['Error']['Message']
|
504
|
-
reqid = response['Response']['RequestId']
|
505
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
506
|
-
end
|
507
|
-
rescue TencentCloud::Common::TencentCloudSDKException => e
|
508
|
-
raise e
|
509
|
-
rescue StandardError => e
|
510
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
511
|
-
end
|
512
|
-
|
513
|
-
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
514
|
-
|
515
|
-
# 基于关键词提取平台,通过对文本内容进行深度分析,提取出文本内容中的关键信息,为用户实现诸如新闻内容关键词自动提取、评论关键词提取等提供基础服务。
|
516
|
-
|
517
|
-
# @param request: Request instance for KeywordsExtraction.
|
518
|
-
# @type request: :class:`Tencentcloud::nlp::V20190408::KeywordsExtractionRequest`
|
519
|
-
# @rtype: :class:`Tencentcloud::nlp::V20190408::KeywordsExtractionResponse`
|
520
|
-
def KeywordsExtraction(request)
|
521
|
-
body = send_request('KeywordsExtraction', request.serialize)
|
522
|
-
response = JSON.parse(body)
|
523
|
-
if response['Response'].key?('Error') == false
|
524
|
-
model = KeywordsExtractionResponse.new
|
525
|
-
model.deserialize(response['Response'])
|
526
|
-
model
|
527
|
-
else
|
528
|
-
code = response['Response']['Error']['Code']
|
529
|
-
message = response['Response']['Error']['Message']
|
530
|
-
reqid = response['Response']['RequestId']
|
531
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
532
|
-
end
|
533
|
-
rescue TencentCloud::Common::TencentCloudSDKException => e
|
534
|
-
raise e
|
535
|
-
rescue StandardError => e
|
536
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
537
|
-
end
|
538
|
-
|
539
|
-
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
540
|
-
|
541
|
-
# 词法分析接口提供以下三个功能:
|
542
|
-
|
543
|
-
# 1、智能分词:将连续的自然语言文本,切分成具有语义合理性和完整性的词汇序列;
|
544
|
-
|
545
|
-
# 2、词性标注:为每一个词附上对应的词性,例如名词、代词、形容词、动词等;
|
546
|
-
|
547
|
-
# 3、命名实体识别:快速识别文本中的实体,例如人名、地名、机构名等。
|
548
|
-
|
549
|
-
# 所有的功能均基于千亿级大规模互联网语料进行持续迭代更新,以保证效果不断提升,用户无需担心新词发现、歧义消除、调用性能等问题。目前词法分析已经在泛互联网、金融、政务等不同垂直领域提供业务支持,并取得良好的效果。
|
550
|
-
|
551
|
-
# @param request: Request instance for LexicalAnalysis.
|
552
|
-
# @type request: :class:`Tencentcloud::nlp::V20190408::LexicalAnalysisRequest`
|
553
|
-
# @rtype: :class:`Tencentcloud::nlp::V20190408::LexicalAnalysisResponse`
|
554
|
-
def LexicalAnalysis(request)
|
555
|
-
body = send_request('LexicalAnalysis', request.serialize)
|
556
|
-
response = JSON.parse(body)
|
557
|
-
if response['Response'].key?('Error') == false
|
558
|
-
model = LexicalAnalysisResponse.new
|
559
|
-
model.deserialize(response['Response'])
|
560
|
-
model
|
561
|
-
else
|
562
|
-
code = response['Response']['Error']['Code']
|
563
|
-
message = response['Response']['Error']['Message']
|
564
|
-
reqid = response['Response']['RequestId']
|
565
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
566
|
-
end
|
567
|
-
rescue TencentCloud::Common::TencentCloudSDKException => e
|
568
|
-
raise e
|
569
|
-
rescue StandardError => e
|
570
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
571
|
-
end
|
572
|
-
|
573
200
|
# 通过精准地对文本进行分词、词性标注、命名实体识别等功能,助您更好地理解文本内容,挖掘出潜在的价值信息。
|
574
201
|
|
575
202
|
# @param request: Request instance for ParseWords.
|
@@ -618,32 +245,6 @@ module TencentCloud
|
|
618
245
|
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
619
246
|
end
|
620
247
|
|
621
|
-
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
622
|
-
|
623
|
-
# 查询指定自定义词库中的词条是否存在。
|
624
|
-
|
625
|
-
# @param request: Request instance for SearchWordItems.
|
626
|
-
# @type request: :class:`Tencentcloud::nlp::V20190408::SearchWordItemsRequest`
|
627
|
-
# @rtype: :class:`Tencentcloud::nlp::V20190408::SearchWordItemsResponse`
|
628
|
-
def SearchWordItems(request)
|
629
|
-
body = send_request('SearchWordItems', request.serialize)
|
630
|
-
response = JSON.parse(body)
|
631
|
-
if response['Response'].key?('Error') == false
|
632
|
-
model = SearchWordItemsResponse.new
|
633
|
-
model.deserialize(response['Response'])
|
634
|
-
model
|
635
|
-
else
|
636
|
-
code = response['Response']['Error']['Code']
|
637
|
-
message = response['Response']['Error']['Message']
|
638
|
-
reqid = response['Response']['RequestId']
|
639
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
640
|
-
end
|
641
|
-
rescue TencentCloud::Common::TencentCloudSDKException => e
|
642
|
-
raise e
|
643
|
-
rescue StandardError => e
|
644
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
645
|
-
end
|
646
|
-
|
647
248
|
# 智能识别并纠正句子中的语法、拼写、用词等错误,确保文本的准确性和可读性。
|
648
249
|
|
649
250
|
# @param request: Request instance for SentenceCorrection.
|
@@ -668,176 +269,6 @@ module TencentCloud
|
|
668
269
|
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
669
270
|
end
|
670
271
|
|
671
|
-
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
672
|
-
|
673
|
-
# 句向量接口能够将输入的句子映射成一个固定维度的向量,用来表示这个句子的语义特征,可用于文本聚类、文本相似度、文本分类等任务,能够显著提高它们的效果。
|
674
|
-
|
675
|
-
# 该句向量服务由腾讯云自然语言处理团队联合微信智言团队共同打造,基于千亿级大规模互联网语料并采用Bert等领先的深度神经网络模型训练而成,在腾讯内部诸多业务的NLP任务上实测效果显著。
|
676
|
-
|
677
|
-
# @param request: Request instance for SentenceEmbedding.
|
678
|
-
# @type request: :class:`Tencentcloud::nlp::V20190408::SentenceEmbeddingRequest`
|
679
|
-
# @rtype: :class:`Tencentcloud::nlp::V20190408::SentenceEmbeddingResponse`
|
680
|
-
def SentenceEmbedding(request)
|
681
|
-
body = send_request('SentenceEmbedding', request.serialize)
|
682
|
-
response = JSON.parse(body)
|
683
|
-
if response['Response'].key?('Error') == false
|
684
|
-
model = SentenceEmbeddingResponse.new
|
685
|
-
model.deserialize(response['Response'])
|
686
|
-
model
|
687
|
-
else
|
688
|
-
code = response['Response']['Error']['Code']
|
689
|
-
message = response['Response']['Error']['Message']
|
690
|
-
reqid = response['Response']['RequestId']
|
691
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
692
|
-
end
|
693
|
-
rescue TencentCloud::Common::TencentCloudSDKException => e
|
694
|
-
raise e
|
695
|
-
rescue StandardError => e
|
696
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
697
|
-
end
|
698
|
-
|
699
|
-
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
700
|
-
|
701
|
-
# 情感分析接口能够对带有情感色彩的主观性文本进行分析、处理、归纳和推理,识别出用户的情感倾向,是积极还是消极,并且提供各自概率。
|
702
|
-
|
703
|
-
# 该功能基于千亿级大规模互联网语料和LSTM、BERT等深度神经网络模型进行训练,并持续迭代更新,以保证效果不断提升。
|
704
|
-
|
705
|
-
# @param request: Request instance for SentimentAnalysis.
|
706
|
-
# @type request: :class:`Tencentcloud::nlp::V20190408::SentimentAnalysisRequest`
|
707
|
-
# @rtype: :class:`Tencentcloud::nlp::V20190408::SentimentAnalysisResponse`
|
708
|
-
def SentimentAnalysis(request)
|
709
|
-
body = send_request('SentimentAnalysis', request.serialize)
|
710
|
-
response = JSON.parse(body)
|
711
|
-
if response['Response'].key?('Error') == false
|
712
|
-
model = SentimentAnalysisResponse.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
|
-
|
727
|
-
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
728
|
-
|
729
|
-
# 相似词接口能够基于同义词库及词向量技术,检索出与输入词语在语义上最相似的若干个词语,可广泛用于检索系统、问答系统、文档归档等场景。
|
730
|
-
|
731
|
-
# @param request: Request instance for SimilarWords.
|
732
|
-
# @type request: :class:`Tencentcloud::nlp::V20190408::SimilarWordsRequest`
|
733
|
-
# @rtype: :class:`Tencentcloud::nlp::V20190408::SimilarWordsResponse`
|
734
|
-
def SimilarWords(request)
|
735
|
-
body = send_request('SimilarWords', request.serialize)
|
736
|
-
response = JSON.parse(body)
|
737
|
-
if response['Response'].key?('Error') == false
|
738
|
-
model = SimilarWordsResponse.new
|
739
|
-
model.deserialize(response['Response'])
|
740
|
-
model
|
741
|
-
else
|
742
|
-
code = response['Response']['Error']['Code']
|
743
|
-
message = response['Response']['Error']['Message']
|
744
|
-
reqid = response['Response']['RequestId']
|
745
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
746
|
-
end
|
747
|
-
rescue TencentCloud::Common::TencentCloudSDKException => e
|
748
|
-
raise e
|
749
|
-
rescue StandardError => e
|
750
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
751
|
-
end
|
752
|
-
|
753
|
-
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
754
|
-
|
755
|
-
# 文本分类接口能够对用户输入的文本进行自动分类,将其映射到具体的类目上,用户只需要提供待分类的文本,而无需关注具体实现。
|
756
|
-
|
757
|
-
# 该功能基于千亿级大规模互联网语料和LSTM、BERT等深度神经网络模型进行训练,并持续迭代更新,以保证效果不断提升。
|
758
|
-
|
759
|
-
# 目前已提供:
|
760
|
-
|
761
|
-
# - 通用领域分类体系,二级分类,包括14个分类类目,分别是汽车、科技、健康、体育、旅行、教育、职业、文化、房产、娱乐、女性、奥运、财经以及其他,适用于通用的场景。
|
762
|
-
|
763
|
-
# @param request: Request instance for TextClassification.
|
764
|
-
# @type request: :class:`Tencentcloud::nlp::V20190408::TextClassificationRequest`
|
765
|
-
# @rtype: :class:`Tencentcloud::nlp::V20190408::TextClassificationResponse`
|
766
|
-
def TextClassification(request)
|
767
|
-
body = send_request('TextClassification', request.serialize)
|
768
|
-
response = JSON.parse(body)
|
769
|
-
if response['Response'].key?('Error') == false
|
770
|
-
model = TextClassificationResponse.new
|
771
|
-
model.deserialize(response['Response'])
|
772
|
-
model
|
773
|
-
else
|
774
|
-
code = response['Response']['Error']['Code']
|
775
|
-
message = response['Response']['Error']['Message']
|
776
|
-
reqid = response['Response']['RequestId']
|
777
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
778
|
-
end
|
779
|
-
rescue TencentCloud::Common::TencentCloudSDKException => e
|
780
|
-
raise e
|
781
|
-
rescue StandardError => e
|
782
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
783
|
-
end
|
784
|
-
|
785
|
-
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
786
|
-
|
787
|
-
# 提供对中文文本的自动纠错功能,能够识别输入文本中的错误片段,定位错误并给出正确的文本结果;支持长度不超过2000字符(含标点符号)的长文本纠错。
|
788
|
-
|
789
|
-
# 此功能是基于千亿级大规模互联网语料和LSTM、BERT等深度神经网络模型进行训练,并持续迭代更新,以保证效果不断提升,是搜索引擎、语音识别、内容审核等功能更好运行的基础之一。
|
790
|
-
|
791
|
-
# @param request: Request instance for TextCorrection.
|
792
|
-
# @type request: :class:`Tencentcloud::nlp::V20190408::TextCorrectionRequest`
|
793
|
-
# @rtype: :class:`Tencentcloud::nlp::V20190408::TextCorrectionResponse`
|
794
|
-
def TextCorrection(request)
|
795
|
-
body = send_request('TextCorrection', request.serialize)
|
796
|
-
response = JSON.parse(body)
|
797
|
-
if response['Response'].key?('Error') == false
|
798
|
-
model = TextCorrectionResponse.new
|
799
|
-
model.deserialize(response['Response'])
|
800
|
-
model
|
801
|
-
else
|
802
|
-
code = response['Response']['Error']['Code']
|
803
|
-
message = response['Response']['Error']['Message']
|
804
|
-
reqid = response['Response']['RequestId']
|
805
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
806
|
-
end
|
807
|
-
rescue TencentCloud::Common::TencentCloudSDKException => e
|
808
|
-
raise e
|
809
|
-
rescue StandardError => e
|
810
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
811
|
-
end
|
812
|
-
|
813
|
-
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
814
|
-
|
815
|
-
# 提供对中文文本的自动纠错功能,能够识别输入文本中的错误片段,定位错误并给出正确的文本结果;支持长度不超过128字符(含标点符号)的长文本纠错。
|
816
|
-
|
817
|
-
# 此功能是基于千亿级大规模互联网语料和LSTM、BERT等深度神经网络模型进行训练,并持续迭代更新,以保证效果不断提升,是搜索引擎、语音识别、内容审核等功能更好运行的基础之一。
|
818
|
-
|
819
|
-
# @param request: Request instance for TextCorrectionPro.
|
820
|
-
# @type request: :class:`Tencentcloud::nlp::V20190408::TextCorrectionProRequest`
|
821
|
-
# @rtype: :class:`Tencentcloud::nlp::V20190408::TextCorrectionProResponse`
|
822
|
-
def TextCorrectionPro(request)
|
823
|
-
body = send_request('TextCorrectionPro', request.serialize)
|
824
|
-
response = JSON.parse(body)
|
825
|
-
if response['Response'].key?('Error') == false
|
826
|
-
model = TextCorrectionProResponse.new
|
827
|
-
model.deserialize(response['Response'])
|
828
|
-
model
|
829
|
-
else
|
830
|
-
code = response['Response']['Error']['Code']
|
831
|
-
message = response['Response']['Error']['Message']
|
832
|
-
reqid = response['Response']['RequestId']
|
833
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
834
|
-
end
|
835
|
-
rescue TencentCloud::Common::TencentCloudSDKException => e
|
836
|
-
raise e
|
837
|
-
rescue StandardError => e
|
838
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
839
|
-
end
|
840
|
-
|
841
272
|
# 运用先进的自然语言处理技术,对原始文本进行优化润色,提升文本的通顺性、表达力和语言质量。
|
842
273
|
|
843
274
|
# @param request: Request instance for TextEmbellish.
|
@@ -862,66 +293,6 @@ module TencentCloud
|
|
862
293
|
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
863
294
|
end
|
864
295
|
|
865
|
-
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
866
|
-
|
867
|
-
# 句子相似度接口能够基于深度学习技术来计算一个源句子和多个目标句子的相似度,相似度分值越大的两个句子在语义上越相似。目前仅支持短文本(不超过500字符)的相似度计算,长文本的相似度计算也即将推出。
|
868
|
-
|
869
|
-
# 鉴于句子相似度是一个应用非常广泛的功能,腾讯云自然语言处理团队在Bert等领先的深度神经网络模型的基础上,专门针对文本相似任务进行了优化,并持续迭代更新。基于句子相似度,可以轻松实现诸如文本去重、相似推荐等功能。
|
870
|
-
|
871
|
-
# 接口将以句子数量为单位消耗资源包,而不是调用接口次数为单位。
|
872
|
-
|
873
|
-
# @param request: Request instance for TextSimilarity.
|
874
|
-
# @type request: :class:`Tencentcloud::nlp::V20190408::TextSimilarityRequest`
|
875
|
-
# @rtype: :class:`Tencentcloud::nlp::V20190408::TextSimilarityResponse`
|
876
|
-
def TextSimilarity(request)
|
877
|
-
body = send_request('TextSimilarity', request.serialize)
|
878
|
-
response = JSON.parse(body)
|
879
|
-
if response['Response'].key?('Error') == false
|
880
|
-
model = TextSimilarityResponse.new
|
881
|
-
model.deserialize(response['Response'])
|
882
|
-
model
|
883
|
-
else
|
884
|
-
code = response['Response']['Error']['Code']
|
885
|
-
message = response['Response']['Error']['Message']
|
886
|
-
reqid = response['Response']['RequestId']
|
887
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
888
|
-
end
|
889
|
-
rescue TencentCloud::Common::TencentCloudSDKException => e
|
890
|
-
raise e
|
891
|
-
rescue StandardError => e
|
892
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
893
|
-
end
|
894
|
-
|
895
|
-
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
896
|
-
|
897
|
-
# 句子相似度接口能够基于深度学习技术来计算一个源句子和多个目标句子的相似度,相似度分值越大的两个句子在语义上越相似。目前仅支持短文本(不超过128字符)的相似度计算,长文本的相似度计算也即将推出。
|
898
|
-
|
899
|
-
# 鉴于句子相似度是一个应用非常广泛的功能,腾讯云自然语言处理团队在Bert等领先的深度神经网络模型的基础上,专门针对文本相似任务进行了优化,并持续迭代更新。基于句子相似度,可以轻松实现诸如文本去重、相似推荐等功能。
|
900
|
-
|
901
|
-
# 接口将以句子数量为单位消耗资源包,而不是调用接口次数为单位。
|
902
|
-
|
903
|
-
# @param request: Request instance for TextSimilarityPro.
|
904
|
-
# @type request: :class:`Tencentcloud::nlp::V20190408::TextSimilarityProRequest`
|
905
|
-
# @rtype: :class:`Tencentcloud::nlp::V20190408::TextSimilarityProResponse`
|
906
|
-
def TextSimilarityPro(request)
|
907
|
-
body = send_request('TextSimilarityPro', request.serialize)
|
908
|
-
response = JSON.parse(body)
|
909
|
-
if response['Response'].key?('Error') == false
|
910
|
-
model = TextSimilarityProResponse.new
|
911
|
-
model.deserialize(response['Response'])
|
912
|
-
model
|
913
|
-
else
|
914
|
-
code = response['Response']['Error']['Code']
|
915
|
-
message = response['Response']['Error']['Message']
|
916
|
-
reqid = response['Response']['RequestId']
|
917
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
918
|
-
end
|
919
|
-
rescue TencentCloud::Common::TencentCloudSDKException => e
|
920
|
-
raise e
|
921
|
-
rescue StandardError => e
|
922
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
923
|
-
end
|
924
|
-
|
925
296
|
# 通过自动补全文本片段,帮助用户快速生成高质量、连贯的完整文本,提高创作效率。
|
926
297
|
|
927
298
|
# @param request: Request instance for TextWriting.
|
@@ -946,86 +317,6 @@ module TencentCloud
|
|
946
317
|
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
947
318
|
end
|
948
319
|
|
949
|
-
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
950
|
-
|
951
|
-
# 修改自定义词库元数据信息,包括名称、描述。
|
952
|
-
|
953
|
-
# @param request: Request instance for UpdateDict.
|
954
|
-
# @type request: :class:`Tencentcloud::nlp::V20190408::UpdateDictRequest`
|
955
|
-
# @rtype: :class:`Tencentcloud::nlp::V20190408::UpdateDictResponse`
|
956
|
-
def UpdateDict(request)
|
957
|
-
body = send_request('UpdateDict', request.serialize)
|
958
|
-
response = JSON.parse(body)
|
959
|
-
if response['Response'].key?('Error') == false
|
960
|
-
model = UpdateDictResponse.new
|
961
|
-
model.deserialize(response['Response'])
|
962
|
-
model
|
963
|
-
else
|
964
|
-
code = response['Response']['Error']['Code']
|
965
|
-
message = response['Response']['Error']['Message']
|
966
|
-
reqid = response['Response']['RequestId']
|
967
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
968
|
-
end
|
969
|
-
rescue TencentCloud::Common::TencentCloudSDKException => e
|
970
|
-
raise e
|
971
|
-
rescue StandardError => e
|
972
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
973
|
-
end
|
974
|
-
|
975
|
-
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
976
|
-
|
977
|
-
# 词向量接口能够将输入的词语映射成一个固定维度的词向量,用来表示这个词语的语义特征。词向量是很多自然语言处理技术的基础,能够显著提高它们的效果。
|
978
|
-
|
979
|
-
# 该词向量服务由腾讯知文自然语言处理团队联合腾讯AI Lab共同打造。使用的词向量基于千亿级大规模互联网语料并采用AI Lab自研的DSG算法训练而成,开源的词向量包含800多万中文词汇,在覆盖率、新鲜度及准确性等三方面性能突出。
|
980
|
-
|
981
|
-
# @param request: Request instance for WordEmbedding.
|
982
|
-
# @type request: :class:`Tencentcloud::nlp::V20190408::WordEmbeddingRequest`
|
983
|
-
# @rtype: :class:`Tencentcloud::nlp::V20190408::WordEmbeddingResponse`
|
984
|
-
def WordEmbedding(request)
|
985
|
-
body = send_request('WordEmbedding', request.serialize)
|
986
|
-
response = JSON.parse(body)
|
987
|
-
if response['Response'].key?('Error') == false
|
988
|
-
model = WordEmbeddingResponse.new
|
989
|
-
model.deserialize(response['Response'])
|
990
|
-
model
|
991
|
-
else
|
992
|
-
code = response['Response']['Error']['Code']
|
993
|
-
message = response['Response']['Error']['Message']
|
994
|
-
reqid = response['Response']['RequestId']
|
995
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
996
|
-
end
|
997
|
-
rescue TencentCloud::Common::TencentCloudSDKException => e
|
998
|
-
raise e
|
999
|
-
rescue StandardError => e
|
1000
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
1001
|
-
end
|
1002
|
-
|
1003
|
-
# 因业务调整该接口将于北京时间2023年8月1日0点下线,届时该产品功能将无法正常使用,为了避免对您的业务造成影响,请您尽快做好相关业务调整。详见:https://cloud.tencent.com/document/product/271/90711
|
1004
|
-
|
1005
|
-
# 词相似度接口能够基于词向量技术来计算两个输入词语的余弦相似度,相似度数值越大的两个词语在语义上越相似。
|
1006
|
-
|
1007
|
-
# @param request: Request instance for WordSimilarity.
|
1008
|
-
# @type request: :class:`Tencentcloud::nlp::V20190408::WordSimilarityRequest`
|
1009
|
-
# @rtype: :class:`Tencentcloud::nlp::V20190408::WordSimilarityResponse`
|
1010
|
-
def WordSimilarity(request)
|
1011
|
-
body = send_request('WordSimilarity', request.serialize)
|
1012
|
-
response = JSON.parse(body)
|
1013
|
-
if response['Response'].key?('Error') == false
|
1014
|
-
model = WordSimilarityResponse.new
|
1015
|
-
model.deserialize(response['Response'])
|
1016
|
-
model
|
1017
|
-
else
|
1018
|
-
code = response['Response']['Error']['Code']
|
1019
|
-
message = response['Response']['Error']['Message']
|
1020
|
-
reqid = response['Response']['RequestId']
|
1021
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
1022
|
-
end
|
1023
|
-
rescue TencentCloud::Common::TencentCloudSDKException => e
|
1024
|
-
raise e
|
1025
|
-
rescue StandardError => e
|
1026
|
-
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
1027
|
-
end
|
1028
|
-
|
1029
320
|
|
1030
321
|
end
|
1031
322
|
end
|