arthrod/gliner-opf-ptbr-pii-v1
gliner-opf-ptbr-pii-v1
Fine-tune of openai/privacy-filter on Brazilian-Portuguese PII, 9-round chunked schedule (3 epochs × 3 saves per epoch). Trained on 914,452 rows of natural-text upstream data (arthrod/oai-pf-ptbr-chunked-v2), evaluated on the same 5,000 PT-BR val set used for the GLiNER models.
Best checkpoint: e3_c3 (final pass) — detection.span typed F1 0.885 (P 0.894 / R 0.876).
Headline performance
opf eval --eval-mode typed on the 5,000-row natural val:
- detection.span typed F1 = 0.885 (P=0.894 R=0.876)
Apples-to-apples vs the GLiNER series (same val, same 24 PT-BR labels, nervaluate)
This model wins partial F1 by +0.01; mmBERT wins exact F1 by +0.017. Roughly tied overall, with different strengths:
opf wins on free-text sensitive descriptors (medical +0.16, organizational +0.34, political +0.24, sexual +0.14, religious +0.04, ethnicity +0.03) mmBERT wins on structured PII + names (first/middle/last names by 0.04–0.16, locations by 0.05–0.14, full address) Both perfect on cpf/rg/pis/credit_card/phone/email/zip (F1 ≥ 0.99)
Learning curve (9-round chunked schedule)
Per-entity F1 (e3_c3, span-typed, top entities)
(Entries with zero gold in val are omitted.)
Training recipe
- Backbone: openai/privacy-filter (8-layer MoE transformer, 128 experts, ~2.7B-equivalent params via top-4 routing)
- Schedule: 3 epochs × 3 saves per epoch (9 sequential
opf train --epochs 1invocations, each on a deterministic 1/3 chunk, resuming from the previous checkpoint) - Optimizer: AdamW, LR 1e-5, weight decay 0.01, max grad norm 1.0
- Batch: 32 windows × 4 grad-accum = effective 128
- Context: n-ctx 256
- Precision: bf16 weights, fp32 accumulators
- Loss: standard CE on BIESO token labels (1 + 72 entities × 4 = 289 token labels)
- Decoding: constrained Viterbi
- Hardware: AMD MI300X single-GPU partition, ROCm 7.2
Dataset
- Train: arthrod/oai-pf-ptbr-chunked-v2 (private) — 914,452 rows, 100% upstream raw text
- 99.8% from
ai4privacy/open-pii-masking-500k-ai4privacy - 100% from
ai4privacy/pii-masking-400k - 84.6% from
arthrod/gliner2-pii-ptbr-reward-split - 93.4% from
nvidia/Nemotron-PII - 4 small spam/phishing sources at 100% (negative evidence)
- 3 sources dropped entirely (schema mismatches, ~18.6k rows)
- Val: same 5,000 PT-BR rows used for the GLiNER models — direct head-to-head comparison
Usage
import opf
# CLI:
# opf redact --checkpoint <download_dir> "text com cpf 123.456.789-09 e telefone (11) 91234-5678"Related
- GLiNER series (same val): mmBERT-small × 3 (partial F1 0.823), ettin-68m-easter-egg (0.682), ettin-32m-easter-egg (0.603)
- Demo: arthrod/gliner-ptbr-pii-demo
- Note: easter-egg label
berco-de-tiradentesis NOT supported here — use the mmBERT-small model for that.
