False news detection method for unbalanced samples

Through the RoBERTa model and Transformer encoder combined with Bi-GRU for semantic interaction, combined with the gating mechanism and weight resampling module, it solves the problem of the attention mechanism model's insufficient ability to capture local dependencies and imbalanced samples, and improves fake news detection. classification accuracy.

CN118760880APending Publication Date: 2024-10-11JILIN UNIVERSITY
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410878678.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

The existing fake news detection model based on the attention mechanism has strong ability to capture global dependencies, but its ability to capture local dependencies is weak. It is especially unable to effectively understand articles that use rhetorical techniques, and faces problems caused by imbalanced samples. Classification accuracy issues.

Method used

The RoBERTa model is used for word embedding, the Transformer encoder and Bi-GRU are combined for semantic interaction, the gating mechanism module is used to extract local features, and the category weights are adjusted through the weight resampling module to alleviate the data imbalance problem.

Benefits of technology

Capturing global and local features at the same time improves the classification accuracy of fake news detection, effectively copes with the imbalanced sample problem, and improves the model's understanding ability and performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760880A_ABST
    Figure CN118760880A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of false news detection, and provides an unbalanced sample-oriented false news detection method, which comprises the following steps of: embedding words; a RoBERTa model is used for embedding words, and the RoBERTa comprises three kinds of embedded codes, namely mark embedding, segmentation embedding and position embedding; a semantic interaction module; the feature extraction module is composed of a RoBERTa embedded code, a Transform encoder and a Bi-GRU, and is used for extracting global features; a gating mechanism module; the local feature extraction module is composed of a ConvID, a BatchNorm, a CGU, a sigmoid activation function and a Dropout layer, and is used for extracting local features; a weight resampling module; and setting a weight and a sampling rate. According to the method, a weight resampling method is provided for a data set imbalance phenomenon, global features and local features can be captured at the same time, and the classification accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of fake news detection, and in particular relates to a fake news detection method for unbalanced samples. Background Art

[0002] With the popularity of social media and the rapid development of the Internet, false information has been widely spread on the Internet, undermining the credibility of information and bringing serious negative impacts to the public. Fake news is deceptive and misleading. They often attract public attention and sharing quickly with attractive headlines, exaggerated facts and inaccurate data. This phenomenon may lead to the public's misunderstanding of facts and affect the accuracy of decision-making. In order to cope with the proliferation of fake news, researchers have begun to focus on the development of fake news detection methods to help users judge the authenticity of information. Fake news detection aims to verify whether the facts stated in the text are true and evaluate the authenticity of the claims contained in the text. Among them, a claim is a statement or assertion stated in the text. It can be a statement about an event, fact, opinion or argument, involving various fields and topics. For example, claims can involve the efficacy of new drugs in the medical field, the policy effects in the political field, and research results in the scientific field. The fake news detection task can help the public and decision makers accurately understand the truth of the facts and avoid people being misled by false information by verifying these claims, verifying and evaluating the authenticity of the claims in the text.

[0003] Existing fake news detection methods mainly use natural language processing and machine learning technologies. However, since the spread speed of fake news on social platforms often exceeds that of real news, some data sets are unbalanced. The current mainstream method is to use a model based on the attention mechanism to detect fake news. The attention mechanism relies on its powerful semantic understanding and ability to capture long-distance dependencies, which helps to improve classification performance. However, the attention-based model focuses more on capturing global dependencies and has a weaker ability to capture local dependencies, making it unable to understand some articles that use rhetorical devices (such as metaphors, similes, and puns). To address the above problems, the model's ability to understand news can be improved by appropriately reducing or adjusting the attention weight or introducing external evidence. To this end, a fake news detection method for imbalanced samples is proposed. Summary of the invention

[0004] The purpose of the present invention is to provide a fake news detection method for unbalanced samples, aiming to solve the problems raised in the above background technology.

[0005] To achieve the above object, the present invention provides the following technical solutions:

[0006] A fake news detection method for imbalanced samples includes the following steps:

[0007] Step S1, word embedding: using the RoBERTa model to embed words, the RoBERTa model includes three embedding codes, namely, tag embedding, segmentation embedding and position embedding;

[0008] Step S2, semantic interaction module; the semantic interaction module consists of RoBERTa embedding code, Transformer encoder and Bi-GRU, which is used to promote semantic interaction between Claim and Article and extract global features;

[0009] Step S3, gating mechanism module; the gating mechanism module consists of ConvID, BatchNorm, CGU, sigmoid activation function and Dropout layer, which is used to extract local features;

[0010] Step S4, weight resampling module: set weights and sampling ratios.

[0011] Furthermore, the token embedding is a word vector obtained by pre-training RoBERTa based on WordPiece embedding.

