@@ -262,6 +262,10 @@ async def recognize_pii_entities( # type: ignore
262
262
be used for scoring, e.g. "latest", "2019-10-01". If a model-version
263
263
is not specified, the API will default to the latest, non-preview version.
264
264
:keyword bool show_stats: If set to true, response will contain document level statistics.
265
+ :keyword domain_filter: Filters the response entities to ones only included in the specified domain.
266
+ I.e., if set to 'PHI', will only return entities in the Protected Healthcare Information domain.
267
+ See https://aka.ms/tanerpii for more information.
268
+ :paramtype domain_filter: str or ~azure.ai.textanalytics.PiiEntityDomainType
265
269
:return: The combined list of :class:`~azure.ai.textanalytics.RecognizePiiEntitiesResult`
266
270
and :class:`~azure.ai.textanalytics.DocumentError` in the order the original documents
267
271
were passed in.
@@ -283,13 +287,16 @@ async def recognize_pii_entities( # type: ignore
283
287
docs = _validate_input (documents , "language" , language )
284
288
model_version = kwargs .pop ("model_version" , None )
285
289
show_stats = kwargs .pop ("show_stats" , False )
290
+ domain_filter = kwargs .pop ("domain_filter" , None )
291
+
286
292
if self ._string_code_unit :
287
293
kwargs .update ({"string_index_type" : self ._string_code_unit })
288
294
try :
289
295
return await self ._client .entities_recognition_pii (
290
296
documents = docs ,
291
297
model_version = model_version ,
292
298
show_stats = show_stats ,
299
+ domain = domain_filter ,
293
300
cls = kwargs .pop ("cls" , pii_entities_result ),
294
301
** kwargs
295
302
)
0 commit comments