
L'inverso del filtro privacy di OpenAI: stesso modello 1.5B, restituisce i PII come intervalli strutturati invece di mascherarli.
OpenAI ha rilasciato Privacy Filter — un modello che nasconde i PII nel testo. I difensori lo usano affinché i dati non vengano divulgati.
Ma ogni difesa ha un secondo lato. Anche gli attaccanti hanno bisogno dei PII. Dai log, dump, bucket S3 abbandonati, caselle di posta rubate. Stesso compito: trovare tutto ciò che è personale in un mucchio di testo.
Privacy Filter maschera. Privacy Parser estrae.
Stesso modello, stessa tassonomia delle etichette, stessi pesi. Invece di <REDACTED> ottieni span strutturati — cosa, dove, quale tipo.
Difesa: verifica i tuoi dati prima che vengano divulgati. Offesa: analizza quelli di qualcun altro dopo che lo sono stati.
Lo strumento non sa da che parte stare. È semplicemente un buon parser.
uv venv
uv pip install -e ./privacy-filter
uv pip install -e ./pii_parser
Il primo avvio scarica il checkpoint opf 1.5B (~3 GB) in ~/.opf/privacy_filter/.
from pii_parser.hybrid import HybridPIIParser
parser = HybridPIIParser(device="cpu")
result = parser.parse(
"Hi Quindle Testwick ([email protected] / +1-415-555-0102), "
"account 40702810500001234567, 14 Beautiful Ct, Anytown USA, "
"password Priv4cy-Filt3r-2026."
)
for s in result.spans:
print(f"{s.label:18} {s.text}")
private_person Quindle Testwick
private_email [email protected]
private_phone +1-415-555-0102
account_number 40702810500001234567
private_address 14 Beautiful Ct, Anytown USA
secret Priv4cy-Filt3r-2026
python -m pii_parser.cli_model "Alice paid 40702810500001234567 on 2026-05-17."
Hybrid = modello + span-merge + regex di ripiego. Scegli questo.
Tassonomia opf v2 — 8 categorie:
private_person · private_email · private_phone · private_address ·
private_url · private_date · account_number · secret
text
↓
opf 1.5B → BIOES logits → Viterbi (tuned) → char spans
↓
span-merge (glues Quindle + Testwick)
↓
regex backstop (URL, secret, account — where the model misses)
↓
spans[]
python pii_parser/tests/test_hybrid.py
Fixture F1: 0.929
Scenarios: 8/8 passed
Latency: ~600 ms CPU
Apache-2.0.
| Backend | Weights | Speed | F1 |
|---|
PIIParser | none | µs | 1.000 |
ModelPIIParser | 1.5B | 500 ms CPU | 0.733 |
HybridPIIParser | 1.5B | 600 ms CPU | 0.929 |