# Deep Learning for Sarcasm Identification in News Headlines
## 4 Model Selection  
In this study, we started experimentation by applying classical machine learning (ML) classifiers to detect sarcastic records among datasets. For classical ML, this study focused on decision tree, random forest, multinomial, Bernoulli, and support vector machines (SVM). The decision tree model is a non-parametric model that partitions the input space into regions corresponding to specific classes. The random forest model is an ensemble of decision trees that combines their predictions to make the final prediction. The multinomial and Bernoulli models are variants of the naive Bayes algorithm that work well for multi-class and binary text classification tasks. The SVM model is a linear model that separates the input space into different classes using a hyperplane. Previous studies have shown that the SVM model works well for text classification tasks. In addition to the classical classifiers, we also utilized an original Long Short-Term Memory (LSTM) from Sequential Deep Learning Models. This model consisted of an embedding layer, followed by two dense layers with an ReLU activation function, two Dropout layers, and a dense layer with Sigmoid activation function as the output layer. The embedding layer provided a dense representation of the words in the input sequence, while the LSTM layer captured the temporal dependencies of the sequence. The two dense layers were used to capture higher-level patterns in the data. Despite the good performance of these models, with accuracies ranging from 64.87% to 84.25%, we proposed a GMP-LSTM model to improve accuracy further. We evaluated the model's performance by comparing accuracy, precision, recall, and F1 scores across all the applied classifiers. F1-measure, precision, recall, and accuracy were the measures employed to assess the technique. Equations (1)-(4) present the formulas for F1-measure, precision, recall, and accuracy:  
\[\text{F1-measure}:\ F1=2\times(precision\times recall)/(Precision\times recall) \tag{1}\]  
\[\text{Precision}:\ precision=TP/(TP+FP) \tag{2}\]  
\[\text{Recall}:\ recall=TP/(TP+FN) \tag{3}\]  
\[\text{Accuracy}:\ Accuracy=(Correct\ predictions)/(Total\ predictions) \tag{4}\]  
We commonly evaluate a classification algorithm's performance using accuracy, defined as the ratio of correctly classified instances to the total number of instances (4). However, accuracy alone might not provide a complete picture of the performance. Preci  
Figure 5: Sarcastic headlines. sion (2) is the ratio of true positive instances to the total number of true positive and false positive instances. At the same time, recall (3) is the ratio of actual positive instances to the sum of actual positive and false negative instances. We calculated the F1-measure using both precision and recall (1). We then split the dataset into a 70:30 ratio for training and validation sets. The accuracy results presented in Table 4 indicate that relying solely on classifiers such as decision tree, random forest, multinomial, Bernoulli, support vector, and LSTM may not be sufficient for accurate sarcasm detection in text. To address this limitation, we propose a novel deep learning architecture called GMP-LSTM, which combines Global Max Pooling with Long Short-Term Memory (LSTM) networks. This study introduces the GMP-LSTM model to overcome traditional classifiers' limitations in detecting sarcasm in text data. The experimental results show that the GMP-LSTM model achieves promising performance with an accuracy of over 90%. This result indicates that the GMP-LSTM model is a practical approach for detecting sarcasm in text data. The subsequent section will provide more details on this novel model and its potential applications. Proposed GMP-LSTM Model. In the proposed model, we replaced the LSTM layer with a GlobalMaxPool1D layer, which performs max pooling operations on the temporal sequences. We added four dense layers with ReLU activation functions, four dropout layers, and a dense layer with a sigmoid activation function as the output layer.