/ Модель

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

Контекст
8 192 токена
Параметры
307 млн
Лицензия
MIT
Архитектура
modernbert · dense
Базовая модель
mmBERT-base
Библиотека
transformers
Опубликована
27 сен 2026

mmBERT-pii-sentinel

Разметка токеновТекст → label

Дообученная многоязычная модель ModernBERT размечает персональные данные в тексте и помогает оценивать чувствительность документов.

47скачиваний за 30 дней1лайквеса обновлены10 окт 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

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

mmBERT-pii-sentinel — дообученная модель coo-quack на базе jhu-clsp/mmBERT-base для обнаружения персональных данных в тексте. Она размечает символьные фрагменты с именами, адресами электронной почты, телефонами и номерами документов, карт и счетов. Дополнительные головы классифицируют чувствительность документа по уровням none, low и high и относят найденные данные к 19 категориям; для этих функций README указывает инструмент pii-sentinel, а не стандартный pipeline Transformers.

Модель построена на ModernBERT и содержит 306,9 млн параметров; контекстная длина в метаданных — 8192 токена. Обучение проводилось на окнах по 512 токенов. Модель предназначена для проверки документов, сообщений, журналов и наборов данных перед публикацией или передачей внешним сервисам; обработку можно выполнять локально. Поддерживаемые языки — английский, французский, итальянский, немецкий, испанский, японский, китайский и корейский.

Лицензия — MIT. Это вспомогательный инструмент скрининга, а не гарантия обнаружения всех утечек и не средство юридически достаточной анонимизации. Обучение и оценка проводились на синтетических текстах; необычная структура реальных документов может ухудшить результат. Форматы номеров и адресов охватывают по одной стране для каждого языка, а оценка на небольшом тестовом наборе может быть неточной.

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

  • поиск имён, телефонов и адресов электронной почты в документах
  • проверка журналов и сообщений перед передачей внешнему сервису
  • поиск идентификаторов и финансовых номеров в текстовых наборах данных
  • сортировка документов по уровню чувствительности
  • предварительная проверка текста на персональные данные перед публикацией

Ограничения

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

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

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

Открыть на Hugging Face

mmBERT-pii-sentinel: Multilingual Personal-Information Detection

License: MIT GitHub Base model

TL;DR: A fine-tuned mmBERT-base that finds person names, contacts and ID numbers in eight languages, and judges how sensitive a document is.

mmBERT-pii-sentinel labels personal information in text as character spans: person names, e-mail addresses, phone numbers, and ID, card and account numbers. It loads as a standard ModernBertForTokenClassification model, so the transformers pipeline runs it as it is. Two more heads judge the whole document: a sensitivity level (none, low or high) and 19 categories of personal information. Those are read by the pii-sentinel tool, which also adds a regex rule set and runs everything on your own machine.

Table of Contents

Quick Start

Installation

pip install torch transformers

Tested with transformers 5.18 and torch 2.14.

Usage

from transformers import pipeline

ner = pipeline("token-classification", model="coo-quack/mmBERT-pii-sentinel", aggregation_strategy="simple")
for entity in ner("Hi, this is Emily Carter. Call me at +1 415 555 0142 or emily.carter@example.org."):
    print(entity["entity_group"], entity["word"].strip(), round(float(entity["score"]), 3))
PERSON Emily Carter 1.0
PHONE +1 415 555 0142 0.98
EMAIL emily.carter@example.org 1.0

The model was fine-tuned on windows of 512 tokens; split longer texts, or use the tool below, which does it for you.

Full analysis with the pii-sentinel tool

For the document's sensitivity level and categories, the regex rules and the post-processing, use the command-line tool. It needs uv:

uvx --from git+https://github.com/coo-quack/pii-sentinel@v0.4.0 \
  pii-sentinel scan --model coo-quack/mmBERT-pii-sentinel document.txt
document.txt: sensitivity high
  person_name: S…
  person_name: D…
  phone: 41…98

The scanned text never leaves the machine; the only network access is the one-time download of the model. See the README for the options, the JSON report and use in CI.

Model Description

Intended for checking documents, messages, logs or datasets for personal information before they are shared, published or sent to an external service, and for sorting documents by sensitivity so that the high ones get a closer look.

