/ Модель

Характеристики

Контекст
512 токенов
Параметры
38,7 млн
Лицензия
Apache 2.0
Архитектура
bert · dense
Базовая модель
Multilingual-MiniLM-L12-H384
Опубликована
8 окт 2026

seatbelt-pii-tagger

Разметка токеновТекст → label4 профессии
60скачиваний за 30 дней0лайковвеса обновлены10 окт 2026

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

Модель размечает персональные данные и секреты в англоязычном и китайском тексте, особенно в сообщениях coding-агентов.

seatbelt-pii-tagger — разработанная автором личного учебного проекта модель для поиска персональных данных и секретов в тексте, прежде всего в запросах, ответах, вызовах инструментов и выводах coding-агентов. Это дообученная модель Microsoft Multilingual-MiniLM-L12-H384 на архитектуре BERT с классификатором последовательностей и 73 BIOES-метками для 18 типов сущностей. Она поддерживает английский, упрощённый и традиционный китайский языки, имеет контекстное окно 512 токенов. В репозитории есть ONNX-копия int8 для CPU и Core ML-копия fp16 для Apple Neural Engine; лицензия — Apache-2.0.

Модель размечает символьные интервалы с личными данными, чтобы проверять текст перед отправкой с устройства. В заявленных тестах она показывает высокие результаты на отдельных китайских и тайваньских наборах, однако качество зависит от домена и правил фильтрации. README отмечает слабое распознавание персон в неформальном тексте, ложные срабатывания на публичные имена и неполный охват сущностей. Модель не предназначена для языков кроме английского и китайского, типов данных вне поддерживаемых меток или сценариев, требующих полного отзыва, например юридической анонимизации.

Сценарии применения

  • поиск персональных данных в запросах coding-агентов
  • проверка ответов агента перед отправкой
  • обнаружение персональных данных в вызовах инструментов и их выводе
  • разметка имён, телефонов и адресов электронной почты в английском и китайском тексте

Ограничения

Модель поддерживает только английский и китайский и не охватывает ряд идентификаторов, включая IP-адреса и медицинские номера; полнота распознавания не подходит для юридической анонимизации. В неформальном тексте распознавание персон может быть слабым, а публичные имена могут вызывать ложные срабатывания.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Для каких профессий подходит4

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

seatbelt-pii-tagger 2026.10: English, Simplified Chinese and Traditional Chinese

A 35M-parameter token tagger that finds personal data and secrets in text. PII means personally identifiable information. It reads English, Simplified Chinese (zh-Hans) and Traditional Chinese (zh-Hant). It targets developer text: prompts, agent replies, tool calls and tool output from coding agents. The shipped files are an int8 ONNX (Open Neural Network Exchange) graph of 35.6 MB that runs on the CPU, and an fp16 Core ML package of 69 MB that runs on the Apple Neural Engine.

The technical report holds the method and every result. The code rebuilds the model with reproduce.sh.

Intended use

A per-prompt hook that flags personal data and secrets before text leaves the machine. This is a personal learning project, not a product.

Out of scope:

  • Languages other than English and Chinese.
  • Identifiers outside the 18 types below, such as employee IDs, IP addresses or medical record numbers.
  • Company names, occupations, ages and other quasi-identifiers.
  • Any use that needs complete recall, such as legal anonymisation.

Labels

The model tags 18 types with BIOES (Begin, Inside, End, Single, Outside), so the head has 73 classes. A span is personal data only when it points at one private person. Public figures, shared mailboxes, public hotlines, landmark addresses and dates other than birth dates are not personal data.

typemarks
persona private person's name, given name, nickname or English name
emaila person's email address
phonea person's mobile or home number
addressa person's street-level address
datea birth date only
urla URL that points at one private person
account_numbera bank account or credit card number
secreta password, PIN, one-time code, API key, access token or card security code
national_ida national ID, for example a 身分證字號 or SSN
passporta passport number
license_platea private vehicle's plate
usernamea person's handle or account ID
nhi_carda Taiwan National Health Insurance card number (健保卡號)
company_ida Taiwan business number (統一編號)
driver_licensea driver's licence number
medical_licensea physician's or pharmacist's licence number
military_ida military ID or service number
household_noa Taiwan household number (戶號)

How to run it

The model runs in the tagger mode of the agent-seatbelt PII hook. The hook splits text into windows of at most 400 characters, runs each window alone, and decodes the token scores into character spans. A rule chain then drops public figures, places, documentation URLs, shared mailboxes and code identifiers.

