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

IBM Watson - Natural Language Classifier service (Java SDK) - deleteClassifier() method does not delete the classifier

我试图在 IBM Watson 平台的自然语言分类器服务中调用 deleteClassifier() 方法,操作完成但没有删除分类器。这是我的代码和输出:

代码:

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()

调用deleteClassifier

.execute()添加到

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

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

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