Facebook pixel tracking

The Science and Information (SAI) Organization publishes open-access peer-reviewed journals in computer science and artificial intelligence.

Contact Info
Website thesai.org
Follow Us
Contact Info
Follow Us
Research Article | Open Access |

An Enhanced Framework Using XLM-R with Optimized TF-IDF and Positional Encoding for Intra-Sentential Code Mixing Malay-English Sentiment Analysis

Author 1: Surendran Selvaraju Author 2: Nilam Nur Amir Sjarif Author 3: Nurulhuda Firdaus Mohd Azmi Author 4: Wan Noor Hamiza Wan Ali Author 5: Norshaliza Kamaruddin
International Journal of Advanced Computer Science and Applications (IJACSA) · Vol. 17, No. 3 · Published 2026

DOI: https://doi.org/10.14569/IJACSA.2026.0170370

Abstract

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.

Keywords

How to Cite this Article

Selvaraju, S., Sjarif, N. N. A., Azmi, N. F. M., Ali, W. N. H. W., & Kamaruddin, N. (2026). An Enhanced Framework Using XLM-R with Optimized TF-IDF and Positional Encoding for Intra-Sentential Code Mixing Malay-English Sentiment Analysis. International Journal of Advanced Computer Science and Applications, 17(3). https://doi.org/10.14569/IJACSA.2026.0170370

Selvaraju, Surendran, et al.. "An Enhanced Framework Using XLM-R with Optimized TF-IDF and Positional Encoding for Intra-Sentential Code Mixing Malay-English Sentiment Analysis." International Journal of Advanced Computer Science and Applications, vol. 17, no. 3, 2026, https://doi.org/10.14569/IJACSA.2026.0170370.

@article{Selvaraju2026,
  title     = {An Enhanced Framework Using XLM-R with Optimized TF-IDF and Positional Encoding for Intra-Sentential Code Mixing Malay-English Sentiment Analysis},
  journal   = {International Journal of Advanced Computer Science and Applications},
  volume    = {17},
  number    = {3},
  year      = {2026},
  publisher = {The Science and Information Organization},
  author    = {Surendran Selvaraju and Nilam Nur Amir Sjarif and Nurulhuda Firdaus Mohd Azmi and Wan Noor Hamiza Wan Ali and Norshaliza Kamaruddin},
  doi       = {10.14569/IJACSA.2026.0170370},
  url       = {https://doi.org/10.14569/IJACSA.2026.0170370}
}

Open Access — licensed under a Creative Commons Attribution 4.0 International License. Unrestricted use, distribution, and reproduction in any medium, even commercially, as long as the original work is properly cited.