[0012] Furthermore, when processing input text, the RoBERTa model adds a [CLS] flag at the beginning of a word and a [SEP] flag at the end, and converts each word into a corresponding token embedding vector to segment the sentence.

[0013] Furthermore, the specific process of step S2 is as follows:

[0014] First, C n ={c1,c2,…,c n} is regarded as a set of n claim sequences, where L is the maximum sequence length, d is the feature size; each Claim consists of a set of m related articles A m,n Reported that A m,n ={a1,a2,…,a m} is a set of source articles, The embedding code is extracted from the pre-trained language model RoBERTa and passed through the Transformer encoder; the mth vector A of the input text m,n Through the Transformer encoder and the nth vector C n To interact:

[0015]

[0016] Among them, vector A m,n As query input, C nAs the input of key and value, deep semantic interaction is carried out in the Transformer encoder block. The query, key and value are projected h times by different learnable linear layers; each Transformer encoder consists of a module unit and two sub-layers; after the input vector interacts with other vectors, the related modules are connected:

[0017] Z1=concat(H1,…,H h )W o

[0018] Among them, H j =Attention(AW j A ,CW j C ,CW j C ), the linear transformation is Where Z1 is the output vector after concatenation, H1,…,H h They are the multi-head attention mechanism inside the Transformer encoder, j∈[0,h], A is the query input of the Transformer encoder (i.e. Figure 3 The input Q in the code is C, and the key and value input of the Transformer encoder is C. Figure 3 Input K, V in and is the linear transformation parameter;

[0019] Bi-GRU is used to extract semantic features. The vector Z1 is sent to the Bi-GRU layer for three iterations and normalized. After passing through a Dropout layer, the dimension is reduced by nonlinear transformation.

[0020] Furthermore, the specific process of step S3 is as follows:

[0021] Given an input sequence C n , after being processed by ConvID, it is normalized using BatchNorm: Normalized feature sequence is divided into a hidden state sequence h' and a gated state sequence s': Perform one-dimensional convolution and batch normalization operations on the gated state sequence s' to obtain the normalized gated sequence Normalized gated sequence Nonlinear mapping is performed through the sigmoid activation function to obtain the gated sequence s; the gated sequence s is multiplied by the hidden state sequence h'. In order to avoid overfitting, the gated feature sequence is sent to the Dropout layer to obtain the final classification label result: Z2 = dropout (gated).

[0022] Furthermore, in step S4, the batch size is set to 128, and within a batch, negative samples are sampled sequentially and positive samples are sampled randomly, with a ratio of 7:3, and the category weights are set to [0:0.5, 1:0.55] using grid search parameters.

[0023] Compared with the prior art, the present invention has the following beneficial effects:

[0024] The present invention proposes a weight resampling method to address the imbalance phenomenon of data sets, which can not only capture global and local features at the same time, but also improve the accuracy of classification. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 It is a flow chart of the present invention.

[0026] Figure 2 It is a structural diagram of the embedding layer in the present invention.

[0027] Figure 3 This is a structural diagram of the semantic interaction module in the present invention.

[0028] Figure 4 It is the framework diagram of CPMLP in the present invention. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0030] The specific implementation of the present invention is described in detail below in conjunction with specific embodiments.

[0031] like Figure 1 As shown, a method for detecting fake news for unbalanced samples is provided by an embodiment of the present invention, and the method for detecting fake news for unbalanced samples includes the following steps:

[0032] Step S1, word embedding: using the RoBERTa model to embed words, the RoBERTa model includes three embedding codes, namely, tag embedding, segmentation embedding and position embedding;

[0033] Step S2, semantic interaction module; the semantic interaction module consists of RoBERTa embedding code, Transformer encoder and gated recurrent unit (Bi-GRU), which is used to promote semantic interaction between Claim and Article and extract global features;

[0034] Step S3, a gating mechanism module; the gating mechanism module consists of a one-dimensional convolutional layer (ConvID), a batch normalization layer (BatchNorm), a convolutional gating unit (CGU), a sigmoid activation function and a Dropout layer, and is used to extract local features;

[0035] Step S4, weight resampling module: setting weights and sampling ratios to alleviate the problem of data imbalance.

[0036] As a preferred embodiment of the present invention, in step S1, we use RoBERTa to embed words, such as Figure 2 The following is the structure of the embedding layer. The token embedding is a word vector obtained by pre-training the model based on WordPiece embedding. When RoBERTa inputs text, in addition to inserting special flags (CLS and SEP) at the beginning and end of the word, it also corresponds each word to a token embedding vector to segment the sentence. Using WordPiece embedding can handle unknown word and subword combinations better than traditional word vectors.

[0037] As a preferred embodiment of the present invention, in step S2, we design a semantic interaction module to promote deeper semantic interaction between Claim and Article. The architecture is as follows: Figure 3 shown.

