CoolFace
Datasetpublic

rizzoaiacademy/rizzo-pii-it-dataset

rizzo-pii ยท Italian PII dataset ๐Ÿฆ”๐Ÿ›ก๏ธ The training & validation data behind rizzoaiacademy/rizzo-pii-0.3B โ€” a PII token-classification model for Italian legal text, covering 22 categories of personal data including the Italian legal identifiers (codice fiscale, partita IVA, dati catastali) that no other open PII model handles. Everything here serves one goal: anonymize legal documents locally before sending them to a closed LLM (anonymize โ†’ reversible local dictionary โ†’ API โ†’โ€ฆ See the full description on the dataset page: https://huggingface.co/datasets/rizzoaiacademy/rizzo-pii-it-dataset.

sourceHugging Faceotherupdated 2mo agoView on Hugging Face
0likes129downloads
Dataset Card

rizzo-pii ยท Italian PII dataset ๐Ÿฆ”๐Ÿ›ก๏ธ

The training & validation data behind **rizzoaiacademy/rizzo-pii-0.3B** โ€” a PII token-classification model for Italian legal text, covering 22 categories of personal data including the Italian legal identifiers (codice fiscale, partita IVA, dati catastali) that no other open PII model handles.

Everything here serves one goal: anonymize legal documents locally before sending them to a closed LLM (anonymize โ†’ reversible local dictionary โ†’ API โ†’ reconstruction), for law firms and GDPR compliance.


What's in here

FileRowsWhat it isTokensLabels
synthetic/synthetic_pii_it_200k.jsonl200,000Synthetic IT legal docs: LLM-written templates with code-injected, checksum-valid values (CF/PIVA/IBAN). Covers the IT-legal tags.mmBERT subword (##)raw
synthetic/synthetic_pii_it_realaug.jsonl40,000Synthetic entities injected into real Ai4Privacy (it) sentences at varied positions โ€” breaks the template/position correlation.mmBERT subwordraw
synthetic/legal_templates.json72The LLM-authored legal templates (placeholders only, no real PII).โ€”โ€”
processed/deepmount_pii_it_train.jsonl40,788`DeepMount00/pii-masking-ita` remapped to the 22 tags โ€” real context for IBAN/ORG/AMOUNT/plate.word-levelremapped
processed/deepmount_pii_it_test.jsonl10,197DeepMount test split (consumed only by validation).word-levelremapped
validation/validation_real.jsonl7,000The single real Italian validation set. Held-out real text (Ai4Privacy val it + DeepMount test); the 5 IT-legal tags injected into held-out real sentences (real context, no leakage).word-levelremapped
subsets/train_subset_10k.jsonl10,000Stratified multilingual subset for smoke tests / tuning.mmBERT subwordremapped (+language,source)
subsets/val_subset_5k.jsonl5,000Validation subset for smoke tests.mmBERT subwordremapped

Full training pool โ‰ˆ 745k rows is the fusion of these files plus the external [Ai4Privacy `open-pii-masking-500k`](https://huggingface.co/datasets/ai4privacy/open-pii-masking-500k-ai4privacy) (multilingual real PII, ~464k train rows) which is not redistributed here โ€” download it from its own repo. Italian is reinforced to ~45% of the pool; ~38% is synthetic.

Record format

Every .jsonl line is one example with parallel token / BIO arrays:

json
{"tokens": ["Il", "Sig", ".", "Mario", "Rossi", ",", "C", ".", "F", ".", "RSSMRA85M01H501Z"],
 "bio_labels": ["O", "O", "O", "B-FULLNAME", "I-FULLNAME", "O", "O", "O", "O", "O", "B-CF"]}
โš ๏ธ Label encoding differs by file. The two synthetic/* files store raw fine-grained labels (GIVENNAME, SURNAME, PEC, TAXNUM, โ€ฆ). The model's 22-tag taxonomy is applied at load time by TAG_MAP / normalize_labels() in the training script (e.g. GIVENNAME+SURNAMEโ†’FULLNAME, PECโ†’EMAIL, TAXNUMโ†’PIVA, CONTOโ†’IBAN). The processed/, validation/ and subsets/ files are already remapped. This keeps the raw files intact so the taxonomy can change in one place.

The 22-tag taxonomy (after remapping)

FULLNAME, GENDER, AGE, EMAIL, TELEPHONENUM, STREET, BUILDINGNUM, CITY, ZIPCODE, PROVINCE, IBAN, CREDITCARDNUMBER, AMOUNT, CF, PIVA, CATASTO, DOCID, ID_DOC, ORG, DATE, TIME, TARGA โ†’ BIO scheme = 44 label ids (+O).

The 5 IT-legal tags (CF, PIVA, CATASTO, DOCID, PROVINCE) do not exist as real data anywhere โ†’ they come only from the synthetic generators.


Key idea: "LLM as author, code as labeler"

The synthetic data is built by letting an LLM write only the prose with `{SLOT}` placeholders, then code injects the values. This solves three problems at once:

  1. 1.Exact BIO labels โ€” we know precisely where each value was injected.
  2. 2.Mathematically valid checksums โ€” CF, PIVA, IBAN are generated correctly, not hallucinated.
  3. 3.Zero real PII leakage โ€” the LLM never sees or writes a real sensitive value.

How it was used

  • โ€”Training pool: all synthetic + augment + DeepMount train + Ai4Privacy (multilingual).
  • โ€”Validation: validation/validation_real.jsonl only (Italian, real, held-out). DeepMount test is consumed exclusively by validation, never trained on.

Reproduce or retrain with the pipeline in the GitHub repo (src/data_pipeline/ to regenerate, src/training/train_pii.py to train).


Limitations

  • โ€”Synthetic structure bias: tags from templates only (CATASTO, PROVINCE) may learn structure over entity; mitigated with 72 templates + real-text augmentation + DeepMount context.
  • โ€”Italian-only validation (the real use case is the IT legal domain); the 7 non-IT training languages are not validated.
  • โ€”Off-domain DeepMount values: US-style names/addresses โ€” useful for form/context, not as Italian values.
  • โ€”Class imbalance: FULLNAME โ‰ซ CREDITCARDNUMBER (~66ร—).

Licensing

This repo mixes content with different licenses โ€” check the source before redistributing:

  • โ€”*`synthetic/` โ€” original work, MIT** ยฉ 2026 Simone Rizzo / Rizzo AI Academy. Fully synthetic, no real PII.
  • โ€”*`processed/deepmount_** โ€” derived from [DeepMount00/pii-masking-ita`](https://huggingface.co/datasets/DeepMount00/pii-masking-ita); subject to that dataset's license.
  • โ€”`validation/validation_real.jsonl` โ€” built from held-out Ai4Privacy and DeepMount real text; subject to those upstream licenses (Ai4Privacy, DeepMount).
  • โ€”*`subsets/`** โ€” stratified samples that include Ai4Privacy-derived rows; same upstream terms apply.

When in doubt, treat the non-synthetic parts as governed by their upstream licenses and cite the original datasets.

Citation

bibtex
@dataset{rizzo_pii_dataset_2026,
  author = {Simone Rizzo},
  title  = {rizzo-pii: Italian PII training pool for legal-text anonymization},
  year   = {2026},
  url    = {https://huggingface.co/datasets/rizzoaiacademy/rizzo-pii-it-dataset}
}