Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NaturalLanguageUnderstandingV1

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. interfaces

You can create custom models with Watson Knowledge Studio to detect custom entities and relations in Natural Language Understanding.

Hierarchy

  • BaseService
    • NaturalLanguageUnderstandingV1

Index

Constructors

constructor

Properties

Static DEFAULT_SERVICE_NAME

DEFAULT_SERVICE_NAME: string = "natural-language-understanding"

Static DEFAULT_SERVICE_URL

DEFAULT_SERVICE_URL: string = "https://api.us-south.natural-language-understanding.watson.cloud.ibm.com"

Methods

analyze

  • Analyze text.

    Analyzes text, HTML, or a public webpage for the following features:

    • Categories
    • Concepts
    • Emotion
    • Entities
    • Keywords
    • Metadata
    • Relations
    • Semantic roles
    • Sentiment
    • Syntax.

    If a language for the input text is not specified with the language parameter, the service automatically detects the language.

    Parameters

    Name Type Attribute Description
    params AnalyzeParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    features Features Specific features to analyze the document for.
    clean boolean Optional Set this to `false` to disable webpage cleaning. For more information about webpage cleaning, see [Analyzing webpages](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-analyzing-webpages).
    fallbackToRaw boolean Optional Whether to use raw HTML content if text cleaning fails.
    headers OutgoingHttpHeaders Optional
    html string Optional The HTML file to analyze. One of the `text`, `html`, or `url` parameters is required.
    language string Optional ISO 639-1 code that specifies the language of your text. This overrides automatic language detection. Language support differs depending on the features you include in your analysis. For more information, see [Language support](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-language-support).
    limitTextCharacters number Optional Sets the maximum number of characters that are processed by the service.
    returnAnalyzedText boolean Optional Whether or not to return the analyzed text.
    text string Optional The plain text to analyze. One of the `text`, `html`, or `url` parameters is required.
    url string Optional The webpage to analyze. One of the `text`, `html`, or `url` parameters is required.
    xpath string Optional An [XPath query](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-analyzing-webpages#xpath) to perform on `html` or `url` input. Results of the query will be appended to the cleaned webpage text before it is analyzed. To analyze only the results of the XPath query, set the `clean` parameter to `false`.
    callback Callback<AnalysisResults> Optional

    Returns Promise<Response<AnalysisResults>>

deleteModel

getAuthenticator

  • getAuthenticator(): any
  • Get the instance of the authenticator set on the service.

    Returns any

listModels

setServiceUrl

  • setServiceUrl(url: string): void
  • Set the service URL to send requests to.

    Parameters

    Name Type Attribute Description
    url string

    The base URL for the service.

    Returns void

Generated using TypeDoc