Instructions to use aitrainingdatabroker/invoice-pii-detector with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aitrainingdatabroker/invoice-pii-detector with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="aitrainingdatabroker/invoice-pii-detector")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("aitrainingdatabroker/invoice-pii-detector") model = AutoModelForTokenClassification.from_pretrained("aitrainingdatabroker/invoice-pii-detector", device_map="auto") - Notebooks
- Google Colab
- Kaggle
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
- Can you license accounting and ERP records?
- QuickBooks data export for AI licensing
- Can an accounting firm license data to AI?
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
- 24
Model tree for aitrainingdatabroker/invoice-pii-detector
Base model
distilbert/distilroberta-base