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 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 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.StringgetVersion()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.voidsetVersion(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- theAuthenticatorinstance 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- theAuthenticatorinstance 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- theAnalyzeOptionscontaining the options for the call- Returns:
- a
ServiceCallwith 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- theListModelsOptionscontaining the options for the call- Returns:
- a
ServiceCallwith 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
ServiceCallwith 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- theDeleteModelOptionscontaining the options for the call- Returns:
- a
ServiceCallwith 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- theCreateSentimentModelOptionscontaining the options for the call- Returns:
- a
ServiceCallwith 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- theListSentimentModelsOptionscontaining the options for the call- Returns:
- a
ServiceCallwith a result of typeListSentimentModelsResponse
-
listSentimentModels
List sentiment models.(Beta) Returns all custom sentiment models associated with this service instance.
- Returns:
- a
ServiceCallwith 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- theGetSentimentModelOptionscontaining the options for the call- Returns:
- a
ServiceCallwith 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- theUpdateSentimentModelOptionscontaining the options for the call- Returns:
- a
ServiceCallwith 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- theDeleteSentimentModelOptionscontaining the options for the call- Returns:
- a
ServiceCallwith 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- theCreateCategoriesModelOptionscontaining the options for the call- Returns:
- a
ServiceCallwith 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- theListCategoriesModelsOptionscontaining the options for the call- Returns:
- a
ServiceCallwith a result of typeCategoriesModelList
-
listCategoriesModels
List categories models.(Beta) Returns all custom categories models associated with this service instance.
- Returns:
- a
ServiceCallwith 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- theGetCategoriesModelOptionscontaining the options for the call- Returns:
- a
ServiceCallwith 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- theUpdateCategoriesModelOptionscontaining the options for the call- Returns:
- a
ServiceCallwith 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- theDeleteCategoriesModelOptionscontaining the options for the call- Returns:
- a
ServiceCallwith 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- theCreateClassificationsModelOptionscontaining the options for the call- Returns:
- a
ServiceCallwith 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- theListClassificationsModelsOptionscontaining the options for the call- Returns:
- a
ServiceCallwith 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
ServiceCallwith 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- theGetClassificationsModelOptionscontaining the options for the call- Returns:
- a
ServiceCallwith 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- theUpdateClassificationsModelOptionscontaining the options for the call- Returns:
- a
ServiceCallwith 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- theDeleteClassificationsModelOptionscontaining the options for the call- Returns:
- a
ServiceCallwith a result of typeDeleteModelResults
-