Skip to main content
Log in

Sarcasm detection using deep learning and ensemble learning

  • Published:
Multimedia Tools and Applications Aims and scope Submit manuscript

Abstract

Across the globe, there is a noticeable upward trend of incorporating sarcasm in everyday life. This trend can be easily attributed to the frequent use of sarcasm in everyday life, but more specifically to social media and the Internet. This study aims to bridge the gap between human and machine intelligence to recognize and understand sarcastic behavior and patterns. The research is based on using various neural techniques, namely Long Short-Term Memory (LSTM), Gated Recurrent Unit (GRU), and Baseline Convolutional Neural Networks (CNN) in an ensemble model to detect sarcasm on the internet. In order to improve the precision of the proposed model, the required dataset is also prepared on different previously trained word-embedding models like fastText, Word2Vec, and GloVe, etc., and their accuracies are compared. The aim is to be able to quantify the overall sentiment of the writer as positive or negative / sarcastic or non-sarcastic to ensure that the correct message is received to the intended audience. The final study revealed that the proposed ensemble model with word embeddings outperformed the other state-of-the-art models and deep learning models considered in this study with an accuracy of around 96% for News Headlines dataset, 73% for Reddit dataset, and amongst our proposed ensemble models, Weighted Average Ensemble gave the highest accuracy of around 99% and 82% for both the datasets respectively. Ensemble model used in our study improvised the stability, precision and predictive power of the proposed model.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17
Fig. 18
Fig. 19
Fig. 20
Fig. 21

Similar content being viewed by others

