Class NaturalLanguageUnderstanding

java.lang.Object
com.ibm.cloud.sdk.core.service.BaseService
com.ibm.watson.natural_language_understanding.v1.NaturalLanguageUnderstanding

public class NaturalLanguageUnderstanding
extends com.ibm.cloud.sdk.core.service.BaseService
Analyze various features of text content at scale. Provide text, raw HTML, or a public URL and IBM Watson Natural Language Understanding will give you results for the features you request. The service cleans HTML content before analysis by default, so the results can ignore most advertisements and other unwanted content.

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 Details

  • Constructor Details

    • NaturalLanguageUnderstanding

      public NaturalLanguageUnderstanding​(String version)
      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 - the Authenticator instance to be configured for this client
    • NaturalLanguageUnderstanding

      public NaturalLanguageUnderstanding​(String version, String serviceName)
      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 instance
      authenticator - the Authenticator instance to be configured for this client
  • Method Details

    • getVersion

      public String 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

      public void setVersion​(String version)
      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 - the AnalyzeOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type AnalysisResults
    • 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 - the ListModelsOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type ListModelsResults
    • listModels

      public com.ibm.cloud.sdk.core.http.ServiceCall<ListModelsResults> 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 type ListModelsResults
    • deleteModel

      public com.ibm.cloud.sdk.core.http.ServiceCall<DeleteModelResults> deleteModel​(DeleteModelOptions deleteModelOptions)
      Delete model.

      Deletes a custom model.

      Parameters:
      deleteModelOptions - the DeleteModelOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type DeleteModelResults
    • 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 - the CreateSentimentModelOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type SentimentModel
    • 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 - the ListSentimentModelsOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type ListSentimentModelsResponse
    • listSentimentModels

      public com.ibm.cloud.sdk.core.http.ServiceCall<ListSentimentModelsResponse> listSentimentModels()
      List sentiment models.

      (Beta) Returns all custom sentiment models associated with this service instance.

      Returns:
      a ServiceCall with a result of type ListSentimentModelsResponse
    • 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 - the GetSentimentModelOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type SentimentModel
    • 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 - the UpdateSentimentModelOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type SentimentModel
    • 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 - the DeleteSentimentModelOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type DeleteModelResults
    • 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 - the CreateCategoriesModelOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type CategoriesModel
    • 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 - the ListCategoriesModelsOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type CategoriesModelList
    • listCategoriesModels

      public com.ibm.cloud.sdk.core.http.ServiceCall<CategoriesModelList> listCategoriesModels()
      List categories models.

      (Beta) Returns all custom categories models associated with this service instance.

      Returns:
      a ServiceCall with a result of type CategoriesModelList
    • 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 - the GetCategoriesModelOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type CategoriesModel
    • 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 - the UpdateCategoriesModelOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type CategoriesModel
    • 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 - the DeleteCategoriesModelOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type DeleteModelResults
    • 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 - the CreateClassificationsModelOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type ClassificationsModel
    • 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 - the ListClassificationsModelsOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type ListClassificationsModelsResponse
    • 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 type ListClassificationsModelsResponse
    • 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 - the GetClassificationsModelOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type ClassificationsModel
    • 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 - the UpdateClassificationsModelOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type ClassificationsModel
    • 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 - the DeleteClassificationsModelOptions containing the options for the call
      Returns:
      a ServiceCall with a result of type DeleteModelResults