Public opinion propagation prediction method and system based on user social behaviors
By adopting a method based on user social behavior in public opinion dissemination prediction, combining sentiment analysis, user theme clustering and Ebbinghaus forgetting curve model, the problem of failure to effectively consider the impact of communication networks and timing among users in the existing technology is solved, and more accurate public opinion dissemination prediction and analysis is achieved.
Patent Information
- Application Number
- CN202411633692.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-03-11
AI Technical Summary
The prior art fails to effectively consider the attenuation changes in the impact of entity communication networks and timing among users in public opinion communication prediction, resulting in poor characterization performance of the public opinion communication process.
Using a method based on user social behavior, through emotion analysis, user theme clustering, Ebbinghaus forgetting curve model and user theme characteristics, a feature module of user nodes is constructed, and the social network is pruned according to the propagation situation, the user's credibility and susceptibility are calculated, and the mask matrix is constructed to evaluate the similarity of the propagation network.
It improves the accuracy of public opinion dissemination prediction, can more accurately analyze the impact of public opinion and neighbor nodes on users, comprehensively consider multiple factors to integrate network weights, and provides a deeper understanding of the public opinion dissemination mechanism and characteristics.
Smart Images

Figure CN119598393A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition, and in particular to a method and system for predicting public opinion propagation based on user social behavior. Background Art
[0002] In recent years, the rapid development of social platforms has brought many conveniences to people's communication. The connectivity, networking and intelligence of society have developed rapidly. Internet social platforms have gradually become a place for people to express their views and exchange ideas on social phenomena and hot issues. As of June 2023, the number of Internet users in my country reached 1.079 billion, an increase of 11.09 million from December 2022, and the Internet penetration rate reached 76.4%.
[0003] While social platforms bring convenience and get rid of geographical restrictions, they also intensify the process of group polarization in events, and also lead to the untruthfulness of speech dissemination and the potential possibility of provoking war. People often have different views on the same public opinion event, which directly promotes the fermentation of public opinion events. The persistent heat of public opinion events and the increase in frequency of occurrence will lead to improper prevention and control due to the government departments' failure to prevent and control in time, affecting social stability. Therefore, in order to strengthen the government's governance of social security and maintain social stability, the study of online public opinion is imperative.
[0004] Group polarization refers to the phenomenon in which social, political or cultural groups become increasingly divided, opposed or extreme when using language or speech in communication among users of social platforms. This phenomenon is often particularly prominent on social media, online discussion forums and other digital communication platforms. Individuals tend to interact with people who have similar views to them, resulting in them being exposed to only one point of view, which reinforces their beliefs but also makes them biased against other points of view. Platforms such as social media and search engines provide users with personalized information based on their preferences and click history, which can cause users to only see information that is consistent with their existing views and ignore other points of view.
[0005] In a polarized environment, some individuals may be more inclined to use extreme and radical language to attract more attention or strengthen their positions. This may lead to intensified rhetoric and increased hostility. Group polarization may cause people to lose contact with people with different views, and their social circles to become more closed, resulting in less opportunities for understanding and dialogue with different views. Group polarization has accelerated the formation of online conflicts and cyber violence to a certain extent, and even interfered with the offline law enforcement environment.
[0006] Public opinion perception anomaly detection uses the Gompertz model to predict several stage thresholds of online public opinion with a small amount of data; hypernetwork modeling and situation prediction uses hypernetwork theory to model an online public opinion event that has occurred, builds a core subnet through the propagation network of the event, mines sentence sentiment scores, and obtains the key communication personnel and paths of the event.
[0007] The detection of public opinion derived from online violence incidents based on the BERTopic model uses Bertopic for topic modeling and high-frequency keyword analysis, and gives examples of the topic derivation evolution process; in the research on false public opinion detection on social networks, the detection characteristics of false public opinion and false news are proposed, and the seven cycles from the generation to the demise of public opinion are scientifically represented, and the public opinion verification method, available data set, and evaluation indicators are proposed; the GMM-HMM topic life cycle state recognition and trend prediction use the topic state indicator as the observed variable of HMM, and use GMM to simulate the probability distribution of the observed variables under each topic state.
[0008] The problem with the above technology is that the classification based on user features is mostly based on machine learning clustering of user keywords, using user categories as indicators of propagation possibility, without considering the entity propagation network between users, and without considering the attenuation changes of time effects.
[0009] There are few precedents for public opinion propagation prediction in graph social networks based on user nodes. Previous research results mostly used graph neural networks to classify user text information, modeled the propagation structure as a graph structure, and used GCN and other models to analyze the aggregation of propagation features. Most existing methods can only share static propagation features through the spatial relationship of the graph, and cannot dynamically weight propagation features based on the relationship between nodes. The representation performance of the rumor propagation process is poor, and the user's own susceptibility and similarity cannot be considered for the new public opinion generated. Summary of the invention
[0010] The purpose of the present invention is to provide a method and system for predicting the spread of public opinion based on user social behavior to solve the problems raised in the above-mentioned background technology.
[0011] To achieve the above-mentioned purpose, one aspect of the present invention provides a method for predicting the spread of public opinion based on user social behavior, comprising the following steps:
[0012] Step S1, improving and dividing the data set categories according to the data set form and content;
[0013] Step S2, performing sentiment analysis based on the content of the user's forwarded comments, and preliminarily clustering the topics of the user's forwarded tweets;
[0014] Step S3, introducing the Ebbinghaus forgetting curve mathematical model and fusing it with the user topic features, and introducing the time-series-related interest decay into the feature construction of the propagation node;
[0015] Step S4, constructing a feature module of user nodes and pruning the entire social network according to the propagation situation;
[0016] Step S5, calculating the user's credibility and susceptibility based on historical forwarding data to construct a mask matrix, and performing a similarity assessment on the propagation network of the specified event;
[0017] Step S6, constructing a propagation prediction result evaluation index.
[0018] Furthermore, step S1 uses the positive emotion level and active time of the user's comments as two basic feature values of the user. The user active time division formula is as follows:
[0019] c i =soft max(concat(avg_work i ,avg_time i ))
[0020] Among them, avg_work i The average number of active users on weekdays or holidays, avg_time i is the time period when the user is active. Counter is used to find the top n time periods with the most active time of the user. Sort is used to divide the top n active time periods into working time periods and rest time periods. Afterwards, the concat algorithm fuses the features of the two time periods and uses softmax to normalize them to obtain the feature value.
[0021] Furthermore, the sentiment analysis in step S2 is represented and calculated by the Bert model, using a Transformer structure with 12 layers, an output vector dimension of 768, and 12 multi-heads. The attention mechanism used is a method of performing inner product operations based on the query, key, and value variable groups. The formula is:
[0022]
[0023] Where Q, K, and V are query, key, and value variable groups respectively. k is the length of the vector, and softmax normalizes its vector inner product.
[0024] Furthermore, in step S2, the clustering method of user forwarded tweets uses the Bert algorithm to convert text into embedded vectors. First, the UMAP algorithm is used to retain the local and global features of high-dimensional data, and then the hierarchical density-based spatial clustering HDBSCAN clustering algorithm is used to obtain the optimal number of clusters, where the distance formula is:
[0025] core k (x) = d(x, N k (x)
[0026] d mreach-k (a,b)=max{core k (a),core k (b),d(a,b)}
[0027] Among them, core k (x) is the core distance, which means that x becomes the minimum neighborhood radius of the core node, N k (x) represents the kth nearest neighbor of node x in the set, d represents the spatial distance between nodes; the mutual reach distance d mreach-k (a,b) Take the core distance of node a and node b, and the maximum value of the spatial distance between node a and node b, thereby constructing a minimum spanning tree and a hierarchical clustering structure.
[0028] The characteristic value of the basic community category to which the user node belongs is obtained, which is represented by the characteristic value of the cluster core point of the same node after clustering. The c-TF-IDF algorithm is used to extract topic keywords from each cluster, and the word with the highest TF-IDF value in each cluster is extracted as the topic word under the topic to improve the topic representation clustering effect of the model.
[0029] Furthermore, for the similarity between nodes and between nodes and events, the cosine similarity coefficient is used to characterize the attribute similarity. The similarity between two nodes is calculated by calculating the cosine value of the vector angle in the vector space, cos_sim(X,Y), that is, using f(v i ,v j ) to represent the node v i and node v j The attribute similarity between
[0030]
[0031] Among them, v i 、v j is the feature vector of node i and node j, |v i | and |v j | is the modulus of the vector, which is expressed as vector multiplication in a specific eigenvector group; i k (j k) is the kth vector in node i(j), and the length of each eigenvector is n.
[0032] Furthermore, the formula for calculating interest attenuation and change in step S3 is expressed as P tn =P tn-1 ×e -θ(t-t0) ,
[0033] For the same topic increment, the formula is: P tn =P0×e -α(tn) +P tn-1 ×e -θ(tn-tn-1)
[0034] For the case of heterogeneous topic variables, the feature vector of the new domain topic Qtn involved by the user is combined with the historical decay interest feature P tn-1 , through the fusion of equal-length weight matrices, a new eigenvector is obtained, specifically:
[0035] P tn =Q tn ×I+WP tn-1
[0036] Among them, t n is the current time of the record, t n-1 is the previous moment of recording, t0 is the starting time of effective recording; P0 is the initial interest characteristic value of a certain interest direction, P tn is the user’s interest at the current moment, P tn-1 is the user's interest in the previous period, θ is the conventional interest decay factor, and α is the initial interest decay factor; Q tn t n The new interest eigenvalue introduced at the moment, I is the unit matrix, and W is the fusion weight matrix.
[0037] Furthermore, we construct feature modules of user nodes and prune the overall social network according to the dissemination situation. We analyze the sentiment of historical tweets of user nodes, clustering characteristics of the subject content of historical tweets, and user active time, and construct user feature nodes based on the existing user social network. For historical dissemination paths, most nodes form a sparse network, and a pruning algorithm can be used based on the network weight and threshold of the dissemination frequency.
[0038]
[0039] Among them, h k The original weight matrix W is the k-th step (i,j) The threshold pruning algorithm performed, a k is the lower threshold, b k is the upper threshold, T kWeight the weight values that meet the threshold range in the kth step, that is, by realizing a mask matrix H that is equal to the weight matrix, each element indicates whether to cut the corresponding connection. When it is equal to 1, it means to keep it, and when it is equal to 0, it means to prune it. The part with the element mask of 0 does not participate in the loss calculation, but the parameter value still needs to be updated.
[0040] Furthermore, in step S5, the user's credibility is represented by Ri, and the susceptibility is represented by Ii. For all historical public opinion and non-public opinion events, the values that can be obtained for a certain node in the entire social network are calculated: positive in-degree value din+, negative in-degree value din-, positive out-degree value dout+, and negative out-degree value dout-. The formula is as follows:
[0041]
[0042] The three core parameters in the graph information transmission process are the node feature matrix seq, the transformed node feature dimension out_sz, and the transformed adjacency matrix bias_mat. First, the original node feature seq is projected using a convolution kernel with a convolution kernel size of 1. The dimension after the projection transformation is out_sz, where the projection matrix is shared by all nodes, and the formula is as follows:
[0043]
[0044] in and It is a representation of the projection change, and through the two sets of projection parameters a1 and a2, the node and the neighboring node are projected separately, and the dimensions are [num_graph, num_node, 1]. Finally, the matrix is transposed, superimposed, and broadcasted to obtain logits, that is, the attention matrix is obtained:
[0045]
[0046] Neighborhood normalization restricts the values of the logits attention matrix to the neighboring nodes of node i, even if k∈Ni
[0047] coefs=softmax(LeakyReLU(logits)+bias_mat)
[0048] In order to calculate the attention value eij between the node pair (i, j), the attention network A needs to consider the influence of both nodes at the same time, then concatenate nodes i and j, and then map them into scalars. At the same time, when aggregating neighbor information, the attention of all neighbors of each node needs to be normalized.
[0049]
[0050] The bias_mat matrix is constructed by combining the node's credibility, susceptibility and the graph attention network mask. The corresponding value in bias_mat is set to -e for the neighboring nodes other than the node. 9 , the corresponding value of the adjacent node in bias_mat is set to bias ij ; Calculate the event m based on the cosine similarity of each node, mask the nodes with large differences, and do not calculate the propagation possibility. The formula is as follows:
[0051]
[0052] Among them, the neighborhood node set N of the computing node i j When transforming the adjacency matrix, Bias ij is the mask value of node j at that moment, I i is the susceptibility of node i, R j represents the credibility of node j, f(C j ,C m ) represents the similarity value between the historical features of node j and the features of the current event m.
[0053] Furthermore, the result evaluation index formula in step S6 is as follows:
[0054]
[0055] Among them, TP is a true positive example, TN is a true negative example, FP is a false positive example, and FN is a false negative example; Precision is the accuracy rate, which is how many of all samples are correctly predicted; Recall is the recall rate, which is how many of all samples predicted to be correct are positive samples.
[0056]
[0057] The F1 value is the harmonic mean of precision and recall. The F1 value range is [0,1], where 1 represents the best output of the model and 0 represents the worst output of the model.
[0058] Another aspect of the present invention provides a public opinion propagation prediction system based on user social behavior, including a division module, a clustering module, a fusion module, a feature module module, an evaluation module, and an assessment module, wherein:
[0059] The partitioning module is used to improve and divide the dataset categories according to the dataset form and content;
[0060] The clustering module is used to perform sentiment analysis based on the content of user forwarded comments and to perform preliminary clustering of the topics of user forwarded tweets;
[0061] The fusion module introduces the Ebbinghaus forgetting curve mathematical model and fuses it with the user topic features, and introduces the time-related interest decay into the feature construction of the propagation node;
[0062] The feature module is used to construct the feature module of user nodes and prune the overall social network according to the propagation situation;
[0063] The evaluation module is used to calculate the user's credibility and susceptibility based on historical forwarding data to construct a mask matrix and perform similarity evaluation on the propagation network of a specified event;
[0064] The evaluation module is used to construct evaluation indicators for propagation prediction results.
[0065] Compared with the prior art, the present system and method have the following advantages:
[0066] The present invention extracts features from tweets posted by users and divides communities based on the graph neural network method, introduces keywords of tweets updated by users into node features, and adds possible changes and relevance in actual social networks into the weight matrix of the graph neural network to more accurately analyze the impact of public opinion and neighbor nodes on users. The present invention introduces the impact of opinion interaction on interest and polarization, and integrates multiple factors to fuse network weights. The present invention focuses on the mechanism and characteristics of public opinion dissemination, and provides a certain reference value for predicting the possibility of public opinion dissemination and designing artificial intervention plans. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 This is a flow chart of a method for predicting public opinion propagation based on user social behavior.
[0068] Figure 2 This is a schematic diagram of the traditional SIR model.
[0069] Figure 3 Schematic diagram of the improved SEIR model.
[0070] Figure 4 It is a schematic diagram of the SIR historical propagation model adopted in the present invention.
[0071] Figure 5 Schematic diagram of a public opinion propagation prediction method based on user social behavior.
[0072] Figure 6 Schematic diagram of the matrix calculation module based on negative exponential function interest attenuation.
[0073] Figure 7 Schematic diagram of GAT weight transfer based on similarity mask matrix. DETAILED DESCRIPTION
[0074] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0075] like Figure 1 , 5 are respectively the process of the method and the schematic diagram of the present invention. The method for predicting and analyzing the possibility of propagation of public opinion in social networks based on user historical data proposed in this embodiment specifically includes the following steps:
[0076] Step S1, improve and divide the data set categories according to the data set form and content. According to the historical blog data and forwarding comment network information, it is divided into two data forms according to the form: point-to-point forwarding and commenting. The user's active time is divided into weekdays, holidays, and daytime and night according to domestic statutory holidays and working hours. Then the corresponding forwarding network is divided into training samples and test samples according to the number of tweets. Then the content of each user's comment is used as sentiment classification information, and the emotional positivity of the user's comment and the active time are used as two of the user's basic feature values. The user active time division formula is as follows:
[0077] c i =softmax(concat(avg_work i ,avg_time i ))
[0078] Among them, avg_work i The average number of active users on weekdays or holidays, avg_time i is the time period when the user is active. Counter is used to find the top n time periods with the most active time for the user. Sort is used to divide the top n active time periods into working time periods and rest time periods. Afterwards, the concat algorithm fuses the features of the two time periods and normalizes them using softmax to obtain the feature value.
[0079] Step S2, sentiment analysis is performed based on the content of the user's forwarded comments, and the topics of the user's forwarded tweets are preliminarily clustered. The sentiment analysis based on the user's comment text is represented and calculated by the Bert model, using a Transformer structure with 12 layers, an output vector dimension of 768, and a multi-head of 12. The attention mechanism used is a method of performing inner product operations based on the three variable groups of query, key, and value. Taking the inner product of a query and n key-value pairs will generate n similarity values. Passing it to softmax will obtain n non-negative weight values that sum to 1. Multiplying the weight value obtained by softmax with the value matrix V can obtain the attention value output. In practice, multiple queries are usually combined to form a matrix to improve calculation efficiency.
[0080]
[0081] The present invention uses a multi-head attention mechanism to project the original value, key, and query to a lower dimension through a special linear layer, perform a scaled dot product operation, merge all multiple output vectors (concat), and finally perform a linear projection to obtain multi-head attention.
[0082] sub_layer_output=LayerNorm(x+(SubLayer(x)))
[0083] The sub-encoder consists of two sub-layers: a multi-head self-attention layer and a feedforward network layer, and both contain residual connections and layer normalization structures, which are mainly used to solve the problems of gradient disappearance and weight matrix degradation of Transformer in deep learning.
[0084] The topic clustering method based on user forwarded tweets uses the Bert algorithm to convert text into embedded vectors. The UMAP algorithm is first used to retain the local and global features of high-dimensional data. Since clustering models usually have difficulty processing high-dimensional data, UMAP is first used to reduce the dimension of the upper-level output data to improve the efficiency of the algorithm. Then the hierarchical density-based spatial clustering HDBSCAN clustering algorithm is used to obtain the optimal number of clusters, where the distance formula is:
[0085] core k (x) = d(x, N k (x)
[0086] d mreach-k (a,b)=max{core k (a),core k(b),d(a,b)}
[0087] Among them, core k (x) is the core distance, which means that x becomes the minimum neighborhood radius of the core node, N k (x) represents the kth nearest neighbor of node x in the set, d represents the spatial distance between nodes; the mutual reach distance d mreach-k (a,b) Take the core distance of node a and node b, and the maximum value of the spatial distance between node a and node b, thereby constructing a minimum spanning tree and a hierarchical clustering structure.
[0088] The characteristic value of the basic community category to which the user node belongs is obtained, which is represented by the characteristic value of the cluster core point of the same node after clustering. The c-TF-IDF algorithm is used to extract topic keywords from each cluster, and the word with the highest TF-IDF value in each cluster is extracted as the topic word under the topic to improve the topic representation clustering effect of the model.
[0089] For the similarity between nodes and between nodes and events, the cosine similarity coefficient is used to characterize the attribute similarity, that is, the similarity between two nodes is calculated by calculating the cosine value of the vector angle in the vector space cos_sim(X,Y), that is, using f(v i ,v j ) to represent the node v i and node v j The attribute similarity between . The formula is as follows:
[0090]
[0091] Where: v i 、v j is the feature vector of node i and node j, |v i | and |v j | is the modulus of the vector, which is expressed as vector multiplication in a specific eigenvector group; i k (j k ) is the kth vector in node i(j), and the length of each eigenvector is n.
[0092] Step S3, introduce the Ebbinghaus forgetting curve mathematical model and fuse it with the user topic features, and introduce the time-series-related interest decay into the feature construction of the propagation node. User interest decay and change: The core idea of interest dynamic feature fusion is to use the features extracted from the user's new tweet topic and the feature results extracted from the original corresponding blog post topic. While introducing the user's interest changes, the fusion calculation avoids the repeated calculation overhead of historical tweet data. For the calculation of user interest decay, a user interest change function based on the time decay function is used. Figure 6The figure shows a schematic diagram of the matrix calculation module based on the negative exponential function interest decay. In the initial calculation, for user node i, take P tn-1 The value of is the core interest feature value of topic clustering.
[0093] P tn =P tn-1 ×e -θ(t-t0)
[0094] t0 is the start time of the effective record, P tn is the user’s interest at the current moment, P tn-1 is the user's interest in the previous period, and θ is the conventional interest decay factor. For the same topic increment, the more records of specific topic posts published / forwarded by the user, the smaller the increment of interest each time. The interest is the sum of the new increment and the time decay; as the number of repetitions increases, the total amount of user interest in the same direction continues to increase, and this increase process gradually tends to be flat and eventually converges to a maximum value. The process is described using a negative exponential function:
[0095] P tn =P0×e -α(tn) +P tn-1 ×e -θ(tn-tn-1)
[0096] t n is the current time of the record, t n-1 is the previous moment of recording, α is the initial interest attenuation factor, P0 is the initial interest characteristic value of a certain interest direction, and for the case of heterogeneous subject variables, the new domain subject Q involved by the user is n The feature vector of the historical decay interest feature P tn-1 , through the fusion of equal-length weight matrices, a new eigenvector is obtained, specifically:
[0097] P tn =Q tn ×I+WP tn-1
[0098] Where: Q tn t n The new interest eigenvalue introduced at the moment, I is the unit matrix, and W is the fusion weight matrix.
[0099] The present invention solves the problem that graph network features cannot be updated and the amount of calculation is too large by introducing the Ebbinghaus forgetting rate curve. The core idea of the dynamic feature fusion adopted by the proposed BERT-Rcmd topic clustering method is to fuse the features extracted from the user's new tweet topic with the original corresponding topic features, while introducing changes in user interests and avoiding the repeated calculation overhead of historical tweet data.
[0100] Step S4, construct the feature module of the user node, and prune the overall social network according to the propagation situation. Through the sentiment analysis of the historical tweets of the user node, the clustering characteristics of the theme content of the historical tweets, and the user's active time, the user feature node is constructed according to the original user social network. For the historical propagation path, most of the nodes constitute a sparse network, and the pruning algorithm can be based on the network weight and the threshold of the propagation frequency.
[0101]
[0102] Where: h k The original weight matrix W is the k-th step (i,j) The threshold pruning algorithm performed, a k is the lower threshold, b k is the upper threshold, T k Weight the weight values that meet the threshold range in the kth step, that is, by realizing a mask matrix H that is equal to the weight matrix, each element indicates whether to cut the corresponding connection. When it is equal to 1, it means to keep it, and when it is equal to 0, it means to prune it. The part with the element mask of 0 does not participate in the loss calculation, but the parameter value still needs to be updated.
[0103] Step S5, calculate the user's credibility and susceptibility based on historical forwarding data to construct a mask matrix, and compare the similarity of the propagation network of the specified event; for individual nodes, by calculating susceptibility through historical data, it can be known whether the user is prone to believe and spread rumors, or has rumor-refuting behavior. When new public opinion arises, susceptibility and self-infectivity will be important reference factors.
[0104] like Figure 2 The figure shows a traditional SIR model, which is a widely used model in infectious disease models. Most of the early research on public opinion dissemination was based on the SIR model. When people who have never heard of public opinion come into contact with public opinion disseminators, they will become public opinion disseminators with a certain probability. When public opinion disseminators meet other public opinion disseminators or immune people, they will become immune people with a certain probability. In the classic SIR infectious disease model, the unknown person is P si The probability of being transformed into a propagator, the propagator is P ir The probability of becoming immune.
[0105] like Figure 3 The figure shows the schematic diagram of the improved SEIR model. The SEIR model adds a latent period on the basis of the SIR model. During the latent period, individuals know the public opinion but do not spread it. se The probability of the transformation is converted into a known state, and then with a certain probability P ei Converted to propagation state.
[0106] like Figure 4The figure shows a schematic diagram of the SIR historical propagation model used in the present invention. The possibility of infection of the user node can be known from the propagation analysis of historical data. i ) is the credibility, Infect(I i ) is the susceptibility.
[0107] For all historical public opinion and non-public opinion events, the value that can be obtained by calculating the positive in-degree value din for a certain node in the entire social network + , negative in-degree value din - , positive out-degree value dout + , negative out-degree value dout - , as shown in the following formula:
[0108]
[0109] The three core parameters in the graph information transmission process of the present invention are the node feature matrix seq, the transformed node feature dimension out_sz, and the transformed adjacency matrix bias_mat; first, the original node feature seq is projected using a convolution kernel with a convolution kernel size of 1, and the dimension after the projection transformation is out_sz, where the projection matrix is shared by all nodes. That is:
[0110]
[0111] in and It is a representation of the projection change, and through the two sets of projection parameters a1 and a2, the node and the neighboring node are projected separately, and the dimensions are [num_graph, num_node, 1]. Finally, the matrix is transposed, superimposed, and broadcasted to obtain logits, that is, the attention matrix is obtained:
[0112]
[0113] Neighborhood normalization restricts the values of the logits attention matrix to the neighboring nodes of node i, even if k∈Ni
[0114] coefs=softmax(LeakyReLU(logits)+bias_mat)
[0115] In order to calculate the attention value e between the node pair (i, j) ij , the attention network A needs to consider the influence of two nodes at the same time, then concatenate node i and node j, and then map them into scalars. At the same time, when aggregating neighbor information, the attention of all neighbors of each node needs to be normalized.
[0116]
[0117] The present invention adopts a method combining the node credibility, susceptibility and the graph attention network mask for the construction of the bias_mat matrix. The neighboring nodes other than the node (node i) set the corresponding value in bias_mat to -e 9 , the corresponding value of the adjacent node (node j) in bias_mat is set to bias ij At the same time, event m is calculated based on the cosine similarity of each node, and nodes with large differences (i.e. users who are not interested in event m) are masked and the propagation possibility is not calculated.
[0118]
[0119] Step S6, constructing the evaluation index of propagation prediction results. Figure 7 The figure shows a schematic diagram of GAT weight transfer based on the similarity mask matrix. Based on the classification results of user nodes by GAT, nodes with positive induction values are taken as infected nodes, and the directed edges between nodes are used as propagation paths to construct propagation routes; finally, the correct rates of infected nodes and infected edges are used as evaluation indicators. Result evaluation indicators:
[0120]
[0121] Among them: TP is a true positive example, TN is a true negative example, FP is a false positive example, and FN is a false negative example; Precision, that is, how many of all samples are correctly predicted, Recall, also known as the recall rate, that is, how many of all samples predicted to be correct are positive samples,
[0122]
[0123] When the precision rate is high, the recall rate is often low; and when the recall rate is high, the precision rate is often low. The F1 value is the harmonic mean of the precision rate and the recall rate, which combines the results of precision and recall (when both the precision rate and the accuracy rate are high, the F1 value will also be high accordingly). The F1 value range is [0,1], where 1 represents the best output of the model and 0 represents the worst output of the model.
[0124] Evaluation of key nodes of the propagation path: After predicting the propagation path, it is difficult for the public security department to monitor and process all possible nodes of propagation, so the evaluation of the key nodes of the predicted path is necessary and of practical significance. In the process of online public opinion propagation, identifying key nodes is the key to analyzing the development trend of public opinion. In view of the fact that opinion leaders in online public opinion usually have a greater influence, a wide range of influence, a large number of audiences, strong professionalism and high activity, the present invention applies the social network analysis method to the identification of key nodes. By calculating the degree centrality, average path length, clustering coefficient and other related network indicators of the node, the key nodes in the propagation of public opinion can be accurately identified, thereby providing strong support for the analysis of public opinion trends.
[0125] The degree of a node indicates the number of nodes connected to other nodes, which can reflect the centrality of the node in online public opinion. The larger the degree value, the higher the centrality.
[0126] The average clustering coefficient represents the average number of the shortest path edges between two objects, which can reflect the overall nature of the development of online public opinion.
[0127]
[0128] Where L is the average path length; n is the number of nodes, d ij is the shortest path coefficient between the object and the subject. The smaller L is, the better the overall connection of public opinion is and the higher the efficiency of the network space structure is.
[0129] The present invention uses the BERT model to cluster the sentiment and interest categories of user tweets, takes sentiment polarity and interest categories as user node features, and dynamically introduces the attenuation of user interests for fusion; introduces user interaction frequency as a weight edge in the propagation algorithm, and masks it with the calculation of topic similarity, including but not limited to topic features and influence. At the same time, the present invention introduces the calculation of the infectiousness and susceptibility of user nodes, and infers the possibility of infection through the node in-and-out degree of historical data. Finally, the feature parameters are mapped to weight parameters through the GAT graph attention network, and finally the public opinion propagation path for a specific event is obtained.
[0130] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for predicting public opinion propagation based on user social behavior, characterized in that: The following steps are involved: Step S1, improving and dividing the data set categories according to the data set form and content; Step S2, performing sentiment analysis based on the content of the user's forwarded comments, and preliminarily clustering the topics of the user's forwarded tweets; Step S3, introducing the Ebbinghaus forgetting curve mathematical model and fusing it with the user topic features, and introducing the time-series-related interest decay into the feature construction of the propagation node; Step S4, constructing a feature module of user nodes and pruning the entire social network according to the propagation situation; Step S5, calculating the user's credibility and susceptibility based on historical forwarding data to construct a mask matrix, and performing a similarity assessment on the propagation network of the specified event; Step S6, constructing a propagation prediction result evaluation index.
2. According to claim 1, a method for predicting public opinion propagation based on user social behavior is characterized in that: Step S1 uses the positive emotion level and active time of the user's comments as two basic feature values of the user. The user active time division formula is as follows: c i =soft max(concat(avg_work i ,avg_time i )) Among them, avg_work i The average number of active users on weekdays or holidays, avg_time i is the time period when the user is active. Counter is used to find the top n time periods with the most active time of the user. Sort is used to divide the top n active time periods into working time periods and rest time periods. Afterwards, the concat algorithm fuses the features of the two time periods and uses softmax to normalize them to obtain the feature value.
3. According to claim 1, a method for predicting public opinion propagation based on user social behavior is characterized in that: The sentiment analysis in step S2 is represented and calculated by the Bert model, using a Transformer structure with 12 layers, an output vector dimension of 768, and 12 multi-heads. The attention mechanism used is a method of performing inner product operations based on the query, key, and value variable groups. The formula is: Where Q, K, and V are query, key, and value variable groups respectively. k is the length of the vector, and softmax normalizes its vector inner product.
4. According to claim 1, a method for predicting public opinion propagation based on user social behavior is characterized in that: In step S2, the clustering method of user forwarded tweets uses the Bert algorithm to convert text into embedded vectors. First, the UMAP algorithm is used to retain the local and global features of high-dimensional data. Then, the hierarchical density-based spatial clustering HDBSCAN clustering algorithm is used to obtain the optimal number of clusters. The distance formula is: core k (x)=d(x,N k (x)) d mreach-k (a,b)=max{core k (a),core k (b),d(a,b)} Among them, core k (x) is the core distance, which means that x becomes the minimum neighborhood radius of the core node, N k (x) represents the kth nearest neighbor of node x in the set, d represents the spatial distance between nodes; the mutual reach distance d mreach-k (a,b) Take the maximum value of the core distance between node a and node b and the spatial distance between node a and node b, and thus construct a minimum spanning tree and a hierarchical clustering structure; The characteristic value of the basic community category to which the user node belongs is obtained, which is represented by the characteristic value of the cluster core point of the same node after clustering. The c-TF-IDF algorithm is used to extract topic keywords from each cluster, and the word with the highest TF-IDF value in each cluster is extracted as the topic word under the topic to improve the topic representation clustering effect of the model.
5. According to claim 1, a method for predicting public opinion propagation based on user social behavior is characterized in that: In step S2, for the similarity between nodes and between nodes and events, the cosine similarity coefficient is used to characterize the attribute similarity. The similarity between two nodes is calculated by calculating the cosine value of the vector angle in the vector space, i.e., using f(v i ,v j ) to represent the node v i and node v j The attribute similarity between Among them, v i 、v j is the feature vector of node i and node j, |v i | and |v j | is the modulus of the vector, which is expressed as vector multiplication in a specific eigenvector group; i k 、j k is the kth vector in node i, j, and the length of each eigenvector is n.
6. According to claim 1, a method for predicting public opinion propagation based on user social behavior is characterized in that: The formula for calculating interest attenuation and change in step S3 is expressed as For the same topic increment, the formula is: For heterotopic variables, the new domain topic Q n The feature vector of the historical decay interest feature P tn-1 , through the fusion of equal-length weight matrices, a new eigenvector is obtained, specifically: P tn =Q tn ×I+WP tn-1 Among them, t n is the current time of the record, t n-1 is the previous moment of recording, t0 is the starting time of effective recording; P0 is the initial interest characteristic value of a certain interest direction, P tn is the user’s interest at the current moment, P tn-1 is the user's interest in the previous period, θ is the conventional interest decay factor, and α is the initial interest decay factor; Q tn t n The new interest eigenvalue introduced at the moment, I is the unit matrix, and W is the fusion weight matrix.
7. According to claim 1, a method for predicting public opinion propagation based on user social behavior is characterized in that: In step S4, a feature module of the user node is constructed, and the overall social network is pruned according to the propagation situation. By analyzing the sentiment of the user node's historical tweets, the theme content clustering features of the historical tweets, and the user's active time, the user feature node is constructed according to the original user social network. For the historical propagation path, most of the nodes constitute a sparse network. The pruning algorithm formula based on the network weight and the threshold of the propagation frequency is as follows: Among them, h k The original weight matrix W is the k-th step (i,j) The threshold pruning algorithm performed, a k is the lower threshold, b k is the upper threshold, T k Weight the weight values that meet the threshold range in the kth step, that is, by realizing a mask matrix H that is equal to the weight matrix, each element indicates whether to cut the corresponding connection. When it is equal to 1, it means to keep it, and when it is equal to 0, it means to prune it. The part with the element mask of 0 does not participate in the loss calculation, but the parameter value still needs to be updated.
8. The method for predicting public opinion propagation based on user social behavior according to claim 1, characterized in that: In step S5, the user's credibility is determined by R i Indicates that the susceptibility is expressed by I i Indicates that for all historical public opinion and non-public opinion events, the value that can be obtained by calculating the positive in-degree value din for a certain node in the entire social network + , negative in-degree value din - , positive out-degree value dout + , negative out-degree value dout - , the formula is as follows: The three core parameters in the graph information transmission process are the node feature matrix seq, the transformed node feature dimension out_sz, and the transformed adjacency matrix bias_mat. First, the original node feature seq is projected using a convolution kernel with a convolution kernel size of 1. The dimension after the projection transformation is out_sz, where the projection matrix is shared by all nodes. The formula is as follows: in and It is a representation of the projection change, and through the two sets of projection parameters a1 and a2, the node and the neighboring node are projected separately, and the dimensions are [num_graph, num_node, 1]; finally, the matrix is transposed, superimposed, and broadcasted to obtain logits, that is, the attention matrix formula is as follows: Neighborhood normalization restricts the values of the logits attention matrix to the neighbors of node i, even if k∈N i coefs=softmax(LeakyReLU(logits)+bias_mat) In order to calculate the attention value a between the node pair (i, j) ij , the attention network A needs to consider the influence of two nodes at the same time, then concatenate node i and node j, and then map them into scalars. When aggregating neighbor information, it is necessary to normalize the attention of all neighbors of each node; The bias_mat matrix is constructed by combining the node's credibility, susceptibility and the graph attention network mask. The corresponding value in bias_mat is set to -e for the neighboring nodes other than the node. 9 , the corresponding value of the adjacent node in bias_mat is set to bias ij ; Calculate the event m based on the cosine similarity of each node, mask the nodes with large differences, and do not calculate the propagation possibility. The formula is as follows: Among them, the neighborhood node set N of the computing node i j When transforming the adjacency matrix, Bias ij is the mask value of node j at that moment, I i is the susceptibility of node i, R j represents the credibility of node j, f(C j ,C m ) represents the similarity value between the historical features of node j and the features of the current event m.
9. The method for predicting public opinion propagation based on user social behavior according to claim 1, characterized in that: The result evaluation index formula in step S6 is as follows: Among them, TP is a true positive example, TN is a true negative example, FP is a false positive example, and FN is a false negative example; Precision is the accuracy rate, which is the proportion of all samples that are correctly predicted; Recall is the recall rate, which is the proportion of all samples predicted to be correct that are positive samples. The F1 value is the harmonic mean of precision and recall. The F1 value range is [0,1], where 1 represents the best output of the model and 0 represents the worst output of the model.
10. A public opinion propagation prediction system based on user social behavior, characterized in that: It includes partition module, clustering module, fusion module, feature module, evaluation module and assessment module, among which: The partitioning module is used to improve and divide the dataset categories according to the dataset form and content; The clustering module is used to perform sentiment analysis based on the content of the user's forwarded comments and to perform preliminary clustering of the topics of the user's forwarded tweets; The fusion module introduces the Ebbinghaus forgetting curve mathematical model and fuses it with the user topic features, and introduces the time-related interest decay into the feature construction of the propagation node; The feature module is used to construct the feature module of user nodes and prune the overall social network according to the propagation situation; The evaluation module is used to calculate the user's credibility and susceptibility based on historical forwarding data to construct a mask matrix and perform similarity evaluation on the propagation network of a specified event; The evaluation module is used to construct evaluation indicators for propagation prediction results.
Citation Information
Cited By
Public opinion joint prediction method and device fusing mechanism model and deep learning
CN120106316A
An Opinion Publicity Joint Prediction Method and Device Combining a Fusion Mechanism Model and Deep Learning
CN120106316B
Text user sentiment analysis method and system based on multiple modes and AI
CN120216700A
Method and system for predicting public opinion hotspot information based on AI
CN120338189A
Network public opinion analysis and prediction method and system based on space-time diagram neural network
CN122064875A