In an agent-seatbelt checkout, start the server. It downloads the files from this repository on first use:

uv run hooks-pii/server/server.py --mode tagger --port 9123

The server picks the network's runtime by itself:

  • On Apple Silicon, it runs model.mlpackage on the Neural Engine. The package is fp16 and pads each window to 64, 128, 192, 256, 320, 384 or 512 tokens. A window takes 0.4 ms at the median, against 1.4 ms for the int8 graph on the CPU (Apple M5 Pro, 400 benchmark windows, lower is better). Its spans match the PyTorch fp32 network's on all but 93 of 33,479 comparison rows.
  • Elsewhere, or when Core ML fails to load, it runs model.int8.onnx on the CPU. Set PII_TAGGER_FP32=1 to run model.onnx instead.

To run your own export, set PII_TAGGER_DIR to a folder that holds the same files.

model.safetensors and config.json hold the same network as PyTorch weights, for transformers: BertForTokenClassification.from_pretrained loads them, with the 73 label names in the config. The hook does not use them.

Results

"Ours" marks a set built for this model. "Public" marks a published dataset.

setmade bymetricraw+ chainOpenAI Privacy FilterRedact modelRedact hookNVIDIA GLiNER-PII
tw_benchpublictyped F1 (higher is better)0.8470.8470.6840.3360.3760.593
zh_benchpublicany overlap F1 (higher is better)0.9980.9980.9370.7170.7170.596
CredDatapublicclean lines flagged, of 1,000 (lower is better)16015519551189759
nemotron_testpublictyped F1 (higher is better)0.9790.9760.7940.6750.7640.890
kiji_enpublictyped F1 (higher is better)0.8610.8580.8230.6190.6430.805
Secrets suite, 4 sets3 ours, 1 public (CredData)mean typed F1 (higher is better)0.9410.9420.7690.0000.762
Our core suite, 8 setsoursmean typed F1 (higher is better)0.9420.9410.7590.3990.4200.519
transcript_devours, private dataF1 (higher is better)0.7010.7520.3250.2820.1690.119
transcript_testours, private dataF1 (higher is better)0.7390.7500.4140.3210.1870.167

What each column is:

  • raw: this model alone.
  • + chain: this model plus the rules agent-seatbelt runs after it.
  • OpenAI Privacy Filter: openai/privacy-filter alone.
  • Redact model: desert-ant-labs/redact by Desert Ant Labs alone, with no rules.
  • Redact hook: the same Redact model as agent-seatbelt's redact mode runs it. That mode adds agent-seatbelt's own regex rules, including 271 secret-token patterns, to the model's spans. These are not Desert Ant Labs' rules. The secret scores in this column come from them: the Redact model alone scores 0.000 on the Secrets suite.
  • NVIDIA GLiNER-PII: nvidia/gliner-PII at its card's threshold of 0.3. It is English-only, so its Chinese scores show a language limit, not quality. It ran only CredData of the secret sets, so its Secrets suite cell is empty.

What each metric is:

  • F1 combines precision (the share of flagged spans that are right) and recall (the share of real values found): 2 × precision × recall / (precision + recall). 1.0 is perfect.
  • typed F1: a flagged span counts only if it overlaps a real value of the same type. The comparison uses the types every system shares. The 8 ID types (national ID, passport, driver licence and the 5 Taiwan-only IDs) count as one type, and dates, usernames and licence plates are not scored.
  • any overlap F1: a flagged span counts if it overlaps a real value, whatever its type.
  • mean typed F1: the average of typed F1 over the sets of a suite, each set with the same weight.
  • clean lines flagged: of the lines that hold no secret, the number a system flags.
  • F1 on the transcript sets: judges decide. Precision is the share of flagged spans a judge called personal data. Recall is the share of real values a flagged span overlaps, whatever its type.
  • Bold marks the best value in a row.

The transcript sets come from the author's own coding-agent sessions. Their scores are published, and their text is not. Section 8 of the technical report gives every set and one more baseline, the agent-seatbelt rules engine. nemotron_test shares a generator with a training source, so its score is likely optimistic.