References

  1. Al-Moslmi T, Omar N, Abdullah S, Albared M (2017) Approaches to cross-domain sentiment analysis: a systematic literature review. Ieee access 5:16173–16192

    Article  Google Scholar 

  2. Aloufi S, El Saddik A (2018) Sentiment identification in football-specific tweets. IEEE Access 6:78609–78621

    Article  Google Scholar 

  3. Alzubi, J., Nayyar, A., & Kumar, A. (2018, November). Machine learning from theory to algorithms: an overview. In journal of physics: conference series (Vol. 1142, no. 1, p. 012012). IOP publishing.

  4. Amir, S., Wallace, B. C., Lyu, H., Carvalho, P., & Silva, M. J. (2016, August). Modelling context with user Embeddings for sarcasm detection in social media. In proceedings of the 20th SIGNLL conference on computational natural language learning (pp. 167-177).

  5. Bakshi, R. K., Kaur, N., Kaur, R., & Kaur, G. (2016, March). Opinion mining and sentiment analysis. In 2016 3rd international conference on computing for sustainable global development (INDIACom) (pp. 452-455). IEEE.

  6. Barbieri, F., Saggion, H., & Ronzano, F. (2014, June). Modelling sarcasm in twitter, a novel approach. In proceedings of the 5th workshop on computational approaches to subjectivity, sentiment and social media analysis (pp. 50-58).

  7. Bark, O., Grigoriadis, A., Pettersson, J., Risne, V., Siitova, A., & Yang, H. (2017). A deep learning approach for identifying sarcasm in text (Bachelor's thesis).

    Google Scholar 

  8. Bharti SK, Vachha B, Pradhan RK, Babu KS, Jena SK (2016) Sarcastic sentiment detection in tweets streamed in real time: a big data approach. Digital Communications and Networks 2(3):108–121

    Article  Google Scholar 

  9. Bojanowski P, Grave E, Joulin A, Mikolov T (2017) Enriching word vectors with subword information. Transactions of the Association for Computational Linguistics 5:135–146

    Article  Google Scholar 

  10. Bouazizi M, Ohtsuki T (2017) A pattern-based approach for multi-class sentiment analysis in twitter. IEEE Access 5:20617–20639

    Article  Google Scholar 

  11. Bouazizi M, Ohtsuki T (2018) Multi-class sentiment analysis in twitter: what if classification is not the answer. IEEE Access 6:64486–64502

    Article  Google Scholar 

  12. Chung, J., Gulcehre, C., Cho, K., & Bengio, Y. (2014). Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555.

  13. Dave, K., Lawrence, S., & Pennock, D. M. (2003, May). Mining the peanut gallery: opinion extraction and semantic classification of product reviews. In proceedings of the 12th international conference on world wide web (pp. 519-528).

  14. Felbo, B., Mislove, A., Søgaard, A., Rahwan, I., & Lehmann, S. (2017). Using millions of emoji occurrences to learn any-domain representations for detecting sentiment, emotion and sarcasm. Stat, 1050, 1.

  15. Fersini, E., Pozzi, F. A., & Messina, E. (2015, October). Detecting irony and sarcasm in microblogs: the role of expressive signals and ensemble classifiers. In 2015 IEEE international conference on data science and advanced analytics (DSAA) (pp. 1-8). IEEE.

  16. Filatova, E. (2012, May). Irony and sarcasm: Corpus generation and analysis using crowdsourcing. In Lrec (pp. 392-398).

  17. Ghosh, A., & Veale, T. (2016, June). Fracking sarcasm using neural network. In proceedings of the 7th workshop on computational approaches to subjectivity, sentiment and social media analysis (pp. 161-169).

  18. Ghosh, D., Fabbri, A. R., & Muresan, S. (2017). The role of conversation context for sarcasm detection in online interactions. arXiv preprint arXiv:1707.06226.

  19. Hazarika, D., Poria, S., Gorantla, S., Cambria, E., Zimmermann, R., & Mihalcea, R. (2018). Cascade: contextual sarcasm detection in online discussion forums. arXiv preprint arXiv:1805.06413.

  20. Hochreiter S, Schmidhuber J (1997) Long short-term memory. Neural Comput 9(8):1735–1780

    Article  Google Scholar 

  21. Jain D, Kumar A, Garg G (2020) Sarcasm detection in mash-up language using soft attention based bi-directional LSTM and feature-rich CNN Applied Soft Computing:106198

  22. Joshi, A., Tripathi, V., Patel, K., Bhattacharyya, P., & Carman, M. (2016, November). Are word embedding-based features useful for sarcasm detection?. In proceedings of the 2016 conference on empirical methods in natural language processing (pp. 1006-1011).

  23. Joshi A, Bhattacharyya P, Carman MJ (2017) Automatic sarcasm detection: a survey. ACM Computing Surveys (CSUR) 50(5):1–22

    Article  Google Scholar 

  24. Joulin, A., Grave, E., Bojanowski, P., Douze, M., Jégou, H., & Mikolov, T. (2016). fastText. Zip: compressing text classification models. arXiv preprint arXiv:1612.03651.

  25. Khodak, M., Saunshi, N., & Vodrahalli, K. (2018, May). A large self-annotated Corpus for sarcasm. In proceedings of the eleventh international conference on language resources and evaluation (LREC 2018).

  26. Kreuz RJ, Roberts RM (1995) Two cues for verbal irony: hyperbole and the ironic tone of voice. Metaphor Symb 10(1):21–31

    Google Scholar 

  27. Kumar, A., & Garg, G. (2019). Empirical study of shallow and deep learning models for sarcasm detection using context in benchmark datasets. Journal of ambient intelligence and humanized computing, 1-16.

  28. Kumar, A., & Jaiswal, A. (2017). Empirical study of twitter and tumblr for sentiment analysis using soft computing techniques. In proceedings of the world congress on engineering and computer science (Vol. 1, pp. 1-5).

  29. Kumar A, Jaiswal A (2020) Systematic literature review of sentiment analysis on twitter using soft computing techniques. Concurrency and Computation: Practice and Experience 32(1):e5107

    Article  MathSciNet  Google Scholar 

  30. Kumar A, Sebastian TM (2012) Sentiment analysis on twitter. International Journal of Computer Science Issues (IJCSI) 9(4):372

    Google Scholar 

  31. Kumar A, Teeja MS (2012) Sentiment analysis: a perspective on its past, present and future. International Journal of Intelligent Systems and Applications 4(10):1–14

    Article  Google Scholar 

  32. Kumar A, Sangwan SR, Arora A, Nayyar A, Abdel-Basset M (2019) Sarcasm detection using soft attention-based bidirectional long short-term memory model with convolution network. IEEE Access 7:23319–23328

    Article  Google Scholar 

  33. Kumar A, Sangwan SR, Arora A, Nayyar A, Abdel-Basset M (2019) Sarcasm detection using soft attention-based bidirectional long short-term memory model with convolution network. IEEE access 7:23319–23328

    Article  Google Scholar 

  34. Kumar A, Narapareddy VT, Srikanth VA, Malapati A, Neti LBM (2020) Sarcasm detection using multi-head attention based bidirectional LSTM. IEEE Access 8:6388–6397

    Article  Google Scholar 

  35. Kumar A, Sangwan SR, Nayyar A (2020) Multimedia Social Big Data: Mining. In: Multimedia social big data: Mining, In multimedia big data computing for IoT applications (pp. 289–321). Springer, Singapore

    Google Scholar 

  36. Kumari A, Behera RK, Sahoo KS, Nayyar A, Kumar Luhach A, Prakash Sahoo S (2020) Supervised link prediction using structured-based feature extraction in social network. Practice and Experience, Concurrency and Computation, p e5839

    Google Scholar 

  37. LeCun Y, Bottou L, Bengio Y, Haffner P (1998) Gradient-based learning applied to document recognition. Proc IEEE 86(11):2278–2324

    Article  Google Scholar 

  38. Lemmens, J., Burtenshaw, B., Lotfi, E., Markov, I., & Daelemans, W. (2020, July). Sarcasm detection using an ensemble approach. In proceedings of the second workshop on figurative language processing (pp. 264-269).

  39. Ling, J., & Klinger, R. (2016, May). An empirical, quantitative analysis of the differences between sarcasm and irony. In European semantic web conference (pp. 203-216). Springer, Cham.

  40. Liu, P., Chen, W., Ou, G., Wang, T., Yang, D., & Lei, K. (2014, June). Sarcasm detection in social media based on imbalanced classification. In international conference on web-age information management (pp. 459-471). Springer, Cham.

  41. Majumder N, Poria S, Peng H, Chhaya N, Cambria E, Gelbukh A (2019) Sentiment and sarcasm classification with multi-task learning. IEEE Intell Syst 34(3):38–43

    Article  Google Scholar 

  42. Manohar, M. Y., & Kulkarni, P. (2017, June). Improvement sarcasm analysis using NLP and corpus based approach. In 2017 international conference on intelligent computing and control systems (ICICCS) (pp. 618-622). IEEE.

  43. Maynard, D. G., & Greenwood, M. A. (2014, March). Who cares about sarcastic tweets? investigating the impact of sarcasm on sentiment analysis. In LREC 2014 Proceedings. ELRA.

  44. Mehndiratta P, Soni D (2019) Identification of sarcasm in textual data: a comparative study. Journal of Data and Information Science 4(4):56–83

    Article  Google Scholar 

  45. Mehndiratta P, Soni D (2019) Identification of sarcasm using word embeddings and hyperparameters tuning. J Discret Math Sci Cryptogr 22(4):465–489

    Article  Google Scholar 

  46. Mehndiratta P, Sachdeva S, Soni D (2017) Detection of sarcasm in text data using deep convolutional neural networks. Scalable Computing: Practice and Experience 18(3):219–228

    Google Scholar 

  47. Mikolov, T., Chen, K., Corrado, G., & Dean, J. (2013). Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781.

  48. Mishra, A., Dey, K., & Bhattacharyya, P. (2017, July). Learning cognitive features from gaze data for sentiment and sarcasm classification using convolutional neural network. In proceedings of the 55th annual meeting of the Association for Computational Linguistics (volume 1: long papers) (pp. 377-387).

  49. Misra, R., & Arora, P. (2019). Sarcasm detection using hybrid neural network. arXiv preprint arXiv:1908.07414.

  50. Onan, A. (2019, April). Topic-enriched word embeddings for sarcasm identification. In computer science on-line conference (pp. 293-304). Springer, Cham.

  51. Pai PF, Liu CH (2018) Predicting vehicle sales by sentiment analysis of twitter data and stock market values. IEEE Access 6:57655–57662

    Article  Google Scholar 

  52. Patro, J., Bansal, S., & Mukherjee, A. (2019, November). A deep-learning framework to detect sarcasm targets. In proceedings of the 2019 conference on empirical methods in natural language processing and the 9th international joint conference on natural language processing (EMNLP-IJCNLP) (pp. 6337-6343).

  53. Pelser, D., & Murrell, H. (2019). Deep and dense sarcasm detection. arXiv preprint arXiv:1911.07474.

  54. Pennington, J., Socher, R., & Manning, C. D. (2014, October). GloVe: global vectors for word representation. In proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP) (pp. 1532-1543).

  55. Poria S, Cambria E, Hazarika D, Vij P (2016, December) A deeper look into sarcastic tweets using deep convolutional neural networks. In proceedings of COLING 2016, the 26th international conference on computational linguistics: technical papers (pp. 1601-1612)

  56. Porwal S, Ostwal G, Phadtare A, Pandey M, Marathe MV (2018, June) Sarcasm detection using recurrent neural network. In 2018 second international conference on intelligent computing and control systems (ICICCS) (pp. 746-748). IEEE

  57. Potamias RA, Siolas G, Stafylopatis AG (2020) A transformer-based approach to irony and sarcasm detection. Neural computing and applications, 1-12

  58. Saha S, Yadav J, Ranjan P (2017) Proposed approach for sarcasm detection in twitter. Indian J Sci Technol 10(25):1–8

    Article  Google Scholar 

  59. Sarsam SM, Al-Samarraie H, Alzahrani AI, Wright B (2020) Sarcasm detection using machine learning algorithms in twitter: a systematic review. Int J Mark Res 62(5):578–598

    Article  Google Scholar 

  60. Shayaa S, Jaafar NI, Bahri S, Sulaiman A, Wai PS, Chung YW, … Al-Garadi MA (2018) Sentiment analysis of big data: methods, applications, and open challenges. IEEE Access 6:37807–37827

    Article  Google Scholar 

  61. Sobti P, Nayyar A, Nagrath P (2021) EnsemV3X: a novel ensembled deep learning architecture for multi-label scene classification. PeerJ Computer Science 7:e557

    Article  Google Scholar 

  62. Tarigan J, Girsang G (2018) Word similarity score as augmented feature in sarcasm detection using deep learning. International Journal of Advanced Computer Research. 8. 354–363

  63. Tseng CW, Chou JJ, Tsai YC (2018) Text mining analysis of teaching evaluation questionnaires for the selection of outstanding teaching faculty members. IEEE Access 6:72870–72879

    Article  Google Scholar 

  64. Wang K, Bansal M, Frahm JM (2018, March) Retweet wars: tweet popularity prediction via dynamic multimodal regression. In 2018 IEEE winter conference on applications of computer vision (WACV) (pp. 1842-1851). IEEE

  65. Wu D, Chi M (2017) Long short-term memory with quadratic connections in recursive neural networks for representing compositional semantics. IEEE Access 5:16077–16083

    Article  Google Scholar 

  66. Zhang M, Zhang Y, Fu G (2016, December) Tweet sarcasm detection using deep neural network. In proceedings of COLING 2016, the 26th international conference on computational linguistics: technical papers (pp. 2449-2460)

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Anand Nayyar.

Ethics declarations

Conflicts of interests/competing interests

The authors declare there is no conflicts of interests / competing interests at all associated with this manuscript.

Additional information

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Goel, P., Jain, R., Nayyar, A. et al. Sarcasm detection using deep learning and ensemble learning. Multimed Tools Appl 81, 43229–43252 (2022). https://doi.org/10.1007/s11042-022-12930-z

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11042-022-12930-z

Keywords

Navigation