Open cumtqiao opened 2 years ago
代码: #include #include <alibabacloud/core/AlibabaCloud.h> #include <alibabacloud/nlp-automl/Nlp_automlClient.h>
using namespace AlibabaCloud; using namespace AlibabaCloud::Nlp_automl;
int main(int argc, char** argv) { // 初始化 SDK AlibabaCloud::InitializeSdk();
// 配置 nlp_automl 实例 ClientConfiguration configuration(""); Nlp_automlClient client("", "", configuration);
// 创建API请求并设置参数 Model::GetPredictResultRequest request; request.setModelId(10281); request.setContent("中华人民共和国解放军");
auto outcome = client.getPredictResult(request); if (!outcome.isSuccess()) { // 异常处理 std::cout << outcome.error().errorCode() << std::endl; AlibabaCloud::ShutdownSdk(); return -1; }
std::cout << "totalCount: " << outcome.result().getContent() << std::endl;
// 关闭 SDK AlibabaCloud::ShutdownSdk(); return 0; }
报错信息:
not integrate the service right,you can try to integrate again.
代码:
include
include <alibabacloud/core/AlibabaCloud.h>
include <alibabacloud/nlp-automl/Nlp_automlClient.h>
using namespace AlibabaCloud; using namespace AlibabaCloud::Nlp_automl;
int main(int argc, char** argv) { // 初始化 SDK AlibabaCloud::InitializeSdk();
// 配置 nlp_automl 实例 ClientConfiguration configuration("");
Nlp_automlClient client("", "", configuration);
// 创建API请求并设置参数 Model::GetPredictResultRequest request; request.setModelId(10281); request.setContent("中华人民共和国解放军");
auto outcome = client.getPredictResult(request); if (!outcome.isSuccess()) { // 异常处理 std::cout << outcome.error().errorCode() << std::endl; AlibabaCloud::ShutdownSdk(); return -1; }
std::cout << "totalCount: " << outcome.result().getContent() << std::endl;
// 关闭 SDK AlibabaCloud::ShutdownSdk(); return 0; }
报错信息:![image](https://user-images.githubusercontent.com/7860898/143544804-d0ebd870-d050-4063-8602-bd1f369be0ce.png)