Satire detection network and method based on multi-hop attention network of context representation

By using a context-based multi-hop attention network, combined with word embeddings and bidirectional GRU, the complexity of sarcasm detection in social media discussions is solved, and more efficient sarcasm intent recognition is achieved.

CN118656435BActive Publication Date: 2026-11-27INNER MONGOLIA UNIV FOR THE NATITIES
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311752789.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-19
Publication Date
2026-11-27
Estimated Expiration
2043-12-19

AI Technical Summary

Technical Problem

Existing methods for detecting irony struggle to effectively handle the complex contexts and ambiguities of irony in social media discussions, resulting in insufficient accuracy in irony detection.

Method used

A context-representation-based multi-hop attention network is adopted. By combining word embedding, bidirectional GRU and multi-hop attention mechanism with context representation and semantic modeling layer, a satire detection model is constructed. Gated recurrent units and attention mechanism are used to integrate information and perform satire classification.

Benefits of technology

It significantly improves the accuracy and effectiveness of satire detection, outperforming existing methods and enabling a better understanding of satirical intentions in social media discussions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656435B_ABST
    Figure CN118656435B_ABST
Patent Text Reader

Abstract

The sarcastic detection network and method based on the multi-hop attention network of context representation belong to the field of social text processing, in order to solve the problem of accurately identifying sarcasm in the dialogue context of social media discussion, the key points are to obtain the hidden semantic context vector H q , the hidden semantic context vector H p of the answer, input the multi-hop attention understanding layer, update recursively through the multi-hop attention understanding layer, obtain the question vector representation and the answer vector representation, input the question vector representation and the answer vector representation into the integrated information layer, obtain the integrated information I st2 through the weighted integration mechanism of the integrated information layer; the question vector representation, the answer vector representation and the integrated information I st2 are integrated, input the output layer classifier, output the sarcasm classification through the output layer, and are used for accurately identifying sarcasm in the dialogue context of social media discussion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of social text processing and relates to a satire detection method based on a multi-hop attention network with context representation. Background Technology

[0002] For years, psychologists, behavioral scientists, and linguists have extensively studied it. Irony detection aims to automatically detect whether text contains irony. Generally, identifying ironic text helps in better understanding social networks and has led to the development of a range of applications such as question answering, sentiment analysis, and reading comprehension (Ghosh and Veale, 2016). Therefore, understanding the broad context of dialogue in social media discussions is crucial for irony detection.

[0003] Irony, an uncommon expression of emotion, has garnered attention from both industry and academia. Riloff et al. (2013) proposed a rule-based classifier that searches for positive verbs and negative contextual phrases in sentences to detect irony. Bharti et al. (2015) proposed two rule-based classifiers. One is a parse-based dictionary generation method used to create parse trees and identify contextual phrases with emotional connotations. The other is used to capture co-occurring puns, irony, and intensifiers. To leverage semantic resources such as AFINN, SentiWordNet, and the General Inquirer, Farías et al. (2016) predicted effective semantic similarity and sentiment features. With the increasing prevalence of deep learning-based architectures in natural language programming (NLP) applications, several such methods have been reported for the automatic detection of ironic language. Joshi et al. (2016) computed similarity between word representations as features for irony detection. By incorporating semantic information from the target text and context, Ghosh and Veale (2017) utilized features from a two-layer CNN and Bi-LSTM combined with LIWC resources to detect irony. Tay et al. (2018) proposed an attention-based neural network for recognizing irony between literal and non-literal meanings.

[0004] Common sense knowledge, sentiment features, negation, and contextual information are helpful for the sarcasm detection task. Wang et al. (2021) used several representative pre-trained models and found that these models are easily affected by the corpus. Zhang et al. (2022) proposed a Chinese sarcasm language retrospective reading detection model that includes skimming and close reading. Chen et al. (2022) introduced sentiment and conflict inconsistency features to construct the target text. Liu et al. (2022) proposed a new method based on the contradiction of sarcasm. Zhou et al. (2023) proposed a dual-channel sarcasm detection model that considers behavioral and sentence conflicts in two channels. While the above existing studies can solve the problem of sarcasm detection, they overlook an important fact: the complexity of the contextual information in sarcasm texts is difficult for this task to handle. In addition, it is necessary to learn the ambiguity of sarcasm through useful methods.

[0005] Table 1: Sarcastic questions and answers in the forum (Internet Argumentation Corpus, IAC)

[0006]

[0007] To identify sarcastic intentions in social media discussions, it is necessary to recommend their statements within a larger dialogue context. This invention provides two examples from the IAC forum, as shown in Table 1. The goal of this task is to predict whether each reply is sarcastic, with the quotations representing the dialogue context of these statements. Without the contextual information of the quotes, it may be impossible to identify the sarcastic intentions of a response. Therefore, the complexity of the dialogue context and the ambiguity of its sarcasm can be considered important clues for detecting sarcasm. Summary of the Invention

[0008] To address the problem of accurately identifying sarcasm in the context of social media discussions and to better understand social networks, a sarcasm detection method based on a multi-hop attention network with context representation is provided in some embodiments of this application, including S10. Processing a text corpus by mapping each word to a question vector and an answer vector through word embedding;

[0009] S20. Input the question vector and answer vector into the word embedding layer and context embedding layer of the representation layer to obtain the word embedding representation E. w With context representation E c And connect them to obtain the combined semantic vector of the question and the combined semantic vector of the answer;

[0010] S30. Input the combined semantic vector of the question and the combined semantic vector of the answer into the semantic modeling layer. The semantic modeling layer bidirectionally converts the symbolic sentences into a unified semantic modeling representation, thus obtaining the hidden semantic context vector H of the question. qThe hidden semantic context vector H of the answer p ;

[0011] S40 will hide the semantic context vector H q The hidden semantic context vector H of the answer p The input is processed through a multi-hop attention understanding layer, which recursively updates the query vector representation. and the response vector representation

[0012] S50. Represent the question vector and the response vector representation The input is integrated into the information layer, which then uses a weighted integration mechanism to obtain integrated information I. st2 ;

[0013] S60. Represent the question vector Response vector representation and integrated information I st2 An ensemble, with input and output layers of classifiers, outputs a classification algorithm through the output layer.

