Code-switching: the data problem nobody scopes for
Most of the world mixes languages mid-sentence. If your dataset treats that as noise, it will not match how people actually speak.
A bilingual speaker in Manila says a sentence that starts in Tagalog, switches to English for a technical term, and returns to Tagalog. A Hindi speaker in Delhi does the same with English. A Spanish speaker in Texas does it with Spanish and English in nearly every conversation.
This is code-switching, and for a large share of the world it is not a special case. It is the normal register.
Why it breaks standard data pipelines
Most speech data projects are specified as monolingual by default. The language field says "Tagalog," so the annotators transcribe in Tagalog, and when they hit an English phrase, they either translate it, transliterate it, or drop it.
Each annotator makes that call individually. The result is a dataset where the same phenomenon is handled three different ways, and a model trained on it learns none of them reliably.
The decisions that have to be made up front
Code-switching data is not harder to collect than monolingual data. It is harder to specify, because every one of these questions has multiple reasonable answers.
- Transcription: do you write the switched-language words in their own script, or transliterate them into the matrix language?
- Boundary marking: do you label the exact word where the switch happens, or just tag the whole utterance?
- Normalization: if a speaker says an English word with a Tagalog accent, do you transcribe the English spelling or a phonetic approximation?
- Coverage: do you want natural switch density, or a balanced sample with more switching than occurs naturally?
Why the boundary question is the expensive one
Word-level switch boundaries are what make code-switching data genuinely valuable, because they let you train a model to track the switch rather than just tolerate it.
They are also the part that costs the most, because annotators disagree about them. In practice the disagreements cluster around a small set of cases (proper nouns, established loanwords, and numerals), which means a guideline that addresses those three categories explicitly can raise agreement substantially.
Where this matters most
The languages where code-switching dominates tend to be the ones with the largest speaker populations and the fastest-growing voice product markets: Tagalog, Hindi, Spanish in the Americas, Malay, Swahili, and the urban varieties of Arabic.
A model deployed to those markets that was trained only on monolingual data will degrade exactly where it is being used.
Natural density or balanced sample
Left alone, a recording of natural conversation produces whatever switch density the speakers happen to use, and in most bilingual communities that is a small fraction of utterances. A model trained on that distribution learns to handle the common case and treats switching as noise.
The alternative is to over-sample switching, deliberately recruiting speakers who switch often and prompting topics that provoke it. This raises the density of the phenomenon you care about, at the cost of representing a distribution that does not match real usage.
Neither is wrong, and the choice depends on what the model is for. Recognition systems benefit from natural density, because they will be evaluated on real traffic. Systems whose whole purpose is handling the switched case, such as translation or intent detection in bilingual customer service, usually benefit from the balanced sample. What does not work is leaving the question unasked, because the answer determines who you recruit, and recruitment is the expensive part.
Writing the guideline for the hard cases
Annotator disagreement in code-switching data is not spread evenly. It clusters in a small number of categories, and a guideline that names those categories explicitly raises agreement more than a longer guideline that describes the general principle.
- Proper nouns. A place name that exists in both languages is the most common source of disagreement. Fix a rule: transcribe in the script of the language it was spoken within, or always in the source language, but pick one and apply it without exception.
- Established loanwords. Words that have been absorbed into the matrix language and are no longer perceived as foreign. These need a list, not a rule, because the boundary moves by community and by generation.
- Numerals and units. Spoken numbers can be written as digits, as words in the matrix language, or as words in the embedded language. Digit normalization is usually the right default, but it has to be stated or half the team will do something else.
- Single-word switches with no morphological integration. A lone English noun dropped into a Tagalog sentence is a switch; the same noun with Tagalog affixes may be a loan. This distinction is real, it is annotatable, and it is invisible unless the guideline defines it.