Spam and Sentiment Detection in Arabic Tweets Using MARBERT Model
Summary
The paper looks at how to automatically read customer opinion about Saudi Telecom Company (STC) on Twitter. Customers post complaints and feedback there in large volumes and in many Arabic dialects, so manual review is not realistic. The authors fine-tune MARBERT, a BERT-style model pre-trained on Arabic tweets in both dialectal Arabic and MSA, for two tasks. The first is spam detection. The second is five-way sentiment classification into positive, negative, neutral, sarcasm and indeterminate. The sentiment corpus has about 24.5K tweets and is heavily skewed toward negative posts. Rather than resampling, the authors gathered additional minority-class tweets, then swept batch size, learning rate, sequence length and epoch count. Spam detection reaches an F1 of 0.98, which beats the SVM and BERT baselines they cite. The best overall sentiment F1 is 0.75, and sarcasm remains the weakest class. The study shows that a tweet-specific Arabic encoder can handle noisy, imbalanced, multi-class customer data reasonably well.
Key points
-
The dataset has 24,513 STC-related tweets: 13,828 negative, 5,694 neutral, 2,297 indeterminate, 1,437 positive and 1,221 sarcasm.
-
MARBERT (Abdul-Mageed et al.) was pre-trained on 15.6B tokens of DA and MSA tweets. It omits the NSP objective because tweets are short.
-
On spam detection, MARBERT scores F1 0.98. The cited baselines are an SVM at 0.93 (Saab et al.) and a BERT-based model at 0.96 (Yaseen).
-
The best sentiment setup reaches overall F1 0.75. It uses train batch 96, eval batch 32, learning rate 2e-5, 5 epochs and a longer max sequence length (256 in the table).
-
Per-class F1 improved when moving from batch 16 to batch 96:
Class Batch 16 Batch 96 Positive 0.85 0.92 Neutral 0.79 0.89 Negative 0.80 0.85 Indeterminate 0.50 0.56 Sarcasm 0.33 0.54
Interesting ideas
- I1. The authors fix weak minority classes by gathering more real examples instead of oversampling or undersampling. Sarcasm grew from about 200 to about 1,400 tweets, and the scores rose; this avoids duplicated noise and discarded data. — For Mova (learn): When silver data is thin for rare constructions, mine more genuine instances for them rather than reweighting or copying the few already present.
- I2. The label set includes an "indeterminate" class alongside "neutral". This keeps unclear tweets from being forced into a polarity label and contaminating the other classes. — For Mova (frames): Speech-act and irony labels in prag could include an explicit "undecidable" outcome, so uncertain readings are recorded honestly rather than guessed.
- I3. Results are reported per class, which shows sarcasm lagging far behind the overall score. A single aggregate F1 would have hidden that gap. — For Mova (learn): Evaluation reports should break scores down by phenomenon (e.g., irony, rare relations), so averages over frequent cases do not mask failures.
- I4. The pre-training objective is matched to the text genre: MARBERT drops NSP because tweets are too short for sentence-pair learning. — For Mova (tree): When adapting gparse to short or fragmentary inputs such as headlines or dialogue turns, drop training signals that assume multi-sentence context.
- I5. Hyperparameter runs are laid out as a sweep table, so the effect of each setting can be traced. — For Mova (learn): Keep a similar per-run log for parser and tagger training, so every configuration choice stays explainable and reproducible.
Cite
@misc{alotaibi2026spam,
title = {{Spam and Sentiment Detection in Arabic Tweets Using MARBERT Model}},
author = {Alotaibi, Abrar and Rahman, Atta-ur and Alhaza, Raheel and Alkhalifa, Wala and Alhajjaj, Narjes and Alharthi, Atheer and Abushoumi, Dhai and Alqahtani, Maryam and Alkhulaifi, Dania},
year = {2026},
doi = {10.18280/mmep.090617},
eprint = {2606.25495},
archivePrefix = {arXiv},
url = {https://doi.org/10.18280/mmep.090617}
}References
- Horev, R. (2018). BERT Explained: State of the art language model for NLP. Towards Data Science, 10. find
- Alqarni, A., Rahman, A. (2023) Arabic Tweets-based Sentiment Analysis to investigate the impact of COVID-19 in KSA: A deep learning approach. Big Data and Cognitive Computing, Preprint. find
- Abuzayed, A., Al-Khalifa, H. (2021). Sarcasm and sentiment detection in Arabic tweets using BERT-based models and data augmentation. In Proceedings of the Sixth Arabic Natural Language Processing Workshop, 312-317. find our card
- Bashmal, L., AlZeer, D. (2021). ArSarcasm shared task: An ensemble BERT model for Sarcasm Detection in Arabic tweets. In Proceedings of the Sixth Arabic Natural Language Processing Workshop, 323-328. find
- Wadhawan, A. (2021). Arabert and farasa segmentation-based approach for sarcasm and sentiment detection in arabic tweets. arXiv preprint arXiv:2103.01679. https://doi.org/10.48550/arXiv.2103.01679 ↗ our card
- Husain, F., Uzuner, O. (2021). Transfer learning approach for Arabic offensive language detection System--BERT-Based model. arXiv preprint arXiv:2102.05708. https://doi.org/10.48550/arXiv.2102.05708 ↗ our card
- Al-Twairesh, N. (2021). The evolution of language models applied to emotion analysis of Arabic tweets. Information, 12(2): 84. https://doi.org/10.3390/info12020084 ↗
- Talafha, B., Ali, M., Za'ter, M.E., Seelawi, H., Tuffaha, I., Samir, M., Al-Natsheh, H.T. (2020). Multi-dialect Arabic Bert for country-level dialect identification. arXiv preprint arXiv:2007.05612. https://doi.org/10.48550/arXiv.2007.05612 ↗
- Abdelali, A., Hassan, S., Mubarak, H., Darwish, K., Samih, Y. (2021). Pre-training Bert on Arabic tweets: Practical considerations. arXiv preprint arXiv:2102.10684. https://doi.org/10.48550/arXiv.2102.10684 ↗ our card
- Alturayeif, N., Luqman, H. (2021). Fine-grained sentiment analysis of Arabic COVID-19 tweets using BERT-based transformers and dynamically weighted loss function. Applied Sciences, 11(22): 10694. https://doi.org/10.3390/app112210694 ↗
- Habbat, N., Anoun, H., Hassouni, L. (2021). A novel hybrid network for arabic sentiment Analysis using fine-tuned AraBERT model. International Journal on Electrical Engineering and Informatics, 13(4): 801-812. https://doi.org/10.15676/ijeei.2021.13.4.3 ↗
- Antoun, W., Baly, F., Hajj, H. (2020). Arabert: Transformer-based model for Arabic language understanding. arXiv preprint arXiv:2003.00104. https://doi.org/10.48550/arXiv.2003.00104 ↗ our card
- Alnajrani, B., Alghamdi, A., Alotaibi, M., Aldawod, S., Rahman A., Nabil, M. (2022). A novel approach to Wikipedia references classification. ICIC Express Letters, 13(12): 1-9. http://dx.doi.org/10.24507/icicelb.13.12.1321 ↗
- Safaya, A., Abdullatif, M., Yuret, D. (2020). Kuisail at semeval-2020 task 12: Bert-CNN for offensive speech identification in social media. In Proceedings of the Fourteenth Workshop on Semantic Evaluation, 2054-2059. find our card
- Saab, S.A., Mitri, N., Awad, M. (2014). Ham or spam? A comparative study for some content-based classification algorithms for email filtering. In MELECON 2014-2014 17th IEEE Mediterranean Electrotechnical Conference, 339-343. https://doi.org/10.1109/MELCON.2014.6820574 ↗
- Yaseen, Q. (2021). Spam email detection using deep learning techniques. Procedia Computer Science, 184: 853-858. https://doi.org/10.1016/j.procs.2021.03.107 ↗
- Musleh, D.A., Alkhales, T.A., Almakki, R.A., Alnajim, S.E., Almarshad, S.K., Alhasaniah, R.S., Almuqhim, A.A. (2022). Twitter Arabic sentiment analysis to detect depression using machine learning. CMC-Computers Materials & Continua, 71(2): 3463-3477. https://doi.org/10.32604/cmc.2022.022508 ↗
- Heikal, M., Torki, M., El-Makky, N. (2018). Sentiment analysis of Arabic tweets using deep learning. Procedia Computer Science, 142: 114-122. https://doi.org/10.1016/j.procs.2018.10.466 ↗
- Hanafy, M., Khalil, M.I., Abbas, H.M. (2018). Combining classical and deep learning methods for Twitter sentiment analysis. In IAPR Workshop on Artificial Neural Networks in Pattern Recognition, 281-292. https://doi.org/10.1007/978-3-319-99978-4_22 ↗
- Feizollah, A., Ainin, S., Anuar, N.B., Abdullah, N.A.B., Hazim, M. (2019). Halal products on Twitter: Data extraction and sentiment analysis using stack of deep learning algorithms. IEEE Access, 7: 83354-83362. https://doi.org/10.1109/ACCESS.2019.2923275 ↗
- Jiang, L., Suzuki, Y. (2019). Detecting hate speech from tweets for sentiment analysis. In 2019 6th International Conference on Systems and Informatics (ICSAI), 671-676. https://doi.org/10.1109/ICSAI48974.2019.9010578 ↗
- Almuqren, L., Cristea, A. (2021). AraCust: A Saudi telecom tweets corpus for sentiment analysis. PeerJ Computer Science, 7: e510. http://dx.doi.org/10.7717/peerj-cs.510 ↗
- Hassan, S.U., Saleem, A., Soroya, S.H., Safder, I., Iqbal, S., Jamil, S., Nawaz, R. (2021). Sentiment analysis of tweets through Altmetrics: A machine learning approach. Journal of Information Science, 47(6): 712-726. https://doi.org/10.1177/0165551520930917 ↗
- Král, P., Matoušek, V. (2015). Text, speech, and dialogue: 18th International Conference, TSD 2015 Pilsen, Czech Republic, 2015: 551-559. find
- Alwakid, G., Osman, T., Hughes-Roberts, T. (2017). Challenges in sentiment analysis for Arabic social networks. Procedia Computer Science, 117: 89-100. https://doi.org/10.1016/j.procs.2017.10.097 ↗
- Khan, R., Shrivastava, P., Kapoor, A., Tiwari, A., Mittal, A. (2020). Social media analysis with AI: sentiment analysis techniques for the analysis of Twitter covid-19 data. Critical Rev, 7(9): 2761-2774. find
- Elshakankery, K., Ahmed, M.F. (2019). HILATSA: A hybrid Incremental learning approach for Arabic tweets sentiment analysis. Egyptian Informatics Journal, 20(3): 163-171. https://doi.org/10.1016/j.eij.2019.03.002 ↗
- Al-Twairesh, N., Al-Khalifa, H., Al-Salman, A., Al-Ohali, Y. (2017). Arasenti-tweet: A corpus for Arabic sentiment analysis of Saudi tweets. Procedia Computer Science, 117: 63-72. https://doi.org/10.1016/j.procs.2017.10.094. ↗
- Warda, L., Kaladzavi, G., Samdalle, A., Kolyang. (2022). Integration of ontology transformation into hidden Markov model. Information Dynamics and Applications, 1(1): 2-13. https://doi.org/10.56578/ida010102 ↗
- Musleh, D., Halawani, K., Mahmoud, S. (2015) Fuzzy modeling for handwritten Arabic numeral recognition. International Arab Journal of Information Technology, 14(4): 1-10. find
- Farooq, M.S., Abbas, S., Rahman A., Sultan, K., Khan, M.A., Mosavi, Amir. (2023). A fused machine learning approach for intrusion detection system. Computers, Materials & Continua, 74(2): 2607-2623. find
- Qureshi M.A., Asif, M., Anwar, S., Shaukat, U., Rahman, A., Khan, M.A., Mosavi, A. (2023). Aspect level songs rating based upon reviews in English. Computers, Materials & Continua, 74(2): 2589-2605. find
- Abdul-Mageed, M., Elmadany, A., Nagoudi, E.M.B. (2020). ARBERT & MARBERT: Deep bidirectional transformers for Arabic. arXiv [cs.CL]. find our card
- Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Polosukhin, I. (2017). Attention is all you need. Advances in neural information processing systems, Part of Advances in Neural Information Processing Systems 30 (NIPS 2017), 30: 6000-6010. find
- Ur, A., Rahman, S., Naseer, I., Majeed, R., Musleh, D., Gollapalli, M.A.S., Khan, M.A. (2021). Supervised machine learning-based prediction of covid-19. Computers, Materials and Continua, 69(1): 21-34. https://doi.org/10.32604/cmc.2021.013453 ↗
- Alotaibi, S.M., Basheer, M.I., Khan, M.A. (2021). Ensemble machine learning based identification of pediatric epilepsy. Computers, Materials & Continua, 68(1): 149-165. https://doi.org/10.32604/cmc.2021.015976 ↗
- Zaman, G., Mahdin, H., Hussain, K., Abawajy, J., Mostafa, S.A. (2021). An ontological framework for information extraction from diverse scientific sources. IEEE Access, 9: 42111-42124. https://doi.org/10.1109/ACCESS.2021.3063181 ↗
- Dash, S., Luhach, A.K., Chilamkurti, N., Baek, S., Nam, Y. (2019). A Neuro-fuzzy approach for user behaviour classification and prediction. Journal of Cloud Computing, 8(1): 1-15. https://doi.org/10.1186/s13677-019-0144-9 ↗
- Rahman, A. (2019). Memetic computing based numerical solution to Troesch problem. Journal of Intelligent & Fuzzy Systems, 37(1): 1545-1554. https://doi.org/10.3233/JIFS-18579 ↗
- Rahman, A. (2019). Optimum information embedding in digital watermarking. Journal of Intelligent & Fuzzy Systems, 37(1): 553-564. https://doi.org/10.3233/JIFS-162405 ↗
- Musleh, D., Ahmed, R., Alhaidari, F. (2019). A novel approach to Arabic keyphrase extraction. ICIC Express Letters. Part B, Applications: An International Journal of Research and Surveys, 10(10): 875-884. https://doi.org/10.24507/icicelb.10.10.875 ↗
- Ahmad, M., Farooq, U., Atta-Ur-Rahman, Alqatari, A., Dash, S., Luhach, A.K. (2019). Investigating TYPE constraint for frequent pattern mining. Journal of Discrete Mathematical Sciences and Cryptography, 22(4): 605-626. https://doi.org/10.1080/09720529.2019.1637158 ↗
- Rahman, A. (2020). GRBF-NN based ambient aware real time adaptive communication in DVB-S2. Journal of Ambient Intelligence and Humanized Computing, 1-11. https://doi.org/10.1007/s12652-020-02174-w ↗
- Alhaidari, F., Rahman, A., Zagrouba, R. (2020). Cloud of things: architecture, applications and challenges. Journal of Ambient Intelligence and Humanized Computing, 1-19. https://doi.org/10.1007/s12652-020-02448-3. ↗
- Rahman, A.U., Dash, S., Luhach, A.K. (2021). Dynamic MODCOD and power allocation in DVB-S2: A hybrid intelligent approach. Telecommunication Systems, 76(1): 49-61. https://doi.org/10.1007/s11235-020-00700-x ↗
- Dash, S., Ahmad, M., Iqbal, T. (2021). Mobile cloud computing: A green perspective. In Intelligent Systems, 185: 523-533. https://doi.org/10.1007/978-981-33-6081-5_46 ↗
- Alhaidari, F., Almotiri, S.H., Al Ghamdi, M.A., Khan, M.A., Rehman, A., Abbas, S., Khan, K.M. (2021). Intelligent software-defined network for cognitive routing optimization using deep extreme learning machine approach. Computers, Materials & Continua, 67(1): 1269-1285. https://doi.org/10.32604/cmc.2021.013303 ↗
- Rahman, A.U., Alqahtani, A., Aldhafferi, N., Nasir, M.U., Khan, M.F., Khan, M.A., Mosavi, A. (2022). Histopathologic oral cancer prediction using oral squamous cell carcinoma biopsy empowered with transfer learning. Sensors, 22(10): 3833. https://doi.org/10.3390/s22103833 ↗
- Rahman, A.U., Abbas, S., Gollapalli, M., Ahmed, R., Aftab, S., Ahmad, M., Mosavi, A. (2022). Rainfall prediction system using machine learning fusion for smart cities. Sensors, 22(9): 3504. https://doi.org/10.3390/s22093504 ↗
- Ghazal, T.M., Al Hamadi, H., Umar Nasir, M., Gollapalli, M., Zubair, M., Adnan Khan, M., Yeob Yeun, C. (2022). Supervised machine learning empowered multifactorial genetic inheritance disorder prediction. Computational Intelligence and Neuroscience, 2022: Article ID: 1051388. https://doi.org/10.1155/2022/1051388 ↗
- Alhaidari, F., Shaib, N.A., Alsafi, M., Alharbi, H., Alawami, M., Aljindan, R., Zagrouba, R. (2022). ZeVigilante: Detecting zero-day malware using machine learning and sandboxing analysis techniques. Computational Intelligence and Neuroscience, 2022: Article ID: 1615528. https://doi.org/10.1155/2022/1615528 ↗
- Ibrahim, N.M., Gabr, D.G.I., Rahman, A.U., Dash, S., Nayyar, A. (2022). A deep learning approach to intelligent fruit identification and family classification. Multimedia Tools and Applications, 81: 27783-27798. https://doi.org/10.1007/s11042-022-12942-9 ↗
- Gollapalli, M., Musleh, D., Ibrahim, N., Khan, M.A., Abbas, S., Atta, A., Omer, A. (2022). A neuro-fuzzy approach to road traffic congestion prediction. Computers, Materials and Continua, 72(3): 295-310. https://doi.org/10.32604/cmc.2022.027925 ↗
- Dilawari, A., Khan, M.U.G., Al-Otaibi, Y.D., Rehman, Z.U., Rahman, A.U., Nam, Y. (2021). Natural language description of videos for smart surveillance. Applied Sciences, 11(9): 3730. https://doi.org/10.3390/app11093730 ↗
- Zagrouba, R., Khan, M.A., Atta Ur, R., Muhammad Aamer, S., Muhammad Faheem, M., Rehman, A., Muhammad Farhan, K. (2021). Modelling and simulation of COVID-19 outbreak prediction using supervised machine learning. Computers, Materials, & Continua, 66(3): 2397-2407. find
- Khan, M.A., Abbas, S., Atta, A., Ditta, A., Alquhayz, H., Khan, M.F., Naqvi, R.A. (2020). Intelligent cloud-based heart disease prediction system empowered with supervised machine learning. Computers, Materials & Continua, 65(1): 139-151. https://doi.org/10.32604/cmc.2020.011416 ↗
- Naseem, M.T., Qureshi, I.M., Muzaffar, M.Z. (2020). Robust and fragile watermarking for medical images using redundant residue number system and chaos. Neural Network World, 30(3): 177-192. https://doi.org/10.14311/nnw.2020.30.013 ↗
- Nasir, M.U., Zubair, M., Ghazal, T.M., Khan, M.F., Ahmad, M., Rahman, A.U., Mansoor, W. (2022). Kidney cancer prediction empowered with blockchain security using transfer learning. Sensors, 22(19): 7483. https://doi.org/10.3390/s22197483 ↗
- AlKhulaifi, D., AlQahtani, M., AlSadeq, Z., Rahman, A., Musleh, D. (2022). An overview of self-adaptive differential evolution algorithms with mutation strategy. Mathematical Modelling of Engineering Problems, 9(4): 1017-1024. https://doi.org/10.18280/mmep.090419 ↗
- Rahman, A., Musleh, D., Nabil, M., Alubaidan, H., Gollapalli, M., Krishnasamy, G., Almoqbil, D., Khan, M.A.A., Farooqui, M., Ahmed, M.I.B., Ahmed, M.S., Mahmud, M. (2022). Assessment of information extraction techniques, models and systems. Mathematical Modelling of Engineering Problems, 9(3): 683-696. https://doi.org/10.18280/mmep.090315 ↗
- ur Rahman, A. (2022). Geo-Spatial disease clustering for public health decision making. Informatica, 46(6): 3827. https://doi.org/10.31449/inf.v46i6.3827 ↗
- Khan, M.A.A., AlAyat, M., AlGhamdi, J., AlOtaibi, S. M., AlZahrani, M., AlQahtani, M., Jan, F. (2023). WeScribe: An intelligent meeting transcriber and analyzer application. In Proceedings of Third International Conference on Computing, Communications, and Cyber-Security, 755-766. https://doi.org/10.1007/978-981-19-1142-2_59 ↗
- Rahman, A.U., Asif, R.N., Sultan, K., Alsaif, S.A., Abbas, S., Khan, M.A., Mosavi, A. (2022). ECG classification for detecting ECG arrhythmia empowered with deep learning approaches. Computational intelligence and neuroscience, 2022: Article ID 6852845. https://doi.org/10.1155/2022/6852845 ↗
- Rahman, A.U., Nasir, M.U., Gollapalli, M., Alsaif, S.A., Almadhor, A.S., Mehmood, S., Mosavi, A. (2022). IoMT-based mitochondrial and multifactorial genetic inheritance disorder prediction using machine learning. Computational Intelligence and Neuroscience, 2022: Article ID 2650742. https://doi.org/10.1155/2022/2650742 ↗
- Nasir, M.U., Khan, S., Mehmood, S., Khan, M.A., Rahman, A.U., Hwang, S.O. (2022). IoMT-Based osteosarcoma cancer detection in histopathology images using transfer learning empowered with blockchain, fog computing, and edge computing. Sensors, 22(14): 5444. https://doi.org/10.3390/s22145444. ↗
- Abbas, S., Raza, S.A., Khan, M.A., Rahman, A., Sultan, K., Mosavi, A. (2023). Automated file labeling for heterogeneous files organization using machine learning. Computers. Materials & Continua 74(2): 3263-3278. find
- Mahmud, M., Rahman, A., Lee, M., Choi, J.Y. (2020). Evolutionary-based image encryption using RNA codons truth table. Optics & Laser Technology, 121: 105818. find
- Gollapalli, M. (2022). Ensemble Machine Learning Model to Predict the Waterborne Syndrome. Algorithms, 15(3): 93. find
- Rahman, A., Mahmud, M., Iqbal, T., Saraireh, L., Kholidy, H., Gollapalli, M., Musleh, D., Alhaidari, F., Almoqbil, D., Ahmed, M.I.B. (2022). Network anomaly detection in 5G networks. Mathematical Modelling of Engineering Problems, 9(2): 397-404. https://doi.org/10.18280/mmep.090213 ↗
- Ahmad, M., Qadir, M.A., Rahman, A. et al. (2020). Enhanced query processing over semantic cache for cloud based relational databases. J Ambient Intell Human Comput. https://doi.org/10.1007/s12652-020-01943-x ↗
- Rahman, A., Qureshi, I.M., Malik, A.N., Naseem, M.T. (2016). Dynamic resource allocation in OFDM systems using DE and FRBS. Journal of Intelligent and Fuzzy Systems, 26(4): 2035-2046. find
- Rahman, A., Alhaidari, F. (2018). Querying RDF Data. Journal of Theoretical and Applied Information Technology, 26(22): 7599-7614. find
- Sajid, N.A., Ahmad, M., Afzal, M.T., Rahman, A. (2021). Exploiting papers’ reference’s section for multi-label computer science research papers’ classification. Journal of Information & Knowledge Management 20(2): 1-21. find
- Sajid, N.A., Ahmad, M., Rahman, A., Zaman, G., Ahmed, M.S. (2023). A novel metadata based multi-label document classification technique. Computer Systems Science and Engineering, 46(1): 1-16. find
- Rahman, A., Ibrahim, N.M., Musleh, D., Khan, M.A.A., Chabani, S., Dash, S. (2022). Cloud-based smart grids: Opportunities and challenges. In Proceedings Biologically Inspired Techniques in Many Criteria Decision Making, 1-13, Smart Innovation, Systems and Technologies, vol. 271, Springer, Singapore. https://doi.org/10.1007/978-981-16-8739-6_1 ↗
- Badi, I., Bouraima, M.B., Jibril, M.L. (2022). Risk assessment in construction projects using the grey theory. Journal of Engineering Management and Systems Engineering, 1(2): 58-66. https://doi.org/10.56578/jemse010203 ↗
This page in Markdown → https://md.research.elamur.ai/free/en/papers/alotaibi-2026-spam-sentiment-detection-arabic-tweets/