It is a screening aid, not a guarantee: it will miss some personal information, and it should not be the only safeguard for data that must not leak. It is not designed for anonymising text for legal purposes.

Sensitivity levels

LevelMeaningExamples
noneNo personal information.A release note, a product description, a company's switchboard number.
lowPersonal information.A name with an e-mail address, a customer's postal address, a date of birth, an IP address or a social media handle tied to a person.
highSpecial categories of personal information.Health, genetic or biometric data, religion, political opinions, sexual orientation, immigration status, ID and card numbers, HR and criminal records.

The levels follow GDPR, Japan's Act on the Protection of Personal Information and the CPRA. A famous person who has died is not counted as personal information; a living one is. The full rules are in the labelling policy.

Categories

Person name, e-mail or phone, postal address, date of birth, government ID, financial account, health, biometric or genetic data, IP address of a person, social media handle, employment, race or religion, political opinion or union membership, sex life or orientation, citizenship or immigration, precise location, credentials, private communications, HR or criminal record.

Labels

The token-classification head uses BIO tags over these entity groups:

Entity groupWhat it marks
PERSONA person's name: full name, surname or given name alone, a nickname that refers to a specific person.
EMAILA person's e-mail address.
EMAIL_GENERICA role address such as support@ (not personal).
PHONEA person's phone number.
PHONE_CORPORATEA company's or department's number (not personal).
MY_NUMBERJapan's individual number.
NATIONAL_IDAnother national or government ID number.
PASSPORT_LICENCEA passport or driving licence number.
CREDIT_CARDA payment card number.
BANK_ACCOUNTA bank account number.
ORDER_TRACKINGAn order or tracking number (not personal; learnt so that it is not mistaken for an ID).
SERIALA product serial number (not personal; same reason).

Evaluation

Measured on a held-out test set of 320 documents, 40 in each of the eight languages, written for this project to cover the sensitivity categories, document formats and lengths. Each document was labelled independently twice and disagreements were adjudicated. Only personal values are counted.

Recall / precisionpii-sentinel tooltransformers pipeline
Person names97.9% / 96.7%97.0% / 96.7%
Phone numbers94.7% / 90.0%94.7% / 90.0%
E-mail addresses91.7% / 84.6%87.5% / 63.6%
ID and account numbers83.1% / 90.1%76.6% / 50.0%

The tool column is the model with the regex rules and the post-processing (which, for example, drops hashes and UUIDs that look like numbers); the pipeline column is this model alone with aggregation_strategy="simple".

Document level (tool only)Result
Sensitivity (none / low / high) accuracy90.0%
high documents judged low or none2 of 162
Documents with personal information judged none7 of 246

The test set is small: a difference of one or two documents is within noise.

Model Architecture

ParameterValue
Base modeljhu-clsp/mmBERT-base, revision c5955035435e2bf121cde7f3c8863ef52ff35d82
ArchitectureModernBertForTokenClassification, plus document heads
Layers22
Hidden size768
Attention heads12
Parameters308M
Vocabulary size256,000 (Gemma 2 tokenizer)
Fine-tuning window512 tokens
Languages trained and evaluatedja, zh (Simplified), ko, en, fr, it, de, es

All encoder layers are fine-tuned. The files are model.safetensors and config.json (the token-classification model), the tokenizer files, and document_heads.safetensors with pii_sentinel.json (the sensitivity and category heads, read by the pii-sentinel tool).

Training Data

Synthetic documents generated from templates in the eight languages. Every person, number and address is fictional, except famous historical figures used as public-figure examples. Labels come from what each template planted, not from a model. No real personal data and no outputs of other PII models are used.

Limitations

  • Trained only on synthetic text; real documents with unusual layouts may be harder.
  • Number and address formats are covered for one country per language (for example, Simplified Chinese only).
  • mmBERT-base was pre-trained on many more languages, but this model was fine-tuned and evaluated on the eight above only.
  • The document level is weakest where only a heading reveals the sensitive fact (a member list of a religious community) and where a document holds an online identifier or an address without a name.

License

MIT (see LICENSE). The base model is also MIT; its notice is reproduced in THIRD_PARTY_NOTICES.md. This model is not affiliated with or endorsed by the authors of mmBERT.

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
ModernBertForTokenClassification
Ревизия весов
7ea039b

0 моделей