[0038] The present invention adopts the method of inputting different queries, keys and values, and adding auxiliary data Article to prompt the model to focus on the most important phrases in the Claim, which can play the role of attention guidance and enable the two inputs to have deep semantic interaction, thereby improving the performance of the model. n ={c1,c2,…,c n} is regarded as a set of n claim sequences, where L is the maximum sequence length, d is the feature size; each Claim consists of a set of m related articles A m,n Reported that A m,n ={a1,a2,…,a m} is a set of source articles, At the same time, each C n It is also associated with a binary label Y indicating its authenticity m,n∈{0,1}. m,n =1 means A m,n is not a rumor, Ym,n=0 means Am,n is a rumor. We define the dataset as D={d1,d2,…,d D}, where each data is a tuple {A m,n ,C n ,Y m,n}. The tuple corresponding to the claim, the related article and its authenticity constitutes the training instance. Given the data, our goal is to predict the claim C n The embedding code is extracted from the pre-trained language model RoBERTa and passed through the Transformer encoder; the mth vector A of the input text m,n Through the Transformer encoder and the nth vector C n To interact:

[0039]

[0040] Among them, vector A m,n As query input, C n As the input of key and value, deep semantic interaction is carried out in the Transformer encoder block. The query, key and value are projected h times by different learnable linear layers; each Transformer encoder consists of a module unit and two sub-layers; after the input vector interacts with other vectors, the related modules are connected:

[0041] Z1=concat(H1,…,H h )W o