Limits

  • After the chain, person recall is low on sets whose gold marks public figures. For example, multinerd_en recall drops from 0.941 raw to 0.523 with the chain (higher is better). This follows the guideline.
  • The raw model flags public names in news text: 66.1 flags per 10k characters on wikinews_zhtw (lower is better). The chain brings it to 39.4.
  • Casual text is weak. Weibo person recall is 0.478 and WNUT-17 person recall is 0.508 (higher is better).
  • Transcript recall is about 0.7: 0.673 raw and 0.714 with the chain on transcript_dev (higher is better). The transcript test set holds only 26 gold entities, so one entity moves recall by about 0.038.
  • Training is not deterministic on Apple MPS (Metal Performance Shaders). Copies of one recipe differ, and this model is one copy.
  • No public data teaches the Taiwan-only types. Only templates teach them.

Training data

sourcekindtrain rows
ai4privacy/pii-masking-openpii-1.5mpublic dataset (synthetic)183,140
Wismut/nym-pii-multilingual-datapublic dataset (synthetic)526,320
nvidia/Nemotron-PIIpublic dataset (synthetic)98,989
gretelai/synthetic_pii_finance_multilingualpublic dataset (synthetic)25,719
gretelai/gretel-pii-masking-en-v1public dataset (synthetic)49,506
Traditional Chinese templatesin-house synthetic182,509
secrets from regex rulesin-house synthetic58,757
social, developer-work and agent-session rowsin-house synthetic5,297
coding-agent transcript windowsin-house, private7,740

The transcript windows come from the author's own coding-agent sessions, on personal and professional projects. LLM judges labelled them, and every judged personal value was replaced by a fake before training. The windows still hold real text, so they are private and not released.

Two comparison systems also tag personal data: Redact by Desert Ant Labs and NVIDIA GLiNER-PII. No training label comes from either one. Transcript windows that showed a Redact or GLiNER candidate to a judge were judged again without it.

The in-house synthetic sets are in CJHwong/seatbelt-pii-tagger-data. In 138 rows of the developer-work and agent-session sets, names and project details copied from the author's sessions are swapped for fakes, so those rows differ from the training copies (see the technical report, section 10).

Licence and attributions

Apache 2.0. The NOTICE file carries the same attributions as this table.

worklicence and holderuse
microsoft/Multilingual-MiniLM-L12-H384MIT License, Copyright (c) Microsoft Corporation (github.com/microsoft/unilm LICENSE)base model: layers 0 to 5 kept, vocabulary pruned from 250,037 to 64,000 XLM-R pieces
XLM-R SentencePiece tokenizer (fairseq)MIT License, Copyright (c) Facebook, Inc. and its affiliates (github.com/facebookresearch/fairseq LICENSE)tokenizer
nvidia/Nemotron-PIICC BY 4.0, NVIDIA Corporationtraining data, relabelled to 18 types
ai4privacy/pii-masking-openpii-1.5mCC BY 4.0, "Ai4Privacy / Ai Suisse SA"training data, relabelled and filtered to English and Chinese scripts
Wismut/nym-pii-multilingual-dataMIT, Wismuttraining data, relabelled and filtered
gretelai/synthetic_pii_finance_multilingualApache 2.0, Greteltraining data
gretelai/gretel-pii-masking-en-v1Apache 2.0, Greteltraining data
gitleaks (MIT, Zachary Rice), betterleaks (MIT), microsoft/security-utilities (MIT), Nosey Parker (Apache 2.0, Praetorian Security)as listedregexes that generate the secret training strings
FakerMITsynthetic values
Wikipedia (wikimedia/wikipedia 20231101.zh)CC BY-SATraditional Chinese paragraphs that rank the vocabulary; no Wikipedia text is in the model
WikidataCC0the public persons and places lists

Evaluation sets: CredData (Yun et al., 2021, https://github.com/Samsung/CredData). Weibo NER, the revised annotation (weiboNER_2nd_conll in https://github.com/hltcoe/golden-horse): Peng and Dredze, "Named Entity Recognition for Chinese Social Media with Jointly Trained Embeddings", EMNLP 2015; Peng and Dredze, "Improving Named Entity Recognition for Chinese Social Media with Word Segmentation Representation Learning", ACL 2016; He and Sun, "F-Score Driven Max Margin Neural Network for Named Entity Recognition in Chinese Social Media", arXiv:1611.04234, 2016.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · token-classification

Можно запустить

Подбираем GPU…

Класс архитектуры
BertForTokenClassification
Ревизия весов
c2ca0cd

0 моделей