[0014] According to the sarcasm detection method based on a multi-hop attention network with context representation in some embodiments of this application, in S10, given a question q = {q1,q2,…,q...} consisting of n words... n} and its m-word answer r = {r1, r2, ..., r m The task of sarcasm detection is to classify the response r and determine whether it expresses sarcasm towards the question q. When processing the text corpus, each word can be mapped to a low-dimensional, continuous, real-valued vector through word embeddings. The question vector and the response vector are stacked into a word embedding matrix. Where d represents the dimension of the word vector and V represents the size of the vocabulary;

[0015] In step S20, for each marker t k Generate a set of 2L+1 embeddings, with context representation E. c As shown in the following formula:

[0016]

[0017] In the formula, x k Let L represent any node, L represent the upper limit of hidden units in the LSTM layer, and j represent any number from 1 to L. This indicates a forward bidirectional LSTM layer. Indicates a backward bidirectional LSTM layer. This indicates a bidirectional LSTM layer.

[0018] According to the sarcasm detection method based on a multi-hop attention network using context representation in some embodiments of this application, in step S30, the word embedding representation E is used... w With context representation E c The input is used to construct a word sequence with a semantic modeling layer through a gated recurrent unit (GRU). Within the GRU framework, two useful gates control the semantic information at each learning step t, including a reset gate z. t and update gate r t The gated recurrent unit (GRU) generates a current input x. t And the previous hidden state h t-1 To introduce an instantaneous hidden state h t =GRU(x t ,h t-1 As shown in the following formula:

[0019] z t =σW z x t +U z h t-1 +b z

[0020] r t =σW r x t +U r h t-1 +b r

[0021]

[0022] h t =z t ·h t-1 +(1-z t )·h t

[0023] In the formula, σ represents the activation function, {W z W r W h U z U r U h} represents the training weights during the learning process, {b z ,b r ,b h} is the bias term used for randomly initializing vectors, "·" represents element-wise multiplication, F is the activation function, tanh function is the optimized representation, and z t Indicates that the door is being reset;

[0024] The text semantics are modeled in both left-to-right and right-to-left directions, as shown in the following formula:

[0025]

[0026] In the formula, GRU ltr This indicates the forward GRU layer, GRU rtl Indicates the backward GRU layer. This represents the gated recurrent units (GRUs) from left to right. This indicates a right-to-left gated loop unit (GRU), [;] indicates a connection operation, h t It is a combination of two gated recurrent unit (GRU) states, based on the current input x. t Information about the entire sequence centered on this.

[0027] According to the sarcasm detection method based on a multi-hop attention network with context representation in some embodiments of this application, in step S40, the hidden semantic context vector H of the response... p ={h p (1),…,h p (l)}, at each step k, the answer vector representation As shown in the following formula:

[0028]

[0029] In the formula, h p In (l), l represents the upper limit of the hidden unit, t represents any time, and k represents each step. This represents the unit transformed by the tanh function. Represents the normalized result and These are the network parameters that need to be updated during the learning process. This represents a single memory vector used to guide the next attention step, recursively updated as follows:

[0030]

[0031] The initial memory vector is obtained by targeting the context vector. calculate in

[0032]

[0033] The hidden semantic context vector H of the answer q ={h q (1),…,h q (l)}, at each step k, the question vector is represented as As shown in the following formula:

[0034]

[0035] In the formula, h q In (l), l represents the upper limit of the hidden unit, t represents any time, and k represents each step. This represents the unit transformed by the tanh function. Represents the normalized result and These are the network parameters that need to be updated during the learning process. This represents a single memory vector used to guide the next attention step, recursively updated as follows:

[0036]

[0037] The initial memory vector can be obtained by targeting the context vector. calculate in

[0038]

[0039] According to the sarcasm detection method based on a multi-hop attention network with context representation in some embodiments of this application, in step S50, a gated attention mechanism is used to integrate the weighted cores. The attention gate mechanism is expressed as follows:

[0040]

[0041] In the formula, σ represents the activation function, w represents the weight matrix, b represents the bias term that needs to be updated during the learning process, [;] represents the connection operation, and is the Sigmoid function that accepts vectors as input;

[0042] 1-g and g are applied as combined weights for the answer and question parts to assemble the question vector representation. and the response vector representation Attention gates are used to control the combination of information between the answer and the question. The dimension of the attention gate is represented by the question vector. and the response vector representation The dimensions are the same, and the weighted integrated information I st2 As shown in the following formula:

[0043]

[0044] In the formula, · represents element-wise multiplication, g is the combined weight of the answer part, and 1-g represents the weight of the question part.

[0045] According to the sarcasm detection method based on a context representation-based multi-hop attention network in some embodiments of this application, the output layer formula is as follows:

[0046]

[0047] In the formula, z out ∈R C Let C represent the predicted probability vector of satire, C represent the number of classes of satire labels, W and b represent the training parameters of the classifier layer, and softmax is the activation function.

[0048] Irony detection networks based on context representation-based multi-hop attention networks according to some embodiments of this application include

[0049] The representation layer takes the question vector and answer vector as inputs to the word embedding layer and the context embedding layer of the representation layer, and obtains the word embedding representation E. w With context representation E c The combined semantic vectors of the question and the answer are obtained by connecting them. The question vector and the answer vector are obtained by processing the text corpus and mapping each word through word embedding.

[0050] The semantic modeling layer, through bidirectional processing of the combined semantic vectors of the question and the combined semantic vectors of the answer, transforms the symbolic sentences into a unified semantic modeling representation, resulting in the hidden semantic context vector H of the question. q The hidden semantic context vector H of the answer p ;

[0051] Multi-hop attention understanding layer, which hides the semantic context vector H q The hidden semantic context vector H of the answer p Perform recursive updates to obtain the query vector representation. and the response vector representation

[0052] The integrated information layer represents the query vector. and the response vector representation Through a weighted integration mechanism, integrated information I is obtained. st2 ;

[0053] The output layer, whose classifier input query vector represents... Response vector representation and integrated information I st2 The integration outputs a satirical classification.

[0054] According to some embodiments of the present application, a satire detection network based on a context representation-based multi-hop attention network is used, wherein the question vector and answer vector in the representation layer are obtained as follows: given a question q = {q1, q2, ..., q...} consisting of n words... n} and its m-word answer r = {r1, r2, ..., r mThe task of sarcasm detection is to classify the response r and determine whether it expresses sarcasm towards the question q. When processing the text corpus, each word can be mapped to a low-dimensional, continuous, real-valued vector through word embeddings. The question vector and the response vector are stacked into a word embedding matrix. Where d represents the dimension of the word vector and V represents the size of the vocabulary;

[0055] In the context embedding layer of the representation layer, for each tag t k Generate a set of 2L+1 embeddings, with context representation E. c As shown in the following formula:

[0056]

[0057] x k Let L represent any node, L represent the upper limit of hidden units in the LSTM layer, and j represent any number from 1 to L. This indicates a forward bidirectional LSTM layer. Indicates a backward bidirectional LSTM layer. Indicates a bidirectional LSTM layer;

[0058] In the semantic modeling layer, E is represented by word embeddings. w With context representation E c The input is used to construct a word sequence with a semantic modeling layer through a gated recurrent unit (GRU). Within the GRU framework, two useful gates control the semantic information at each learning step t, including a reset gate z. t and update gate r t The gated recurrent unit (GRU) generates a current input x. t And the previous hidden state h t-1 To introduce an instantaneous hidden state h t =GRU(x t ,h t-1 As shown in the following formula:

[0059] z t =σW z x t +U z h t-1 +b z

[0060] r t =σW r x t +U r h t-1 +b r

[0061]

[0062] h t =z t ·h t-1 +(1-z t )·h t

[0063] In the formula, σ represents the activation function, {W z W r W h U z U r U h} represents the training weights during the learning process, {b z ,b r ,b h} is the bias term used for randomly initializing vectors, "·" represents element-wise multiplication, F is the activation function, tanh function is the optimized representation, and z t Indicates that the door is being reset;

[0064] The text semantics are modeled in both left-to-right and right-to-left directions, as shown in the following formula:

[0065]

[0066] In the formula, GRU ltr This indicates the forward GRU layer, GRU rtl Indicates the backward GRU layer. This represents the gated recurrent units (GRUs) from left to right. This indicates a right-to-left gated loop unit (GRU), [;] indicates a connection operation, h t It is a combination of two gated recurrent unit (GRU) states, based on the current input x. t Information about the entire sequence centered on this.

[0067] According to some embodiments of the present application, a satire detection network based on a context-representation multi-hop attention network is used, wherein in the multi-hop attention understanding layer, the hidden semantic context vector H of the response is... p ={h p (1),…,h p (l)}, at each step k, the answer vector representation As shown in the following formula:

[0068]

[0069] In the formula, h p In (l), l represents the upper limit of the hidden unit, t represents any time, and k represents each step. This represents the unit transformed by the tanh function. Represents the normalized result and These are the network parameters that need to be updated during the learning process. This represents a single memory vector used to guide the next attention step, recursively updated as follows:

[0070]

[0071] The initial memory vector is obtained by targeting the context vector. calculate in

[0072]

[0073] The hidden semantic context vector H of the answer q ={h q (1),…,h q (l)}, at each step k, the question vector is represented as As shown in the following formula:

[0074]

[0075] In the formula, h q In (l), l represents the upper limit of the hidden unit, t represents any time, and k represents each step. This represents the unit transformed by the tanh function. Represents the normalized result and These are the network parameters that need to be updated during the learning process. This represents a single memory vector used to guide the next attention step, recursively updated as follows:

[0076]

[0077] The initial memory vector can be obtained by targeting the context vector. calculate in

[0078]

[0079] In the integrated information layer, a gated attention mechanism is used to integrate the weighted cores. The attention gate mechanism is represented as follows:

[0080]

[0081] In the formula, σ represents the activation function, w represents the weight matrix, b represents the bias term that needs to be updated during the learning process, [;] represents the connection operation, and is the Sigmoid function that accepts vectors as input;

[0082] 1-g and g are applied as combined weights for the answer and question parts to assemble the question vector representation. and the response vector representation Attention gates are used to control the combination of information between the answer and the question. The dimension of the attention gate is represented by the question vector. and the response vector representation The dimensions are the same, and the weighted integrated information I st2 As shown in the following formula:

[0083]

[0084] In the formula, · represents element-wise multiplication, g is the combined weight of the answer part, and 1-g represents the weight of the question part.

[0085] The formula in the output layer is as follows:

[0086]

[0087] In the formula, z out ∈R C Let C represent the predicted probability vector of satire, C represent the number of classes of satire labels, W and b represent the training parameters of the classifier layer, and softmax is the activation function.

[0088] According to some embodiments of this application, a satire detection network based on a context representation-based multi-hop attention network is used to train the network model end-to-end through backpropagation, minimizing the cross-entropy error as the objective function for satire detection. It was used to correct the irony represented by a one-hot vector, and then The predicted probability presented to each sentence;

[0089] The goal of training the model is to minimize the ground truth distribution of the entire sample. and predicted distribution The loss function between them is as follows:

[0090]

[0091] Where i represents the index of a specific sentence, j represents the index of the category, λ represents the regularization factor, and θ contains all the training parameters;

[0092] The network model is trained using stochastic gradient descent (SGD) to minimize the objective function, and employs dropout and early stopping strategies to prevent overfitting of the network model parameters.

[0093] Beneficial Effects: Irony is a subtle form of language in which individuals state the opposite of what is implied. Due to this ambiguity and complexity, irony detection has always been a challenging task. The importance of irony detection has been recognized by both industry and academia. However, current automatic irony detection methods mainly rely on lexical and linguistic cues, which do not solve the problem well. This invention aims to address the challenge of irony detection by utilizing a novel context representation multi-hop attention (CRMA) network based on bidirectional GRU. CRMA not only understands the ambiguity of irony through a combination of context and word representations but also learns the semantic complexity between sentences through a multi-hop attention mechanism. Extensive experiments were conducted on the IAC dataset collected from popular websites to demonstrate the effectiveness of this invention. Experimental results show that the proposed model and method significantly outperform other state-of-the-art methods, and further examples validate the efficiency of our proposed network in detecting irony. Attached Figure Description

[0094] Figure 1 Architecture of a context-representation-based multi-hop attention network (CRMA) model. Detailed Implementation

[0095] 1 Overview

[0096] This invention proposes a novel, broad, and effective Contextual-Representation Multihop-Attention Network (CRMA) for the task of detecting irony. This method combines an ELMO model and a bidirectional GRU with contextual representations to better understand the ambiguity of irony. Then, a multihop attention model is constructed to learn complex semantic relationships through mutual influence. Finally, responses and questions are used as an ensemble mechanism for classifying irony detection. The proposed model is evaluated on a public forum dataset, and experimental results show that the CRMA model outperforms state-of-the-art methods.

[0097] In summary, the present invention has the following three main contributions.

[0098] (1) This invention proposes a Contextual-Representation Multihop-Attention network (CRMA), which combines contextual representation with a bidirectional GTU-based multihop attention mechanism to improve the detection performance of ironic language.

[0099] (2) This invention attempts to clarify the effectiveness and advancement of contextual representation in order to better understand ambiguity and to use multi-hop attention mechanism to solve the semantic complex relationship of satirical language.

[0100] (3) Quantitative experiments were conducted on real datasets from the forum, and the results showed that the CRMA model proposed in this invention is significantly better than the state-of-the-art ironic language detection methods.

[0101] The remainder of this invention is organized as follows. Section 2 introduces relevant research on ironic language detection. Section 3 introduces the context-presentation multi-hop attention CRMA network proposed in this invention for detecting ironic language. Section 4 evaluates the CRMA model and details the experimental aspects of this invention. Finally, Section 5 summarizes this research on irony detection and proposes directions for future work.

[0102] 2. Related work

[0103] Recently, linguists, psychologists, and behavioral scientists have conducted extensive research on irony. Generally, many scholars have attempted to understand the cognitive processes involved in the use of ironic language, and these processes have been extensively studied, such as the resonant reminder theory (Kreuz and Glucksberg, 1989), the suggestive pretense theory (Kumon-Nakamura et al., 1995), and the implicit display theory (Utsumi, 2000). Irony detection is a relatively unexplored research topic and a challenging problem (Pang and Lee, 2008). Research on irony detection can be categorized into rule-based methods, machine learning-based methods, and deep learning methods, which will be introduced below.

[0104] Generally, traditional rule-based methods require predicting a set of rules to identify sarcasm. Veale et al. (2010) used Google search tools to identify sarcastic smiles. Riloff et al. (2013) proposed a rule-based classifier capable of identifying sarcasm and distinguishing between positive verbs and negative phrases. By introducing tags into the Twitter domain, Maynard et al. (2014) designed an important indicator reflecting sarcasm. Bharti et al. (2015) used a phrase-level classifier model to build a parse tree and then predicted sarcasm based on rules.

[0105] It is well known that supervised machine learning methods have been studied to detect satirical language by utilizing features from many different categories. Using large-scale satirical corpora as a resource, Tsur et al. (2010) designed many effective features and then employed useful methods to prevent overfitting for a better understanding of satirical language. Farías et al. (2016) applied semantic resources such as AFINN, SentiWordNet, and General Inquirer to establish semantic similarity and sentiment features. Joshi et al. (2016) captured contextual inconsistencies by combining features from Word2Vec and other different word embeddings. Ravi et al. (2017) explored a novel framework that automatically identifies different types of satire by combining textual features.

[0106] Recently, in the field of natural language processing, deep learning models have been used to detect sarcasm. Silvio et al. (2016) employed a method combining useful convolutional neural networks and word embedding information to identify sarcasm. Ghosh and Veale (2016) used convolutional neural networks and long short-term memory as a deep neural sarcasm detection framework to improve the performance of sarcasm detection. To utilize the semantic information between the target text and the context, Ghosh and Veale (2017) explored a two-layer CNN and Bi-LSTM model to identify sarcasm by combining word embeddings and effective features provided by the LIWC tool. Tay et al. (2018) used a novel attentional neural architecture to detect sarcasm, which often appears between positive and negative emotions. Wang et al. (2021) used several representative pre-trained models and found that these pre-trained models are susceptible to the influence of corpora. Zhang et al. (2022) proposed a Chinese sarcasm detection model based on backreading from skimming and close reading. Chen et al. (2022) introduced some sentiment and conflict inconsistency features to construct the target text. Liu et al. (2022) proposed a novel method to capture the contradictions in irony. Zhou et al. (2023) established a dual-channel irony detection model to discover behavioral and sentence conflicts in ironic contexts. However, the above methods may ignore contextual information obtained from external corpora to understand the ambiguity of irony and ignore the complex semantic relationships between conversations to detect irony.

[0107] In recent years, computational models utilizing attention mechanisms for text tasks in natural language processing have seen a resurgence (Bahdanau et al., 2015). In this research direction, the attention mechanism can be primarily viewed as a composition function that selects the search location by assigning weights to different parts. Notably, this attention-based approach has achieved promising performance on various NLP tasks (Ma et al., 2017; Shen et al., 2018; Diao et al., 2018; Diao et al., 2019).

[0108] 3 Algorithms

[0109] This section introduces the CRMA model for ironic language detection. First, the problem definition and notation are described. Then, the CRMA framework is outlined. Finally, the details of the different components and the training process are explained in detail.

[0110] 3.1 Problem Definition and Symbols

[0111] Given a question consisting of n words q = {q1, q2, ..., q...} n} and its m-word answer r = {r1, r2, ..., r m The task of sarcasm detection is to classify responses r to determine whether they express sarcasm towards the question q. When processing text corpora, each word can be mapped to a low-dimensional, continuous, real-valued vector through word embeddings (Mikolov et al., 2013; Pennington et al., 2014). The entire semantic word vector is stacked into a word embedding matrix. Where d represents the dimension of the word vector and V represents the size of the vocabulary.

[0112] 3.2 Overview of the MQA Model

[0113] This section provides an overview of the proposed CRMA model for irony detection, such as... Figure 1 As shown, the CRMA model mainly involves the following five steps.

[0114] Representation Layer: This layer consists of context representations and word representations. The former is used to learn and expand context embeddings to better understand ambiguity. The latter is used to represent the semantic latent vector for each word.

[0115] Semantic Modeling Layer: This layer mainly consists of two bidirectional GRUs. By using bidirectional GRUs, symbolic sentences are converted into a unified semantic modeling representation in both left-to-right and right-to-left directions.

[0116] Multi-hop attention understanding layer: A novel multi-hop attention mechanism is proposed to handle the complex semantic relationship between the answer and the question, which has the ability to improve the performance of detecting sarcasm.

[0117] Information Integration Layer: We utilize a gating attention mechanism to integrate information used for detecting sarcasm, combining semantic information from the response with semantic information from the question.

[0118] Output layer: performs bidirectional classification of irony.

[0119] 3.3 Components

[0120] This section will describe the components in CRMA one by one.

[0121] 3.3.1 Characterization Layer

[0122] Pre-trained word representations are a crucial component in natural language processing tasks. This invention considers representation layers at both the word level and context level, as described below.

[0123] Word embedding layer: Based on existing research, word embedding can discover the latent semantic regularity vector space between words and use it as a basic feature to describe the core of ironic language. Word embeddings can be pre-trained using the GloVe method (Pennington et al., 2014), which mainly encodes each word into a continuous semantic latent vector space. Words that frequently appear in similar semantic contexts are closely mapped in the latent vector space, thereby generating word semantic information. The details of this standard GloVe process will be left to the reader (Pennington et al., 2014). This invention selects d w As a dimension of GloVe.

[0124] Contextual Embedding Layer: Ambiguity is a key challenge in sarcasm detection. A useful deep learning model needs to understand high-quality representations to generate semantic and syntactic information within a linguistic context to address the sarcasm detection problem. Many methods exist for representing contextual embeddings; this invention chooses ELMo, which is a function of the entire input sentence. By pre-training on a large-scale dataset, ELMo can be constructed by combining a two-layer bidirectional LSTM with feature convolutions.

[0125] First, for the feedforward language model, this can be achieved by using the tag t. k For a given historical sequence (t1, t2, ..., t... k-1 Project the probability of ) and calculate the sequence (t1, t2, ..., t) N The probability of ).

[0126]

[0127] Recently, neural language models have developed the ability to propose independent contextual representations, which are then passed forward to an L-layer LSTM. For each position k (j = 1, ..., L), a context-dependent embedding can be output. This is used for each LSTM layer. Finally, the top-level output of the LSTM is utilized through the Softmax layer. To predict the next label t k+1 Similar to forward language models (LM), backward language models can predict the previous tag by reversing the sequence, given the subsequent context.

[0128]

[0129] This can be achieved in a similar manner to forward language models, using each inverse LSTM in an L-layer deep model to represent each tag t. k In a given context (t) k+1 ,t k+2 ,…,t N The representation in ) Therefore, a bidirectional language model consists of a forward language model and a backward language model, and is often used to maximize the log-likelihood of the bidirectional language model.

[0130] As we know, ELMo represents the integration of intermediate layer representations in a bidirectional language model. For each tag t k This can generate a set of 2L+1 embeddings, as shown below:

[0131]

[0132] in This indicates a forward bidirectional LSTM layer. This indicates a backward bidirectional LSTM layer.

[0133] Therefore, the context representation E can be obtained. c To handle complex semantic lexical usage features in large contexts in order to detect irony. The dimension of the context embedding is d. c Finally, the word embedding represents E. w and context representation E c These vectors are connected and passed to generate the final combined semantic vector, namely the combined semantic vector of the question and the combined semantic vector of the answer, to capture the ambiguity of the question vector and the answer vector, which is the input to the next semantic modeling layer.

[0134] 3.3.2 Semantic Modeling Layer

[0135] Recurrent Neural Networks (RNNs) have been widely used in natural language processing tasks, significantly improving their performance in sequence modeling. This is achieved through contextual representation of E...c The word E represents w For the input, this invention utilizes a particularly efficient sequence RNN model called a gated recurrent unit (GRU) to construct word sequences with a semantic modeling layer.

[0136] Within the GRU framework, there are two useful gates to control semantic information during the learning process at each step t, such as the reset gate z. t and update gate r t This GRU produces a current input x. t And the previous hidden state h t-1 To introduce an instantaneous hidden state h t =GRU(x t ,h t-1 ), as shown below.

[0137]

[0138] Where {W z W r W h U z U r U h} represents the training weights during the learning process, {b z ,b r ,b h} is the bias term used to randomly initialize the vector, and "·" represents element-wise multiplication. F is the activation function, and we can choose the tanh function to optimize the representation.

[0139] To increase the amount of input information available to the network, a more common approach is to utilize a bidirectional GRU to model text semantics in both left-to-right and right-to-left directions. The formula is as follows.

[0140]

[0141] in Indicates GRU from left to right, This indicates a right-to-left GRU, [;] indicates a join operation, h t It is a combination of two GRU states, summarizing the state with x t Information about the entire sequence centered on this.

[0142] This invention applies Bi-GRU to encode a sentence to obtain semantic understanding. Then, the semantic modeling information is the input to the multi-hop attention understanding layer.

[0143] 3.3.3 Multi-hop attention understanding layer

[0144] In many cases, the semantic relationships between answers or questions can be very complex. This is because different parts of the information may relate to different aspects of the answer or question. Therefore, using a single vector for each representation may fail to reveal their complex semantic relationships, potentially leading to suboptimal results.

[0145] Inspired by Nam and Claudia (2018), this invention employs a multi-hop attention mechanism to address this problem. Unlike existing methods, instead of compressing the response into a single representation, multiple vectors are used to represent the semantic modeling of the response. This mechanism designs an iterative matching process to reveal semantic relationships.

[0146] Let H p ={h p (1),…,h p (l)} represents the hidden semantic context vector of each answer vector after passing through the Bi-GRU layer. To obtain the answer vector representation, conventional mechanisms are typically used: last-step, averaging, or max pooling. Consistent with current research, we employ a self-attention mechanism instead of the max pooling or averaging steps, combined with some modifications to create different answer vector representations. Specifically, at each step k, the answer vector representation... The calculation is as follows.

[0147]

[0148] in and These are the network parameters that need to be updated during the learning process. This represents a single memory vector used to guide the next attention step, recursively updated as follows:

[0149]

[0150] The initial memory vector can be obtained by targeting the context vector. calculate in

[0151]

[0152] In each step, the answer vector representation can be used with a vector. This indicates that it primarily captures specific parts of the answer. This is in contrast to the previous answer vector representation. Similarly, the question vector representation of a multi-hop attention model can be extracted.

[0153] Let H q ={h q (1),…,h q(l)} represents the hidden semantic context vector of each question vector after passing through the Bi-GRU layer. To obtain the question vector representation, traditional mechanisms are typically used: last-step, average, or max pooling. Consistent with current research, we employ a self-attention mechanism to replace the max pooling or averaging steps, and combine some modifications to create different question vector representations. Specifically, at each step k, the question vector representation... The calculation is as follows.

[0154]

[0155] in and These are the network parameters that need to be updated during the learning process. This represents a single memory vector used to guide the next attention step, recursively updated as follows:

[0156]

[0157] The initial memory vector can be obtained by targeting the context vector. calculate in

[0158]

[0159] In each step, the question vector representation can be used with a vector. This indicates that it primarily captures specific parts of the answer. 3.3.4 Integrated Information Layer

[0160] This layer integrates the aforementioned parts of the CRMA framework proposed in this invention, utilizing answer semantic information and question semantic information to explore the consistency relationship with different features capturing irony. Based on answer semantic information and question semantic information, a gated attention mechanism is used to project the confidence of supplementary cues, introducing word-level and context-level features to explore integrated information. This invention employs the following two strategies:

[0161] ST1: Average Integration Mechanism. This assumes that the information from the respondent and the questioner is equally important. Therefore, the average information can be calculated as follows:

[0162]

[0163] Where α is 0.5, the dimension of the attention gate is related to the response vector representation. and the question vector same.

[0164] ST2: Weighted Integration Mechanism. Assume the importance of the response information and the question information is different. Therefore, a gated attention mechanism can be used to integrate the weighted kernels of the two parts. The attention gating mechanism is represented as:

[0165]

[0166] Where w represents the weight matrix, b represents the bias term that needs to be updated during the learning process, [;] represents the connection operation, and is the sigmoid function that accepts vectors as input.

[0167] Then, 1-g and g are applied as combined weights for the answer and question parts to assemble... and Here, the attention gate can be viewed as a sentinel, used to control the combination of information between the response and the question. Note that the dimensions of the attention gate are... and Similarly, the weighted integrated information is calculated through a weighted sum as follows:

[0168]

[0169] Where · represents element-wise multiplication, g is the combined weight of the answer portion, 1-g represents the weight of the question portion, and I st2 This represents the final integrated information for all the above components.

[0170] 3.3.5 Output Layer

[0171] Following previous research, we treat irony detection as a classification problem. In the output layer, and I st2 The input is integrated into the softmax classifier. Its formula is as follows.

[0172]

[0173] Where z out ∈R C Let C represent the predicted probability vector of satire, C represent the number of classes of satire labels, W and b represent the training parameters of the classifier layer, and softmax is chosen as the activation function.

[0174] 3.4 Irony Detection

[0175] This section describes the learning and optimization details of the framework of this invention. The CRMA model proposed in this invention should be trained end-to-end through backpropagation, minimizing the cross-entropy error as the objective function for irony detection. Furthermore, It was used to correct the irony represented by a one-hot vector, and then The predicted probability presented to each sentence. The goal of training the model is to minimize the ground truth distribution of the entire sample. and predicted distribution The loss function between them is as follows:

[0176]

[0177] Where i represents the index of a specific sentence, j represents the index of the category, λ represents the regularization factor, and θ contains all the training parameters.

[0178] Regarding the optimization method, the CRMA model proposed in this invention should be trained using stochastic gradient descent (SGD) to minimize the objective function. Furthermore, dropout and early stopping strategies are employed to prevent parameter overfitting. More details will be presented in the experiments below.

[0179] 4. Experiment and Evaluation

[0180] This section first describes the dataset and evaluation metrics. Then, it compares the performance of the proposed CRMA model with other current methods. Finally, it provides a detailed analysis of the proposed model.

[0181] 4.1 Experimental Setup

[0182] Dataset. Internet Argument Corpus V1 (IAC) v1 Typically, this dataset (Internet Argumentation Corpus, IAC) is a publicly available corpus of online forum dialogues. It includes annotations for different types of social language categories, such as consistency / inconsistency, rudeness, and irony. Different versions of IAC are also popular; this invention selects a specific subset, IACv1. The written language of IAC is English. Each instance, typically a sentence, is tagged with either "ironic" or "non-ironic."

[0183] Evaluation metrics. This invention uses the following commonly used standards for evaluation: precision, recall, accuracy, and F1 score. These are also the metrics used in existing research to compare irony detection against other strong baselines.

[0184] Training Details. In the experiments of this invention, the GloVe model (Penningtone et al., 2014) was chosen as the word embedding model, with a dimension of 300. Simultaneously, ELMo (Peterset et al., 2018) was used to initialize the context representation, with a dimension of 512. All word vectors were fine-tuned during training. Furthermore, words not included in the vocabulary were initialized by sampling from a uniform distribution U(-0.25, 0.25).

[0185] To regularize the model proposed in this invention, L2 regularization is used with a parameter set to 10. -6The weights of the training parameters are determined by the algorithm. A loss rate of 0.5 is used to avoid overfitting. The hidden units of the bidirectional LSTM layer are set to 300 (150 in each direction). This invention employs 5-fold cross-validation to achieve optimal performance on the training dataset. Therefore, an early stopping strategy is implemented over 100 epochs, with a mini-batch size of 64. The initial values ​​of the entire weight matrix are sampled from the same distribution, with a bias set to zero. The model parameters are optimized based on the Adam optimization algorithm (Kingma and Ba, 2014). The initial learning rate is set to 0.001. The entire architecture is implemented using Keras.

[0186] 4.2 Experimental Results

[0187] To comprehensively evaluate the performance of the CRMA model proposed in this invention, this section describes some state-of-the-art baseline methods for comparison.

[0188] ●UCDCC: This is a Siamese LSTM model that uses GloVe word embedding features. The method employs numerous rules to preprocess Twitter data (Ghosh and Veale, 2018).

[0189] • THU-NGN: It consists of a densely connected LSTM based on word embeddings, sentiment features and syntactic features (Wu et al., 2018).

[0190] • Bi-LSTM: This is a variant of RNN that can learn long-term dependencies and bidirectional information (Hochreiter and Schmidhuber, 1997).

[0191] • AT-LSTM: This is an LSTM model followed by a neural attention mechanism. It is able to focus on important parts of the input (Wang et al., 2016).

[0192] ●CNN-LSTM-DNN: This is a combination of CNN, LSTM and DNN. It stacks two convolutional layers and two LSTM layers, and then feeds the output to the DNN for prediction (Ghosh and Veale, 2016).

[0193] • MIARN: This is a variant of SIARN that extends the single-dimensional internal attention computation of SIARN to multiple dimensions (Tay et al., 2018).

[0194] • ADGCN: This is a GCN-based method with a sentiment graph and a dependency graph. The initial input of GCN is the hidden state of a Bi-LSTM (Lou et al., 2021).

[0195] DC-Net: This is a dual-channel sarcasm detection model that reconstructs text into literal and implicit semantics separately and models them independently (Liu et al., 2022).

[0196] • CRMA: The proposed model in this invention, Contextual-RepresentationMultihop-Attentionnetwork (CRMA), combines contextual representation with a multi-hop attention mechanism based on bidirectional GTU.

[0197] Since the benchmark dataset contains a fairly balanced mix of positive and negative text, we follow the above research and use precision, recall, and F1 score as evaluation metrics. Table 2 shows a performance comparison of the different state-of-the-art methods mentioned above, which reveals that:

[0198] Table 2: Comparison with previous methods.

[0199]

[0200] Results with superscript * are reported in (Liu et al., 2022). Best results for each type are highlighted.

[0201] (1) For neural network methods, the UCDCC model performs poorly in detecting sarcasm by combining detection and response information. Meanwhile, AT-LSTM outperforms Bi-LSTM on all evaluation factors. This validates the ability of attention mechanisms to capture valuable cues for sarcasm recognition. Based on a dual-channel framework, DC-Net outperforms other methods by modeling literal and implicit sentiment separately.

[0202] (2) Finally, the results were compared in detail, further demonstrating the advantages of the CRMA model proposed in this invention. As shown in the figure, it can be seen that it achieves the best performance among all methods for handling sarcasm detection. Obviously, CRMA obtains the best F1 score, outperforming the state-of-the-art method DC-Net by 1.5%. This is because our proposed CRMA model has the ability to understand latent semantic ambiguity information through contextual representation. These results show that the multi-hop attention mechanism combined with Bi-LSTM is an important architecture for solving the complex semantic relationships in sarcasm recognition. Therefore, the CRMA model proposed in this invention effectively improves the performance of sarcasm detection.

[0203] 4.3 Qualitative Analysis

[0204] To further evaluate the contribution of CRMA, we conducted follow-up experiments to study its effectiveness from four perspectives: the effect of different representations, the effect of different CRMA components, attention visualization in the CRMA model, generalization performance, and error analysis.

[0205] Effects of Different Representations. This invention provides a series of models to verify the effectiveness of the contextual representation ELMo. Here, the same neural network and parameters are used for the following experiments. First, only randomly initialized embeddings based on a Bi-CRMA classifier are used. Then, a second model is implemented, using GloVe to represent the semantic space. Next, ELMo is used to import contextualized embeddings. Finally, an ELMo+GloVe model is designed to represent dimensional semantic vectors. The F1 scores of these models are shown in Table 3.

[0206] Table 3: Effects of different representations

[0207]

[0208] Table 3 clearly shows that all pre-trained word embedding methods outperform random initialization. This result indicates that pre-trained embedding matrices are necessary for sarcasm detection due to the size of the dataset. For ELMo as a contextualized representation, it outperforms random initialization but is worse than GloVe. Compared to the random approach, this contextualized embedding only generates complex word usage features within the context. As expected, the combination of ELMo and GloVe achieves the best performance among all methods. This is because this structure fully considers the influence of contextualization and word representation, contributing to the understanding of ambiguity in sarcasm detection.

[0209] The impact of different CRMA components. To understand how different components affect the overall performance of irony detection, an intuitive approach is to remove the components and compare simplified versions of CRMA:

[0210] CRMA-QBM removes citation information, employs Bi-GRU and multihop-attention mechanisms. It uses only a basic response vector-based network, combined with word embeddings and context embeddings.

[0211] CRMA-BM ignores Bi-GRU encoded information and multihop attention. It only uses deep neural networks based on citation and response information.

[0212] CRMA-M ignores the multihop-attention mechanism. As input to citation and response information, the model applies a Bi-GRU model to detect sarcasm based on word embeddings and contextual embeddings.

[0213] CRMA-B ignores the Bi-GRU encoding model. As input to citation and response information, the model applies a multihop-attention mechanism to detect sarcasm based on word embeddings and contextual embeddings.

[0214] CRMA-ST2+ST1 integrates information using the ST1 strategy instead of ST2. As input to citation and response information, the model applies a Bi-GRU model and multihop-attention to detect irony based on word embeddings and context embeddings.

[0215] Table 4: Effects of different CRMA components

[0216]

[0217] The test precision, recall, and F1 scores of these models are shown in Table 4. Compared to the CRMA-QBM model, which only explores the response vectors of the basic model, this model, CRMA-BM, achieves some improvement. This indicates that incorporating dialogue context into discussion forums is crucial for detecting sarcasm.

[0218] For CRMA-BM, word representations and contextual representations are found to be necessary for better exploring ironic ambiguity, representing an improvement over CRMA-B. Simultaneously, for CRMA-BM, Bi-GRU can learn semantic contextual information from long texts such as citations and responses to better integrate the CRMA framework, representing an improvement over CRMA-M. Among the complete strategies, the weighted strategy using ST2 performs best on the F1 score. This indicates that employing a weighted strategy to integrate compelling information is highly advantageous for irony detection.

[0219] Based on the above results, it can be seen that the CRMA model proposed in this invention outperforms other state-of-the-art methods, demonstrating that the combination of citation information, contextual representation, Bi-GRU, and multi-hop attention mechanisms can contribute to the irony detection task. The results verify that the CRMA model proposed in this invention is capable of extracting effective and useful features for irony detection.

[0220] Generalization ability. To measure the generalization ability of the proposed model, the CRMA model was applied to a representative social media dataset—tweets. Because tweets are short and informal, this can pose a significant challenge to sarcasm detection.

[0221] The Semeval2018Task3 dataset is a shared task for detecting verbal sarcasm in tweets (VanHee et al., 2018). The corpus includes a balanced training set of 3833 tweets and a test set of 784 tweets. Only 40% of the samples in the test set are sarcasm. This dataset has been annotated by three linguistics students, showing high inter-annotator consistency.

[0222] Experimental results were shown on the same settings as SemEval2018 Task 3A. The goal of this shared task is to distinguish whether a tweet is sarcastic or not. THUNGN, NTUA-SLP, and WLV are the top three methods for this task (VanHee et al., 2018). The CRMA model proposed in this invention was tested on this dataset. Simultaneously, the same word embeddings as the THUNGN method were applied. The results are summarized in Table 5.

[0223] Table 5: Effects of different CRMA components

[0224]

[0225] The results show that the CRMA method proposed in this invention is also very suitable for handling sarcasm detection on tweet platforms. This verifies the effectiveness of response and question information, different levels of representation, Bi-GRU encoding, and multi-hop attention mechanisms. In the future, we will explore the role of query semantic understanding in tweets through more comprehensive research.

[0226] 5. Conclusions and Future Work

[0227] This invention proposes a Contextual Representation Multi-Bouncing Attention (CRMA) framework to address sarcasm. The main idea of ​​the CRMA model is to leverage question and response information from discussion forums, combining word representations and contextualized representations through Bi-GRU and multi-bouncing attention mechanisms. Experimental results on two open datasets show that the proposed method outperforms many competing baselines, validating the effectiveness and state-of-the-art performance of the CRMA model in detecting sarcasm. In the next phase, we will utilize useful features such as hash labels and emojis to improve overall performance using deep learning methods. Simultaneously, we will also consider leveraging external background knowledge to detect sarcasm.

Claims

1. A method for detecting irony based on a multi-hop attention network with contextual representation, characterized in that, include S10. Process the text corpus by mapping each word into a question vector and an answer vector through word embedding; S20. Input the question vector and answer vector into the word embedding layer and context embedding layer of the representation layer to obtain the word embedding representation E. w With context representation E c And connect them to obtain the combined semantic vector of the question and the combined semantic vector of the answer; S30. Input the combined semantic vector of the question and the combined semantic vector of the answer into the semantic modeling layer. The semantic modeling layer bidirectionally converts the symbolic sentences into a unified semantic modeling representation, thus obtaining the hidden semantic context vector H of the question. q The hidden semantic context vector H of the answer p ; S40 will hide the semantic context vector H q The hidden semantic context vector H of the answer p The input is processed through a multi-hop attention understanding layer, which then recursively updates the query vector representation. and the response vector representation ; S50. Represent the question vector and the response vector representation The input is integrated into the information layer, which then uses a weighted integration mechanism to obtain integrated information I. st2 ; S60. Represent the question vector Response vector representation and integrated information I st2 An ensemble, with input and output layers of classifiers, outputs a classification result through the output layer; In step S30, E is represented by word embedding. w With context representation E c The input is used to construct a word sequence with a semantic modeling layer through a gated recurrent unit (GRU). Within the GRU framework, two useful gates are used to control semantic information at each learning step t, including a reset gate z. t and update gate r t The gated recurrent unit (GRU) generates a current input x. t And the previous hidden state h t-1 To introduce an instantaneous hidden state h t =GRU(x t ,h t-1 As shown in the following formula: In the formula, Represents the activation function, {W z W r W h U z U r U h } represents the training weights during the learning process, {b z ,b r ,b h } is the bias term used for randomly initializing vectors. This represents an element-wise multiplication operation, where F is the activation function and tanh is the optimization representation. Indicates that the door is being reset; The text semantics are modeled in both left-to-right and right-to-left directions, as shown in the following formula: In the formula, Indicates the forward GRU layer. Indicates the backward GRU layer. This represents the gated loop unit (GRU) from left to right. This indicates a gated loop unit (GRU) from right to left, and [;] indicates a connection operation. It is a combination of two gated recurrent unit (GRU) states, based on the current input x. t Information about the entire sequence centered on this.

2. The irony detection method based on a multi-hop attention network with context representation according to claim 1, characterized in that, in, In S10, a question consisting of n words is given. q ={q1,q2,...,q n } and its answer consisting of m words r ={r1,r2,...,r m The task of irony detection is to assess the response... r Classify them and determine whether they are relevant to the question. q To express irony, when processing text corpora, each word can be mapped to a low-dimensional, continuous, real-valued vector through word embeddings. The question vector and the answer vector are stacked into a word embedding matrix. Where d represents the dimension of the word vector, Indicates the size of the vocabulary; In step S20, for each marker t k Generate a set of 2L+1 embeddings, with context representation E. c As shown in the following formula: In the formula, Let L represent any node, and let L represent the upper limit of hidden units in the LSTM layer. This indicates a forward bidirectional LSTM layer. Indicates a backward bidirectional LSTM layer. This indicates a bidirectional LSTM layer.

3. The irony detection method based on a multi-hop attention network with context representation according to claim 1, characterized in that, in, In step S40, the hidden semantic context vector H of the answer p ={h p (1),...,h p (l)}, at each step k, the answer vector representation As shown in the following formula: In the formula, h p In (l), l represents the upper limit of the hidden unit. Let k represent any given moment, and k represent each step. This represents the unit transformed by the tanh function. Represents the normalized result , , and These are the network parameters that need to be updated during the learning process. This represents a single memory vector used to guide the next attention step, recursively updated as follows: The initial memory vector is obtained by targeting the context vector. calculate ,in The hidden semantic context vector H of the answer q ={h q (1),...,h q (l)}, at each step k, the question vector is represented as As shown in the following formula: In the formula, h q In (l), l represents the upper limit of the hidden unit. Let k represent any given moment, and k represent each step. This represents the unit transformed by the tanh function. Represents the normalized result , , and These are the network parameters that need to be updated during the learning process. This represents a single memory vector used to guide the next attention step, recursively updated as follows: The initial memory vector can be obtained by targeting the context vector. calculate ,in 。 4. The irony detection method based on a multi-hop attention network with context representation according to claim 3, characterized in that, in, In step S50, a gated attention mechanism is used to integrate the weighted cores. The attention gate mechanism is represented as follows: In the formula, denoted as activation function, w represents weight matrix, b represents bias term to be updated during learning, [;] represents connection operation, and is the sigmoid function that accepts vector as input; 1-g and g are applied as combined weights for the answer and question parts to assemble the question vector representation. and the response vector representation Attention gates are used to control the combination of information between the answer and the question. The dimension of the attention gate is represented by the question vector. and the response vector representation The dimensions are the same, and the weighted integrated information I st2 As shown in the following formula: In the formula, This represents an element-wise multiplication operation, where g is the combined weight of the answer portion and 1-g represents the weight of the question portion.

5. The irony detection method based on a multi-hop attention network with context representation according to claim 4, characterized in that, in, The output layer formula is as follows: In the formula, Let C represent the predicted probability vector of satire, C represent the number of classes of satire labels, W and b represent the training parameters of the classifier layer, and softmax is the activation function.

6. A satire detection network based on a context-representation multi-hop attention network performing the method of any one of claims 1-5, characterized in that, include The representation layer takes the question vector and answer vector as inputs to the word embedding layer and the context embedding layer of the representation layer, and obtains the word embedding representation E. w With context representation E c The combined semantic vectors of the question and the answer are obtained by connecting them. The question vector and the answer vector are obtained by processing the text corpus and mapping each word through word embedding. The semantic modeling layer, through bidirectional processing of the combined semantic vectors of the question and the combined semantic vectors of the answer, transforms the symbolic sentences into a unified semantic modeling representation, resulting in the hidden semantic context vector H of the question. q The hidden semantic context vector H of the answer p ; Multi-hop attention understanding layer, which hides the semantic context vector H q The hidden semantic context vector H of the answer p Perform recursive updates to obtain the query vector representation. and the response vector representation ; The integrated information layer represents the query vector. and the response vector representation Through a weighted integration mechanism, integrated information I is obtained. st2 ; The output layer, whose classifier input query vector represents... Response vector representation and integrated information I st2 The integration outputs a satirical classification.

7. The irony detection network based on a multi-hop attention network with context representation according to claim 6, characterized in that, in, The question vector and answer vector in the representation layer are obtained based on the following method: given a question consisting of n words q ={q1,q2,...,q n } and its answer consisting of m words r ={r1,r2,...,r m The task of irony detection is to assess the response... r Classify them and determine whether they are relevant to the question. q To express irony, when processing text corpora, each word can be mapped to a low-dimensional, continuous, real-valued vector through word embeddings. The question vector and the answer vector are stacked into a word embedding matrix. Where d represents the dimension of the word vector, Indicates the size of the vocabulary; In the context embedding layer of the representation layer, for each tag t k Generate a set of 2L+1 embeddings, with context representation E. c As shown in the following formula: Let L represent any node, and let L represent the upper limit of hidden units in the LSTM layer. This indicates a forward bidirectional LSTM layer. Indicates a backward bidirectional LSTM layer. Indicates a bidirectional LSTM layer; In the semantic modeling layer, E is represented by word embeddings. w With context representation E c The input is used to construct a word sequence with a semantic modeling layer through a gated recurrent unit (GRU). Within the GRU framework, two useful gates are used to control semantic information at each learning step t, including a reset gate z. t and update gate r t The gated recurrent unit (GRU) generates a current input x. t And the previous hidden state h t-1 To introduce an instantaneous hidden state h t =GRU(x t ,h t-1 As shown in the following formula: In the formula, Represents the activation function, {W z W r W h U z U r U h } represents the training weights during the learning process, {b z ,b r ,b h } is the bias term used for randomly initializing vectors. This represents an element-wise multiplication operation, where F is the activation function and tanh is the optimization representation. Indicates that the door is being reset; The text semantics are modeled in both left-to-right and right-to-left directions, as shown in the following formula: In the formula, Indicates the forward GRU layer. Indicates the backward GRU layer. This represents the gated loop unit (GRU) from left to right. This indicates a gated loop unit (GRU) from right to left, and [;] indicates a connection operation. It is a combination of two gated recurrent unit (GRU) states, based on the current input x. t Information about the entire sequence centered on this.

8. The irony detection network based on a contextual representation multi-hop attention network according to claim 6 or 7, characterized in that, in, In a multi-hop attention understanding layer, the hidden semantic context vector H of the answer p ={h p (1),...,h p (l)}, at each step k, the answer vector representation As shown in the following formula: In the formula, h p In (l), l represents the upper limit of the hidden unit. Let k represent any given moment, and k represent each step. This represents the unit transformed by the tanh function. Represents the normalized result , , and These are the network parameters that need to be updated during the learning process. This represents a single memory vector used to guide the next attention step, recursively updated as follows: The initial memory vector is obtained by targeting the context vector. calculate ,in The hidden semantic context vector H of the answer q ={h q (1),...,h q (l)}, at each step k, the question vector is represented as As shown in the following formula: In the formula, h q In (l), l represents the upper limit of the hidden unit. Let k represent any given moment, and k represent each step. This represents the unit transformed by the tanh function. Represents the normalized result , , and These are the network parameters that need to be updated during the learning process. This represents a single memory vector used to guide the next attention step, recursively updated as follows: The initial memory vector can be obtained by targeting the context vector. calculate ,in ; In the integrated information layer, a gated attention mechanism is used to integrate the weighted cores. The attention gate mechanism is represented as follows: In the formula, denoted as activation function, w represents weight matrix, b represents bias term to be updated during learning, [;] represents connection operation, and is the sigmoid function that accepts vector as input; 1-g and g are applied as combined weights for the answer and question parts to assemble the question vector representation. and the response vector representation Attention gates are used to control the combination of information between the answer and the question. The dimension of the attention gate is represented by the question vector. and the response vector representation The dimensions are the same, and the weighted integrated information I st2 As shown in the following formula: In the formula, This indicates an element-wise multiplication operation, where g is the combined weight of the answer part, and 1-g represents the weight of the question part. The formula in the output layer is as follows: In the formula, Let C represent the predicted probability vector of satire, C represent the number of classes of satire labels, W and b represent the training parameters of the classifier layer, and softmax is the activation function.

9. The irony detection network based on a multi-hop attention network with context representation according to claim 8, characterized in that, The network model is trained end-to-end using backpropagation, and the cross-entropy error is used as the objective function for sarcasm detection. It was used to correct the irony represented by a one-hot vector, and then The predicted probability presented to each sentence; The goal of training the model is to minimize the ground truth distribution of the entire sample. and predicted distribution The loss function between them is as follows: in i An index representing a specific sentence. j Index representing the category, Represents the regularization factor. Includes all training parameters; The network model is trained using stochastic gradient descent (SGD) to minimize the objective function, and employs dropout and early stopping strategies to prevent overfitting of the network model parameters.