Code-Switching and Mixed-Language Text › The Shape of Code-Switching

Michael BrenndoerferNovember 26, 20265 min read
Language AI HandbookAll chapters
Part 26 of 67Multilingual Language Models and Cross-Lingual Transfer
Chapter 188Code-Switching and Mixed-Language Text › The Shape of Code-Switching
Reading section 2 of 13 · The Shape of Code-Switching · 5 minSection 2 of 13 · 5 min

Section 2 of 13 · 5 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

Start by locating each switch. Record which pipeline decisions depend on passage, sentence, token, or morpheme boundaries before choosing a language label.

Locate each switch relative to sentence and word boundaries. A word-internal switch also occurs within a sentence. Record discourse tags separately, since a tag can appear inside a sentence. Use the resolution your system needs for routing, retrieval, or annotation.

Intersentential switching

Here, an intersentential switch occurs between complete sentences. A switch at an embedded clause boundary inside one sentence is intrasentential under this convention.

"I finished the report last night. Phir main so gaya." ("...Then I fell asleep.")

Each sentence in the example uses one language. Sentence-level labels can represent both parts if the classifier identifies them correctly. A router that accepts only one language label for the whole document has to discard one of those labels. If a ticket starts in Spanish and ends in English, a Spanish-only queue may handle the opening and miss the English request.

When switches coincide with known sentence or turn breaks, label those units first. For routing, a per-segment classifier with a mixed label is one possible design.

Intrasentential switching

The switch happens inside a single sentence, often at a constituent boundary:

"I told him ki main kal nahi aa sakta." ("I told him that I can't come tomorrow.")

A single sentence label leaves the switch boundary unmarked. For the example above, compare the adjacent word labels and inspect which parts the deployed tokenizer separates before choosing a routing or retrieval policy.

Poplack’s 1980 Spanish–English study describes two proposals. The equivalence constraint favors places where the surface structures line up. The free morpheme constraint limits switches at bound morphemes and makes a qualification for forms phonologically integrated into the other language. The paper’s bound-morpheme examples come from Spanish and English. Myers-Scotton’s Matrix Language Frame distinguishes a grammatical frame from contributions of an embedded language. Muysken (2000) distinguishes insertion into a frame, alternation between structures, and congruent lexicalization, where languages supply lexical items within a shared structure.

Use these analyses to decide what to observe in the target corpus:

  • Count switches by the grammatical categories on either side of the boundary.
  • Compare boundary prediction with and without syntactic features.
  • Compare the boundary distributions of naturally occurring text and synthetic text before using the latter for evaluation.
Matrix language

The framework uses a matrix and an embedded language to describe how mixed material is organized. Use the English main clause and Hindi complement above as an example of nested material. State which structural unit you analyze before assigning a matrix language.

Tag switching and discourse markers

A single tag or discourse particle is inserted:

"That's a great idea, yaar." "Entonces, we should probably leave."

If a whole-sentence label ignores one discourse marker, the tag can still matter to a token-level annotation task. Decide whether an item such as yaar should count as a switched tag, a borrowing, or an unresolved label for the community whose text you are annotating.

Use target-speaker review to check whether discourse particles such as yaar, entonces, and n’est-ce pas suit the requested register.

When evaluating a generated reply, ask reviewers to judge the discourse markers and grammatical form separately.

Intra-word switching and morphological mixing

A stem from one language can take a suffix from another. Das and Gambäck (2014), §2 report an English example with Bengali plural morphology. Their source writes admirer der, with a space, and analyzes -der as the plural suffix.

In Vamos a parquear el carro, ASALE records parquear as a regional Spanish verb from English to park. In Mujhe WhatsApp karna hai, the brand name WhatsApp and the Hindi light verb karna are separate words.

Decide how your corpus distinguishes a switched item from an established loan. Poplack excluded habitual, socially integrated items from her Spanish–English switch counts and considered phonological integration separately. A system might recognize parquear as a whole word or identify a stem and ending. Test how your analyzer treats it and the Hindi light-verb example under the annotation policy used for your task.

If a written stem and suffix use different scripts, record both scripts for that token. Apply that test to the written form and use language or morphological evidence separately.

Borrowing versus code-switching: the definitional trap

Consider ‘I need to download the file’ quoted in a Hindi conversation. The full sentence is English, so the English spelling of download cannot establish its loan status in Hindi. To test a loan policy, annotate an example that embeds it in a Hindi phrase, such as download karna.

Define whether the label describes a form’s origin, its use in the speech community, or an operation such as selecting an index. Apply both candidate policies to one borrowed word in a small fixture. If changing a label changes the counts used by CMI, recalculate the score and inspect whether the downstream decision also changes.

Write down the loanword and unknown-label policies. Check both before comparing results from different corpora.

Comments

Add to the conversation

A question, a correction, or an example from your own work.

No comments yet. Be the first to share your thoughts!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy