/ Модель

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

Контекст
512 токенов
Параметры
435 млн
Лицензия
MIT
Архитектура
electra · dense
Базовая модель
gelectra-large
Библиотека
transformers
Опубликована
20 ноя 2026

german-clinical-deid

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

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

157скачиваний за 30 дней1лайквеса обновлены24 ноя 2026

Бенчмарки

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

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

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

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

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

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

German Clinical De-identification — модель разметки токенов, разработанная Lukas Kunhardt для поиска персональных данных в немецких клинических текстах перед их редактированием или обезличиванием. Она выделяет 18 типов данных, включая имена, даты, адреса, телефоны и идентификаторы. Модель дообучена на deepset/gelectra-large; в карточке указано 434,5 млн параметров, архитектура ELECTRA и контекст до 512 токенов. Доступны веса Safetensors и ONNX, включая варианты для transformers.js.

Для редактирования клинических записей автор рекомендует пакет german-clinical-deid и порог вероятности 0,01: обычный режим pipeline пропускает больше персональных данных. Модель обучалась только на синтетических письмах; в немецком она показала результаты на тестах GraSCCo и MDeID. Лицензия — MIT.

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

German Clinical De-identification

A token classifier that finds names, dates, addresses, phone numbers, IDs and other personal information (18 types, as in GraSCCo) in German clinical text, so that you can redact it. It is based on gelectra-large (335M parameters) and was trained only on synthetic letters.

For German I recommend the smaller german-clinical-deid-base (109M) first: it leaks about as rarely (table below). This model leaks less than the base model in five of the six other MDeID languages.

Quick start

pip install transformers torch
from transformers import pipeline

ner = pipeline("token-classification", model="LukasKunhardt/german-clinical-deid",
               aggregation_strategy="simple", stride=128)
text = "Herr Max Muster (geb. 03.02.1961) wurde am 12.05.2024 im Klinikum Nord aufgenommen."
for e in ner(text):
    print(e["entity_group"], text[e["start"]:e["end"]], round(float(e["score"]), 2))
NAME_PATIENT Max Muster 1.0
DATE 03.02.1961 1.0
DATE 12.05.2024 1.0
LOCATION_HOSPITAL Klinikum Nord 0.97

The pipeline gives each token its most likely label. That misses far more than the reading the model was tuned for, which redacts every token whose probability of being personal is at least 0.01 (stored in config.json): on the German MDeID test the pipeline leaks in 21.9 % of notes, the 0.01 reading in 11.7 %. For redaction, use the helper package: pip install german-clinical-deid, then Deidentifier("LukasKunhardt/german-clinical-deid").redact(text) (code on GitHub, also Presidio and spaCy).

Browser and Node

onnx/model.onnx (fp32) and onnx/model_quantized.onnx (embedding table in int8) run in transformers.js; in my Node test (version 3.8.1) both gave the same entities.

import { pipeline } from "@huggingface/transformers";

const ner = await pipeline("token-classification", "LukasKunhardt/german-clinical-deid", { dtype: "q8" });
const out = await ner("Herr Max Muster (geb. 03.02.1961) wurde am 12.05.2024 im Klinikum Nord aufgenommen.");
console.log(out.map(e => `${e.entity} ${e.word}`).join(", "));
NAME_PATIENT Max, NAME_PATIENT Muster, DATE 03, DATE ., DATE 02, DATE ., DATE 1961, DATE 12, DATE ., DATE 05, DATE ., DATE 202, DATE ##4, LOCATION_HOSPITAL Klinikum, LOCATION_HOSPITAL Nord

transformers.js returns one entry per token, so you join neighbouring tokens yourself. The int8 file is only 7 % smaller than fp32 and slower on CPU (1,850 against 1,266 ms per text). For a smaller download use onnx/model_fp16.onnx (669 MB) or the base model.

Results

Test sets: the 41 test letters of GraSCCo (real letters with hand-replaced identifiers) and the MDeID test split (synthetic notes, 402 German and about 410 in each of six other languages). A document has a leak if a name, ID, phone or fax number, e-mail address or street stays readable. Strict typed F1 needs start, end and type to match. Here other models ran at the better of their default and a tuned threshold.

Model and readingSizeGraSCCo char F1GraSCCo letters with a leakMDeID German notes with a leakMDeID German strict typed F1
this model, threshold 0.01 (model.onnx)335M0.9602 / 4111.7 %0.475
this model, plain pipeline335M0.9803 / 4121.9 %not measured
german-clinical-deid-base, threshold 0.01109M0.9481 / 4111.2 %0.439
Ibrahimbaroud/personal-information-detection-german109M0.9735 / 4178.6 %0.300
Horizon-Labs/pii-redactor-base308M0.8328 / 4123.4 %0.363

Notes with a leak on the MDeID German test set against model size

The chart shows each model's best threshold reading against its size (F1 chart). PyTorch, model.onnx and model_fp16.onnx give the same numbers.

On all seven MDeID languages the other models ran at their default label (openai/privacy-filter through its own package):

Model and readingChar F1Notes with a leak
this model, threshold 0.01 (model.onnx)0.92715.2 %
this model, plain pipeline0.89835.8 %
Horizon-Labs/pii-redactor-base0.90047.8 %
obi/deid_roberta_i2b20.77868.3 %
StanfordAIMI/stanford-deidentifier-base0.64175.4 %
openai/privacy-filter (opf, Viterbi)0.76190.3 %

Notes with a leak per language:

