IBM WATSON-自然语言分类器服务(Java SDK)-DeleteClalsifier()方法不会删除分类器



我正在尝试在IBM Watson平台中的自然语言分类器服务中调用deleteclalsifier((方法,该操作已完成,但并未删除分类器。这是我的代码和输出:

代码:

NaturalLanguageClassifier service = new NaturalLanguageClassifier();
service.setUsernameAndPassword("xxxxxxx", "yyyyyyy");
System.out.println("Before deleting: ");
Classifier classifier;
classifier = service.getClassifier("90e7acx197-nlc-38920").execute();
System.out.println(classifier);
service.deleteClassifier("90e7acx197-nlc-38920");
System.out.println("After deleting: ");
classifier = service.getClassifier("90e7acx197-nlc-38920").execute();
System.out.println(classifier);

输出:

删除之前:

Apr 18, 2017 7:16:08 PM okhttp3.internal.platform.Platform log
INFO: --> GET https://gateway.watsonplatform.net/natural-language-classifier/api/v1/classifiers/90e7acx197-nlc-38920 http/1.1
Apr 18, 2017 7:16:08 PM okhttp3.internal.platform.Platform log
INFO: <-- 200 OK https://gateway.watsonplatform.net/natural-language-classifier/api/v1/classifiers/90e7acx197-nlc-38920 (167ms, unknown-length body)
{
  "classifier_id": "90e7acx197-nlc-38920",
  "language": "en",
  "name": "TutorialClassifier",
  "status": "Available",
  "created": "2017-04-18T01:26:14.630",
  "status_description": "The classifier instance is now available and is ready to take classifier requests.",
  "url": "https://gateway.watsonplatform.net/natural-language-classifier/api/v1/classifiers/90e7acx197-nlc-38920"
}

删除后:

Apr 18, 2017 7:16:08 PM okhttp3.internal.platform.Platform log
INFO: --> GET https://gateway.watsonplatform.net/natural-language-classifier/api/v1/classifiers/90e7acx197-nlc-38920 http/1.1
Apr 18, 2017 7:16:09 PM okhttp3.internal.platform.Platform log
INFO: <-- 200 OK https://gateway.watsonplatform.net/natural-language-classifier/api/v1/classifiers/90e7acx197-nlc-38920 (142ms, unknown-length body)
{
  "classifier_id": "90e7acx197-nlc-38920",
  "language": "en",
  "name": "TutorialClassifier",
  "status": "Available",
  "created": "2017-04-18T01:26:14.630",
  "status_description": "The classifier instance is now available and is ready to take classifier requests.",
  "url": "https://gateway.watsonplatform.net/natural-language-classifier/api/v1/classifiers/90e7acx197-nlc-38920"
}

拿起_JAVA_OPTIONS: -Xmx512M -Xms512M

我在这里做错了什么?

需要使用.execute()

调用DeleteClalifier

.execute()添加到

service.deleteClassifier("90e7acx197-nlc-38920");

下面的方法将删除您的分类器

service.deleteClassifier("90e7acx197-nlc-38920").execute();

最新更新