Share via


TextAnalyticsClient.ExtractKeyPhrasesAsync Method

Definition

Runs a model to identify a collection of significant phrases found in the passed-in document.

For example, for the document "The food was delicious and there were wonderful staff", the API returns the main talking points: "food" and "wonderful staff".

For a list of languages supported by this operation, see https://aka.ms/talangs.

For document length limits, maximum batch size, and supported text encoding, see https://aka.ms/azsdk/textanalytics/data-limits.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.TextAnalytics.KeyPhraseCollection>> ExtractKeyPhrasesAsync (string document, string language = default, System.Threading.CancellationToken cancellationToken = default);
abstract member ExtractKeyPhrasesAsync : string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.TextAnalytics.KeyPhraseCollection>>
override this.ExtractKeyPhrasesAsync : string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.TextAnalytics.KeyPhraseCollection>>
Public Overridable Function ExtractKeyPhrasesAsync (document As String, Optional language As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of KeyPhraseCollection))

Parameters

document
String

The document to analyze.

language
String

The language that the document is written in. If unspecified, this value will be set to the default language in DefaultLanguage in the request sent to the service. If set to an empty string, the service will apply a model where the language is explicitly set to "None".

cancellationToken
CancellationToken

A CancellationToken controlling the request lifetime.

Returns

A result containing the collection of key phrases identified in the document.

Exceptions

Service returned a non-success status code.

Applies to