Rumor detection method and system based on dynamic multi-hop graph attention network
By using a dynamic multi-hop graph attention network in rumors detection, combining graph convolution network and Transformer model, users and comment information are encoded, and multi-hop attention weight is calculated through graph diffusion, the shortcomings of existing methods in dealing with dynamic post relationships and user behavior are solved, and the accuracy of rumors detection is improved.
Patent Information
- Application Number
- CN202210182172.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-25
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2042-02-25
AI Technical Summary
The existing rumor detection methods are insufficient in dealing with dynamic post relationships and user behaviors, especially in social media. Due to the large number of users and complex behavior relationships, it is difficult for existing methods to effectively extract user characteristics and dissemination path information of posts, resulting in insufficient detection accuracy.
The method based on a dynamic multi-hop graph attention network is adopted to encode user information through a graph convolution network, and the comment information is encoded using the Transformer model, and text encoding, user encoding and comment tree encoding are fused. Then, it is input to the multi-hop graph neural network layer through dynamic grouping, and the attention weight of the multi-hop neighbor is calculated by graph diffusion, and the timing and structural features of the posts during the dissemination process are extracted.
By fully learning the timing and structural characteristics of posts during the dissemination process, the classification accuracy of rumors detection is improved, and the shortcomings of existing methods in dealing with dynamic relationships and user behavior are overcome.
Smart Images

