A personalized ranking and recommendation method based on homogeneous hypergraph attention network

Through the method based on homogeneous hypergraph attention network, the model architecture of the recommendation system is optimized, the number of parameters is reduced, and the recommendation efficiency is improved, and the problem of inefficiency of existing recommendation systems in large-scale user data processing is solved.

CN114840772BActive Publication Date: 2025-03-14BEIJING INST OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210414011.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-14
Publication Date
2025-03-14
Estimated Expiration
2042-04-14

AI Technical Summary

Technical Problem

When existing recommendation systems process large-scale user data and diversified data forms, the model architecture is insufficient and the number of parameters is too large, resulting in inefficient recommendation efficiency.

Method used

A personalized sorting and recommendation method based on a homogeneous hypergraph attention network is adopted. By obtaining the interactive graph data between users and projects, the final hypergraph adjacency matrix, node degree matrix and hyperedema degree matrix are calculated. Combined with the project representation matrix, the user representation propagation sequence is calculated, and the user representation matrix is ​​obtained through weighted calculations of attention mechanisms, and finally the candidate items are scored and sorted.

Benefits of technology

On the premise of ensuring the effectiveness of recommendation, the model structure and parameter scale are simplified, the model recommendation efficiency is improved, and hardware resources and calculation consumption are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114840772B_ABST
    Figure CN114840772B_ABST
Patent Text Reader

Abstract

The invention discloses a personalized sorting and recommendation method based on a homogeneous hypergraph attention network; the method comprises: obtaining the interaction graph data of all current users and projects; calculating the final hypergraph adjacency matrix, node degree matrix and hyperedge degree matrix of all current users and projects according to the interaction graph data and the project order; based on this, in combination with the project representation matrix, calculating the user representation propagation sequence; based on this, weighted calculation and filtering of the sequence through the attention mechanism to obtain the user representation matrix; scoring and sorting the candidate items in the candidate item sequence according to the target user representation extracted from the user representation matrix and in combination with the query representation of the target user; recommending the target user according to the sorted candidate item sequence; the method can ensure that the recommendation system optimizes the model architecture and reduces the number of parameters under the premise of achieving effective recommendation, thereby improving the model recommendation efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of collaborative filtering recommendation of recommendation systems, and in particular to a method for personalized sorting and recommendation based on a homogeneous hypergraph attention network. Background Art

[0002] The rise of social networking platforms has greatly changed people's lives and behaviors. Nowadays, since most creations are published and consumed by users on the platform, a more efficient and personalized search engine will make it easier for users to find content of interest on the platform and increase user stickiness to the platform.

[0003] The recommendation system needs to use collaborative filtering recommendation technology. Existing collaborative filtering methods can be roughly divided into model-based collaborative filtering and graph-based collaborative filtering. The differences between the two types of methods were initially reflected in the type of data used, and gradually derived obvious research gaps in their respective research routes.

[0004] Classic model-based collaborative filtering methods attempt to form models through known interactions between users and items so that the recommendation system can identify more complex patterns and obtain recommendations with the help of user representations. Among the methods in this direction, the matrix decomposition method was once considered one of the most effective collaborative filtering methods due to its performance and high scalability. This method projects all users and items into a shared latent factor space and calculates the inner product of the representation for estimation. Another classic method is Bayesian personalized ranking, which uses paired log-sigmoid functions and directly optimizes the original AUC parameters through Bayesian AUC optimization. In addition, the neural network-based matrix factorization (Neural MF) method uses a multilayer perceptron (MLP) to learn interaction functions. It should be pointed out that the proven effective model-based collaborative filtering methods were proposed earlier, the data used were relatively simple and small in scale, and the related implementation methods were relatively mechanical, and could not achieve personalized result feedback for users. With the gradual development of recommendation systems, the rapid expansion of user data scale, and the diversification of data forms, the early model-based collaborative filtering methods have become insufficient in the applicability of system data.

[0005] Changes in data scale and data form have led to a considerable development of graph-based collaborative filtering. More and more studies are trying to explore the graph structure in user-item interactions. Some work has achieved good results. SimRank regards two items referenced by similar objects as similar pairs to model user-item interactions. The introduction of the graph convolutional neural network layer (GCN Layer) has created another feasible route for collaborative filtering tasks. GCMC applies it to model the interaction between users and items, and obtains the representation of users and items through convolution between relationships. At the same time, inspired by the GraphSAGE method, the PinSage method embeds this layer structure into the commercial recommendation system. The NGCF method combines collaborative factors with high-order connectivity when propagating features and adds them to the graph network. However, it is difficult for the current modeling methods based on graph neural networks to describe the high-dimensional relationship information formed between user data that is more important for recommendation. Some work has also tried to use hypergraphs to model users. A method similar to the method proposed in the present invention is the Dual Channel Hypergraph Collaborative Filtering method. This method first uses user-item interaction data as the basis for constructing a hypergraph based on high-order connectivity, encodes users and items by characterizing high-order connectivity of multiple lengths, and finally uses a common parameter matrix to output the representation of users and items. However, this method requires large hardware resources and computing power in the implementation stage, and the model structure of the output user and item representation part is relatively redundant.

