Beyond Sentiment: Detecting Sarcasm in Financial Cash Tag Discourse Using BERT
Keywords:
Sentiment Analysis, Sarcasm Detection, Financial Text Mining, BERTAbstract
As microblogging grows rapidly and significantly affects online communication, it creates new challenges for sentiment analysis systems. One of them is the sarcasm gap, in which the intended message of the user has a very different meaning from what they actually write. This introduces noise and prediction errors in automated trading systems. This paper proposes a BERT-based framework designed to detect sarcasm within financial cashtag discourse, specifically targeting high-volume cashtags such as $AAPL and $TSLA on platforms including X (formerly Twitter) and StockTwits. The framework leverages bidirectional context through Masked Language Modelling (MLM) to generate deep contextual embeddings capable of identifying polarity reversal—instances where ostensibly positive language conceals negative sentiment. WordPiece tokenization is employed to manage out-of-vocabulary (OOV) financial terminology while preserving domain-critical cashtag prefixes. Experimental evaluation on a Gold Standard dataset comprising 12,500 manually annotated posts (sourced 60% from X and 40% from StockTwits) demonstrates that the proposed BERT-based model achieves an F1-score of 0.87 and an AUPRC of 0.91, representing improvements of 14.5% and 18.2% respectively, over a Bi-LSTM baseline with 128 hidden units and GloVe embeddings. All improvements are statistically significant (p < 0.01, paired bootstrap test). Multi-head attention visualizations via BertViz confirm that the model’s internal reasoning aligns with linguistically meaningful sarcasm indicators. These findings demonstrate that Transformer-based architectures constitute a critical advancement for minimizing false positives and enhancing predictive signal quality in automated financial trading systems.
References
Kelvin Du, Frank Xing, “Financial Sentiment Analysis: Techniques and Applications,” ACM Comput. Surv., vol. 56, no. 9, pp. 1–42, 2024, [Online]. Available: https://dl.acm.org/doi/full/10.1145/3649451
Muhammad Qasim Memon, Santosh Kumar Banbhrani, “Detecting Sarcasm In Social Media Posts Using Transformer-Based Language Models With Contextual And Sentiment-Aware Features,” Spectr. Eng. Sci., vol. 2, no. 5, 2024, [Online]. Available: https://thesesjournal.com/index.php/1/article/view/354
“Research on Sarcastic Emotion Recognition Based on Multiple Feature Fusion | ITM Web of Conferences.” Accessed: Apr. 21, 2026. [Online]. Available: https://www.itm-conferences.org/articles/itmconf/abs/2025/01/itmconf_dai2024_02008/itmconf_dai2024_02008.html
J. N. Patil, D. H. Patil, R. K. Binnar, C. B. Jadhav, A. S. H., and P. P. R., “A Scalable AI-Driven Natural Language Interface for Algorithmic Trading with Strategy Validation and Asynchronous Execution,” Int. J. Sci. Strateg. Manag. Technol., vol. 02, no. 04, pp. 1–9, Apr. 2026, doi: 10.55041/IJSMT.V2I4.156.
B. Liu, “Sentiment analysis : mining opinions, sentiments, and emotions,” p. 431, 2020, Accessed: Apr. 21, 2026. [Online]. Available: https://books.google.com/books/about/Sentiment_Analysis.html?id=PdX7DwAAQBAJ
Dogu Araci, “FinBERT: Financial Sentiment Analysis with Pre-trained Language Models,” arXiv:1908.10063, 2019, [Online]. Available: https://arxiv.org/abs/1908.10063
Shervin Minaee, Nal Kalchbrenner, Erik Cambria, Narjes Nikzad, Meysam Chenaghlu, Jianfeng Gao, “Deep Learning Based Text Classification: A Comprehensive Review,” arXiv:2004.03705, 2021, [Online]. Available: https://arxiv.org/abs/2004.03705
K. Mishev, A. Gjorgjevikj, I. Vodenska, L. T. Chitkushev and D. Trajanov, “Evaluation of Sentiment Analysis in Finance: From Lexicons to Transformers,” IEEE Access, vol. 8, pp. 131662–131682, 2020, doi: 10.1109/ACCESS.2020.3009626.
“FinBERT-FOMC: Fine-Tuned FinBERT Model with Sentiment Focus Method for Enhancing Sentiment Analysis of FOMC Minutes.” Accessed: Apr. 21, 2026. [Online]. Available: https://dl.acm.org/doi/fullHtml/10.1145/3604237.3626843
“Towards Efficient FinBERT via Quantization and Coreset for Financial Sentiment Analysis - ACL Anthology.” Accessed: Apr. 21, 2026. [Online]. Available: https://aclanthology.org/2025.finnlp-2.6/
A. Vaswani et al., “Attention Is All You Need,” Adv. Neural Inf. Process. Syst., vol. 2017-December, pp. 5999–6009, Jun. 2017, Accessed: Oct. 01, 2023. [Online]. Available: https://arxiv.org/abs/1706.03762v7
Jesse Vig, “A Multiscale Visualization of Attention in the Transformer Model,” arXiv:1906.05714, 2019, [Online]. Available: https://arxiv.org/abs/1906.05714
T. Wolf et al., “Transformers: State-of-the-Art Natural Language Processing,” EMNLP 2020 - Conf. Empir. Methods Nat. Lang. Process. Proc. Syst. Demonstr., pp. 38–45, 2020, doi: 10.18653/V1/2020.EMNLP-DEMOS.6.
V. Sanh, L. Debut, J. Chaumond, and T. Wolf, “DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter,” arXiv Prepr. arXiv1910.01108, 2019, [Online]. Available: https://arxiv.org/pdf/1910.01108
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 50sea

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


















