Transcribing Thai that switches into English
Thai speakers name products and actions in English without leaving the sentence. What that does to a transcript, its word timings, and a search index.
· 3 min read
Listen to any Thai office call and count the English. A support agent says cancel and order. An engineer says deploy and staging. A doctor, a lawyer, and a mechanic each keep a working vocabulary of English words inside otherwise ordinary Thai sentences. Code-switching between Thai and English is documented in Thai public speech, and it is the norm in the recordings a Thai product actually collects.
This is a transcription problem before it is a language problem. The sentence has one meaning and two scripts, and an engine has to decide what to write down. This post is about that decision, and about the three shapes a transcript can take.
Three shapes, one sentence#
Take one line a support agent might say. There are three ways it comes back.
spoken ลูกค้า cancel order ไปแล้วตั้งแต่เมื่อวาน romanised luk kha cancel order pai laeo tang tae muea wan phonetic ลูกค้า แคนเซิล ออร์เดอร์ ไปแล้วตั้งแต่เมื่อวาน as spoken ลูกค้า cancel order ไปแล้วตั้งแต่เมื่อวาน
The romanised shape loses the Thai. The phonetic shape spells the English words in Thai script, which is what somebody typing quickly might do and what a model trained mostly on Thai will default to. Both are readable by a person and useless to a search index: a customer searching for cancel finds nothing, because the transcript spells it แคนเซิล.
The third shape keeps each word in the script it was spoken in. It is the only one where a search for either language finds the line, and the only one where the English terms match the strings already in your database.
What it does to word timings#
Word spans have a harder job across a switch. Thai carries no spaces. The engine has to find the boundary between the last Thai word and the first English one from the sound alone, with no orthographic hint on either side. An engine that segments Thai well and then fumbles the handover produces spans that drift by a word around every switch.
Check it on a recording of your own. Ask for word timestamps, find a switch, and play the two seconds around it against the spans. A subtitle cut from drifting spans shows the English word one cue early, which is the sort of error a viewer notices immediately.
Pinning your own terms#
Product names are the hard case, because they are English words the model has no reason to expect. A term list solves it. Send the names your recordings actually contain, up to 50 terms. The spelling then holds across every request, however clearly each speaker said it.
Keep the list to names that are genuinely ambiguous by ear. A list of common words does nothing. A list that runs past the ceiling is refused outright, with no quiet trimming, which is the behaviour you want when a database generates the list.
The convention still applies#
Numbers inside a switched sentence follow the convention you asked for, in whichever language they were said. An order number read out in English digits and a price said in Thai land in the same transcript under one rule, which is what makes the line parseable afterwards.
What the model does#
Paxa STT Lite writes each word in the script it was spoken in, and times whole words on both sides of a switch. It publishes no accuracy figure until the evaluation method is published beside it. The way to settle this for your own recordings is to run a few of them.
Next steps#
- Read the speech-to-text guide for the vocabulary and convention fields.
- Read the transcription API reference for the request shape.
- Read what ASR means for Thai for the three properties of the language behind this one.
- The source for the pattern is code-switching between Thai and English in young Thai politicians' speeches, HASSS 23(2), 2023.