[0006] Therefore, how to ensure that the recommendation system optimizes the model architecture and reduces the number of parameters while achieving effective recommendations, thereby improving the efficiency of model recommendations, has become a key issue in current research. Summary of the invention

[0007] In view of the above problems, the present invention provides a method for personalized sorting and recommendation based on a homogeneous hypergraph attention network, which at least solves some of the above technical problems. This method can ensure that the recommendation system optimizes the model architecture and reduces the number of parameters while achieving effective recommendations, thereby improving the efficiency of model recommendations.

[0008] The embodiment of the present invention provides a method for personalized sorting and recommendation based on a homogeneous hypergraph attention network, including:

[0009] S0. Obtaining the interaction graph data of all current users and projects; the current users are subjects in a logged-in state or subjects in a non-logged-in state who browse information in the system as recorded in the system; the projects are the information, videos and / or pictures browsed by the current users as recorded in the system;

[0010] S1. According to the interaction graph data and the project order k, calculate the final hypergraph adjacency matrix H and node degree matrix D of all current users and projects. V and the hyperedge degree matrix D e ; The item order is used to calculate the accessibility of the interaction relationship between the current user and the item;

[0011] S2, based on the final hypergraph adjacency matrix H, node degree matrix D v and the hyperedge degree matrix D e , and combined with the item representation matrix E, the user representation propagation sequence X is obtained by calculation;

[0012] S3. According to the user representation propagation sequence X, the sequence is weighted and filtered through the attention mechanism to obtain the user representation matrix X f ;

[0013] S4, according to the user characterization matrix X f The target user representation extracted from the query representation q of the target user is used to score and sort the candidate items in the candidate item sequence D; and the target user is recommended according to the sorted candidate item sequence D.

[0014] Furthermore, the S1 specifically includes:

[0015] S11. According to the interaction graph data between the current user and the project, all current user data sets and project data sets are obtained; and user data in the user data set and project data in the project data set are ID-numbered, and the ID numbers all start from 0;

[0016] S12, initialize the matrix of |user data set|*|project data set| dimension to obtain an initialization matrix; fill the initialization matrix according to the user data and project data with ID numbers to obtain the native hypergraph adjacency matrix H ori ;

[0017] S13, based on the native hypergraph adjacency matrix H ori , calculate the 2nd to kth order reachability matrix through high-order connectivity;

[0018] S14, the native hypergraph adjacency matrix H ori , the 2 to k order reachable matrices are summed and regularized to obtain the final hypergraph adjacency matrix H;

[0019] S15. Calculate the node degree matrix D according to the final hypergraph adjacency matrix H v and the hyperedge degree matrix D e .

[0020] Furthermore, in S12, the initialization matrix is ​​filled according to the user data and project data with ID numbers to obtain the native hypergraph adjacency matrix H ori , specifically:

[0021] The user data with ID numbers are used as the row labels of the initialization matrix, and the project data with ID numbers are used as the column labels of the initialization matrix; if any of the user data with ID numbers interacts with any of the project data with ID numbers, the value at the corresponding position of the initialization matrix is ​​the first parameter, otherwise it is the second parameter.

[0022] Furthermore, the S15 specifically includes:

[0023] S151, respectively, the node degree matrix D v and the hyperedge degree matrix D e Initialize; the node degree matrix D v and the hyperedge degree matrix D e are all square matrices, and the node degree matrix D v The dimension of the final hypergraph adjacency matrix H is the same as the number of rows; the hyperedge degree matrix D e The dimension of is the same as the number of columns of the final hypergraph adjacency matrix H;

[0024] S152, respectively add the values ​​of each row in the final hypergraph adjacency matrix H to obtain multiple one-dimensional row vectors; and sequentially add the multiple row vectors to the initialized node degree matrix D v The main diagonal of the node degree matrix D is realized v Calculation of

[0025] S153, respectively add the values ​​of each column in the final hypergraph adjacency matrix H to obtain multiple one-dimensional column vectors; and sequentially add the multiple column vectors to the initialized hyperedge degree matrix D e The main diagonal of e Calculation.

[0026] Furthermore, the S2 specifically includes:

[0027] S21, initialize the user representation propagation sequence, that is, X = {X (0)};

[0028] S22, multiplying the final hypergraph adjacency matrix H by the item representation matrix E, and the obtained value is used as the initial value of the user representation propagation sequence, that is, X (0) =H*E;

[0029] S23, based on the final hypergraph adjacency matrix H, node degree matrix D v and the hyperedge degree matrix D e , the user representation propagation matrix T is obtained by calculation;

[0030] S24. Based on the user representation propagation matrix T, the user representation propagation sequence is calculated; specifically: in the user representation propagation sequence, the value of the i+1th propagation result is equal to the product of the propagation matrix T and the i-th propagation result, expressed as: X (i+1) =T*X (i) Based on this, the user representation propagation sequence is obtained, that is, X = {X (i) |0≤i≤K};

[0031] Among them, X represents the user representation propagation sequence; K represents the propagation round; i represents the propagation result corresponding to the propagation round.

[0032] Furthermore, the S23 specifically includes:

[0033] S231, based on the final hypergraph adjacency matrix H, node degree matrix D v and the hyperedge degree matrix D e , the Laplace filter matrix is ​​obtained by calculation; the calculation formula corresponding to the iteration is:

