An item recommendation method based on multi-task learning and knowledge graph enhancement
Through multi-task learning and knowledge graph enhancement project recommendation methods, combined with attention mechanism and graph convolution network, the data sparse and cold start problems of traditional recommendation systems are solved, and more accurate user and project recommendations are achieved.
Patent Information
- Application Number
- CN202210395173.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-15
- Publication Date
- 2024-12-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional recommendation systems face sparse data and cold start problems, making it difficult to effectively recommend new users or new projects, and the knowledge graph-based embedding method ignores the differences between knowledge graph embedding tasks and recommendation tasks.
Using multi-task learning and knowledge graph enhancement project recommendation method, the recommendation model EMKR is alternately trained, combined with recommendation modules and knowledge graph embedding modules, and using attention mechanisms and graph convolution networks to realize multi-task learning sharing of users and projects and capture them. User historical behavior and knowledge graph information.
It improves the accuracy and performance of the recommendation system, especially effectively captures user behavior preferences in sparse data scenarios, and improves the recommendation quality of new users and new projects.
Smart Images

Figure CN114817712B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of massive information processing and intelligent technology, and specifically relates to a project recommendation method based on multi-task learning and knowledge graph enhancement, wherein the projects include books, movies, music, and commodities. Background Art
[0002] With the rapid development of the Internet, data is growing exponentially. The vast amount of information makes it difficult for users to select what they are interested in from the diverse data. In order to deal with the problem of information overload and improve the user experience, the recommendation system came into being. Collaborative filtering is one of the most popular recommendation technologies. It uses the historical interactions of users to calculate the similarity between users. This technology believes that users who had similar behavioral preferences in the past will also have similar needs in the future. However, traditional recommendations often face the problems of data sparsity and cold start. The so-called data sparsity means that there are a lot of blanks in the user-item interaction matrix, so it is difficult to calculate the similarity based on historical records. The so-called cold start means that it is difficult to recommend items to a new user or difficult to recommend new items to users.
[0003] In order to meet the challenges of traditional recommendation technology, researchers have proposed hybrid recommendation, introducing auxiliary information such as project attributes, comments, and user social networks. Studies have shown that the rational use of auxiliary information can improve the performance of recommendations. In recent years, the introduction of knowledge graphs as auxiliary information for recommendations has attracted attention. The knowledge graph is essentially a semantic network, with nodes representing entities and edges representing relationships. By mapping the recommended items, users, and their attributes to the knowledge graph, it helps to capture user preferences more accurately. Compared with traditional recommendations, recommendations based on knowledge graphs give the recommendation results a certain degree of explainability.
[0004] A feasible approach to the recommendation system based on knowledge graphs follows this idea: embed the entities and relationships of the graph into a low-dimensional vector space using the knowledge graph embedding technology, and directly use the useful vectors obtained by embedding the knowledge graph as an enhancement for items or users. However, this research idea ignores the differences between knowledge graph embedding tasks and recommendation tasks. Therefore, it is necessary to provide an embedding method that is more suitable for recommendation systems and design a more effective project recommendation method based on knowledge graphs. Summary of the invention
[0005] The purpose of the present invention can be achieved by adopting the following technical solutions:
[0006] A project recommendation method based on multi-task learning and knowledge graph enhancement, wherein the projects include books, movies, music, and commodities, and the project recommendation method has the following steps:
[0007] S1. Data preparation: Obtain the historical records of user-rated items and construct the implicit feedback matrix of user items Where M is the number of users, N is the number of projects, the user with index number m has a positive preference for the project with index number n, m = 0, 1, ..., M-1, n = 0, 1, ..., N-1, then the value of the mth row and nth column of the matrix Y is 1, otherwise it is 0; at the same time, construct a knowledge graph G = {(head, relation, tail) | head, tail∈E, relation∈R}, the basic unit of the knowledge graph is the triple (head, relation, tail), where head is the head entity, tail is the tail entity, relation is the relationship from the head entity to the tail entity, E is the entity set consisting of the head entity and the tail entity, the size of the entity set E is P, R is the relationship set, the size of the relationship set R is Q;
[0008] S2. Train the recommendation model using alternating training, the recommendation model is referred to as EMKR; wherein the EMKR includes a recommendation module, a knowledge graph embedding module and L multi-task learning sharing units, referred to as SU; wherein the recommendation module includes L feature extraction layers and a prediction layer connected sequentially, the lth feature extraction layer is referred to as RS Layer l, where l = 0, 1, ..., L-1; the knowledge graph embedding module includes L feature extraction layers and a prediction layer connected sequentially, and the lth feature extraction layer is referred to as KG Layer l; SU associates with RS Layer l and KG Layer l, realize feature sharing of two related vectors;
[0009] S3. Use the trained EMKR to predict the scores of user-item pairs and return the user's recommendation list based on the scores, as follows: given a user, calculate the scores of all items for the given user, sort the scores from large to small, and the ones with higher rankings should be recommended to the user first.
[0010] Furthermore, in step S2, the recommendation module of EMKR implements a two-part modeling strategy, which first initializes two d-dimensional vectors for the user with index number m: Initialize two d-dimensional vectors for the item with index number n in, Is the user in RS Layer The context vector of 0 is used to capture the user's historical behavior. Is the user in RS Layer Auxiliary vector of 0, used to expand the user's expressive ability; The project is in RS LayerThe context vector of 0 is used to capture useful information in the knowledge graph. The project is in RS Layer Auxiliary vector of 0, used to expand the expressive power of the project; in, Is the user in RS Layer The complete vector of l, The project is in RS Layer The complete vector of l.
[0011] Furthermore, in step S2, the two-part modeling strategy is applied to all feature extraction layers, namely in The user with index number m is in RS Layer The complete vector of l, The item with index number n in RS Layer The complete vector of l.
[0012] Furthermore, in step S2, the items in the knowledge graph correspond to corresponding head entities, and EMKR unifies the index numbers of the items and the corresponding head entities, that is, the item with index number n corresponds to the head entity with index number n in the knowledge graph.
[0013] Furthermore, in step S2, a d-dimensional vector representation is initially generated for the head entity, relation, and tail entity in G, which are respectively denoted as in, The head entity with index number i in KG Layer The initial vector is 0, The relation with index number o in KG Layer The initial vector is 0, The tail entity with index number j in KG Layer 0 initial vector, i=0,1,…,P-1, o=0,1,…,Q-1, j=0,1,…,P-1.
[0014] Furthermore, in step S2, the RS of the recommended module Layer The calculation process of l is as follows:
[0015] First, sample the cnt historical click items of the user with index number m, and set the index number of the historical click items of the user to be index_k, k = 0, 1, ...cnt-1, index_k∈{0, 1, ..., N-1}; then, use the attention mechanism to obtain the user's Layer The calculation formula of the l+1 context vector and the attention mechanism is as follows:
[0016]
[0017]
[0018]
[0019] Among them, β k is the attention score of the k-th historical click item, W β is a trainable parameter matrix used to calculate the attention score, is the complete vector of the item with index number index_k in Layer l, α k is the normalized attention score calculated using formula (2), α k The value range is (0,1); when l = L-1, formula (3) obtains the vector is the context vector of the item with index m output by the feature extraction layer of the recommendation module.
[0020] Furthermore, in step S2, the KG of the knowledge graph embedding module of EMKR Layer lUse the fully connected FC() in the neural network to extract the potential features of the relationship, and the calculation method is as follows:
[0021]
[0022] in, The relation with index number o in KG Layer The vector of l, Is the relationship in KG Layer l+1 vector, W and b are the parameter matrix and bias vector used to implement full connection, which are updated by model training, and ReLU() is the activation function used to implement full connection; when l=L-1, formula (4) obtains the vector is the relation vector with index number o output by the feature extraction layer of the knowledge graph embedding module;
[0023] At the same time, the KG of the knowledge graph embedding module of EMKR Layer l Use Hop graph convolutional network layers to calculate the neighborhood vector of the head entity; let hop = 0, 1, ... Hop-1, the calculation process of the hop graph convolutional network layer is as follows:
[0024] First, sample Ns neighborhood triplets of the head entity with index number i. Among the Ns neighborhood triplets, the index number of the neighborhood tail entity is tail_s, and the index number of the neighborhood relationship is rel_s, s = 0, 1, ..., Ns-1, tail_s ∈ {0, 1, ..., P-1}, rel_s ∈ {0, 1, ..., Q-1}. Use formula (5) to calculate the importance of the sth neighborhood relationship to the head entity.
[0025]
[0026] in, The relationship with index number rel_s in KG Layer The vector of l;
[0027] Then, the normalized importance is calculated using formula (6): The value range is (0,1):
[0028]
[0029] Finally, use formula (7) to calculate the neighborhood vector of the head entity:
[0030]
[0031] Furthermore, in step S2, the relevant parts of the recommendation module and the knowledge graph embedding module are RS Layer The context vector and KG of the item with index n in l Layer The calculation process of SU for the head entity vector with index number n in l is as follows:
[0032] First, use formula (8) to calculate the interaction matrix Cross of the lth layer: (l) , then use formulas (9) and (10) to obtain the context vector and head entity vector of the item in the next layer:
[0033]
[0034]
[0035]
[0036] in, is a vector The transpose of , w1, w2, b1, b2 is a trainable d-dimensional vector introduced to realize the multi-task learning unit SU, which can automatically learn the feature sharing pattern of two related vectors; in formulas (9) and (10), when l = L-1, SU obtains the vector in is the context vector of the item with index number n output by the feature extraction layer of the recommendation module, is the head entity vector with index number n output by the feature extraction layer of the knowledge graph embedding module; it should be noted that only the head entity vector with index number i belonging to {0,1,…,N-1} will be input into SU. If index number i does not belong to {0,1,…,N-1}, then KG is obtained by formula (7) Layer The neighborhood vector of the head entity with index number i in L-1. Combining the two cases, the head entity vector of any index number i output by the feature extraction layer of the knowledge graph embedding module is
[0037] Furthermore, in step S2, the prediction layer of the recommendation module of EMKR calculates the final vector of the user with index number m Calculate the final vector of the item at index n The score of the user-item pair is calculated using formula (11):
[0038]
[0039] The prediction layer of the knowledge graph embedding module of EMKR uses formula (12) to calculate the prediction vector of the tail entity with index number j:
[0040]
[0041] in, They are respectively the vector of the head entity with index number i and the vector of the relationship with index number o output by the feature extraction layer of the knowledge graph embedding module, and concat() is a vector concatenation function;
[0042] The triple score is calculated using formula (13):
[0043]
[0044] Among them, y ioj It is the predicted score of the triple consisting of the head entity with index number n, the relation with index number o, and the tail entity with index number j.
[0045] Furthermore, in step S2, the recommendation module uses a cross entropy loss function to calculate the losses of all user-item pairs, the knowledge graph embedding module uses a cross entropy loss function to calculate the losses of all triples, and the Adam optimizer is used to optimize the losses; the alternating training introduces a hyperparameter fre to adjust the frequency of training, and the alternating training process is as follows: in one training round, the recommendation module is first trained for fre batches, and then the knowledge graph embedding module is trained once until all samples are trained, and the representation vectors of the items, users, entities and the predicted scores of the user-item pairs are output and saved EMKR.
[0046] Compared with the prior art, the present invention has the following advantages and effects:
[0047] (1) The present invention is an item recommendation method based on multi-task learning and knowledge graph enhancement. The method introduces knowledge graph as auxiliary information for recommendation and is an innovation of hybrid recommendation. The method is easy to implement in real e-commerce platforms and online applications because it is easy to obtain some attribute information of the product and organize it into a knowledge graph.
[0048] (2) The EMKR designed by the present invention designs a two-part modeling strategy, which models both users and projects as context vectors and auxiliary vectors, where the user context vector captures the user's historical behavior pattern using an attention mechanism, and the project context vector uses a multi-task learning shared unit to associate the knowledge graph. The auxiliary part expands the expression ability of users and projects. The knowledge graph embedding module aggregates multi-hop neighborhood information by stacking graph convolutional network layers and distinguishes the importance of relationships, which can better express the semantic diversity of relationships in the graph.
[0049] (3) The project recommendation method provided by the present invention not only better utilizes the deep multi-relational semantics of the knowledge graph, but also makes full use of the user's historical records, and can effectively capture the user's behavioral preferences in sparse recommendation scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 It is a schematic diagram of the data format and knowledge graph construction of book recommendations in an embodiment of the present invention;
[0051] Figure 2 Schematic diagram of the EMKR model for project recommendation based on multi-task learning and knowledge graph enhancement in the present invention;
[0052] Figure 3 It is the EMKR training flow chart of the present invention. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] Example
[0055] This embodiment introduces a project recommendation method based on multi-task learning and knowledge graph enhancement, where the projects include books, movies, music, and commodities. The book recommendation scenario is used as a specific implementation example. The implementation process of the method is as follows:
[0056] T1. Data preparation: In a book rating or online reading system, the rating records of M users on N books are usually recorded. For example, the rating method is to give an explicit score of 0-5. The present invention converts this explicit score into an implicit score according to the threshold 3, that is, if the score is greater than 3, the implicit score is 1, otherwise it is 0, and constructs an implicit feedback matrix The user with index number m has a positive preference for the item with index number n, m = 0, 1, ..., M-1, n = 0, 1, ..., N-1, then the value of the mth row and nth column of the matrix Y is 1, otherwise it is 0; various attributes of books are easily collected in the book rating system, such as book name, book type, author, etc., so the knowledge graph G = {(head, relation, tail)|head, tail∈E, relation∈R} can be constructed based on these attributes. The basic unit of the knowledge graph is the triple (head, relation, tail), where head is the head entity, tail is the tail entity, relation is the relationship from the head entity to the tail entity, E is the entity set consisting of the head entity and the tail entity, the size of the entity set E is P, R is the set of relations, and the size of the relationship set R is Q; for example Figure 1 The (book1, author, author1) in the formula indicates that the author of book1 is author1. Starting from the head entity of book1, different tail entities are linked through various attribute relationships. Therefore, for each pair of user-book interaction data in the recommendation, the book can find a corresponding head entity in the knowledge graph, and the index number of the book and the corresponding head entity is the same, that is, the book with index number n corresponds to the head entity with index number n in the knowledge graph. Figure 1 Demonstrated examples of the recommended data format and the corresponding knowledge graph construction in the recommendation method based on multi-task learning and knowledge graph enhancement;
[0057] T2. Set the hyperparameters of the recommendation model, L, Hop, bs, Epochs, fre, cnt, and Ns. The recommendation model is referred to as EMKR. The EMKR includes a recommendation module, a knowledge graph embedding module, and L multi-task learning sharing units, referred to as SU. The recommendation module includes L feature extraction layers connected sequentially and a prediction layer. The lth feature extraction layer is referred to as RS. Layer l, where l = 0, 1, ..., L-1; the knowledge graph embedding module includes L feature extraction layers and a prediction layer connected sequentially, and the lth feature extraction layer is referred to as KG Layer l; SU associates with RS Layer l and KG Layer l, to achieve feature sharing of two related vectors; Hop is the number of graph convolutional network layers in the feature extraction layer of the knowledge graph embedding module, bs is the batch size of training, Epochs is the round of EMKR training, fre is a hyperparameter that can adjust the training frequency of the two modules, cnt is the number of sampled history items, Ns is the number of triples in the neighborhood of the sampling head entity; two d-dimensional vectors are initialized for the user with index number m Initialize two d-dimensional vectors for the item with index number n in, Is the user in RS Layer The context vector of 0 is used to capture the user's historical behavior. is the user's auxiliary vector, used to expand the user's expressive ability, Is the project in RS Layer The context vector of 0 is used to capture useful information in the knowledge graph. It is an auxiliary vector of the project, which is used to expand the expressive power of the project. Layer The complete vector of 0 Projects in RS Layer The complete vector of 0 Users in RS Layer The complete vector of l Projects in RS Layer The complete vector of l; The head entity with index number i, the relationship with index number o, and the tail entity with index number j in the knowledge graph are initially located in KG Layer Initial vector of 0 i=0,1,…,P-1,o=0,1,…,Q-1,j=0,1,…,P-1;The initial current layer number l=0,the current training generation number epo=0,the current number of layers of graph convolution layer hop=0,the number of times the current recommendation task is trained f=0;
[0058] T3. Randomly sample cnt historical click items of the user with index number m, and set their index numbers as index_k, k = 0, 1, ...cnt-1, index_k∈{0, 1, ..., N-1}; then, use the attention mechanism to update the user's context vector. The calculation formula of the attention mechanism is as follows:
[0059]
[0060]
[0061]
[0062] Among them, β k is the attention score of the k-th historical click item, W β is a trainable parameter matrix used to calculate the attention score, The item with index number index_k in RS Layer The complete vector of l, α k is the normalized attention score calculated using formula (2), α k The value range is (0,1); when l = L-1, formula (3) obtains the vector is the context vector of the item with index m output by the feature extraction layer of the recommendation module;
[0063] T4. Use the fully connected FC() in the neural network to extract the potential features of the relationship. The calculation method is as follows:
[0064]
[0065] in, The relation with index number o in KG Layer The vector of l, Is the relationship in KG Layer l+1 vector, W and b are the parameter matrix and bias vector used to implement full connection, which are updated by model training, and ReLU() is the activation function used to implement full connection; when l=L-1, formula (4) obtains the vector is the relation vector with index number o output by the feature extraction layer of the knowledge graph embedding module;
[0066] T5. For the Ns neighborhood triples of the head entity with sampling index i, in the Ns neighborhood triples, the index of the neighborhood tail entity is tail_s, and the index of the neighborhood relation is rel_s, where s = 0, 1,..., Ns - 1, tail_s ∈ {0, 1,…, P - 1}, rel_s ∈ {0, 1,…, Q - 1}. Use formula (5) to calculate the importance of the s-th neighborhood relation to this head entity.
[0067]
[0068] Among them, is the vector of the relation with index rel_s in KG Layer l;
[0069] Then, use formula (6) to calculate the normalized importance The value range is (0, 1):
[0070]
[0071] Finally, use formula (7) to calculate the neighborhood vector of this head entity
[0072]
[0073] T6. If hop < Hop, repeat T5, hop = hop + 1; otherwise, enter T7;
[0074] T7. Use formula (8) to calculate the interaction matrix Cross of the l-th layer (l) , and then, use formulas (9), (10) to obtain the context vector and head entity vector of this item in the next layer:
[0075]
[0076]
[0077]
[0078] Among them, is the transpose of the vector w1, w2, b1, b2 are trainable d-dimensional vectors introduced to implement the multi-task learning unit SU, which can automatically learn the feature sharing pattern of two related vectors; in formulas (9), (10), when l = L - 1, SU obtains the vector Among them is the context vector of the item with index n output by the feature extraction layer of the recommendation module, is the head entity vector with index n output by the feature extraction layer of the knowledge graph embedding module; note that only the head entity vectors with index i belonging to {0, 1, …, N - 1} will be input into SU. If the index i does not belong to {0, 1, …, N - 1}, then is the KG obtained by formula (7) Layer The neighborhood vector of the head entity with index i at L - 1. Combining the two cases, the head entity vector with any index i output by the feature extraction layer of the knowledge graph embedding module is
[0079] T8. When l < L, repeat T3 - T7, l = l + 1. Otherwise, go to T9;
[0080] T9. The prediction layer of the recommendation module of EMKR calculates the final vector of the user with index m Calculate the final vector of the item with index n Use formula (11) to calculate the score of the user - item pair:
[0081]
[0082] The prediction layer of the knowledge graph embedding module of EMKR uses formula (12) to calculate the prediction vector of the tail entity with index j
[0083]
[0084] Among them, are respectively the vector of the head entity with index i and the vector of the relationship with index o output by the feature extraction layer of the knowledge graph embedding module, and concat() is the vector concatenation function;
[0085] Use formula (13) to calculate the triple score:
[0086]
[0087] Among them, y ioj is the prediction score of the triple composed of the head entity with index n, the relationship with index o, and the tail entity with index j;
[0088] T10. Use the cross - entropy loss function to calculate the losses of the recommendation module and the knowledge graph embedding module;
[0089] T11. When f < fre, use the Adam optimizer to optimize the loss of the recommendation module, f = f + 1. Otherwise, optimize the loss of the knowledge graph embedding module and reset f = 0;
[0090] T12. When epo < Epochs, repeat T3 - T11, epo = epo + 1; otherwise, the training ends and proceeds to T13.
[0091] T13. Use the model EMKR to recommend projects to users. Specifically: Given a user, calculate his scores for all projects, sort the scores from largest to smallest, and the projects with higher rankings should be recommended to the user with higher priority.
[0092] To verify the effectiveness of the project recommendation method based on multi - task learning and knowledge graph enhancement proposed in this application, the Book - Crossing dataset for book recommendation is used for verification. The basic statistics of this dataset are shown in Table 1. Among them, the number of users is 17860, the number of projects is 14910, the number of rating records is 139746, and the constructed knowledge graph has 19793 triples. The important parameter settings for this experiment are shown in Table 2.
[0093] Table 1. Basic statistics table of Book - Crossing dataset and knowledge graph
[0094] Dataset user project Record Triple Book-Crossing 17860 14910 139746 19793
[0095] Table 2. Experimental parameter setting table
[0096] Dataset d Epochs L bs Hop cnt N fre Book-Crossing 8 4 1 32 2 3 3 2
[0097] Compare this invention with the existing MKR and RippleNet, use accuracy to evaluate the performance, and the comparison results are shown in Table 3:
[0098] Table 3. Experimental comparison result table
[0099] method Accuracy RippleNet 0.622 MKR 0.704 EMKR 0.862
[0100] As can be seen from Table 3, the accuracy of a project recommendation method based on multi - task learning and knowledge graph enhancement of this invention reaches 0.862, having better prediction performance.
[0101] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications made without departing from the spirit and principle of the present invention shall be equivalent replacement methods and are all included in the protection scope of the present invention.
Claims
1. A project recommendation method based on multi-task learning and knowledge graph enhancement, where: The items include books, movies, music, and commodities, and the item recommendation method includes the following steps: S1. Data preparation: Obtain the historical records of user-rated items and construct the implicit feedback matrix of user items , where M is the number of users, N is the number of items, the user with index number m has a positive preference for the item with index number n, m=0,1,…,M-1, n=0,1,…,N-1, then the value of the mth row and nth column of the matrix Y is 1, otherwise it is 0; at the same time, construct the knowledge graph G={(head,relation,tail)|head,tail∈E,relation∈R}, the basic unit of the knowledge graph is the triple (head,relation,tail), where head is the head entity, tail is the tail entity, relation is the relationship from the head entity to the tail entity, E is the entity set consisting of the head entity and the tail entity, the size of the entity set E is P, R is the relationship set, the size of the relationship set R is Q; S2. Train the recommendation model using alternating training, the recommendation model is referred to as EMKR; wherein the EMKR includes a recommendation module, a knowledge graph embedding module and L multi-task learning sharing units, referred to as SU; wherein the recommendation module includes L feature extraction layers and a prediction layer connected sequentially, the lth feature extraction layer is referred to as RS Layer l, where l=0,1,…,L-1; the knowledge graph embedding module includes L feature extraction layers and a prediction layer connected sequentially, and the lth feature extraction layer is referred to as KG Layer l; SU associates with RS Layer l and KG Layer l, realize feature sharing of two related vectors; S3. Use the trained EMKR to predict the scores of user-item pairs and return the user's recommendation list based on the scores, as follows: given a user, calculate the scores of all items for the given user, sort the scores from large to small, and the ones with higher rankings should be recommended to the user first.
2. According to claim 1, a project recommendation method based on multi-task learning and knowledge graph enhancement is characterized in that: In step S2, the recommendation module of EMKR implements a two-part modeling strategy, which first initializes two d-dimensional vectors for the user with index number m: , , initial two d-dimensional vectors for the item with index number n , ,in, Is the user in RS Layer The context vector of 0 is used to capture the user's historical behavior. Is the user in RS Layer Auxiliary vector of 0, used to expand the user's expressive ability; The project is in RS Layer The context vector of 0 is used to capture useful information in the knowledge graph. The project is in RS Layer Auxiliary vector of 0, used to expand the expressive power of the project; , ,in, Is the user in RS Layer The complete vector of l, The project is in RS Layer The complete vector of l.
3. The project recommendation method based on multi-task learning and knowledge graph enhancement according to claim 2, characterized in that: In step S2, a two-part modeling strategy is applied to all feature extraction layers, namely, , ,in The user with index number m is in RS Layer The complete vector of l, The item with index number n in RS Layer The complete vector of l.
4. The project recommendation method based on multi-task learning and knowledge graph enhancement according to claim 3 is characterized in that: In step S2, each item corresponds to the corresponding head entity in the knowledge graph, and EMKR unifies the index numbers of the items and the corresponding head entities, that is, the item with index number n corresponds to the head entity with index number n in the knowledge graph.
5. The project recommendation method based on multi-task learning and knowledge graph enhancement according to claim 4, characterized in that: In step S2, a d-dimensional vector representation is initially generated for the head entity, relation, and tail entity in G, which are respectively denoted as , , ,in, The head entity with index number i in KG Layer The initial vector is 0, The relation with index number o in KG Layer The initial vector is 0, The tail entity with index number j in KG Layer 0 initial vector, i=0,1,…,P-1, o=0,1,…,Q-1, j=0,1,…,P-1.
6. The project recommendation method based on multi-task learning and knowledge graph enhancement according to claim 5, characterized in that: In step S2, the RS of the recommended module Layer The calculation process of l is as follows: First, sample the cnt historical click items of the user with index number m, and set the index number of the historical click items of the user to be index_k, k=0,1,…cnt-1, index_k∈{0,1,…,N-1}; then, use the attention mechanism to obtain the user’s Layer The context vector of l +1, the calculation formula of the attention mechanism is as follows: (1) (2) (3) Among them, β k is the attention score of the k-th historical click item, W β is a trainable parameter matrix used to calculate the attention score, is the complete vector of the item with index number index_k in Layer l, α k is the normalized attention score calculated using formula (2), α k The value range is (0,1); when l=L-1, formula (3) obtains the vector , is the context vector of the item with index m output by the feature extraction layer of the recommendation module.
7. The project recommendation method based on multi-task learning and knowledge graph enhancement according to claim 6, characterized in that: In step S2, the KG of the knowledge graph embedding module of EMKR Layer lUse the fully connected FC() in the neural network to extract the potential features of the relationship, and the calculation method is as follows: (4) in, The relation with index number o in KG Layer The vector of l, Is the relationship in KG Layer l+1 vector, W and b are the parameter matrix and bias vector used to implement full connection, which are updated by model training, and ReLU() is the activation function used to implement full connection; when l=L-1, formula (4) obtains the vector , is the relation vector with index number o output by the feature extraction layer of the knowledge graph embedding module; At the same time, the KG of the knowledge graph embedding module of EMKR Layer l Use Hop graph convolutional network layers to calculate the neighborhood vector of the head entity; let hop=0,1,…Hop-1, the calculation process of the hop graph convolutional network layer is as follows: First, sample Ns neighborhood triplets of the head entity with index number i. Among the Ns neighborhood triplets, the index number of the neighborhood tail entity is tail_s, and the index number of the neighborhood relationship is rel_s, s=0,1,...,Ns-1, tail_s∈{0,1,...,P-1}, rel_s∈{0,1,...,Q-1}. Use formula (5) to calculate the importance of the sth neighborhood relationship to the head entity. : (5) in, The relationship with index number rel_s in KG Layer The vector of l; Then, the normalized importance is calculated using formula (6): , The value range is (0,1): (6) Finally, use formula (7) to calculate the neighborhood vector of the head entity: : (7)。 8. The project recommendation method based on multi-task learning and knowledge graph enhancement according to claim 1, characterized in that: In step S2, the relevant parts of the recommendation module and the knowledge graph embedding module are RS Layer The context vector and KG of the item with index n in l Layer The calculation process of SU for the head entity vector with index number n in l is as follows: First, use formula (8) to calculate the interaction matrix of the lth layer: , then use formulas (9) and (10) to obtain the context vector and head entity vector of the item in the next layer: (8) (9) (10) in, is a vector The transpose of w1, w2, b1, and b2 are trainable d-dimensional vectors introduced to realize the multi-task learning unit SU, which can automatically learn the feature sharing pattern of two related vectors; in formulas (9) and (10), when l=L-1, SU obtains the vector , ,in is the context vector of the item with index number n output by the feature extraction layer of the recommendation module, is the head entity vector with index number n output by the feature extraction layer of the knowledge graph embedding module; only the head entity vector with index number i belonging to {0,1,…,N-1} will be input into SU. If index number i does not belong to {0,1,…, N-1}, then ; KG is obtained by formula (7) Layer The neighborhood vector of the head entity with index number i in L-1. Combining the two cases, the head entity vector of any index number i output by the feature extraction layer of the knowledge graph embedding module is .
9. The project recommendation method based on multi-task learning and knowledge graph enhancement according to claim 8, characterized in that: In step S2, the recommendation module uses a cross entropy loss function to calculate the losses of all user-item pairs, the knowledge graph embedding module uses a cross entropy loss function to calculate the losses of all triples, and the Adam optimizer is used to optimize the losses; the alternating training introduces a hyperparameter fre to adjust the frequency of training, and the alternating training process is as follows: in one training round, the recommendation module is first trained for fre batches, and then the knowledge graph embedding module is trained once until all samples are trained, and the representation vectors of the items, users, entities and the predicted scores of the user-item pairs are output and saved EMKR.
Citation Information
Cited By
Potential supplier recommendation method based on knowledge graph enhanced relational graph convolutional network
CN120632176A
