Skip to content

A DoubleBERT-based Multi-model for Sarcasm Prediction from Text, Emoji, and Numbers

Sep 2026 · Recent Advances in Electrical & Electronic Engineering (Formerly Recent Patents on Electrical & Electronic Engineering) · 0 citations

Abstract

Sarcasm detection remains a challenging task in Natural Language Processing (NLP) because sarcasm often conveys a negative meaning with positive words. Furthermore, the extensive use of social media has significantly transformed the way people communicate, making automatic sarcasm detection gradually important. Traditional sarcasm-detection models primarily rely on textual information and often fail to capture the semantic cues conveyed by emojis and numerical expressions. To address this limitation, we present a novel DoubleBERT framework that enhances sarcasm prediction accuracy by jointly exploiting text, emojis, and numbers. The proposed DoubleBERT model employs two independent BERT encoders (BERT-1 and BERT-2), each of which processes the same input tokens in parallel without sharing any parameters. Before the tokenization process, all emojis are converted into their English textual representation (e.g., is converted to 'face with rolling eyes'). Now all three modalities (text, emoji, and numerical expressions) are represented as a sequence of tokens. The resulting (CLS) token embeddings from each encoder are concatenated into a 1536-dimensional feature vector, which is subsequently fed to a sigmoid classifier for binary sarcasm classification. The proposed model was trained on a combined Twitter and Facebook dataset containing 22,664 samples, using a stratified 70/15/15 split for train/validation/test, with the AdamW optimizer for 3 epochs. The proposed DoubleBERT model demonstrated consistent convergence during training, with the training loss decreasing from 0.2171 in the first epoch to 0.1298 in the second epoch and 0.0600 in the third epoch. Validation accuracy improved and reached 0.9944. After successful training and validation, we evaluated the trained model using an ROC (Receiver Operating Characteristic) curve and confusion matrix. The confusion matrix reported 734 true positives, 1043 high true negatives, 6 low false positives, and 4 low false negatives, demonstrating the model’s high classification accuracy and lowest error rate. The major contribution for this work is the development of a DoubleBERT-based multimodal sarcasm detection framework that includes text, emojis, and numbers. The proposed DoubleBERT model was compared with a few baseline models, and it performs better than several stateof- the-art models on the benchmark datasets. In this study, we proposed a DoubleBERT-based model for sarcasm detection that integrates text, emojis, and numbers. The proposed model achieved outstanding performance on the combined Twitter and Facebook dataset, with validation accuracy of 0.9944, precision of 0.9919, recall of 0.9946, and F1-score of 0.9932. These results indicate that the proposed model outperforms the baseline models. To further evaluate the robustness of the proposed model, we have implemented adversarial testing. The model correctly classified 8 test cases out of 10. In future work, we plan to evaluate performance on larger, multilingual, and voice-based datasets for sarcasm detection.

View source

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.