[0034]

[0035] Among them, γ represents a hyperparameter with a value range of [0,1]; W represents the weight matrix, which can be taken as the unit matrix. Further sorting out the formula, we can get

[0036]

[0037] Where I represents the identity matrix, taking the Laplace matrix;

[0038]

[0039] The iteration formula is further expressed as

[0040] X (i+1) =(I-γL)X (i) ;

[0041] S232: transform the Laplace filter matrix to obtain the user representation propagation matrix T; the user representation propagation matrix T is expressed as:

[0042] T=I-γL

[0043] The iterative formula is simplified to

[0044] X (i+1)=T*X (i) ;

[0045] Furthermore, the S3 specifically includes:

[0046] S31, according to the user representation propagation sequence X, obtain a corresponding weight matrix sequence by calculation;

[0047] S32: According to the weight matrix sequence and the user representation propagation sequence X, the user representation matrix X is obtained by calculating, summing and filtering. f .

[0048] Furthermore, the S31 specifically includes:

[0049] S311, initializing the weight matrix sequence;

[0050] S312: Select the previous round of propagation result X from the user-indicated propagation sequence X. (i-1) 、Current propagation result X (i) And the next round of propagation result X (i+1) , and input it into the first multi-layer perceptron to obtain the first output result E (i) ;

[0051] S313: output the first output result E (i) and the current propagation result X (i) Splice and input the splicing result into the activation layer to obtain the current propagation result X (i) The corresponding weight matrix;

[0052] S314, adding the weight matrix obtained in each round to the weight matrix sequence; finally obtaining a complete weight matrix sequence.

[0053] Further, the S32 specifically includes:

[0054] S321, according to each weight matrix in the weight matrix sequence, and the current propagation result X (i) , calculate the weighted sum X fin , the corresponding calculation formula is expressed as:

[0055] Among them, K represents the propagation round; i represents the i-th propagation result; W i represents the i-th weight matrix;

[0056] S322, the X fin Input into the second multi-layer perceptron and output the user representation matrix X f , the user characterization matrix X f Including multiple user characterization parameters U u .

[0057] Furthermore, the S4 specifically includes:

[0058] S41, from the user representation matrix X f In the example above, we obtain the user representation parameter U corresponding to the target user u. u ;

[0059] S42, the user characterization parameter U obtained in S41 u The query representation q is concatenated and the concatenated result is input into the third multi-layer perceptron to obtain the combined representation (U u,q );

[0060] S43, the combination representation (U u,q ) are respectively concatenated with all the candidate items in the candidate item sequence D, and the concatenation results are input into a fourth multi-layer perceptron to obtain a score for each of the candidate items;

[0061] S44, sorting all the candidate items in the candidate item sequence D according to the score of each candidate item to obtain a sorted sequence D sorted ;

[0062] S45, according to the sorting sequence D sorted , and recommend to the target user.

[0063] Compared with the prior art, the personalized ranking and recommendation method based on homogeneous hypergraph attention network described in the present invention has the following beneficial effects:

[0064] Compared with the prior art, the method of the present invention can reduce the noise generated in the conversion stage when converting the user's usage data graph into homogeneous hypergraph data containing only user nodes, and use a lighter module to encode the user to perform related personalized recommendation and sorting tasks, which has the effect of simplifying the model structure and parameter scale while ensuring a certain degree of recommendation effectiveness.

[0065] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings.

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

[0067] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0068] Figure 1 A flow chart of a method for personalized sorting and recommendation based on a homogeneous hypergraph attention network provided in an embodiment of the present invention.

[0069] Figure 2 A schematic diagram of the principle of converting interactive graph data into a native hypergraph adjacency matrix provided in an embodiment of the present invention.

[0070] Figure 3 A schematic diagram of the conversion of interactive graph data into a native hypergraph adjacency matrix provided in an embodiment of the present invention.

[0071] Figure 4 A model diagram provided for an embodiment of the present invention. DETAILED DESCRIPTION

[0072] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0073] Benefiting from the substantial growth of user data, research has found that users with similar preferences are more likely to form relationship circles and tend to share each other's interests. This is a common phenomenon in public social networks such as Weibo and Twitter. Inspired by this, the embodiments of the present invention use the preferences of groups with the same / similar interests or usage records to guide recommendations, and propose a new neural network enhancement method to mine and aggregate similar users.

[0074] Users with social relationships may have different preference distributions, which may bring noise to user representation. In addition, when using raw data, most verified methods tend to construct heterogeneous (i.e., the graph has different types of nodes) graphs to learn the representation of nodes, which requires more complex network learning methods and increases the complexity of the network. Here, the present invention makes a basic assumption that the preferences of similar users are more likely to share similar elements, and this part of the interest will be partially reflected in behaviors such as clicking and reading, so mining an interest circle will be more beneficial to the accuracy of recommendations. Based on this, the present invention attempts to create a homogeneous hypergraph from a bipartite graph of user behavior to learn user preferences.

[0075] The purpose of the present invention is to improve the personalized retrieval and recommendation method based on collaborative filtering in the field of recommendation systems, and model users through the original interaction data of users. Before further introducing the work in related fields, the tasks of the present invention and some important related definitions and concepts are described as follows.