Figure CN114706977B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of natural language processing, and specifically relates to a rumor detection method and system based on a dynamic multi-hop graph attention network. Background Art
[0002] With the development of mobile Internet, social media has brought us convenience in learning and life, but it has also inevitably accelerated the spread of rumors. The proliferation of online rumors not only seriously interferes with people's production and life, but also destroys the social trust system to a certain extent, causing serious negative impacts on society. Although various media organizations have strengthened the monitoring of rumors and opened rumor-refuting platforms, these measures require a lot of manpower and material resources to collect information to verify the authenticity of the news, and there are also problems such as time lag, incomplete information coverage, and event reversal. Therefore, it is necessary to automatically detect rumors in the early stages.
[0003] The rumor detection task is a binary classification problem, that is, judging whether an event or a tweet is a "rumor" or a "non-rumor". Existing research work can be divided into two categories of methods: one is traditional machine learning methods, and the other is deep learning methods. Traditional machine learning methods mainly construct or select appropriate features, such as text content and social network-related information, and then use shallow algorithms such as naive Bayes, decision trees, and support vector machines to detect rumors. Although feature engineering improves the performance of rumor detection, feature selection is time-consuming and laborious, and because feature selection is highly subjective, it is easy to be deliberately circumvented by rumor makers. In recent years, deep learning has shown superior performance in natural language processing, image classification and other fields. Therefore, researchers have applied deep learning models to rumor detection tasks to automatically learn the deep features implied by rumors. Deep learning models are mainly based on convolutional neural networks (CNN), recurrent neural networks (RNN) and graph neural networks (GNN). Convolutional neural networks can only extract local information from texts and perform poorly for long texts. Recurrent neural networks have the problem of gradient disappearance. The advantage of graph neural networks is that they can model the relationship between multiple posts and effectively learn the representation of each node through its neighborhood, thereby improving the model's ability to learn deeper features of posts. However, the generation and spread of rumors is a dynamic process, and most existing graph neural network models are static graph neural network models. Static graph neural networks are only constructed once, and all the nodes composed of posts and the edges composed of post relationships are fixed, which cannot cope with the changes in interactive relationships caused by the increase in posts. At the same time, previous methods only perform simple information extraction on user information, while ignoring the structural characteristics of user relationship networks, such as the relationship network formed by user behavior. Due to the large number of users in social media, the graph generated by user behavior is prone to edge sparsity. Therefore, the method of modeling users needs to overcome the sparsity of edges to extract effective information. In addition, forwarded posts account for a large proportion in social media. Since forwarded posts themselves do not carry additional text information, existing studies often choose to ignore them. However, for forwarded posts, the user information in them is an important difference between forwarded posts and source posts. Ignoring forwarded posts will lead to the inability to fully extract user features of posts, and will also cause the loss of key information such as propagation paths in graph neural networks. Summary of the invention
[0004] The purpose of the present invention is to provide a rumor detection method and system based on a dynamic multi-hop graph attention network, which is conducive to improving the accuracy of rumor detection.
[0005] To achieve the above object, the technical solution adopted by the present invention is: a rumor detection method based on a dynamic multi-hop graph attention network, comprising the following steps:
[0006] Step A: Extract user information, reply information, and forwarding or comment relationships between posts under known events, and mark whether each event is a rumor to construct a training set S;
[0007] Step B: Use the training set S to train a deep learning network model G based on a dynamic multi-hop graph attention network to analyze whether each event is a rumor;
[0008] Step C: The extracted user information, reply information, and relationship between posts are input into the trained deep learning network model G together with the text information of the posts to obtain a prediction of whether each event is a rumor.
[0009] Furthermore, the step B specifically includes the following steps:
[0010] Step B1: Encode each post in the training set S to obtain the text encoding s of each post under the event and the relationship matrix R between posts;
[0011] Step B2: Encode the user information in the training set S, use matrix X to represent the basic information features of the user, use adjacency matrix A to represent the user's behavior features, input them into the graph convolutional network, learn and extract the deep relationship between users, and obtain the user-encoded graph convolution representation vector u;
[0012] Step B3: Encode the reply information in the training set S, input each reply representation vector xij into the attention network, use two additional parameters to learn the structural information of the reply; learn the comment tree information from the post reply information, and obtain the comment tree representation vector c;
[0013] Step B4: The text code s of each post and the corresponding user code u and comment tree code c are fused and spliced to obtain the representation vector h of the post; at the same time, the posts are grouped by fixing the number of posts;
[0014] Step B5: Input the post vector Ti of each group into the multi-hop graph attention network, first calculate the single-hop attention score using the relationship between posts, then calculate the multi-hop attention score using the graph diffusion method, and update the post representation vector; extract the representation vector e of the source post of each group;
[0015] Step B6: Use dot-productattention to calculate the correlation between each group of vectors, introduce mask M to ensure that the prediction of group i depends only on the output before group i, but not on the output after group i; use the Softmax function to normalize the output vector; according to the target loss function loss, use the back propagation method to calculate the gradient of each parameter in the deep learning network model G, and use the stochastic gradient descent method to update the parameters;
[0016] Step B7: When the iterative change of the loss value generated by the deep learning network model G is less than the set threshold or reaches the maximum number of iterations, the training of the deep learning network model G is terminated.
[0017] Furthermore, the step B1 specifically includes the following steps:
[0018] Step B11: traverse the training set S, where the training samples in S are represented as S = (P, y), where P represents the post set, y represents the polarity of rumor detection, and the polarity of rumor detection includes {non-rumor, rumor, true rumor, and unverified rumor}; use the pre-trained distributed representation word vector for each post p in the post set P; the word index x i Find the corresponding unique hot encoding v through the vocabulary i , and then converted into w through the pre-trained word vector i , expressed as:
[0019] w i =Wv i
[0020] Among them, v i Index x for the word i In the one-hot encoding of the vocabulary, W is the d-dimensional word vector matrix;
[0021] Step B12: Use the converted word vector as the input of Text-CNN; use filters with different windows to capture features of different granularities to extract text features; for the i-th word in the post text content, the corresponding k-dimensional word embedding representation is So a sentence with n words is represented as:
[0022]
[0023] in, is a concatenation operator with a window size of h. The convolutional filter takes a continuous sequence of h words in a sentence as input and outputs a feature. For a continuous sequence of h words starting from the i-th word, the filter operation is expressed as:
[0024] s i =ReLU(W c S i:i+h-1 )
[0025] Among them, W c Represents the filter parameters; then obtain the feature representation of the sentence:
[0026] s=[s1,s2,...,s n ].
[0027] Furthermore, the step B2 specifically includes the following steps:
[0028] Step B21: Traverse the training set S, extract the user corresponding to each post in the training set, and construct a user feature matrix U to represent the features of all user nodes. The features include the user's personal information and social information. Where n represents the number of users, m represents the dimension of the user feature matrix, and each row of the matrix are all represented as a user's feature vector; the adjacency matrix A and its degree matrix D are used to represent the user's edge; when user a and user b have a forwarding, commenting relationship or discuss the same post, A ab =1, if user a and user b have no intersection, A ab =0; the degree matrix D is composed of eigenvectors, with D ij =∑ j A ij ;
[0029] Step B22: Perform graph convolution operation using user feature matrix U and adjacency matrix A; for a single convolution, the feature matrix have:
[0030] L (1) =δ(AUW0)
[0031] Where L (0) =X, A is the adjacency matrix, W0 is the weight matrix; δ is an activation function. For multiple convolutions, the node matrix is updated as follows:
[0032] L (j+1) =δ(AL j W j )
[0033] Where j represents the number of convolutional layers.
[0034] Furthermore, the step B3 specifically includes the following steps:
[0035] Step B31: Traverse the training set S, extract the corresponding replies under each post, form a comment tree between the replies, and use the Transformer model to learn the dependencies between the replies; each layer of the Transformer contains a self-attention sublayer and a feedforward sublayer, where the self-attention layer architecture is derived as follows:
[0036]
[0037] The attention weights of elements i and j in the sequence are calculated using the query of i and the key of j;
[0038] Step B32: Aggregate the values of each position to get the output of position i, which is:
[0039]
[0040] Step B33: Each comment reply uses the word embedding vector representation of the comment text. First, for each comment reply x i Perform max-pooling to obtain its sentence representation x' i ; Then the comment sentence representation sequence X' = (x'1, x'2, ..., x' m ) The interaction between tweets is modeled through s MHA layers; after passing through these MHA layers, the output U = (u1,u2,...,u m ), and finally aggregate these outputs through the attention mechanism and connect them using a fully connected layer;
[0041] α k =softmax(γ T u k )
[0042]
[0043] in, k is the number of classes, v is the representation vector of X;
[0044] Step B34: Add and Two additional learned parameters, used to represent the relationship between replies, are:
[0045]
[0046]
[0047] Furthermore, the step B4 specifically includes the following steps:
[0048] Step B41: The text feature s, user feature u and comment tree feature c extracted in steps 2, 3 and 4 are spliced together as fusion features and called post features; considering the different contribution levels of text, user and comment features, attention weights are trained on text features, user features and comment features to enhance the representation of a certain feature;
[0049] α=σ2(σ1(s,u,c);θ1);θ2)
[0050] In addition, the attention is increased by 1 to ensure that the features are not lost; the calculation of training and fusion representation is as follows:
[0051] H=(αT +1)[s,u,c]
[0052] Step B42: Divide the time series data of rumor events according to the number of posts; each event E i , containing the source post h r Other posts related to this event ij ; Since different events have different numbers of posts and time spans, the number of posts in each stage of different events is also different; First, count the number of posts in the event and the start and end time of event-related posts, use normalization to process the time, and calculate the number of posts required for each event interval after dividing into τ time intervals; Then, according to the time of each post, divide the posts into corresponding time intervals; In addition, the posts on the path between the source post and the newly added posts in each time interval are also included. Each time interval can be regarded as a stage of the event, and the stage of each event is expressed as:
[0053] T i ={h i1 ,h i2 ,...,h ik ,h r ,H′}.
[0054] Furthermore, the step B5 specifically includes the following steps:
[0055] Step B51: The vector set T obtained in step 4 i Input into the multi-hop graph attention network, introduce the attention diffusion operator, which is represented as a triple (v i ,e ij ,v j ), calculate the attention score of the directly connected edges Attention diffusion is used to calculate the attention score between pairs of nodes that are not directly connected;
[0056]
[0057] Among them, l represents the number of layers, W h , W t , W e is the trainable weight matrix, h i 、h j is the vector representation of the input node;
[0058] Step B52: Apply the attention diffusion operator to each edge in the graph to obtain its attention score, where the attention score of the edge without direct connection is negative infinity;
[0059]
[0060] Step B53: Normalize the result obtained in step B52 to obtain:
[0061] A (l) =softmax(S (l) )
[0062] Among them, A (l) It represents the attention score at layer l when node j gathers information to node i;
[0063] Step B54: Use graph diffusion to calculate the attention score of multi-hop neighbor relationships:
[0064]
[0065] Among them, θ i =α(1-α) i ,α∈(0,1], α is the bias diffusion parameter; the graph attention diffusion of feature aggregation is defined as follows:
[0066] AttDiffusion(G,H l ,θ)=AH l
[0067] Z 0 =H l
[0068] Z k+1 =(1-α)AZ k +αZ 0
[0069] In which, by defining a sequence Z k Simplifying the calculation, when k→∞, the sequence converges to AH l The value of , achieves the purpose of graph diffusion;
[0070] Step B55: Input the result obtained in step B54 into two fully connected feed-forward sub-layers, adding layer normalization and residual connections in the two sub-layers:
[0071]
[0072]
[0073] Furthermore, the step B6 specifically includes the following steps:
[0074] Step B61: Extract the source post vector representation of each group obtained through attention diffusion H'={h1,h2,...,h τ}, where τ is the number of groups; dot-productattention is used to calculate the correlation between vectors. In addition, a mask M is introduced to ensure that the prediction of group i depends only on the output before group i, but not on the output after group i;
[0075]
[0076]
[0077] Step B62: Use cross entropy as the loss function to calculate the loss value, update the learning rate through the Adam optimization algorithm, and use back propagation to iteratively update the model parameters to minimize the loss function to train the model. The cross entropy loss function is as follows:
[0078]
[0079] Where |C| is the number of rumor detection polarity categories, y i is the rumor detection polarity represented by a one-hot vector, y i is the rumor detection polarity probability distribution obtained by calculating the classification layer, λ is the coefficient of the L2 regularization term, θ is the set of trainable parameters, and the model adopts the dropout strategy to avoid overfitting.
[0080] The present invention also provides a rumor detection system using the above method, comprising:
[0081] The data collection module is used to extract the user information, reply information, and forwarding or comment relationships between posts under each event, and mark whether each event is a rumor to construct a training set;
[0082] The preprocessing module is used to preprocess the training samples in the training set, including word segmentation and removal of stop words;
[0083] The encoding module is used to encode the text information, user information, and comment information of the post, obtain the corresponding representation vectors of text encoding, user encoding, and comment tree encoding, and perform splicing and fusion;
[0084] A network training module is used to input the post vector obtained by the encoding module into the deep learning network, obtain the source post representation vector of each stage through graph diffusion and use it to train the deep learning network, use the probability of the representation vector belonging to a certain category and the annotations in the training set as the loss, and train the entire deep learning network with the goal of minimizing the loss to obtain a rumor detection model based on a dynamic multi-hop graph attention network; and
[0085] The rumor detection module extracts the text, user and comment information of the rumor detection input, and then uses the trained rumor detection model based on the dynamic multi-hop graph attention network to analyze and process the input post related information, and outputs the polarity of the rumor detection.
[0086] Compared with the prior art, the present invention has the following beneficial effects: the present invention uses a graph convolutional network to encode user information, uses a Transformer to encode comment information, and then concatenates and fuses the text encoding, user encoding, and comment tree encoding. At the same time, they are input into the multi-hop graph neural network layer through dynamic grouping, and the graph diffusion method is used to obtain the attention weights of multi-hop neighbors. The present invention can fully learn the temporal characteristics of posts in the process of propagation and the structural characteristics between posts, and effectively improve the accuracy of rumor detection and classification. BRIEF DESCRIPTION OF THE DRAWINGS
[0087] Figure 1 is a flow chart of a method implementation of an embodiment of the present invention;
[0088] Figure 2 This is a model architecture diagram in an embodiment of the present invention; DETAILED DESCRIPTION
[0089] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0090] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.
[0091] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0092] like Figure 1 As shown, this embodiment provides a rumor detection method based on a dynamic multi-hop graph attention network, comprising the following steps:
[0093] Step A: Extract user information, reply information, and forwarding or comment relationships between posts under known events, and mark whether each event is a rumor to construct a training set S.
[0094] Step B: Use the training set S to train a deep learning network model G based on a dynamic multi-hop graph attention network to analyze whether each event is a rumor. In this embodiment, the deep learning network model architecture is as follows: Figure 2 shown.
[0095] The step B specifically comprises the following steps:
[0096] Step B1: Encode each post in the training set S to obtain the text encoding s of each post under the event and the relationship matrix R between posts.
[0097] In this embodiment, step B1 specifically includes the following steps:
[0098] Step B11: Traverse the training set S, where the training samples in S are represented as S = (P, y), where P represents the post set, and y represents the polarity of rumor detection, which includes {non-rumor, rumor, true rumor, and unverified rumor}. For each post p in the post set P, use the pre-trained distributed representation word vector. Word index x i Find the corresponding unique hot encoding v through the vocabulary i , and then converted into w through the pre-trained word vector i , expressed as:
[0099] w i =Wv i
[0100] Among them, v i Index x for the word i In the one-hot encoding of the vocabulary, W is a d-dimensional word vector matrix.
[0101] Step B12: Use the converted word vector as the input of Text-CNN. Filters with different windows are used to capture features of different granularities to extract text features. For the i-th word in the post text content, the corresponding k-dimensional word embedding representation is So a sentence with n words is represented as:
[0102]
[0103] in, is a concatenation operator with a window size of h. The convolution filter takes a continuous sequence of h words in a sentence as input and outputs a feature. To clearly show the process, a continuous sequence of h words starting from the i-th word is taken as an example. The filter operation is expressed as:
[0104] s i =ReLU(W c S i:i+h-1 )
[0105] Among them, W c Represents the filter parameters. The filter can also be applied to other words. Then the feature representation of the sentence is obtained:
[0106] s=[s1,s2,...,s n ].
[0107] Step B2: Encode the user information in the training set S, use matrix X to represent the basic information features of the user, use adjacency matrix A to represent the user's behavioral features, input them into the graph convolutional network, learn and extract the deep relationship between users, and obtain the user-encoded graph convolution representation vector u.
[0108] In this embodiment, step B2 specifically includes the following steps:
[0109] Step B21: Traverse the training set S, extract the user corresponding to each post in the training set, and construct a user feature matrix U to represent the features of all user nodes. The features include the user's personal information and social information, such as the user's nickname, whether it is authenticated, the number of followers, the number of fans, the registration time, etc. n represents the number of users, m represents the dimension of the user feature matrix, and each row of the matrix are all represented as a user's feature vector. The user's edge is represented by the adjacency matrix A and its degree matrix D. When user a and user b have a forwarding, commenting relationship or discuss the same post, A ab =1, if user a and user b have no intersection, A ab = 0. The degree matrix D is composed of eigenvectors, with D ij =∑ j A ij .
[0110] Step B22: Perform graph convolution operation using user feature matrix U and adjacency matrix A. For a single convolution, the feature matrix have:
[0111] L (1) =δ(AUW0)
[0112] Where L (0) =X, A is the adjacency matrix, W0 is the weight matrix. δ is an activation function, ReLU is usually selected as the activation function. For multiple convolutions, the node matrix is updated as follows:
[0113] L (j+1) =δ(AL (j) W j )
[0114] Where j represents the number of convolutional layers.
[0115] Step B3: Encode the reply information in the training set S and represent each reply with a vector x ij Input into the attention network, use two additional parameters to learn the structural information of the reply. Learn the comment tree information from the post reply information and get the comment tree representation vector c.
[0116] In this embodiment, step B3 specifically includes the following steps:
[0117] Step B31: Traverse the training set S, extract the corresponding replies under each post, form a comment tree between replies, and use the Transformer model to learn the dependency relationship between replies. Each layer of the Transformer contains a self-attention sublayer and a feedforward sublayer, where the self-attention layer architecture is derived as follows:
[0118]
[0119] The attention weights of elements i and j in the sequence are calculated using the query of i and the key of j.
[0120] Step B32: Aggregate the values of each position to get the output of position i, which is:
[0121]
[0122] Step B33: Each comment reply uses the word embedding vector representation of the comment text. First, for each comment reply x i Perform max-pooling to obtain its sentence representation x' i Then, the comment sentence representation sequence X' = (x'1, x'2, ..., x' m ) Through s MHA layers to model the interaction between tweets. After these MHA layers, we get the output U = (u1,u2,...,u m ), and finally aggregate these outputs through the attention mechanism and connect them using a fully connected layer.
[0123] α k =softmax(γ T u k )
[0124]
[0125] in, k is the number of classes and v is the representation vector of X.
[0126] Step B34: Add and Two additional learned parameters, used to represent the relationship between replies, are:
[0127]
[0128]
[0129] Step B4: The text code s of each post and the corresponding user code u and comment tree code c are fused and spliced to obtain the representation vector h of the post. At the same time, the posts are grouped by fixing the number of posts.
[0130] In this embodiment, step B4 specifically includes the following steps:
[0131] Step B41: The text feature s, user feature u and comment tree feature c extracted in steps 2, 3 and 4 are concatenated together as fusion features and called post features. Considering the different contributions of text, user and comment features, attention weights are trained on text features, user features and comment features to enhance the representation of a certain feature.
[0132] α=σ2(σ1(s,u,c);θ1);θ2)
[0133] In addition, the attention is increased by 1 to ensure that the features are not lost. The calculation of training and fusion representation is as follows:
[0134] H=(α T +1)[s,u,c]
[0135] Step B42: Divide the time series data of rumor events according to the number of posts. i , containing the source post h r Other posts related to this event ij . Since different events have different numbers of posts and time spans, the number of posts in each stage of different events is also different. First, count the number of posts in the event and the start and end time of event-related posts, use normalization to process the time, and calculate the number of posts required for each event interval after dividing it into τ time intervals. Then, according to the time of each post, the posts are divided into corresponding time intervals. In addition, the posts on the path of the source posts and the newly added posts in each time interval are also included. Each time interval can be regarded as a stage of the event. The stage of each event is expressed as:
[0136] T i ={h i1 ,h i2 ,...,h ik ,h r ,H′}.
[0137] Step B5: Input each group’s post vector Ti into the multi-hop graph attention network, first calculate the single-hop attention score using the relationship between posts, then calculate the multi-hop attention score using graph diffusion, and update the post representation vector. Extract the representation vector e of each group’s source post.
[0138] In this embodiment, step B5 specifically includes the following steps:
[0139] Step B51: The vector set T obtained in step 4 i Input into the multi-hop graph attention network, introduce the attention diffusion operator, which is represented as a triple (v i ,e ij ,v j ), calculate the attention score of the directly connected edges Attention diffusion is used to calculate the attention scores between pairs of nodes that are not directly connected.
[0140]
[0141] Among them, l represents the number of layers, W h , W t , W e is the trainable weight matrix, h i 、h j is the vector representation of the input node.
[0142] Step B52: After applying the attention diffusion operator to each edge in the graph, its attention score is obtained, where the attention score of the edge without direct connection is negative infinity.
[0143]
[0144] Step B53: Normalize the result obtained in step B52 to obtain:
[0145] A (l) =softmax(S (l) )
[0146] Among them, A (l) It represents the attention score at layer l when node j aggregates information to node i.
[0147] Step B54: Use graph diffusion to calculate the attention score of multi-hop neighbor relationships:
[0148]
[0149] Among them, θ i =α(1-α) i,α∈(0,1], α is the bias diffusion parameter. The graph attention diffusion of feature aggregation is defined as follows:
[0150] AttDiffusion(G,H l ,θ)=AH l
[0151] Z 0 =H l
[0152] Z k+1 =(1-α)AZ k +αZ 0
[0153] In which, by defining a sequence Z k Simplifying the calculation, when k→∞, the sequence can converge to AH l , in order to achieve the purpose of graph diffusion.
[0154] Step B55: Input the result obtained in step B54 into two fully connected feed-forward sub-layers, adding layer normalization and residual connections in the two sub-layers:
[0155]
[0156]
[0157] Step B6: Use dot-productattention to calculate the correlation between each group of vectors, introduce mask M, and ensure that the prediction of group i depends only on the output before group i, but not on the output after group i. Use the Softmax function to normalize the output vector. According to the target loss function loss, use the back propagation method to calculate the gradient of each parameter in the deep learning network model G, and use the stochastic gradient descent method to update the parameters.
[0158] In this embodiment, step B6 specifically includes the following steps:
[0159] Step B61: Extract the source post vector representation of each group obtained through attention diffusion H'={h1,h2,...,h τ}, where τ is the number of groups. Dot-productattention is used to calculate the correlation between vectors. In addition, mask M is introduced to ensure that the prediction of group i depends only on the output before group i, but not on the output after group i.
[0160]
[0161]
[0162] Step B62: Use cross entropy as the loss function to calculate the loss value, update the learning rate through the Adam optimization algorithm, and use back propagation to iteratively update the model parameters to minimize the loss function to train the model. The cross entropy loss function is as follows:
[0163]
[0164] Where |C| is the number of rumor detection polarity categories, y i is the rumor detection polarity represented by a one-hot vector, y i is the rumor detection polarity probability distribution obtained by calculating the classification layer, λ is the coefficient of the L2 regularization term, θ is the set of trainable parameters, and the model adopts the dropout strategy to avoid overfitting.
[0165] Step B7: When the iterative change of the loss value generated by the deep learning network model G is less than the set threshold or reaches the maximum number of iterations, the training of the deep learning network model G is terminated.
[0166] Step C: The extracted user information, reply information, and relationship between posts are input into the trained deep learning network model G together with the text information of the posts to obtain a prediction of whether each event is a rumor.
[0167] This embodiment also provides a rumor detection system using the above method, including: a data collection module, a preprocessing module, an encoding module, a network training module and a rumor detection module.
[0168] The data collection module is used to extract user information, reply information and forwarding or comment relationships between posts under each event, and mark whether each event is a rumor to construct a training set.
[0169] The preprocessing module is used to preprocess the training samples in the training set, including word segmentation and removal of stop words.
[0170] The encoding module is used to encode the text information, user information, and comment information of the post, obtain the corresponding representation vectors of the text encoding, user encoding, and comment tree encoding, and perform splicing and fusion.
[0171] The network training module is used to input the post vector obtained by the encoding module into the deep learning network, obtain the source post representation vector of each stage through graph diffusion and use it to train the deep learning network, use the probability of the representation vector belonging to a certain category and the annotations in the training set as the loss, and train the entire deep learning network with the goal of minimizing the loss to obtain a rumor detection model based on a dynamic multi-hop graph attention network.
[0172] The rumor detection module is used to extract the text, user and comment information of the rumor detection input, and then use the trained rumor detection model based on the dynamic multi-hop graph attention network to analyze and process the input post related information, and output the polarity of the rumor detection.
[0173] The above is only a preferred embodiment of the present invention, and does not limit the present invention in other forms. Any technician familiar with the profession may use the above disclosed technical content to change or modify it into an equivalent embodiment with equivalent changes. However, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the technical solution of the present invention still belongs to the protection scope of the technical solution of the present invention.
Claims
1. A rumor detection method based on dynamic multi-hop graph attention network, characterized in that: The following steps are involved: Step A: Extract user information, reply information, and forwarding or comment relationships between posts under known events, and mark whether each event is a rumor to construct a training set S; Step B: Use the training set S to train a deep learning network model G based on a dynamic multi-hop graph attention network to analyze whether each event is a rumor; Step C: The extracted user information, reply information, and relationship between posts are input into the trained deep learning network model G together with the text information of the posts to obtain a prediction of whether each event is a rumor; The step B specifically comprises the following steps: Step B1: Encode each post in the training set S to obtain the text encoding s of each post under the event and the relationship matrix R between posts; Step B2: Encode the user information in the training set S, use matrix X to represent the basic information features of the user, use adjacency matrix A to represent the user's behavior features, input them into the graph convolutional network, learn and extract the deep relationship between users, and obtain the user-encoded graph convolution representation vector u; Step B3: Encode the reply information in the training set S and represent each reply with a vector x ij Input into the attention network, use two additional parameters to learn the structural information of the reply; learn the comment tree information from the post reply information and obtain the comment tree representation vector c; Step B4: The text code s of each post and the corresponding user code u and comment tree code c are fused and spliced to obtain the representation vector h of the post; at the same time, the posts are grouped by fixing the number of posts; Step B5: Transform each group’s post vector T i Input into the multi-hop graph attention network, first use the relationship between posts to calculate the single-hop attention score, then use the graph diffusion method to calculate the multi-hop attention score, and update the post representation vector; extract the representation vector e of each group of source posts; Step B6: Use dot-product attention to calculate the correlation between each group of vectors, introduce mask M to ensure that the prediction of group i depends only on the output before group i, but not on the output after group i; use the Softmax function to normalize the output vector; according to the target loss function loss, use the back propagation method to calculate the gradient of each parameter in the deep learning network model G, and use the stochastic gradient descent method to update the parameters; Step B7: When the iterative change of the loss value generated by the deep learning network model G is less than the set threshold or reaches the maximum number of iterations, the training of the deep learning network model G is terminated; The step B1 specifically comprises the following steps: Step B11: traverse the training set S, where the training samples in S are represented as S = (P, y), where P represents the post set, y represents the polarity of rumor detection, and the polarity of rumor detection includes {non-rumor, rumor, true rumor, and unverified rumor}; use the pre-trained distributed representation word vector for each post p in the post set P; the word index x i Find the corresponding one-hot encoding v through the vocabulary i , and then converted to w through the pre-trained word vector i , expressed as: w i =Wv i Among them, v i is the word index x i In the one-hot encoding of the vocabulary, W is the d-dimensional word vector matrix; Step B12: Use the converted word vector as the input of Text-CNN; use filters with different windows to capture features of different granularities to extract text features; for the i-th word in the post text content, the corresponding k-dimensional word embedding representation is So a sentence with n words is represented as: in, is a concatenation operator with a window size of h. The convolutional filter takes a continuous sequence of h words in a sentence as input and outputs a feature. For a continuous sequence of h words starting from the i-th word, the filter operation is expressed as: s i =ReLU(W c S i:i+h-1 ) Among them, W c Represents the filter parameters; then obtain the feature representation of the sentence: s=[s1,s2,...,s n ] The step B2 specifically comprises the following steps: Step B21: Traverse the training set S, extract the user corresponding to each post in the training set, and construct a user feature matrix U to represent the features of all user nodes. The features include the user's personal information and social information. Where n represents the number of users, m represents the dimension of the user feature matrix, and each row of the matrix are all represented as a user's feature vector; the adjacency matrix A and its degree matrix D are used to represent the user's edge; when user a and user b have a forwarding, commenting relationship or discuss the same post, A ab =1, if user a and user b have no intersection, A ab =0; the degree matrix D is composed of eigenvectors, with D ij =∑ j A ij ; Step B22: Perform graph convolution operation using user feature matrix U and adjacency matrix A; for a single convolution, the feature matrix have: L (1) =δ(AUW0) Where L (0) =X, A is the adjacency matrix, W0 is the weight matrix; δ is an activation function. For multiple convolutions, the node matrix is updated as follows: <h2 style=";text-align:left;direction:ltr">L<h2 style=";text-align:left;direction:ltr"> (j+1) <h2 style=";text-align:left;direction:ltr"> =δ(AL<h2 style=";text-align:left;direction:ltr"> (j) <h2 style=";text-align:left;direction:ltr"> W<h2 style=";text-align:left;direction:ltr"> j <h2 style=";text-align:left;direction:ltr"> ) Where j represents the number of convolutional layers; The step B3 specifically comprises the following steps: Step B31: Traverse the training set S, extract the corresponding replies under each post, form a comment tree between the replies, and use the Transformer model to learn the dependencies between the replies; each layer of the Transformer contains a self-attention sublayer and a feedforward sublayer, where the self-attention layer architecture is derived as follows: The attention weights of elements i and j in the sequence are calculated using the query of i and the key of j; Step B32: Aggregate the values of each position to get the output of position i, which is: Step B33: Each comment reply uses the word embedding vector representation of the comment text. First, for each comment reply x i Perform max-pooling to obtain its sentence representation x′ i ; Then the comment sentence representation sequence X′=(x′1,x′2,...,x′ m ) The interaction between tweets is modeled through s MHA layers; after passing through these MHA layers, the output U = (u1, u2, ..., u m ), and finally aggregate these outputs through the attention mechanism and connect them using a fully connected layer; a k =softmax(γ T you k ) in, k is the number of classes, v is the representation vector of X; Step B34: Add and Two additional learned parameters, used to represent the relationship between replies, are: The step B4 specifically comprises the following steps: Step B41: The text feature s, user feature u and comment tree feature c extracted in steps 2, 3 and 4 are spliced together as fusion features and called post features; considering the different contribution levels of text, user and comment features, attention weights are trained on text features, user features and comment features to enhance the representation of a certain feature; α=σ2(σ1(s,u,c);θ1);θ2) In addition, the attention is increased by 1 to ensure that the features are not lost; the calculation of training and fusion representation is as follows: H=(α T +1)[s,u,c] Step B42: Divide the time series data of rumor events according to the number of posts; each event E i , containing the source post h r Other posts related to this event ij ; Since different events have different numbers of posts and time spans, the number of posts in each stage of different events is also different; First, the number of posts in the event and the start and end time of the event-related posts are counted, and the time is processed by normalization to calculate the number of posts required for each time interval after being divided into τ time intervals; Then, according to the time of each post, the posts are divided into corresponding time intervals; In addition, the posts on the path between the source post and the newly added posts in each time interval are also included, and each time interval is regarded as a stage of the event. The stage of each event is expressed as: T i ={h i1 ,h i2 ,...,h ik ,h r ,H′} The step B5 specifically comprises the following steps: Step B51: The vector set T obtained in step 4 i Input into the multi-hop graph attention network, introduce the attention diffusion operator, which is represented as a triple (V i , e ij , v j ), calculate the attention score of the directly connected edges Then use attention diffusion to calculate the attention score between pairs of nodes that are not directly connected; Among them, l represents the number of layers, W h , W t , W e is the trainable weight matrix, h i 、h j is the vector representation of the input node; Step B52: Apply the attention diffusion operator to each edge in the graph to obtain its attention score, where the attention score of the edge without direct connection is negative infinity; Step B53: Normalize the result obtained in step B52 to obtain: A (l) =softmax(S (l) ) Among them, A (l) It represents the attention score at layer l when node j gathers information to node i; Step B54: Use graph diffusion to calculate the attention score of multi-hop neighbor relationships: Among them, θ i =α(1-α) i , α∈(0,1], α is the bias diffusion parameter; the graph attention diffusion of feature aggregation is defined as follows: AttDiffusion(G,H l ,θ)=AH l Z 0 =H l Z k+1 =(1-α)AZ k +αZ 0 In which, by defining a sequence Z k Simplifying the calculation, when k→∞, the sequence converges to AH l The value of , achieves the purpose of graph diffusion; Step B55: Input the result obtained in step B54 into two fully connected feed-forward sub-layers, and then add layer normalization and residual connections in the two sub-layers: The step B6 specifically comprises the following steps: Step B61: Extract the source post vector representation of each group obtained through attention diffusion H′={h1, h2, ..., h τ }, where τ is the number of groups; dot-product attention is used to calculate the correlation between vectors. In addition, a mask M is introduced to ensure that the prediction of group i depends only on the output before group i, but not on the output after group i; Step B62: Use cross entropy as the loss function to calculate the loss value, update the learning rate through the Adam optimization algorithm, and use back propagation to iteratively update the model parameters to minimize the loss function to train the model. The cross entropy loss function is as follows: Where |C| is the number of rumor detection polarity categories, y i is the rumor detection polarity represented by a one-hot vector, y i is the rumor detection polarity probability distribution obtained by calculating the classification layer, λ is the coefficient of the L2 regularization term, θ is a trainable parameter, and the model adopts the dropout strategy to avoid overfitting.
2. A rumor detection system using the method as claimed in claim 1, characterized in that: include: The data collection module is used to extract the user information, reply information, and forwarding or comment relationships between posts under each event, and mark whether each event is a rumor to construct a training set; The preprocessing module is used to preprocess the training samples in the training set, including word segmentation and removal of stop words; The encoding module is used to encode the text information, user information, and comment information of the post, obtain the corresponding representation vectors of text encoding, user encoding, and comment tree encoding, and perform splicing and fusion; The network training module is used to input the post vector obtained by the encoding module into the deep learning network, obtain the source post representation vector of each stage through graph diffusion and use it to train the deep learning network. The probability of the representation vector belonging to a certain category and the annotations in the training set are used as the loss. The entire deep learning network is trained with the goal of minimizing the loss to obtain a rumor detection model based on a dynamic multi-hop graph attention network. as well as The rumor detection module is used to extract the text, user and comment information of the rumor detection input, and then use the trained rumor detection model based on the dynamic multi-hop graph attention network to analyze and process the input post related information, and output the polarity of the rumor detection.
Citation Information
Patent Citations
Internet rumor detection method based on transmission graph neural network
CN112732906A
Multitask rumor detection method based on bidirectional propagation graph
CN113094596A