redact

Text redaction — PII detection and masking using a hybrid of distilbert NER for person names and regex for structured identifiers (emails, phone numbers, NHS numbers, UK postcodes, standalone numbers). Lightweight, dependency-minimal, targeting ~98% coverage with flat typed placeholders like [NAME], [EMAIL], etc.

source

Redactor


def Redactor(
    model:str='Davlan/distilbert-base-multilingual-cased-ner-hrl'
):

Detect and mask PII in free text with typed placeholders.