Sarcasm Detection On Social Data: Heuristic Search and Deep Learning
Sarcasm Detection On Social Data: Heuristic Search and Deep Learning
Corresponding Author:
Arumugham Palaniammal
Department of Computer and Information Science, Annamalai University
Chidambaram, India
Email: [email protected]
1. INTRODUCTION
Microblogging platforms are the main mediums for expressing the individual’s opinions, thoughts,
and views on different domains and actions [1]. Sarcasm is a complicated process of irony that often originates
in social networking sites and microblogging platforms, as these platforms frequently support condemnation
and trolling of others [2]. In text classification, sarcasm detection (SD) can be a crucial tool, which has several
effects on numerous fields including sales, health, and security [3]. By using SD methods, companies analyse
clients’ emotions about their products. It offers an important benefit of increasing the quality of products [4].
In sentiment analysis (SA), the sarcasm classification has a critical sub-activity, particularly for classifying
tweets, and for sharing implied details within the information that an individual expresses or conveys with
others [5]. Additionally, the framework of the tweet can be also utilized for predicting sarcasm (for example,
changing the polarity of negative or positive statements into their opposite types). On Twitter, the numerous
problems create SD as a challenging task [6].
While utilizing the traditional machine learning (ML) approach, feature extraction performs a
significant part [7]. A set of features is described for extracting many contexts from the information. In a study,
a set of features to find whether an analysis is sarcastic or not formed. These features are imbalance,
punctuation, and hyperbole. It decides a comment imbalance when the provided star rating is increased
however, the majority of words in the text have negative opinions, and alternately [8]. The comments are
labeled hyperbolically when more than three negative or positive words. The punctuation marks the existence
of exclamation marks or many questions [9]. Deep learning (DL) techniques are also employed for SD because
of their capability to automatically learn difficult representations and patterns in raw text data. Concerning the
DL approach, technique selection is the challenging part [10]. Transformer methods are a current development
in DL methods and are extremely efficient for an extensive range of natural language processing tasks.
This manuscript offers the design of the future search algorithm with deep learning assisted sarcasm
detection and classification on social networking data (FSADL-SDCSND) approach. The major intent of the
FSADL-SDCSND approach is in the effective and automated recognition of sarcastic text. In the presented
FSADL-SDCSND technique, several stages of data preprocessing are achieved to transform the data into a
compatible format. Besides, the FSADL-SDCSND approach applies a bidirectional serial-parallel long
short-term memory (BS-PLSTM) approach for recognizing and classifying the sarcasm. The hyperparameter
tuning process is accomplished by employing the future search algorithm (FSA) for improving the recognition
achievement of the BS-PLSTM model. To exhibit the greater solution of the FSADL-SDCSND model, a
sequence of simulations can be applied.
The subsequent sections of the article are arranged as: section 2 shows the literature review.
Section 3 outlines the proposed model. Section 4 elaborates on the performance evaluation. Section 5 completes
the work.
2. RELATED WORKS
Accoring to Sivalingam et al. [11], an unsupervised learning technique, the conditional random field
structure modified expectation maximization (CRF-MEM) technique is developed to identify sarcasm in
tweets. This developed algorithm targets to address the drawback existing in the standard expectation
maximization (EM) method, the random allocation factors with the presented feature correlation values.
Pandey and Singh [12] proposed a technique including bidirectional encoder representations from transformers
(BERT) stacked with long short-term memory (LSTM). The embedded vectors are utilized by the LSTM
network comprising a single layer. Kumar et al. [13] introduced a multi-head attention (MHA)-based
bidirectional-long short-term memory (Bi-LSTM) model for detecting sarcastic commentaries in a specified
quantity.
Palaniammal and Anandababu [14] introduced a novel chaos specification curve analysis (CSCA)
with a graph convolutional network for sarcasm detection (GCNSD) approach. After pre-processing, the
method implements the graph convolutional network (GCN) framework for identifying and classifying diverse
types of sarcasm. Lastly, the CSCA method was employed for optimally selecting the hyperparameter outputs.
Vinoth and Prabhavathy [15] suggested an intellectual machine learning-based sarcasm detection and
classification (IMLB-SDC) model. The study intends for recognizing the sarcasm presence in social networks.
In addition, the feature engineering method occurs using TF-IDF. Besides, a 2-feature selection (FS) technique
has been implemented like data gain and chi-square.
Vinoth and Prabhavathy [16] designed an automated sarcasm detection and classification method
through a hyperparameter tuned-deep learning (ASDC-HPTDL) approach for a social Network platform. In
the following phase of preprocessing, the pre-processed information can be transferred to the feature vectors
utilized by Glove Embedding's algorithm. Next, the attention bidirectional-gated recurrent unit (Abi-GRU)
method was employed for the classification and detection of sarcasm. Also, the improved artificial flora
optimization (IAFO) approach was exploited for hyperparameter tuning. Ashok et al. [17] recommended a
distinctive deep neural network (DNN) algorithm related to Bi-LSTM on hyperparameters optimizer through
a genetic algorithm (GA) and then a convolution neural network (CNN) for SD.
Sahu and Hudnurkar [18] presents a SD model utilizing chi-square, gain, mutual information, and
symmetrical uncertainty methods. A group classifier namely neural networks (NN), support vector machines
(SVM), random forest (RF), and an optimized deep convolutional neural network (DCNN) with weight
selection is also employed. The clan upgraded grey wolf optimization (CU-GWO) model is introduced for
optimal FS and optimized DCNN. According to Magoo and Singh [19], a heuristic-assisted capsule network
(H-CapNet) technique is proposed. To improve the capsule network, a fusion metaheuristic model, specifically
the escaping energy searched grey–harris hawks’ algorithm (EEG-HHA), is implemented.
Sarcasm detection on social data: heuristic search and deep learning (Arumugham Palaniammal)
4698 ISSN: 2252-8938
User mentions and hashtags: consider whether to replace or remove hashtags and user mentions (e.g.,
"@username"), this may or may not contribute to SD.
Contextual information: capture the conversation context by including some past and succeeding posts or
sentences. It will provide context for detecting sarcasm.
Negation handling: identify negations such as "not," "no," "never," and so on, which represent sarcasm
when applied in a specific context.
Feature engineering: create custom features that may assist in detecting sarcasm, like the presence of
specific words or phrases, word count, and sentence length.
3.2. Sarcasm detection using bidirectional serial-parallel long short-term memory model
For the SD process, the BS-PLSTM model is applied. BS-PLSTM is a development of Bi-LSTM [20].
The major difference among serial-parallel long short-term memory (S‐PLSTM) and exist several LSTM cells
from the S‐PLSTM at timestep 𝑡. For handling the data transferring and integrating issues from the time path
of parallel procedures, 2 gates are designed that are called integrated gates (IGs) and internal integrated gates
(IIGs).
IIG has developed to acquire the internal communications among every parallel model at the existing
timestep and specific method at the subsequent time-steps. IIG proceeds to the hidden layer (HL) ℎ̃𝑡,𝑗 , and cell
layer 𝑐̃𝑡,𝑖 of parallel LSTM cells at the existing timestep as the input part. In the meantime, it employs the
quality embedded vector 𝑒𝑡+1,𝑗 of 𝑗𝑡ℎ procedure at the following timestep as another input part. Afterward, the
HL ℎ𝑡,𝑗 and cell layer 𝑐𝑡,𝑗 and then interactive integration is the outcome as the input vectors of 𝑗𝑡ℎ LSTM cell
at the following timestep. IIG has been established by the subsequent equations:
𝑐̃𝑡,𝑖
𝑔𝑖,𝑗 = 𝜎 (𝑊𝐼𝑙𝐺 {𝑒 } + 𝑏𝐼𝐼𝐺 ) (1)
𝑡+1,𝑗
exp(𝑔𝑖,𝑗 )
𝛼𝑖,𝑗𝑠 = ∑ (2)
𝑖 exp(𝑔𝑖,𝑗 )
𝑐𝑡,𝑖 𝑐̃𝑡,𝑖
{ℎ } = ∑𝑖 𝛼𝑖,𝑗 ∗ { ̃ } (3)
𝑡,𝑗 ℎ𝑡,𝑖
whereas 𝑊𝐼𝐼𝐺 ∈ ℝ(𝑑ℎ +𝑑𝑒𝑚𝑏 )×𝑑ℎ and 𝑏𝑙𝑙𝐺 ∈ ℝ(𝑑ℎ +𝑑𝑒𝑚𝑏 ) are learnable parameters. It proceeds the HL ℎ̃ 𝑇,𝑖 and
cell layer 𝑐̃𝑇,𝑖 of LSTM layers at the last timestep 𝑇 as inputs. Afterward, the HL ℎ 𝑇 is the outcome after
integration.
exp(𝑜𝑘 )
𝛼𝑘 = ∑ (5)
𝑘 exp(𝑜𝑘 )
ℎ 𝑇 = ∑𝑘 𝛼𝑘 ∗ ℎ̃ 𝑇,𝑘 (6)
Whereas 𝑊𝑙𝐺 ∈ ℝ𝑑ℎ ×𝑑ℎ and 𝑏𝑙𝐺 ∈ ℝ𝑑ℎ denote the learnable parameters of IG. The connection between
BS-PLSTM and S-PLSTM is the same as that among BiLSTM as well as LSTM. BS-PLSTM assumes 2
⃗⃗⃗⃗𝑇 ; ⃖⃗⃗⃗⃗
directions of time sequences. Thus, the last outcome of BS-PLSTM is ℎ 𝑇 = [ℎ ℎ1 ].
optimum performance between the other peoples is considered as one person accomplishing the better outcome
in a country over many years.
Based on a mathematical equation, FSA is built and steps start based on the random solution.
In (7), 𝑆(𝑖, : ) implies the 𝑖 𝑡ℎ solution, 𝑈𝑏, and 𝐿𝑏 portrays the search space’s upper and lower boundaries, and
𝑟𝑎𝑛𝑑 denotes the uniform distribution random number in the 𝑑 dimension. The best solution is considered a
global solution (𝐺𝑆), and each solution is considered a local solution (𝐿𝑆) after building all solutions this
process is repeated until an optimal outcome is achieved. In (8), the search phase is based on the 𝐿𝑆 support of
the exploitation feature. In (9), the search process is based on the 𝐺𝑆 maintenance of the exploitation feature.
Each solution is updated by (10), after computing the global and the local convergence. In (11) is utilized to
process upgrades 𝐿𝑆 and 𝐺𝑆.
At last, the algorithm checks 𝐿𝑆 and 𝐺𝑆 because of the upgrading of random initials and updates them if there
is a better solution than 𝐿𝑆 and 𝐺𝑆. The iterative process of FSA is given as follows:
‒ Step 1. A primary population size, the searching space, and the main function are randomly defined. Set
the 𝐿𝑏 and 𝑈𝑏 lower and upper limits. Max. Set 𝑡 = 1, and set the maximal amount of iterations. Compute
the 𝐿𝑆 and 𝐺𝑆. Initialize by (7).
‒ Step 2. The search in all the country and overall world is dependent upon 𝐿𝑆 and 𝐺𝑆 in (8) and (9). The
solution of each person is determined in (10) after computing the global and the local convergence.
‒ Step 3. Compare the fitness value of all the possible solutions to define 𝐿𝑆 and 𝐺𝑆 in the present generation.
Update the 𝐿𝑆 and 𝐺𝑆, if there is a best solution.
‒ Step 4. Compute 𝑡 = 𝑡 + 1. Judge if 𝑡 equivalent to Max. If not, go to step 2. Or else, stop and give the
result.
The optimum fitness is a critical factor in the FSA approach. An encoder output is employed for
developing an improved outcome for candidate efficacy. Now, the value of accuracy is the most important
condition utilized in designing an FF.
4. RESULTS ANALYSIS
The investigational assessment of the FSADL-SDCSND method can be experimented on two datasets
[22]–[25], as portrayed in Table 1. The dataset comprises tweets and user replies accumulated by the
@onlinesarcasm Twitter bot, with user mood data and processed to eliminate URLs and replace mentions,
utilizing tweets as content and replies as context. It also features news headlines from The Onion and HuffPost,
giving high-quality, formal content with clear sarcasm labels. This dataset mitigates noise and sparsity related
to Twitter datasets, and every record encompasses attributes for SD, the headline text, and a link to the original
article. Detailed statistics and a hybrid NN model trained on this dataset are available on GitHub.
Sarcasm detection on social data: heuristic search and deep learning (Arumugham Palaniammal)
4700 ISSN: 2252-8938
Figure 2 illustrates the classification accuracy of the FSADL-SDCSND methodology for sarcastic and
non-sarcastic tweets using the Twitter-2013 dataset. Figures 2(a) and 2(b) portrayed 100% accuracy in
detecting non-sarcastic tweets and correctly predicted most sarcastic tweets under 80:20. Figures 2(c) and 2(d)
demonstrated high accuracy across both training and testing phases under 70:30, showing robust performance
in tweet classification. The values also referred to the effective recognition of the sarcastic and non-sarcastic
instances under overall classes.
(a) (b)
(c) (d)
Figure 2. Confusion matrices on Twitter-2013 dataset, (a) 80:20, (b) 80:20, (c) 70:30, and (d) 70:30 of TR/TS sets
The relational study of the FSADL-SDCSND technique with present approaches is provided in
Table 2. Based on 𝑎𝑐𝑐𝑢𝑦 , the FSADL-SDCSND technique reaches a higher 𝑎𝑐𝑐𝑢𝑦 of 99.61% while the Vanilla
CNN, FS, ELMoBiLSTM, ELMoBiLSTMFull, and A2TextNet models have shown lower 𝑎𝑐𝑐𝑢𝑦 values of
72.63%, 90.15%, 77.06%, 78.49%, and 93.39%. Based on 𝑝𝑟𝑒𝑐𝑛 , the FSADL-SDCSND method reaches
maximal 𝑝𝑟𝑒𝑐𝑛 of 99.62% while the Vanilla CNN, FS, ELMoBiLSTM, ELMoBiLSTMFull, and A2TextNet
methods exhibited lesser 𝑝𝑟𝑒𝑐𝑛 values of 71.48%, 88.74%, 76.34%, 78.02%, and 92.41%. Then, based on
𝑟𝑒𝑐𝑎𝑙 , the FSADL-SDCSND method gains higher 𝑟𝑒𝑐𝑎𝑙 of 99.61% while the Vanilla CNN, FS,
ELMoBiLSTM, ELMoBiLSTMFull, and A2Text-Net methods showed minimal 𝑟𝑒𝑐𝑎𝑙 values of 67.76%,
88.63%, 75.77%, 74.22%, and 91.47%. Next, based on 𝐹𝑠𝑐𝑜𝑟𝑒 , the FSADL-SDCSND method attains superior
𝐹𝑠𝑐𝑜𝑟𝑒 of 99.61% while the Vanilla CNN, FS, ELMoBiLSTM, ELMoBiLSTMFull, and A2TextNet models
depicted minimal 𝐹𝑠𝑐𝑜𝑟𝑒 values of 68.88%, 88.54%, 76.13%, 75.99%, and 90.53%. These outputs showed the
supremacy of the FSADL-SDCSND method.
5. CONCLUSION
In this manuscript, a novel FSADL-SDCSND methodology was presented for automated and precise
SD and social networking data classification. The major intent of the FSADL-SDCSND methodology is in the
automated and efficient recognition of sarcastic text. In the proposed FSADL-SDCSND approach, three phases
are employed namely data preprocessing, BS-PLSTM-based classification, and FSA-based tuning. Here, the
BS-PLSTM model has been exploited for detecting and classifying the sarcasm. The tuning process is achieved
by employing the FSA to improve the detection performance of the BS-PLSTM methodology. To exhibit the
greater solution of the FSADL-SDCSND system, a sequence of simulations can be applied. The extensive
results highlighted the greater solution of the FSADL-SDCSND methodology with other compared methods
in terms of different performance measures. The FSADL-SDCSND approach may struggle with nuanced,
context-dependent sarcasm, prompting future research avenues for enhancing accuracy by incorporating
contextual information and user-specific nuances in online communication.
REFERENCES
[1] Y. Y. Tan, C. O. Chow, J. Kanesan, J. H. Chuah, and Y. L. Lim, “Sentiment analysis and sarcasm detection using deep multi-task
learning,” Wireless Personal Communications, vol. 129, no. 3, pp. 2213–2237, 2023, doi: 10.1007/s11277-023-10235-4.
[2] P. Goel, R. Jain, A. Nayyar, S. Singhal, and M. Srivastava, “Sarcasm detection using deep learning and ensemble learning,”
Multimedia Tools and Applications, vol. 81, no. 30, pp. 43229–43252, 2022, doi: 10.1007/s11042-022-12930-z.
[3] A. Kumar, S. R. Sangwan, A. K. Singh, and G. Wadhwa, “Hybrid deep learning model for sarcasm detection in indian indigenous
language using word-emoji embeddings,” ACM Transactions on Asian and Low-Resource Language Information Processing, vol.
22, no. 5, 2023, doi: 10.1145/3519299.
[4] S. K. Bharti, R. K. Gupta, P. K. Shukla, W. A. Hatamleh, H. Tarazi, and S. J. Nuagah, “Multimodal sarcasm detection: a deep
learning approach,” Wireless Communications and Mobile Computing, vol. 2022, 2022, doi: 10.1155/2022/1653696.
[5] H. Ahmad, W. Akbar, N. Aslam, A. Ahmed, and M. Khurshid, “TF-IDF feature extraction-based sarcasm detection on social
media,” Journal of Computing \& Biomedical Informatics, vol. 5, no. 1, pp. 118–129, 2023.
[6] X. Zhao, J. Huang, and H. Yang, “CANs: coupled-attention networks for sarcasm detection on social media,” Proceedings of the
International Joint Conference on Neural Networks, vol. 2021, 2021, doi: 10.1109/IJCNN52387.2021.9533800.
[7] P. Dutta and C. K. Bhattacharyya, “Multi-modal sarcasm detection in social networks: a comparative review,” Proceedings - 6th
International Conference on Computing Methodologies and Communication, ICCMC 2022, pp. 207–214, 2022, doi:
10.1109/ICCMC53470.2022.9753981.
[8] D. K. Nayak and B. K. Bolla, “Efficient deep learning methods for sarcasm detection of news headlines,” Smart Innovation, Systems
and Technologies, vol. 269, pp. 371–382, 2022, doi: 10.1007/978-981-16-7996-4_26.
[9] R. Kanakam and R. K. Nayak, “Sarcasm detection on social networks using machine learning algorithms: a systematic review,”
Proceedings of the 5th International Conference on Trends in Electronics and Informatics, ICOEI 2021, pp. 1130–1137, 2021, doi:
10.1109/ICOEI51242.2021.9452954.
[10] D. K. Sharma, B. Singh, S. Agarwal, H. Kim, and R. Sharma, “Sarcasm detection over social media platforms using hybrid auto-
encoder-based model,” Electronics, vol. 11, no. 18, 2022, doi: 10.3390/electronics11182844.
[11] A. Sivalingam, K. Sundararajan, and A. Palanisamy, “CRF-MEM: conditional random field model based modified expectation
maximization algorithm for sarcasm detection in social media,” Journal of Internet Technology, vol. 24, no. 1, pp. 45–54, 2023,
doi: 10.53106/160792642023012401005.
[12] R. Pandey and J. P. Singh, “BERT-LSTM model for sarcasm detection in code-mixed social media post,” Journal of Intelligent
Information Systems, vol. 60, no. 1, pp. 235–254, 2023, doi: 10.1007/s10844-022-00755-z.
[13] A. Kumar, V. T. Narapareddy, V. A. Srikanth, A. Malapati, and L. B. M. Neti, “Sarcasm detection using multi-head attention based
bidirectional LSTM,” IEEE Access, vol. 8, pp. 6388–6397, 2020, doi: 10.1109/ACCESS.2019.2963630.
[14] A. Palaniammal and P. Anandababu, “Chaos sine cosine algorithm with graph convolution network for sarcasm detection in social
media,” 7th International Conference on Trends in Electronics and Informatics, ICOEI 2023, pp. 96–102, 2023, doi:
10.1109/ICOEI56765.2023.10126052.
[15] D. Vinoth and P. Prabhavathy, “An intelligent machine learning-based sarcasm detection and classification model on social
networks,” Journal of Supercomputing, vol. 78, no. 8, pp. 10575–10594, 2022, doi: 10.1007/s11227-022-04312-x.
[16] D. Vinoth and P. Prabhavathy, “Automated sarcasm detection and classification using hyperparameter tuned deep learning model
for social networks,” Expert Systems, vol. 39, no. 10, 2022, doi: 10.1111/exsy.13107.
[17] D. M. Ashok, A. N. Ghanshyam, S. S. Salim, D. B. Mazahir, and B. S. Thakare, “Sarcasm detection using genetic optimization on
LSTM with CNN,” 2020 International Conference for Emerging Technology (INCET), Belgaum, India, 2020, pp. 1-4, doi:
10.1109/INCET49848.2020.9154090.
[18] G. A. Sahu and M. Hudnurkar, “Metaheuristic-assisted deep ensemble technique for identifying sarcasm from social media data,”
International Journal of Wireless and Mobile Computing, vol. 26, no. 1, pp. 25–38, 2024, doi: 10.1504/ijwmc.2024.10062122.
[19] C. Magoo and M. Singh, “A novel hybrid approach for intent creation and detection using k-means-based topic clustering and
heuristic-based capsule network,” International Journal of Information Technology and Decision Making, vol. 22, no. 6, pp. 1923–
1960, 2023, doi: 10.1142/S0219622022500924.
Sarcasm detection on social data: heuristic search and deep learning (Arumugham Palaniammal)
4702 ISSN: 2252-8938
[20] Z. Liu, D. Zhang, W. Jia, X. Lin, and H. Liu, “An adversarial bidirectional serial–parallel LSTM-based QTD framework for product
quality prediction,” Journal of Intelligent Manufacturing, vol. 31, no. 6, pp. 1511–1529, 2020, doi: 10.1007/s10845-019-01530-8.
[21] Y. Fan, S. Zhang, H. Yang, D. Xu, and Y. Wang, “An improved future search algorithm based on the sine cosine algorithm for
function optimization problems,” IEEE Access, vol. 11, pp. 30171–30187, 2023, doi: 10.1109/ACCESS.2023.3258970.
[22] I. Leo, “Sarcasm in Twitter: detecting sarcasm in tweets,” Kaggle, 2019. [Online]. Available:
https://www.kaggle.com/competitions/gse002/data
[23] E. Riloff, A. Qadir, P. Surve, L. D. Silva, N. Gilbert, and R. Huang, “Sarcasm as contrast between a positive sentiment and negative
situation,” EMNLP 2013 - 2013 Conference on Empirical Methods in Natural Language Processing, Proceedings of the Conference,
pp. 704–714, 2013.
[24] R. Misra, “News headlines dataset for sarcasm detection,” Kaggle, 2019. [Online]. Available:
https://www.kaggle.com/datasets/rmisra/news-headlines-dataset-for-sarcasm-detection
[25] R. Misra and P. Arora, “Sarcasm detection using hybrid neural network,” Research Gate, pp. 1-5, 2019, doi:
10.13140/RG.2.2.32427.39204.
BIOGRAPHIES OF AUTHORS