GeoTech

Engineering / Case study

Egyptian Arabic voice-overs that learn from the owner's edits

GeoTech Engineering · · 7 min read

Text-to-speechArabic NLPVideo productionProduct tooling

We produce explainer and promo videos for DentX and Krown with an AI voice speaking Egyptian Arabic. The voice is good. The scripts were the problem: the same word mispronounced in video after video, the same English term written in Arabic letters and read like an Arabic word, and the product owner correcting each one by hand, again. This is how we made his corrections stick: every edit he makes becomes a rule, and the next script is fixed before it is ever recorded.

63owner edits mined
57word pairs found
1,108takes recorded and checked
0.93average read-back score

TL;DR

The problem: corrections that do not carry over

A text-to-speech engine reads what you write. In Arabic, short vowels are usually not written, so the engine has to guess them, and a wrong guess changes the word. Product vocabulary is full of English terms that Egyptians say in English (app, notification, dashboard, WhatsApp, InstaPay) but that writers often spell in Arabic letters, and the engine then reads them as Arabic. And some words simply sound wrong for this audience, even when they are correct Arabic.

The owner fixed these as he heard them. The edit lived in that one scene. The next script, written a week later, had the same word spelled the same old way, and he fixed it again. Every repeat is another chance to miss one.

Why the usual fixes did not work

A style guide. We had one, in plain text. Writers (human or AI) follow it most of the time. "Most of the time" is exactly the failure mode: the owner still had to listen for the misses.

Rewriting words the way they sound. Our first real attempt was to spell Egyptian pronunciation directly into the script, for example replacing the letter that Egyptians pronounce as a glottal stop with the glottal-stop letter itself. The engine pronounced those words, but they looked and sounded wrong to the owner. His verdict, in short, was that it was very bad and that the scripts must use normal spelling, with diacritics only on the letter that is mispronounced. We rolled it back. That was our mistake, and it taught us the key point: the right spelling is the one the owner chooses, not the one a rule predicts.

A hand-maintained replacement list. It depends on someone remembering to add each correction, while the owner was already making them in the review screen.

The fix: mine the edits

Each scene row stores two texts: the wording from the script file (base_text) and the wording in force (text), which is the owner's edit if he made one. Wherever they differ, we run a word-level longest-common-subsequence diff, ignoring audio direction tags such as [excited], and keep each changed hunk of one to three words on each side as a pair.

// word-level LCS diff → replacement hunks of 1–3 words each side
function diffPairs(a, b) {
  const A = words(a), B = words(b);
  // ...standard LCS table...
  // walk the table; a run of deletions followed by insertions = one pair
  // keep it if both sides are 1–3 words and the texts differ after Unicode NFC
}

The NFC normalisation matters more than it looks: Arabic diacritics typed in a different order are the same text, and without it the miner reported "changes" that were not changes.

Pairs from all edits are grouped and counted, then classified:

ClassRuleIn the snapshot
safe: marksOnly diacritics, shadda or spacing differ15
safe: latinAn Arabic-spelled word of at most two words became Latin3
safe: repeatedThe owner made the same change at least twice4
suggestionMade once, or a rival change for the same word exists35

Two guards keep the safe class honest. A pair is demoted if the owner ever made the reverse change, and it is demoted if another replacement for the same word was made at least as often. In both cases he has not made up his mind, so the tool should not decide for him.

The most-repeated pair in the snapshot is the word used to open each video's summary scene, which the owner changed from "let's review" to "let's sum up" 16 times. Another pair, made 11 times, is his own phonetic spelling of the word for "in front of you". That is exactly the kind of spelling our earlier rule-based attempt tried to impose everywhere; here it applies to one word, because he chose it.

Foreign words: a short curated list

The second source is a hand-kept file of foreign words and their Arabic spellings: payment brands, drug names, apps. It holds 72 words with 146 Arabic spellings between them. Words that also have an ordinary Arabic meaning are deliberately left out. When a match is replaced, the Arabic prefixes glued to it (and, with, for, the) are kept and joined to the Latin word with a connector, so the sentence still reads as Arabic.

When rules are applied

The second problem: the accent drifting

Even with the right words, some takes came back sounding Gulf or Levantine rather than Egyptian. The pattern was clear once we looked: it happened on short scenes recorded on their own, most often the last line of an episode. A long reading keeps its accent; a five-word reading has nothing to anchor it.

So the review screen records a whole episode in one request (up to 2,900 characters) and cuts it back into scenes using the engine's per-character timestamps. Each cut sits halfway through the pause between two scenes. Re-recording a single scene now reads the scene before it, the scene itself and the scene after it, and keeps only the middle. Of DentX's 750 takes, 258 came from whole-episode readings.

Checking what was actually said

Every take is transcribed back with a speech-to-text model and scored against the script: twice the longest common word sequence divided by the total word count, after normalising letter variants and known transcription spellings of our brand names. A cut that scores below 0.6 is thrown away and that scene is read again on its own. This catches a real failure we saw at the end of some long readings, where the engine produced a stretch of music instead of words. The score checks the words only. The accent is judged by the owner's ear.

Measured results

Checklist if you are building something similar

  1. Store both the original wording and the reviewer's wording. The diff between them is your training data.
  2. Diff at word level, ignore markup, and normalise Unicode before comparing.
  3. Apply automatically only what is unambiguous: diacritics, script switches, and repeated choices that were never reversed.
  4. Never rewrite approved work. Apply rules when content is created.
  5. Do not record short lines alone. Give the voice its context and cut afterwards.
  6. Verify each take by transcribing it, and drop broken cuts before a human hears them.

Need this?

This review-and-learn workflow runs inside our own products, and the same thinking drives Spotra, our tool for turning a product link into a short ad video with a voice you approve word by word. If you produce Arabic voice-over content at volume and want your corrections to stick, talk to GeoTech.