Invoice PII Detector

Finds personal and account details in invoice and payment text: PERSON, ORG, EMAIL, PHONE, ADDRESS, DATE, MONEY, INVOICE_ID, BANK_ACCOUNT and TAX_ID.

Every name, number and sentence it was trained on is made up. Nothing comes from a real person, customer or business.

Related tool: pii-pattern-scanner (a Space that runs in your browser).

Why it exists

Accounting and ERP records hold names, addresses and account numbers next to the figures an AI lab might value. This model flags the candidates so a person can review them before the records are shared.

Use it

from transformers import pipeline

tagger = pipeline("token-classification", model="aitrainingdatabroker/invoice-pii-detector", aggregation_strategy="simple")
for hit in tagger("Please remit $4,310.00 to account 0048215937 by March 4, 2026 quoting INV-204517."):
    print(hit["entity_group"], hit["word"], round(hit["score"], 3))

How it was trained

Fine-tuned from distilroberta-base for 8 epochs on one RTX 3070. Training data: 280 rows from synthetic-invoice-pii-spans, all invented, with test rows built from templates the model never saw in training. The scripts that built the data and trained the model are in source/; the full scores are in scores.json.

Test scores

Exact entity match on 120 held-out rows: precision 0.943, recall 0.962, F1 0.953.

Type Precision Recall F1 Count
ADDRESS 1.0 1.0 1.0 30
BANK_ACCOUNT 0.591 0.433 0.5 30
DATE 1.0 1.0 1.0 60
EMAIL 1.0 1.0 1.0 30
INVOICE_ID 1.0 1.0 1.0 60
MONEY 1.0 1.0 1.0 60
ORG 1.0 1.0 1.0 60
PERSON 1.0 1.0 1.0 60
PHONE 1.0 1.0 1.0 30
TAX_ID 0.638 1.0 0.779 30

Limits

  • Trained only on invented text from templates, with test sentences built from templates it never saw. Real text varies far more.
  • Single lines, not tables or scanned PDFs. Account and tax numbers in the training data are not real numbers, and real formats vary by country.
  • This model is not legal advice and not a certification. A person should review its output before anything is shared or decided, and your counsel decides what a rule requires.

Read more

License and credit

Apache 2.0. Please credit AI Training Data Broker and link to https://aitrainingdatabroker.com/ when you share or build on it.

About

AI Training Data Broker is a broker and technical advisor for companies that sell or license their data to AI labs. It guides the technical side, including export, format, de-identification and compliance, and publishes free guides, checklists and tools.

Downloads last month
-
Safetensors
Model size
81.5M params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for aitrainingdatabroker/invoice-pii-detector

Finetuned
(808)
this model

Dataset used to train aitrainingdatabroker/invoice-pii-detector

Space using aitrainingdatabroker/invoice-pii-detector 1