A beta privacy filter for Moroccan Darija

As AI use grows, privacy needs more than a policy document. Private data should be detected and removed before text moves any further through a system. I could not find a privacy model focused on everyday Moroccan Darija, so I fine-tuned a beta version of the OpenAI Privacy Filter and made it available as a small web demo.

V5 uses supervised span fine-tuning on 15,000 synthetic training examples, with 2,000 examples for validation and another 2,000 held out for testing. The data mixes Latin-script Darija, Arabic-script Darija, and French administrative language. It also includes lowercase names, run-on addresses, difficult span boundaries, and 28% negative examples. Training ran for six epochs and kept the checkpoint with the lowest validation loss.

The model covers 17 types of sensitive data. These include names, addresses, phone numbers, email addresses, account details, secrets, and Moroccan identifiers such as CNIE, CNSS, ICE, IF, RC, RIB, passports, licence plates, and court case numbers. A conservative post-processing step handles recurring boundary and identifier errors.

On the 2,000-example synthetic test set, the deployed pipeline reached 0.986 precision, 0.986 recall, and 0.986 exact-span F1. Exact-span scoring matters here: finding most of a name or address is still a redaction error.

This result is promising, but it is not proof of production reliability. The training and benchmark examples are synthetic and illustrative, not real identity records. The next useful test is a separately sourced, manually labelled set of real Darija messages.

Try the beta

Use fictional examples only. Text entered below is sent to the hosted Hugging Face Space for inference. The demo is public, but the model weights remain in a private repository mounted read-only by the Space.




Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • Organized Chaos
  • Why ordinary days are underrated
  • Why do long conversations break LLMs?
  • Is vibe coding the risk or just poor architecture?
  • AI vs Classic Product Management