Introduction
Multilingualism is a defining characteristic of immigrant communities, where speakers often fluidly mix a minority language with a majority one—a phenomenon known as code-switching. While sociolinguists have long studied the motivations behind spoken code-switching, such as signaling identity or shifting emotional tone, computational analysis of this behavior in large-scale digital text remains a developing field. This research addresses the challenge of predicting intra-post code-switching within a massive Turkish-Dutch online forum. Specifically, the goal is to determine if an algorithm can predict whether the next word in a post will involve a language switch based solely on the current and preceding context.
Dataset and Methodology
The study utilizes data from the Hababam Forum, a prominent online platform for Turkish-Dutch bilinguals in the Netherlands. The dataset is exceptionally large, spanning seven years and comprising millions of posts, making it one of the most extensive bilingual corpora analyzed for code-switching to date.
The prediction task is framed as a binary classification problem: for any token $i$, the model predicts if token $i+1$ will be in a different language. A Naive Bayes classifier was employed, utilizing three primary feature sets:
- Linguistic History: The language of the current and two previous tokens, along with a flag for any prior code-switching in the post.
- Multi-Word Expressions (MWEs): A novel feature set tracking whether a token belongs to a common 3-gram formulaic phrase.
- Non-Linguistic Cues (Emoticons): Features identifying the presence of emoticons near the current token, hypothesized to correlate with emotional and linguistic shifts.
To address class imbalance, the models were trained and evaluated on balanced data subsets across 100 iterations. Ground-truth labels were generated using an automated word-level language identification tagger with approximately 97% accuracy.
Key Insights and Results
The analysis revealed that multi-word expressions (MWEs) are powerful indicators of linguistic transitions. Bilingual speakers often use fixed phrases in one language as a bridge before switching to another. Furthermore, while emoticons are weak predictors in isolation, they enhance model performance when combined with linguistic features, suggesting that emotional shifts often mirror language shifts.
The most effective predictive model integrated language history, previous code-switching indicators, and MWEs. This combination achieved a balanced performance with an F1 score of 0.7113.
Qualitative findings also highlighted that topic choice heavily influences language. Institutional topics like education often prompted a shift to Dutch, while cultural topics like food or traditions favored Turkish.
Limitations and Future Directions
A primary limitation is the reliance on automated language tagging, which introduces a small margin of error into the ground truth. Additionally, some emoticon features utilized "look-ahead" information, which is unsuitable for real-time predictive systems. Future work aims to validate these findings on manually annotated datasets and explore the generalizability of MWE and emoticon features across different language pairs and immigrant communities.
Summary updated