CoolFace
Datasetpublic

wan9yu/pii-bench-zh

PII Bench ZH Chinese PII (Personally Identifiable Information) detection benchmark dataset. Two subsets covering formal and informal Chinese text, with character-level span annotations. This is the first open Chinese PII benchmark that covers locale-specific formats (phone, national ID, bank card, license plate, address) with precise offsets. Disclaimer / 免责声明 This dataset is 100% synthetic and intended solely for research and evaluation purposes. It does not contain any real… See the full description on the dataset page: https://huggingface.co/datasets/wan9yu/pii-bench-zh.

sourceHugging Faceapache-2.0updated 6mo agoView on Hugging Face
0likes255downloads
Dataset Card

PII Bench ZH

Chinese PII (Personally Identifiable Information) detection benchmark dataset. Two subsets covering formal and informal Chinese text, with character-level span annotations.

This is the first open Chinese PII benchmark that covers locale-specific formats (phone, national ID, bank card, license plate, address) with precise offsets.

Disclaimer / 免责声明 This dataset is 100% synthetic and intended solely for research and evaluation purposes. It does not contain any real personal information. All names, ID numbers, phone numbers, bank card numbers, addresses, and other data are randomly generated and do not correspond to any real individuals or entities. The ID numbers and bank card numbers use valid checksum algorithms with real area code / BIN prefixes for realism, but the complete numbers are fictitious. 本数据集为 100% 合成数据仅供研究和评估使用。数据集不包含任何真实个人信息。所有姓名、身份证号、手机号、银行卡号、地址等均为随机生成,不对应任何真实个人或实体。身份证号和银行卡号使用了真实的区号前缀 / BIN 码以增加真实感,但完整号码均为虚构。 The authors assume no liability for any misuse of this dataset. Users are responsible for ensuring compliance with applicable laws and regulations in their jurisdiction. 作者不对本数据集的任何滥用行为承担责任。用户有责任确保其使用符合所在司法管辖区的相关法律法规。

Subsets

SubsetFileSamplesDescription
formaldata/pii_bench_zh.jsonl5,000Formal text: registration forms, medical records, delivery orders, contracts
chatdata/pii_bench_zh_chat.jsonl3,000Noisy chat/IM: emoji, informal tone, voice-to-text, mixed zh/en, non-standard formatting

Total: 8,000 samples, 23,206 PII entities.

The chat subset is designed to stress-test PII detection under realistic noise conditions:

  • Phone numbers with spaces/dashes (138 1234 5678)
  • Emoji interleaved with PII (加个微信吧 张三 13812345678 😂)
  • Filler words and casual tone (嗯,那个人叫张三 身份证号...)
  • Chinese-English code-switching (pls contact 张三 phone:13812345678)
  • No formal context markers (no "客户"/"患者" prefixes)

How This Dataset Was Created

This dataset was generated programmatically using template-based synthesis — no real data was collected, scraped, or anonymized.

The generation process:

  1. 1.Templates — 11 formal scenario templates + 13 chat scenario templates covering IM conversations, group chats, voice-to-text, WeChat-style messages, etc.
  2. 2.Fake PII generators — each PII type has a dedicated generator:
  3. 3.ID numbers: real area code prefixes + random birth date + valid MOD 11-2 checksum
  4. 4.Bank cards: real BIN prefixes + random digits + valid Luhn checksum
  5. 5.Phone numbers: valid Chinese mobile prefixes (1[3-9]) + 9 random digits
  6. 6.Addresses: real province/city/district names + random street + random number
  7. 7.License plates: real province abbreviations + random alphanumeric
  8. 8.Names: random combination from 50 common surnames × 50 common given names
  9. 9.Passports: E/G prefix + 8 random digits
  10. 10.Emails: random pinyin-like local parts + common Chinese email domains
  11. 11.Noise injection (chat subset only): emoji insertion, filler words, phone number reformatting (spaces/dashes), casual punctuation
  12. 12.Offset verification — every sample is validated: text[start:end] == entity.text
  13. 13.Deterministic — seed=42, fully reproducible

Entity Types

TypeFormalChatExampleValidation
person5,3103,010张三Chinese name (surname + given)
phone4,4002,261138123456781[3-9] + 9 digits
id_number1,81252211010119900307123418 digits, MOD 11-2 checksum
address1,429255北京市朝阳区建国路100号Province + city + district + street
email931493zhangsan@qq.comStandard email format
bank_card862504621700123456789016 digits, Luhn checksum
passport463260E12345678E/G + 8 digits
license_plate455239京A12345Province + letter + 5 alphanumeric

Format

JSONL with one sample per line:

json
{
  "id": "zh_chat_000001",
  "text": "你存一下 张三 138 1234 5678 😂",
  "lang": "zh",
  "entities": [
    {"text": "张三", "type": "person", "start": 5, "end": 7},
    {"text": "138 1234 5678", "type": "phone", "start": 8, "end": 21}
  ]
}

Usage

python
from datasets import load_dataset

# Load formal subset
formal = load_dataset("wan9yu/pii-bench-zh", data_files="data/pii_bench_zh.jsonl", split="train")

# Load chat subset
chat = load_dataset("wan9yu/pii-bench-zh", data_files="data/pii_bench_zh_chat.jsonl", split="train")

With argus-redact benchmark framework

bash
pip install argus-redact datasets
python -m tests.benchmark pii_bench_zh --mode fast --limit 1000       # formal
python -m tests.benchmark pii_bench_zh_chat --mode fast --limit 1000  # chat

Generator source code:

Reproduce:

bash
git clone https://github.com/wan9yu/argus-redact.git
cd argus-redact
python -m tests.benchmark.generators.zh --count 5000 --seed 42 --output pii_bench_zh.jsonl
python -m tests.benchmark.generators.zh_chat --count 3000 --seed 42 --output pii_bench_zh_chat.jsonl

License

Apache 2.0

Citation

bibtex
@dataset{pii_bench_zh_2026,
  title={PII Bench ZH: Chinese PII Detection Benchmark},
  author={wan9yu},
  year={2026},
  url={https://huggingface.co/datasets/wan9yu/pii-bench-zh},
  publisher={Hugging Face}
}

Related