Class NaturalLanguageUnderstanding
public class NaturalLanguageUnderstanding
extends com.ibm.cloud.sdk.core.service.BaseService
You can create [custom models](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-customizing) with Watson Knowledge Studio to detect custom entities and relations in Natural Language Understanding.
- Version:
- v1
- See Also:
- Natural Language Understanding
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_SERVICE_NAME
static String
DEFAULT_SERVICE_URL
Fields inherited from class com.ibm.cloud.sdk.core.service.BaseService
PROPNAME_DISABLE_SSL, PROPNAME_ENABLE_GZIP, PROPNAME_URL
-
Constructor Summary
Constructors Constructor Description NaturalLanguageUnderstanding(String version)
Constructs an instance of the `NaturalLanguageUnderstanding` client.NaturalLanguageUnderstanding(String version, com.ibm.cloud.sdk.core.security.Authenticator authenticator)
Constructs an instance of the `NaturalLanguageUnderstanding` client.NaturalLanguageUnderstanding(String version, String serviceName)
Constructs an instance of the `NaturalLanguageUnderstanding` client.NaturalLanguageUnderstanding(String version, String serviceName, com.ibm.cloud.sdk.core.security.Authenticator authenticator)
Constructs an instance of the `NaturalLanguageUnderstanding` client. -
Method Summary
Modifier and Type Method Description com.ibm.cloud.sdk.core.http.ServiceCall<AnalysisResults>
analyze(AnalyzeOptions analyzeOptions)
Analyze text.com.ibm.cloud.sdk.core.http.ServiceCall<CategoriesModel>
createCategoriesModel(CreateCategoriesModelOptions createCategoriesModelOptions)
Create categories model.com.ibm.cloud.sdk.core.http.ServiceCall<ClassificationsModel>
createClassificationsModel(CreateClassificationsModelOptions createClassificationsModelOptions)
Create classifications model.com.ibm.cloud.sdk.core.http.ServiceCall<SentimentModel>
createSentimentModel(CreateSentimentModelOptions createSentimentModelOptions)
Create sentiment model.com.ibm.cloud.sdk.core.http.ServiceCall<DeleteModelResults>
deleteCategoriesModel(DeleteCategoriesModelOptions deleteCategoriesModelOptions)
Delete categories model.com.ibm.cloud.sdk.core.http.ServiceCall<DeleteModelResults>
deleteClassificationsModel(DeleteClassificationsModelOptions deleteClassificationsModelOptions)
Delete classifications model.com.ibm.cloud.sdk.core.http.ServiceCall<DeleteModelResults>
deleteModel(DeleteModelOptions deleteModelOptions)
Delete model.com.ibm.cloud.sdk.core.http.ServiceCall<DeleteModelResults>
deleteSentimentModel(DeleteSentimentModelOptions deleteSentimentModelOptions)
Delete sentiment model.com.ibm.cloud.sdk.core.http.ServiceCall<CategoriesModel>
getCategoriesModel(GetCategoriesModelOptions getCategoriesModelOptions)
Get categories model details.com.ibm.cloud.sdk.core.http.ServiceCall<ClassificationsModel>
getClassificationsModel(GetClassificationsModelOptions getClassificationsModelOptions)
Get classifications model details.com.ibm.cloud.sdk.core.http.ServiceCall<SentimentModel>
getSentimentModel(GetSentimentModelOptions getSentimentModelOptions)
Get sentiment model details.String
getVersion()
Gets the version.com.ibm.cloud.sdk.core.http.ServiceCall<CategoriesModelList>
listCategoriesModels()
List categories models.com.ibm.cloud.sdk.core.http.ServiceCall<CategoriesModelList>
listCategoriesModels(ListCategoriesModelsOptions listCategoriesModelsOptions)
List categories models.com.ibm.cloud.sdk.core.http.ServiceCall<ListClassificationsModelsResponse>
listClassificationsModels()
List classifications models.com.ibm.cloud.sdk.core.http.ServiceCall<ListClassificationsModelsResponse>
listClassificationsModels(ListClassificationsModelsOptions listClassificationsModelsOptions)
List classifications models.com.ibm.cloud.sdk.core.http.ServiceCall<ListModelsResults>
listModels()
List models.com.ibm.cloud.sdk.core.http.ServiceCall<ListModelsResults>
listModels(ListModelsOptions listModelsOptions)
List models.com.ibm.cloud.sdk.core.http.ServiceCall<ListSentimentModelsResponse>
listSentimentModels()
List sentiment models.com.ibm.cloud.sdk.core.http.ServiceCall<ListSentimentModelsResponse>
listSentimentModels(ListSentimentModelsOptions listSentimentModelsOptions)
List sentiment models.void
setVersion(String version)
Sets the version.com.ibm.cloud.sdk.core.http.ServiceCall<CategoriesModel>
updateCategoriesModel(UpdateCategoriesModelOptions updateCategoriesModelOptions)
Update categories model.com.ibm.cloud.sdk.core.http.ServiceCall<ClassificationsModel>
updateClassificationsModel(UpdateClassificationsModelOptions updateClassificationsModelOptions)
Update classifications model.com.ibm.cloud.sdk.core.http.ServiceCall<SentimentModel>
updateSentimentModel(UpdateSentimentModelOptions updateSentimentModelOptions)
Update sentiment model.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
-
NaturalLanguageUnderstanding
Constructs an instance of the `NaturalLanguageUnderstanding` client. The default service name is used to configure the client instance.- Parameters:
version
- Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is `2021-03-25`.
-
NaturalLanguageUnderstanding
public NaturalLanguageUnderstanding(String version, com.ibm.cloud.sdk.core.security.Authenticator authenticator)Constructs an instance of the `NaturalLanguageUnderstanding` client. The default service name and specified authenticator are used to configure the client instance.- Parameters:
version
- Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is `2021-03-25`.authenticator
- theAuthenticator
instance to be configured for this client
-
NaturalLanguageUnderstanding
Constructs an instance of the `NaturalLanguageUnderstanding` client. The specified service name is used to configure the client instance.- Parameters:
version
- Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is `2021-03-25`.serviceName
- the service name to be used when configuring the client instance
-
NaturalLanguageUnderstanding
public NaturalLanguageUnderstanding(String version, String serviceName, com.ibm.cloud.sdk.core.security.Authenticator authenticator)Constructs an instance of the `NaturalLanguageUnderstanding` client. The specified service name and authenticator are used to configure the client instance.- Parameters:
version
- Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is `2021-03-25`.serviceName
- the service name to be used when configuring the client instanceauthenticator
- theAuthenticator
instance to be configured for this client
-
-
Method Details
-
getVersion
Gets the version.Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is `2021-03-25`.
- Returns:
- the version
-
setVersion
Sets the version.- Parameters:
version
- the new version
-
analyze
public com.ibm.cloud.sdk.core.http.ServiceCall<AnalysisResults> analyze(AnalyzeOptions analyzeOptions)Analyze text.Analyzes text, HTML, or a public webpage for the following features: - Categories - Classifications - Concepts - Emotion - Entities - Keywords - Metadata - Relations - Semantic roles - Sentiment - Syntax - Summarization (Experimental)
If a language for the input text is not specified with the `language` parameter, the service [automatically detects the language](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-detectable-languages).
- Parameters:
analyzeOptions
- theAnalyzeOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeAnalysisResults
-
listModels
public com.ibm.cloud.sdk.core.http.ServiceCall<ListModelsResults> listModels(ListModelsOptions listModelsOptions)List models.Lists Watson Knowledge Studio [custom entities and relations models](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-customizing) that are deployed to your Natural Language Understanding service.
- Parameters:
listModelsOptions
- theListModelsOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeListModelsResults
-
listModels
List models.Lists Watson Knowledge Studio [custom entities and relations models](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-customizing) that are deployed to your Natural Language Understanding service.
- Returns:
- a
ServiceCall
with a result of typeListModelsResults
-
deleteModel
public com.ibm.cloud.sdk.core.http.ServiceCall<DeleteModelResults> deleteModel(DeleteModelOptions deleteModelOptions)Delete model.Deletes a custom model.
- Parameters:
deleteModelOptions
- theDeleteModelOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeDeleteModelResults
-
createSentimentModel
public com.ibm.cloud.sdk.core.http.ServiceCall<SentimentModel> createSentimentModel(CreateSentimentModelOptions createSentimentModelOptions)Create sentiment model.(Beta) Creates a custom sentiment model by uploading training data and associated metadata. The model begins the training and deploying process and is ready to use when the `status` is `available`.
- Parameters:
createSentimentModelOptions
- theCreateSentimentModelOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeSentimentModel
-
listSentimentModels
public com.ibm.cloud.sdk.core.http.ServiceCall<ListSentimentModelsResponse> listSentimentModels(ListSentimentModelsOptions listSentimentModelsOptions)List sentiment models.(Beta) Returns all custom sentiment models associated with this service instance.
- Parameters:
listSentimentModelsOptions
- theListSentimentModelsOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeListSentimentModelsResponse
-
listSentimentModels
List sentiment models.(Beta) Returns all custom sentiment models associated with this service instance.
- Returns:
- a
ServiceCall
with a result of typeListSentimentModelsResponse
-
getSentimentModel
public com.ibm.cloud.sdk.core.http.ServiceCall<SentimentModel> getSentimentModel(GetSentimentModelOptions getSentimentModelOptions)Get sentiment model details.(Beta) Returns the status of the sentiment model with the given model ID.
- Parameters:
getSentimentModelOptions
- theGetSentimentModelOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeSentimentModel
-
updateSentimentModel
public com.ibm.cloud.sdk.core.http.ServiceCall<SentimentModel> updateSentimentModel(UpdateSentimentModelOptions updateSentimentModelOptions)Update sentiment model.(Beta) Overwrites the training data associated with this custom sentiment model and retrains the model. The new model replaces the current deployment.
- Parameters:
updateSentimentModelOptions
- theUpdateSentimentModelOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeSentimentModel
-
deleteSentimentModel
public com.ibm.cloud.sdk.core.http.ServiceCall<DeleteModelResults> deleteSentimentModel(DeleteSentimentModelOptions deleteSentimentModelOptions)Delete sentiment model.(Beta) Un-deploys the custom sentiment model with the given model ID and deletes all associated customer data, including any training data or binary artifacts.
- Parameters:
deleteSentimentModelOptions
- theDeleteSentimentModelOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeDeleteModelResults
-
createCategoriesModel
public com.ibm.cloud.sdk.core.http.ServiceCall<CategoriesModel> createCategoriesModel(CreateCategoriesModelOptions createCategoriesModelOptions)Create categories model.(Beta) Creates a custom categories model by uploading training data and associated metadata. The model begins the training and deploying process and is ready to use when the `status` is `available`.
- Parameters:
createCategoriesModelOptions
- theCreateCategoriesModelOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeCategoriesModel
-
listCategoriesModels
public com.ibm.cloud.sdk.core.http.ServiceCall<CategoriesModelList> listCategoriesModels(ListCategoriesModelsOptions listCategoriesModelsOptions)List categories models.(Beta) Returns all custom categories models associated with this service instance.
- Parameters:
listCategoriesModelsOptions
- theListCategoriesModelsOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeCategoriesModelList
-
listCategoriesModels
List categories models.(Beta) Returns all custom categories models associated with this service instance.
- Returns:
- a
ServiceCall
with a result of typeCategoriesModelList
-
getCategoriesModel
public com.ibm.cloud.sdk.core.http.ServiceCall<CategoriesModel> getCategoriesModel(GetCategoriesModelOptions getCategoriesModelOptions)Get categories model details.(Beta) Returns the status of the categories model with the given model ID.
- Parameters:
getCategoriesModelOptions
- theGetCategoriesModelOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeCategoriesModel
-
updateCategoriesModel
public com.ibm.cloud.sdk.core.http.ServiceCall<CategoriesModel> updateCategoriesModel(UpdateCategoriesModelOptions updateCategoriesModelOptions)Update categories model.(Beta) Overwrites the training data associated with this custom categories model and retrains the model. The new model replaces the current deployment.
- Parameters:
updateCategoriesModelOptions
- theUpdateCategoriesModelOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeCategoriesModel
-
deleteCategoriesModel
public com.ibm.cloud.sdk.core.http.ServiceCall<DeleteModelResults> deleteCategoriesModel(DeleteCategoriesModelOptions deleteCategoriesModelOptions)Delete categories model.(Beta) Un-deploys the custom categories model with the given model ID and deletes all associated customer data, including any training data or binary artifacts.
- Parameters:
deleteCategoriesModelOptions
- theDeleteCategoriesModelOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeDeleteModelResults
-
createClassificationsModel
public com.ibm.cloud.sdk.core.http.ServiceCall<ClassificationsModel> createClassificationsModel(CreateClassificationsModelOptions createClassificationsModelOptions)Create classifications model.(Beta) Creates a custom classifications model by uploading training data and associated metadata. The model begins the training and deploying process and is ready to use when the `status` is `available`.
- Parameters:
createClassificationsModelOptions
- theCreateClassificationsModelOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeClassificationsModel
-
listClassificationsModels
public com.ibm.cloud.sdk.core.http.ServiceCall<ListClassificationsModelsResponse> listClassificationsModels(ListClassificationsModelsOptions listClassificationsModelsOptions)List classifications models.(Beta) Returns all custom classifications models associated with this service instance.
- Parameters:
listClassificationsModelsOptions
- theListClassificationsModelsOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeListClassificationsModelsResponse
-
listClassificationsModels
public com.ibm.cloud.sdk.core.http.ServiceCall<ListClassificationsModelsResponse> listClassificationsModels()List classifications models.(Beta) Returns all custom classifications models associated with this service instance.
- Returns:
- a
ServiceCall
with a result of typeListClassificationsModelsResponse
-
getClassificationsModel
public com.ibm.cloud.sdk.core.http.ServiceCall<ClassificationsModel> getClassificationsModel(GetClassificationsModelOptions getClassificationsModelOptions)Get classifications model details.(Beta) Returns the status of the classifications model with the given model ID.
- Parameters:
getClassificationsModelOptions
- theGetClassificationsModelOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeClassificationsModel
-
updateClassificationsModel
public com.ibm.cloud.sdk.core.http.ServiceCall<ClassificationsModel> updateClassificationsModel(UpdateClassificationsModelOptions updateClassificationsModelOptions)Update classifications model.(Beta) Overwrites the training data associated with this custom classifications model and retrains the model. The new model replaces the current deployment.
- Parameters:
updateClassificationsModelOptions
- theUpdateClassificationsModelOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeClassificationsModel
-
deleteClassificationsModel
public com.ibm.cloud.sdk.core.http.ServiceCall<DeleteModelResults> deleteClassificationsModel(DeleteClassificationsModelOptions deleteClassificationsModelOptions)Delete classifications model.(Beta) Un-deploys the custom classifications model with the given model ID and deletes all associated customer data, including any training data or binary artifacts.
- Parameters:
deleteClassificationsModelOptions
- theDeleteClassificationsModelOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeDeleteModelResults
-