Logo Lanfrica

sjvrensburg/gliner2-sa-names-finetune

Domain:

natural language processing

Record type:

softwaremodel
Creator:
sjv
Host:
Fine-tuning GLiNER2-PII to fix a measured SA-name (isiZulu/isiXhosa/Sesotho/etc.) detection gap # gliner2-sa-names-finetune Fine-tuning GLiNER2-PII (the on-device PII model used by privacy-ext) to close a measured detection gap for South African (isiZulu, isiXhosa, Sesotho, Setswana, Tshivenda, Xitsonga) personal names. ## Background privacy-ext is an on-device PII redactor: a local Rust daemon runs GLiNER2 (205M params, ONNX, 8 fragments) and a browser extension intercepts pastes to offer redacted text. It's a privacy tool, so a name that goes undetected is a real leak, not just a lower score. An eval of 266 labeled cases (6 name-origin groups × 7 sentence contexts) found: - **Overall recall 95.9%** — not a broad failure. - Every non-Western name group underperforms the Western control (100%): Sesotho/Setswana 97.6%, isiZulu 96.4%, Tshivenda/Xitsonga 91.4%, isiXhosa 91.1%. - **The gap is almost entirely concentrated in one context**: bare address/attn-line phrasing (`"Attn: {name}, Unit 4B, Soweto. Please call before delivery."`) scored only **73.7%** recall, while all 6 other contexts (explicit name-cue sentences, billing, form fields, email signatures, narrative, third-person) scored 97-100% across every group. - Within `address_attn` alone: Tshivenda/Xitsonga 40%, isiXhosa 50%, isiZulu 75%. - When a name IS detected, span boundaries are always exact (0 boundary errors) — this is a pure miss/no-miss recall problem, not a subword-fragmentation/boundary problem, despite SA names tokenizing into more subword pieces than Western names. **The task: fine-tune GLiNER2-PII (LoRA) so it reliably detects SA names in short, cue-free, label-style text (address lines, attn lines, delivery labels) — without regressing recall on the contexts and name groups that already work.** ## Task outline 1. **Build the training corpus.** - Pull real SA name lists from liberally-licensed sources (see `docs/DATA_SOURCES.md`) — don't hand-pick names, and don't reuse a tiny ad-hoc list; recall on this task is bottlenecked on name-list size and diversity. - Weight generated examp …