Comparative Analysis of TF-IDF, Word2Vec, and BERT with Logistic Regression, Random Forest, and XGBoost for Sarcasm Detection in News Headlines
DOI:
https://doi.org/10.52436/1.jutif.2026.7.5.5803Keywords:
BERT, Logistic Regression, Sarcasm Detection, Text Classification, TF-IDF, Word2VecAbstract
The detection of sarcasm in news headlines remains a significant challenge in Natural Language Processing due to the inherent ambiguity and limited contextual information in micro-texts. This research aims to evaluate the effectiveness of various text representation techniques and classification algorithms to identify the most optimal and computationally efficient model for sarcasm detection. The study examines three generations of text representation (TF-IDF, Word2Vec, and BERT) and classification algorithms, including Logistic Regression, Random Forest, XGBoost, and Stacking Ensemble, while comparing heavy and light preprocessing scenarios. The results reveal that light preprocessing which retains stopwords is more optimal for maintaining the semantic integrity of short texts. The combination of Logistic Regression and TF-IDF achieved the best performance with an accuracy of 0.8320 and an F1-Score of 0.8052. This model proved highly efficient with a training time of only 0.1397 seconds, significantly outperforming complex models like BERT and Stacking, which required up to 115.87 seconds without yielding a proportional increase in accuracy. These findings contribute to the field of NLP by demonstrating that for micro-text characteristics, frequency-based representations with minimal preprocessing offer a more effective and resource-efficient solution than complex contextual models, providing a benchmark for real-time sarcasm detection systems.
Downloads
References
D. Deswita et al., “Digital Media Consumption Trends and Changing Consumer Mindsets: A Case Study of Online Shopping Behavior,” jbkd, vol. 1, no. 4, p. 8, Jul. 2024, doi: 10.47134/jbkd.v1i4.2839.
K. Lamot, T. Kreutz, and M. Opgenhaffen, “‘We Rewrote This Title’: How News Headlines Are Remediated on Facebook and How This Affects Engagement,” Social Media + Society, vol. 8, p. 205630512211148, Jul. 2022, doi: 10.1177/20563051221114827.
R. Misra and P. Arora, “Sarcasm Detection Using News Headlines Dataset,” AI Open, vol. 4, pp. 13–18, 2023.
C. Wen, G. Jia, and J. Yang, “DIP: Dual Incongruity Perceiving Network for Sarcasm Detection,” in 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Vancouver, BC, Canada: IEEE, Jun. 2023, pp. 2540–2550. doi: 10.1109/CVPR52729.2023.00250.
Q. Yang, J. Zeng, L. Yang, K. Ma, and H. Lin, “Sarcasm-R1: Enhancing Sarcasm Detection through Focused Reasoning,” 2025, Accessed: Apr. 12, 2026. [Online]. Available: https://papers.cool/venue/2025.findings-emnlp.570@ACL
A. Rasikh et al., “Deep Learning for Sarcasm Identification in News Headlines,” Applied Sciences, vol. 13, p. 5586, Apr. 2023, doi: 10.3390/app13095586.
N. Wardana, F. Aditiawan, and A. Sari, “Logistic Regression Classification with TF-IDF and FastText for Sentiment Analysis of LinkedIn Reviews,” VISA: Journal of Vision and Ideas, vol. 4, Aug. 2024, doi: 10.47467/visa.v4i3.2835.
R. Bodige and R. Akarapu, “Transformer-based advances in sarcasm detection: a study of contextual models and methodologies,” Knowledge and Information Systems, vol. 67, pp. 7399–7430, May 2025, doi: 10.1007/s10115-025-02469-4.
Q. Abuein, R. M. Al-Khatib, A. Migdady, M. S. Jawarneh, and A. Al-Khateeb, “ArSa-Tweets: A Novel Arabic Sarcasm Detection System Based on Deep Learning Model,” Heliyon, vol. 10, p. e36892, 2024.
G. Gümüşçekicci and R. Dehkharghani, Sarcasm detection on news headlines using transformers. 2025. doi: 10.21203/rs.3.rs-6523727/v1.
S. Fatima, A. Hussain, S. B. Amir, S. H. Ahmed, and S. M. H. Aslam, “XGBoost and Random Forest Algorithms: An in Depth Analysis,” Pakistan Journal of Scientific Research, vol. 3, pp. 26–31, 2023.
Y.-H. Hu, T.-H. Liu, C.-F. Tsai, and Y.-J. Lin, “Handling Class Imbalanced Data in Sarcasm Detection with Ensemble Oversampling Techniques,” Applied Artificial Intelligence, vol. 39, no. 1, p. 2468534, Dec. 2025, doi: 10.1080/08839514.2025.2468534.
A. Shetty, A. R. Singh, P. Shukla, and A. Shetye, “Sarcasm Detection in News Headlines: A Comparative Study of Multinomial Naive Bayes, Logistic Regression, and Support Vector Machine,” ResearchGate, 2023.
M. George and R. Murugesan, “Improving Sentiment Analysis of Financial News Headlines Using Hybrid Word2Vec-TFIDF Feature Extraction Technique,” Procedia Computer Science, vol. 244, pp. 1–8, 2024.
A. Prasetyo and B. Harjo, “Deteksi Sarkasme Pada Dataset News Headlines Menggunakan Artificial Neural Network Berbasis TF-IDF,” Journal of Creativity Student, vol. 8, pp. 321–329, Jul. 2025, doi: 10.15294/jcs.v8i2.39855.
P. Dubey, A. Mishra, A. Singh, M. Murtuza, A. Chanchlani, and P. Dubey, “Efficient transformer architecture for sarcasm detection: a study on compression and performance,” Bulletin of Electrical Engineering and Informatics, vol. 15, pp. 557–567, Feb. 2026, doi: 10.11591/eei.v15i1.11102.
R. Egger and E. Gokce, “Natural Language Processing (NLP): An Introduction: Making Sense of Textual Data,” in Applied Data Science in Tourism, R. Egger, Ed., in Tourism on the Verge. , Cham: Springer International Publishing, 2022, pp. 307–334. doi: 10.1007/978-3-030-88389-8_15.
M. Syah, A. Puspa, M. Idhom, and Trimono, “Perbandingan Representasi Teks Tf-Idf Dan Bert Terhadap Akurasi Cosine Similarity Dalam Penilaian Otomatis Jawaban Berbasis Teks,” Data Sciences Indonesia (DSI), vol. 5, pp. 47–59, Jul. 2025, doi: 10.47709/dsi.v5i1.6021.
P. Batham, D. Tiwari, and A. Srivastava, “RESEARCH IN ENGINEERING MANAGEMENT AND SCIENCE ( IJPREMS ) FINE-TUNED BERT MODEL,” pp. 831–839, 2024.
D. Hazarika, E. Cambria, and R. Zimmermann, “CASCADE : Contextual Sarcasm Detection in Online Discussion Forums,” pp. 1837–1848, 2018.
X. Shu, “BERT and RoBERTa for Sarcasm Detection: Optimizing Performance through Advanced Fine-tuning,” ACE, vol. 97, no. 1, pp. 1–11, Nov. 2024, doi: 10.54254/2755-2721/97/20241354.
D. Makwana, P. Engineer, A. Dabhi, and H. Chudasama, “Sampling Methods in Research : A Review,” vol. 7, no. 3, pp. 762–768, 2023.
N. Benavides and A. Ramos, “Context-Based Models for Sarcasm Detection”.
N. Wang, J. Jiao, S. Zhang, and J. Fu, “Secure and Efficient Semantic Extension Search over Encrypted Documents by Integrating Cloud and Fog Systems,” Mathematical Problems in Engineering, vol. 2022, no. 1, p. 9349651, 2022, doi: 10.1155/2022/9349651.
A. E. M. Santos, M. S. Lana, and T. M. Pereira, “Evaluation of machine learning methods for rock mass classification,” Neural Comput & Applic, vol. 34, no. 6, pp. 4633–4642, Mar. 2022, doi: 10.1007/s00521-021-06618-y.
K. Badola and M. Gupta, “Twitter Spam Detection Using Natural Language Processing by Encoder Decoder Model,” in 2021 International Conference on Artificial Intelligence and Smart Systems (ICAIS), Coimbatore, India: IEEE, Mar. 2021, pp. 402–405. doi: 10.1109/ICAIS50930.2021.9395862.
M. A. Al-Hashem, A. M. Alqudah, and Q. Qananwah, “Performance Evaluation of Different Machine Learning Classification Algorithms for Disease Diagnosis,” https://services.igi-global.com/resolvedoi/resolve.aspx?doi=10.4018/IJEHMC.20211101.oa5, Jan. 1AD, Accessed: Sep. 19, 2025. [Online]. Available: https://www.igi-global.com/article/performance-evaluation-of-different-machine-learning-classification-algorithms-for-disease-diagnosis/www.igi-global.com/article/performance-evaluation-of-different-machine-learning-classification-algorithms-for-disease-diagnosis/278822
B. Trémoulhéac, N. Dikaios, D. Atkinson, and S. R. Arridge, “Dynamic MR Image Reconstruction – Separation From,” vol. 33, no. 8, pp. 1689–1701, 2014.
S. Matharaarachchi, M. Domaratzki, and S. Muthukumarana, “Machine Learning with Applications Enhancing SMOTE for imbalanced data with abnormal minority instances,” Machine Learning with Applications, vol. 18, no. December 2023, p. 100597, 2024, doi: 10.1016/j.mlwa.2024.100597.
Additional Files
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 A'zham Albar Rasyid, Pulung Nurtantio Andono, Ruri Suko Basuki

This work is licensed under a Creative Commons Attribution 4.0 International License.

</a