Readingdeenesfritnlptall 7
threshold 0.01 (model.onnx)11.7 %24.3 %15.7 %8.8 %9.7 %24.0 %12.2 %15.2 %

I compared training data versions by their test scores, so these numbers are probably a little optimistic; threshold and seed came from development data. RESULTS.md has all models, the int8 file, confidence intervals and every look at the test sets.

Other languages: MultiGraSCCo

MultiGraSCCo (Baroud et al., 2026, CC BY 4.0) translates the 63 GraSCCo letters into nine languages with the same labels. I scored the same 41 test letters in every language and compared with the authors' open models, one per language, which were trained on about 65 % of the sentences of these letters. Character F1:

Model and readingdeenfritpltrruukarfamean of 9 translations
german-clinical-deid, plain pipeline0.9800.9290.8470.8380.8230.7060.5660.5900.1750.0030.609
german-clinical-deid, threshold 0.010.9600.9210.8140.8360.7350.6050.5600.5770.1810.0280.584
authors' model for that language (trained on these letters)0.9760.9620.8580.8910.8800.8630.9170.9010.9710.9290.908

The authors' models have the higher F1 in every translated language. In German this model is level with theirs (0.980 against 0.976). This model was trained on German only; in Cyrillic, Arabic and Persian script it fails, because the German vocabulary of its base model does not cover them.

Paired bootstrap over the 41 German test letters (2,000 resamples), this model minus the authors' German model, character F1: plain pipeline +0.004 (95 % interval −0.008 to 0.015), threshold 0.01 −0.016 (95 % interval −0.029 to −0.005). So the plain pipeline is level with theirs and the 0.01 reading is slightly behind.

An additional measure of my own, not a standard one: the share of letters in which a name, ID, phone number or street stays readable (less than half redacted).

Model and readingdeenfritpltrruukarfamean of 9 translations
german-clinical-deid, threshold 0.014.9 %7.3 %17.1 %19.5 %34.1 %24.4 %97.6 %97.6 %100.0 %100.0 %55.3 %
german-clinical-deid, plain pipeline7.3 %9.8 %22.0 %26.8 %41.5 %61.0 %97.6 %97.6 %100.0 %100.0 %61.8 %
authors' model for that language (trained on these letters)14.6 %12.2 %26.8 %26.8 %43.9 %36.6 %26.8 %24.4 %22.0 %31.7 %27.9 %

Development numbers and span F1 are in RESULTS.md.

Limits

  • It does not work for Russian, Ukrainian, Arabic or Persian text (MultiGraSCCo, above).
  • Check the output before you share text: the model misses some identifiers. I have not tested it on real hospital letters yet.
  • If you have annotated clinical text, partner_eval.py measures the model at your site and writes only sums (no text). I would be glad to hear the numbers.
  • Removing identifiers is not anonymisation under the GDPR. It is a research tool, not a medical device.

Training

  1. A script invents a case, an open-weight model (DeepSeek V4.1 Flash or GLM-5.3) writes the letter, and the script labels every invented value: 2,550 letters in LukasKunhardt/synthetic-german-clinical-letters. gpt-oss-120b and Gemini 4 Argon screened them for unlabelled personal data; I dropped every flagged letter.
  2. I fine-tuned deepset/gelectra-large for 3 epochs (learning rate 3e-5, batch size 16, 512-token windows), each letter three times with fresh identifiers, and kept the seed of three with the fewest leaks on development data. One run takes about 45 minutes on one NVIDIA A10G.

License

MIT, like the base model. The letter-writing models allow free use of their outputs. GraSCCo (CC BY 4.0), MDeID (CC BY-NC 4.0) and SPARCLING-DE were used for testing only.

Citation

@misc{kunhardt2026germandeid,
  author = {Kunhardt, Lukas},
  title  = {German Clinical De-identification},
  year   = {2026},
  url    = {https://huggingface.co/LukasKunhardt/german-clinical-deid}
}

Lukas Kunhardt, ORCID 0000-0001-5135-6427. Questions and bug reports are welcome in the Community tab or as GitHub issues.

Versions

  • v1.0.12: code repository README shows how to use the model as a Presidio recognizer. Model files and numbers unchanged.
  • v1.0.11: bootstrap interval for the German MultiGraSCCo comparison; partner_eval.py in the code repository to measure the model on your own annotated documents. Model files unchanged.
  • v1.0.10: MultiGraSCCo section now leads with character F1 (the standard measure); the leak share is shown as an additional measure. Model files unchanged.
  • v1.0.9: the helper package is on PyPI (pip install german-clinical-deid). Model files unchanged.
  • v1.0.8: MultiGraSCCo results in nine more languages (card and RESULTS.md). Model files unchanged.
  • v1.0.7: new onnx/model.onnx and onnx/model_quantized.onnx, measured on both test sets; onnx/model_int8.onnx replaced by model_quantized.onnx and removed. Weights unchanged.

Kurz auf Deutsch

Das Modell findet persönliche Angaben in deutschen Arztbriefen, damit man sie schwärzen kann. Der pipeline-Weg aus dem Schnellstart lässt auf dem deutschen MDeID-Test in 21,9 % der Notizen etwas lesbar, mit der Schwelle 0,01 aus dem Hilfspaket 11,7 %. Bitte prüfen Sie die Ausgabe vor der Weitergabe; es ist kein Medizinprodukt.

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
ElectraForTokenClassification
Ревизия весов
6f6a9b6

0 моделей