Now booking: Pakistan Regional Voice Evaluation pilots for Q1 2027→
Code-switching · Guide

Code-Switching Speech Datasets: A Practical Guide for Voice AI Teams

Pakistani speakers move between Urdu and English inside one sentence. Why voice agents fail at the switch point, and how to build data that tests it.

Phonivra Research Team12 November 20269 min read

Why multilingual voice agents fail at the switch

In Pakistan, a customer might say "Mera balance check kar dein, aur last transaction bhi bata dein." Half of it is English. Speech models that expect one language per utterance often misspell the English words, split them, or drop them entirely. The agent then misses exactly the words that carry the intent: balance, transaction.

REFERENCEMerabalancecheckkardeinASR OUTPUTMerabilanschekkardein
Figure 1. Illustrative example: the English words carry the intent, and they are the ones that break.

Designing realistic conversational recordings

  • Use real scenarios: banking, telecom, delivery, appointments.
  • Let speakers phrase requests naturally instead of reading a script.
  • Include different switching patterns: single English words, full English phrases, and English numbers inside Urdu.
  • Record on phones as well as microphones, with real background noise.

Language-switch labels and reference transcripts

Each English span should be written in English script and tagged with its language. That lets you measure errors separately for the Urdu parts and the English parts, and see exactly where your model loses accuracy.

Merabalancecheckkar dein, aurlasttransaction
Figure 2. Language spans: Urdu (grey) and English (orange) tagged separately.

Stratified evaluation, WER and meaning-critical failures

Report WER separately for utterances with and without code-switching, and for Urdu versus English spans. Then add a meaning-critical check: did the agent understand the request? An utterance with one small spelling error can still change the intent, for example when last is misheard and the agent returns the wrong transaction.

Annotation schema

A simple, portable format works best. We deliver JSON Lines with one record per utterance:

{"id":"URD-0311","text":"Mera balance check kar dein", "spans":[{"text":"balance","lang":"en"},{"text":"check","lang":"en"}], "intent":"balance_inquiry","condition":"phone_call","speaker_l1":"Punjabi"}

Want this applied to your own audio? Send 10 minutes and your guidelines, and we will return a labelled sample.

Keep reading

More from Insights

Start small

Test your model on 100 real utterances.

A fixed-scope pilot across Saraiki, Pakistani Punjabi and Urdu with a full error report. You keep the findings.