A method for predicting users' future interactive behavior in social networks

Through the joint representation learning of community-aware temporal biased walks and the DyCDUP model, the problem of difficulty in capturing the dynamic behavior of social network users in the existing technology is solved, and the accuracy and efficiency of predicting users' future interactive behavior are improved.

CN114969540BInactive Publication Date: 2024-10-29CHONGQING UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210658125.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-10
Publication Date
2024-10-29
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing technologies are difficult to effectively capture the dynamic behavior evolution and periodicity of users in social networks, resulting in prediction models that are computationally expensive and have poor prediction results when the network structure changes.

Method used

The community-aware temporal biased walk is used to obtain the node's initial encoding vector and neighborhood sequence, and joint representation learning is performed through the DyCDUP model (including the neighborhood attention layer and the temporal attention layer) to generate the final feature vector of the node, and logistic regression is used The classifier predicts future interaction probabilities.

Benefits of technology

Effectively captures user periodic behaviors and interactive change trends in dynamic social networks, improving the accuracy and efficiency of predicting users' future interactive behaviors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114969540B_ABST
    Figure CN114969540B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for predicting future interactive behaviors of users in a social network. The method comprises the following steps: obtaining a user historical neighborhood sequence nodeSeq from time period t-ttl to t through a community-aware time-series biased walk, and encoding and representing the user's initial feature vector; then inputting the user feature vector from time period t-ttl to t and the historical neighborhood sequence nodeSeq into the neural network model DyCDUP of this paper, training in the joint representation learning of the neighborhood layer and the time-series layer, and obtaining the user's final feature vector; performing hadmard encoding on the two user node feature vectors as the interactive features between the two users, and inputting all the existing interactive features from time period t-ttl to t into a logistic regression classifier for training; finally, by inputting the interactive features of the two users into the trained logistic regression classifier, predicting the probability of the two users interacting in time period t+1. The present invention can provide a more accurate user future interactive prediction effect and effectively predict future interactive behaviors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of information recognition and processing of dynamic time series data, and in particular relates to a method for predicting future interactive behaviors of users in a social network. Background Art

[0002] In the context of Internet big data, how to effectively utilize users' social information and achieve accurate recommendations on content, goods and services has important commercial value. With a huge number of users, personalized needs vary depending on their region, age, gender, hobbies and other information. User behavior in the real world is somewhat cyclical and evolves over time. How to effectively capture the cyclical behavior of users in social networks and timely update the latest behavior patterns of users (evolution of user social interaction) is the focus and difficulty of current research.

[0003] In view of the huge amount of information in the network, current prediction models have adopted the idea of ​​embedding dimensionality reduction to realize the node representation of the network. The network dimension is reduced from |V|*|V| to |V|*P, P<<|V|. Researchers have proposed many methods to obtain low-dimensional embedding representation of the network, such as matrix decomposition (SVD), Skip-gram (DeepWalk, Node2Vec), autoencoder (SDNE), etc. Most of the research methods are based on static networks, while the networks in the real world are dynamic and have evolutionary power. Since static models process static data, when the network structure changes, they often need to be retrained, which costs a huge computational cost. At the same time, such methods cannot effectively capture the evolutionary behavior of the network. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a method for predicting future interaction behaviors of users in a social network in view of the deficiencies of the above-mentioned prior art. The method can provide a more accurate prediction effect of future links of users and effectively predict future interaction behaviors.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is: a method for predicting future interactive behavior of users in a social network, the method comprising:

[0006] S1. Obtain the initial coding vector and neighborhood sequence of the node from the t-ttl period to the t period through community-aware time-series biased walk; the node refers to the user in the community;

[0007] S2. The initial encoding vector and neighborhood sequence of the node from the t-ttl period to the t period are used to train in the DyCDUP model joint representation learning until the preset training conditions are met. The DyCDUP model training is completed and the final feature vector of the node is output; the DyCDUP model includes a neighborhood attention layer and a temporal attention layer in sequence; the neighborhood attention layer is used to aggregate the interaction of nodes in the same community structure, and the temporal attention layer is used to capture the evolution of the interaction between nodes along the period;

[0008] S3, using the final feature vector of the output node in S2, select the final feature vectors of two sample nodes for hadmard encoding to obtain the interaction feature vectors of the two sample nodes, and combine the actual interaction conditions of the two sample nodes to perform positive and negative sampling. Positive sampling refers to all interaction information that has occurred, and negative sampling refers to interactions that have not occurred in existing interactions. The sampling results are used to train the logistic regression classifier;

