IsomorphismLive demo.
Pick a text or write your own. The real Python package runs in your browser (through Pyodide) and replaces Swiss personal data with placeholders, lists what it found for an audit log, and puts the values back into an answer.
Everything runs in this page. Nothing you enter is sent anywhere. Starting the demo downloads the Python runtime (about 10 MB) from jsDelivr once.
Runtime
Start the demoPython 3.12 in your browser.
The package is pure Python without dependencies, so it runs unchanged in Pyodide, a Python build for WebAssembly. The page loads the runtime from jsDelivr and installs the published wheel from this site.
Anonymise
Text in, placeholders outSame value, same placeholder.
Every AHV number, IBAN, UID number, phone number and email address becomes a placeholder such as [AHV_1]. A value that appears twice gets the same placeholder, so a model can follow who is meant. Names and postal addresses are not recognised yet and stay in the text.
…
Restore
Answer in, real values backIn one pass.
The model works with placeholders and returns them in its answer. restore() puts the real values back. Models sometimes change the case or add spaces inside the brackets; those still match. Placeholders that are not in the mapping stay as they are.
…
Next
Use it in your codepip install isomorphism.
The demo calls the same functions you use in Python. The docs cover the API, the formats and the confidence values.
from isomorphism import anonymize, restore
text = "AHV 756.1234.5678.97, IBAN CH93 0076 2011 6238 5295 7, Tel. 071 123 45 67"
safe, mapping = anonymize(text, lang="de")
# 'AHV [AHV_1], IBAN [IBAN_1], Tel. [PHONE_1]'
answer = call_your_model(safe)
print(restore(answer, mapping))
for f in mapping.findings: # audit log, no values
print(f.kind, f.start, f.end, f.confidence, f.detector, f.checksum_ok)