Dela via


TextAnalyticsClient.DetectLanguageBatchAsync Method

Definition

Overloads

DetectLanguageBatchAsync(IEnumerable<String>, String, TextAnalyticsRequestOptions, CancellationToken)

Runs a predictive model to determine the language the passed-in documents 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.

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

DetectLanguageBatchAsync(IEnumerable<DetectLanguageInput>, TextAnalyticsRequestOptions, CancellationToken)

Runs a predictive model to determine the language the passed-in documents 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.

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

DetectLanguageBatchAsync(IEnumerable<String>, String, TextAnalyticsRequestOptions, CancellationToken)

Source:
TextAnalyticsClient.cs

Runs a predictive model to determine the language the passed-in documents 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.

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.DetectLanguageResultCollection>> DetectLanguageBatchAsync (System.Collections.Generic.IEnumerable<string> documents, string countryHint = default, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options = default, System.Threading.CancellationToken cancellationToken = default);
abstract member DetectLanguageBatchAsync : seq<string> * string * Azure.AI.TextAnalytics.TextAnalyticsRequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.TextAnalytics.DetectLanguageResultCollection>>
override this.DetectLanguageBatchAsync : seq<string> * string * Azure.AI.TextAnalytics.TextAnalyticsRequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.TextAnalytics.DetectLanguageResultCollection>>
Public Overridable Function DetectLanguageBatchAsync (documents As IEnumerable(Of String), Optional countryHint As String = Nothing, Optional options As TextAnalyticsRequestOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of DetectLanguageResultCollection))

Parameters

documents
IEnumerable<String>

A collection of documents to analyze.

countryHint
String

Indicates the country of origin of all of the documents to assist the model in predicting the language they are written in. If unspecified, this value will be set to the default country hint in DefaultCountryHint in the request sent to the service. To remove this behavior, set to None.

options
TextAnalyticsRequestOptions

TextAnalyticsRequestOptions used to select the version of the predictive model to run, and whether statistics are returned in the response.

cancellationToken
CancellationToken

A CancellationToken controlling the request lifetime.

Returns

A result containing the detected language or an error if the model could not analyze the documents.

Exceptions

DisableServiceLogs is only supported in service API version v3.1 and newer.

Service returned a non-success status code.

Applies to

DetectLanguageBatchAsync(IEnumerable<DetectLanguageInput>, TextAnalyticsRequestOptions, CancellationToken)

Source:
TextAnalyticsClient.cs

Runs a predictive model to determine the language the passed-in documents 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.

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.DetectLanguageResultCollection>> DetectLanguageBatchAsync (System.Collections.Generic.IEnumerable<Azure.AI.TextAnalytics.DetectLanguageInput> documents, Azure.AI.TextAnalytics.TextAnalyticsRequestOptions options = default, System.Threading.CancellationToken cancellationToken = default);
abstract member DetectLanguageBatchAsync : seq<Azure.AI.TextAnalytics.DetectLanguageInput> * Azure.AI.TextAnalytics.TextAnalyticsRequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.TextAnalytics.DetectLanguageResultCollection>>
override this.DetectLanguageBatchAsync : seq<Azure.AI.TextAnalytics.DetectLanguageInput> * Azure.AI.TextAnalytics.TextAnalyticsRequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.TextAnalytics.DetectLanguageResultCollection>>
Public Overridable Function DetectLanguageBatchAsync (documents As IEnumerable(Of DetectLanguageInput), Optional options As TextAnalyticsRequestOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of DetectLanguageResultCollection))

Parameters

documents
IEnumerable<DetectLanguageInput>

A collection of documents to analyze.

options
TextAnalyticsRequestOptions

TextAnalyticsRequestOptions used to select the version of the predictive model to run, and whether statistics are returned in the response.

cancellationToken
CancellationToken

A CancellationToken controlling the request lifetime.

Returns

A result containing the detected language or an error if the model could not analyze the documents.

Exceptions

DisableServiceLogs is only supported in service API version v3.1 and newer.

Service returned a non-success status code.

Applies to