Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TextAnalyticsClient

Package version

Client class for interacting with Azure Text Analytics.

Hierarchy

  • TextAnalyticsClient

Index

Constructors

constructor

  • Creates an instance of TextAnalyticsClient.

    Example usage:

    import { TextAnalyticsClient, CognitiveServicesCredential } from "@azure/ai-text-analytics";
    
    const client = new TextAnalyticsClient(
       "<service endpoint>",
       new CognitiveServicesCredential("<subscription key>")
    );

    Parameters

    Returns TextAnalyticsClient

Properties

defaultCountryHint

defaultCountryHint: string

The default country hint to use. Defaults to "us".

defaultLanguage

defaultLanguage: string

The default language to use. Defaults to "en".

endpointUrl

endpointUrl: string

The URL to the TextAnalytics endpoint

Methods

analyzeSentiment

detectLanguages

  • Runs a predictive model to determine the language that the passed-in input strings are written in, and returns, for each one, the detected language as well as a score indicating the model's confidence that the inferred language is correct. Scores close to 1 indicate high certainty in the result. 120 languages are supported.

    Parameters

    • inputs: string[]

      A collection of input strings to analyze.

    • Optional countryHint: undefined | string

      Indicates the country of origin for all of the input strings to assist the text analytics model in predicting the language they are written in. If unspecified, this value will be set to the default country hint in TextAnalyticsClientOptions. If set to an empty string, the service will apply a model where the country is explicitly set to "None". The same country hint is applied to all strings in the input collection.

    • Optional options: DetectLanguagesOptions

      Optional parameters for the operation.

    Returns Promise<DetectLanguageResultCollection>

  • Runs a predictive model to determine the language that the passed-in input document are written in, and returns, for each one, the detected language as well as a score indicating the model's confidence that the inferred language is correct. Scores close to 1 indicate high certainty in the result. 120 languages are supported.

    Parameters

    • inputs: DetectLanguageInput[]

      A collection of input documents to analyze.

    • Optional options: DetectLanguagesOptions

      Optional parameters for the operation.

    Returns Promise<DetectLanguageResultCollection>

extractKeyPhrases

recognizeEntities

recognizeLinkedEntities

recognizePiiEntities

Generated using TypeDoc