public class NaturalLanguageClassifier extends WatsonService
defaultHeaders, JSON_MIME_PATTERN, JSON_PATCH_MIME_PATTERN, MESSAGE_CODE, MESSAGE_ERROR, skipAuthentication, VERSION
Constructor and Description |
---|
NaturalLanguageClassifier()
Instantiates a new `NaturalLanguageClassifier`.
|
NaturalLanguageClassifier(IamOptions iamOptions)
Instantiates a new `NaturalLanguageClassifier` with IAM.
|
NaturalLanguageClassifier(java.lang.String username,
java.lang.String password)
Instantiates a new `NaturalLanguageClassifier` with username and password.
|
Modifier and Type | Method and Description |
---|---|
ServiceCall<Classification> |
classify(ClassifyOptions classifyOptions)
Classify a phrase.
|
ServiceCall<Classification> |
classify(java.lang.String classifierId,
java.lang.String text)
Classify.
|
ServiceCall<ClassificationCollection> |
classifyCollection(ClassifyCollectionOptions classifyCollectionOptions)
Classify multiple phrases.
|
ServiceCall<Classifier> |
createClassifier(CreateClassifierOptions createClassifierOptions)
Create classifier.
|
ServiceCall<Classifier> |
createClassifier(java.lang.String name,
java.lang.String language,
java.io.File trainingData)
Create classifier.
|
ServiceCall<java.lang.Void> |
deleteClassifier(DeleteClassifierOptions deleteClassifierOptions)
Delete classifier.
|
ServiceCall<java.lang.Void> |
deleteClassifier(java.lang.String classifierId)
Delete classifier.
|
ServiceCall<Classifier> |
getClassifier(GetClassifierOptions getClassifierOptions)
Get information about a classifier.
|
ServiceCall<Classifier> |
getClassifier(java.lang.String classifierId)
Get information about a classifier.
|
ServiceCall<ClassifierList> |
getClassifiers()
List classifiers.
|
ServiceCall<ClassifierList> |
listClassifiers()
List classifiers.
|
ServiceCall<ClassifierList> |
listClassifiers(ListClassifiersOptions listClassifiersOptions)
List classifiers.
|
configureClient, configureHttpClient, createServiceCall, getApiKey, getEndPoint, getName, getPassword, getToken, getUsername, isJsonMimeType, isJsonPatchMimeType, isTokenManagerSet, processServiceCall, setApiKey, setAuthentication, setDefaultHeaders, setDefaultHeaders, setEndPoint, setIamCredentials, setSkipAuthentication, setUsernameAndPassword, toString
public NaturalLanguageClassifier()
public NaturalLanguageClassifier(java.lang.String username, java.lang.String password)
username
- the usernamepassword
- the passwordpublic NaturalLanguageClassifier(IamOptions iamOptions)
iamOptions
- the options for authenticating through IAMpublic ServiceCall<Classification> classify(ClassifyOptions classifyOptions)
classifyOptions
- the ClassifyOptions
containing the options for the callServiceCall
with a response type of Classification
public ServiceCall<ClassificationCollection> classifyCollection(ClassifyCollectionOptions classifyCollectionOptions)
classifyCollectionOptions
- the ClassifyCollectionOptions
containing the options for the callServiceCall
with a response type of ClassificationCollection
public ServiceCall<Classifier> createClassifier(CreateClassifierOptions createClassifierOptions)
createClassifierOptions
- the CreateClassifierOptions
containing the options for the callServiceCall
with a response type of Classifier
public ServiceCall<java.lang.Void> deleteClassifier(DeleteClassifierOptions deleteClassifierOptions)
deleteClassifierOptions
- the DeleteClassifierOptions
containing the options for the callServiceCall
with a response type of Voidpublic ServiceCall<Classifier> getClassifier(GetClassifierOptions getClassifierOptions)
getClassifierOptions
- the GetClassifierOptions
containing the options for the callServiceCall
with a response type of Classifier
public ServiceCall<ClassifierList> listClassifiers(ListClassifiersOptions listClassifiersOptions)
listClassifiersOptions
- the ListClassifiersOptions
containing the options for the callServiceCall
with a response type of ClassifierList
public ServiceCall<ClassifierList> listClassifiers()
ServiceCall
with a response type of ClassifierList
public ServiceCall<Classification> classify(java.lang.String classifierId, java.lang.String text)
classifierId
- the classifier IDtext
- the submitted phrase to classifypublic ServiceCall<Classifier> createClassifier(java.lang.String name, java.lang.String language, java.io.File trainingData) throws java.io.FileNotFoundException
name
- the classifier namelanguage
- IETF primary language for the classifier. for example: 'en'trainingData
- the set of questions and their "keys" used to adapt a system to a domain (the ground truth)java.io.FileNotFoundException
- if the file could not be foundpublic ServiceCall<java.lang.Void> deleteClassifier(java.lang.String classifierId)
classifierId
- the classifier IDpublic ServiceCall<Classifier> getClassifier(java.lang.String classifierId)
classifierId
- the classifier IDpublic ServiceCall<ClassifierList> getClassifiers()