[0042] Among them, H j =Attention(AW j A ,CW j C ,CW j C ), the linear transformation is Where Z1 is the output vector after concatenation, H1,…,H h They are the multi-head attention mechanism inside the Transformer encoder, j∈[0,h], A is the query input of the Transformer encoder (i.e. Figure 3 The input Q in the code is C, and the key and value input of the Transformer encoder is C. Figure 3 Input K, V in and is the linear transformation parameter;

[0043] Bi-GRU is used to extract semantic features. Compared with traditional RNN and LSTM, GRU has lower computational cost and faster execution speed. At the same time, GRU has fewer parameters, can better prevent gradient disappearance, and can better handle long sequence data. Vector Z1 is sent to the Bi-GRU layer for 3 iterations and normalized. After passing through a Dropout layer, it is reduced in dimension through nonlinear transformation.

[0044] As a preferred embodiment of the present invention, in step S3, the present invention proposes a gating mechanism module for capturing local dependencies in the input sequence, which is implemented by CPMLP. This module can process both sequence and non-sequence features and has better generalization performance. The structure of CPMLP is as follows Figure 4 Specifically, given an input sequence C n , after being processed by ConvID, it is normalized using BatchNorm: Normalized feature sequence is divided into a hidden state sequence h' and a gated state sequence s': Perform one-dimensional convolution and batch normalization operations on the gated state sequence s' to obtain the normalized gated sequence Normalized gated sequence The nonlinear mapping is performed through the sigmoid activation function to obtain the gating sequence s; the gating sequence s is multiplied by the hidden state sequence h' to obtain the gating feature sequence: In order to avoid overfitting, the gated feature sequence is sent to the Dropout layer to obtain the final classification label result: Z2 = dropout (gated).

[0045] As a preferred embodiment of the present invention, in step S4, when the samples in the data set are seriously unbalanced, it is more difficult for the model to predict the minority category. In view of the influence of noise interference on the prediction accuracy of the model, we designed an anti-noise interference experiment ATI (Anti-noise interference), which is an adjustable weight resampling method. In view of the fact that the number of positive samples in the data set we use is far less than the number of negative samples, as shown in Table 1, the weight range is divided into two categories according to the ratio of positive and negative samples, and the category weight is used for allocation. When calculating the loss function, different categories are weighted to improve the classification effect of the model on the minority category. Specifically, we use the following weight and sampling rate settings. First, the batch size is set to 128. Within a batch, negative samples are sampled sequentially, positive samples are randomly sampled, and the ratio is 7:3. The category weight is set to [0:0.5,1:0.55] using the grid search parameter.

[0046] Table 1 Dataset statistics

[0047]

[0048] In order to evaluate the performance of this method, we use appropriate evaluation indicators to evaluate the classification results, namely accuracy, F1-score, precision and recall. Tables 2 and 3 list the results of this method and traditional methods on the four data sets in terms of various evaluation indicators.

[0049] Table 2 Experimental results of this method and traditional methods on Snopes and Mocheg datasets

[0050]

[0051] Table 3 Experimental results of this method and traditional methods on MultiFC and PolitiFact datasets

[0052]

[0053] As can be seen from Tables 2 and 3, the classification performance of the traditional CNN and LSTM models based on word embedding is the worst. When turning from the classic deep learning language model to the Transformer and Longformer models based on the attention mechanism, it can be observed that all indicators on each dataset have been significantly improved, with an increase of about 8%-13%. Among these methods, Longformer is good at processing long sequences, with an accuracy improvement of 15% compared to the classic deep learning language model on the MultiFC dataset. However, the performance of this method is better than all of them, with an accuracy improvement of 4.6% on the four datasets. This shows that the structure of this method can better capture global and local information. In addition, although BERT and RoBERTa have high accuracy, compared with them, the accuracy of this method on the Snopes and MultiFC datasets is improved by about 2.9%, and the accuracy on the Mocheg and Politifact datasets is improved by about 3.3%. This proves the effectiveness of this method.

[0054] The above are only preferred embodiments of the present invention. It should be pointed out that, for those skilled in the art, several modifications and improvements can be made without departing from the concept of the present invention. These should also be regarded as the protection scope of the present invention. These will not affect the effect of the implementation of the present invention and the practicality of the patent.

Claims

1. A fake news detection method for unbalanced samples, characterized in that: The following steps are involved: Step S1, word embedding; Use the RoBERTa model to embed words. The RoBERTa model includes three embedding codes: tag embedding, segmentation embedding, and position embedding. Step S2, semantic interaction module; the semantic interaction module consists of RoBERTa embedding code, Transformer encoder and Bi-GRU, which is used to promote semantic interaction between Claim and Article and extract global features; Step S3, gating mechanism module; the gating mechanism module consists of ConvID, BatchNorm, CGU, sigmoid activation function and Dropout layer, which is used to extract local features; Step S4, weight resampling module: set weights and sampling ratios.

2. The fake news detection method for unbalanced samples according to claim 1, characterized in that: The token embedding is a word vector obtained by pre-training RoBERTa based on WordPiece embedding.

3. The fake news detection method for unbalanced samples according to claim 1, characterized in that: When processing input text, the RoBERTa model adds a [CLS] flag at the beginning of a word and a [SEP] flag at the end, and converts each word into a corresponding token embedding vector to segment the sentence.

4. The fake news detection method for unbalanced samples according to claim 1, characterized in that: The specific process of step S2 is as follows: First, C n ={c1,c2,…,c n } is regarded as a set of n claim sequences, where L is the maximum sequence length, d is the feature size; each Claim consists of a set of m related articles A m,n Reported that A m,n ={a1,a2,…,a m } is a set of source articles, The embedding code is extracted from the pre-trained language model RoBERTa and passed through the Transformer encoder; the mth vector A of the input text m,n Through the Transformer encoder and the nth vector C n To interact: Among them, vector A m,n As query input, C n As the input of key and value, deep semantic interaction is carried out in the Transformer encoder block. The query, key and value are projected h times by different learnable linear layers; each Transformer encoder consists of a module unit and two sub-layers; after the input vector interacts with other vectors, the related modules are connected: Z1=concat(H1,…,H h )W o Among them, H j =Attention(AW j A ,CW j C ,CW j C ), the linear transformation is Where Z1 is the output vector after concatenation, H1,…,H h They are the multi-head attention mechanism inside the Transformer encoder, A is used as the query input of the Transformer encoder, and C is used as the key and value input of the Transformer encoder. and is the linear transformation parameter; Bi-GRU is used to extract semantic features. The vector Z1 is sent to the Bi-GRU layer for three iterations and normalized. After passing through a Dropout layer, the dimension is reduced by nonlinear transformation.

5. The fake news detection method for unbalanced samples according to claim 1, characterized in that: The specific process of step S3 is as follows: Given an input sequence C n , after being processed by ConvID, it is normalized using BatchNorm: Normalized feature sequence is divided into a hidden state sequence h' and a gated state sequence s': Perform one-dimensional convolution and batch normalization operations on the gated state sequence s' to obtain the normalized gated sequence Normalized gated sequence The nonlinear mapping is performed through the sigmoid activation function to obtain the gating sequence s; the gating sequence s is multiplied by the hidden state sequence h' to obtain the gating feature sequence: The gated feature sequence is sent to the Dropout layer to obtain the final classification label result: Z2 = dropout (gated).

6. The fake news detection method for unbalanced samples according to claim 1, characterized in that: In step S4, the batch size is set to 128. Within a batch, negative samples are sampled sequentially and positive samples are randomly sampled with a ratio of 7:

3. The class weights are set to [0:0.5, 1:0.55] using grid search parameters.

Citation Information

Patent Citations

  • False news detection system and method based on evidence perception hierarchical interaction attention network

    CN111581979A

  • Multi-modal false news detection method based on user cognition consistency reasoning

    CN115964482A

  • False news detection method based on multi-modal Transform

    CN115982350A

  • Multi-modal false news detection method based on multi-level semantic enhancement

    CN117315695A

  • Emotion-fused common attention network multi-mode false news detection method

    CN117391051A