4 Star 81 Fork 15

tencentcloud/tencentcloud-sdk-java

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
NlpClient.java 4.12 KB
一键复制 编辑 原始数据 按行查看 历史
tencentcloud 提交于 2026-04-17 03:32 +08:00 . release 3.1.1446
/*
* Copyright (c) 2017-2025 Tencent. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.tencentcloudapi.nlp.v20190408;
import java.lang.reflect.Type;
import com.google.gson.JsonSyntaxException;
import com.google.gson.reflect.TypeToken;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.common.AbstractClient;
import com.tencentcloudapi.common.profile.ClientProfile;
import com.tencentcloudapi.common.JsonResponseModel;
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.nlp.v20190408.models.*;
public class NlpClient extends AbstractClient{
private static String endpoint = "nlp.tencentcloudapi.com";
private static String service = "nlp";
private static String version = "2019-04-08";
public NlpClient(Credential credential, String region) {
this(credential, region, new ClientProfile());
}
public NlpClient(Credential credential, String region, ClientProfile profile) {
super(NlpClient.endpoint, NlpClient.version, credential, region, profile);
}
/**
*NLP 技术的句子纠错、情感分析、词法分析 API 接口将于2026年4月15日下线,届时将无法正常调用。为了避免对您的业务造成影响,请您尽快做好相关业务调整。如果您有 NLP 技术的产品需求,推荐您调用[腾讯混元大模型](https://cloud.tencent.com/product/tclm)。
情感分析接口能够对带有情感色彩的主观性文本进行分析、处理、归纳和推理,识别出用户的情感倾向,是积极、中性还是消极,并且提供各自概率。
* @param req AnalyzeSentimentRequest
* @return AnalyzeSentimentResponse
* @throws TencentCloudSDKException
*/
public AnalyzeSentimentResponse AnalyzeSentiment(AnalyzeSentimentRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "AnalyzeSentiment", AnalyzeSentimentResponse.class);
}
/**
*NLP 技术的句子纠错、情感分析、词法分析 API 接口将于2026年4月15日下线,届时将无法正常调用。为了避免对您的业务造成影响,请您尽快做好相关业务调整。如果您有 NLP 技术的产品需求,推荐您调用[腾讯混元大模型](https://cloud.tencent.com/product/tclm)。
通过精准地对文本进行分词、词性标注、命名实体识别等功能,助您更好地理解文本内容,挖掘出潜在的价值信息。
* @param req ParseWordsRequest
* @return ParseWordsResponse
* @throws TencentCloudSDKException
*/
public ParseWordsResponse ParseWords(ParseWordsRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "ParseWords", ParseWordsResponse.class);
}
/**
*NLP 技术的句子纠错、情感分析、词法分析 API 接口将于2026年4月15日下线,届时将无法正常调用。为了避免对您的业务造成影响,请您尽快做好相关业务调整。如果您有 NLP 技术的产品需求,推荐您调用[腾讯混元大模型](https://cloud.tencent.com/product/tclm)。
智能识别并纠正句子中的语法、拼写、用词等错误,确保文本的准确性和可读性。
* @param req SentenceCorrectionRequest
* @return SentenceCorrectionResponse
* @throws TencentCloudSDKException
*/
public SentenceCorrectionResponse SentenceCorrection(SentenceCorrectionRequest req) throws TencentCloudSDKException{
req.setSkipSign(false);
return this.internalRequest(req, "SentenceCorrection", SentenceCorrectionResponse.class);
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tencentcloud/tencentcloud-sdk-java.git
git@gitee.com:tencentcloud/tencentcloud-sdk-java.git
tencentcloud
tencentcloud-sdk-java
tencentcloud-sdk-java
master

搜索帮助