CoolFace
Modelpublic

angel-gitt/privacy-filter-gbai

sourceHugging Faceapache-2.0updated 7d agoView on Hugging Face
0likes184downloads
Model Card

Privacy Filter ES M1

Spanish-focused PII token classifier derived from `OpenMed/privacy-filter-multilingual-v2`. The 1.4B-parameter backbone and tokenizer are unchanged. Only the final Linear(640 -> 217) BIOES classification head (139,097 parameters) was trained.

Training

  • —Method: frozen-backbone, head-only supervised fine-tuning in FP32.
  • —Train: 7,168 Spanish snippets (3,009 from MEDDOCAN train and 4,159 owned synthetic examples).
  • —Validation: 2,762 Spanish snippets (1,762 from MEDDOCAN dev and 1,000 owned synthetic examples).
  • —One epoch, batch size 16, learning rate 1e-4, seed 1701.
  • —Exact train/validation text overlap: zero after deduplication and quarantine.
  • —MEDDOCAN test, MAPA/EUR-Lex and the English OOD set were evaluation-only.

The small trained head is also included as m1_head.safetensors; the standard model shards contain that head already merged into the base checkpoint.

Evaluation

All results use whitespace-preserving tokenization and constrained BIOES/Viterbi decoding. F1 values below are exact-span untyped / character-level detection.

Evaluation setDocumentsM0M1
MEDDOCAN official test (Spanish clinical)2500.447 / 0.7550.508 / 0.796
Independent English OOD1,2010.501 / 0.7900.531 / 0.777
MAPA/EUR-Lex Spanish legal diagnostic20.265 / 0.3200.492 / 0.631

The MAPA result is only a small diagnostic because the published Spanish subset contains two long documents. It was not used for training M1.

Usage

Install OpenMed's Hugging Face dependencies, then use its privacy-filter runtime so predictions are decoded with the model's BIOES/Viterbi constraints:

python
from openmed import extract_pii

result = extract_pii(
    "Contacte con Ana López en ana.lopez@example.es",
    model_name="angel-gitt/privacy-filter-gbai",
)
for entity in result.entities:
    print(entity.label, entity.text, entity.confidence)

Limitations

This is a research prototype, not a guarantee of complete anonymization or legal compliance. It can miss PII, produce false positives, and infer incorrect span boundaries or categories. The English character-level F1 decreased slightly after Spanish adaptation. High-stakes use requires deterministic checks, a domain-specific held-out evaluation set and human review.

License and attribution

Released under Apache 2.0, following the upstream model. Cite and attribute OpenMed, OpenAI Privacy Filter, MEDDOCAN and the relevant upstream datasets as described in their respective model and dataset cards.