A Hybrid LSTM-CNN Model for Text-based Sarcasm Detection
Keywords:
Sarcasm Detection, Convolutional Neural Network, Long Short-Term Memory, Deep Learning, Natural Language Processing, Sentiment AnalysisAbstract
Sarcasm detection is still a difficult task in a Natural Language Processing (NLP) system as the meaning of sarcastic expression is not always the same as the literal meaning. While deep learning methods have proven successful for sarcasm detection, many existing models are ineffective at handling both contextual and local semantic information to correctly classify the sarcasm. This work introduces a hybrid LSTM-CNN model for sarcasm detection in the text domain and compares its accuracy with the accuracy of models such as Simple Neural Network (SNN), Convolutional Neural Network (CNN), Long Short-Term Memory (LSTM), BERT and DistilBERT. The News Headlines Dataset for Sarcasm Detection, which contains 28,619 news headlines labeled as sarcastic or not, was used for the experiments. To prepare the text data for the model, it was first preprocessed using a combination of cleaning, tokenization, lower-casing, and padding sequences. The performance of models was assessed through the use of Accuracy, Precision, Recall, F1-score and Binary Cross-Entropy Loss. The experimental results revealed that the proposed sequential CNN-LSTM model achieved better performance than the CNN and LSTM models alone, highlighting the advantage of the sequential CNN-LSTM model in combining sequential contextual learning with CNN feature extraction. Transformer models (BERT and DistilBERT) however had the best overall classification performance. The results show transformer architectures outperform them in terms of predictive accuracy, but the proposed LSTM–CNN model is a lightweight model that is also appropriate for text classification tasks with limited resources.