[0009] S4. From the final feature vector set of the node, select the feature vectors of the two target nodes to form an interaction feature vector and input it into the trained logistic regression classifier to predict the future interaction probability of the two target nodes.

[0010] Preferably, in S1, obtaining the initial coding vector of the node from the (t-ttl)th time period to the tth time period through the community-aware time-series biased walk includes:

[0011] The time when the last interaction occurs in the tth period is taken as the initial time t′, t′=max(E t ), the node walks in reverse time, and each time selects the next node from the neighborhood neighbors according to the random walk probability, and repeats the selection of the next node multiple times until the walk sequence reaches l times, and each node walks ω times as the starting node, thereby obtaining the walk sequence of the node perceived by the community, and the initial encoding vector of the node in the tth time period is obtained according to the walk sequence through the word2vec algorithm; the neighborhood neighbors include the time sequence neighbors Γ t (v) and community neighbors C t (v) ;

[0012] Specifically, the node's walk selection of the next node at time k is carried out according to the following rules:

[0013] Based on the set community-aware random walk parameter δ, each time the next node is selected, a random number r is generated, and the next node is selected according to the random walk probability. When r ≥ δ, the next node is selected from the temporal neighbors at time k as the next node, otherwise, a node of the community neighbors in the same community is selected as the next node;

[0014] The function of the random walk probability is: Among them, δ represents the random walk parameter, r represents the random number, P temporal (k) represents the probability of the temporal neighbor at time k being selected; P community (k) represents the probability of being selected as a community neighbor in the same community at time k.

[0015] The acquisition of the neighborhood sequence in S1 includes:

[0016] According to the obtained node's community-perceived walk sequence, the node's neighborhood sequence nodeSeq = {(v1, t1) → (v2, t2) → ... → (v i ,t i )→…→(v l ,t l )},v i ∈V,t1≥t2≥…≥t i ≥…≥t l , that is, the node sequence is arranged in descending order according to the timestamp, and the neighborhood sequence after each time reverse walk is traversed in turn, and a fixed number of nodes before and after the node in the neighborhood sequence are taken to add to the neighborhood set Ns of the node.

[0017] Preferably, the calculation method for training the neighborhood attention layer in the DyCDUP model in S2 includes:

[0018] The initial encoding vector of the node from the t-ttl period to the t period is defined as a D-dimensional vector, and the D-dimensional vector is converted into a node vector with F dimensions by calculating the weight formula of the neighborhood attention layer; the calculation formula of the weight coefficient is:

[0019]

[0020] Among them, α uv Represents the weight coefficient of node u relative to node v; The neighborhood set is obtained from the neighborhood sequence NodeSeq of node v in the i-th period, V represents the node set in the network, T' represents the timestamp set of the interaction event, E t Represents the interaction set of all nodes in the network at time t, and several nodes are preset before and after node v as the neighborhood set m is a node in the neighborhood set Ns, W is a transfer matrix; a is the weight vector parameter of the model function of the neighborhood attention layer; || represents a series operation, σ is a nonlinear activation function, A uv Indicates the current dynamic network time G i The weight of the edge (u,v), Represents the initial encoding vector of node v at time i;

[0021] according to Relative to the weight coefficient of node v, calculate the neighborhood embedding of node v in the i-th period; the calculation formula is:

[0022] Where σ represents the activation function LeakyRELU, represents the initial encoding vector of node v in the i-th period, W s represents the transfer matrix of the neighborhood attention layer, represents the weight coefficient of node u relative to node v in the i-th period;

[0023] The neighborhood embedded vector is split into hs multi-head mechanisms to obtain sub-vectors, and self-attention calculation is performed between the sub-vectors. The embedded vector obtained for the node The specific calculation formula of the long mechanism is:

[0024]

[0025]

[0026]

[0027]

[0028] in It represents the embedding representation of node v output by the neighborhood attention layer in period i. The embedding vector output by each node in period i is finally expressed as The feature vector set R of all nodes in the network in period t F , F represents the vector dimension; qu represents the query of the neighborhood attention layer, ke represents the key of the neighborhood attention layer, and va represents the value of the neighborhood attention layer;

[0029] After each period is trained by the neighborhood attention layer, the final output is

[0030] Preferably, the calculation method of the temporal attention layer in S2 includes:

[0031] The output of the neighborhood attention As the input of the temporal attention layer, where t∈T, T is the total number of time periods, T=t-ttl+1;

[0032] Calculate the attention weight coefficient of the temporal attention layer. The calculation formula is as follows:

[0033]

[0034]

