language: ko license: other license_name: schift-open-1.0 license_link: LICENSE library_name: onnxruntime pipeline_tag: token-classification tags:
- pii
- korean
- ner
- privacy
- onnx
- token-classification datasets:
- custom model-index:
- name: schift-ko-pii-v4
results:
- task:
type: token-classification
name: Korean PII Detection
metrics:
- type: f1 value: 0.863 name: F1 (raw, no postprocess)
- type: f1 value: 0.968 name: F1 (with postprocess)
- task:
type: token-classification
name: Korean PII Detection
metrics:
schift-ko-pii-v4
111M parameter Korean PII detector that outperforms models 3x its size.
Fine-tuned from klue/roberta-base with LoRA on Korean legal, financial, and administrative texts. Exported to ONNX INT8 for CPU-only deployment (107 MB).
Benchmark: schift-ko-pii-v4 vs LFM2.5-Encoder-350M-PII-Detector
Same benchmark, same scoring (50% overlap match), no postprocessing on either side.
| Model | Params | micro F1 | strong F1 | Size |
|---|---|---|---|---|
| schift-ko-pii-v4 | 111M | 0.863 | 0.893 | 107 MB (ONNX INT8) |
| LFM2.5-PII-Detector | 350M | 0.663 | 0.645 | ~1.4 GB |
With postprocessing enabled (postprocess=True):
| Model | strong F1 | P | R |
|---|---|---|---|
| schift-ko-pii-v4 + postprocess | 0.968 | 0.947 | 0.991 |
Category breakdown (raw model, no postprocess)
| Category | schift-ko-pii | LFM2.5-PII |
|---|---|---|
| Person (standard) | 1.00 | 0.67 |
| Person (rare surnames) | 1.00 | 0.60 |
| Person (short names) | 1.00 | 0.57 |
| Phone | 0.86 | 0.92 |
| 1.00 | 0.86 | |
| Address (urban) | 1.00 | 0.67 |
| Address (rural) | 1.00 | 0.60 |
| Vehicle plate | 1.00 | 0.00 |
| Date (Korean) | 1.00 | 0.00 |
| Resident ID | 1.00 | 0.75 |
| Passport | 1.00 | 1.00 |
LFM2.5 is a strong multilingual model, but it was not trained on Korean-specific
formats: vehicle plates (52가1234), resident registration numbers
(850205-1234567), Korean date expressions (2024년 3월 15일), or rare Korean
surnames (황보, 남궁, 독고).
Quick start
pip install schift-ko-pii
from schift_ko_pii import detect
# Raw model output
spans = detect("피고 김민수의 전화번호는 010-1234-5678이다.")
# [
# {"start": 3, "end": 6, "label": "private_person", "score": 0.99, "text": "김민수"},
# {"start": 14, "end": 27, "label": "private_phone", "score": 0.98, "text": "010-1234-5678"},
# ]
# With postprocessing (regex validation + structured-ID rules, higher precision)
spans = detect("주민번호 850205-1234567을 확인.", postprocess=True)
Postprocessing
The postprocess=True flag applies Korean-specific rules:
- Regex validation for structured IDs (resident numbers, passports, vehicle plates, bank accounts)
- Luhn/checksum verification where applicable
- Context-aware span merging
- False-positive suppression for legal case numbers and statute references
This raises strong-category F1 from 0.893 to 0.968.
API (free)
For production use without managing model files:
from schift import Schift
client = Schift(api_key="...") # free at schift.io
result = client.pii.redact("김민수의 전화번호는 010-1234-5678입니다.")
# Postprocessing is always enabled on the API.
Labels
| Label | Description | Examples |
|---|---|---|
private_person |
Person names (Korean, Hanja, foreign) | 김민수, 황보영희, Lee Jenny |
private_phone |
Phone numbers | 010-1234-5678, 02-1234-5678 |
private_email |
Email addresses | user@example.com |
private_address |
Street/postal addresses | 서울특별시 강남구 테헤란로 521 |
private_date |
Dates | 2024년 3월 15일, 2024-03-15 |
private_url |
URLs, SNS links, IP addresses | instagram.com/user, 192.168.1.1 |
account_number |
Structured IDs: resident/business/bank/passport/vehicle | 850205-1234567, M12345678 |
secret |
Secrets, API keys, passwords |
Benchmark
The benchmark suite is included in this repository under benchmark/.
# Benchmark this model
python benchmark/run_benchmark.py
# With postprocess
python benchmark/run_benchmark.py --postprocess
# Compare any HuggingFace model
python benchmark/run_benchmark.py --hf-model LiquidAI/LFM2.5-Encoder-350M-PII-Detector
93 hand-crafted cases covering Korean legal, investigative, and administrative text. Categories: person (standard/rare/short/foreign/hanja), phone, email, address (urban/rural), dates, URLs, resident IDs, business IDs, bank accounts, passports, vehicle plates, IP addresses, plus negative cases (legal case numbers, statute references, Hanja legal terms).
Model details
- Base model:
klue/roberta-base(111M params) - Training: LoRA adapter on ~20k Korean legal/financial/admin examples
- Export: ONNX FP32 → INT8 dynamic quantization
- Inference: ONNX Runtime CPU, single thread, 107 MB
- Max length: 512 tokens
- Tagging scheme: BIES (Begin/Inside/End/Single)
License
Schift Open License v1.0 — Apache 2.0 base with a revenue threshold. Free for everyone under $10M annual revenue. Research, education, and non-profit use always permitted. Companies above the threshold: contact licensing@schift.io.
Citation
@software{schift_ko_pii_2026,
author = {Schift Inc.},
title = {schift-ko-pii: Korean PII Detection Model},
year = {2026},
url = {https://huggingface.co/schift-io/schift-ko-pii-v4},
}
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file schift_ko_pii-0.1.0.tar.gz.
File metadata
- Download URL: schift_ko_pii-0.1.0.tar.gz
- Upload date:
- Size: 19.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
112da71deb6b3135f296915f41fb64d6ae943048f38779730a7282e1ba3e6a96
|
|
| MD5 |
fb48ce6b45fb93285ee5ece3803db256
|
|
| BLAKE2b-256 |
994c917a5e138c9d18399b7b4be9575e88c65a77af53a05b6ddd34cd90ac394c
|
File details
Details for the file schift_ko_pii-0.1.0-py3-none-any.whl.
File metadata
- Download URL: schift_ko_pii-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
699187b3f39344035aba7952fedaf0f3d1fb3d98dbec343282bb08f0f88777e0
|
|
| MD5 |
8e51e5e76aeb4627f1fe640686942ba5
|
|
| BLAKE2b-256 |
30aa81b3372fce4edb66969dd5dfbb87718a0b38919a53f32fab7ecd2cf2db0f
|