Chinese PII Detection Model | 568M Parameters | Open Source
OpenMed-PII-Chinese-SnowflakeMed-Large-568M-v1 is a transformer-based token classification model fine-tuned for Personally Identifiable Information (PII) detection in Chinese text. This model identifies and classifies 54 types of sensitive information including names, addresses, social security numbers, medical record numbers, and more.
Evaluated on the Chinese test split (AI4Privacy + synthetic data):
| Metric | Score |
|---|---|
| Micro F1 | 0.7592 |
| Precision | 0.7662 |
| Recall | 0.7523 |
| Macro F1 | 0.4532 |
| Weighted F1 | 0.7459 |
| Accuracy | 0.8899 |
| Rank | Model | F1 | Precision | Recall |
|---|---|---|---|---|
| 1 | OpenMed-PII-Chinese-SnowflakeMed-Large-568M-v1 | 0.7592 | 0.7662 | 0.7523 |
| 2 | OpenMed-PII-Chinese-BigMed-Large-560M-v1 | 0.7589 | 0.7662 | 0.7517 |
| 3 | OpenMed-PII-Chinese-NomicMed-Large-395M-v1 | 0.7572 | 0.7641 | 0.7505 |
| 4 | OpenMed-PII-Chinese-BioClinicalModern-Large-395M-v1 | 0.7543 | 0.7577 | 0.7508 |
| 5 | OpenMed-PII-Chinese-ModernMed-Large-395M-v1 | 0.7534 | 0.7589 | 0.7479 |
| 6 | OpenMed-PII-Chinese-SuperClinical-Large-434M-v1 | 0.7531 | 0.7508 | 0.7554 |
| 7 | OpenMed-PII-Chinese-ClinicalBGE-568M-v1 | 0.7528 | 0.7553 | 0.7504 |
| 8 | OpenMed-PII-Chinese-SuperClinical-Base-184M-v1 | 0.7449 | 0.7432 | 0.7465 |
| 9 | OpenMed-PII-Chinese-mLiteClinical-135M-v1 | 0.7446 | 0.7498 | 0.7396 |
| 10 | OpenMed-PII-Chinese-BioClinicalModern-Base-149M-v1 | 0.7442 | 0.7490 | 0.7395 |
This model detects 54 PII entity types organized into categories:
Identifiers (22 types)| Entity | Description |
|---|---|
ACCOUNTNAME |
Accountname |
BANKACCOUNT |
Bankaccount |
BIC |
Bic |
BITCOINADDRESS |
Bitcoinaddress |
CREDITCARD |
Creditcard |
CREDITCARDISSUER |
Creditcardissuer |
CVV |
Cvv |
ETHEREUMADDRESS |
Ethereumaddress |
IBAN |
Iban |
IMEI |
Imei |
| ... | and 12 more |
| Entity | Description |
|---|---|
AGE |
Age |
DATEOFBIRTH |
Dateofbirth |
EYECOLOR |
Eyecolor |
FIRSTNAME |
Firstname |
GENDER |
Gender |
HEIGHT |
Height |
LASTNAME |
Lastname |
MIDDLENAME |
Middlename |
OCCUPATION |
Occupation |
PREFIX |
Prefix |
| ... | and 1 more |
| Entity | Description |
|---|---|
EMAIL |
|
PHONE |
Phone |
| Entity | Description |
|---|---|
BUILDINGNUMBER |
Buildingnumber |
CITY |
City |
COUNTY |
County |
GPSCOORDINATES |
Gpscoordinates |
ORDINALDIRECTION |
Ordinaldirection |
SECONDARYADDRESS |
Secondaryaddress |
STATE |
State |
STREET |
Street |
ZIPCODE |
Zipcode |
| Entity | Description |
|---|---|
JOBDEPARTMENT |
Jobdepartment |
JOBTITLE |
Jobtitle |
ORGANIZATION |
Organization |
| Entity | Description |
|---|---|
AMOUNT |
Amount |
CURRENCY |
Currency |
CURRENCYCODE |
Currencycode |
CURRENCYNAME |
Currencyname |
CURRENCYSYMBOL |
Currencysymbol |
| Entity | Description |
|---|---|
DATE |
Date |
TIME |
Time |
from transformers import pipeline
# Load the PII detection pipeline
ner = pipeline("ner", model="OpenMed/OpenMed-PII-Chinese-SnowflakeMed-Large-568M-v1", aggregation_strategy="simple")
text = """
患者李明(出生日期:1985/03/15,身份证号:310101198503159876)今日就诊。
联系方式:li.ming@email.cn,电话:+86 138 1234 5678。
地址:上海市浦东新区陆家嘴路123号。
"""
entities = ner(text)
for entity in entities:
print(f"{entity['entity_group']}: {entity['word']} (score: {entity['score']:.3f})")
def redact_pii(text, entities, placeholder='[REDACTED]'):
"""Replace detected PII with placeholders."""
# Sort entities by start position (descending) to preserve offsets
sorted_entities = sorted(entities, key=lambda x: x['start'], reverse=True)
redacted = text
for ent in sorted_entities:
redacted = redacted[:ent['start']] + f"[{ent['entity_group']}]" + redacted[ent['end']:]
return redacted
# Apply de-identification
redacted_text = redact_pii(text, entities)
print(redacted_text)
from transformers import AutoModelForTokenClassification, AutoTokenizer
import torch
model_name = "OpenMed/OpenMed-PII-Chinese-SnowflakeMed-Large-568M-v1"
model = AutoModelForTokenClassification.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)
texts = [
"患者李明(出生日期:1985/03/15,身份证号:310101198503159876)今日就诊。",
"联系方式:li.ming@email.cn,电话:+86 138 1234 5678。",
]
inputs = tokenizer(texts, return_tensors='pt', padding=True, truncation=True)
with torch.no_grad():
outputs = model(**inputs)
predictions = torch.argmax(outputs.logits, dim=-1)
This model was trained on a combination of:
AI4Privacy PII Masking 200K: Multilingual base dataset (200K records across 8 languages)
NVIDIA Nemotron-PII: Seed dataset for synthetic data generation
Synthetic Chinese Data: ~25K high-quality samples generated with locale-specific formatting (身份证号 format, +86 phones, Chinese names, ¥ currency)
Format: BIO-tagged token classification
Labels: 76 BIO tags (54 entity types)
Important: This model is intended as an assistive tool, not a replacement for human review.
@misc{openmed-pii-2026,
title = {OpenMed-PII-Chinese-SnowflakeMed-Large-568M-v1: Chinese PII Detection Model},
author = {OpenMed Science},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/OpenMed/OpenMed-PII-Chinese-SnowflakeMed-Large-568M-v1}
}
Have the files? Publish a torrent.
Publish a torrentHave the complete files and permission to share them? Replace the example folder path. The script checks the files, makes a torrent and submits its magnet and checksums. Keep your torrent client seeding. Get your community key from your settings, and read the script before running it.
curl -fsSL https://pirateface.co/package.sh | bash -s -- --repo OpenMed/OpenMed-PII-Chinese-SnowflakeMed-Large-568M-v1 ./model-folderSnowflake/snowflake-arctic-embed-l-v2.0