[0035] where β v is the attention weight matrix of node v, Is β v The attention weight coefficient from the i-th period to the j-th period in the time series indicates the influence of the interaction information of the v node in the i-th period on the j-th period. P represents the intermediate dimension of the matrix. Qt, Kt, and Vt in the temporal attention mechanism are Qt represents the query of the neighborhood attention layer, Kt represents the key of the neighborhood attention layer, Vt represents the value of the neighborhood attention layer, and W qt ,W kt ,W vt ∈R F×P , W q ,W k ,W v represents the transfer matrix;

[0036] according to Relative to the attention weight coefficient of the v node, calculate the temporal embedding of the v node in the i-th period; the calculation formula is:

[0037] in The attention weight coefficient from the t'th period to the i-th period, W t is the transfer matrix of the temporal attention layer; similarly to the neighborhood attention layer, the vector of the temporal embedding Use ht multi-head mechanism to split and get sub-vectors, perform self-attention calculation between sub-vectors, and get Z∈R P ,P<<|V|, |V| represents the number of user nodes in time period i.

[0038] Preferably, the preset training condition described in S2 is: the initial coding vector and neighborhood sequence of the node from the t-ttl period to the t period are trained in the DyCDUP model joint representation learning until the loss function Loss converges, that is, the DyCDUP model is trained for 5 consecutive times, the loss function Loss does not decrease, or the number of training times reaches the set epochs parameter, and the training is terminated.

[0039] Preferably, the formula of the loss function Loss is:

[0040]

[0041] Among them, σ is the sigmoid activation function, <.> represents the inner product operation, represents the neighborhood set of node v at time t, represents the negative sampling in the network at time t, x n Represents the negative sampling rate, which is used to balance positive and negative sampling.

[0042] Preferably, training a logistic regression classifier in S3 includes:

[0043] Positive and negative sampling is performed on the known interaction information of the two sample nodes from the t-ttl period to the t period as a training set, wherein all interactions existing in the known interaction information are used as positive sampling, and no interaction is used as negative sampling. The feature vectors of the two sample nodes in the training set are combined to form an interaction feature vector to train the logistic regression classifier model.

[0044] Preferably, in S4, the feature vectors of two target nodes are selected from the final feature vector set of the nodes in time period t to form an interaction feature vector, which is input into a trained logistic regression classifier to predict the future interaction probability of the two target nodes, specifically including:

[0045] From the final feature vector of the node in time period t output after the DyCDUP model training is completed, the feature vectors of the two target nodes are selected for dot product to represent the interactive feature vector of the two target nodes u and v Then input into the trained logistic regression classifier for prediction.

[0046] Compared with the prior art, the present invention has the following advantages:

[0047] 1. The present invention obtains the initial coding vector and neighborhood sequence of the node from the (t-ttl)th period to the tth period through community-aware time-series biased walk, pays attention to the evolution of the dynamic community structure in the continuous time network, and then trains the DyCDUP model according to the initial coding vector and neighborhood sequence of the node from the t-ttlth period to the tth period. The DyCDUP model includes a neighborhood attention layer and a temporal attention layer. The neighborhood attention layer is used to aggregate the interaction of nodes in the same community structure, and the temporal attention layer is used to capture the evolution of the interaction between nodes along the time period. The node microstructure and macro community structure are integrated into the neighborhood structure of the node, which effectively captures the periodic behavior and interaction change trend of users in the dynamic social network, and obtains a better prediction effect.

[0048] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 It is a schematic diagram of the process of the present invention.

[0050] Figure 2 Schematic diagram of the DyCDUP model of the present invention.

[0051] Figure 3 It is the embedded representation of the nodes in the network output by the DyCDUP model in the application example of the present invention. DETAILED DESCRIPTION

[0052] Example 1

