Veil NER nano
Veil NER nano finds personal information in Ghanaian text, so it can be masked before the text leaves your systems. It reads English, Twi, Fante, Ga, Ewe and Ghanaian Pidgin, and the way people mix them, and it knows Ghanaian identifiers such as Ghana Card PINs, mobile money numbers and GhanaPost GPS addresses.
It is 56 MB and runs on an ordinary CPU, taking about 40 ms for a kilobyte of text on a single thread of a 2020 Apple M1 with 8 GB of memory, so it can sit in front of every request without a GPU. It is the fast model of Dekka Veil, built by Dekka in Accra. Its larger sibling, veil-ner-deep, is more precise on Twi and Ewe names and suits batch work.
Run it
pip install onnxruntime tokenizers numpy pyyaml huggingface_hub
from huggingface_hub import snapshot_download
import importlib.util
path = snapshot_download("dekka-cloud/veil-ner-nano")
spec = importlib.util.spec_from_file_location("veil_ner", f"{path}/veil_ner.py")
veil_ner = importlib.util.module_from_spec(spec); spec.loader.exec_module(veil_ner)
model = veil_ner.VeilNER(path)
for span in model("Me din de Akosua Mensah, patient PT-204118. Frษ me wษ 024 412 3456."):
print(span)
# {'label': 'PERSON_NAME', 'start': 10, 'end': 23, 'text': 'Akosua Mensah', 'score': 1.0}
# {'label': 'PATIENT_ID', 'start': 33, 'end': 42, 'text': 'PT-204118', 'score': 0.9994}
# {'label': 'GH_MOBILE_NUMBER', 'start': 54, 'end': 66, 'text': '024 412 3456', 'score': 0.9999}
Or from the command line, after downloading the repository: python veil_ner.py "Me din de Akosua Mensah, patient PT-204118".
veil_ner.py needs nothing but ONNX Runtime, the tokenizers library and NumPy. It reads manifest.yaml for the labels, the tokenizer window and the confidence threshold (0.82), and decodes the model's output exactly as Dekka Veil does, span for span. Long text is read in overlapping windows of 256 tokens, and each returned span has a label, character offsets, the text and a confidence score.
Running both models
Each model is its own directory with the same files, so the same code loads either one. Load nano where someone waits on the answer, such as a gateway in front of an AI model, and veil-ner-deep for documents and transcripts processed in batches, where its extra precision on names is worth the time.
nano = veil_ner.VeilNER(snapshot_download("dekka-cloud/veil-ner-nano"))
deep = veil_ner.VeilNER(snapshot_download("dekka-cloud/veil-ner-deep"))
What it finds
| Kind | Labels |
|---|---|
| People | PERSON_NAME, PERSON_ALIAS, ACCOUNT_HOLDER_NAME |
| Where they live | ADDRESS (free-text addresses and directions), GH_DIGITAL_ADDRESS (GhanaPost GPS) |
| How to reach them | GH_MOBILE_NUMBER, GH_LANDLINE_NUMBER, EMAIL_ADDRESS, IP_ADDRESS |
| National and financial identifiers | GH_GHANA_CARD_PIN, GH_TAX_IDENTIFIER, BANK_ACCOUNT_NUMBER, PAYMENT_CARD_PAN, GH_VEHICLE_REGISTRATION |
| Institutional IDs | PATIENT_ID, STUDENT_ID, EMPLOYEE_ID |
Phone numbers read aloud as words in English, Akan or Ewe count as phone numbers. A place named on its own, such as "Kumasi", isn't labelled, because on its own it identifies nobody. Organisations' switchboard numbers and the plates of public buses aren't personal either, and while the model alone sometimes flags them, Dekka Veil's rules drop them.
How it compares
We measured Veil against the two general-purpose open tools people reach for, Presidio, which is rule-based, and GLiNER PII small, an open-weights model, run zero-shot at its threshold of 0.5. All three read the same sets on the same machine.
| Set | Measure | Veil NER nano | GLiNER PII small | Presidio |
|---|---|---|---|---|
| Synthetic Ghanaian test, 3,000 records | Details covered in full | 91.2% | 68.6% | 70.7% |
| Characters left readable | 2.8% | 37.9% | 35.8% | |
| Real Ghanaian call sentences with synthetic details, 600 records | Details covered in full | 100% | 48.8% | 74.0% |
| Characters left readable | 0% | 69.0% | 48.1% | |
| Decoys wrongly flagged, of 88 | 0 | 0 | 67 | |
| Real call transcripts, 497 sentences | Names found, of 15 | 11 | 0 | 15 |
| Things wrongly flagged as personal | 0 | 3 | 255 |
On every Ghanaian set we measured, Veil covers more personal information and leaves far less of it readable than the general-purpose tools, and it does it in 56 MB on a CPU. On the real transcripts, GLiNER found none of the names, and Presidio found them all only by flagging 255 ordinary words along with them.
Real Twi and Ewe news. On the test split of MasakhaNER 2.0, real news text with names labelled by people, the model finds 78.0% of Twi names at 43.2% precision and 82.8% of Ewe names at 66.9% precision. In Twi it errs toward flagging: more than half of what it calls a Twi name isn't one, which is the safer mistake for privacy, and veil-ner-deep is the more precise choice there.
With Dekka Veil's rules
Inside Dekka Veil the model runs beside rules that validate the structured identifiers it also finds. Together they do better than either alone, and the rules drop the switchboard numbers and bus plates the model sometimes flags on its own.
| Set | Measure | Model alone | Model with Veil's rules |
|---|---|---|---|
| Synthetic Ghanaian test | Details covered in full | 91.2% | 96.7% |
| Characters left readable | 2.8% | 1.1% | |
| Decoys wrongly flagged, of 471 | 187 | 5 | |
| Real call sentences with synthetic details | Details covered in full | 100% | 100% |
The rules are part of Dekka Veil, which runs in Dekka's AI Gateway. This repository holds the model.
How we measured
Every figure on this card comes from one evaluation run on 5 November 2026, and we report it per set so no single blended number hides a weakness.
- Details covered in full is the share of personal details whose every character the model covered. A name half-masked still gives the person away, so partial cover doesn't count.
- Characters left readable is the share of the characters of personal details that stayed visible. It is what a reader would still see.
- Decoys are things that look personal and aren't, such as a hospital's switchboard number, a bus plate in a news report or a product code. Flagging them is a false alarm.
The four sets are different kinds of evidence, and we read each for what it is.
- Synthetic Ghanaian test (veil-synth-gh v0.3, 3,000 records). Banking, mobile money, health, education, government, support chats and prompts to AI assistants, with every name and identifier generated, in sentence shapes training never saw. It is the widest test, and it flatters every tool, because its templates were written by the same people as the training templates.
- Real call sentences with synthetic details (600 records). Real sentences from banking and airtime call transcripts that training never saw, with synthetic names and numbers written in. The 100% is partly by construction, because the details were written in the way training wrote them, so it shows the model reads this kind of speech rather than proving it can't miss.
- Real call transcripts (497 sentences). Real transcripts in Ghanaian languages whose 15 names we labelled ourselves. No native speaker has reviewed those labels yet, so we call them silver.
- MasakhaNER 2.0 test (real Twi and Ewe news). The only real text with labels made by native speakers. It labels names and places, so it measures names alone.
The confidence threshold was chosen on held-out validation text, real call sentences and MasakhaNER's development split, never on any test set, so the test figures weren't tuned on.
How it was trained
The model is a two-layer student of DeBERTa-v3-xsmall that keeps the first and last of its twelve layers. It was fine-tuned on veil-synth-gh v0.3, then taught by a larger teacher, AfroXLMR-base, which had first read Ghanaian-language web text and the call transcripts to learn how Twi, Ewe, Ga and Fante are written. The teacher labelled 20,073 passages of unlabelled Twi, Ewe, Ga and Fante text for the student to learn from, alongside 33,000 extra synthetic records. Distillation weighted the teacher's predictions at 0.7, at temperature 2, over four epochs.
Training used PyTorch 2.8 and Transformers 5.22.1, batch 32, AdamW with 6% warmup, bf16 and seed 20261104. The checkpoint was chosen by the mean of overlap F1 on synthetic validation text and on held-out real call sentences, and dynamic int8 quantisation shrank it to 56 MB.
Compute and cost. Everything behind this release, eleven candidate models trained and compared across three sessions, ran on a single NVIDIA A40 in 4 hours 15 minutes and cost US$2.56. Each session shut its GPU down the moment its results were saved, and the shipped model needs no GPU at all, so serving it costs only the CPU time of the requests it reads.
Data and credits
None of the training text contains a real person's details. Every name and identifier the model learned from was generated, and real sentences were used only as the words around them. Our thanks to the people who made the open data this rests on.
- Ashesi University and Nokwary Technologies, for the Financial Inclusion Speech Dataset, funded by Lacuna Fund. Its transcripts of real banking and airtime calls in Twi, Fante, Ga and Ewe give the synthetic records real Ghanaian speech to sit in. Licensed CC BY 4.0.
- Masakhane, for InjongoIntent's Twi and Ewe sentences (Apache 2.0), for MasakhaNER 2.0, used only to set the threshold and to measure the model (CC BY-NC 4.0, so it trained nothing), and for AfroXLMR-base, the teacher (MIT).
- Onomaverse for name data and GeoNames for place names, both CC BY 4.0.
- Unicode CLDR for Akan and Ewe number words (Unicode License v3).
- Wikidata for names and Mozilla Common Voice for Twi sentences, both CC0.
- FineWeb-2 (ODC-By 1.0, subject to Common Crawl's terms of use) and GlotCC-V1 (CC0), the Ghanaian-language web text the teacher read and labelled. None of it is redistributed here.
- Microsoft for DeBERTa-v3-xsmall, the base model (MIT).
Limits
- Measure it on your own text first if yours differs from messages, forms, call transcripts and prompts, such as long legal documents or OCR output.
- It isn't a guarantee. It lowers what leaves, and it can't promise a text holds nothing personal.
- Twi names are found generously. It flags some ordinary Twi words as names, so expect some false alarms there.
- Some IDs aren't covered. Passport, voter ID, NHIS, WAEC index and driver's licence numbers aren't trained, because their formats aren't published, and Ga numbers said aloud are found only when said in English.
- Not for watching people. It is for keeping personal information out of places it shouldn't go, and it isn't for identifying, profiling or tracking anyone, or for making decisions about people.
Licence
The weights are released under CC BY 4.0, so you can use and adapt them, commercially too, as long as you credit Dekka. They build on DeBERTa-v3-xsmall, whose MIT notice is in NOTICE, and the data credits above travel with them.
Cite
@misc{dekka2026veilnano,
title = {Veil NER nano: personal information detection for Ghanaian text},
author = {Buaba, Jerry and Dekka},
year = {2026},
url = {https://huggingface.co/dekka-cloud/veil-ner-nano}
}
Model tree for dekka-cloud/veil-ner-nano
Base model
microsoft/deberta-v3-xsmall