Microblog popularity prediction method based on graph neural network integrating text and time series information
By dividing and constructing subgraphs through sliding windows, combined with unsupervised graph neural network model extraction of features, it solves the problem of failing to consider the interrelationships of Weibo in the current technology of Weibo popularity prediction, and achieves better prediction effects and efficiency.
Patent Information
- Application Number
- CN202111470982.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-03
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2041-12-03
AI Technical Summary
Existing graph neural networks fail to effectively consider the interrelationships between microblogs in microblog popularity prediction, resulting in poor prediction results for newly issued microblogs, and the model needs to be rebuilt and trained.
A sliding window is used to divide the data set, construct text subgraphs and time series subgraphs, extract features through an unsupervised graph neural network model, and fuse the features of text subgraphs and time series subgraphs to predict Weibo popularity. Specific steps include data preprocessing, subgraph division, construction of text and time series subgraphs, feature extraction and Weibo popularity prediction, using the Deep Graph Informax model and multi-layer perceptron for prediction.
By considering the mutual influence and timing information between microblogs, the prediction accuracy of newly issued microblogs is improved, the need for model retraining is reduced, and the prediction efficiency is improved.
Smart Images

Figure CN114357271B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of neural network model design, and in particular relates to a microblog popularity prediction model based on a graph neural network that integrates text and time series information. Background Art
[0002] The heat prediction task is widely used in many fields including advertising, recommendation systems, and information retrieval, and has become a research focus. The existing heat prediction models generally use one or a combination of information such as user content, author, time, and user network structure. The main methods used include traditional machine learning methods, deep learning methods, point process methods, and graph neural network methods. Although there are currently methods using graph neural networks, the graph structure used is the network structure of the user's attention network and the microblog propagation network to extract microblog information, and the relationship between microblogs is still not considered. At present, graph neural networks are developing rapidly and are applied to various fields. However, using graph neural networks to construct a graph composed of microblog nodes to consider the mutual influence between microblogs will make the model unable to predict newly issued microblogs. It is necessary to reconstruct the graph composed of all data, extract features, and retrain the heat prediction model. Summary of the invention
[0003] In view of the above-mentioned prior art, the present invention provides a Weibo popularity prediction method based on graph neural network fusing text and time series information, which solves the problems existing in the prior art.
[0004] In order to solve the above technical problems, the steps of the microblog popularity prediction method proposed in the present invention are as follows:
[0005] Step 1: Data preprocessing: preprocess the text and time series data of microblogs;
[0006] Step 2: Subgraph data division: Use the sliding window data set division method to sort the data according to the time when the microblogs were sent, and then divide the data through a sliding window of fixed length. Get the text content and time series information of the microblog data in the window, and gradually move backward along the time axis according to a fixed step size to obtain the data information in the next window, so as to divide the data set into several data subsets;
[0007] Step 3: Construct text subgraph and time series subgraph: Construct graphs for each data subset, including: construct text subgraphs through microblog text and extracted keywords, and construct time series subgraphs through the trend information of microblog posts over a period of time;
[0008] Step 4: Feature extraction: All the obtained text subgraphs and time-series subgraphs are input into an unsupervised graph neural network model, and Deep Graph Informax (DGI) is used to extract features from the text subgraphs and time-series subgraphs. The output of the unsupervised graph neural network model is the feature representation of all microblog nodes in the text subgraphs and time-series subgraphs.
[0009] Step 5, Weibo popularity prediction: The feature representations of all Weibo nodes in the text subgraph and the time series subgraph are integrated with the popularity trend information of Weibo posts over a period of time to achieve feature fusion, and data is aligned according to Weibo IDs. Finally, the popularity of Weibo posts throughout their life cycle is predicted using a multi-layer perceptron.
[0010] Furthermore, the microblog popularity prediction method of the present invention includes:
[0011] The content of step 1 is: for the Weibo text part, the text data of the Weibo is cleaned, the stop words are removed, and the third-party python library jieba is used for word segmentation, and the analyze.extract_tags() function is used to extract the keywords of the Weibo text; for the Weibo time series part, the change in the number of forwarding of the current Weibo is obtained at fixed time intervals to obtain a sequence that changes with time, such as {p1, p2, p3...pt}, where t represents the number of records and pm represents the change in popularity from time m-1 to time m.
[0012] Step 3 includes:
[0013] 3-1) Constructing a text subgraph: For N microblog data in the sliding window, obtain their text information, extract C keywords through Jieba word segmentation, and construct a heterogeneous graph with N+C nodes, which is the text subgraph. Use this text subgraph to consider the mutual influence between microblogs; the steps are as follows:
[0014] 301) Edges between keyword nodes: The edges between two words are constructed by mutual information PMI. First, the text is cut into several windows of the same length, and then the PMI is calculated by counting the number of times the words appear in the windows. When the PMI is greater than the set threshold, the edge between the keyword nodes is constructed.
[0015] 302) Edges between keywords and text nodes: The edges between text and keywords are constructed by TF-IDF, where TF is the frequency of the word in the text and IDF is the inverse document frequency. The total number of texts and the number of texts containing the keyword are divided and the logarithm is taken. The product of the two is the final TF-IDF value. When TF-IDF is greater than the set threshold, the edge between the keyword and the text node is constructed.
[0016] 3-2) Construct a temporal subgraph: For the N Weibo data in the sliding window, obtain the temporal information of each Weibo, consider the mutual influence between the temporal information of Weibo, extract the features of the temporal information of Weibo through the convolutional neural network to obtain the adjacency matrix of the temporal subgraph, and use the temporal information of Weibo as the feature matrix to construct a homogeneous graph of N nodes, which is the temporal subgraph.
[0017] The content of step 301) is: divide the text content of the microblog into several windows, count the number of times the keywords appear in the windows, and use formula (1) to calculate the mutual information between the keywords.
[0018]
[0019]
[0020]
[0021] In formula (1), when w h and w k When it is a keyword node, Sw represents the total number of windows. h ) indicates that the keyword node w is included h The number of windows, Sw(w h ,w k ) means that it also includes the keyword node w h and keyword node w k The number of windows.
[0022] The content of step 302) is: the text subgraph includes text nodes and keyword nodes, the time sequence information of microblogs is used as the feature of the text node, and then as the feature matrix of the text subgraph, the adjacency matrix of the text subgraph is obtained by TF-IDF to obtain the edge between the text node and the keyword node, and the edge between the keyword nodes is obtained by PMI, and the adjacency matrix is obtained by the formula:
[0023]
[0024] In formula (2), when w h and w k When all are keyword nodes in the text subgraph, PMI is used to obtain the edges between keyword nodes; when w h and w k When they are text nodes and keyword nodes in the text subgraph respectively, TF-IDF is used to obtain the edge between the text node and the keyword node, г1 is the threshold of PMI, г2 is the threshold of TF-IDF, and A text is the adjacency matrix of the text subgraph.
[0025] The content of step 3-2) is as follows:
[0026] The adjacency matrix of the temporal subgraph is calculated using a convolutional neural network, and the formula is as follows:
[0027] T′ i =tanh(Conv(T i )),
[0028]
[0029] In formula (3), i is the microblog node in the time series subgraph, T i is the time series information of microblog node i, tanh is the activation function, Conv is the convolutional neural network, T` i A is the intermediate feature representation extracted by the convolutional neural network. trend is the adjacency matrix of the temporal subgraph.
[0030] Step 4 is to perform feature representation on the text subgraph and the time series subgraph through an unsupervised graph neural network model, and obtain the feature representation of the node by maximizing the mutual information between the local representation and the global feature. The local representation is the feature of the node and its surrounding neighbors, and the global feature includes the feature of the specified subgraph. The specific process is as follows:
[0031] Use the erosion function to transform the adjacency matrix and feature matrix of the text subgraph and the time subgraph respectively to obtain negative samples; use the encoder GCN to encode the text subgraph and the time subgraph respectively to obtain the node representation of the positive sample; use the encoder GCN to encode the negative sample to obtain the node representation of the negative sample; use the Readout function to obtain the global feature representation of the text subgraph and the time subgraph respectively, that is, the feature representation of each node is added and averaged; optimize through the discriminator and loss function, and finally obtain the feature representation of all the microblog nodes in the text subgraph and the time subgraph.
[0032] Compared with the prior art, the present invention has the following beneficial effects:
[0033] Combining the content information of the text used in the existing methods and the time series information formed by the initial heat of the Weibo propagation, the mutual influence between Weibo is considered by using text graphs and time series graphs. At the same time, the sliding window division sub-graph method solves the problem that the model cannot predict the newly issued Weibo to a certain extent. Compared with the existing technology, it has better prediction results and can quickly obtain better prediction results for newly issued Weibo when using less time series information. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 This is a flow chart of the Weibo popularity prediction method based on graph neural network fusion of text and time series information of the present invention. DETAILED DESCRIPTION
[0035] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, but the following embodiments are by no means intended to limit the present invention in any way.
[0036] The design concept of the microblog popularity prediction method based on the graph neural network that fuses text and time series information is as follows: it includes 4 main invention contents: a sliding window data set division method, two composition methods, an unsupervised graph neural network feature extraction module and a popularity prediction model; after sliding the window, the data set is divided according to the movement, and each time the microblog data falling inside the window has a text graph and a time series graph constructed for its text content and time series information respectively, the feature extraction module extracts node features through unsupervised DGI, and the popularity prediction model is used to fuse the features of the text subgraph and the time series subgraph with the separate time series information, and a multi-layer perceptron is used to predict the final popularity. Figure 1 As shown, the steps are as follows:
[0037] Step 1: Data preprocessing:
[0038] The data of the text part and the time series part of the Weibo are preprocessed; for the Weibo text part, the text data of the Weibo is cleaned to remove the stop words, and the third-party python library jieba is used for word segmentation, and the analyze.extract_tags() function is used to extract the keywords of the Weibo text; for the Weibo time series part, the change in the number of forwarding of the current Weibo is obtained at fixed time intervals to obtain a sequence that changes with time, such as {p1, p2, p3...pt}, where t represents the number of records and pm represents the change in popularity from time m-1 to time m.
[0039] Step 2: Sub-graph data division:
[0040] The sliding window data set partitioning method is used to sort the data according to the time when the microblogs are sent, and then the data is segmented through a sliding window of fixed length. The text content and time series information of the microblog data in the window are obtained respectively, and the data information in the next window is obtained by gradually moving backward along the time axis according to a fixed step size, thereby dividing the data set into several data subsets;
[0041] Step 3: Construct text subgraph and time subgraph:
[0042] Graphs are constructed for each data subset, including: constructing a text subgraph through microblog text and extracted keywords, and constructing a time series subgraph through the trend information of microblog posts over a period of time;
[0043] 3-1) Constructing a text subgraph: For N microblog data in the sliding window, obtain their text information, extract C keywords through Jieba word segmentation, and construct a heterogeneous graph with N+C nodes, which is the text subgraph. Use this text subgraph to consider the mutual influence between microblogs; the steps are as follows:
[0044] 301) Edges between keyword nodes: The edges between two words are constructed by mutual information PMI. First, the text is cut into several windows of the same length, and then the PMI is calculated by counting the number of times the words appear in the windows. When the PMI is greater than the set threshold, the edge between the keyword nodes is constructed.
[0045] Specifically, the text content of the microblog is divided into several windows, the number of times the keywords appear in the windows is counted, and the mutual information between the keywords is calculated using formula (1).
[0046]
[0047]
[0048]
[0049] In formula (1), when w h and w k When it is a keyword node, Sw represents the total number of windows. h ) indicates that the keyword node w is included h The number of windows, Sw(w h ,w k ) means that it also includes the keyword node w h and keyword node w k The number of windows.
[0050] 302) Edges between keywords and text nodes: The edges between text and keywords are constructed through TF-IDF, where TF is the frequency of the word in the text and IDF is the inverse document frequency. The total number of texts and the number of texts containing the keyword are divided and their logarithms are taken. The product of the two is the final TF-IDF value. When TF-IDF is greater than the set threshold, the edge between the keyword and the text node is constructed.
[0051] Specifically, the text subgraph includes text nodes and keyword nodes. The time sequence information of the microblog is used as the feature of the text node, and then as the feature matrix of the text subgraph. The adjacency matrix of the text subgraph is obtained by obtaining the edges between the text node and the keyword node through TF-IDF, and the edges between the keyword nodes through PMI. The adjacency matrix acquisition formula is:
[0052]
[0053] In formula (2), when w h and w k When all are keyword nodes in the text subgraph, PMI is used to obtain the edges between keyword nodes; when w h and w k When they are text nodes and keyword nodes in the text subgraph respectively, TF-IDF is used to obtain the edge between the text node and the keyword node, г1 is the threshold of PMI, г2 is the threshold of TF-IDF, and A text is the adjacency matrix of the text subgraph.
[0054] 3-2) Construct a temporal subgraph: For the N Weibo data in the sliding window, obtain the temporal information of each Weibo, consider the mutual influence between the temporal information of Weibo, extract the features of the temporal information of Weibo through the convolutional neural network to obtain the adjacency matrix of the temporal subgraph, and use the temporal information of Weibo as the feature matrix to construct a homogeneous graph of N nodes, which is the temporal subgraph.
[0055] Specifically, the adjacency matrix of the temporal subgraph is calculated by a convolutional neural network, and the formula is as follows:
[0056] T′ i =tanh(Conv(T i )),
[0057]
[0058] In formula (3), i is the microblog node in the time series subgraph, T i is the time series information of microblog node i, tanh is the activation function, Conv is the convolutional neural network, T` i A is the intermediate feature representation extracted by the convolutional neural network. trend is the adjacency matrix of the temporal subgraph.
[0059] Step 4: Feature extraction: All the obtained text subgraphs and time-series subgraphs are input into an unsupervised graph neural network model, and Deep Graph Informax (DGI) is used to extract features from the text subgraphs and time-series subgraphs. The output of the unsupervised graph neural network model is the feature representation of all microblog nodes in the text subgraphs and time-series subgraphs.
[0060] Specifically, the text subgraph and time subgraph are represented by features through an unsupervised graph neural network model, and the feature representation of the node is obtained by maximizing the mutual information between the local representation and the global feature. The local representation is the feature of the node and its surrounding neighbors, and the global feature includes the feature of the specified subgraph. The specific process is as follows:
[0061] Use the erosion function to transform the adjacency matrix and feature matrix of the text subgraph and the time sequence subgraph respectively to obtain negative samples;
[0062] Use the encoder GCN to encode the text subgraph and the time subgraph respectively to obtain the node representation of the positive sample;
[0063] Use encoder GCN to encode negative samples and obtain node representation of negative samples;
[0064] Use the Readout function to obtain the global feature representation of the text subgraph and the time series subgraph, that is, add up the feature representations of each node and take the average;
[0065] Through optimization by the discriminator and loss function, we finally get the feature representation of all the microblog nodes in the text subgraph and the time series subgraph.
[0066] In the present invention, the Readout function uses formula (4) to synthesize the feature representations of each node in the subgraph to obtain the global feature representation of the subgraph. Other methods can also be used to obtain the global feature representation.
[0067]
[0068] In formula (4), is the global feature representation of the subgraph, is the feature representation of microblog node i, and N is the number of microblog nodes in the subgraph.
[0069] The loss function can be calculated using formula (5), and finally the feature representation of microblog nodes is obtained in all the text subgraphs and time series subgraphs.
[0070]
[0071] In formula (5), L is the loss function, N is the number of nodes in the subgraph, M is the number of nodes in the negative sample, X is the feature matrix of the subgraph, A is the adjacency matrix of the subgraph, E(X,A) is the encoder GCN, is the discriminator, is the feature matrix of negative samples, is the adjacency matrix of negative samples.
[0072] Step 5, Weibo popularity prediction: The feature representations of all Weibo nodes in the text subgraph and the time series subgraph are integrated with the popularity trend information of Weibo posts over a period of time, and the data is aligned according to the Weibo ID. Finally, the popularity of the Weibo throughout its life cycle is predicted through a multi-layer perceptron.
[0073] Although the present invention has been described above in conjunction with the accompanying drawings, the present invention is not limited to the above-mentioned specific embodiments, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can make many modifications without departing from the purpose of the present invention, all of which are within the protection of the present invention.
Claims
1. A method for predicting microblog popularity based on graph neural network integrating text and time series information, characterized in that: include: Step 1: Data preprocessing: preprocess the text and time series data of microblogs; Step 2: Subgraph data division: Use the sliding window data set division method to sort the data according to the time when the microblogs were sent, and then divide the data through a sliding window of fixed length. Get the text content and time series information of the microblog data in the window, and gradually move backward along the time axis according to a fixed step size to obtain the data information in the next window, so as to divide the data set into several data subsets; Step 3: Construct text subgraph and time series subgraph: Construct graphs for each data subset, including: construct text subgraphs through microblog text and extracted keywords, and construct time series subgraphs through the trend information of microblog posts over a period of time; the specific contents include: 3-1) Constructing a text subgraph: For N microblog data in the sliding window, obtain their text information, extract C keywords through Jieba word segmentation, and construct a heterogeneous graph with N+C nodes, which is the text subgraph. Use this text subgraph to consider the mutual influence between microblogs; the steps are as follows: 301) Edges between keyword nodes: The edges between two words are constructed by mutual information PMI. First, the text is cut into several windows of the same length, and then the PMI is calculated by counting the number of times the words appear in the windows. When the PMI is greater than the set threshold, the edge between the keyword nodes is constructed. 302) Edges between keywords and text nodes: The edges between text and keywords are constructed by TF-IDF, where TF is the frequency of the word in the text and IDF is the inverse document frequency. The total number of texts and the number of texts containing the keyword are divided and the logarithm is taken. The product of the two is the final TF-IDF value. When TF-IDF is greater than the set threshold, the edge between the keyword and the text node is constructed. 3-2) Constructing a time-series subgraph: For the N microblog data in the sliding window, obtain the time-series information of each microblog, consider the mutual influence between the microblog time-series information, extract the features of the microblog time-series information through the convolutional neural network to obtain the adjacency matrix of the time-series subgraph, and use the microblog time-series information as the feature matrix to construct a homogeneous graph of N nodes, which is the time-series subgraph; Step 4: Feature extraction: All the obtained text subgraphs and time-series subgraphs are input into an unsupervised graph neural network model, and Deep Graph Informax (DGI) is used to extract features from the text subgraphs and time-series subgraphs. The output of the unsupervised graph neural network model is the feature representation of all microblog nodes in the text subgraphs and time-series subgraphs. Step 5, Weibo popularity prediction: The feature representations of all Weibo nodes in the text subgraph and the time series subgraph are integrated with the popularity trend information of Weibo posts over a period of time to achieve feature fusion, and data is aligned according to Weibo IDs. Finally, the popularity of Weibo posts throughout their life cycle is predicted through a multi-layer perceptron.
2. The microblog popularity prediction method according to claim 1, characterized in that: The contents of step 1 are as follows: For the microblog text part, the text data of the microblog is cleaned to remove the stop words, and the third-party python library jieba is used for word segmentation, and the analyze.extract_tags() function is used to extract the keywords of the microblog text; For the microblog time series part, the change in the number of reposts of the current microblog is obtained at fixed time intervals to obtain a sequence that changes over time, such as {p1, p2, p3...pt}, where t represents the number of records and pm represents the change in popularity from time m-1 to time m.
3. The microblog popularity prediction method according to claim 1, characterized in that: The content of step 301) is as follows: The text content of the microblog is divided into several windows, the number of times the keywords appear in the windows is counted, and the mutual information between the keywords is calculated using formula (1). In formula (1), when w h and w k When it is a keyword node, Sw represents the total number of windows. h ) indicates that the keyword node w is included h The number of windows, Sw(w h ,w k ) means that it also includes the keyword node w h and keyword node w k The number of windows.
4. The microblog popularity prediction method according to claim 1, characterized in that: The content of step 302) is as follows: The text subgraph includes text nodes and keyword nodes. The time series information of microblogs is used as the feature of the text node, and then as the feature matrix of the text subgraph. The adjacency matrix of the text subgraph is obtained by obtaining the edges between the text node and the keyword node through TF-IDF, and the edges between the keyword nodes through PMI. The adjacency matrix acquisition formula is: In formula (2), when w h and w k When all are keyword nodes in the text subgraph, PMI is used to obtain the edges between keyword nodes; when w h and w k When they are text nodes and keyword nodes in the text subgraph respectively, TF-IDF is used to obtain the edge between the text node and the keyword node, г1 is the threshold of PMI, г2 is the threshold of TF-IDF, and A text is the adjacency matrix of the text subgraph.
5. The microblog popularity prediction method according to claim 1, characterized in that: The content of step 3-2) is as follows: The adjacency matrix of the temporal subgraph is calculated using a convolutional neural network, and the formula is as follows: T' i =tanh(Conv(T i )), In formula (3), i is the microblog node in the time series subgraph, T i is the time series information of microblog node i, tanh is the activation function, Conv is the convolutional neural network, T` i A is the intermediate feature representation extracted by the convolutional neural network. trend is the adjacency matrix of the temporal subgraph.
6. The microblog popularity prediction method according to claim 1, characterized in that: The contents of step 4 are as follows: The text subgraph and time subgraph are represented by features through an unsupervised graph neural network model, and the feature representation of the node is obtained by maximizing the mutual information between the local representation and the global feature. The local representation is the feature of the node and its surrounding neighbors, and the global feature includes the feature of the specified subgraph. The specific process is as follows: Use the erosion function to transform the adjacency matrix and feature matrix of the text subgraph and the time sequence subgraph respectively to obtain negative samples; Use the encoder GCN to encode the text subgraph and the time subgraph respectively to obtain the node representation of the positive sample; Use encoder GCN to encode negative samples and obtain node representation of negative samples; Use the Readout function to obtain the global feature representation of the text subgraph and the time series subgraph, that is, add up the feature representations of each node and take the average; Through optimization by the discriminator and loss function, we finally get the feature representation of all the microblog nodes in the text subgraph and the time series subgraph.
