A rumor detection method and system based on content and feature differences
By using the BERT model and an improved convolutional neural network combined with the attention mechanism, the problem of the differences between the original text of social media events and the comment text being ignored was solved, achieving more efficient rumor detection results.
Patent Information
- Application Number
- CN202111313004.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-08
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2041-11-08
AI Technical Summary
Existing rumor detection methods fail to effectively consider the differences in content and structure when processing the original text and comment text of social media events, resulting in poor detection results.
The BERT pre-trained model is used for data cleaning and vectorization processing, the convolution kernel size of the convolutional neural network is improved, and the attention mechanism is introduced to perform feature extraction and classification on the original text and comment text respectively.
The accuracy, precision, recall rate and F1 value of rumor detection have been significantly improved, and the classification performance of the model has been improved.
Smart Images

Figure CN114036259B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a rumor detection method and system based on content and feature differences. Background Art
[0002] In the information age, more and more people share and obtain information on social media. This information is often mixed with rumors, which greatly affects people's daily lives. Some even cause social panic and affect social stability.
[0003] Currently, most methods for rumor detection are divided into rumor detection methods based on traditional machine learning models and rumor detection methods based on deep learning models.
[0004] Most rumor detection methods based on traditional machine learning models focus their research on the design of artificial features for the content, user, and propagation characteristics of events. Features are mainly calculated by artificially designing features for the content, user, and propagation of events, and traditional machine learning classifiers are used to complete the classification of events. For example, the Chinese patent: A Weibo rumor identification method based on LDA and random forest (patent application number: 201711483228.0) uses a linear discriminant analysis model to extract artificially designed features, and completes the classification of Weibo events through a random forest classifier model. However, this patent has shortcomings: 1. The method of manually designing features can only extract surface features, with poor feature representation capabilities and weak generalization capabilities. 2. The classification performance of traditional machine learning models is poor.
[0005] Rumor detection methods based on deep learning models mostly use pre-trained models to convert text information into vectors and then use neural network models to automatically extract features from these vectors. Current pre-trained models include one-hot encoding, Word2Vec, and BERT. Compared to one-hot encoding and Word2Vec, BERT, by increasing model depth and other factors, better captures the contextual semantic information within text data, significantly enhancing its ability to represent textual information. Current neural network models primarily include convolutional neural networks and recurrent neural networks. Convolutional neural networks can significantly reduce data size while preserving information to the greatest extent possible, while recurrent neural networks can process data with sequential structures. Compared to traditional machine learning models, deep learning models rely less on artificial features, have better generalization capabilities, and offer superior classification performance. However, most current deep learning models fail to account for the heterogeneity of event text information. For example, the Chinese patent "A Social Network Rumor Detection Method Based on CNN Optimization" (Patent Application No.: 201811168129.8) integrates event content and temporal information, using a convolutional network model for multi-layer training to extract features and ultimately classify rumor events. However, this patent has shortcomings: 1. The technology uses only a single convolutional neural network model for feature extraction of event text information, resulting in weak feature representation capabilities. 2. The technology uses the same model to process both the original text and comment text in the event text, failing to consider the differences in content and structure between the two types of information. Summary of the Invention
[0006] Purpose of the invention: To clean up the text information of social media events, we found that there are significant differences in text length and content between the original text of the event and the comment text.
[0007] In terms of text length: the average length of the original event text is 90.7, with the longest being 156; the average length of the event comment text is 14.9, with the longest being 280. It can be seen that the average length of the original event text and the comment text differs by nearly 6 times, and the longest length differs by nearly 2 times.
[0008] In terms of textual content: The original text of an event often consists of expositions of viewpoints on the event theme, quotations from other viewpoints, and is strongly related to the event theme. Commentary on an event, however, can take many forms, including questions and corrections that are highly relevant to the event theme, as well as emojis, comments on other topics, and irrelevant comments that are less relevant or even completely unrelated to the event theme.
[0009] To address the technical issues presented in the background art, the present invention proposes a rumor detection method and system based on content and feature diversity. This method addresses the drawback of current rumor detection methods based on deep learning models, which ignore the differences in content and structure between different textual information within an event, thus impacting detection effectiveness. Compared to existing benchmark methods, the rumor detection model proposed in this invention significantly improves the accuracy, precision, recall, and F1 score of rumor detection.
[0010] The present invention comprises the following steps:
[0011] Step 1: Use crawler technology to obtain event information from social media platforms and construct an event dataset E = {e1, e2, e3, …, e N}, e N Indicates the Nth event, where N is a natural number;
[0012] Step 2: The acquired event text information is divided into original text information and comment text information according to categories, and the original text sentence vector and comment sentence vector of the event are obtained through preprocessing methods respectively;
[0013] Step 3: For the original sentence vector of the event, obtain the event original text representation features through the event original text processing model;
[0014] Step 4: For the event comment sentence vector, obtain the event comment representation features through the event comment processing model;
[0015] Step 5: The event text representation features obtained in step 3 and the event comment representation features obtained in step 4 are used to obtain a predicted classification of the event through the event classification output model to determine whether the event is a rumor.
[0016] Step 2 includes: defining the rumor detection task as: the i-th event e i The text information is divided into original text information and comment text information according to the category, which is represented by e i ={m0 i ,m1 i ,m2 i ,m3 i ,…,m M i}, where m0 i for e i The original text information, {m1 i ,m2 i ,m3 i ,…,m M i} is e i Comment text information, M is e i The number of comment text information, mM i Indicates e i The Mth comment text information, i is [1, N];
[0017] For event e i All text information is first preprocessed, including data cleaning, data enhancement and vectorization processing. In the data cleaning part, regular expressions are used to remove URLs, numbers, and "@forward" information in the text data; the original text data in the dataset and the text data with too few comments on some events are enhanced. For example, the number of comments on individual events is only in the single digit, or there are no comments at all. For very few events without comments, the original text of the event is used as one comment text for the event. For the original text information with only 1 number in the event and the comment text information with only a single digit number of comments, the text is replaced with synonyms by vocabulary replacement, the text is converted into other languages and then converted back into Chinese text by back translation, and the words in the text are randomly replaced with random typos by random noise injection; in the vectorization processing part, the event e is pre-trained by the BERT (Bidirectional Encoder Representation from Transformers) model. i The text information of {m0 i ,m1 i ,m2 i ,m3 i ,…,m M i}, are converted into sentence vectors {v0 i ,v1 i ,v2 i ,v3 i ,…,v M i}, v0 i Represents the event original sentence vector, {v1 i ,v2 i ,v3 i ,…,v M i} represents the event comment sentence vector, v M i Indicates e i The Mth review sentence vector.
[0018] Step 3 includes: improving the convolution layer of the text convolutional neural network model, setting the length of the convolution kernel to 768, which is the same as the sentence vector, and fixing its width to 1 to ensure the structural feature integrity of the event sentence vector; according to the event original sentence vector v0 iThe input matrix I0 is constructed with the sentence vector added after data enhancement. First, the convolution layer is used to perform convolution calculation using the improved convolution kernel to obtain the feature column vector output by the convolution layer. Then, the feature column vector matrix T0 of the convolution layer is obtained by splicing in the vertical direction. i :
[0019] T0 i =f(W0×I0+b0)
[0020] Where W0 is the weight matrix, b0 is the bias, and f is the Relu activation function;
[0021] Then, through the pooling layer, the maximum pooling method is used to retain the feature with the largest value in each column of the feature column vector matrix, and the event e is obtained. i The original text representation feature p0 i .
[0022] Step 4 includes: according to event e i The comment sentence vector {v1 i ,v2 i ,v3 i ,…,v M i}Construct the input matrix I1, construct the layer through the comment feature sequence, and obtain the event comment feature sequence {s1 i ,s2 i ,3 i ,…,s M i}, s M i Indicates e i The Mth comment feature sequence;
[0023] The comment feature sequence construction layer is specifically manifested as: i The comment sentence vector {v1 i ,v2 i ,v3 i ,…,v M i}, first pass the convolution layer, use the improved convolution kernel to perform convolution calculation, get the feature column vector output by the convolution layer, and then splice it in the vertical direction to get the feature column vector matrix T1 i :
[0024] T1 i =f(W1×I1+b1)
[0025] Where W1 is the weight matrix and b1 is the bias;
[0026] Finally, the characteristic column vector matrix T1 iSplit horizontally to obtain the event comment feature sequence {s1 i ,s2 i , 3 i ,…,s M i};
[0027] Then the event e is converted to i The comment feature sequence {s1 i ,s2 i , s3 i ,…,s M i}Learn in both the forward and backward directions to obtain the forward hidden layer features {h f 1,i ,h f 2,i ,h f 3,i ,…,h f M,i} and the backward hidden layer features {h b 1,i ,h b 2,i ,h b 3,i ,…,h b M,i}, then concatenate the two hidden layer features corresponding to each event comment feature sequence to obtain the output feature of the bidirectional gated recurrent unit {h1 i ,h2 i ,h3 i ,…,h M i}, and finally the attention layer distributes the attention weights on the output features to obtain the event e i Comments characterization feature p1 i :
[0028]
[0029]
[0030] h i j =(h f j,i ,h b j,i ),j∈[1,M]
[0031] u i j =tanh(W a h i j +ba )
[0032]
[0033] p1 i =Σa i j ·h i j
[0034] in, Represented as a forward gated recurrent unit for input feature s i j training; Represented as a backward gated recurrent unit for input feature s i j training;
[0035] s i j Indicates e i The j-th comment feature sequence;
[0036] h f j,i Represents the hidden features of the i-th event and j-th comment information in the forward gated recurrent unit;
[0037] h b j,i Represents the hidden features of the i-th event and j-th comment information in the backward gated recurrent unit;
[0038] h i j Represents the output features of the bidirectional gated recurrent unit for the i-th event and the j-th comment information;
[0039] u i j Indicates h i j The attention layer hidden features, W a is the weight matrix, b a is the bias, tanh is the activation function;
[0040] a i j Indicates u i j The attention weight value, where u w is the weight matrix;
[0041] p1 i Represents the characteristic features of the i-th event comment.
[0042] Step 5 includes: i The original text representation feature p0i and comment representation feature p1 i Perform feature splicing to obtain event e i Characterization feature p i , through the fully connected layer, the representation features are fully connected with the classification category L = {R, N}, where R represents rumor and N represents non-rumor. The evaluation values of the event in the rumor category and the non-rumor category are obtained respectively. Finally, the softmax function is used to obtain the predicted value of the event classification. The category with the largest predicted value is selected as the classification of the event to complete the rumor detection task:
[0043] p i =(p0 i ,p1 i )
[0044] The present invention also provides a rumor detection system based on content and feature differences, including an event information acquisition module, an event preprocessing module and an event detection module;
[0045] The event information acquisition module uses crawler technology, Python as the crawler language, and Scrapy as the crawler framework to obtain JSON-formatted event information stored in the form of key-value pairs on the social media platform, where the key is the information item and the value is specific information, for example: {"eid":"100310980","text":"This is not true."};
[0046] The event preprocessing module divides the event text information into original text information and comment text information according to the event original text and comment category based on the event information obtained by the event information acquisition module, and then preprocesses the text information. Then, the text information is converted into vectors using the BERT pre-trained model to obtain the event original text sentence vector and comment sentence vector;
[0047] The event detection module includes an event text processing model, an event comment processing model, and an event classification output model; the event preprocessing module obtains the original text sentence vector of the event, and obtains the event original text representation feature through the event text processing model; the event preprocessing module obtains the comment sentence vector of the event, and obtains the event comment representation feature through the event comment processing model; finally, through the event classification output model, the representation feature of the event is obtained by feature splicing, and the event is classified through the fully connected layer, and finally the rumor detection task of the event is completed.
[0048] In the preprocessing of event information, vectors converted using the BERT model can improve the representation of text information. Improvements to the convolutional kernels of the text convolutional neural network ensure the integrity of the structural information of each event text sentence vector. Separate models are used for feature extraction of the original text and comment text within an event, fully accounting for the differences in content between different types of information. The introduced attention mechanism enables the model to train on comment information by calculating the weight of each feature value in the representation features output by the bidirectional gated recurrent unit. This allows the model to give different levels of attention to feature values of different influences, fully accounting for the differences in influence among the representation features.
[0049] The event information acquisition module constructs an event data set E={e1, e2, e3, ..., e N}, e N Indicates the Nth event, where N is a natural number.
[0050] The event preprocessing module specifically performs the following steps: The rumor detection task is defined as: the i-th event e i The text information is divided into original text information and comment text information according to the category, which is expressed as
[0051] e i ={m0 i ,m1 i ,m2 i ,m3 i ,…,m M i}, where m0 i for e i The original text information, {m1 i ,m2 i ,m3 i ,…,m M i} is e i Comment text information, M is e i The number of comment text information, m M i Indicates e i The Mth comment text information, i is [1, N];
[0052] For event e i All text information is preprocessed first, including data cleaning, data enhancement and vectorization processing. In the data cleaning part, regular expressions are used to remove URLs, numbers, and @ forwarding information in the text data; in the data enhancement part, the original text data in the dataset and the text data with too few event comments are enhanced; in the vectorization part, the BERT pre-trained model is used to transform the event e iThe text information of {m0 i ,m1 i ,m2 i ,m3 i ,…,m M i}, are converted into sentence vectors {v0 i ,v1 i ,v2 i ,v3 i ,…,v M i}, v0 i Represents the event original sentence vector, {v1 i ,v2 i ,v3 i ,…,v M i} represents the event comment sentence vector, v M i Indicates e i The Mth review sentence vector.
[0053] The event detection module specifically performs the following steps: improving the convolution layer of the text convolutional neural network model, setting the length of the convolution kernel to 768, which is the same length as the sentence vector, and fixing the width to 1 to ensure the structural feature integrity of the event sentence vector; i The input matrix I0 is constructed with the sentence vector added after data enhancement. First, the convolution layer is used to perform convolution calculation using the improved convolution kernel to obtain the feature column vector output by the convolution layer. Then, the feature column vector matrix T0 of the convolution layer is obtained by splicing in the vertical direction. i :
[0054] T0 i =f(W0×I0+b0)
[0055] Where W0 is the weight matrix, b0 is the bias, and f is the Relu activation function;
[0056] Then, through the pooling layer, the maximum pooling method is used to retain the feature with the largest value in each column of the feature column vector matrix, and the event e is obtained. i The original text representation feature p0 i ;
[0057] According to the event i The comment sentence vector {v1 i ,v2 i ,v3 i ,…,v M i}Construct the input matrix I1, construct the layer through the comment feature sequence, and obtain the event comment feature sequence {s1i ,s2 i ,s3 i ,…,s M i}, s M i Indicates e i The Mth comment feature sequence;
[0058] The comment feature sequence construction layer is specifically manifested as: i The comment sentence vector {v1 i ,v2 i ,v3 i ,…,v M i}, first pass the convolution layer, use the improved convolution kernel to perform convolution calculation, get the feature column vector output by the convolution layer, and then splice it in the vertical direction to get the feature column vector matrix T1 i :
[0059] T1 i =f(W1×I1+b1)
[0060] Where W1 is the weight matrix and b1 is the bias;
[0061] Finally, the characteristic column vector matrix T1 i Split horizontally to obtain the event comment feature sequence
[0062] {s1 i ,s2 i ,s3 i ,…,s M i};
[0063] Then the event e is converted to i The comment feature sequence {s1 i ,s2 i ,s3 i ,…,s M i}Learn in both the forward and backward directions to obtain the forward hidden layer features {h f 1,i ,h f 2,i ,h f 3,i ,…,h f M,i} and the backward hidden layer features {h b 1,i , h b 2,i , h b 3,i,…,h b M,i}, then concatenate the two hidden layer features corresponding to each event comment feature sequence to obtain the output feature of the bidirectional gated recurrent unit {h1 i ,h2 i ,h3 i ,…,h M i}, and finally the attention layer distributes the attention weights on the output features to obtain the event e i Comments characterization feature p1 i :
[0064]
[0065]
[0066] h i j =(h f j,i ,h b j,i ),j∈[1,M]
[0067] u i j =tanh(W a h i j +b a )
[0068]
[0069] p1 i =Σa i j ·h i j
[0070] in, Represented as a forward gated recurrent unit for input feature s i j training; Represented as a backward gated recurrent unit for input feature s i j training;
[0071] s i j Indicates e i The j-th comment feature sequence;
[0072] h f j,i Represents the hidden features of the i-th event and j-th comment information in the forward gated recurrent unit;
[0073] h b j,i Represents the hidden features of the i-th event and j-th comment information in the backward gated recurrent unit;
[0074] h i j Represents the output features of the bidirectional gated recurrent unit for the i-th event and the j-th comment information;
[0075] u i j Indicates h i j The attention layer hidden features, W a is the weight matrix, b a is the bias, tanh is the activation function;
[0076] a i j Indicates u i j The attention weight value, where u w is the weight matrix;
[0077] p1 i represents the characteristic features of the i-th event comment;
[0078] The event e i The original text representation feature p0 i and comment representation feature p1 i Perform feature splicing to obtain event e i Characterization feature p i , through the fully connected layer, the representation features are fully connected with the classification category L = {R, N}, where R represents rumor and N represents non-rumor. The evaluation values of the event in the rumor category and the non-rumor category are obtained respectively. Finally, the softmax function is used to obtain the predicted value of the event classification. The category with the largest predicted value is selected as the classification of the event to complete the rumor detection task:
[0079] p i =(p0 i ,p1 i ).
[0080] The above improvements enhance the classification performance of the model and greatly improve the accuracy, precision, recall rate and F1 value of rumor detection.
[0081] Compared with the prior art, the present invention has the following technical advantages:
[0082] (1) The data preprocessing of the present invention includes three parts: data cleaning, data enhancement and vectorization processing. In the data enhancement part, the present invention adopts the method of vocabulary replacement to replace synonyms in the text, adopts the method of back translation to convert the text into other languages and then convert it back into Chinese text, and adopts the method of random noise injection to randomly replace words in the text with random typos. The above methods are used to increase text data and improve the robustness of the neural network model; in the vectorization processing part, the BERT model is used as the pre-training model of the present invention to convert each text data in the event into a sentence vector with a fixed length of 768 dimensions. Compared with the one-hot encoding and Word2Vec models, the BERT model can capture contextual information with a longer span by increasing the number of layers, improve the representation ability of text information, and improve the classification performance of the model.
[0083] (2) The present invention extracts features from the original text information and comment text information in the event by considering the content differences. For the original text information of the event, features are extracted through the event original text processing model to obtain the event original text representation features; for the comment text information of the event, features are extracted through the event comment processing model to obtain the event comment representation features. Through the event classification output model, the event original text representation features and the event comment representation features are feature spliced to obtain the event representation features, and then the evaluation value of the event classification of the model of the present invention is obtained through the fully connected layer. Finally, the predicted value of the event classification of the model of the present invention is obtained through the softmax function, and the category with the largest predicted value is selected as the classification of the event.
[0084] Different types of models are used to extract features from different types of information in an event, thereby enhancing the feature characterization capability of the event characterization features, and optimizing the parameters of the model of the present invention, thereby improving the classification performance of the model.
[0085] (3) According to the characteristics of the preprocessing model, the convolution kernel size of the text convolutional neural network model is improved, and the width of the convolution kernel is fixed to 1.
[0086] By fixing the width of the convolution kernel to 1, the convolution kernel only calculates one sentence vector in each convolution, without losing the structural feature information of the sentence vector representing the event text, ensuring the integrity of the structural information of each event sentence vector and improving the classification performance of the model.
[0087] (4) Based on the consideration of the differences in event content, the attention mechanism is introduced to consider the influence of the representation features differently. The introduced attention mechanism enables the model to pay different attention to the feature values with different influences in the representation features by calculating the weight of each feature value during the learning and training process, thereby improving the representation ability of the event comment representation features extracted by the model and improving the classification performance of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0088] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, and the above and other advantages of the present invention will become more apparent.
[0089] Figure 1 It is a flow chart of the rumor detection method.
[0090] Figure 2 It is a module diagram of the rumor detection system.
[0091] Figure 3 It is a structural diagram of comment feature sequence construction.
[0092] Figure 4 This is the structure diagram of the attention mechanism. DETAILED DESCRIPTION
[0093] like Figure 1 、 Figure 2 、 Figure 3 、 Figure 4 As shown, the present invention provides a rumor detection method and system based on content and feature differences, wherein the method includes:
[0094] Step 1: Use crawler technology to obtain event information from social media platforms and construct an event dataset E = {e1, e2, e3, …, e N}, e N Indicates the Nth event, where N is a natural number;
[0095] Step 2: The acquired event text information is divided into original text information and comment text information according to categories, and the original text sentence vector and comment sentence vector of the event are obtained through preprocessing methods respectively;
[0096] Step 3: For the original sentence vector of the event, obtain the event original text representation features through the event original text processing model;
[0097] Step 4: For the event comment sentence vector, obtain the event comment representation features through the event comment processing model;
[0098] Step 5: The event text representation features obtained in step 3 and the event comment representation features obtained in step 4 are used to obtain a predicted classification of the event through the event classification output model to determine whether the event is a rumor.
[0099] Step 2 includes: defining the rumor detection task as: the i-th event e i The text information is divided into original text information and comment text information according to the category, which is represented by e i ={m0 i ,m1 i,m2 i ,m3 i ,…,m M i}, where m0 i for e i The original text information, {m1 i ,m2 i ,m3 i ,…,m M i} is e i Comment text information, M is e i The number of comment text information, m M i Indicates e i The Mth comment text information, i is [1, N];
[0100] For event e i All text information is first preprocessed, including data cleaning, data enhancement and vectorization processing. In the data cleaning part, regular expressions are used to remove URLs, numbers, and @ forwarding information in the text data; in the data enhancement part, the original text data in the dataset and the text data of some events with too few comments are enhanced. For example, the number of comments on individual events is only in the single digit, or there are no comments at all. For very few events without comments, the original text of the event is used as one comment text for the event. For the original text information with only 1 number in the event and the comment text information with only a single digit number of comments, the text is replaced with synonyms by vocabulary replacement, the text is converted into other languages and then converted back into Chinese text by back translation, and the words in the text are randomly replaced with random typos by random noise injection; in the vectorization processing part, the event e is pre-trained by the BERT (BidirectionalEncoder Representation from Transformers) model. i The text information of {m0 i ,m1 i ,m2 i ,m3 i ,…,m M i}, are converted into sentence vectors {v0 i ,v1 i ,v2 i ,v3 i ,…,v M i}, v0 i Represents the event original sentence vector, {v1 i , v2 i ,v3i ,…,v M i} represents the event comment sentence vector. M i Indicates e i The Mth review sentence vector.
[0101] Step 3 includes: improving the convolution layer of the text convolutional neural network model, setting the length of the convolution kernel to 768, which is the same as the sentence vector, and fixing its width to 1 to ensure the structural feature integrity of the event sentence vector; according to the event original sentence vector v0 i The input matrix I0 is constructed with the sentence vector added after data enhancement. First, the convolution layer is used to perform convolution calculation using the improved convolution kernel to obtain the feature column vector output by the convolution layer. After splicing in the vertical direction, the feature column vector matrix T0 output by the convolution layer is obtained. i :
[0102] T0 i =f(W0×I0+b0)
[0103] Where W0 is the weight matrix, b0 is the bias, and f is the Relu activation function;
[0104] Then, through the pooling layer, the maximum pooling method is used to retain the feature with the largest value in each column of the feature column vector matrix, and the event e is obtained. i The original text representation feature p0 i .
[0105] Step 4 includes: according to event e i The comment sentence vector {v1 i ,v2 i ,v3 i ,…,v M i}Construct the input matrix I1, construct the layer through the comment feature sequence, and obtain the event comment feature sequence {s1 i ,s2 i ,s3 i ,…,s M i};s M i Indicates e i The Mth comment feature sequence;
[0106] The comment feature sequence construction layer is specifically manifested as: i The comment sentence vector {v1 i ,v2 i ,v3 i ,…,v M i}, first pass the convolution layer, use the improved convolution kernel to perform convolution calculation, get the feature column vector output by the convolution layer, and then splice it in the vertical direction to get the feature column vector matrix T1 i :
[0107] T1 i =f(W1×I1+b1)
[0108] Where W1 is the weight matrix, b1 is the bias, and f is the Relu activation function;
[0109] Finally, the characteristic column vector matrix T1 i Split horizontally to obtain the event comment feature sequence
[0110] {s1 i ,s2 i ,s3 i ,…,s M i};
[0111] Then the event e is converted to i The comment feature sequence {s1 i ,s2 i ,s3 i ,…,s M i}Learn in both the forward and backward directions to obtain the forward hidden layer features {h f 1,i ,h f 2,i ,h f 3,i ,…,h f M,i} and the backward hidden layer features {h b 1,i ,h b 2,i ,h b 3,i ,…,h b M,i}, then concatenate the two hidden layer features corresponding to each event comment feature sequence to obtain the output feature of the bidirectional gated recurrent unit {h1 i ,h2 i ,h3 i ,…,h M i}, and finally the attention layer distributes the attention weights on the output features to obtain the event e i Comments characterization feature p1 i :
[0112]
[0113]
[0114] h i j =(h f j,i , h b j,i ), j∈[1,M]
[0115] u i j =tanh(W a h i j +ba)
[0116]
[0117] p1 i =∑a i j ·h i j
[0118] in, Represented as a forward gated recurrent unit for input feature s i j training; Represented as a backward gated recurrent unit for input feature s i j training;
[0119] s i j Indicates e i The j-th comment feature sequence;
[0120] h f j , i Represents the hidden features of the i-th event and j-th comment information in the forward gated recurrent unit;
[0121] h b j , i Represents the hidden features of the i-th event and j-th comment information in the backward gated recurrent unit;
[0122] h i j Represents the output features of the bidirectional gated recurrent unit for the i-th event and the j-th comment information;
[0123] u i j Indicates h i j The attention layer hidden features, Wa is the weight matrix, b a is the bias, tanh is the activation function; a i j Indicates u i j The attention weight value, where u w is the weight matrix;
[0124] p1 i Represents the characteristic features of the i-th event comment.
[0125] Step 5 includes: i The original text representation feature p0 i and comment representation feature p1 i Perform feature splicing to obtain event e i Characterization feature p i , through the fully connected layer, the representation features are fully connected with the classification category L = {R, N}, where R represents rumor and N represents non-rumor. The evaluation values of the event in the rumor category and the non-rumor category are obtained respectively. Finally, the softmax function is used to obtain the predicted value of the event classification. The category with the largest predicted value is selected as the classification of the event to complete the rumor detection task:
[0126] p i =(p0 i ,p1 i )
[0127] The present invention also provides a rumor detection system based on content and feature differences, including an event information acquisition module, an event preprocessing module and an event detection module;
[0128] The event information acquisition module uses crawler technology, Python as the crawler language, and Scrapy as the crawler framework to obtain JSON-formatted event information stored in the form of key-value pairs on the social media platform, where the key is the information item and the value is specific information, for example: {"eid":"100310980","text":"This is not true."};
[0129] The event preprocessing module divides the event text information into original text information and comment text information according to the event original text and comment category based on the event information obtained by the event information acquisition module, and then preprocesses the text information. Then, the text information is converted into vectors using the BERT pre-trained model to obtain the event original text sentence vector and comment sentence vector;
[0130] The event detection module includes an event text processing model, an event comment processing model, and an event classification output model; the event preprocessing module obtains the original text sentence vector of the event, and obtains the event original text representation feature through the event text processing model; the event preprocessing module obtains the comment sentence vector of the event, and obtains the event comment representation feature through the event comment processing model; finally, through the event classification output model, the representation feature of the event is obtained by feature splicing, and the event is classified through the fully connected layer, and finally the rumor detection task of the event is completed.
[0131] Example 1:
[0132] In order to verify the performance of the present invention, the dataset constructed by the present invention is the public Sina Weibo dataset provided by [Ma Jing, Gao Wei, Mitra P, et al. Detecting Rumors from Microblogs with Recurrent Neural Networks[C]. Proceedings of the Twenty-Fifth International Joint Conference on Artificial Intelligence (IJCAI), 2016, 3818–3824.]. This dataset uses the Sina Weibo API to obtain event information, as well as information such as forwarding and comments on the event information. The detailed parameters of the dataset are shown in Table 1.
[0133] Table 1 Dataset parameters
[0134] Statistics quantity number of events 4664 Number of rumors 2313 Number of non-rumors 2351 Number of Weibo posts 3805656 Number of users 2746818 Average duration of events (hours) 2460.7 Average number of posts per event 816 Maximum number of posts for an event 59318 Minimum number of posts for an event 10
[0135] In order to evaluate the effectiveness of the model classification performance, this paper selects four evaluation indicators: accuracy, precision, recall rate, and F1 value. The classification basis of the model's predicted category and actual category is shown in Table 2.
[0136] Table 2 Classification basis
[0137] Predictions are rumors Predicted to be non-rumor Actually a rumor TP FN Actually not a rumor FP TN
[0138] The baseline methods selected in this method are four rumor detection methods that also use the same dataset, namely the DT-RANK method proposed by [Zhao Z, Resnick P, Mei Q, et al. Enquiring Minds: Early Detection of Rumors in Social Media from Enquiry Posts[C]. Proceedings of the 24th International Conference on World Wide Web, 2015: 1395-1405.], the SVM-TS method proposed by [Ma J, Gao W, Wei Z, et al. Detect Rumors Using Time Series of Social Context Information on Microblogging Websites[J]. Proceedings of the 24th ACM International onConference on Informatio n and Knowledge Management, 2015: 1751-1754.], and the SVM-TS method proposed by [Ma J, Gao W, Mitra P, et al. Detecting rumors from microblogs with recurrent neural networks[C]. Proceedings of the 25th International JointConference on Artificial Intelligence. Intelligence, 2016:3818-3824.] The GRU-2 method proposed by [LiuYang,Wu Yi-fang.Early detection of fake news on social media throughpropagation path Classification with Recurrent and C onvolutional Networks[C].Proceedings of the Association for the Advancement of The PPC_RNN+CNN method proposed by Artificial Intelligence, 2018, 354-361.].
[0139] In the training setup of the model presented in this paper, 75% of the dataset is used as the training set, 10% as the validation set, and 15% as the test set. The model is trained on the training set events until the model converges, then stops training. The validation set events are then used to adjust the model parameters to improve the model's classification performance. Finally, the test set events are used to evaluate the model's classification performance.
[0140] We conducted extensive tuning experiments on the number of convolution kernels, the number of original input sentence vectors, and the number of bidirectional gated recurrent units. The results are as follows:
[0141] The number of convolution kernels is set to 200: Increasing the number of convolution kernels will increase the training time of the model, and as the number of convolution kernels further increases, the increment of training time also increases. The detection accuracy of the model of the present invention reaches its maximum value when the number of convolution kernels increases to 200. Further increase will reduce the detection accuracy. Analysis of the reasons: When the number of convolution kernels is too small, the computational complexity of the neural network model is small and the training time is short, but the insufficient feature extraction amount can easily cause underfitting and affect the detection accuracy; when the number of convolution kernels is too large, the feature extraction amount is too large, which will significantly increase the training time and easily cause overfitting and affect the detection accuracy.
[0142] The number of sentence vectors in the original event input matrix was set to 10: including one original event, three back-translations of the original event in Japanese, English, and German, and six misspellings. Results showed that increasing the amount of original sentence vectors had little impact on model performance. Specifically, increasing the amount of original sentence vectors had little impact on training time and slightly improved model detection accuracy. When the number of sentence vectors in the original text input matrix reached 10, detection accuracy reached its maximum, and further increasing it had little effect on detection accuracy.
[0143] The number of bidirectional gated recurrent units (BGRUs) was set to 80, corresponding to the number of sentence vectors in the event comment input matrix. Increasing the number of BGRUs significantly impacts model performance, increasing training time and improving detection accuracy. When the number of BGRUs was 80, detection accuracy reached its maximum, and further increasing the number of BGRUs had little effect.
[0144] The rumor detection results are shown in Table 3.
[0145] Table 3 Rumor detection results
[0146]
[0147] It can be seen from the rumor detection results that the accuracy of SVM-TS in the traditional machine learning method is only 0.857, and the classification performance is relatively weak. The accuracy of PPC_RNN+CNN in the deep learning method reached 0.916, and the classification performance was significantly improved compared to the traditional machine learning method. The present invention, by considering the differences in text content and features, selected the BERT pre-training model and improved the convolution kernel size of the text convolutional neural network. The accuracy index in the rumor detection experiment reached 0.972, which is 5.6% higher than the selected benchmark method. In addition, the precision index of rumors and non-rumors reached 0.968 and 0.976 respectively, the recall index of rumors and non-rumors reached 0.977 and 0.968 respectively, and the precision index of rumors and non-rumors reached 0.972 and 0.972 respectively, all of which were significantly improved.
[0148] The present invention provides a rumor detection method and system based on content and feature differences. There are numerous methods and approaches for implementing this technical solution. The above is merely a preferred embodiment of the present invention. It should be noted that those skilled in the art may make improvements and modifications without departing from the principles of the present invention, and such improvements and modifications are considered within the scope of protection of the present invention. Any components not specified in this embodiment may be implemented using existing technologies.
Claims
1. A rumor detection method based on content and feature differences, characterized in that: The following steps are involved: Step 1: Use crawler technology to obtain event information from social media platforms and construct an event dataset E = {e1, e2, e3, …, e N }, e N Indicates the Nth event, where N is a natural number; Step 2: The acquired event text information is divided into original text information and comment text information according to categories, and the original text sentence vector and comment sentence vector of the event are obtained through preprocessing methods respectively; Step 3: For the original sentence vector of the event, obtain the event original text representation features through the event original text processing model; Step 4: For the event comment sentence vector, obtain the event comment representation features through the event comment processing model; Step 5: The event text representation features obtained in step 3 and the event comment representation features obtained in step 4 are used to obtain a predicted classification of the event through the event classification output model to determine whether the event is a rumor; Step 2 includes: defining the rumor detection task as: the i-th event e i The text information is divided into original text information and comment text information according to the category, which is represented by e i ={m0 i ,m1 i ,m2 i ,m3 i ,…,m M i }, where m0 i for e i The original text information, {m1 i ,m2 i ,m3 i ,…,m M i } is e i Comment text information, M is e i The number of comment text information, m M i Indicates e i The Mth comment text information, i is [1, N]; Step 2 also includes: for event e i All text information is preprocessed first, including data cleaning, data enhancement and vectorization processing. In the data cleaning part, regular expressions are used to remove URLs, numbers, and @ forwarding information in the text data; in the data enhancement part, the original text data in the dataset and the text data with too few event comments are enhanced; in the vectorization part, the BERT pre-trained model is used to transform the event e i The text information of {m0 i ,m1 i ,m2 i ,m3 i ,…,m M i }, are converted into sentence vectors {v0 i ,v1 i ,v2 i ,v3 i ,…,v M i }, v0 i Represents the event original sentence vector, {v1 i ,v2 i ,v3 i ,…,v M i } represents the event comment sentence vector, v M i Indicates e i The Mth comment sentence vector; Step 3 includes: improving the convolutional layer of the text convolutional neural network model, setting the length of the convolution kernel to 768, which is the same as the sentence vector, and fixing the width to 1 to ensure the structural integrity of the event sentence vector; according to the event original sentence vector v0 i The input matrix I0 is constructed with the sentence vector added after data enhancement. First, the convolution layer is used to perform convolution calculation using the improved convolution kernel to obtain the feature column vector output by the convolution layer. Then, the feature column vector matrix T0 of the convolution layer is obtained by splicing in the vertical direction. i : T0 i =f(W0×I0+b0) Where W0 is the weight matrix, b0 is the bias, and f is the Relu activation function; Then, through the pooling layer, the maximum pooling method is used to retain the feature with the largest value in each column of the feature column vector matrix, and the event e is obtained. i The original text representation feature p0 i ; Step 4 includes: according to event e i The comment sentence vector {v1 i ,v2 i ,v3 i ,…,v M i }Construct the input matrix I1, construct the layer through the comment feature sequence, and obtain the event comment feature sequence {s1 i ,s2 i ,s3 i ,…,s M i }, s M i Indicates e i The Mth comment feature sequence; The comment feature sequence construction layer is specifically manifested as: i The comment sentence vector {v1 i ,v2 i ,v3 i ,…,v M i }, first pass the convolution layer, use the improved convolution kernel to perform convolution calculation, get the feature column vector output by the convolution layer, and then splice it in the vertical direction to get the feature column vector matrix T1 i : T1 i =f(W1×I1+b1) Where W1 is the weight matrix and b1 is the bias; Finally, the characteristic column vector matrix T1 i Split horizontally to obtain the event comment feature sequence {s1 i ,s2 i ,s3 i ,…,s M i }; Then the event e is converted to i The comment feature sequence {s1 i ,s2 i ,s3 i ,…,s M i }Learn in both the forward and backward directions to obtain the forward hidden layer features {h f 1,i ,h f 2,i ,h f 3,i ,…,h f M,i } and the backward hidden layer features {h b 1,i ,h b 2,i ,h b 3,i ,…,h b M,i }, then concatenate the two hidden layer features corresponding to each event comment feature sequence to obtain the output feature of the bidirectional gated recurrent unit {h1 i ,h2 i ,h3 i ,…,h M i }, and finally the attention layer distributes the attention weights on the output features to obtain the event e i Comments characterization feature p1 i : h i j =(h f j,i ,h b j,i ),j∈[1,M] u i j =tanh(W a h i j +b a ) p1 i =∑a i j ·h i j in, Represented as a forward gated recurrent unit for input feature s i j training; Represented as a backward gated recurrent unit for input feature s i j training; s i j Indicates e i The j-th comment feature sequence; h f j,i Represents the hidden features of the i-th event and j-th comment information in the forward gated recurrent unit; h b j,i Represents the hidden features of the i-th event and j-th comment information in the backward gated recurrent unit; h i j Represents the output features of the bidirectional gated recurrent unit for the i-th event and the j-th comment information; u i j Indicates h i j The attention layer hidden features, W a is the weight matrix, b a is the bias, tanh is the activation function; a i j Indicates u i j The attention weight value, where u w is the weight matrix; p1 i represents the characteristic features of the i-th event comment; Step 5 includes: i The original text representation feature p0 i and comment representation feature p1 i Perform feature splicing to obtain event e i Characterization feature p i , through the fully connected layer, the representation features are fully connected with the classification category L = {R, N}, where R represents rumor and N represents non-rumor. The evaluation values of the event in the rumor category and the non-rumor category are obtained respectively. Finally, the softmax function is used to obtain the predicted value of the event classification. The category with the largest predicted value is selected as the classification of the event to complete the rumor detection task: p i =(p0 i ,p1 i )。 2. A rumor detection system based on content and feature differences implemented using the method according to claim 1, characterized in that: It includes event information acquisition module, event preprocessing module and event detection module; The event information acquisition module uses crawler technology, Python as the crawler language, and Scrapy as the crawler framework to obtain JSON format event information stored in the form of key-value pairs on the social media platform, where the key is the information item and the value is the specific information; The event preprocessing module divides the event text information into original text information and comment text information according to the event original text and comment category based on the event information obtained by the event information acquisition module, and then preprocesses the text information. Then, the text information is converted into vectors using the BERT pre-trained model to obtain the event original text sentence vector and comment sentence vector; The event detection module includes an event text processing model, an event comment processing model, and an event classification output model. The event preprocessing module obtains the event text sentence vector, and obtains the event text representation features through the event text processing model. The event preprocessing module obtains the event comment sentence vector, and the event comment representation feature is obtained through the event comment processing model; Finally, the event classification output model is used to obtain the event representation features through feature splicing, and then the event is classified through the fully connected layer, ultimately completing the rumor detection task for the event. The event information acquisition module constructs an event data set E={e1, e2, e3, ..., e N }, e N Indicates the Nth event, where N is a natural number; The event preprocessing module specifically performs the following steps: The rumor detection task is defined as: the i-th event e i The text information is divided into original text information and comment text information according to the category, which is represented by e i ={m0 i ,m1 i ,m2 i ,m3 i ,…,m M i }, where m0 i for e i The original text information, {m1 i ,m2 i ,m3 i ,…,m M i } is e i Comment text information, M is e i The number of comment text information, m M i Indicates e i The Mth comment text information, i is [1, N]; For event e i All text information is preprocessed first, including data cleaning, data enhancement and vectorization processing. In the data cleaning part, regular expressions are used to remove URLs, numbers, and @ forwarding information in the text data; In the data enhancement part, the original text data in the dataset and the text data of some events with too few comments are enhanced; In the vectorization processing part, the event e is transformed into i The text information of {m0 i ,m1 i ,m2 i ,m3 i ,…,m M i }, are converted into sentence vectors {v0 i ,v1 i ,v2 i ,v3 i ,…,v M i }, v0 i Represents the event original sentence vector, {v1 i ,v2 i ,v3 i ,…,v M i } represents the event comment sentence vector, v M i Indicates e i The Mth comment sentence vector; The event detection module specifically performs the following steps: improving the convolutional layer of the text convolutional neural network model, setting the length of the convolution kernel to 768, which is the same length as the sentence vector, and fixing the width to 1 to ensure the structural feature integrity of the event sentence vector; According to the event original sentence vector v0 i The input matrix I0 is constructed with the sentence vector added after data enhancement. First, the convolution layer is used to perform convolution calculation using the improved convolution kernel to obtain the feature column vector output by the convolution layer. Then, the feature column vector matrix T0 of the convolution layer is obtained by splicing in the vertical direction. i : T0 i =f(W0×I0+b0) Where W0 is the weight matrix, b0 is the bias, and f is the Relu activation function; Then, through the pooling layer, the maximum pooling method is used to retain the feature with the largest value in each column of the feature column vector matrix, and the event e is obtained. i The original text representation feature p0 i ; According to the event i The comment sentence vector {v1 i ,v2 i ,v3 i ,…,v M i }Construct the input matrix I1, construct the layer through the comment feature sequence, and obtain the event comment feature sequence {s1 i ,s2 i ,s3 i ,…,s M i }, s M i Indicates e i The Mth comment feature sequence; The comment feature sequence construction layer is specifically manifested as: i The comment sentence vector {v1 i ,v2 i ,v3 i ,…,v M i }, first pass the convolution layer, use the improved convolution kernel to perform convolution calculation, get the feature column vector output by the convolution layer, and then splice it in the vertical direction to get the feature column vector matrix T1 i : T1 i =f(W1×I1+b1) Where W1 is the weight matrix and b1 is the bias; Finally, the characteristic column vector matrix T1 i Split horizontally to obtain the event comment feature sequence {s1 i ,s2 i ,s3 i ,…,s M i }; Then the event e is converted to i The comment feature sequence {s1 i ,s2 i ,s3 i ,…,s M i }Learn in both the forward and backward directions to obtain the forward hidden layer features {h f 1,i ,h f 2,i ,h f 3,i ,…,h f M,i } and the backward hidden layer features {h b 1,i ,h b 2,i ,h b 3,i ,…,h b M,i }, then concatenate the two hidden layer features corresponding to each event comment feature sequence to obtain the output feature of the bidirectional gated recurrent unit {h1 i ,h2 i ,h3 i ,…,h M i }, and finally the attention layer distributes the attention weights on the output features to obtain the event e i Comments characterization feature p1 i : h i j =(h f j,i ,h b j,i ),j∈[1,M] u i j =tanh(W a h i j +b a ) p1 i =∑a i j ·h i j in, Represented as a forward gated recurrent unit for input feature s i j training; Represented as a backward gated recurrent unit for input feature s i j training; s i j Indicates e i The j-th comment feature sequence; h f j,i Represents the hidden features of the i-th event and j-th comment information in the forward gated recurrent unit; h b j,i Represents the hidden features of the i-th event and j-th comment information in the backward gated recurrent unit; h i j Represents the output features of the bidirectional gated recurrent unit for the i-th event and the j-th comment information; u i j Indicates h i j The attention layer hidden features, W a is the weight matrix, b a is the bias, tanh is the activation function; a i j Indicates u i j The attention weight value, where u w is the weight matrix; p1 i represents the characteristic features of the i-th event comment; The event e i The original text representation feature p0 i and comment representation feature p1 i Perform feature splicing to obtain event e i Characterization feature p i , through the fully connected layer, the representation features are fully connected with the classification category L = {R, N}, where R represents rumor and N represents non-rumor. The evaluation values of the event in the rumor category and the non-rumor category are obtained respectively. Finally, the softmax function is used to obtain the predicted value of the event classification. The category with the largest predicted value is selected as the classification of the event to complete the rumor detection task: p i =(p0 i ,p1 i )。
Citation Information
Patent Citations
Microblog rumor recognition method based on LDA and random forest
CN108090046A
A CNN-Optimized Method for Detecting Rumors on Social Networks
CN109325125B
Rumor detection method and system based on microblog event relationship
CN112612970A
Deep learning rumor detection method fusing microblog themes and comments
CN113127643A