TextAnalyticsClient class
Client class for interacting with Azure Text Analytics.
Constructors
Text |
Creates an instance of TextAnalyticsClient. Example usage:
|
Properties
default |
The default country hint to use. Defaults to "us". |
default |
The default language to use. Defaults to "en". |
endpoint |
The URL to the TextAnalytics endpoint |
Methods
analyze |
Runs a predictive model to identify the positive, negative, neutral, or mixed sentiment contained in the input strings, as well as scores indicating the model's confidence in each of the predicted sentiments. Optionally it can also identify targets in the text and assessments about it through opinion mining. For a list of languages supported by this operation, See https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support. |
analyze |
Runs a predictive model to identify the positive, negative or neutral, or mixed sentiment contained in the input documents, as well as scores indicating the model's confidence in each of the predicted sentiments.Optionally it can also identify targets in the text and assessments about it through opinion mining. For a list of languages supported by this operation, See https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support. |
begin |
Submit a collection of text documents for analysis. Specify one or more unique actions to be executed. |
begin |
Submit a collection of text documents for analysis. Specify one or more unique actions to be executed. |
begin |
Start a healthcare analysis operation to recognize healthcare related entities (drugs, conditions, symptoms, etc) and their relations. |
begin |
Start a healthcare analysis operation to recognize healthcare related entities (drugs, conditions, symptoms, etc) and their relations. |
detect |
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. |
detect |
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. |
extract |
Runs a model to identify a collection of significant phrases found in the passed-in input strings. For a list of languages supported by this operation, See https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support. |
extract |
Runs a model to identify a collection of significant phrases found in the passed-in input documents. For a list of languages supported by this operation, See https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support. |
recognize |
Runs a predictive model to identify a collection of named entities in the passed-in input strings, and categorize those entities into types such as person, location, or organization. For more information on available categories, See https://docs.microsoft.com/azure/cognitive-services/Text-Analytics/named-entity-types. For a list of languages supported by this operation, See https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support. |
recognize |
Runs a predictive model to identify a collection of named entities in the passed-in input documents, and categorize those entities into types such as person, location, or organization. For more information on available categories, See https://docs.microsoft.com/azure/cognitive-services/Text-Analytics/named-entity-types. For a list of languages supported by this operation, See https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support. |
recognize |
Runs a predictive model to identify a collection of entities found in the passed-in input strings, and include information linking the entities to their corresponding entries in a well-known knowledge base. For a list of languages supported by this operation, See https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support. |
recognize |
Runs a predictive model to identify a collection of entities found in the passed-in input documents, and include information linking the entities to their corresponding entries in a well-known knowledge base. For a list of languages supported by this operation, See https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support. |
recognize |
Runs a predictive model to identify a collection of entities containing personally identifiable information found in the passed-in input strings, and categorize those entities into types such as US social security number, drivers license number, or credit card number. For a list of languages supported by this operation, See https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/language-support. |
recognize |
Runs a predictive model to identify a collection of entities containing personally identifiable information found in the passed-in input documents, and categorize those entities into types such as US social security number, drivers license number, or credit card number. For a list of languages supported by this operation, See https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/language-support. |
Constructor Details
TextAnalyticsClient(string, TokenCredential | KeyCredential, TextAnalyticsClientOptions)
Creates an instance of TextAnalyticsClient.
Example usage:
import { TextAnalyticsClient, AzureKeyCredential } from "@azure/ai-text-analytics";
const client = new TextAnalyticsClient(
"<service endpoint>",
new AzureKeyCredential("<api key>")
);
new TextAnalyticsClient(endpointUrl: string, credential: TokenCredential | KeyCredential, options?: TextAnalyticsClientOptions)
Parameters
- endpointUrl
-
string
The URL to the TextAnalytics endpoint
- credential
Used to authenticate requests to the service.
- options
- TextAnalyticsClientOptions
Used to configure the TextAnalytics client.
Property Details
defaultCountryHint
The default country hint to use. Defaults to "us".
defaultCountryHint: string
Property Value
string
defaultLanguage
The default language to use. Defaults to "en".
defaultLanguage: string
Property Value
string
endpointUrl
The URL to the TextAnalytics endpoint
endpointUrl: string
Property Value
string
Method Details
analyzeSentiment(string[], string, AnalyzeSentimentOptions)
Runs a predictive model to identify the positive, negative, neutral, or mixed sentiment contained in the input strings, as well as scores indicating the model's confidence in each of the predicted sentiments. Optionally it can also identify targets in the text and assessments about it through opinion mining. For a list of languages supported by this operation,
See https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support.
function analyzeSentiment(documents: string[], language?: string, options?: AnalyzeSentimentOptions): Promise<AnalyzeSentimentResultArray>
Parameters
- documents
-
string[]
The input strings to analyze.
- language
-
string
The language that all the input strings are
written in. If unspecified, this value will be set to the default
language in TextAnalyticsClientOptions
.
If set to an empty string, the service will apply a model
where the lanuage is explicitly set to "None".
- options
- AnalyzeSentimentOptions
Optional parameters that includes enabling opinion mining.
Returns
Promise<AnalyzeSentimentResultArray>
analyzeSentiment(TextDocumentInput[], AnalyzeSentimentOptions)
Runs a predictive model to identify the positive, negative or neutral, or mixed sentiment contained in the input documents, as well as scores indicating the model's confidence in each of the predicted sentiments.Optionally it can also identify targets in the text and assessments about it through opinion mining. For a list of languages supported by this operation,
See https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support.
function analyzeSentiment(documents: TextDocumentInput[], options?: AnalyzeSentimentOptions): Promise<AnalyzeSentimentResultArray>
Parameters
- documents
The input documents to analyze.
- options
- AnalyzeSentimentOptions
Optional parameters that includes enabling opinion mining.
Returns
Promise<AnalyzeSentimentResultArray>
beginAnalyzeActions(string[], TextAnalyticsActions, string, BeginAnalyzeActionsOptions)
Submit a collection of text documents for analysis. Specify one or more unique actions to be executed.
function beginAnalyzeActions(documents: string[], actions: TextAnalyticsActions, language?: string, options?: BeginAnalyzeActionsOptions): Promise<AnalyzeActionsPollerLike>
Parameters
- documents
-
string[]
Collection of documents to analyze
- actions
- TextAnalyticsActions
TextAnalyticsActions to execute.
- language
-
string
The language that all the input strings are
written in. If unspecified, this value will be set to the default
language in TextAnalyticsClientOptions
.
If set to an empty string, the service will apply a model
where the language is explicitly set to "None".
- options
- BeginAnalyzeActionsOptions
Options for the operation.
Returns
Promise<AnalyzeActionsPollerLike>
beginAnalyzeActions(TextDocumentInput[], TextAnalyticsActions, BeginAnalyzeActionsOptions)
Submit a collection of text documents for analysis. Specify one or more unique actions to be executed.
function beginAnalyzeActions(documents: TextDocumentInput[], actions: TextAnalyticsActions, options?: BeginAnalyzeActionsOptions): Promise<AnalyzeActionsPollerLike>
Parameters
- documents
Collection of documents to analyze
- actions
- TextAnalyticsActions
TextAnalyticsActions to execute.
- options
- BeginAnalyzeActionsOptions
Options for the operation.
Returns
Promise<AnalyzeActionsPollerLike>
beginAnalyzeHealthcareEntities(string[], string, BeginAnalyzeHealthcareEntitiesOptions)
Start a healthcare analysis operation to recognize healthcare related entities (drugs, conditions, symptoms, etc) and their relations.
function beginAnalyzeHealthcareEntities(documents: string[], language?: string, options?: BeginAnalyzeHealthcareEntitiesOptions): Promise<AnalyzeHealthcareEntitiesPollerLike>
Parameters
- documents
-
string[]
Collection of documents to analyze.
- language
-
string
The language that all the input strings are
written in. If unspecified, this value will be set to the default
language in TextAnalyticsClientOptions
.
If set to an empty string, the service will apply a model
where the language is explicitly set to "None".
Options for the operation.
Returns
Promise<AnalyzeHealthcareEntitiesPollerLike>
beginAnalyzeHealthcareEntities(TextDocumentInput[], BeginAnalyzeHealthcareEntitiesOptions)
Start a healthcare analysis operation to recognize healthcare related entities (drugs, conditions, symptoms, etc) and their relations.
function beginAnalyzeHealthcareEntities(documents: TextDocumentInput[], options?: BeginAnalyzeHealthcareEntitiesOptions): Promise<AnalyzeHealthcareEntitiesPollerLike>
Parameters
- documents
Collection of documents to analyze.
Options for the operation.
Returns
Promise<AnalyzeHealthcareEntitiesPollerLike>
detectLanguage(DetectLanguageInput[], DetectLanguageOptions)
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.
function detectLanguage(documents: DetectLanguageInput[], options?: DetectLanguageOptions): Promise<DetectLanguageResultArray>
Parameters
- documents
A collection of input documents to analyze.
- options
- DetectLanguageOptions
Optional parameters for the operation.
Returns
Promise<DetectLanguageResultArray>
detectLanguage(string[], string, DetectLanguageOptions)
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.
function detectLanguage(documents: string[], countryHint?: string, options?: DetectLanguageOptions): Promise<DetectLanguageResultArray>
Parameters
- documents
-
string[]
A collection of input strings to analyze.
- countryHint
-
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, or the string "none", the service will apply a
model where the country is explicitly unset.
The same country hint is applied to all strings in the input collection.
- options
- DetectLanguageOptions
Optional parameters for the operation.
Returns
Promise<DetectLanguageResultArray>
extractKeyPhrases(string[], string, ExtractKeyPhrasesOptions)
Runs a model to identify a collection of significant phrases found in the passed-in input strings. For a list of languages supported by this operation,
See https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support.
function extractKeyPhrases(documents: string[], language?: string, options?: ExtractKeyPhrasesOptions): Promise<ExtractKeyPhrasesResultArray>
Parameters
- documents
-
string[]
The input strings to analyze.
- language
-
string
The language that all the input strings are
written in. If unspecified, this value will be set to the default
language in TextAnalyticsClientOptions
.
If set to an empty string, the service will apply a model
where the language is explicitly set to "None".
- options
- ExtractKeyPhrasesOptions
Options for the operation.
Returns
Promise<ExtractKeyPhrasesResultArray>
extractKeyPhrases(TextDocumentInput[], ExtractKeyPhrasesOptions)
Runs a model to identify a collection of significant phrases found in the passed-in input documents. For a list of languages supported by this operation,
See https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support.
function extractKeyPhrases(documents: TextDocumentInput[], options?: ExtractKeyPhrasesOptions): Promise<ExtractKeyPhrasesResultArray>
Parameters
- documents
The input documents to analyze.
- options
- ExtractKeyPhrasesOptions
Options for the operation.
Returns
Promise<ExtractKeyPhrasesResultArray>
recognizeEntities(string[], string, RecognizeCategorizedEntitiesOptions)
Runs a predictive model to identify a collection of named entities in the passed-in input strings, and categorize those entities into types such as person, location, or organization. For more information on available categories,
See https://docs.microsoft.com/azure/cognitive-services/Text-Analytics/named-entity-types. For a list of languages supported by this operation, See https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support.
function recognizeEntities(documents: string[], language?: string, options?: RecognizeCategorizedEntitiesOptions): Promise<RecognizeCategorizedEntitiesResultArray>
Parameters
- documents
-
string[]
The input strings to analyze.
- language
-
string
The language that all the input strings are
written in. If unspecified, this value will be set to the default
language in TextAnalyticsClientOptions
.
If set to an empty string, the service will apply a model
where the language is explicitly set to "None".
Optional parameters for the operation.
Returns
recognizeEntities(TextDocumentInput[], RecognizeCategorizedEntitiesOptions)
Runs a predictive model to identify a collection of named entities in the passed-in input documents, and categorize those entities into types such as person, location, or organization. For more information on available categories,
See https://docs.microsoft.com/azure/cognitive-services/Text-Analytics/named-entity-types. For a list of languages supported by this operation, See https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support.
function recognizeEntities(documents: TextDocumentInput[], options?: RecognizeCategorizedEntitiesOptions): Promise<RecognizeCategorizedEntitiesResultArray>
Parameters
- documents
The input documents to analyze.
Optional parameters for the operation.
Returns
recognizeLinkedEntities(string[], string, RecognizeLinkedEntitiesOptions)
Runs a predictive model to identify a collection of entities found in the passed-in input strings, and include information linking the entities to their corresponding entries in a well-known knowledge base. For a list of languages supported by this operation,
See https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support.
function recognizeLinkedEntities(documents: string[], language?: string, options?: RecognizeLinkedEntitiesOptions): Promise<RecognizeLinkedEntitiesResultArray>
Parameters
- documents
-
string[]
The input strings to analyze.
- language
-
string
The language that all the input strings are
written in. If unspecified, this value will be set to the default
language in TextAnalyticsClientOptions
.
If set to an empty string, the service will apply a model
where the language is explicitly set to "None".
- options
- RecognizeLinkedEntitiesOptions
Options for the operation.
Returns
Promise<RecognizeLinkedEntitiesResultArray>
recognizeLinkedEntities(TextDocumentInput[], RecognizeLinkedEntitiesOptions)
Runs a predictive model to identify a collection of entities found in the passed-in input documents, and include information linking the entities to their corresponding entries in a well-known knowledge base. For a list of languages supported by this operation,
See https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support.
function recognizeLinkedEntities(documents: TextDocumentInput[], options?: RecognizeLinkedEntitiesOptions): Promise<RecognizeLinkedEntitiesResultArray>
Parameters
- documents
The input documents to analyze.
- options
- RecognizeLinkedEntitiesOptions
Options for the operation.
Returns
Promise<RecognizeLinkedEntitiesResultArray>
recognizePiiEntities(string[], string, RecognizePiiEntitiesOptions)
Runs a predictive model to identify a collection of entities containing personally identifiable information found in the passed-in input strings, and categorize those entities into types such as US social security number, drivers license number, or credit card number. For a list of languages supported by this operation,
See https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/language-support.
function recognizePiiEntities(inputs: string[], language?: string, options?: RecognizePiiEntitiesOptions): Promise<RecognizePiiEntitiesResultArray>
Parameters
- inputs
-
string[]
The input strings to analyze.
- language
-
string
The language that all the input strings are
written in. If unspecified, this value will be set to the default
language in TextAnalyticsClientOptions
.
If set to an empty string, the service will apply a model
where the language is explicitly set to "None".
- options
- RecognizePiiEntitiesOptions
Options for the operation.
Returns
Promise<RecognizePiiEntitiesResultArray>
recognizePiiEntities(TextDocumentInput[], RecognizePiiEntitiesOptions)
Runs a predictive model to identify a collection of entities containing personally identifiable information found in the passed-in input documents, and categorize those entities into types such as US social security number, drivers license number, or credit card number. For a list of languages supported by this operation,
See https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/language-support.
function recognizePiiEntities(inputs: TextDocumentInput[], options?: RecognizePiiEntitiesOptions): Promise<RecognizePiiEntitiesResultArray>
Parameters
- inputs
The input documents to analyze.
- options
- RecognizePiiEntitiesOptions
Optional parameters for the operation.
Returns
Promise<RecognizePiiEntitiesResultArray>