Session recommendation method based on hypergraph and target attention
Through the combination of hypergraph and target attention module, the problem of insufficient project relationship and user interest expression in session recommendation is solved, efficient information aggregation and interest matching is achieved, and recommendation accuracy and performance are improved.
Patent Information
- Application Number
- CN202411158313.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-12-03
AI Technical Summary
The existing session recommendation method has shortcomings in capturing complex relationships between items and user interest expressions in conversations, especially the sequence-based methods are difficult to capture complex relationships, and the diversity of user interests leads to inaccurate fixed vector representations, which adds the model. Calculation and overfitting risk.
Using a conversation recommendation method based on hypergraph and target attention, through hypergraph data construction, location vector learning, item clustering and target attention modules, high-order information is aggregated, user interests are dynamically matched, and the calculation amount is reduced and recommendation accuracy is improved.
It effectively improves recommendation accuracy, breaks through the information aggregation limitation of ordinary graphs, dynamically matches user interests, reduces the amount of calculation, and improves model performance.
Smart Images

Figure CN119067129A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of conversation recommendation, and in particular to a conversation recommendation method based on hypergraph and target attention. Background Art
[0002] Traditional session-based recommendations include Markov chain-based recommendations. After the development of deep learning neural networks, there are recommendations based on recurrent neural networks, improved recurrent neural networks, graph neural networks, and improved graph neural networks. Although these methods have good performance, there are also some defects in the models themselves.
[0003] The Markov chain-based method models the conversation to predict the next interaction in a given context. Since the prediction is only related to the previous items within the conversation, the information aggregation is weak and the accuracy is low. In order to improve the accuracy of the recommendation, the aggregation of information can be increased, thereby introducing a neural network.
[0004] In the neural network direction, recursive neural networks treat session data as a sequence for recommendation. However, when treating session data as a sequence, the session data itself needs to have a strict order, and sequence-based methods are difficult to capture the complex relationship between items. For example, in a session s = v1-v2-v3-v2, the relationship between item v2 and items v1 and v3 will be confused in this session. Therefore, sequence-based methods cannot capture the complex transformation relationship between items well. In order to more comprehensively represent the connection between items, multiple session data are jointly transformed into graph data. The points and edges in the graph data are mapped to a vector respectively. The vector contains not only the information of the point itself but also the information between neighbors, and the user's interest expression vector is generated according to the user's corresponding session. The next interaction is predicted based on the user's interest characteristics. However, user interests are usually diverse, and using a fixed vector to represent them may not be accurate enough. A common way is to increase the dimension of the vector to express more information, but increasing the dimension of the vector will have the risk of overfitting. Users have diverse interests and hobbies, so users' interests can be represented by multiple vectors, and different interests and hobbies are used when predicting different items. When there are too many items, the user's interest preferences need to be calculated for each prediction, which increases the computational complexity of the model, and GNN may ignore high-order information connections between items when aggregating information.
[0005] Therefore, it is necessary to provide a session recommendation method based on hypergraph and target attention to solve the above problems. Summary of the invention
[0006] The purpose of the present invention is to provide a conversation recommendation method based on hypergraph and target attention, which utilizes hypergraph to aggregate high-order information of items, and adds a target attention module to increase the accuracy of recommendation, and reduces the computational complexity of the model through clustering, thereby improving the accuracy of algorithm recommendation.
[0007] To achieve the above object, the present invention provides a conversation recommendation method based on hypergraph and target attention, including a conversation recommendation model based on hypergraph and target attention, the conversation recommendation model including a conversation hypergraph data construction module, a position vector learning module, an item clustering module, a target attention module and a prediction module; specifically including the following steps:
[0008] S1: In the session hypergraph data construction module, a hypergraph is constructed based on the sessions data;
[0009] S2: Use the hypergraph obtained in step S1 to generate the embedding of each object. In the process of embedding generation, a position vector learning module is embedded to represent the positional relationship between items.
[0010] S3: Add an item clustering module and a target attention module to the conversation recommendation model. According to different goals, the attention scores of all items in the conversation are calculated. The generated embeddings are clustered and divided into types using the item clustering module. The target attention module is used to generate different interests of users according to the different recommended items.
[0011] S4: In the prediction module, all the session-based embedding representations and item-based embedding representations are obtained through the formula:
[0012]
[0013] Calculate the score of each item, and use the softmax function to calculate the output vector of the model:
[0014]
[0015] In the formula, The probability that the node will become the next node to interact with the user. Represents the data embedding expression in the prediction module;
[0016] Define the loss function:
[0017] Participate in the calculation of the loss function formula in the form of embedded vectors, In order to obtain the estimated value calculated by the model, the loss function is calculated by the observed value and the estimated value, and then backpropagation is used to optimize the model.
[0018] Preferably, in step S1, the following steps are specifically included:
[0019] The anonymous session data s is represented as The sessions are arranged in order of timestamps, where v s,i represents the i-th item in session s, s n Indicates that session s has a total of n items, Represents the set of all items in the data set, m is the number of all items, and the session recommendation model recommends the n+1th item based on the first n items in the known session, sorts all items, and selects the top K items with the greatest probability for item recommendation;
[0020] In the conversation recommendation model, the conversation data is modeled as the edge in the hypergraph, so that G = (V, E, W) represents a hypergraph, where V represents a set of N different vertices, E represents a set of M hyperedges, each hyperedge has two or more points and the weight is W, and the weight of each hyperedge comes from a diagonal matrix W∈R M*M ;
[0021] Hypergraph or through the incidence matrix H∈R |V|*|E| It means, e∈E, v∈V;
[0022] If point v is on edge e, then H ve =1, otherwise H ve = 0, the degrees of any vertex v and edge e are defined as:
[0023] Where D and B represent diagonal matrices respectively. When point v is on edge e, h(v,e) = 1, otherwise h(v,e) = 0;
[0024] When making recommendations, we obtain information about items and their neighbors, and represent each hyperedge as [i s,1 ,i s,2 ,i s,3 ,i s,m ]=e,i s,3 ∈V, the session data is converted into hypergraph data, and many-to-many propagation is performed through information aggregation of multiple hypergraphs to obtain high-order information and perform information recommendation.
[0025] Preferably, in step S2, the following steps are specifically included:
[0026] The weight matrix of each hyperedge is set to 1, and the weight matrix W of the hyperedge is a unit diagonal matrix. The spectral convolution of the hypergraph neural network is used to aggregate information. The specific formula is as follows:
[0027]
[0028] Among them, H is the correlation matrix, W is the weight matrix, is a variable, θ (l) represents a fully connected layer, H T X represents the aggregation of the neighbor nodes of the hyperedge to the hyperedge by summing up according to the characteristics of the nodes in the previous layer, completing the update from the point to the hyperedge, D v , D e is a diagonal matrix that stores the degree d(e) of edge e and the degree d(v) of point v. The degree d(v) of point v and the degree d(e) of edge e are expressed as:
[0029] d(v)=∑ e∈E h((v,e)
[0030] d(e)=∑ v∈V h(v,e)
[0031] Where V is the set of all points, E is the set of all edges, and h(v,e) represents the matrix element in the diagonal matrix;
[0032] The hypergraph convolutional network realizes the node-hyperedge-node conversion when aggregating information. represents the representation of the node in the hypergraph at layer l, represents the representation of the hypergraph at the l+1th layer, the formula Use the structure of the hypergraph to complete the transmission of information from point to edge to point;
[0033] After all layers of neural network transformation, the final node embedding is obtained by averaging the embeddings of nodes obtained in the previous layers;
[0034] When information is aggregated, position embedding is added, and the position matrix P r =[p1,p2,p3....p m ], m represents the length of the current session, and the position information is embedded into the vector using the following formula:
[0035]
[0036] Where W1∈R d*2d ,b∈R d are the parameters that need to be learned;
[0037] In session s, s=[i s,1 ,i s,2 ....i s,m ],i s,m Representing the mth item in session s, the global embedding representation in the final session is as follows:
[0038]
[0039] in, represents the global embedding of the session, and the local embedding of the session is represented by the last item in the session. m is the number of all items in the session.
[0040] Preferably, in step S3, the vector clustering module reduces the amount of computation by using a clustering algorithm, replaces all items in the cluster with the cluster center point, uses a parameter-adaptive K-means clustering elbow method to determine clustering parameters, and uses the sum of squared errors as the error function SSE, which is obtained according to the following formula:
[0041] L=L p +β1.L d +β2.L c
[0042] In the formula, β1 represents the weight between the item and the cluster C1 to which the target item belongs, L p Refers to the prediction error of the model for the original data point, L d refers to the error based on the deviation, β2 represents the weight between the item and the cluster C2 to which the target item belongs, and L c Refers to complexity-based errors.
[0043] Preferably, in step S3, the target attention module is used to calculate all items v in the session. i Items with target v t , item v t ∈C t Items, v t Belongs to cluster C t , Where h represents a total of h items. The score weight of the items in the session is calculated according to the type of the target item. The item v is calculated by the following formula: i With the target item v t Belongs to cluster C t The weight between i,t And save it:
[0044]
[0045] After calculating the interest embedding, local embedding, and global embedding of the session, the final embedding of the session is generated using the linear transformation of the following formula:
[0046]
[0047] The final embedding is represented as: Where W3∈R d*3d represents the weight of a linear transformation; st It will change according to the target type, and each type of item requires recalculating the embedding expression of the session.
[0048] Therefore, the present invention adopts the above-mentioned conversation recommendation method based on hypergraph and target attention, which has the following beneficial effects:
[0049] (1) The present invention utilizes a target attention module to match the user's preferences in different directions according to the different dynamics of the items to be recommended.
[0050] (2) Each edge of the hypergraph in the present invention can connect multiple vertices, breaking through the conventional Figure 1 The limitation that an edge can only connect two vertices is that more information in the graph is aggregated so that the embedding of each item can contain more information to obtain higher-order connections between information.
[0051] (3) The present invention adds a target attention module to the graph neural network to solve the problem of user interest preference selection. When recommending different items, the user's different interest preferences will be used.
[0052] (4) Clustering is added in the present invention, and the centroid of the category to which the item belongs replaces all the items in the category. When generating the item interest preference, it is not necessary to generate it dynamically for each item. The addition of clustering transforms the calculation between the selected items and the unselected items into the calculation of the centroid of the cluster to which the selected items and the unselected items belong. The calculated values of the items and the centroid can be reused. Compared with TAGNN, the model proposed in this scheme can reduce the amount of calculation when recommending items. When selecting the item interest, it is not necessary to generate it dynamically for each item.
[0053] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 It is an embedding graph of items calculated by a hypergraph neural network for session data in a session recommendation method based on a hypergraph and target attention of the present invention;
[0055] Figure 2 A clustering graph is embedded in a conversation recommendation method based on a hypergraph and target attention in the present invention;
[0056] Figure 3 It is a performance indicator graph in a conversation recommendation method based on a hypergraph and target attention in the present invention. DETAILED DESCRIPTION
[0057] The technical solution of the present invention is further described below through the accompanying drawings and embodiments.
[0058] Unless otherwise defined, technical or scientific terms used in the present invention shall have the common meanings understood by one having ordinary skills in the field to which the present invention belongs.
[0059] The words "include" or "comprises" and the like used in the present invention mean that the elements before the word include the elements listed after the word, and do not exclude the possibility of also including other elements. The orientation or position relationship indicated by the terms "inside", "outside", "upper", "lower", etc. is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation of the present invention. When the absolute position of the described object changes, the relative position relationship may also change accordingly. In the present invention, unless otherwise clearly specified and limited, the terms "attachment" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral body; it can be directly connected, or indirectly connected through an intermediate medium, and it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0060] Example
[0061] like Figure 1 As shown, the present invention provides a conversation recommendation method based on a hypergraph and target attention, including a conversation recommendation model based on a hypergraph and target attention, the conversation recommendation model includes a conversation hypergraph data construction module, a position vector learning module, an item clustering module, a target attention module and a prediction module; specifically includes the following steps:
[0062] S1: In the session hypergraph data construction module, a hypergraph is constructed according to the sessions data. In step S1, the following steps are specifically included:
[0063] The anonymous session data s is represented as The sessions are arranged in order of timestamps, where v s,i represents the i-th item in session s, s n Indicates that session s has a total of n items, Represents the set of all items in the data set, m is the number of all items, and the session recommendation model recommends the n+1th item based on the first n items in the known session, sorts all items, and selects the top K items with the greatest probability for item recommendation;
[0064] In the conversation recommendation model, the conversation data is modeled as the edge in the hypergraph, so that G = (V, E, W) represents a hypergraph, where V represents a set of N different vertices, E represents a set of M hyperedges, each hyperedge has two or more points and the weight is W, and the weight of each hyperedge comes from a diagonal matrix W∈R M*M ;
[0065] Hypergraph or through the incidence matrix H∈R |V|*|E| It means, e∈E, v∈V;
[0066] If point v is on edge e, then H ve =1, otherwise H ve = 0, the degrees of any vertex v and edge e are defined as:
[0067] Where D and B represent diagonal matrices respectively. When point v is on edge e, h(v,e) = 1, otherwise h(v,e) = 0;
[0068] When making recommendations, we obtain information about items and their neighbors, and represent each hyperedge as [i s,1 ,i s,2 ,i s,3 ,i s,m ]=e,i s,3 ∈V, the session data is converted into hypergraph data, and many-to-many propagation is performed through information aggregation of multiple hypergraphs to obtain high-order information and perform information recommendation.
[0069] S2: Use the hypergraph obtained in step S1 to generate the embedding of each object. In the process of embedding generation, a position vector learning module is embedded to represent the positional relationship between items.
[0070] In step S2, the following steps are specifically included:
[0071] The weight matrix of each hyperedge is set to 1, and the weight matrix W of the hyperedge is a unit diagonal matrix. The spectral convolution of the hypergraph neural network is used to aggregate information. The specific formula is as follows:
[0072]
[0073] Among them, H is the correlation matrix, W is the weight matrix, is a variable, θ (l) represents a fully connected layer, H T X represents the aggregation of the neighbor nodes of the hyperedge to the hyperedge by summing up according to the characteristics of the nodes in the previous layer, completing the update from the point to the hyperedge, D v , D eis a diagonal matrix that stores the degree d(e) of edge e and the degree d(v) of point v. The degree d(v) of point v and the degree d(e) of edge e are expressed as:
[0074] d(v)=∑ e∈E h(v,e)
[0075] d(e)=∑ v∈V h(v,e)
[0076] Where V is the set of all points, E is the set of all edges, and h(v,e) represents the matrix element in the diagonal matrix;
[0077] The hypergraph convolutional network realizes the node-hyperedge-node conversion when aggregating information. represents the representation of the node in the hypergraph at layer l, represents the representation of the hypergraph at the l+1th layer, the formula Use the structure of the hypergraph to complete the transmission of information from point to edge to point;
[0078] After all layers of neural network transformation, the final node embedding is obtained by averaging the embeddings of nodes obtained in the previous layers;
[0079] When information is aggregated, position embedding is added, and the position matrix P r =[p1,p2,p3....p m ], m represents the length of the current session, and the position information is embedded into the vector using the following formula:
[0080]
[0081] Where W1∈R d*2d ,b∈R d are the parameters that need to be learned;
[0082] In session s, s=[i s,1 ,i s,2 ....i s,m ],i s,m Representing the mth item in session s, the global embedding representation in the final session is as follows:
[0083]
[0084] in, represents the global embedding of the session, and the local embedding of the session is represented by the last item in the session. m is the number of all items in the session.
[0085] S3: Figure 2As shown in FIG. 1 , an item clustering module and a target attention module are added to the conversation recommendation model. According to different goals, the attention scores of all items in the conversation are calculated. The generated embeddings are clustered and divided into types using the item clustering module. The target attention module is used to generate different interests of users according to the different recommended items. In step S3, the vector clustering module reduces the amount of calculation through the clustering algorithm, replaces all items in the cluster with the cluster center point, and uses the parameter-adaptive K-means clustering elbow method to determine the clustering parameters. The sum of squared errors is used as the error function SSE, and SSE is obtained according to the following formula:
[0086] L=L p +β1.L d +β2.L c
[0087] In the formula, β1 represents the weight between the item and the cluster C1 to which the target item belongs, L p Refers to the prediction error of the model for the original data point, L d refers to the error based on the deviation, β2 represents the weight between the item and the cluster C2 to which the target item belongs, and L c Refers to complexity-based errors.
[0088] In step S3, the target attention module is used to calculate all items v in the session. i Items with target v t , item v t ∈C t Items, v t Belongs to cluster C t , Where h means there are h items in total. The score weight of the items in the session is calculated according to the type of the target item. The item v is calculated by the following formula: i With the target item v t Belongs to cluster C t The weight between i,t And save it:
[0089]
[0090] After calculating the interest embedding, local embedding, and global embedding of the session, the final embedding of the session is generated using the linear transformation of the following formula:
[0091]
[0092] The final embedding is represented as: Where W3∈R d*3d represents the weight of a linear transformation; s tIt will change according to the target type, and each type of item requires recalculating the embedding expression of the session.
[0093] S4: In the prediction module, all the session-based embedding representations and item-based embedding representations are obtained through the formula:
[0094]
[0095] Calculate the score of each item, and use the softmax function to calculate the output vector of the model:
[0096]
[0097] In the formula, The probability that the node will become the next node to interact with the user. Represents the data embedding expression in the prediction module;
[0098] Define the loss function:
[0099] Participate in the calculation of the loss function formula in the form of embedded vectors, In order to obtain the estimated value calculated by the model, the loss function is calculated by the observed value and the estimated value, and then backpropagation is used to optimize the model.
[0100] Experiment and result analysis
[0101] When evaluating the performance of the model, two datasets, yoochoose1 / 64 and diginetica, are used. These two datasets are from the datasets used in TA-GNN. When preprocessing the dataset, we first delete items with less than 5 interactions and delete sessions that only contain one item. In order to facilitate the training and testing of the model, we divide the dataset into a training set and a test set.
[0102] In the process of comparison, typical benchmark models were compared. The comparison algorithms include: recommendation algorithm based on item popularity (POP), specific strategy recommendation algorithm based on item popularity (S-POP), recommendation algorithm based on collaborative filtering (Item-KNN), sequence recommendation algorithm based on gated recurrent unit (GRU4REC), conversation recommendation algorithm based on deep learning (STAMP), conversation recommendation algorithm based on graph neural network (SR-GNN), graph neural network recommendation algorithm based on time attention (TAGNN), interest dynamic attention mechanism algorithm (TAHGNN). All baseline model parameters in the experiment used the same hyperparameter settings as the corresponding original text.
[0103] Evaluation Indicators,When evaluating the model proposed in this paper, two main indicators are proposed, including Precision@20 and MRR@20. Precision indicates the ratio of the number of correct information retrieved to the total number of extracted information, and MRR reflects whether the retrieved items are in a more prominent position for users, emphasizing the relationship and order of positions;
[0104] When generating the embedding vector, the dimension of the vector is set to 100, the initial learning rate is 0.001, and the number of layers of the neural network is set to three. For the parameters of the comparison method, the hyperparameters are set to the corresponding hyperparameters in this solution. If the data set and evaluation indicators used in this solution are the same as the model in this article, the data in this solution will be directly used for comparison. The evaluation indicators are Precision@20 and MRR@20, as shown in Table 1 and Figure 3 As shown;
[0105] Table 1
[0106]
[0107] The table compares the algorithm proposed in this paper with the algorithms that have been proposed. The POP and S-POP algorithms only focus on the similarity between items, so their performance is poor. Another simple method, Item-KNN, shows a good performance compared to the POP and S-POP algorithms because Item-KNN uses the user's potential interest features.
[0108] Several deep learning methods used in the algorithm have better performance, can better extract user interest features, calculate the similarity between users and items, and thus achieve higher performance recommendations. Sequence models such as GRU4REC and NARM treat session data as a strict sequence, and therefore cannot capture the complex multi-connection relationship between data. SR-GNN treats session data as a graph. Compared with sequence data, the expression of graph data is more consistent with the relationship between data in the real world, so it has better performance than the sequence model SR-GNN. The TAGNN model, which is improved on the basis of SR-GNN, improves the performance of the algorithm because it can dynamically model user interest features.
[0109] Therefore, the present invention adopts the above-mentioned conversation recommendation method based on hypergraph and target attention, further improves TAGNN, converts conversation data into hypergraph, and uses the better information aggregation ability of hypergraph to mine the hidden connection information between item pairs. Because the target attention mechanism proposed in TAGNN needs to calculate the interest preference for each item, in order to reduce the amount of calculation, this paper proposes to use clustering to replace the weight calculation between the selected items and the unselected items with the calculation of the centroid of the class to which the selected items and the unselected items belong. Comparative experiments on yoochoose1 / 64 and diginetica datasets prove that the model proposed in this scheme can effectively improve the performance of various indicators of TAGNN.
[0110] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.
Claims
1. A conversation recommendation method based on hypergraph and target attention, Features: The method includes a conversation recommendation model based on a hypergraph and target attention, wherein the conversation recommendation model includes a conversation hypergraph data construction module, a position vector learning module, an item clustering module, a target attention module and a prediction module; the method specifically includes the following steps: S1: In the session hypergraph data construction module, a hypergraph is constructed based on the sessions data; S2: Use the hypergraph obtained in step S1 to generate the embedding of each object. In the process of embedding generation, a position vector learning module is embedded to represent the positional relationship between items. S3: Add an item clustering module and a target attention module to the conversation recommendation model. According to different goals, the attention scores of all items in the conversation are calculated. The generated embeddings are clustered and divided into types using the item clustering module. The target attention module is used to generate different interests of users according to the different recommended items. S4: In the prediction module, all the session-based embedding representations and item-based embedding representations are obtained through the formula: Calculate the score of each item, and use the softmax function to calculate the output vector of the model: In the formula, The probability that the node will become the next node to interact with the user. Represents the data embedding expression in the prediction module; Define the loss function: Participate in the calculation of the loss function formula in the form of embedded vectors, In order to obtain the estimated value calculated by the model, the loss function is calculated by the observed value and the estimated value, and then backpropagation is used to optimize the model.
2. According to the method for session recommendation based on hypergraph and target attention in claim 1, Features: In step S1, the following steps are specifically included: The anonymous session data s is represented as The sessions are arranged in order of timestamps, where v s,i represents the i-th item in session s, s n Indicates that session s has a total of n items, Represents the set of all items in the data set, m is the number of all items, and the session recommendation model recommends the n+1th item based on the first n items in the known session, sorts all items, and selects the top K items with the greatest probability for item recommendation; In the conversation recommendation model, the conversation data is modeled as the edge in the hypergraph, so that G = (V, E, W) represents a hypergraph, where V represents a set of N different vertices, E represents a set of M hyperedges, each hyperedge has two or more points and the weight is W, and the weight of each hyperedge comes from a diagonal matrix W∈R M*M ; Hypergraph or through the incidence matrix H∈R |V|*|E| It means, e∈E, v∈V; If point v is on edge e, then H ve =1, otherwise H ve = 0, the degrees of any vertex v and edge e are defined as: Where D and B represent diagonal matrices respectively. When point v is on edge e, h(v,e) = 1, otherwise h(v,e) = 0; When making recommendations, we obtain information about items and their neighbors, and represent each hyperedge as [i s,1 ,i s,2 ,i s,3 ,i s,m ]=e,i s,3 ∈V, the session data is converted into hypergraph data, and many-to-many propagation is performed through information aggregation of multiple hypergraphs to obtain high-order information and perform information recommendation.
3. According to the hypergraph and target-focused conversation recommendation method of claim 1, Features: In step S2, the following steps are specifically included: The weight matrix of each hyperedge is set to 1, and the weight matrix W of the hyperedge is a unit diagonal matrix. The spectral convolution of the hypergraph neural network is used to aggregate information. The specific formula is as follows: Among them, H is the correlation matrix, W is the weight matrix, is a variable, θ (l) represents a fully connected layer, H T X represents the aggregation of the neighbor nodes of the hyperedge to the hyperedge by summing up the features of the nodes in the previous layer, completing the update from the point to the hyperedge. v , D e is a diagonal matrix that stores the degree d(e) of edge e and the degree d(v) of point v. The degree d(v) of point v and the degree d(e) of edge e are expressed as: d(v)=∑ e∈E h(v,e) d(e)=∑ v∈V h(v,e) Where V is the set of all points, E is the set of all edges, and h(v,e) represents the matrix element in the diagonal matrix; The hypergraph convolutional network realizes the node-hyperedge-node conversion when aggregating information. represents the representation of the node in the hypergraph at layer l, represents the representation of the hypergraph at the l+1th layer, the formula Use the structure of the hypergraph to complete the transmission of information from point to edge to point; After all layers of neural network transformation, the final node embedding is obtained by averaging the embeddings of nodes obtained in the previous layers; When information is aggregated, position embedding is added, and the position matrix P r =[p 1 ,p 2 ,p 3 ....p m ], m represents the length of the current session, and the position information is embedded into the vector using the following formula: Among them, W 1 ∈R d*2d ,b∈R d are the parameters that need to be learned; In session s, s=[i s,1 ,i s,2 ....i s,n ],i s,m Representing the mth item in session s, the global embedding representation in the final session is as follows: in, represents the global embedding of the session, and the local embedding of the session is represented by the last item in the session. m is the number of all items in the session.
4. According to the method for session recommendation based on hypergraph and target attention in claim 1, Features: In step S3, the vector clustering module reduces the amount of calculation through the clustering algorithm, replaces all the items in the cluster with the cluster center point, uses the parameter-adaptive K-means clustering elbow method to determine the clustering parameters, and uses the sum of squared errors as the error function SSE. SSE is calculated according to the following formula: L=L p +b 1 .L d +b 2 .L c In the formula, β 1 The cluster C to which the representative item and the target item belong 1 The weight between p Refers to the prediction error of the model for the original data point, L d Refers to the error based on the deviation, β 2 The cluster C to which the representative item and the target item belong 2 The weight between c Refers to complexity-based errors.
5. According to the hypergraph and target-focused conversation recommendation method of claim 1, Features: In step S3, the target attention module is used to calculate all items v in the session. i Items with target v t , item v t ∈C t Items, v t Belongs to cluster C t , Where h means there are h items in total. The score weight of the items in the session is calculated according to the type of the target item. The item v is calculated by the following formula: i With the target item v t Belongs to cluster C t The weight between i,t And save it: After calculating the interest embedding, local embedding, and global embedding of the session, the final embedding of the session is generated using the linear transformation of the following formula: The final embedding is represented as: Where W 3 ∈R d*3d represents the weight of a linear transformation; s t It will change according to the target type, and each type of item requires recalculating the embedding expression of the session.