[0076] Definition 1: Personalized search task based on circles

[0077] In the personalized search task, for the item sequence obtained by rough screening, the model needs to calculate the scores of items based on the intermediate representations learned from user data and the current query conditions. Such scores predict to some extent the degree of user interest in the items or the probability that the user may "click" on the items, thereby guiding the sorting of the returned item sequence.

[0078] When learning the representation of users, the present invention pays more attention to the behavior of users rather than their own attributes to achieve anonymous learning. The present invention extracts the collective preferences of a group from similar behaviors, and based on this, users and items can be intuitively mapped to the same domain.

[0079] For the task of the present invention, given the candidate representation set D = {D i |0 < i ≤ n} (where n represents the number of candidates each time for recommendation, and i represents the serial number of the candidate. The candidate representation set comes from the upstream task, that is, the upstream determines the capacity n of the candidate set), the user-item interaction bipartite graph G b and the vector representation q of the query sent by user u (which can be the input of the upstream task, or transformed from the query keywords input during search, that is, obtained by segmenting the query input and adding them up according to word vector models such as word2vec), the model M should calculate the user representation U u and output the score set P = {P i |0 < i ≤ n} (when the candidate representation set is determined, here i and n are consistent with the candidate set, that is, P i is the score of D i ) for final sorting, where P i = M(D i , U u , q).

[0080] Unless otherwise specified, the value ranges of subsequent i or j that play a numbering role are all different, and each i or j is only valid for the formula where it is located.

[0081] Definition 2: Hypergraph

[0082] A hypergraph is a graph structure in which the number of nodes that can be linked by an edge is greater than 2. For a hypergraph, it can be defined as G = (V, ξ, X, W), where V represents the node set, ξ represents the hyperedge set, X is the node representation matrix, and W represents the edge weight matrix, which is a diagonal matrix. The values ​​of each position are the weights of the hyperedges. For a hypergraph, the adjacency matrix H with values ​​of each position in {0,1} can be used to describe the connection relationship between nodes and hyperedges. That is, for a node v i and super edge e j , when e j Connect i When , the value of the position of the i-th row and j-th column of the H matrix is ​​1, that is, Specifically, there can be

[0083]

[0084] To determine the value of each position in the H matrix. In a hypergraph, the degree of each node and the degree of each hyperedge can be calculated from the hypergraph adjacency matrix.

[0085] Definition 3: Higher-order connectivity

[0086] Simply constructing a hypergraph adjacency matrix based on the interaction situation may have the problem of data sparsity. Therefore, some methods are needed to expand the user's receptive field, that is, to connect more projects to the user, while at the same time controlling the noise generated by the expanded connection. Taking this into account, the embodiment of the present invention expands the calculation of the native k-order reachable concept. First, the concepts of k-order reachable projects and users are explained accordingly.

[0087] In the user-item bipartite graph, item a(b) is a k-order reachable item of item b(a) if and only if there is a path between items a and b with less than k (k ≥ 2) users; user c is a k-order reachable user of item a if and only if there is a project d that has a direct interaction relationship with user c, and project d is a k-order reachable item of item a.

[0088] The path in the above definition refers to a series of nodes from a certain node to a certain node in the user-item bipartite graph. For the user-item bipartite graph, the path characteristic is that users and items must appear alternately in a path of any length.

[0089] This calculation can be described by a formula. First, obtain the relevant user set Set based on the user-item interaction data. user and item set Set item , and assign ID numbers to the users and items in the collection. Next, initialize a |Set user |*|Set item |Dimension 0 matrix, combined with Set user and Setitem The user and project numbers in the matrix are filled according to the interaction data, so that the values ​​of the user number row and project number column positions are 1, and the resulting matrix is ​​set to H ori . Then for the k-order reachable relationship between user and item, we have

[0090]

[0091] Among them, H (k) represents a k-order reachable matrix, where k is the order, Indicates H ori The transpose of the matrix, the pow(*) function is a power function, and max(x,Y) means that the maximum value of each position in the Y matrix does not exceed x.

[0092] Definition 4: Improved high-order connectivity

[0093] The expansion process described by the above native high-order connectivity makes it easier for users to connect to some irrelevant items, thus forming noise in user representation learning. Therefore, the above formula can be modified to

[0094]

[0095] Among them, sim E (*) represents the similarity function based on the item representation matrix E, which is a measure of the representation similarity of two items corresponding to each non-zero position coordinate of the input matrix, where E is the item representation matrix. The similarity can be measured in many ways, such as finding the corresponding representation vector in the item representation matrix for each position of the row number i and column number j of the function input matrix O and calculating the cosine distance, that is,

[0096]

[0097] Where sim(*,*) represents a function that measures two inputs, which can be a function such as cosine (cosine value) represented by two vectors. When building hyperedges to connect users with projects, the relevance will limit the weight of the information flowing through the hyperedge. Therefore, the final hypergraph adjacency matrix H f Take

[0098]

[0099] Where normalize(*) represents the regularization function, and maxlen represents the maximum k-order number. Considering the actual situation, in the embodiment of the present invention, it should generally be 2, and at most 3, that is, only the original adjacency matrix H is taken. ori The 2nd and 3rd order reachable matrices are summed and regularized. In the following sections, H is used to refer to the final H f .

