A 300-million-parameter guard dog for Italian legal text
It exists so Italian law firms can use ChatGPT on sensitive documents without ever shipping a codice fiscale off their laptop.

What it does
rizzo-pii is a ≈0.3B parameter token-classification model built on an mmBERT/ModernBERT backbone that runs entirely on a CPU. It scans text for 22 categories of personally identifiable information, including Italian-specific legal identifiers like CF, PIVA, and CATASTO, then replaces each hit with a stable placeholder. The mapping between placeholder and real value stays in a local dictionary, so the document can be sent to a cloud LLM, processed, and restored without the sensitive content ever crossing the network.
The interesting bit
The five Italian-legal tags—codice fiscale, VAT number, cadastral data, document IDs, and province codes—do not exist in public NER corpora, so the team synthesized training examples with mathematically valid checksums. That means the model not only recognizes an IBAN or fiscal code by pattern, but can verify it with the same mod-97, Luhn, or official Italian algorithms a bureaucrat would use.
Key highlights
- Reversible pseudonymization, not destructive redaction: the frontier model sees
[FULLNAME_1]and[CF_1], and the real values are swapped back into the answer locally. - Memory footprint is roughly 0.5 GB on CPU—small enough that the “privacy layer” requires no GPU or paid API key.
- Covers 22 PII categories, collapsing legal roles into
FULLNAMEand merging raw variants (PEC →EMAIL, passport/social number →ID_DOC) to keep the taxonomy tight. - Claims a 0.989 micro-F1 on real Italian validation data, though the README does not detail per-category performance.
- Packaged as standalone desktop apps for Windows, macOS, and Linux.
Caveats
- The 0.989 micro-F1 is an aggregate score; per-category precision and recall are not shown, so it is unclear which of the 22 tags are driving performance.
- The
URLtag is caught by regex alone using a closed TLD list, which the authors note will miss exotic domains while it avoids flagging Italian abbreviations likeS.r.l.
Verdict
If you are an Italian professional handling contracts, tax documents, or court filings and want to use ChatGPT without a GDPR panic attack, this is purpose-built for you. Everyone else should probably stick to Presidio or a generic filter unless they specifically need checksum-validated Italian fiscal codes.
Frequently asked
- What is Rizzo-AI-Academy/rizzo-pii?
- It exists so Italian law firms can use ChatGPT on sensitive documents without ever shipping a codice fiscale off their laptop.
- Is rizzo-pii open source?
- Yes — Rizzo-AI-Academy/rizzo-pii is open source, released under the MIT license.
- What language is rizzo-pii written in?
- Rizzo-AI-Academy/rizzo-pii is primarily written in Python.
- How popular is rizzo-pii?
- Rizzo-AI-Academy/rizzo-pii has 568 stars on GitHub.
- Where can I find rizzo-pii?
- Rizzo-AI-Academy/rizzo-pii is on GitHub at https://github.com/Rizzo-AI-Academy/rizzo-pii.