← Back to portfolio

LIVE DEMO · PII DETECTOR

Redact me.

Type or paste anything below. My fine-tuned DistilBERT model finds names, emails, phone numbers, Social Security numbers, card numbers and IP addresses as you type. It runs entirely in your browser, so nothing you enter ever leaves this page.

Watch it catch personal data in a sample message, or type your own below.
Loading the model (about 63 MB, only the first time)…
0 / 5000
What the model sees
Redact as
 

Found 0 items

    How it works

    01

    Tokenize

    Your text is split into the same word pieces the model was trained on.

    02

    Classify

    A DistilBERT model I fine-tuned labels every piece and gives a confidence score, running on your device with ONNX Runtime.

    03

    Validate

    Card numbers must pass a Luhn checksum and SSNs a format check, the same rule-based safety net used in the full service.

    Use it in your own code

    The model is free, and so is a small Python package that wraps it with the same checks this page uses. Two steps get it running.

    1. Install it

      You need Python 3.9 or newer. Then run this in a terminal:

      pip install chad-pii
    2. Redact some text

      Save this as redact_me.py and run python redact_me.py. The first run downloads the model (about 260 MB) from Hugging Face. After that it works offline, and nothing you redact is sent anywhere.

      from chad_pii import redact, tokenize, restore
      
      text = "Hi, I'm Sarah Johnson. Email sarah.j@example.com or call 6626341142."
      
      print(redact(text))                # labels
      print(redact(text, mode="mask"))   # black bars
      print(redact(text, mode="fake"))   # realistic fake values
      
      safe, key = tokenize(text)         # reversible tokens
      print(safe)
      print(restore(safe, key) == text)

      It prints:

      Hi, I'm [PERSON]. Email [EMAIL] or call [PHONE].
      Hi, I'm █████████████. Email ███████████████████ or call ██████████.
      Hi, I'm Drew Bennett. Email jamie.ellis@example.com or call (202) 555-0184.
      Hi, I'm <PERSON_1>. Email <EMAIL_1> or call <PHONE_1>.
      True

    Use find(text) to get each item's type, position and confidence, or run chad-pii "some text" on the command line. The package checks card numbers with Luhn, IBANs with their bank checksum and SSNs by format, and catches 10-digit phone numbers with a real area code. See chad-pii on PyPI, or use the raw model with transformers from Hugging Face.

    This is a demo of a research model, so it can miss things or flag things by mistake. Please don't rely on it for real compliance work.