The increasing use of online platforms, especially in social media, has led to a rapid growth of user-generated content that frequently exhibits intra-sentential code mixing between Malay and English language. Sentiment analysis remains challenging due to linguistic heterogeneity, frequent language switching, non-standard syntax and limited availability of adequate representations for code mixing text. Although multilingual contextual embedding models such as Cross-lingual Language Model (XLM-R) provide good semantic representations, but there are still challenges in capturing fine-grained sentiment cues in intra-sentential code mixing text when used directly. This study proposed an enhanced feature extraction framework for intra-sentential code mixing Malay-English. The framework first constructs TF-IDF weighting based on trigrams and followed by lexicon-guided filtering to select trigrams that contain sentiment-relevant words. Contextual embeddings are then extracted using XLM-R and further refined through Term Frequency–Inverse Document Frequency (TF-IDF) weighting and positional encoding to preserve structural information. The dataset derived from the MESocSentiment corpus with total of 4,292. The experimental results show that the proposed framework achieves an accuracy of 0.896 and an F1-score of 0.932, where it outperforms traditional sparse feature representations and multilingual contextual embedding baselines. Notably, the framework demonstrates a high recall of 0.954, indicating strong sensitivity in identifying sentiment-bearing instances across diverse social media code mixing expressions. Further analysis reveals that the integration of informative trigram filtering, XLM-R based contextual embedding, TF-IDF weighting, positional encoding, and sentiment polarity scoring enhances the representation of sentiment cues in short and informal social media text. Overall, the results suggest that the proposed feature extraction framework enhances the representation quality of sentiment analysis for code mixing Malay–English in social media.
Selvaraju et al. (Thu,) studied this question.