Downloads · 30 days
74
67% of all-time downloads
semprerudi/maschera-ch-v63b
maschera-ch-v63b is a token classification model from semprerudi. Use it when you need labels on individual words, such as names. It is set up for transformers. The card lists the license as mit.
Use it: MASCHERA is the free desktop app (Windows, macOS, Linux, Docker) that runs this model to mask and anonymise personal data in Swiss documents before they go to an AI service. Source: github.com/semprerudi/masch…
Downloads · 30 days
74
67% of all-time downloads
All-time downloads
111
Public
Parameters
308M
1.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.2 GB · 97%
From the Hugging Face model README
Use it: MASCHERA is the free desktop app (Windows, macOS, Linux, Docker) that runs this model to mask and anonymise personal data in Swiss documents before they go to an AI service. Source: github.com/semprerudi/maschera.
Token classification for personal data in Swiss documents in the three national languages German, French and Italian, as well as in English. Rumantsch is not supported.
It labels spans that carry personal data so they can be replaced by placeholders before a text is handed to an AI service.
Sehr geehrte Frau Brülhart -> Sehr geehrte Frau [FULLNAME_1]
AHV 756.1234.5678.97 -> AHV [AHVN13_1]
Lindenstrasse 12, 3011 Bern -> [STREET_1] [BUILDINGNUM_1], [ZIPCODE_1] [CITY_1]
This model is the recognition stage of MASCHERA, a local masking tool for Swiss documents. MASCHERA fetches or bundles exactly this model; it runs on your own device and sends nothing anywhere.
| Base model | jhu-clsp/mmBERT-base (ModernBERT), 22 layers, 308M parameters |
| Task | token classification, BIO |
| Labels | 91 BIO labels over 45 tags, frozen contract b7a96dc9 |
| Context | 512 tokens; longer documents are windowed by the tool |
| Weights | model.safetensors, 1.2 GB |
| Training data | synthetic only — it has never seen a real document |
The tag set covers Swiss identifiers with checksums (AHV, UID, IBAN, QR reference, GLN), addresses, names, dates, and administrative references. The full taxonomy lives in the repository.
Two measurements. Both are here, not only the friendlier one.
| synthetic | gold documents | |
|---|---|---|
| Size | 2000 documents, 29,210 gold spans | 9 documents, 280 gold spans |
| Leak rate | 0.02 % (13 leaks) | 1.27 % (6 leaks) |
| Micro-F1 | 0.997 | 0.736 |
| Over-masking | 84 | 95 |
| Reproducible | yes | no |
The synthetic figure is the reproducible one. Measured with MASCHERA
1.0.1 (python3 tools/mess_synthetisch.py --model runs/ch-v63b --n 2000);
the documents depend on the templates and the generator, so the numbers
change if those change. The documents are
generated from the templates and nomenclatures in the repository; the
values come from a holdout zone, so no value in the measurement was
seen during training. That separates "recognises names" from "memorised a
list" — but it does not replace real documents.
⚠️ The gold documents cannot be recomputed by anyone. They contain real personal data and are not published. There are nine, hand-marked. It is the most honest figure available and the least comfortable one.
⚠️ This test set resolves very little. Earlier evaluations on an older version of the test set (four training runs, each evaluated after epoch 2 and after epoch 3, eight evaluations in total) ranged from 0.769 to 0.833 micro-F1. Two models less than about 0.06 micro-F1 apart (roughly ±0.03) cannot be told apart by it. The 0.736 above was measured on the current test set and is not directly comparable to that range.
⚠️ Over-masking is not a leak. One word too many costs readability; one word too few costs personal data. The model is tuned towards the second.
The leak rate on real documents is around one percent, not zero. Review the masked text before you pass it on. This is pseudonymisation, not anonymisation: as long as the dictionary exists the step is reversible, and under Swiss data protection law the data remain personal data.
Masking personal data in Swiss administrative and business correspondence before it is given to a third-party AI service, with a human reviewing the result. It is a preparation step, not a compliance guarantee.
Not intended for unattended redaction, automated decisions, or as the sole safeguard before publishing a document.
Trained on synthetic data generated from the templates and nomenclatures of the repository. Values are drawn from open Swiss administrative sources (see Data sources below); no real document was used.
| Epochs | 3 |
| Learning rate | 3e-5, linear, warmup 0.1 |
| Batch | 8 × 2 (gradient accumulation) |
| Weight decay | 0.01 |
| Precision | bf16 |
| max_length | 512 |
| Training seed | 4711 |
Read from the run's training_args.bin, not copied from defaults.
⚠️ The seed of the training set is not recorded anywhere. The generator writes it into the header of the dataset it produces, but that file is not published. The path is reproducible; the exact run is not quite.
The generator, the templates and the nomenclatures are in the repository, so a comparable model can be built from scratch.
The nomenclatures come from open Swiss government data. All of them require attribution:
Model weights: MIT.
Built on the idea of rizzo-pii by Simone Rizzo (MIT). No affiliation with that project.