Skip to content

Example 4: Calling an external service/framework for PII detection

In a similar way to example 3, we can write logic to call external services for PII detection. There are two types of external services we support:

  1. Remote services such as a PII detection model hosted somewhere. In this case, the recognizer would do the actual REST request and translate the results to a list of RecognizerResult.
  2. Calling PII models from other frameworks, such as transformers or Flair.

Calling a remote service

  1. Documentation on remote recognizers.

  2. A sample implementation of a remote recognizer.

Calling a model in a different framework

  • This example shows a Presidio wrapper for a Flair model.
  • Using a similar approach, we could create wrappers for HuggingFace models, Conditional Random Fields or any other framework.