Introduction
Code-mixing—the practice of blending vocabulary and syntax from multiple languages within a single sentence—is ubiquitous on social media, particularly among bilingual populations. However, it presents a significant challenge for traditional Sentiment Analysis (SA) systems. Standard models struggle with the lack of formal grammar, extreme spelling variations (e.g., phonetic Romanized Hindi like "acha" vs "achha"), and complex sentiment structures where conflicting emotions are aggregated in a single sentence.
The CMSA Architecture
To address these challenges, researchers have developed the CMSA (Code-Mixed Sentiment Analysis) model. This hybrid architecture is designed to "de-mix" and analyze sentiments through three integrated components:
- Sub-word CNN: Instead of whole-word or character-level embeddings, a 1D-CNN generates sub-word representations. This approach provides robustness against informal spelling variations while capturing more semantic meaning than individual characters.
- Dual Encoder Network: This core component consists of two parallel BiLSTMs. The Collective Encoder captures the overall sentiment "vibe" of the sentence. Simultaneously, the Specific Encoder employs an attention mechanism to focus on specific sub-words that carry significant emotional weight, effectively navigating sentiment "flips" (e.g., sentences containing "but").
- Feature Network: A supplementary network incorporates "surface features" such as capitalized word counts, repeated punctuation, and monolingual sentence vectors. This augmentation is crucial for maintaining performance when training data is scarce.
Experimental Results
The CMSA model was evaluated on a benchmark dataset of 3,879 English-Hindi code-mixed sentences from Facebook. CMSA achieved a state-of-the-art accuracy of 83.54% and an F1-score of 0.827, representing a 6.24% improvement over previous baselines like FastText and SACMT.
A key finding of this study is the model's data efficiency. As shown in the performance analysis, CMSA consistently outperforms standard Subword-LSTM models even with very small training sets (e.g., 500-1000 samples). This robustness is largely attributed to the synergy between the dual encoders and the feature augmentation network.
Conclusion
The CMSA architecture demonstrates that combining sub-word level convolutions with a dual-track attention-based BiLSTM significantly improves sentiment analysis in noisy, code-mixed environments. Future work will explore more sophisticated attention mechanisms and the application of this architecture to other language pairs, such as Spanish-English.
Summary updated