A sarcasm detection method for social media comments based on topic context
By introducing topical context and self-attention mechanisms, combined with long short-term memory networks, the accuracy of detecting sarcasm in social media comments is improved, solving the problem of insufficient accuracy in existing methods and achieving a better understanding of users' true emotions.
Patent Information
- Application Number
- CN202311024868.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-12
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2043-08-12
AI Technical Summary
Existing methods for detecting sarcasm in social media comments are insufficient in terms of accuracy, especially since they ignore the role of the object of sarcasm and contextual information, making it difficult to accurately understand users' true feelings about specific events.
By introducing the topic corresponding to the target comment text as the context, and combining self-attention mechanism and long short-term memory network, the Chinese BERT model and bidirectional gated recurrent neural network are used to extract topic-comment text features for irony detection.
It improves the accuracy of ironic statement recognition, better understands users' actual emotions towards specific events, and enhances the effectiveness of irony detection.
Smart Images

Figure CN117056512B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing, specifically a method for detecting irony in social media comments based on topic context. Background Technology
[0002] With the rapid development of social media platforms, more and more social media users are expressing their thoughts and opinions on trending topics or events (objects of satire). Many users use exaggeration, metaphor, and other rhetorical devices in their social media comments to indirectly criticize people or events or humorously cover up awkwardness. Due to the ambiguity and non-directness of satirical texts, satire detection is considered one of the key challenges in sentiment analysis and opinion mining. Therefore, effective satire detection can provide valuable assistance in understanding people's true thoughts and mining user opinions.
[0003] Existing methods for detecting irony in social media comments mainly fall into two categories: context-based irony detection and context-independent irony detection. Context-based irony detection uses contextual information to determine whether a target statement is ironic. Contextual information includes user characteristics, replies to the target statement, and comments. This method is limited to sentence-level text information and ignores the role of the ironic object in irony detection. Context-independent irony detection focuses on the sentence structure and linguistic characteristics of the ironic statement, judging whether it is ironic solely by analyzing the target statement. This method does not consider the role of contextual information, resulting in low accuracy in irony identification. Therefore, irony detection in social media comments, relying solely on analyzing the comment statement itself, is insufficient to accurately and comprehensively understand the user's true feelings about a specific event; topical contextual information is needed to enhance the ironic tendency of the comment statement. Summary of the Invention
[0004] The purpose of this invention is to provide a topic-context-based method for detecting irony in social media comments. By introducing the topic corresponding to the target comment text as its contextual background, the method can better understand the ironic expression in the target comment. Simultaneously, it utilizes self-attention mechanisms and long short-term memory networks to focus on the emotional information within the target comment, enhancing the understanding of the semantic information of the comment itself and thus improving the accuracy of ironic statement recognition.
[0005] To achieve its objectives, the present invention employs the following technical solution:
[0006] A method for detecting irony in social media comments based on topic context includes the following steps:
[0007] (1) Obtain the topic text and target comment text and perform preprocessing operations;
[0008] (2) Obtain the text vector representations of the topic text and the target comment text through the Chinese BERT pre-trained model BERT-Base-Chinese;
[0009] (3) The obtained topic text vector and target comment text vector are used to extract features using a bidirectional gated recurrent neural network (Bi-GRU), and then global average pooling is performed on the topic text feature vector and the target comment text feature vector.
[0010] (4) Extract the related semantic features of the two through the interactive attention mechanism, and fuse the related semantic features with the text features to obtain the topic-comment text features;
[0011] (5) For the target comment text vector representation, emotional semantic features are obtained by combining a long short-term memory network with a self-attention mechanism;
[0012] (6) The topic-comment text features and sentiment semantic features are fused and input into the sigmoid function to obtain the final irony detection result.
[0013] In step (1), the specific operations for obtaining the topic text and target comment text and performing word segmentation are as follows:
[0014] (1.1) Use a web crawler to crawl Chinese comment text with topics from the "Observer" website, while blocking sensitive topics to ensure the standardization of text data.
[0015] (1.2) Filter out long text data to reduce the impact of long sentences on ironic expression, and filter out information in the text data that is not semantically relevant.
[0016] (1.3) Construct a data sample by combining topic text and comment text into topic-comment pairs, and filter out duplicate topic-comment pairs.
[0017] In step (2), the specific steps for obtaining the text vector representations of the topic text and the target comment text through the BERT-base Chinese pre-trained language model are as follows:
[0018] (2.1) Add “[CLS]” and “[SEP]” to the beginning and end of each text word sequence respectively, fill the sequence with the special padding character “[PAD]” to ensure that all sequences have the same length, convert the word fragments into corresponding integer IDs, and form a numeric tensor.
[0019] (2.2) The input text sequence is converted into a vector representation through the embedding layer of the BERT model, resulting in an input vector representation containing relevant information.
[0020] (2.3) Input this input vector into multiple Transformer encoders for processing to obtain richer context-dependent representations.
[0021] In step (3), the specific steps for extracting features from the obtained vector representation using a bidirectional gated recurrent neural network (Bi-GRU) and performing global average pooling are as follows:
[0022] (3.1) Further extract the text features of the target comment text and topic text through the Bi-GRU network, and output the context information at the corresponding positions.
[0023] (3.2) For the feature sequence obtained after Bi-GRU processing, calculate the average value of all positions in each feature dimension to obtain the converged vector representation.
[0024] In step (4), the specific steps for extracting the semantic features of the two through the interactive attention mechanism and fusing the semantic features of the two with the text features to obtain the topic-comment text features are as follows:
[0025] (4.1) Calculate an interaction matrix, perform softmax normalization on each row of the interaction matrix to obtain the attention matrix of the topic relative to the text, and then perform softmax normalization on each column of the interaction matrix to obtain the attention matrix of the text relative to the topic.
[0026] (4.2) Average the obtained attention matrix of text relative to topic column by column to obtain the text-level attention representation, and then multiply it by the obtained attention matrix of topic relative to text to obtain the topic-level attention representation.
[0027] (4.3) Finally, the correlation between topic and text is calculated.
[0028] (4.4) The output vector of the topic text after Bi-GRU network and global average pooling, the output vector of the target comment text, and the correlation representation between the topic and the text obtained through interactive attention mechanism are concatenated. The resulting text feature sequence contains bidirectional information of each word, forming a topic-comment text feature vector representation.
[0029] In step (5), the specific steps for obtaining emotional semantic features through a long short-term memory network combined with a self-attention mechanism are as follows:
[0030] (5.1) The forget gate determines which information can pass through the cell state. This decision is controlled by the forget gate through the sigmoid function. The forget gate generates a value between 0 and 1 based on the output of the previous time step and the input of the current time step to determine whether to allow the information learned in the previous time step to pass through.
[0031] (5.2) Generate the information that needs to be updated. The input gate uses the sigmoid function to determine which values to use for updating. Then the tanh layer generates new candidate values, which are added to the cell state as candidate values generated by the current layer.
[0032] (5.3) To update the cell state, first multiply by the intermediate value generated by the forget gate to forget useless information, and then add the product of the intermediate value generated by the input gate and the candidate value to obtain the candidate value.
[0033] (5.4) The output gate first obtains an initial output through the sigmoid function, then scales the updated candidate values to between -1 and 1 using tanh, and then multiplies them one by one with the output obtained by sigmoid to obtain the output.
[0034] (5.5) The text features extracted by the LSTM model are used as the input of the self-attention mechanism. Different weight parameters are given according to the importance of different words in the sentence to the information of the sentence, and the attention feature vector of the sentence is obtained.
[0035] In step (6), the specific steps for fusing topic-comment text features and sentiment semantic features and inputting them into the sigmoid function to obtain the final irony detection result are as follows:
[0036] (6.1) The obtained topic-comment text feature vector and attention feature vector are concatenated.
[0037] (6.2) Then the concatenated vector is input into the sigmoid function to classify the text.
[0038] (6.3) Optimize by cross-entropy loss and L2 loss function, and use dropout to prevent overfitting.
[0039] The social media comment sarcasm detection method based on topic context provided by this invention has the following advantages:
[0040] (1) By introducing a topic and using the topic as the object of irony, this invention provides supplementary explanations to the target comment statement, which can better determine whether the sentence is an ironic expression. Compared with the traditional sentence-level irony detection, topic-oriented irony detection is closer to the real scene.
[0041] (2) This invention uses topic text as contextual information of target comment statements, and then, by deeply mining the intra-sentence information of target comment statements, combines the context-based irony detection method with the context-independent irony detection method, which can accurately and comprehensively understand the user's actual feelings about a specific event. Attached Figure Description
[0042] Figure 1 A flowchart of a social media comment sarcasm detection method based on topic context provided by the present invention;
[0043] Figure 2 A flowchart of text data acquisition and processing provided for this invention;
[0044] Figure 3 The flowchart for integrating topic context information provided by this invention;
[0045] Figure 4 A flowchart for mining target comment text information provided by this invention. Detailed Implementation
[0046] The present invention will be further explained and illustrated below through specific embodiments.
[0047] Example 1: This invention provides a method for detecting irony in social media comments based on topic context, such as... Figure 1 As shown. The specific steps are as follows:
[0048] S1. Text data acquisition and processing. Combined with... Figure 2 The following explanation is provided:
[0049] S1.1. Obtain topic text and target comment text data. Use a web crawler to crawl Chinese comment text with topics from the "Guancha" website (https: / / www.guancha.cn / ).
[0050] S1.2. Data processing of topic text and target comment text.
[0051] S1.2.1. Block topics containing sensitive words, low proportion of ironic expressions, and strong offensive content to ensure the standardization of text data.
[0052] S1.2.2. Filter out long text data with a length of more than 100 characters to reduce the impact of long sentences on ironic expression.
[0053] S1.2.3. Add "topic:" and "text:" before the topic text and comment text respectively to form a topic-comment pair to construct a data sample.
[0054] S1.2.4. Filter out duplicate topic-comment pairs, and also filter out special characters, web addresses, and semantically irrelevant information from the text data. This forms the initial data.
[0055] S1.2.5. For each data sample, perform independent labeling to obtain category labels.
[0056] S1.2.6. To improve data quality, discard approximately 20% of the noisy data in the initial data.
[0057] S1.2.7. Revise the topic. Delete inappropriate phrasing, such as "Ministry of Foreign Affairs responded"; delete redundant information in the topic, such as "yet another one!"; rephrase the topic text to make it more fluent.
[0058] S2. Obtain the vector representations of the topic text and comment text. Details are as follows:
[0059] S2.1 adds “[CLS]” and “[SEP]” to the beginning and end of each text word sequence respectively, fills the sequence with the special padding character “[PAD]” to ensure that all sequences have the same length, converts word fragments into corresponding integer IDs, and forms a digital tensor.
[0060] S2.2. The BERT model's embedding layer converts the input text sequence into a vector representation. The three embedding vectors—TokenEmbedding, Segment Embedding, and Position Embedding—are summed to obtain an input vector representation containing Token, Segment, and Position information. This input vector is then fed into multiple Transformer encoders for processing, yielding a richer, context-sensitive representation. The relevant representation obtained after BERT processing is as follows:
[0061]
[0062]
[0063] Parameter description: The word embedding represents the conversion of each word into a corresponding word vector. This represents the positional embedding that transforms each word into a corresponding position vector within the sentence. This represents the paragraph embedding that transforms each word into the paragraph vector corresponding to the sentence it belongs to. and These are the output vectors containing context information for topic and text at time m, respectively.
[0064] S3. Feature extraction of topic text and comment text, and global average pooling. Details are as follows:
[0065] S3.1. Further extract textual features from the target comment text (text) and topic text (topic) using a Bi-GRU network, and output the contextual information at the corresponding positions. The Bi-GRU processing process is represented as follows:
[0066]
[0067]
[0068]
[0069] Parameter description: x t Let h be the input vector of the Bi-GRU network at time t. t Let t be the hidden layer state of the Bi-GRU network. This represents the output of the positive hidden layer state at time t-1. This is the output of the reverse hidden layer state at time t-1. and These are the text feature sequences obtained after Bi-GRU processing of the topic text (topic) and the target comment text (text), respectively. d is the hidden layer dimension, and b is the bias.
[0070] S3.2. For the feature sequence obtained after Bi-GRU processing, calculate the average value of all positions in each feature dimension to obtain the converged vector representation. The formula is as follows:
[0071]
[0072]
[0073] Parameter description: and These are the output vectors of the topic text (`topic`) and the target comment text (`text`) after global average pooling, respectively. `u+2` and `v+2` represent the feature sequence lengths of the topic and the text, respectively. and Representing the input feature sequence h respectively c and h r The vector at the i-th position.
[0074] S4. Incorporating topical context information. Combined with... Figure 3 The following explanation is provided:
[0075] S4.1. Calculate an interaction matrix I using the following formula:
[0076] I = h c ·h rT
[0077] Parameter description: h c h is the text feature sequence obtained after Bi-GRU processing of the topic text. rT The transpose of the text feature sequence obtained after Bi-GRU processing of the target comment text.
[0078] S4.2. Perform softmax normalization on each row of this interaction matrix to obtain the attention matrix α between the topic and the text. Then, perform softmax normalization on each column of this interaction matrix to obtain the attention matrix β between the text and the topic. The calculation formula is as follows:
[0079]
[0080]
[0081] Parameter description: α ij Let β be the attention matrix of the topic relative to the text. ij This is the attention matrix for text relative to topic.
[0082] S4.3. β ij The average of each column is used to obtain the text-level attention representation, which is then compared with α. ij Perform a dot product to obtain the topic-level attention representation. The calculation formula is as follows:
[0083]
[0084]
[0085] Parameter description: For text-level attention representation, This represents the attention representation at the topic level.
[0086] S4.4. Finally, the correlation between the topic and the text is represented by the text encoding vector h. r The weighted sum with attention γ. The calculation formula is as follows:
[0087] s = h rT ·γ
[0088] Parameter description: s represents the relevance between topic and text.
[0089] S4.5. The output vector of the topic text after Bi-GRU network and global average pooling. Output vector of the target comment text The topic-comment text feature vector is formed by concatenating the topic and text relevance representation s obtained through the interactive attention mechanism. The concatenated text feature sequence contains bidirectional information for each word.
[0090]
[0091] Parameter description: L is the topic-comment text feature vector.
[0092] S5. Comment text information mining. Combined with... Figure 4 The following explanation is provided:
[0093] S5.1. The forget gate determines which information can pass through the cell state. This decision is controlled by the forget gate through the sigmoid function. The forget gate is based on the output h of the previous time step. t-1 and the input x at the current time step t To generate an f between 0 and 1 t The value determines whether to reuse the information c learned in the previous time step. t-1 Passed. The formula is as follows:
[0094] f t =σ(W f ·[h t-1 ,x t ]+b f )
[0095] Parameter description: W f Let b be the weight matrix. f f is the bias vector. t It is the intermediate value generated by the forget gate, f t ∈[0,1].
[0096] S5.2. Generating the information that needs to be updated. The input gate uses the sigmoid function to determine which values to use for updates, and then the tanh layer generates new candidate values. This new candidate value will be added to the cell state as a candidate value generated by the current layer. The calculation process is as follows:
[0097] i t =σ(W i ·[h t-1 ,x t ]+b i )
[0098]
[0099] Parameter description: For the new candidate value, i t It is the intermediate value generated by the input gate.
[0100] S5.3. Update the cell state, first multiply by f. t Forget the useless information, and then... The candidate values are obtained by adding them together. The formula is as follows:
[0101]
[0102] Parameter description: c t It is the candidate value updated at time t, c t-1 It represents the candidate value at the previous moment.
[0103] S5.4. The output gate first obtains an initial output using the sigmoid function, and then uses tanh to convert c... t The value is scaled to between -1 and 1, and then multiplied pairwise with the output obtained from the sigmoid function to obtain the final output. The formula is as follows:
[0104] o t =σ(W o ·[h t-1 ,x t ]+b o )
[0105] h t =o t ·tanh(c t )
[0106] Parameter description: o t The initial output, h, is obtained through the output gate. t For the output of the model, W o It is the weight matrix, b o For bias.
[0107] S5.5. The text features extracted by the LSTM model are used as input to the self-attention mechanism. Different weight parameters are assigned to different words in the sentence according to their importance to the sentence's information, resulting in the sentence's attention feature vector Q. The formula is as follows:
[0108]
[0109]
[0110] Parameter description: α i yes The weight represents the importance of the i-th word to the entire comment text.
[0111] S6. Feature Fusion and Classification. Details are as follows:
[0112] S6.1. Concatenate the obtained topic-comment text feature vector L and attention feature vector Q:
[0113] T = Concat[L, Q]
[0114] S6.2. Then, the concatenated vector T is input into the sigmoid function to classify the text:
[0115]
[0116] Parameter description: w T As the weight, b T For bias, It is a probability value, representing the probability of being ironic or not.
[0117] S6.3. Optimize using cross-entropy loss and L2 loss function, and use dropout to prevent overfitting:
[0118]
[0119] Parameter description: N is the total number of samples in the training set; K is the total number of classes; Let be the true value of the j-th class for the i-th training sample. denoted as , where is the predicted value for the j-th class of the i-th training sample; λ is the L2 regularization coefficient; and Θ is the trainable parameter in the model.
[0120] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and not restrictive, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
[0121] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. A method for detecting irony in social media comments based on topic context, characterized in that... Includes the following steps: Step 1: Obtain the topic text and target comment text and perform preprocessing operations; Step 2: Obtain the text vector representations of the topic text and the target comment text using the BERT-Base-Chinese pre-trained model; Step 3: Use a bidirectional gated recurrent neural network (Bi-GRU) to extract features from the obtained topic text vector and target comment text vector, and then perform global average pooling on the topic text feature vector and target comment text feature vector; Step 4: Extract the semantic features of the association between the two through the interactive attention mechanism, and fuse the semantic features of the association with the text features to obtain the topic-comment text features; Step 5: For the target comment text vector representation, obtain sentiment semantic features by combining a long short-term memory network with a self-attention mechanism; Step 6: Fuse the topic-comment text features and sentiment semantic features, and input them into the sigmoid function to obtain the final irony detection result; Step 3 includes: (4.1) Further extract the text features of the target comment text and topic text using a Bi-GRU network, and output the context information at the corresponding positions; the process after Bi-GRU processing is as follows: Where: x t Let h be the input vector of the Bi-GRU network at time t. t Let t be the hidden layer state of the Bi-GRU network. This represents the output of the positive hidden layer state at time t-1. This is the output of the reverse hidden layer state at time t-1. and These are the text feature sequences obtained after Bi-GRU processing of the topic text (topic) and the target comment text (text), respectively, where d is the hidden layer dimension and b is the bias. (4.2) For the feature sequence obtained after Bi-GRU processing, calculate the average value of all positions in each feature dimension to obtain the converged vector representation, as shown in the formula: in: and These are the output vectors of the topic text (`topic`) and the target comment text (`text`) after global average pooling, respectively. `u+2` and `v+2` represent the feature sequence lengths of the topic and the text, respectively. and Representing the input feature sequence h respectively c and h r The vector at the i-th position.
2. The method for detecting irony in social media comments based on topic context as described in claim 1, characterized in that... Step 1 includes: (2.1) Obtaining topic text and comment text: Use a web crawler to crawl Chinese comment text with topics from the "Observer" website; (2.2) Text data processing: Block topics containing sensitive words, low proportion of ironic expressions, and strong attacks; construct topic-comment pairs; filter long text data, duplicate data, special symbols, web addresses, and information that is not semantically relevant; label data; reduce noise; and correct topics.
3. The method for detecting irony in social media comments based on topic context as described in claim 1, characterized in that... Step 2 includes: (3.1) Add "[CLS]" and "[SEP]" to the beginning and end of each text word sequence respectively, fill the sequence with the special padding character "[PAD]" to ensure that all sequences have the same length, convert the word fragments into corresponding integer IDs, and form a digital tensor; (3.2) The input text sequence is converted into a vector representation through the embedding layer of the BERT model. The three embedding vectors, TokenEmbedding, Segment Embedding, and Position Embedding, are summed to obtain an input vector representation containing Token, Segment, and Position information. This input vector is then fed into multiple Transformer encoders for processing to obtain a richer context-sensitive representation. The relevant representation obtained after BERT processing is as follows: in, The word embedding represents the conversion of each word into a corresponding word vector. This represents the positional embedding that transforms each word into a corresponding position vector within the sentence. This represents the paragraph embedding that transforms each word into the paragraph vector corresponding to the sentence it belongs to. and These are the output vectors containing context information for topic and text at time m, respectively.
4. The method for detecting irony in social media comments based on topic context as described in claim 1, characterized in that... Step 4 includes: (5.1) Perform softmax normalization on each row of this interaction matrix to obtain the attention matrix α of the topic relative to the text. Then perform softmax normalization on each column of this interaction matrix to obtain the attention matrix β of the text relative to the topic. The calculation formula is as follows: Where: α ij Let β be the attention matrix of the topic relative to the text. ij This is the attention matrix for text relative to topic; (5.2) β ij The average of each column is used to obtain the text-level attention representation, which is then compared with α. ij Performing a dot product yields the topic-level attention representation, calculated using the following formula: in: For text-level attention representation, Attention representation at the topic level; (5.3) Finally, the correlation between the topic and the text is represented by the text encoding vector h. r The weighted sum with attention γ is calculated using the following formula: s=h rT ·c Where: s represents the relevance between topic and text. (5.4) The output vector of the topic text after Bi-GRU network and global average pooling. Output vector of the target comment text The topic-comment text feature vector is formed by concatenating the topic and text relevance representation s obtained through the interactive attention mechanism. The concatenated text feature sequence contains bidirectional information for each word. Where: L is the topic-comment text feature vector.
5. The method for detecting irony in social media comments based on topic context as described in claim 1, characterized in that... Step 5 includes: (6.1) The forget gate determines which information can pass through the cell state. This decision is controlled by the forget gate through the sigmoid function. The forget gate is based on the output h of the previous time step. t-1 and the input x at the current time step t To generate an f between 0 and 1 t The value determines whether to reuse the information c learned in the previous time step. t-1 The formula is as follows: f t =σ(W f ·[h t-1 ,x t ]+b f ) Among them: W f Let b be the weight matrix. f f is the bias vector. t It is the intermediate value generated by the forget gate, f t ∈[0,1]; (6.2) The input gate uses the sigmoid function to determine which values to use for updating, and then the tanh layer generates new candidate values. This new candidate value will be added to the cell state as a candidate value generated by the current layer. The calculation process is as follows: i t =σ(W i ·[h t-1 ,x t ]+b i ) in: For the new candidate value, i t It is the intermediate value generated by the input gate; (6.3) To update the cell state, first multiply by f. t Forget the useless information, and then... The candidate values are obtained by adding them together, as shown in the following formula: Where: c t It is the candidate value updated at time t, c t-1 The candidate value represents the value at the previous moment; (6.4) The output gate first obtains an initial output through the sigmoid function, and then uses tanh to convert c to an output. t The value is scaled to between -1 and 1, and then multiplied pairwise with the output obtained from the sigmoid function to obtain the final output, as shown in the following formula: the t =σ(W o ·[h t-1 ,x t ]+b o ) h t =o t ·tanh(c t ) Among them: o t The initial output, h, is obtained through the output gate. t W is the output of the model. o It is the weight matrix, b o For bias; (6.5) The text features extracted by the LSTM model are used as the input of the self-attention mechanism. Different weight parameters are assigned according to the importance of different words in the sentence to the information, and the attention feature vector Q of the sentence is obtained, as shown in the following formula: Where: α i yes The weight represents the importance of the i-th word to the entire comment text.
6. The method for detecting irony in social media comments based on topic context as described in claim 1, characterized in that... Step 6 includes: (7.1) Concatenate the obtained topic-comment text feature vector L and attention feature vector Q: T = Concat[L, Q] (7.2) Then, the concatenated vector T is input into the sigmoid function to classify the text: Where: w T As the weight, b T For bias, It is a probability value, representing the probability of being ironic or not; (7.3) Optimize using cross-entropy loss and L2 loss function, and use dropout to prevent overfitting: Where: N is the total number of samples in the training set; K is the total number of categories; Let be the true value of the j-th class for the i-th training sample. denoted as , where is the predicted value for the j-th class of the i-th training sample; λ is the L2 regularization coefficient; and Θ is the trainable parameter in the model.
Citation Information
Patent Citations
Knowledge graph and cross-modal attention-based multi-modal siphonage detection method
CN114330334A
System of and method for automatically detecting sarcasm of a batch of text
US20230073602A1