Repository navigation
Releases
Tarnkappe v0.7.2
Bug fix.
Company names with a legal form no longer swallow the words before them. "Hi, I'm Laura Becker from Nordwind GmbH" was detected as one company, so the person was missed. Now the company is "Nordwind GmbH" and Laura Becker is found as a person. The name starts after words such as "from", "at", "bei", "by", "with", "seit" or "is"; words that can be part of a name ("für", "am", "of", "und") are kept, so "Gesellschaft für Informatik e.V." stays whole.
Scores on hand-labelled real pages and on the public benchmarks are unchanged.
Tarnkappe v0.7.1
Documentation only; the detector is the same as v0.7.0.
Largest clean real-page test so far: 45 new hand-labelled snippets from five people's scans (141 organisations, 60 persons). Answers were saved before labelling and nothing was tuned on them.
| v0.6 | v0.7 | Bar | |
|---|---|---|---|
| Organisations found | 86.5% | 87.9% | 80% |
| Organisation detections correct | 89.7% | 89.9% | 85% |
| Persons found | 100% | 100% | 95% |
| Person detections correct | 92.1% | 92.1% | 85% |
The release bar is met on this test. The 95% range for organisations found is about 83–93%.
These pages are mostly business profiles, press releases and interviews. On a smaller clean test of political news and blogs (18 snippets), organisations found was 71%, so expect lower figures on such pages.
Still missed: small startup and event brand names without context.
Sometimes marked wrongly: job-title fragments such as "Platform Solutions".
v0.7.0
Rules only; same model as v0.6.
Changes
- A list of about 250 well-known organisations without a legal form (parties, broadcasters, newspapers, public bodies, chambers, associations, companies whose name is also their platform's). Matched with exact capitalisation on scanned web pages; ambiguous names count only next to another organisation.
- A lone lower-case or all-capitals word taken for a person becomes a company candidate.
- Fix (present since v0.4): a company name known from its legal form elsewhere in a scan is no longer dropped where the tagger found it too.
- Labelling rule: organisations inside compound words count ("SPD-Mitglied"), and so do platform names that are also company names, also where used as a place ("auf Facebook").
Clean test (18 new real-page snippets, answers saved before labelling)
- Organisations found 71% (v0.6: 56%), detections correct 97% (v0.6: 96%).
- Political news is over-represented in this batch.
All 203 labelled snippets (mostly used for tuning)
- Organisations found 82.1% (v0.6: 72.8%), detections correct 88.4% (v0.6: 87.5%).
Public benchmarks are unchanged.
Not met yet: the 80% bar for organisations found on a clean real-page test.
v0.6.0
A retrained tagger for organisations.
What counts as an organisation: anything a person can work for or belong to: companies, public bodies, media, universities, clubs, parties and associations. Products and apps don't count unless the name is also the company's (eval/README.md).
Changes
- Tagger retrained with 5,500 more Wikipedia paragraphs about companies (3,500 German) and 12,000 sentences with organisation names in running text.
- Company check retrained.
- A name after a job title and "at"/"bei" is read as the employer ("Director of … at BASF").
Clean tests
- 26 fresh hand-labelled real-page snippets: organisations found 68% (v0.5: 63%), detections correct 90% (v0.5: 80%).
- 109 unseen
v0.5.0
Rules only; same model files as v0.4.0.
Phones
- Numbers next to a phone word ("Tel.", "contact", "customer care", "Tél.", "Telefono", "hotline", …), also with slashes.
- Numbers starting with 0 are no longer read as card numbers.
- Untouched test of 1,000 synthetic European phone sentences (40 countries): 99.2% found (v0.4: 89.0%), no false phone hits.
- Presidio: phones 88% (v0.4: 63%), postcodes 78% (v0.4: 33%). Tuned on that set, so not a clean figure.
Companies
- Context rule: "worked at X", "bei X", "Agentur X", "Title @ X".
- A company name accepted on two pages of a scan is matched on every page of that scan.
- One-word "persons" that are mostly company names (e.g. Porsche, Lufthansa) become companies.
- Clean test on 57 new hand-labelled real-page snippets: companies found 67% (v0.4: 66%), 79% of company detections correct; persons found 99%.
- The 80% company bar is not met yet. Retraining the tagger is planned for v0.6.
v0.4.0
Tarnkappe v0.4.0: far fewer false company flags on scanned web pages.
What changed
- Company names in training: 10,000 page-like examples built from about 8,300 real company names (CC0 sample from CompanyData.com's public datasets; STOXX Europe 600 and S&P 500 constituents), with and without legal forms, plus job titles, fields, page buttons and technology words marked as not companies.
- Second check on companies (tarnkappe/orgcheck.py): a 107 KB classifier rates every company detection under profile="pages" and drops unlikely ones. Companies with a legal form always pass.
- More legal forms for the company rule: SL, SLU, SA, SRL, S.a r.l., SpA, LP, NV, AS, ASA, Sp. z o.o. and capitalised variants.
Results
21 real scanned snippets, never used for tuning (pages profile, detect_scan, scanned person's name):
- v0.3: persons found 100%, companies found 62%, company detections correct 62%
- v0.4: persons found 100%, companies found 62%, company detections correct 87%
Persons found with default thresholds: tweets 79.8% → 83.2%, social media 79.7% → 85.3%, English web text 95.8%, German news 96.2%. Median latency 1.4 ms per short text.
Not yet good enough
Companies found on real pages is still 62% (bar 80%): well-known brands written without a legal form are often missed. Phone and postcode recall on the Presidio test fell (75% → 63%, 44% → 33%).
Full figures in RESULTS.md. Code Apache 2.0, model weights CC BY-SA 4.0.
v0.3.0
Tarnkappe v0.3.0: fast PII detection for English and German, now packaged as tarnkappe and retrained for web pages.
What's new
- Package
tarnkappe(pip install .), API withprofileoption, Dockerfile. - The tagger reads line breaks; retrained with 11,000 teacher-labelled Wikipedia paragraphs shaped like web pages.
profile="pages"threshold set for scanned web pages; default thresholds stay recall-first for chat and social text.detect_scan(det, pages, profile="pages", profile_names=[name]): shares company names across one scan and finds the scanned person's own name everywhere.- Rules: " GmbH / UG / Ltd / plc ..." is a company; street names and user names are never companies.
- Long pages processed in windows (about 14,000 tokens per second per core).
How good it is
On 23 real scanned snippets from four people, with answers saved before labelling:
- Persons: 100% found, 93% of person detections correct.
- Companies: 92% found, but only 34% of company detections correct (46% after fixes made on seeing them).
Persons, e-mail addresses, phone numbers and addresses are the reliable part; treat company flags as hints.
Persons found in tweets fell from 88% to 80% with the retraining. Full figures in RESULTS.md.
Licences
Code Apache 2.0, model weights CC BY-SA 4.0 (see NOTICE for training data credits).
v0.2.0
First tagged version of Tarnkappe: fast, small PII detection for English and German text.
What's included
- Pattern layer for email, phone, IBAN, credit card and IP address
- 2.5M-parameter ONNX tagger for names, organisations, streets, postcodes and locations, with a rule that splits first and last name
- Python API (
from pii import Detector), FastAPI service, Dockerfile - Training script, benchmark and tests
Measured
- Person F1 on human-labelled test sets: 0.82 English web text, 0.82 German Wikipedia/news, 0.77 German news, 0.49 social media
- 83% of personal data found on Presidio test sentences from templates unseen in training; 97.5% of flagged spans are real
- About 1.4 ms per short text on one CPU core; 5 MB model plus 25 MB word vectors
Full numbers are in RESULTS.md.
Known limits
- Prototype. Not yet compared with GLiNER-class models, which are expected to be more accurate.
- English and German only. Weak on organisations, informal text, and foreign phone and postcode formats.
- A data-minimisation aid, not a guarantee of anonymisation.
Licences
Code: Apache 2.0. Model weights: CC BY-SA 4.0. Credits in NOTICE and model/README.md.