Class NaturalLanguageClassifier
java.lang.Object
com.ibm.cloud.sdk.core.service.BaseService
com.ibm.watson.natural_language_classifier.v1.NaturalLanguageClassifier
public class NaturalLanguageClassifier
extends com.ibm.cloud.sdk.core.service.BaseService
IBM Watson™ Natural Language Classifier uses machine learning algorithms to return the
top matching predefined classes for short text input. You create and train a classifier to
connect predefined classes to example texts so that the service can apply those classes to new
inputs.
- Version:
- v1
- See Also:
- Natural Language Classifier
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_SERVICE_NAMEstatic StringDEFAULT_SERVICE_URLFields inherited from class com.ibm.cloud.sdk.core.service.BaseService
PROPNAME_DISABLE_SSL, PROPNAME_ENABLE_GZIP, PROPNAME_URL -
Constructor Summary
Constructors Constructor Description NaturalLanguageClassifier()Constructs an instance of the `NaturalLanguageClassifier` client.NaturalLanguageClassifier(com.ibm.cloud.sdk.core.security.Authenticator authenticator)Constructs an instance of the `NaturalLanguageClassifier` client.NaturalLanguageClassifier(String serviceName)Constructs an instance of the `NaturalLanguageClassifier` client.NaturalLanguageClassifier(String serviceName, com.ibm.cloud.sdk.core.security.Authenticator authenticator)Constructs an instance of the `NaturalLanguageClassifier` client. -
Method Summary
Modifier and Type Method Description com.ibm.cloud.sdk.core.http.ServiceCall<Classification>classify(ClassifyOptions classifyOptions)Classify a phrase.com.ibm.cloud.sdk.core.http.ServiceCall<ClassificationCollection>classifyCollection(ClassifyCollectionOptions classifyCollectionOptions)Classify multiple phrases.com.ibm.cloud.sdk.core.http.ServiceCall<Classifier>createClassifier(CreateClassifierOptions createClassifierOptions)Create classifier.com.ibm.cloud.sdk.core.http.ServiceCall<Void>deleteClassifier(DeleteClassifierOptions deleteClassifierOptions)Delete classifier.com.ibm.cloud.sdk.core.http.ServiceCall<Classifier>getClassifier(GetClassifierOptions getClassifierOptions)Get information about a classifier.com.ibm.cloud.sdk.core.http.ServiceCall<ClassifierList>listClassifiers()List classifiers.com.ibm.cloud.sdk.core.http.ServiceCall<ClassifierList>listClassifiers(ListClassifiersOptions listClassifiersOptions)List classifiers.Methods inherited from class com.ibm.cloud.sdk.core.service.BaseService
configureClient, configureService, constructServiceUrl, constructServiceURL, enableGzipCompression, getAuthenticator, getClient, getEndPoint, getName, getServiceUrl, isJsonMimeType, isJsonPatchMimeType, setClient, setDefaultHeaders, setEndPoint, setServiceUrl, toString
-
Field Details
-
DEFAULT_SERVICE_NAME
- See Also:
- Constant Field Values
-
DEFAULT_SERVICE_URL
- See Also:
- Constant Field Values
-
-
Constructor Details
-
NaturalLanguageClassifier
public NaturalLanguageClassifier()Constructs an instance of the `NaturalLanguageClassifier` client. The default service name is used to configure the client instance. -
NaturalLanguageClassifier
public NaturalLanguageClassifier(com.ibm.cloud.sdk.core.security.Authenticator authenticator)Constructs an instance of the `NaturalLanguageClassifier` client. The default service name and specified authenticator are used to configure the client instance.- Parameters:
authenticator- theAuthenticatorinstance to be configured for this client
-
NaturalLanguageClassifier
Constructs an instance of the `NaturalLanguageClassifier` client. The specified service name is used to configure the client instance.- Parameters:
serviceName- the service name to be used when configuring the client instance
-
NaturalLanguageClassifier
public NaturalLanguageClassifier(String serviceName, com.ibm.cloud.sdk.core.security.Authenticator authenticator)Constructs an instance of the `NaturalLanguageClassifier` client. The specified service name and authenticator are used to configure the client instance.- Parameters:
serviceName- the service name to be used when configuring the client instanceauthenticator- theAuthenticatorinstance to be configured for this client
-
-
Method Details
-
classify
public com.ibm.cloud.sdk.core.http.ServiceCall<Classification> classify(ClassifyOptions classifyOptions)Classify a phrase.Returns label information for the input. The status must be `Available` before you can use the classifier to classify text.
- Parameters:
classifyOptions- theClassifyOptionscontaining the options for the call- Returns:
- a
ServiceCallwith a result of typeClassification
-
classifyCollection
public com.ibm.cloud.sdk.core.http.ServiceCall<ClassificationCollection> classifyCollection(ClassifyCollectionOptions classifyCollectionOptions)Classify multiple phrases.Returns label information for multiple phrases. The status must be `Available` before you can use the classifier to classify text.
Note that classifying Japanese texts is a beta feature.
- Parameters:
classifyCollectionOptions- theClassifyCollectionOptionscontaining the options for the call- Returns:
- a
ServiceCallwith a result of typeClassificationCollection
-
createClassifier
public com.ibm.cloud.sdk.core.http.ServiceCall<Classifier> createClassifier(CreateClassifierOptions createClassifierOptions)Create classifier.Sends data to create and train a classifier and returns information about the new classifier.
- Parameters:
createClassifierOptions- theCreateClassifierOptionscontaining the options for the call- Returns:
- a
ServiceCallwith a result of typeClassifier
-
listClassifiers
public com.ibm.cloud.sdk.core.http.ServiceCall<ClassifierList> listClassifiers(ListClassifiersOptions listClassifiersOptions)List classifiers.Returns an empty array if no classifiers are available.
- Parameters:
listClassifiersOptions- theListClassifiersOptionscontaining the options for the call- Returns:
- a
ServiceCallwith a result of typeClassifierList
-
listClassifiers
List classifiers.Returns an empty array if no classifiers are available.
- Returns:
- a
ServiceCallwith a result of typeClassifierList
-
getClassifier
public com.ibm.cloud.sdk.core.http.ServiceCall<Classifier> getClassifier(GetClassifierOptions getClassifierOptions)Get information about a classifier.Returns status and other information about a classifier.
- Parameters:
getClassifierOptions- theGetClassifierOptionscontaining the options for the call- Returns:
- a
ServiceCallwith a result of typeClassifier
-
deleteClassifier
public com.ibm.cloud.sdk.core.http.ServiceCall<Void> deleteClassifier(DeleteClassifierOptions deleteClassifierOptions)Delete classifier.- Parameters:
deleteClassifierOptions- theDeleteClassifierOptionscontaining the options for the call- Returns:
- a
ServiceCallwith a void result
-