/ Модель

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

Контекст
131 072 токена
Параметры
145 млн
Лицензия
Apache 2.0
Архитектура
privacy_filter · MoE
Базовая модель
privacy-filter
Опубликована
8 ноя 2026

swedish-pii-guard

Разметка токеновТекст → label7 профессий
118скачиваний за 30 дней1лайквеса обновлены17 ноя 2026

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

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

Модель выделяет персональные данные в шведском тексте для последующей маскировки перед передачей LLM, инструментам или журналам.

Swedish PII guard — предварительная модель от kognitiv-ai, полученная дообучением openai/privacy-filter. Она размечает персональные данные в шведском тексте, чтобы их можно было маскировать перед отправкой в LLM, записью в журналы или передачей инструментам. Модель содержит 145,4 млн параметров, использует MoE-архитектуру и формат safetensors; для запуска применяется runtime opf. Карточка указывает контекст до 131 072 токенов.

Модель выделяет 11 типов данных, включая имена, шведские персональные идентификаторы, номера документов, IP-адреса, телефоны, электронную почту, адреса, даты рождения, URL и секреты. Обучение проводилось на синтетических данных; оценка охватывала синтетические и новостные тексты. Лицензия — Apache-2.0.

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

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

  • маскировка персональных данных в шведском тексте перед отправкой в LLM
  • очистка шведских сообщений от имён, телефонов и электронных адресов
  • поиск personnummer и samordningsnummer в текстах
  • защита персональных данных в логах и выводах инструментов
  • обнаружение IP-адресов, URL и секретов в шведских текстовых данных

Ограничения

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

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

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

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

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

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

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

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

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

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

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

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

Открыть на Hugging Face

Swedish PII guard (preview)

A Swedish fine-tune of openai/privacy-filter. It finds personal data in Swedish text so the data can be masked before the text is sent to an LLM, written to a log or passed on by a tool.

Status: a starting point. We release the weights, the training data and the full recipe (the recipe/ folder of this repository) so others can build better Swedish and Nordic guards. Read Known gaps before you rely on it.

What it masks

11 labels: the base model's 8 plus national_id, id_number and ip_address.

LabelExamples
private_personfull names, first or last name alone, initials, genitives ("Annas")
national_idpersonnummer, samordningsnummer
id_numberpassport, ID card, patient/journal numbers
private_addresshome addresses, postcode + town of a person
private_phonepersonal and direct numbers
private_emailpersonal and named work addresses
account_numberbank account, bankgiro/plusgiro of a person, card, IBAN, customer numbers
private_datebirth dates and dates tied to one person (injury, move-in, employment start)
private_urlpersonal profiles and pages
secretpasswords, API keys, tokens, PINs, one-time codes
ip_addressIPv4 and IPv6 addresses

Deliberately not masked:

  • organisations, authorities and places;
  • org numbers, case and diary numbers;
  • switchboards and role mailboxes (info@, registrator@);
  • public dates (meetings, deadlines, decisions);
  • order and booking references.

An LLM usually needs these, and they don't identify a private person. The full policy is in recipe/POLICY.md.

How to use

The model uses the same runtime as the base model (opf):

from opf._api import OPF
guard = OPF(model="kognitiv-ai/swedish-pii-guard", device="cuda")
res = guard.redact("Hej, jag heter Karin Berg och mitt personnummer är 19121212-1212.")
for s in res.detected_spans:
    print(s.label, s.text)

We recommend snapping span edges to word boundaries (recipe/eval/postproc.py).

Training

  • Data: 100% synthetic. No real documents or personal data were used.
    • Open-weight LLMs (Qwen3.6-35B-A3B, Qwen3.8-27B, DeepSeek-V4.1-Flash, GLM-5.2) wrote about 100k Swedish texts with typed slots instead of values.
    • The slots were filled from name and address pools, with valid check digits.
    • Programmatic rows cover records, signatures, name-first texts and contrast pairs (e.g. an injury date vs a meeting date).
    • Negative slots (organisations, switchboards, public dates) are present but unlabelled.
  • Recipe: opf train, 2 epochs, lr 5e-5, batch 16, about 340k rows.
  • Final weights: a uniform average ("model soup") of three runs with different data-order seeds. It beat every single run.

Evaluation

All sets are Swedish, word-snapped, and none were used for training.

  • GPT test set: about 300 texts per split (business, tool output, chat, news), written and labelled by a GPT model; the reported split was never inspected.
  • Webbnyheter and SUCX3: public Swedish NER corpora (CC BY 4.0). Recall is measured on gold persons, and gold organisations and places count as must-not-mask.
ModelGPT test F1Person recall, news (Webbnyheter)Person recall, SUCX3Orgs / places wrongly masked, SUCX3
openai/privacy-filter (base)0.700.560.41
OpenMed/privacy-filter-multilingual-v2 †0.690.840.7530% / 31%
emiemimi/privacy-filter-multilingual-500 †0.730.790.6833% / 46%
this model0.920.900.8023% / 13%

† Decoded with plain argmax and with labels mapped to ours. Their policies differ (for example, OpenMed masks all dates), so treat these rows as indicative.

By type, on a GPT dev set:

  • About 100% recall: personnummer, bank/card/IBAN numbers, phone numbers, e-mail addresses, URLs, addresses, birth dates, IP addresses.
  • Secrets, including PINs: about 98%.
  • Names: about 91%. Person-tied dates: about 84%. Passport/ID/patient numbers: about 72%.

Known gaps

  • Names in running prose are missed about 10–20% of the time, especially short or word-like names (Sol, Ek, Lo) and surnames used alone.
  • Organisations and places in news text are still masked too often (13–23%).
  • ID document numbers (passport, ID card, patient numbers) are the weakest type (about 72% on our dev set).
  • Ambiguous words are sometimes masked: the pronoun "Hans" (his) as a name, or a public date written without a year ("den 1 januari").
  • Not a GDPR special-category detector. Health, ethnicity, religion and the like are context, not spans, and are not masked.
  • Evaluated on synthetic and news text only. No real business documents were used for testing. Check its output before you rely on it, and test it on your own data first.

Acknowledgement

Thanks to AI Factory Sweden, through AI Göteborg, for pointing us to the EuroHPC AI Factories access programme.

We acknowledge EuroHPC JU for awarding the project ID EHPC-AIF-2026FL01-1143 access to the Arrhenius GPU partition hosted by NAISS at Linköping University, Sweden. All training and evaluation of this model ran on that allocation. Some template-writing calls used hosted APIs (DeepSeek-V4.1-Flash, GLM-5.2).

Licence

Apache 2.0, the same as the base model.

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

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

GPU в ailist

Универсальный рантайм

Нельзя запустить

Не удалось определить, чем загружать веса модели (нет library_name и architectures).

Ревизия весов
1291338

0 моделей