[0053] In this embodiment, users in a social network are abstracted as nodes of the network, and the interactions between users are abstracted as edges between two users, and the timestamp of the interaction is used as the third attribute information. A dynamic social network is represented as G = (V, E, T'), where V represents the set of nodes in the network, and E represents the set of edges connecting nodes in the network. u,v |u,v∈V}, represents an interaction event between nodes u and v, T' represents the timestamp set of the interaction event, so the dynamic network G=(V,E,T)={(e1,t1),(e2,t2),...}.

[0054] like Figure 1 As shown, a method for predicting future interactive behavior of users in a social network according to an embodiment of the present invention includes:

[0055] S1. Obtain the initial coding vector and neighborhood sequence of the node from the (t-ttl)th period to the tth period through community-aware time-series biased walk; the node refers to the user in the community; specifically includes:

[0056] The time when the last interaction occurs in the tth period is taken as the initial time t′, t′=max(E t ), the node walks in reverse time, and each time selects the next node from the neighborhood neighbors according to the random walk probability, and repeats the selection of the next node multiple times until the walk sequence reaches l times, and each node walks ω times as the starting node, thereby obtaining the walk sequence of the node perceived by the community, and the initial encoding vector of the node in the tth time period is obtained according to the walk sequence through the word2vec algorithm; the neighborhood neighbors include the time sequence neighbors Γ t (v) and community neighbors C t (v) ;

[0057] More specifically, the node's walk selection of the next node at time k is performed according to the following rules:

[0058] Based on the set community-aware random walk parameter δ, each time the next node is selected, a random number r is generated, and the next node is selected according to the random walk probability. When r ≥ δ, the next node is selected from the temporal neighbors at time k as the next node, otherwise, a node in the community neighbors in the same community is selected as the next node;

[0059] The function of the random walk probability is: Among them, δ represents the random walk parameter, r represents the random number, P temporal(k) represents the probability of selecting a temporal neighbor in the same community at time k; P community (k) represents the probability of being selected as a community neighbor in the same community at time k.

[0060]

[0061] Where w represents a node in the temporal neighborhood, w∈Γ t (v), τ(v) represents the time when the node last interacted before time t, t vk Indicates the timestamp of the edge e=(v,k,t) of the currently selected walk.

[0062]

[0063] Among them, the function selects the power function exp; C t (v) represents the community to which node v belongs at time t; m represents C t (v) is a node in the

[0064] According to the obtained node's community-perceived walk sequence, the node's neighborhood sequence nodeSeq = {(v1, t1) → (v2, t2) → ... → (v i ,t i )→…→(v l ,t l )},v i ∈V,t1≥t2≥…≥t i ≥…≥t l , that is, the node sequence is arranged in descending order according to the timestamp, and the neighborhood sequence after each time reverse walk is traversed in turn, and a fixed number of nodes before and after the node in the neighborhood sequence are taken to add to the neighborhood set Ns of the node.

[0065] S2. The initial coding vectors and neighborhood sequences of the nodes from the t-ttl period to the t period are used for training in the DyCDUP model joint representation learning. The model parameters are adjusted in each round of training of the DyCDUP model until the preset training conditions are met. The DyCDUP model training is completed and the final feature vector of the node is output. The DyCDUP model includes a neighborhood attention layer and a temporal attention layer in sequence. The neighborhood attention layer is used to aggregate the interaction of nodes in the same community structure, and the temporal attention layer is used to capture the evolution of the interaction between nodes along the time period.

[0066] S3, using the final feature vector of the output node in S2, select the final feature vectors of two sample nodes for hadmard encoding to obtain the interaction feature vectors of the two sample nodes, and combine the actual interaction conditions of the two sample nodes to perform positive and negative sampling. The sampling results are used to train the logistic regression classifier;

[0067] S4. From the final feature vector set of the node, select the feature vectors of two target nodes to form an interaction feature vector and input it into the trained logistic regression classifier to predict the future interaction probability of the two target nodes, that is, the interaction probability in the t+1 period.

[0068] In this embodiment, the schematic diagram of the DyCDUP model is as follows: Figure 2 The calculation method for training the neighborhood attention layer in the DyCDUP model described in S2 includes:

[0069] The initial encoding vector of the node from the t-ttl period to the t period is defined as a D-dimensional vector, and the D-dimensional vector is converted into a node vector with F dimensions by calculating the weight formula of the neighborhood attention layer; the calculation formula of the weight coefficient is:

[0070]

[0071] Among them, α uv Represents the weight coefficient of node u relative to node v; is obtained from the neighborhood sequence NodeSeq of node v in the i-th period, V represents the set of nodes in the network, T' represents the timestamp set of the interaction event, E t Represents the interaction set of all nodes in the network at time t, and several nodes are preset before and after node v as the neighborhood set m is a node in the neighborhood set Ns, W is a transfer matrix; a is the weight vector parameter of the model function of the neighborhood attention layer; || represents a series operation, σ is a nonlinear activation function, A uv Indicates the current dynamic network time G i The weight of the edge (u,v), Represents the initial encoding vector of node v at time i;

[0072] according to Relative to the weight coefficient of node v, calculate the neighborhood embedding of node v in the i-th period; the calculation formula is:

[0073] Where σ represents the activation function LeakyRELU, represents the initial encoding vector of node v in the i-th period, W s represents the transfer matrix of the neighborhood attention layer, represents the weight coefficient of node u relative to node v in the i-th period;

[0074] The neighborhood embedded vector is split into hs multi-head mechanisms to obtain sub-vectors, and self-attention calculation is performed between the sub-vectors. The embedded vector obtained for the node The specific calculation formula of the long mechanism is:

[0075]

[0076]

[0077]

[0078]

[0079] in It represents the embedding representation of node v output by the neighborhood attention layer in period i. The embedding vector output by each node in period i is finally expressed as The feature vector set R of all nodes in the network in period t F , F represents the vector dimension; qu represents the query of the neighborhood attention layer, ke represents the key of the neighborhood attention layer, and va represents the value of the neighborhood attention layer;

[0080] After each period is trained by the neighborhood attention layer, the final output is Represents the feature vector set R of all user nodes in the network during period t F , F represents the dimension F of a single vector in the vector set. F<<|V| means that the network is reduced from the adjacency matrix |V|*|V| to F*|V|. The input of the neighborhood attention layer is the dynamic network snapshot G i , G i ∈G and a set of input nodes denoted Where D is the embedding dimension of the input. The input of the neighborhood attention layer is set to the NodeSeq sequence generated by the community-aware random walk for each node, and the encoding vector is calculated by the word2vec algorithm. The output is a set of new node representations with F dimensions. They capture snapshots G i Neighborhood structure characteristics.

[0081] In this embodiment, the calculation method of the temporal attention layer in S2 includes:

[0082] The output of the neighborhood attention As the input of the temporal attention layer, t∈T, T is the total number of time periods, T=t-ttl+1; F is the vector dimension of the neighborhood attention layer output, which is also the dimension of the temporal attention layer input. This layer outputs a new representation sequence of the node set V at each time snapshot Each sequence is a P-dimensional vector; node v learns at time t The vector is used as input. The vector represents the neighborhood information characteristics of node v in time period t, which incorporates the node microstructure and macro community structure. The model is modeled by tracking the evolution of the historical neighborhood of node v using the attention mechanism to obtain the latest evolution information of node v. In order to prevent interference from distant historical information, the calculation formula of the attention weight coefficient of the temporal attention layer is as follows:

[0083]

[0084]

[0085] where β v is the attention weight matrix of node v, Is β v The attention weight coefficient from the i-th period to the j-th period in the time series indicates the influence of the interaction information of the v node in the i-th period on the j-th period. P represents the intermediate dimension of the matrix. Qt, Kt, and Vt in the temporal attention mechanism are Qt represents the query of the neighborhood attention layer, Kt represents the key of the neighborhood attention layer, Vt represents the value of the neighborhood attention layer, and W qt ,W kt ,W vt ∈R F×P , W q ,W k ,W v represents the transfer matrix; |V| represents the number of user nodes in period i;

[0086] To ensure the correctness of the timing, when time i≤j, the historical neighborhood information is used to make predictions. Otherwise, -∞ is used to remove illegal aggregate information to prevent the use of future information to predict past interactions. Relative to the attention weight coefficient of the v node, calculate the temporal embedding of the v node in the i-th period; the calculation formula is:

[0087] in Is β v The attention weight coefficient from the t'th period to the i-th period, W t is the transfer matrix of the temporal attention layer; similarly to the neighborhood attention layer, the vector of the temporal embedding Use ht multi-head mechanism to split and get sub-vectors, perform self-attention calculation between sub-vectors, and get Z∈R P ,P<<|V|, |V| represents the number of user nodes in time period i.

[0088] Finally, the community-aware temporal attention layer outputs {Z∈RP ,P<<|V|},{Z∈R P ,P<<|V|} is used to represent the feature set of nodes in each time period.

[0089] In this embodiment, the preset training conditions described in S2 are: In this embodiment, 30% of the interaction data stored in time period t is used as the verification set, and the remaining interaction data from time period t-ttl to time period t is used as the training set, which is input into the DyCDUP model for joint representation training of neighborhood and time series. The loss function Loss is calculated after each round of training, and the parameters in the model are updated using the gradient descent algorithm Adam optimizer until the loss function Loss converges, that is, the DyCDUP model is trained for 5 consecutive times, and the loss function Loss does not decrease, or the number of training times reaches the set epochs parameter, the training is terminated, and the final trained node feature vector set Z is output.

[0090] After the DyCDUP model learns the representation of nodes in the dynamic network, it uses link prediction for verification. At this time, it is necessary to determine whether there is an edge (interaction) between two nodes (users). For this type of problem, it can be regarded as a binary classification problem. Binary cross-entropy is used as the loss function. At the same time, due to the sparseness of the edges (interactions) in the network, negative sampling (non-interaction) is used to avoid the impact of sample imbalance on the experimental results. At the same time, in order to encourage nodes to have similar representations in fixed-step snapshots to better capture the potential periodicity of dynamic networks, the final loss function Loss formula is:

[0091]

[0092] Among them, σ is the sigmoid activation function, <.> represents the inner product operation, represents the neighborhood set of node v at time t, represents the negative sampling in the network at time t, x n Represents the negative sampling rate, which is used to balance positive and negative sampling.

[0093] In this embodiment, the adjustment parameters of the DyCDUP model include W s ,W t ,W qt ,W kt ,W vt ,W Qs ,W Ks ,W Vs ,A,a,x.

[0094] In this embodiment, training the logistic regression classifier in S3 includes:

[0095] Positive and negative sampling is performed on the known interaction information of the two sample nodes from the t-ttl period to the t period as a training set, wherein all interactions existing in the known interaction information are used as positive sampling, and no interaction is used as negative sampling. The feature vectors of the two sample nodes in the training set are combined to form an interaction feature vector to train the logistic regression classifier model.

[0096] In this embodiment, in S4, the feature vectors of two target nodes are selected from the final feature vector set of the nodes in time period t to form an interaction feature vector, which is input into the trained logistic regression classifier to predict the future interaction probability of the two target nodes, specifically including:

[0097] From the final feature vector of the node in time period t output after the DyCDUP model training is completed, the feature vectors of the two target nodes are selected for dot product to represent the interactive feature vector of the two target nodes u and v Then it is input into the trained logistic regression classifier for prediction, and the prediction result is output, that is, the interaction probability in the t+1 period.

[0098] With respect to the prediction method disclosed in Example 1, the prediction method is described in detail by taking the data set of email exchanges leaked by Enron as an example:

[0099]

[0100] Source represents the sender of the email 61, target represents the receiver of the email 25, and time represents the time when the email was sent 20733. The real personal information of the user is hidden here, and the number is used to refer to the user. The real time of the email is recorded as relative time. The first 70% of the interactions that have occurred in the data set are arranged by time (email contact) as positive sampling use cases (training set), and at the same time, two points in the same number of data sets that have not had any interaction contact are selected to form an edge, which is regarded as a negative sampling use case. The last 30% is used as a validation set, and positive and negative sampling are also performed.

[0101] After that, the training data is input into the DyCDUP model system to construct an initial network G, where nodes represent users and edges represent email exchanges between users. The community detection DyCD (G, tot, ttl) algorithm is run, where tot represents the time window value (for example, 1 month, which means that the model will be run once a month to process the latest 1 month of data), and ttl represents the time value of influence decay (for example, 6 months, information older than 6 months is considered invalid and eliminated). DyCD finally outputs the network community structure C at the current time = {C 1 ,C 2 ,...,C t} (When it is first started, it will start from scratch, that is, output the current community structure once a month until the latest month), and the network G = {G 1 ,G 2 ,...G t} t represents the network at time period t.

[0102] For the current network G i We perform community-aware time-biased walks. We first select a node v in the network and assign the time t′=max(E t ) as the initial time, the temporal neighbors of the node at time t′ are represented as Γ t (v)={(w,t)|e vw =(v,w,t)}, that is, all people who have interacted before t′, community neighbors C t (v) is the other nodes in the community where the node is located. Now we start to obtain the neighborhood sequence of the node, with node v as the starting node, and start using the probability The next node is selected, where the random walk parameter δ is set to the clustering coefficient of the current node (it can also be a hyperparameter provided by the prior knowledge of the social network), δ = 2|E| / t(t-1), where |E| is the number of edges connected to the t neighbors of node v, and r is a random number [0,1] generated by the system at this time. Repeat this step until the sequence length reaches l times, and each node walks ω times as the starting node. The points in the walk are used as the high-order neighborhood set NodeSeq of node v. Input the walk sequence into the word2vec (select the Skip-gram algorithm) model to obtain the initial encoding vector of all nodes in the current network R D Represents a D-dimensional vector set. Perform neighborhood attention calculation on the initial vector to obtain the embedding vector of node v Using multi-head attention mechanism Compute node v in G i Indicated in

[0103] Neighborhood attention gives the embedded representation of the network at different times In order to better capture the evolutionary pattern of dynamic networks, it is necessary to aggregate the embedded information at each moment and learn the embedded representation of the network at the current moment by effectively capturing the historical time series information. That is, the user characteristics of the current time period t are not only affected by the current situation, but also by the history. Therefore, the impact of historical information on the current situation is calculated. Loss Function The embedding set Z of the output node and the model AUC value of the validation set are used as indicators to evaluate the model effect.

[0104] Z records the latest embedding representation of the nodes in the network at this time, and the internal form is as follows Figure 3 As shown in the figure, there are 899 network users (899 nodes) in the experimental data set. A 128-dimensional vector is learned for each user (node). This vector records the user's high-dimensional features (such as which users in the network the user is similar to, which users the user has interacted with, and which users the user has a common community with in history). In the process of use, we encode the interaction between users in the two networks as That is, the feature vectors of two users are dot-producted, and the result represents the edge between the users, that is, the interaction feature vector of the two users. In this way, the edges of the positive and negative samples in the training set are encoded, and the encoded edges are input into the logistic regression classifier LR to train the classifier. When predicting whether two users will interact in the future, the node vectors of the two users are dot-producted to obtain the interaction feature vector of the two users to be predicted, and then the interaction feature vector is input into the trained logistic regression classifier LR. The logistic regression classifier LR calculates and outputs the probability, which is [0,1], that is, it is determined whether there is interaction between the two users.

[0105] The above is only a preferred embodiment of the present invention and does not limit the present invention in any way. Any simple modification, change and equivalent change made to the above embodiment according to the technical essence of the invention still falls within the protection scope of the technical solution of the present invention.

Claims

1. A method for predicting future interactive behavior of users in a social network, characterized in that: The method includes: S1. Obtain the first t-ttl Period to t The initial encoding vector and neighborhood sequence of the time period node; the node refers to the user in the community; S2, adopt the t-ttl Period to t The initial encoding vector and neighborhood sequence of the time period node are DYNAMIC The model is trained in joint representation learning until the preset training conditions are met. DYNAMIC After the model training is completed, the final feature vector of the output node is output; DYNAMIC The model consists of a neighborhood attention layer and a temporal attention layer in sequence; the neighborhood attention layer is used to aggregate the interactions of nodes in the same community structure, and the temporal attention layer is used to capture the evolution of interactions between nodes along time periods; S3, using the final feature vector of the output node in S2, select the final feature vectors of two sample nodes for hadmard The interaction feature vectors of the two sample nodes are obtained by encoding, and the actual interaction conditions of the two sample nodes are combined for positive and negative sampling. Positive sampling refers to all interaction information that has occurred, and negative sampling refers to interactions that have not occurred in the existing interactions. The sampling results are used to train the logistic regression classifier. S4, from the final feature vector set of the node, select the feature vectors of the two target nodes to form an interaction feature vector and input it into the trained logistic regression classifier to predict the future interaction probability of the two target nodes; In S1, the community-aware time-series biased walk is used to obtain the t-ttl The initial encoding vector of the node from the tth period to the tth period includes: The time when the last interaction occurred in the tth period is taken as the initial time , , the node walks in reverse time, each time selecting the next node from the neighborhood according to the random walk probability, and repeating the selection of the next node multiple times until the walk sequence reaches l times, and each node is used as the starting node to walk ω The node's community-perceived walk sequence is obtained, and the word2vec algorithm is used to obtain the first t The initial encoding vector of the time period node; the neighborhood neighbors include the time sequence neighbors and community neighbors ; Specifically, the node k The next node is selected by the following rules: Community-aware random walk parameters , each time the next node is selected, a random number is generated , select the next node according to the random walk probability, when When the next node k Select the next node from the temporal neighbors at the moment, otherwise, select a node from the community neighbors in the same community as the next node; The function of the random walk probability is: ;in, represents the random walk parameter, Represents a random number, express k The probability of selecting a temporal neighbor in the same community at the same time; express k The probability of being selected as a neighbor in the same community at the same time; The acquisition of the neighborhood sequence in S1 includes: According to the obtained node's community-perceived walk sequence, the node's neighborhood sequence is obtained , , that is, the node sequence is arranged in descending order according to the timestamp, and the neighborhood sequence after each time reverse walk is traversed in turn, and a fixed number of nodes before and after the node in the neighborhood sequence are taken to add to the neighborhood set of the node ; The calculation method for training the neighborhood attention layer in the DyCDUP model described in S2 includes: The first t-ttl Period to t The initial encoding vector of the node in the time period is defined as D dimensional vector, calculated by the weight formula of the neighborhood attention layer, D dimensional vector into a dimensional node vector; the calculation formula of the weight coefficient is: ; in, Representation Node u Relative Node v The weight coefficient of The neighborhood set is the nodes in the i-th period v Obtained from the neighborhood sequence NodeSeq, V represents the set of nodes in the network, T' A collection of timestamps indicating when an interaction event occurred. E t represents the interaction set of all nodes in the network at time t, and the nodes v Preset several nodes before and after as neighborhood sets , is a neighborhood set A node in is a transfer matrix; is the weight vector parameter of the model function of the neighborhood attention layer; represents the concatenation operation, is a nonlinear activation function, Indicates the current dynamic network time Middle Edge The weight of Represents the node at time i v The initial encoding vector of according to Relative to the node v The weight coefficient of i Time period v Neighborhood embedding of a node; the calculation formula is: ; in represents the activation function LeakyRELU, Indicates i Time period node v The initial encoding vector of represents the transfer matrix of the neighborhood attention layer, Indicates i Time period node u Relative Node v The weight coefficient of The neighborhood embedding vector is adopted The multi-head mechanism is split to obtain sub-vectors, and self-attention calculation is performed between sub-vectors. The embedding vector obtained for the node , the specific calculation formula of the long mechanism is: ; , , ; in Indicates that the neighborhood attention layer is i The final output node of the period v The embedding representation of the final output of each node in the i-th period is finally expressed as , ; Represents the set of feature vectors of all nodes in the network during period t , F represents the vector dimension; qu Represents the neighborhood attention layer query , ke Represents the neighborhood attention layer key , va Represents the neighborhood attention layer value; 、 、 All represent transfer matrices; After each period is trained by the neighborhood attention layer, the final output is ; The calculation method of the temporal attention layer described in S2 includes: The output of the neighborhood attention As the input of the temporal attention layer, , is the total number of time periods, ; Calculate the attention weight coefficient of the temporal attention layer. The calculation formula is as follows: ; ; in is the attention weight matrix of node v, yes The attention weight coefficient from the i-th period to the j-th period in is expressed as v node i The impact of the interactive information occurring in the period on the jth period, Represents the intermediate dimension of the matrix; They are , , , Qt Represents the neighborhood attention layer query , K Represents the neighborhood attention layer key , Vt Represents the neighborhood attention layer value ,and , , , , represents the transfer matrix; according to Relative to v The attention weight coefficient of the node is calculated for the i-th period v The temporal embedding of the node; the calculation formula is: ; in yes The attention weight coefficient from the t'th period to the i-th period, W t is the transfer matrix of the temporal attention layer; similarly to the neighborhood attention layer, the vector of the temporal embedding use The multi-head mechanism is split to obtain sub-vectors, and self-attention calculation is performed between sub-vectors to obtain , Indicates the number of user nodes in period i.

2. A method for predicting future interactive behavior of users in a social network according to claim 1, characterized in that: The preset training condition in S2 is: t-ttl Period to t The initial encoding vector and neighborhood sequence of the time period node are DYNAMIC The model is trained in joint representation learning until the loss function Loss Convergence, that is, training the DyCDUP model for 5 consecutive times, the loss function Loss No decrease, or the number of training times reaches the set epochs Parameters, end training.

3. The method for predicting future interactive behavior of users in a social network according to claim 2, characterized in that: The formula of the loss function Loss is: ; in, is the sigmoid activation function, represents the inner product operation, Representation Node exist The neighborhood set at time, express Negative sampling in the time network, Represents the negative sampling rate, which is used to balance positive and negative sampling.

4. The method for predicting future interactive behavior of users in a social network according to claim 1, characterized in that: Training a logistic regression classifier in S3 involves: For two sample nodes t-ttl Time period is up t The known interaction information of the time period is positively and negatively sampled as a training set, wherein all interactions existing in the known interaction information are used as positive samples, and no interactions are used as negative samples. The feature vectors of the two sample nodes in the training set are combined to form an interaction feature vector to train the logistic regression classifier model.

5. The method for predicting future interactive behavior of users in a social network according to claim 1, characterized in that: S4 from t From the final feature vector set of the time period node, the feature vectors of two target nodes are selected to form an interaction feature vector and input into the trained logistic regression classifier to predict the future interaction probability of the two target nodes, including: Output from DyCDUP model after training t In the final feature vector of the time period node, the feature vectors of two target nodes are selected for dot product to represent the two target nodes The interaction feature vector of , and then input into the trained logistic regression classifier for prediction.

Citation Information

Patent Citations

  • Dynamic link prediction method based on space-time attention deep model

    CN110413844A

  • Enhanced network representation learning method based on community perception and relationship attention

    CN111709518A