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.
IBM is sunsetting Watson Natural Language Understanding Custom Sentiment (BETA). From **June 1, 2023** onward, you will no longer be able to use the Custom Sentiment feature.<br /><br />To ensure we continue providing our clients with robust and powerful text classification capabilities, IBM recently announced the general availability of a new [single-label text classification capability](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-classifications). This new feature includes extended language support and training data customizations suited for building a custom sentiment classifier.<br /><br />If you would like more information or further guidance, please contact IBM Cloud Support.{: deprecated}.
API Version: 1.0 See: https://cloud.ibm.com/docs/natural-language-understanding
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_SERVICE_NAME
Default service name used when configuring the `NaturalLanguageUnderstanding` client.
|
static String |
DEFAULT_SERVICE_URL
Default service endpoint URL.
|
Constructor and 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.
|
Modifier and Type | Method and 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<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<CategoriesModel> |
getCategoriesModel(GetCategoriesModelOptions getCategoriesModelOptions)
Get categories model details.
|
com.ibm.cloud.sdk.core.http.ServiceCall<ClassificationsModel> |
getClassificationsModel(GetClassificationsModelOptions getClassificationsModelOptions)
Get classifications 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<ClassificationsModelList> |
listClassificationsModels()
List classifications models.
|
com.ibm.cloud.sdk.core.http.ServiceCall<ClassificationsModelList> |
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.
|
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.
|
configureClient, configureService, constructServiceUrl, constructServiceURL, disableRetries, enableGzipCompression, enableRetries, getAuthenticator, getClient, getDefaultHeaders, getEndPoint, getName, getServiceUrl, isJsonMimeType, isJsonPatchMimeType, setClient, setDefaultHeaders, setEndPoint, setServiceUrl, toString
public static final String DEFAULT_SERVICE_NAME
public static final String DEFAULT_SERVICE_URL
public NaturalLanguageUnderstanding(String version)
version
- Release date of the API version you want to use. Specify dates in YYYY-MM-DD
format. The current version is `2022-04-07`.public NaturalLanguageUnderstanding(String version, com.ibm.cloud.sdk.core.security.Authenticator authenticator)
version
- Release date of the API version you want to use. Specify dates in YYYY-MM-DD
format. The current version is `2022-04-07`.authenticator
- the Authenticator
instance to be configured for this clientpublic NaturalLanguageUnderstanding(String version, String serviceName)
version
- Release date of the API version you want to use. Specify dates in YYYY-MM-DD
format. The current version is `2022-04-07`.serviceName
- the service name to be used when configuring the client instancepublic NaturalLanguageUnderstanding(String version, String serviceName, com.ibm.cloud.sdk.core.security.Authenticator authenticator)
version
- Release date of the API version you want to use. Specify dates in YYYY-MM-DD
format. The current version is `2022-04-07`.serviceName
- the service name to be used when configuring the client instanceauthenticator
- the Authenticator
instance to be configured for this clientpublic String getVersion()
Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is `2022-04-07`.
public void setVersion(String version)
version
- the new versionpublic com.ibm.cloud.sdk.core.http.ServiceCall<AnalysisResults> analyze(AnalyzeOptions analyzeOptions)
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).
analyzeOptions
- the AnalyzeOptions
containing the options for the callServiceCall
with a result of type AnalysisResults
public com.ibm.cloud.sdk.core.http.ServiceCall<ListModelsResults> listModels(ListModelsOptions listModelsOptions)
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.
listModelsOptions
- the ListModelsOptions
containing the options for the callServiceCall
with a result of type ListModelsResults
public com.ibm.cloud.sdk.core.http.ServiceCall<ListModelsResults> listModels()
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.
ServiceCall
with a result of type ListModelsResults
public com.ibm.cloud.sdk.core.http.ServiceCall<DeleteModelResults> deleteModel(DeleteModelOptions deleteModelOptions)
Deletes a custom model.
deleteModelOptions
- the DeleteModelOptions
containing the options for the callServiceCall
with a result of type DeleteModelResults
public com.ibm.cloud.sdk.core.http.ServiceCall<CategoriesModel> createCategoriesModel(CreateCategoriesModelOptions createCategoriesModelOptions)
(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`.
createCategoriesModelOptions
- the CreateCategoriesModelOptions
containing the
options for the callServiceCall
with a result of type CategoriesModel
public com.ibm.cloud.sdk.core.http.ServiceCall<CategoriesModelList> listCategoriesModels(ListCategoriesModelsOptions listCategoriesModelsOptions)
(Beta) Returns all custom categories models associated with this service instance.
listCategoriesModelsOptions
- the ListCategoriesModelsOptions
containing the
options for the callServiceCall
with a result of type CategoriesModelList
public com.ibm.cloud.sdk.core.http.ServiceCall<CategoriesModelList> listCategoriesModels()
(Beta) Returns all custom categories models associated with this service instance.
ServiceCall
with a result of type CategoriesModelList
public com.ibm.cloud.sdk.core.http.ServiceCall<CategoriesModel> getCategoriesModel(GetCategoriesModelOptions getCategoriesModelOptions)
(Beta) Returns the status of the categories model with the given model ID.
getCategoriesModelOptions
- the GetCategoriesModelOptions
containing the options
for the callServiceCall
with a result of type CategoriesModel
public com.ibm.cloud.sdk.core.http.ServiceCall<CategoriesModel> updateCategoriesModel(UpdateCategoriesModelOptions updateCategoriesModelOptions)
(Beta) Overwrites the training data associated with this custom categories model and retrains the model. The new model replaces the current deployment.
updateCategoriesModelOptions
- the UpdateCategoriesModelOptions
containing the
options for the callServiceCall
with a result of type CategoriesModel
public com.ibm.cloud.sdk.core.http.ServiceCall<DeleteModelResults> deleteCategoriesModel(DeleteCategoriesModelOptions deleteCategoriesModelOptions)
(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.
deleteCategoriesModelOptions
- the DeleteCategoriesModelOptions
containing the
options for the callServiceCall
with a result of type DeleteModelResults
public com.ibm.cloud.sdk.core.http.ServiceCall<ClassificationsModel> createClassificationsModel(CreateClassificationsModelOptions createClassificationsModelOptions)
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`.
createClassificationsModelOptions
- the CreateClassificationsModelOptions
containing the options for the callServiceCall
with a result of type ClassificationsModel
public com.ibm.cloud.sdk.core.http.ServiceCall<ClassificationsModelList> listClassificationsModels(ListClassificationsModelsOptions listClassificationsModelsOptions)
Returns all custom classifications models associated with this service instance.
listClassificationsModelsOptions
- the ListClassificationsModelsOptions
containing
the options for the callServiceCall
with a result of type ClassificationsModelList
public com.ibm.cloud.sdk.core.http.ServiceCall<ClassificationsModelList> listClassificationsModels()
Returns all custom classifications models associated with this service instance.
ServiceCall
with a result of type ClassificationsModelList
public com.ibm.cloud.sdk.core.http.ServiceCall<ClassificationsModel> getClassificationsModel(GetClassificationsModelOptions getClassificationsModelOptions)
Returns the status of the classifications model with the given model ID.
getClassificationsModelOptions
- the GetClassificationsModelOptions
containing the
options for the callServiceCall
with a result of type ClassificationsModel
public com.ibm.cloud.sdk.core.http.ServiceCall<ClassificationsModel> updateClassificationsModel(UpdateClassificationsModelOptions updateClassificationsModelOptions)
Overwrites the training data associated with this custom classifications model and retrains the model. The new model replaces the current deployment.
updateClassificationsModelOptions
- the UpdateClassificationsModelOptions
containing the options for the callServiceCall
with a result of type ClassificationsModel
public com.ibm.cloud.sdk.core.http.ServiceCall<DeleteModelResults> deleteClassificationsModel(DeleteClassificationsModelOptions deleteClassificationsModelOptions)
Un-deploys the custom classifications model with the given model ID and deletes all associated customer data, including any training data or binary artifacts.
deleteClassificationsModelOptions
- the DeleteClassificationsModelOptions
containing the options for the callServiceCall
with a result of type DeleteModelResults
Copyright © 2023 IBM Cloud. All rights reserved.