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
-
Safetensors
Model size
34.1M params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Dataset used to train schift-io/schift-ko-pii-v6

Evaluation results