Go to top

How Balo builds legal PII anonymization with Ellf and Prodigy

We’ve talked to Bojan Konic, co-founder of Balo, about how their small team built on-device anonymization for some of the most privacy-sensitive documents, and how they used Ellf for agentic NLP development to find blind spots in their data and move to a new model architecture, improving their accuracy on German and French legal text.

Balo builds anonymization solutions for courts, administrations and organizations in the legal sector. What started as a side project by two people with a vision and a single license to Prodigy is now used by law firms, courts and institutions across Europe, including the superior courts of the cantons of Aargau and Basel-Stadt in Switzerland.

From search and replace to AI-powered anonymization

Courts publish their decisions online, and before they can do that, every name, organization, address and other piece of identifying information needs to be removed or replaced. Balo’s main product, A-Tool, runs on local servers in the customer’s own network and provides integrations to anonymize and pseudonymize names, organizations and locations in Word and PDF documents in a single click.

Balo's A-Tool: integration in Microsoft Word and standalone application for PDFs and A-Tool Guard
Balo’s A-Tool for anonymizing and pseudonymizing Word and PDF documents

With A-Tool Guard, launched in September 2026 and running entirely on a single Windows PC, lawyers can now also pseudonymize their documents before sharing them with ChatGPT, Claude and other AI assistants, so they can take advantage of modern AI-powered workflows without any sensitive data leaving their machines.

Small, fast, private – and very accurate

Because everything runs locally on the customer’s servers or machine, A-Tool needs to ship with a model that runs on CPU and is both small and fast. Nobody wants to install a 10 GB package to anonymize a Word document. At the same time, the bar for accuracy keeps rising.

A few years ago, customers were more forgiving of mistakes. Now everyone has used ChatGPT and expects near-perfect results from AI. So we’re always improving our models, while keeping them compact and easy to use.

— Bojan Konic, Co-Founder

The core task behind A-Tool is named entity recognition: finding people, organizations, locations, addresses and other identifying information across a wide range of domain-specific documents. spaCy was a natural choice for this, and Balo started by creating their own data to train, fine-tune and evaluate custom models for German legal text with the Prodigy annotation tool. Their corpus now encompasses over 260,000 examples of PII in German and French legal documents.

The named entity recognizer is complemented by a rule-based matcher for structured information like URLs and custom logic for splitting sentences. Everything is packaged as a single spaCy pipeline.

Balo's spaCy pipeline: tokenizer, sentencizer, pattern matcher, transformer and named entity recognizer

To bootstrap data for new languages and edge cases, the team uses a human-in-the-loop distillation workflow: prompts to OpenAI’s API generate synthetic training examples, which are then reviewed and corrected by hand in Prodigy. Real-world feedback from customers drives each new iteration. This curated mix of data, shaped by years of experience with real customer documents, is now one of Balo’s most valuable assets.

Taking it further with Ellf

Balo already had a good workflow in place, but every training run, evaluation and annotation round had to be orchestrated manually. For a team of two juggling product development, sales and customer support, that put a natural limit on the number of experiments they could run, and there was nobody to bounce technical decisions off.

The Ellf platform: project plan and Claude Code with example prompt: "/ellf-train Set up the model training for the reproduce-spacy-de-pipeline project and report back with the results and analysis."
The Ellf platform with a project plan, operated by Claude Code

Ellf gives coding assistants like Claude Code or Codex superpowers for solving NLP problems and a platform to execute data-centric projects, automated annotation, evaluation and more. To keep their data private and run experiments, Balo plugged in a cluster on their own GPU server, which only took a single conversation with Claude Code to set up.

With Ellf, I can just tell Claude Code what I want to do, and it translates that into the right steps.

— Bojan Konic, Co-Founder

Jackknifing to find blind spots in the data

After years of growing a corpus from examples, customer feedback and successive annotation rounds, some inconsistencies are inevitable, and they’re hard to find in a corpus of this size. Balo used jackknifing to surface them:

Flowchart showing the jackknifing workflow: splitting the annotated data into folds, training one model per fold on the other folds, finding confident disagreements with Ellf, reviewing and correcting them in Prodigy, updating the corpus with the corrections and repeating, resulting in cleaner data and a better model

  1. Split the data into several folds.
  2. Train one model per fold on all of the other folds, so every example is predicted by a model that has never seen it during training. On Balo’s GPU cluster, four of these training jobs ran in parallel.
  3. Compare the predictions with the existing annotations. Where a model confidently disagrees with the annotation, the annotation is a likely error, or at least an edge case worth a second look.
  4. Review the disagreements with Prodigy in Ellf and correct the data.
  5. Retrain on the corrected data and repeat.

