A Dual Encoder Architecture for Robust, Adversarial Aware Sarcasm Detection across Heterogeneous Text Corpora
摘要
Sarcasm detection is challenging in natural language processing due to contextual, emotional, and cultural nuances. This paper proposes a dual-encoder BERT (D-BERT) architecture addressing contextual diversity and sentiment reversal challenges in sarcasm detection. We developed D-BERT with two specialized stages: the first BERT extracts deep contextual embeddings while the second performs classification. The model was trained on 149,480 samples from Twitter, Reddit, SemEval, and The Onion, representing diverse communication styles. D-BERT achieved validation accuracies of 91% (95% CI(Confidence Interval): [0.902, 0.918]) on multi-domain data, 86.4% on Twitter, and 83.6% on Reddit, with F1-scores of 0.91, 0.86, and 0.84 respectively. Statistical validation confirmed 13% improvement over single-encoder BERT (McNemar’s