/ Модель

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

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

mmBERT-pii-sentinel

Разметка токеновТекст → label8 профессий

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

112скачиваний за 30 дней2лайкавеса обновлены27 ноя 2026

Бенчмарки

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

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

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

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

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

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

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

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

В тестировании инструмента на небольшом наборе из 320 документов сообщаются точность определения чувствительности 90,9%, а также показатели точности и полноты для отдельных типов данных. Результаты относятся к инструменту с дополнительными правилами и постобработкой, а не к одной только модели в Transformers pipeline. Модель служит вспомогательным средством скрининга: она может пропускать персональные данные и не предназначена для юридически надёжной анонимизации. Обучение проводилось на синтетических текстах; форматы адресов и номеров охватывают по одной стране на язык, а качество может быть ниже на реальных документах с необычной структурой.

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

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

Ограничения

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

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

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

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

Также подходит для

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

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 1024 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.6.3 \
  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).
ADDRESSA person's street-level postal address.
ADDRESS_CORPORATEA company's, shop's or venue's address (not personal).
DATE_OF_BIRTHA person's date of birth.
EMPLOYMENTA person's employer, department, job title or role, including a title written next to the name.
HANDLEA person's social-media handle or login name.
HANDLE_BRANDA brand's or organisation's account (not personal).
IP_PERSONALAn IP address tied to a person.
IP_SERVERA server's or device's IP address (not personal).
MEMBER_IDA member, customer, employee or patient number.

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 tool
Person names97.5% / 98.6%
Phone numbers94.7% / 94.7%
E-mail addresses83.3% / 76.9%
ID and account numbers88.3% / 93.2%

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, and reports a role address or a company's address as not personal). The transformers pipeline alone (aggregation_strategy="simple") was not re-measured for this version.

Attributes, measured per document (a document counts as found when a finding of that type with pii: true is reported):

Recall / precisionpii-sentinel toolDocuments containing it
Workplace (employment_info)51% / 93%112
Date of birth90% / 86%20
Postal address94% / 70%17
Handle3 of 4 / 3 of 64
IP address of a person4 of 4 / 4 of 64
Document level (tool only)Result
Sensitivity (none / low / high) accuracy90.9%
high documents judged low or none4 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 window1024 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
Ревизия весов
9ae624c

0 моделей