IndoPII Base
IndoPII Base is the accurate variant of the IndoPII Indonesian personal-data detector. It uses an XLM-R-base token tagger (12 layers, pruned 32k vocabulary, INT8 ONNX, 188 MB). It is the teacher model distilled into IndoPII Mini.
It runs on CPU in about 20 ms per sentence and about 120 ms per 1,000-character document with 4 threads. Choose it over Mini when recall matters more than throughput, for example in compliance audits or for real-world prose.
Usage
Install the indopii package from the Mini repository, then select the base model:
pip install "git+https://huggingface.co/AIbnuHibban/indopii-mini"
from indopii import Detector
det = Detector(model="base")
print(det.redact("Pasien Ny. Siti Aminah Lubis, perempuan, No. BPJS 0001234567891, alamat Jl. Sei Batang Hari No. 21, Medan.",
mode="tag").text)
# Pasien Ny. [NAME], [GENDER], No. BPJS [BPJS], alamat [ADDRESS].
The Mini model card documents everything else: labels, redaction modes, CLI, rule engine and annotation conventions.
Evaluation
| Test set | Base | Mini |
|---|---|---|
| IndoPII-Bench test (480 documents, 2,591 spans): strict F1 | 0.930 | 0.897 |
| IndoPII-Bench test: macro F1 over 21 labels | 0.917 | 0.907 |
| IndoPII-Bench test: leak (personal data not fully redacted) | 4.0% | 7.9% |
Real-text track (450 real sentences, NAME/ADDRESS): strict F1 |
0.820 | 0.737 |
| Real-text track: leak | 4.0% | 21.2% |
| Name-ambiguity challenge (200 minimal pairs): pair accuracy | 0.790 | 0.665 |
| ms per ~1,000-character document (Ryzen 5 6600H, 4 threads) | 116 | 8.5 |
Strongest per-label scores:
| Label | F1 |
|---|---|
NIP, SIM, PLATE |
1.000 |
RELIGION |
0.991 |
EMAIL |
0.989 |
BIRTH_PLACE |
0.979 |
PHONE |
0.971 |
BIRTH_DATE |
0.958 |
NIK |
0.957 |
NAME |
0.933 |
ADDRESS |
0.862 |
Weakest per-label scores:
| Label | F1 |
|---|---|
PASSPORT |
0.720 |
KK |
0.755 |
IP_ADDRESS |
0.827 |
Every baseline and the full protocol are in the benchmark card.
Training
- Base model: XLM-R base, with its 250k vocabulary pruned to the 32k pieces used by Indonesian training text. The embedding matrix shrinks from 192M to 24M parameters.
- Fine-tuning: 4 epochs (LR 3e-5, batch 32, fp16) on 92.9k documents: synthetic template documents with valid fake identifiers, NERGrit news names, silver-annotated real sentences, and contrastive name and honorific templates. The epoch and the span threshold (0.8) were selected on the dev set.
- Quantisation: selective dynamic INT8 for embeddings, attention and the first FFN projection, which is within noise of fp32.
Limitations
The main benchmark is LLM-written and LLM-adjudicated. Out of scope:
- regional languages;
- heavily degraded OCR;
- speech transcripts.
Organisation contacts are intentionally not treated as personal data. Detection supports, but does not guarantee, UU PDP compliance.
License
The model weights and code are released under Apache-2.0. The base model, XLM-R, is MIT. Data sources and their licenses are listed in the Mini card.
Model tree for AIbnuHibban/indopii-base
Base model
FacebookAI/xlm-roberta-base