[0100] Definition 5: Hypergraph Laplacian Filter

[0101] Laplace filter is an information aggregation method used to transfer information between nodes in a hypergraph. For any vertex and any edge in the hypergraph G = (V, ξ, X, W), the degree of the node and edge can be calculated as

[0102] d(vertex)=∑ r∈ξ w(r)*h(vertex,r),d(edge)=∑ a∈V h(a,edge)

[0103] The meanings of h(v,r) and h(a,e) can be found in Definition 2. w(r) represents the weight of the corresponding hyperedge, which is recorded in the diagonal weight matrix W. Then, we can define the node degree matrix D of the hypergraph dimension |V|*|V| v and the hyperedge degree matrix D with dimension |ξ|*|ξ| e (The subscripts v and e here only indicate the identification of the matrices). These are two diagonal matrices. The elements on the diagonal are the degrees of the nodes and hyperedges respectively. The order of the nodes and hyperedges is determined by the row and column order of the adjacency matrix H.

[0104] Then the Laplace filter matrix L can be expressed as

[0105]

[0106] Where I is the identity matrix, D v represents the node degree matrix, D e represents the hyperedge degree matrix, H is the hypergraph adjacency matrix, and H T is its transpose, W represents the weight matrix (the default is the identity matrix I). Then passing information on the hypergraph to represent iteration can be expressed as

[0107] X (t+1) =(I-γL)X (t)

[0108] Where X (t) represents the node representation matrix of the tth round obtained by iteration, I is the unit matrix, and γ is a hyperparameter with a value range of [0,1]. The above formula can be understood as performing a representation iteration on each node in the hypergraph. This iterative process omits the participation of the neural network layer and activation function, thereby improving the iteration efficiency to a certain extent.

[0109] The method of the present invention is implemented by the following technical solution. In the following description, the serial numbers of all steps do not represent limitations on the execution steps of the present invention.

[0110] See also Figure 1As shown, the embodiment of the present invention provides a method for personalized sorting and recommendation based on a homogeneous hypergraph attention network, which specifically includes the following steps:

[0111] S0. Obtain the interaction graph data of all current users and projects; wherein, all current users are subjects in a logged-in state or subjects in a non-logged-in state recorded in the system to browse information in the system; projects are information, videos and / or picture information browsed by all current users recorded in the system. For example, when multiple users search and click to browse products in Taobao or search, click or browse articles and other content in the WeChat ecosystem, the method of the present application collects user behavior records in this step, thereby forming a record of the set of {user ID (anonymized), query ID, project (i.e., product or document interacted by the user) ID}. Based on the users and projects in the records, such an interactive bipartite graph can be constructed, in which there are two types of nodes: users and projects, and there are edges only between nodes of different types;

[0112] S1. Based on the interaction graph data and the project order k, calculate the final hypergraph adjacency matrix H and node degree matrix D of all current users and projects. v and the hyperedge degree matrix D e ; The item order is used to calculate the accessibility of the interaction between the current user and the item; for example, in the Taobao usage scenario, whether there is a direct or indirect "browsing" relationship between a user and a product, that is, the user has browsed the product, or the user and a user who has browsed the product have browsed another product together, thus forming a path of this user-a product-a user-the product (or longer);

[0113] S2, based on the final hypergraph adjacency matrix H and node degree matrix D v and the hyperedge degree matrix D e , and combined with the item representation matrix E, the user representation propagation sequence X is calculated; for example, in the WeChat "Search" search scenario, the following algorithm is used to generate the propagation sequence of the user representation matrix based on the representation of the articles that the user has clicked and browsed, thus realizing the concept of "completing the user portrait based on the content consumed by the user (i.e. the documents interacted with)".

[0114] S3. According to the user representation propagation sequence X, the sequence is weighted and filtered through the attention mechanism to obtain the user representation matrix X f ;

[0115] S4, according to the user characterization matrix X fThe target user representation extracted from the query representation q of the target user is combined with the query representation q of the target user to score and sort the candidate items in the candidate item sequence D; the target user is recommended according to the sorted candidate item sequence D. For example, in the WeChat scenario, when a user issues a search request through the "Search" engine or enters the "Look" application, the algorithm scores the candidate items (documents or pushed content) in turn based on the user representation learned from the user's interactive behavior history and the candidate item representation returned by the application (such as the documents captured by the engine based on the title string matching or the candidates that the application is preparing to randomly push, and the specific representation calculation can come from the upstream task), and returns the content with high scores in the front.

[0116] The following is a detailed description of each of the above steps.

[0117] In the above step S1, the interaction graph data between the current user and the project is mainly converted into the final hypergraph adjacency matrix H; specifically:

[0118] S11. Get all current user data sets Set according to the interaction graph data between the current user and the project user and project data set Set item ; and ID number the user data in the user data set, and ID number the project data in the project data set; wherein the ID numbers all start from 0;

[0119] S12, initialize the matrix of |user data set|*|project data set| dimension to obtain the initialization matrix; fill the initialization matrix according to the user data and project data with ID numbers to obtain the native hypergraph adjacency matrix H ori ; The specific filling method is: use the user data with ID number as the row label of the initialization matrix, and use the project data with ID number as the column label of the initialization matrix; if any user data with ID number interacts with any project data with ID number, the value of the corresponding position in the initialization matrix is ​​the first parameter, otherwise it is the second parameter; in the embodiment of the present invention, the first parameter is set to 1 and the second parameter is set to 0; the conversion process can refer to Figure 2 and Figure 3 shown.