Jackknifing is a well-established technique, but it’s rarely used in practice because of how much orchestration it requires: multiple training jobs, predictions on held-out data, a review queue and a retraining loop. With Ellf, Bojan was able to set up the whole workflow automatically via Claude Code. The disagreements arrived as annotation tasks in Ellf, ready to review with Prodigy.

Ellf and Claude Code set up the whole workflow and guided me through every step. And whenever it found data I should look at, it’d start up an annotation task, and it was my job to review the edge cases and decide on the guidelines. That’s what Ellf promises – “vibe NLP” – and it really works!

— Bojan Konic, Co-Founder

For the German data, Balo ran three rounds of jackknifing and corrections, each with a different focus, and a fourth round to check if there was anything left to fix. The biggest improvement came from labeling courts, prosecutors and councils consistently, which increased the recall for organizations by 6.4 percentage points.

 FocusCorrectionsF-scoreRecall gain
Round 1Span fixes1,0680.9476–
Round 2Organizations3560.9496+6.4 pp ORG
Round 3Locations3000.9497+1.6 pp LOC
Results are for the CNN model, evaluated on the cleaned German evaluation set of 2,112 examples. The overall F-score only moves slightly, because each round targets a single label, but the gains show up in the per-label recall.

Once the fourth round didn’t surface any new types of errors, the team knew it was time to stop: the model’s remaining errors were now much more likely to be genuinely hard cases than artifacts of noisy data.

A new transformer architecture

At some point, Ellf told Bojan what many data-centric projects eventually run into: the data was now in good shape, and further improvements would have to come from the model itself. The CNN architecture was simply hitting its limits. It’s very fast, but it only considers a small context window around each word, which makes it hard to reliably recognize an organization name that spans many words, something that occurs often in French legal texts.

Bojan wasn’t up to date on the latest models, or whether a multilingual model or separate models per language would work better. Using Ellf’s knowledge base, Claude Code suggested several candidates, including distilled multilingual transformer models, ran the experiments in the platform and put together tables comparing their accuracy, speed and size. The winner was a 12-layer multilingual MiniLM distilled from XLM-RoBERTa, trained on Balo’s German and French data and wrapped as a spaCy pipeline that still runs on CPU. In the experiments, it was the most accurate of the candidates and processed 228 words per second, compared to only 54 to 86 for larger models like XLM-RoBERTa, gBERT and mDeBERTa.

Example prompt: "/ellf-project We want to replace our current CNN architecture with a transformer model. Which are the best options for this? And can you set up the experiments to compare the most promising candidates?"

 CNN (before)Transformer (after)
German (F-score)0.9480.953
German (F-score, ORG)0.8300.861
French (F-score)0.9650.976
French (F-score, ORG)0.8740.928
Model size605 MB460 MB
Words per second (CPU)8,972231
Evaluated on 2,049 German and 584 French examples, which were also part of the data used to select the transformer’s best checkpoint. The CNNs were trained before the latest data corrections. CNN size and speed are for the German model, with speed measured on a laptop.

A single model now covers both languages, with the biggest gains for organizations, a long-standing source of errors. It’s also smaller than the German CNN with its large static word vectors, and doesn’t need over 100 special cases for tokenization anymore. And because the base model is multilingual, even the occasional Italian or Portuguese document now gets solid baseline coverage.

While the new model is slower than the CNN, it’s worth the trade-off in practice. Most of the processing time in A-Tool is spent inserting the content controls that highlight the entities in Word. For a 100-page court decision, running the model accounts for 10% of the total time at most, and the longer the document, the smaller that share gets.

Future plans

Since the launch of A-Tool Guard, Balo has been focusing on bringing the product to law firms across Switzerland, and improving it based on their feedback. The team is offering personal support directly from the founders, and turning customer requests into new features on the roadmap. On the modeling side, they’ll keep improving their pipelines with Ellf as new data and edge cases come in.

On the technical side, the next big topic is PDFs. PDFs are notoriously tricky to anonymize safely, since sensitive information can hide in bookmarks, tables of contents or embedded files, which is why A-Tool converts them to Markdown instead. This currently requires documents that already include a text layer, so the team is looking into also providing built-in text recognition (OCR), and how to manage expectations around blurry or low-quality scans. Ellf and its built-in PDF support will also come in handy here to run those experiments.

Ellf took us so much further, and it’s a lot of fun to work with. spaCy and Prodigy have been reliable partners for us for over five years now, so it was great to take our workflows to the next level with Ellf.

— Bojan Konic, Co-Founder

Try Ellf for free Use project template

Resources