TextAnalyticsClient.RecognizePiiEntities(String, String, RecognizePiiEntitiesOptions, CancellationToken) Method

Definition

Runs a predictive model to identify a collection of entities containing Personally Identifiable Information found in the passed-in document, and categorize those entities into types such as US social security number, drivers license number, or credit card number.

For more information on available categories, see https://aka.ms/tanerpii.

For a list of languages supported by this operation, see https://docs.microsoft.com/azure/cognitive-services/text-analytics/language-support.

For document length limits, maximum batch size, and supported text encoding, see https://docs.microsoft.com/azure/cognitive-services/text-analytics/concepts/data-limits?tabs=version-3.

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

Parameters

document
System.String

The document to analyze.

language
System.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".

options
RecognizePiiEntitiesOptions

The additional configurable RecognizePiiEntitiesOptions that may be passed when recognizing PII entities. Options include entity domain filters, model version, and more.

cancellationToken
System.Threading.CancellationToken

A System.Threading.CancellationToken controlling the request lifetime.

Returns

Response<PiiEntityCollection>

A result containing the collection of entities identified in the document, as well as a score indicating the confidence that the entity correctly matches the identified substring.

Exceptions

Service returned a non-success status code.

Remarks

Method is only available for V3_1 and up.

Applies to