Enhanced Semantic Representation Learning for Sarcasm Detection by Integrating Context-Aware Attention and Fusion Network
Abstract
:1. Introduction
- A novel Contextual Sarcasm Detection Model is proposed that integrates enhanced semantic representation learning based on comment contents and diverse contextual clues;
- For comment representation learning, we employ a context-aware attention mechanism to capture the key parts of sentences in response to the corresponding contextual information;
- For context representation learning, we employ a user-forum fusion network to generate a comprehensive context representation by integrating user information and forum information;
- Experimental results from a large Reddit corpus, SARC, demonstrate that our proposed method achieves a significant performance improvement over state-of-art textual sarcasm detection methods.
2. Related Work
3. Proposed Model
3.1. Overview
3.2. Task Definition
3.3. Comment Representation Learning
3.4. Context Representation Learning
3.5. Decision Learning
4. Experiment
4.1. Experimental Data
4.2. Comparison Models
- CBOW The model employs the continuous bag of words to represent comments and applies a fully connected layer to recognize sarcasm.
- CNN The model applies a single CNN on the comment to capture location-invariant local patterns and combines the CNN with a fully connected layer to detect sarcasm.
- LSTM The model uses the Bi-LSTM on the comment to capture the long-range dependency and combines the Bi-LSTM with a fully connected layer to detect sarcasm.
- BERT-FCL The model [23] uses BERT to represent comments and combines BERT with a fully connected layer to detect sarcasm.
- SAWS The model [19] adopts a self-attention mechanism of weighted snippets with a context vector to capture the incongruity of sentence snippets.
- ADGCN The model [12] employs a graph convolutional network based on an affective graph and a dependency graph in order to capture the long-range literal sentiment inconsistencies.
- CUE-CNN The model [9] learns user embeddings by projecting similar users into nearby regions of the embedding space and combines user embeddings with a CNN to detect sarcasm.
- CASCADE The model [14] adopts a hybrid approach with both content and context-driven modeling for sarcasm detection, where user embeddings are used to encode the stylometric and personality features of users.
4.3. Training Details
4.4. Experimental Results
4.5. Ablation Study
4.6. Case Study
4.7. Error Analysis
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Plepi, J.; Flek, L. Perceived and Intended Sarcasm Detection with Graph Attention Networks. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP Findings 2021), Punta Cana, Dominican Republic, 16–20 November 2021. [Google Scholar]
- Baroiu, A.; Trausan-Matu, S. Automatic Sarcasm Detection: Systematic Literature Review. Information 2022, 13, 399. [Google Scholar] [CrossRef]
- Joshi, A.; Bhattacharyya, P.; Carman, M.J. Automatic Sarcasm Detection: A Survey. ACM Comput. Surv. 2017, 50, 73:1–73:22. [Google Scholar] [CrossRef]
- Riloff, E.; Qadir, A.; Surve, P.; Silva, L.D.; Gilbert, N.; Huang, R. Sarcasm as Contrast between a Positive Sentiment and Negative Situation. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing (EMNLP 2013), Seattle, WA, USA, 18–21 October 2013. [Google Scholar]
- Reyes, A.; Rosso, P.; Veale, T. A multidimensional approach for detecting irony in Twitter. Lang. Resour. Eval. 2013, 47, 239–268. [Google Scholar] [CrossRef]
- Poria, S.; Cambria, E.; Hazarika, D.; Vij, P. A Deeper Look into Sarcastic Tweets Using Deep Convolutional Neural Networks. In Proceedings of the 26th International Conference on Computational Linguistics (COLING 2016), Osaka, Japan, 11–16 December 2016. [Google Scholar]
- Xiong, T.; Zhang, P.; Zhu, H.; Yang, Y. Sarcasm Detection with Self-matching Networks and Low-rank Bilinear Pooling. In Proceedings of the World Wide Web Conference (WWW 2019), San Francisco, CA, USA, 13–17 May 2019. [Google Scholar]
- Akula, R.; Garibay, I. Interpretable Multi-Head Self-Attention Architecture for Sarcasm Detection in Social Media. Entropy 2021, 23, 394. [Google Scholar] [CrossRef] [PubMed]
- Amir, S.; Wallace, B.C.; Lyu, H.; Carvalho, P.; Silva, M.J. Modelling Context with User Embeddings for Sarcasm Detection in Social Media. In Proceedings of the 20th SIGNLL Conference on Computational Natural Language Learning (CoNLL 2016), Berlin, Germany, 11–12 August 2016. [Google Scholar]
- Poria, S.; Hazarika, D.; Majumder, N.; Mihalcea, R. Beneath the Tip of the Iceberg: Current Challenges and New Directions in Sentiment Analysis Research. arXiv 2020, arXiv:2005.00357v5. [Google Scholar] [CrossRef]
- Babanejad, N.; Davoudi, H.; An, A.; Papagelis, M. Affective and Contextual Embedding for Sarcasm Detection. In Proceedings of the 28th International Conference on Computational Linguistics (COLING 2020), Barcelona, Spain, 8–13 December 2020. [Google Scholar]
- Lou, C.; Liang, B.; Gui, L.; He, Y.; Dang, Y.; Xu, R. Affective Dependency Graph for Sarcasm Detection. In Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR 2021), Montreal, QC, Canada, 11–15 July 2021. [Google Scholar]
- Jena, A.K.; Sinha, A.; Agarwal, R. C-Net: Contextual Network for Sarcasm Detection. In Proceedings of the Second Workshop on Figurative Language Processing (Fig-Lang@ACL 2020), Online, 9 July 2020. [Google Scholar]
- Hazarika, D.; Poria, S.; Gorantla, S.; Cambria, E.; Zimmermann, R.; Mihalcea, R. CASCADE: Contextual Sarcasm Detection in Online Discussion Forums. In Proceedings of the 27th International Conference on Computational Linguistics (COLING 2018), Santa Fe, NM, USA, 20–26 August 2018. [Google Scholar]
- Maynard, D.; Greenwood, M.A. Who cares about sarcastic tweets? Investigating the impact of sarcasm on sentiment analysis. In Proceedings of the Ninth International Conference on Language Resources and Evaluation (LREC 2014), Reykjavik, Iceland, 26–31 May 2014. [Google Scholar]
- Veale, T.; Hao, Y. Detecting Ironic Intent in Creative Comparisons. In Proceedings of the 19th European Conference on Artificial Intelligence (ECAI 2010), Lisbon, Portugal, 16–20 August 2010. [Google Scholar]
- Lukin, S.M.; Walker, M.A. Really? Well. Apparently Bootstrapping Improves the Performance of Sarcasm and Nastiness Classifiers for Online Dialogue. arXiv 2017, arXiv:1708.08572. [Google Scholar]
- Tay, Y.; Luu, A.T.; Hui, S.C.; Su, J. Reasoning with Sarcasm by Reading In-Between. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (ACL 2018), Melbourne, Australia, 15–20 July 2018. [Google Scholar]
- Pan, H.; Lin, Z.; Fu, P.; Wang, W. Modeling the Incongruity Between Sentence Snippets for Sarcasm Detection. In Proceedings of the 24th European Conference on Artificial Intelligence (ECAI 2020), Santiago de Compostela, Spain, 29 August–8 September 2020. [Google Scholar]
- Zhang, M.; Zhang, Y.; Fu, G. Tweet Sarcasm Detection Using Deep Neural Network. In Proceedings of the 26th International Conference on Computational Linguistics (COLING 2016), Osaka, Japan, 11–16 December 2016. [Google Scholar]
- Du, Y.; Li, T.; Pathan, M.S.; Teklehaimanot, H.K.; Yang, Z. An Effective Sarcasm Detection Approach Based on Sentimental Context and Individual Expression Habits. Cogn. Comput. 2022, 14, 78–90. [Google Scholar] [CrossRef]
- Kamal, A.; Abulaish, M. CAT-BiGRU: Convolution and Attention with Bi-Directional Gated Recurrent Unit for Self-Deprecating Sarcasm Detection. Cogn. Comput. 2022, 14, 91–109. [Google Scholar] [CrossRef]
- Baruah, A.; Das, K.A.; Barbhuiya, F.A.; Dey, K. Context-Aware Sarcasm Detection Using BERT. In Proceedings of the Second Workshop on Figurative Language Processing (Fig-Lang@ACL 2020), Online, 9 July 2020. [Google Scholar]
- Wang, R.; Wang, Q.; Liang, B.; Chen, Y.; Wen, Z.; Qin, B.; Xu, R. Masking and Generation: An Unsupervised Method for Sarcasm Detection. In Proceedings of the 45th International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR 2022), Madrid, Spain, 11–15 July 2022. [Google Scholar]
- Wen, Z.; Gui, L.; Wang, Q.; Guo, M.; Yu, X.; Du, J.; Xu, R. Sememe knowledge and auxiliary information enhanced approach for sarcasm detection. Inf. Process. Manag. 2022, 59, 102883. [Google Scholar] [CrossRef]
- Bojanowski, P.; Grave, E.; Joulin, A.; Mikolov, T. Enriching Word Vectors with Subword Information. arXiv 2016, arXiv:1607.04606. [Google Scholar] [CrossRef]
- Wang, Y.; Huang, M.; Zhu, X.; Zhao, L. Attention-based LSTM for Aspect-level Sentiment Classification. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing (EMNLP 2016), Austin, TX, USA, 1–4 November 2016. [Google Scholar]
- Le, Q.V.; Mikolov, T. Distributed Representations of Sentences and Documents. In Proceedings of the 31th International Conference on Machine Learning (ICML 2014), Beijing, China, 21–26 June 2014. [Google Scholar]
- Cai, Y.; Cai, H.; Wan, X. Multi-Modal Sarcasm Detection in Twitter with Hierarchical Fusion Model. In Proceedings of the 57th Conference of the Association for Computational Linguistics (ACL 2019), Florence, Italy, 28 July–2 August 2019. [Google Scholar]
- Khodak, M.; Saunshi, N.; Vodrahalli, K. A Large Self-Annotated Corpus for Sarcasm. arXiv 2017, arXiv:1704.05579. [Google Scholar]
Dataset | Training | Testing | ||
---|---|---|---|---|
Nonsarcastic | Sarcastic | Nonsarcastic | Sarcastic | |
Main balanced | 77,351 | 77,351 | 32,333 | 32,333 |
Pol balanced | 6834 | 6834 | 1703 | 1703 |
Pol imbalanced | 37,941 | 9485 | 21,070 | 2341 |
Parameter | Value |
---|---|
Maximum sequence Length | 100 |
Batch Size | 32 |
Learning rate | 0.001 |
Dimensions of comment embedding | 300 |
Dimensions of user embedding | 100 |
Dimensions of forum embedding | 100 |
Models | Main Balanced | Pol Balanced | Pol Imbalanced | |||
---|---|---|---|---|---|---|
Accuracy | F1 | Accuracy | F1 | Accuracy | F1 | |
CBOW | 0.60 | 0.60 | 0.60 | 0.60 | 0.80 | 0.44 |
CNN | 0.63 | 0.63 | 0.65 | 0.65 | 0.81 | 0.53 |
LSTM | 0.50 | 0.45 | 0.50 | 0.43 | 0.80 | 0.44 |
BERT-FCL | 0.65 | 0.65 | 0.57 | 0.56 | 0.73 | 0.71 |
BERT- | 0.68 | 0.60 | 0.75 | 0.33 | 0.83 | 0.71 |
SAWS | 0.64 | 0.64 | 0.59 | 0.59 | 0.80 | 0.54 |
ADGCN | 0.62 | 0.62 | 0.65 | 0.65 | 0.79 | 0.66 |
CUE-CNN | 0.59 | 0.57 | 0.67 | 0.67 | 0.80 | 0.44 |
CASCADE | 0.62 | 0.62 | 0.63 | 0.64 | 0.79 | 0.88 |
CSDM | 0.69 | 0.69 | 0.70 | 0.70 | 0.83 | 0.67 |
Models | Main Balanced | Pol Balanced | Pol Imbalanced | |||
---|---|---|---|---|---|---|
Accuracy | F1 | Accuracy | F1 | Accuracy | F1 | |
CSDM-c | 0.67 | 0.67 | 0.66 | 0.66 | 0.80 | 0.66 |
CSDM-u | 0.66 | 0.66 | 0.68 | 0.68 | 0.80 | 0.65 |
CSDM-f | 0.68 | 0.68 | 0.69 | 0.69 | 0.80 | 0.68 |
CSDM | 0.69 | 0.69 | 0.70 | 0.70 | 0.83 | 0.67 |
Post | Comment |
---|---|
Analysis | States with more Planned Parenthood clinics have fewer teen births and sexually transmitted diseases | |
Alec Baldwin: Trump “An Enemy of the Working Class” | |
No wonder he won’t release his tax returns; Trump has business ties to at least 10 alleged former Soviet criminals, report claims | |
Net Neutrality Is Trump’s Next Target, Administration Says |
Post | Comment | Ground Truth | Prediction |
---|---|---|---|
Bathroom bill’ to cost North Carolina $3.76B | small price to pay for keeping their women and female children safe | Sarcasm | Nonsarcasm |
Ted Koppel tells Sean Hannity he is bad for America | come on remember all the money he raised for the charity being waterboarded? | Sarcasm | Nonsarcasm |
Republican lawmakers introduce bills to curb protesting in at least 18 states | but the democrats are against freedums | Sarcasm | Nonsarcasm |
Border wall ask: $1 billion for 62 miles | who knew tall concrete walls would be expensive? | Nonsarcasm | Sarcasm |
Star Wars: US Must Prep for Space Battles, Commander Says | only if the space ships run on coal | Nonsarcasm | Sarcasm |
Scarlett Johansson May Run for Office, Isn’t Concerned About Boycotts | probably not the best time for her to be speaking on politics when her newest movie features her as a whitewashed version of an Asian heroine | Nonsarcasm | Sarcasm |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Hao, S.; Yao, J.; Shi, C.; Zhou, Y.; Xu, S.; Li, D.; Cheng, Y. Enhanced Semantic Representation Learning for Sarcasm Detection by Integrating Context-Aware Attention and Fusion Network. Entropy 2023, 25, 878. https://doi.org/10.3390/e25060878
Hao S, Yao J, Shi C, Zhou Y, Xu S, Li D, Cheng Y. Enhanced Semantic Representation Learning for Sarcasm Detection by Integrating Context-Aware Attention and Fusion Network. Entropy. 2023; 25(6):878. https://doi.org/10.3390/e25060878
Chicago/Turabian StyleHao, Shufeng, Jikun Yao, Chongyang Shi, Yu Zhou, Shuang Xu, Dengao Li, and Yinghan Cheng. 2023. "Enhanced Semantic Representation Learning for Sarcasm Detection by Integrating Context-Aware Attention and Fusion Network" Entropy 25, no. 6: 878. https://doi.org/10.3390/e25060878
APA StyleHao, S., Yao, J., Shi, C., Zhou, Y., Xu, S., Li, D., & Cheng, Y. (2023). Enhanced Semantic Representation Learning for Sarcasm Detection by Integrating Context-Aware Attention and Fusion Network. Entropy, 25(6), 878. https://doi.org/10.3390/e25060878