[0120] S13. Based on the native hypergraph adjacency matrix H ori , calculate the 2 to k order reachability matrix H through high-order connectivity (2) ,...,H (k) ; The specific calculation formula is:

[0121]

[0122] Among them, sim E(*) represents the similarity function based on the item representation matrix E;

[0123] S14. Substitute the native hypergraph adjacency matrix H ori , the 2nd to kth order reachable matrices are summed and regularized to obtain the final hypergraph adjacency matrix H; the specific calculation formula is:

[0124]

[0125] Among them, normalize(*) represents the regularization function;

[0126] S15. Calculate the node degree matrix D based on the final hypergraph adjacency matrix H v and the hyperedge degree matrix D e ; Specifically: the node degree matrix D v and the hyperedge degree matrix D e Initialize; where the node degree matrix D v and the hyperedge degree matrix D e are all square matrices, and the node degree matrix D v The dimension is the same as the number of rows of the final hypergraph adjacency matrix H; the hyperedge degree matrix D e The dimension is the same as the number of columns of the final hypergraph adjacency matrix H; the values ​​of each row in the final hypergraph adjacency matrix H are added to obtain multiple one-dimensional row vectors; the multiple row vectors are sequentially added to the initialized node degree matrix D v In the main diagonal of v Calculate; add the values ​​of each column in the final hypergraph adjacency matrix H to obtain multiple one-dimensional column vectors; add multiple column vectors to the initialized hyperedge degree matrix D in sequence e In the main diagonal of e Calculation.

[0127] The above step S2 specifically includes:

[0128] S21, initialize the user representation propagation sequence, that is, X = {X (0)};

[0129] Among them, X represents the user representation transmission sequence; K represents the transmission round; i represents the transmission result corresponding to the transmission round;

[0130] S22, multiply the final hypergraph adjacency matrix H by the item representation matrix E, and the obtained value is used as the initial value of the user representation propagation sequence, that is, X (0) =H*E;

[0131] S23, based on the final hypergraph adjacency matrix H and node degree matrix D v and the hyperedge degree matrix D e, the user representation propagation matrix T is obtained by calculation; specifically: first, based on the final hypergraph adjacency matrix and degree matrix D v Sum degree matrix D e , the Laplace filter matrix is ​​obtained by calculation, and the calculation formula corresponding to the iteration is expressed as:

[0132]

[0133] Among them, γ represents a hyperparameter with a value range of [0,1], and W is a weight matrix, which can be taken as a unit matrix.

[0134] Further rearranging the formula, we can get

[0135]

[0136] I represents the identity matrix. Take the Laplacian matrix

[0137]

[0138] The iteration formula can be further expressed as

[0139] X (i+1) =(I-γL)X (i)

[0140] Secondly, the Laplace filter matrix is ​​transformed to obtain the user representation propagation matrix T; the user representation propagation matrix T is expressed as:

[0141] T=I-γL

[0142] Based on this, the iterative formula can be simplified to

[0143] X (i+1) =T*X (i) .

[0144] S24. Based on the user representation propagation matrix T, a user representation propagation sequence is calculated; specifically, in the user representation propagation sequence, the value of the i+1th propagation result is equal to the product of the propagation matrix T and the ith propagation result, expressed as: X (i+1) =T*X (i) Based on this, we obtain the user representation propagation sequence, namely X = {X (i) |0≤i≤K};

[0145] Among them, X represents the user representation propagation sequence; K represents the propagation round; i represents the propagation result corresponding to the propagation round.

[0146] The above step S3 specifically includes:

[0147] S31, according to the user representation propagation sequence X, the corresponding weight matrix sequence is obtained by calculation;

[0148] S32, according to the weight matrix sequence and the user representation propagation sequence X, the user representation matrix X is obtained by calculating the sum and filtering f .

[0149] Wherein, step S31 specifically includes:

[0150] S311, initializing the weight matrix sequence;

[0151] S312, select the previous round of propagation result X from the user's indicated propagation sequence X (i-1) 、Current propagation result X (i) And the next round of propagation result X (i+1) , concatenate them to obtain X (i-1) ||X (i) ||X (i+1) ; Input the splicing result into the first multi-layer perceptron MLP1 (the hidden layer is initialized to 64 dimensions * 4 layers, the input layer dimension is consistent with the splicing matrix, and the output layer dimension is consistent with E (i) Keep consistent), and obtain the first output result E (i) ;

[0152] S313, the first output result E (i) and the current propagation result X (i) To splice (X (i) ||E (i) ), input the splicing result into the activated layer activated_layer to obtain the current propagation result X (i) The corresponding weight matrix W i ;

[0153] S314, adding the weight matrix obtained in each round to the weight matrix sequence; finally obtaining a complete weight matrix sequence W; and then performing Softmax processing on W.

[0154] Step S32 specifically includes:

[0155] S321, according to each weight matrix in the weight matrix sequence, and the current propagation result X (i) , calculate the weighted sum X fin , the corresponding calculation formula is expressed as:

[0156] Among them, K represents the propagation round; i represents the i-th propagation result; W i represents the i-th weight matrix;

[0157] S322, X finInput to the second multi-layer perceptron MLP2 (by default, 4 intermediate layers are used, each with a dimension of 64, and the dimensions of the input and output layers are the same as X fin The column dimensions remain the same), output user representation matrix X f , user representation matrix X f Including multiple user characterization parameters U u .

[0158] The above step S4 specifically includes:

[0159] S41, from the user representation matrix X f In the example above, we obtain the user representation parameter U corresponding to the target user u. u ;

[0160] S42, the user characterization parameter U obtained in S41 u Concatenate with the query representation q (U u ||q), and input the concatenated result into the third multi-layer perceptron MLP3 (by default, 4 intermediate layers are taken, each layer has a dimension of 64, and the input layer dimension is |U u |+|q|, the output layer dimension is |U u |), and obtain the combined representation (U u,q );

[0161] S43, the combination expression (U u,q ) are concatenated with all the candidate items in the candidate item sequence D, and the concatenated results are input into the fourth multi-layer perceptron MLP4 (by default, 4 intermediate layers are taken, each layer has a dimension of 64, and the input layer dimension is |U u,q |+|candidate|, the output layer dimension is 1), and the score of each candidate is obtained;

[0162] S44. Sort all candidate items in candidate item sequence D according to the score of each candidate item to obtain a sorted sequence D sorted ;

[0163] S45, according to the sorting sequence D sorted , make recommendations to target users.

[0164] The embodiment of the present invention also includes calculating the model loss function and updating the model parameters; referring to Figure 4 As shown in the figure, when training the model, the network parameters of the model (including the activated_layer, MLP1, MLP2, MLP3 and MLP4 mentioned above) can be updated according to the Bayesian personalized ranking loss (BPR Loss, which is the sum of the log-sigmoid function value of the difference between the negative and positive scores in the paired training examples over the entire training set) to improve the accuracy of the model. First, a training set can be constructed.

[0165]

[0166] s pos ,s neg denote a positive example (in the user-item interaction record) and a negative example (not in the user-item interaction record). In fact, such a test case can be regarded as a candidate set containing only two candidates. Then the error of each test case can be expressed as

[0167]

[0168] Where p is the score of the positive / negative example output under the current conditions, and the loss function of a single test case is summed to get the loss function of the model. Consider adding a regularization term to the loss function of the model, then the final error can be expressed as

[0169]

[0170] Based on this, the model parameters of the encoding and recommendation parts can be optimized according to the defined loss function.

[0171] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A personalized ranking and recommendation method based on homogeneous hypergraph attention network, characterized in that: include: S0. Obtaining the interaction graph data of all current users and projects; the current users are subjects in a logged-in state or subjects in a non-logged-in state who browse information in the system as recorded in the system; the projects are the information, videos and / or pictures browsed by the current users as recorded in the system; S1. According to the interaction graph data and the project order k, calculate the final hypergraph adjacency matrix H and node degree matrix D of all current users and projects. v and the hyperedge degree matrix D e ; The item order is used to calculate the accessibility of the interaction relationship between the user and the item; S2, based on the final hypergraph adjacency matrix H, node degree matrix D v and the hyperedge degree matrix D e , and combined with the item representation matrix E, the user representation propagation sequence X is obtained by calculation; S3. According to the user representation propagation sequence X, the sequence is weighted and filtered through the attention mechanism to obtain the user representation matrix X f ; S4, according to the user characterization matrix X f The target user representation extracted from the target user is combined with the query representation q of the target user to score and sort the candidate items in the candidate item sequence D; Recommending the target user according to the sorted candidate item sequence D; The S1 specifically includes: S11. According to the interaction graph data between the current user and the project, all current user data sets and project data sets are obtained; and the user data in the user data set and the project data in the project data set are ID-numbered; the ID numbers all start from 0; S12, initialize the matrix of |user data set|*|project data set| dimension to obtain an initialization matrix; fill the initialization matrix according to the user data and project data with ID numbers to obtain the native hypergraph adjacency matrix H ori ; S13, based on the native hypergraph adjacency matrix H ori , calculate the 2nd to kth order reachability matrix through high-order connectivity; S14, the native hypergraph adjacency matrix H ori , the 2 to k order reachable matrices are summed and regularized to obtain the final hypergraph adjacency matrix H; S15. Calculate the node degree matrix D according to the final hypergraph adjacency matrix H v and the hyperedge degree matrix D e .

2. The personalized ranking and recommendation method based on homogeneous hypergraph attention network as claimed in claim 1, characterized in that: In S12, the initialization matrix is ​​filled according to the user data and project data with ID numbers to obtain the native hypergraph adjacency matrix H ori , specifically: The user data with ID numbers are used as the row labels of the initialization matrix, and the project data with ID numbers are used as the column labels of the initialization matrix; if any of the user data with ID numbers interacts with any of the project data with ID numbers, the value at the corresponding position of the initialization matrix is ​​the first parameter, otherwise it is the second parameter.

