Instructions to use allsmart/Art4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use allsmart/Art4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="allsmart/Art4")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("allsmart/Art4") model = AutoModelForTokenClassification.from_pretrained("allsmart/Art4", device_map="auto") - Notebooks
- Google Colab
- Kaggle
ALLSmartArt4
People, organisations and addresses in German and English text, for masking and pseudonymising prompts before they reach a language model. Named after Art. 4 (1) GDPR: the basic form of personal data.
ALLSmartArt4 is one of three privacy models of ALLSmartLLM, where it runs in the privacy layer of the gateway on our own hardware in Austria. Together with ALLSmartArt4i (people identifiable without a name) and ALLSmartArt9-10 (special categories under Art. 9 and 10 GDPR) it covers what a name-only recogniser misses.
| Output | per word: PERSON, ORG, ADRESSE (independent sigmoid scores) |
| Size | 0.3B parameters, token classification on mmBERT-base |
| Languages | German (incl. Austrian and Swiss usage), English |
| Speed | ≈ 25 ms for 30 words, ≈ 90 ms for 250 words on a desktop CPU (Ryzen 7 7800X3D, 8 threads) |
What it gets right
The cases where general-purpose recognisers fail: lower-case names in chats ("hi tom"), initials ("Ferdinand L."), names in tables, CSV and logs, names that are also ordinary words, names from every language area. Roles, departments, rooms and code identifiers stay untouched. A place counts as an address only when it belongs to a person.
Laut Ferdinand L. von der Raiffeisenbank Mühlviertel wohnt Frau mag. eva huber in der Linzer Straße 12.
PERSON Ferdinand L.
ORG Raiffeisenbank Mühlviertel
PERSON Frau mag. eva huber
ADRESSE Linzer Straße 12
Usage
beispiel.py in this repository is a complete, dependency-light example (word split, windows for long texts, spans):
from beispiel import finde
finde("hi tom, die Lieferung geht an Rosseggerweg 7, 4553 Schlierbach.")
# PERSON 'tom', ADRESSE 'Rosseggerweg 7', ADRESSE '4553 Schlierbach'
# [{'von': 3, 'bis': 6, 'typ': 'PERSON', 'p': 0.999}, ...]
Two details matter for good results: split words the same way as in training (punctuation is its own word, see
WORT in the example) and process texts longer than 300 words in overlapping windows, taking the maximum per word.
Evaluation
All test sets were written and annotated independently of the training data, by separate agents that never saw the model or its training texts, and were never used for training or model selection.
Blind set: 120 short texts, German and English, 695 annotated values, many hard cases.
| values found | people found | precision | |
|---|---|---|---|
| ALLSmartArt4 | 93.8 % | 96.1 % | 92.1 % |
GLiNER (urchade/gliner_multi-v2.1, threshold 0.5) |
86.6 % | 81.3 % | 85.3 % |
Control set (890 values, ordinary business texts): 99.9 % found, precision 97.2 %.
Long documents: 40 invented documents of 700 to 2,800 words (minutes, e-mail threads, reports, interview transcripts; 53,838 words in total), whole documents in windows:
| people | organisations | address parts | precision |
|---|---|---|---|
| 94.8 % (1,559) | 96.3 % (163) | 87.8 % (74) | 83.6 % |
A hit counts when type matches and the spans overlap by at least half of the shorter one.
Limitations
- A place mentioned next to a person is sometimes taken for their address.
- Street names without a house number occasionally cause false alarms.
- On long documents precision drops (speaker abbreviations, headers, signatures); for masking a superfluous placeholder is the safer error.
- Trained and measured on German and English only.
Training data
Only invented texts in German and English, created for this purpose, in many text types (chats, e-mails, tickets, tables, logs, letters, minutes). No customer data and no real personal data were used.
License
Apache 2.0. Base model mmBERT-base (MIT).
Deutsch: ALLSmartArt4 erkennt Personen, Firmen und Adressen in deutschen und englischen Texten, auch klein geschriebene Namen im Chat, Initialen und Namen in Tabellen. Es läuft in der Privacy-Schicht von ALLSmartLLM auf eigener Hardware in Österreich und ist auch auf einer CPU schnell genug für den Betrieb.
- Downloads last month
- 7
Model tree for allsmart/Art4
Base model
jhu-clsp/mmBERT-base