Instructions to use schift-io/schift-ko-pii-v6 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use schift-io/schift-ko-pii-v6 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="schift-io/schift-ko-pii-v6", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("schift-io/schift-ko-pii-v6", trust_remote_code=True) model = AutoModelForTokenClassification.from_pretrained("schift-io/schift-ko-pii-v6", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
schift-ko-pii-v6
34M Korean PII detector with dual-path LoRA β person + address + organization.
Designed for court judgment de-identification, administrative document masking, and general Korean PII detection. The model uses a dual-path architecture: person/address detection runs through the base encoder, while organization detection uses LoRA-adapted features. This prevents entity interference β adding organization doesn't degrade person/address accuracy.
Benchmark (benchmark_v3, 473 cases)
| Entity | F1 | P | R | Count |
|---|---|---|---|---|
| private_person | 0.935 | 0.964 | 0.908 | 411 |
| private_organization | 0.820 | 0.791 | 0.852 | 182 |
| private_address | 0.926 | 0.917 | 0.936 | 141 |
| private_phone | 1.000 | 1.000 | 1.000 | 65 |
| Overall | 0.903 | 0.908 | 0.899 | 473 |
Compared to v5 (person + address only, F1=0.823 on benchmark_v2): v6 adds organization detection while maintaining person/address performance.
What it detects
| Entity | Detected by | Examples |
|---|---|---|
private_person |
Model | κΉλ―Όμ, λ¨κΆνμ§, Mike Johnson |
private_address |
Model | μμΈνΉλ³μ κ°λ¨κ΅¬ ν ν€λλ‘ 521 |
private_organization |
Model (LoRA path) | μ£Όμνμ¬ μΌμ±μ μ, (μ£Ό)ν΄λ¨Όμμ€, μ¬λ¨λ²μΈ νκ΅λ²λ₯ κ΅¬μ‘°κ³΅λ¨ |
phone_number |
Postprocess (regex) | 010-1234-5678, 055-000-4484 |
resident_id |
Postprocess (regex + checksum) | 850205-1234567 |
account_number |
Postprocess (regex) | M12345678, 52κ°1234 |
private_date |
Postprocess (regex) | 2024λ 3μ 15μΌ |
private_email |
Postprocess (regex) | user@example.com |
Installation
pip install schift-ko-pii
Usage
from schift_ko_pii import detect, mask, apply
# Detect all PII
spans = detect(
"νΌκ³ μ£Όμνμ¬ μΌμ±μ μ(λνμ΄μ¬ κΉλ―Όμ)λ "
"μμΈνΉλ³μ κ°λ¨κ΅¬ ν
ν€λλ‘ 521μμ μκ³ μκ² μν΄λ₯Ό κ°νμλ€.",
postprocess=True
)
for s in spans:
print(f" [{s['label']}] {s['text']} (score: {s['score']:.2f})")
# [private_organization] μΌμ±μ μ (score: 0.94)
# [private_person] κΉλ―Όμ (score: 0.98)
# [private_address] μμΈνΉλ³μ κ°λ¨κ΅¬ ν
ν€λλ‘ 521 (score: 0.97)
# Mask and review
result = mask(
"μκ³ (μ£Ό)ν΄λ¨Όμμ€μ λνμ΄μ¬ κ°μ μμ νΌκ³ μ λνμ¬ μ©μλΉ μ§κΈμ ꡬνλ€.",
postprocess=True
)
print(result["masked"])
# μκ³ [κΈ°κ΄1]μ λνμ΄μ¬ [μ¬λ1]μ νΌκ³ μ λνμ¬ μ©μλΉ μ§κΈμ ꡬνλ€.
# Selective replacement
clean = apply(result["masked"], result["entities"], {
"organization_1": "ββνμ¬",
"person_1": "βββ",
})
Architecture
- Encoder: LFM2.5 conv + attention hybrid, 6 layers, hidden 512 (frozen from v5)
- LoRA: rank-16 adapters on attention q/v projections (4 projections, 123K params)
- Heads: per-entity classifiers
- Person/Address: Linear(512 β 5) β reads from base encoder
- Organization: MLP(512 β 128 β 5) β reads from LoRA-adapted encoder
- Inference: dual-path forward β base path for person/address, LoRA path for organization, cross-head overlap resolution
- Total params: 34.1M (34.0M frozen + 0.1M trainable LoRA + heads)
- Format: safetensors float32 (130 MB)
- Tokenizer: klue/roberta-base, max 512 tokens
- Requires:
trust_remote_code=True
Training Data
| Source | Count | Entity |
|---|---|---|
| Assembly meeting transcripts | 89,000 | Person names (auto-labeled from speaker patterns) |
| KLUE NER (CC-BY-SA-4.0) | 26,008 | Person + Organization + Address |
| μ°½λ κ΅° administrative documents | 10,000 | Person + Organization + Address + Phone |
| Augmented / disambig / legal negative | 2,152 | Mixed |
License
Schift License v2.0 β Apache 2.0 base with revenue threshold. Free for everyone under $10M annual revenue. Research, education, and non-profit always permitted.
Acknowledgments
Training data contributed by μ§λ°©μμΉνμ μ°κ΅¬μ (μ°½λ κ΅° μ 보곡κ°μ²κ΅¬ λ°μ΄ν° κΈ°λ° ν©μ± λ°μ΄ν°μ ).
Citation
@software{schift_ko_pii_v6_2026,
author = {Schift Inc.},
title = {schift-ko-pii-v6: Dual-Path LoRA Korean PII Detection},
year = {2026},
url = {https://huggingface.co/schift-io/schift-ko-pii-v6},
}
- Downloads last month
- -
Dataset used to train schift-io/schift-ko-pii-v6
Evaluation results
- F1 on benchmark_v3 (473 cases)self-reported0.903
- Precision on benchmark_v3 (473 cases)self-reported0.908
- Recall on benchmark_v3 (473 cases)self-reported0.899