3. The personalized ranking and recommendation method based on homogeneous hypergraph attention network as claimed in claim 1, characterized in that: The S15 specifically includes: S151, respectively, the node degree matrix D v and the hyperedge degree matrix D e Initialize; the node degree matrix D v and the hyperedge degree matrix D e are all square matrices, and the node degree matrix D v The dimension of the final hypergraph adjacency matrix H is the same as the number of rows; the hyperedge degree matrix D e The dimension of is the same as the number of columns of the final hypergraph adjacency matrix H; S152, respectively add the values ​​of each row in the final hypergraph adjacency matrix H to obtain multiple one-dimensional row vectors; and sequentially add the multiple row vectors to the initialized node degree matrix D v The main diagonal of the node degree matrix D is realized v Calculation of S153, respectively add the values ​​of each column in the final hypergraph adjacency matrix H to obtain multiple one-dimensional column vectors; and sequentially add the multiple column vectors to the initialized hyperedge degree matrix D e The main diagonal of e Calculation.

4. The personalized ranking and recommendation method based on homogeneous hypergraph attention network according to claim 1, characterized in that: The S2 specifically includes: S21, initialize the user representation propagation sequence, that is, X = {X (0) }; S22, multiplying the final hypergraph adjacency matrix H by the item representation matrix E, and the obtained value is used as the initial value of the user representation propagation sequence, that is, X (0) =H*E; S23, based on the final hypergraph adjacency matrix H, node degree matrix D v and the hyperedge degree matrix D e , the user representation propagation matrix T is obtained by calculation; S24. Based on the user representation propagation matrix T, the user representation propagation sequence is calculated; specifically: in the user representation propagation sequence, the value of the i+1th propagation result is equal to the product of the propagation matrix T and the i-th propagation result, expressed as: X (i+1) =T*X (i) Based on this, the user representation propagation sequence is obtained, that is, X = {X (i) |0≤i≤K}; Among them, X represents the user representation propagation sequence; K represents the propagation round; i represents the propagation result corresponding to the propagation round.

5. The personalized ranking and recommendation method based on homogeneous hypergraph attention network as claimed in claim 4, characterized in that: The S23 specifically includes: S231, based on the final hypergraph adjacency matrix H, node degree matrix D v and the hyperedge degree matrix D e , the Laplace filter matrix is ​​obtained by calculation; the calculation formula corresponding to the iteration is: Among them, γ represents a hyperparameter whose value range is [0,1]; W represents the weight matrix, which can be taken as the unit matrix; Further rearranging the formula, we can get Where I represents the identity matrix, taking the Laplace matrix; The iteration formula is further expressed as X (i+1) =(I-γL)X (i) ; S232: transform the Laplace filter matrix to obtain the user representation propagation matrix T; the user representation propagation matrix T is expressed as: T=I-γL.

6. The personalized ranking and recommendation method based on homogeneous hypergraph attention network according to claim 1, characterized in that: The S3 specifically includes: S31, according to the user representation propagation sequence X, obtain a corresponding weight matrix sequence by calculation; S32: According to the weight matrix sequence and the user representation propagation sequence X, the user representation matrix X is obtained by calculating, summing and filtering. f .

7. The personalized ranking and recommendation method based on homogeneous hypergraph attention network according to claim 6, characterized in that: The S31 specifically includes: S311, initializing the weight matrix sequence; S312: Select the previous round of propagation result X from the user-indicated propagation sequence X. (i-1) 、Current propagation result X (i) And the next round of propagation result X (i+1) , and input it into the first multi-layer perceptron to obtain the first output result E (i) ; S313: output the first output result E (i) and the current propagation result X (i) Splice and input the splicing result into the activation layer to obtain the current propagation result X (i) The corresponding weight matrix; S314, adding the weight matrix obtained in each round to the weight matrix sequence; finally obtaining a complete weight matrix sequence.

8. The method for personalized ranking and recommendation based on homogeneous hypergraph attention network as claimed in claim 7, characterized in that: The S32 specifically includes: S321, according to each weight matrix in the weight matrix sequence, and the current propagation result X (i) , calculate the weighted sum X fin , the corresponding calculation formula is expressed as: Among them, K represents the propagation round; i represents the i-th propagation result; W i represents the i-th weight matrix; S322, the X fin Input into the second multi-layer perceptron and output the user representation matrix X f , the user characterization matrix X f Including multiple user characterization parameters U u .

9. The personalized ranking and recommendation method based on homogeneous hypergraph attention network as claimed in claim 8, characterized in that: The S4 specifically includes: S41, from the user representation matrix X f In the example above, we obtain the user representation parameter U corresponding to the target user u. u ; S42, the user characterization parameter U obtained in S41 u The query representation q is concatenated and the concatenated result is input into the third multi-layer perceptron to obtain the combined representation (U u,q ); S43, the combination representation (U u,q ) are respectively concatenated with all the candidate items in the candidate item sequence D, and the concatenation results are input into a fourth multi-layer perceptron to obtain a score for each of the candidate items; S44, sorting all the candidate items in the candidate item sequence D according to the score of each candidate item to obtain a sorted sequence D sorted ; S45, according to the sorting sequence D sorted , and recommend to the target user.

Citation Information

Patent Citations

  • Animal husbandry news information recommendation system

    CN112732995A

  • Collaborative filtering recommendation method and system based on decoupling type two-channel hypergraph neural network

    CN113505305A