A movie recommendation method based on collaborative enhancement and graph attention neural network
By constructing a movie knowledge graph and using a graph attention neural network, the problems of data sparsity and cold start in movie recommendation are solved, the accuracy of the recommendation system is improved, and in-depth mining of user interests and movie features is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG UNIV OF TECH
- Filing Date
- 2023-05-29
- Publication Date
- 2026-04-28
AI Technical Summary
Existing movie recommendation methods fail to fully utilize interactive, collaborative, and auxiliary information, resulting in data sparsity and cold-start problems, leading to insufficient recommendation accuracy.
We employ a method based on collaborative reinforcement and graph attention neural networks. By constructing a movie knowledge graph, we use the TransH knowledge graph representation learning algorithm for preprocessing, and combine graph attention networks to learn the embedding vectors of users and movies. We then calculate multi-layer embedding vectors of users and movies to predict the probability of a user watching a movie.
It improves the accuracy of movie recommendations, alleviates the problems of data sparsity and cold start, and enables the recommendation system to better uncover users' potential interests and the potential features of movies.
Smart Images

Figure CN116662656B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of recommender systems, and in particular to a movie recommendation method based on collaborative enhancement and graph attention neural networks. Background Technology
[0002] In recent years, people have become increasingly accustomed to watching movies online, and the rise of movie streaming platforms has brought great convenience. However, with the increase in the number of movies, users find it difficult to quickly find movies that interest them. Therefore, movie recommendation systems have emerged and are currently a hot research topic. Collaborative filtering, as a typical personalized recommendation model, utilizes user collaboration signals and makes recommendations based on the interaction information between users and items, and is widely used in various recommendation scenarios. It assumes that similar users often share common latent preferences, making it intuitive, effective, and highly interpretable.
[0003] However, movie recommendation scenarios often suffer from data sparsity. With a vast library of movies, the proportion of films a user hasn't seen differs significantly from the proportion of movies they have. Furthermore, new user registrations lead to a cold start problem for movie recommendation systems. Collaborative filtering alone doesn't perform well in addressing these issues. Movie knowledge graphs, as information carriers capable of holding substantial semantic structure and relational information about movies, have been frequently used in recent years to assist recommendation systems. Movie knowledge graphs connect independent movie entities through different types of relationships, expanding movie attribute information and capturing potential semantic relevance between movies, thus improving the accuracy and interpretability of recommendation predictions. Graph neural networks can effectively capture node and edge information within the movie knowledge graph. Therefore, extending collaborative filtering recommendation by using graph neural networks to mine movie knowledge graph information can effectively alleviate data sparsity and cold start problems, improving recommendation performance. Summary of the Invention
[0004] To overcome the shortcomings of existing movie recommendation methods in fully utilizing interactive, collaborative, and auxiliary information, as well as the problems of data sparsity and cold start, and to improve the accuracy of recommendation algorithms, this invention proposes a movie recommendation method based on collaborative enhancement and graph attention neural networks.
[0005] The technical solution adopted by this invention to solve its technical problem is: a movie recommendation method based on collaborative enhancement and graph attention neural networks, the specific steps of which are:
[0006] Step 1: Extract the feature information of each entity and the relationship information between entities in the movie dataset to be processed, and construct a movie knowledge graph with entities as nodes and entity relationships as nodes. The nodes include: movie name node, actor node, theme node, genre node and year node; obtain the user and movie sets according to the user-movie interaction matrix.
[0007] Step 2: Use the TransH knowledge graph representation learning algorithm to preprocess the movie knowledge graph data to obtain the initial embedding vectors of movie knowledge graph entities and relations;
[0008] Step 3: Randomly select one user from the user set, calculate its initial set of interactive movie entities using the interaction information, and calculate the user's interaction embedding vector based on this set;
[0009] Step 4: Based on the user's initial interactive movie entity set, map it onto the movie knowledge graph for propagation, calculate the embedding vector of the l-th layer and the head entity embedding vector after random sampling;
[0010] Step 5: Calculate the multi-layer embedding vector of the end user on the movie knowledge graph using the head entity embedding vector from Step 4;
[0011] Step 6: Calculate the user's embedding vector using the interaction embedding vector in Step 3, the embedding vectors of each layer in Step 4, and the multi-layer embedding vector in Step 5; traverse the user set and repeat Steps 3 to 6 to calculate the embedding vectors of all users.
[0012] Step 7: Take any movie from the movie set, use the collaborative interaction information to calculate its initial collaborative movie entity set, and calculate the collaborative embedding vector of the movie based on the set;
[0013] Step 8: Map the collaborative interaction movie entity set of the movie onto the movie knowledge graph for propagation, and calculate the embedding vector of the l-th layer and the head entity embedding vector after random sampling;
[0014] Step 9: Calculate the final multi-layer embedding vector of the movie on the movie knowledge graph using the head entity embedding vector from Step 8;
[0015] Step 10: Calculate the embedding vector of a movie using its own embedding vector, the co-embedding vector in step 7, the embedding vectors of each layer in step 8, and the multi-layer embedding vectors in step 9; traverse the movie set and repeat steps 7 to 10 to calculate the embedding vector of all movies.
[0016] Step 11: Predict the probability of a user watching a movie based on the embedding vectors of the user and the movie, calculate the loss function, and end the calculation when the loss value is less than the set minimum loss value; for a user in the set, recommend the top K movies based on the predicted rating from high to low, where K is the set number of recommended movies.
[0017] In step 1, in the user-movie interaction matrix Y = {y uv In |u∈U,v∈V}, U={u1,u2,...,u m Let} represent the user set, V = {v1, v2, ..., v...} n} represents a collection of movies, where y represents movies that a user has watched. uv =1, otherwise y uv =0;
[0018] In step 1, the movies in the user-movie interaction matrix are aligned with their corresponding entities on the movie knowledge graph to obtain the corresponding neighbor attribute features of the movies on the movie knowledge graph.
[0019] In step 2, the TransH knowledge graph representation learning algorithm is used to map the entities and relations in the knowledge graph to a low-dimensional vector space to obtain initial embedding vectors. The movie knowledge graph G consists of H triples (h, r, t), where h ∈ ε, r ∈ η, and t ∈ ε are the head entity, relation, and tail entity of the triple, respectively, and ε = {e1, e2, ..., e A} represents the set of movie entities, η = {r1, r2, ..., r B} represents the set of relationships between movie entities;
[0020] In step 3, for any user u, obtain its initial set of interactive movie entities, and calculate the interaction embedding vector of user u based on this set.
[0021]
[0022]
[0023] Where v→e means finding the corresponding movie entity e on the movie knowledge graph based on user u's interactive movies. It corresponds A movie entity e in the set i The embedding vector.
[0024] In step 4, the initial set of interactive movie entities from step 3 is mapped onto the movie knowledge graph for propagation, and the corresponding attention weights are calculated.
[0025]
[0026] in
[0027] λ r =σ(W2ReLU(W1z0+b1)+b2) (4)
[0028]
[0029]
[0030] Embed vectors for each head entity. Let W and b be the corresponding relation embedding vectors, where W and b are trainable weights and biases; ReLU is the non-linear activation function, and σ is the Sigmoid activation function. The set of triples belonging to the l-th layer for the head entity corresponding to user u in the movie knowledge graph;
[0031] Step 4 uses attention weights to calculate the embedding vector of movie user u at layer l of the movie knowledge graph.
[0032]
[0033] in
[0034]
[0035] Let L be the set of all tail entities in the l-th level movie knowledge graph, and let L be the total number of hops in the movie knowledge graph. t Indicates the tail entity. This is one of the tail entities in the l-th layer of the film knowledge graph. Represents the embedding vector corresponding to entity e; the initial set of interactive movie entities that interact with user u. Corresponding to layer 0, the entities connected to layer 0 in the movie knowledge graph are layer 1, and so on for other layers;
[0036] In step 4, based on the randomly sampled tail entity set, attention weights are used to calculate the head entity embedding vectors for each layer of the movie knowledge graph.
[0037]
[0038] in It is a set of tail entities that are randomly sampled from all corresponding tail entities in the head entity of the l-th layer; This represents the head entity embedding vector of the l-th layer. This represents the tail entity embedding vector of the l-th layer. This represents the splicing operation, where σ is a non-linear activation function.
[0039] In step 5, the multi-layer embedding vector of the movie knowledge graph is calculated using the head entity embedding vector from step 4.
[0040]
[0041] Attention weight
[0042]
[0043]
[0044] It is the initial embedding vector of movie v.
[0045] In step 6, the embedding vector of user u is calculated by concatenating the interactive embedding vector from step 3, the embedding vectors of each layer from step 4, and the multi-layer embedding vectors from step 5.
[0046]
[0047] Iterate through the user set U, repeating steps 3 to 6, and calculate the embedding vectors for all users.
[0048] In step 7, for any chosen movie v, its initial set of cooperative movie entities is obtained, and the cooperative embedding vector of movie v is calculated based on this set.
[0049]
[0050]
[0051] in
[0052]
[0053] Let 'a' represent movie v and v'. a Common interactive users, v a v represents a collaborative neighbor that shares users with v. a →e is the corresponding movie entity e on the movie knowledge graph found based on the collaborative neighbors of movie v.
[0054] In step 8, the initial collaborative movie entity set from step 7 is mapped onto the movie knowledge graph for propagation, and the corresponding attention weights are calculated.
[0055]
[0056] in
[0057] λ r =σ(W2ReLU(W1z0+b1)+b2) (4)
[0058]
[0059]
[0060] Embed vectors for each head entity. Let W and b be the corresponding relation embedding vectors, where W and b are trainable weights and biases; ReLU is the non-linear activation function, and σ is the Sigmoid activation function. The set of triples belonging to the l-th layer for the head entity corresponding to movie v in the movie knowledge graph;
[0061] Step 8 uses attention weights to calculate the embedding vector of movie v at layer l of the movie knowledge graph.
[0062]
[0063] in
[0064]
[0065] Let L be the total number of hops in the film knowledge graph at level l, and let e be the total number of hops in the film knowledge graph. t Indicates the tail entity. This is one of the tail entities in the l-th layer of the film knowledge graph. Represents the embedding vector corresponding to entity e; the initial co-movie entity set of movie v. Corresponding to layer 0, the entities connected to layer 0 in the movie knowledge graph are layer 1, and so on for other layers;
[0066] In step 8, based on the randomly sampled tail entity set, attention weights are used to calculate the head entity embedding vectors for each layer of the movie knowledge graph.
[0067]
[0068] in It is a set of tail entities that are randomly sampled from all corresponding tail entities in the head entity of the l-th layer; This represents the head entity embedding vector of the l-th layer. This represents the tail entity embedding vector of the l-th layer. This represents the splicing operation, where σ is a non-linear activation function.
[0069] In step 9, the multi-layer embedding vector of the movie knowledge graph is calculated using the head entity embedding vector from step 8.
[0070]
[0071] Attention weight
[0072]
[0073]
[0074] It is the initial embedding vector of movie v.
[0075] In step 10, the embedding vector of movie v is calculated by concatenating the movie's own embedding vector, the co-embedding vector from step 7, the embedding vectors from each layer in step 8, and the multi-layer embedding vectors from step 9.
[0076]
[0077] Traverse the movie set V, repeating steps 7 to 10, and calculate the embedding vectors for all movies;
[0078] Calculate the loss function in step 11.
[0079]
[0080] in
[0081]
[0082] σ is the Sigmoid activation function; function Υ + and Υ - These represent positive and negative samples, respectively. Represents the cross-entropy loss, parameterized by α. It is an L2-regularization term; y uv It represents the actual interaction between user u and movie v. It predicts the probability that user u will watch movie v.
[0083] The technical concept of this invention is as follows: learn the semantic and relational information of movies in the movie knowledge graph through graph attention network, make recommendations using collaborative information, interaction information and knowledge graph information, and learn user embedding vectors and movie embedding vectors with richer information to make predictions more accurate.
[0084] The advantages of this invention are: by introducing collaborative information and knowledge graph information into the movie recommendation system, it can mine users' potential long-distance interests and the potential features of movies, resulting in higher recommendation accuracy and solving the problems of data sparsity and cold start to a certain extent. Attached Figure Description
[0085] Figure 1 This is a schematic diagram of a movie recommendation system consisting of a user-movie interaction graph and a movie knowledge graph. Circles represent user entities, rectangles represent song entities, diamonds represent knowledge graph entities, and dashed boxes contain the user's interactive movie neighbors and the movie's collaborative interactive movie neighbors, respectively.
[0086] Figure 2This is a flowchart of the method of the present invention. Detailed Implementation
[0087] To further illustrate the implementation examples, the present invention will be further described below with reference to the accompanying drawings.
[0088] Reference Figure 2 A movie recommendation method based on collaborative enhancement and graph attention neural networks includes the following steps:
[0089] Step 1: Extract the feature information of each entity and the relationship information between entities in the movie dataset to be processed, and construct a movie knowledge graph with entities as nodes and entity relationships as nodes. The nodes include: movie name node, actor node, theme node, genre node and year node; obtain the user and movie sets according to the user-movie interaction matrix.
[0090] Step 2: Use the TransH knowledge graph representation learning algorithm to preprocess the movie knowledge graph data to obtain the initial embedding vectors of movie knowledge graph entities and relations;
[0091] Step 3: Randomly select one user from the user set, calculate its initial set of interactive movie entities using the interaction information, and calculate the user's interaction embedding vector based on this set;
[0092] Step 4: Based on the user's initial interactive movie entity set, map it onto the movie knowledge graph for propagation, calculate the embedding vector of the l-th layer and the head entity embedding vector after random sampling;
[0093] Step 5: Calculate the multi-layer embedding vector of the end user on the movie knowledge graph using the head entity embedding vector from Step 4;
[0094] Step 6: Calculate the user's embedding vector using the interaction embedding vector in Step 3, the embedding vectors of each layer in Step 4, and the multi-layer embedding vector in Step 5; traverse the user set and repeat Steps 3 to 6 to calculate the embedding vectors of all users.
[0095] Step 7: Take any movie from the movie set, use the collaborative interaction information to calculate its initial collaborative movie entity set, and calculate the collaborative embedding vector of the movie based on the set;
[0096] Step 8: Map the collaborative interaction movie entity set of the movie onto the movie knowledge graph for propagation, and calculate the embedding vector of the l-th layer and the head entity embedding vector after random sampling;
[0097] Step 9: Calculate the final multi-layer embedding vector of the movie on the movie knowledge graph using the head entity embedding vector from Step 8;
[0098] Step 10: Calculate the embedding vector of a movie using its own embedding vector, the co-embedding vector in step 7, the embedding vectors of each layer in step 8, and the multi-layer embedding vectors in step 9; traverse the movie set and repeat steps 7 to 10 to calculate the embedding vector of all movies.
[0099] Step 11: Predict the probability of a user watching a movie based on the embedding vectors of the user and the movie, calculate the loss function, and end the calculation when the loss value is less than the set minimum loss value; for a user in the set, recommend the top K movies based on the predicted rating from high to low, where K is the set number of recommended movies.
[0100] In step 1, in the user-movie interaction matrix Y = {y uv In |u∈U,v∈V}, U={u1,u2,...,u m Let} represent the user set, V = {v1, v2, ..., v...} n} represents a collection of movies, where y represents movies that a user has watched. uv =1, otherwise y uv =0;
[0101] In step 1, the movies in the user-movie interaction matrix are aligned with their corresponding entities on the movie knowledge graph to obtain the corresponding neighbor attribute features of the movies on the movie knowledge graph.
[0102] In step 2, the TransH knowledge graph representation learning algorithm is used to map the entities and relations in the knowledge graph to a low-dimensional vector space to obtain initial embedding vectors. The movie knowledge graph G consists of H triples (h, r, t), where h ∈ ε, r ∈ η, and t ∈ ε are the head entity, relation, and tail entity of the triple, respectively, and ε = {e1, e2, ..., e A} represents the set of movie entities, η = {r1, r2, ..., r B} represents the set of relationships between movie entities;
[0103] In step 3, for any user u, obtain its initial set of interactive movie entities, and calculate the interaction embedding vector of user u based on this set.
[0104]
[0105]
[0106] Where v→e means finding the corresponding movie entity e on the movie knowledge graph based on user u's interactive movies. It corresponds A movie entity e in the set i The embedding vector.
[0107] In step 4, the initial set of interactive movie entities from step 3 is mapped onto the movie knowledge graph for propagation, and the corresponding attention weights are calculated.
[0108]
[0109] in
[0110] λ r =σ(W2ReLU(W1z0+b1)+b2) (4)
[0111]
[0112]
[0113] Embed vectors for each head entity. Let W and b be the corresponding relation embedding vectors, where W and b are trainable weights and biases; ReLU is the non-linear activation function, and σ is the Sigmoid activation function. The set of triples belonging to the l-th layer for the head entity corresponding to user u in the movie knowledge graph;
[0114] Step 4 uses attention weights to calculate the embedding vector of movie user u at layer l of the movie knowledge graph.
[0115]
[0116] in
[0117]
[0118] Let L be the set of all tail entities in the l-th level movie knowledge graph, and let L be the total number of hops in the movie knowledge graph. t Indicates the tail entity. This is one of the tail entities in the l-th layer of the film knowledge graph. This represents the embedding vector corresponding to entity e; such as Figure 1 As shown, the area within the dashed box represents the initial set of interactive movie entities for user u. This corresponds to level 0. Entities connected to level 0 in the movie knowledge graph are level 1, and so on for other levels.
[0119] In step 4, based on the randomly sampled tail entity set, attention weights are used to calculate the head entity embedding vectors for each layer of the movie knowledge graph.
[0120]
[0121] in It is a set of tail entities that are randomly sampled from all corresponding tail entities in the head entity of the l-th layer; This represents the head entity embedding vector of the l-th layer. This represents the tail entity embedding vector of the l-th layer. This represents the splicing operation, where σ is a non-linear activation function.
[0122] In step 5, the multi-layer embedding vector of the movie knowledge graph is calculated using the head entity embedding vector from step 4.
[0123]
[0124] Attention weight
[0125]
[0126]
[0127] It is the initial embedding vector of movie v.
[0128] In step 6, the embedding vector of user u is calculated by concatenating the interactive embedding vector from step 3, the embedding vectors of each layer from step 4, and the multi-layer embedding vectors from step 5.
[0129]
[0130] Iterate through the user set U, repeating steps 3 to 6, and calculate the embedding vectors for all users.
[0131] In step 7, for any chosen movie v, its initial set of cooperative movie entities is obtained, and the cooperative embedding vector of movie v is calculated based on this set.
[0132]
[0133]
[0134] in
[0135]
[0136] Let 'a' represent movie v and v'. a Common interactive users, v a v represents a collaborative neighbor that shares users with v. a →e is the corresponding movie entity e on the movie knowledge graph found based on the collaborative neighbors of movie v.
[0137] In step 8, the initial collaborative movie entity set from step 7 is mapped onto the movie knowledge graph for propagation, and the corresponding attention weights are calculated.
[0138]
[0139] in
[0140] λ r =σ(W2ReLU(W1z0+b1)+b2) (4)
[0141]
[0142]
[0143] Embed vectors for each head entity. Let W and b be the corresponding relation embedding vectors, where W and b are trainable weights and biases; ReLU is the non-linear activation function, and σ is the Sigmoid activation function. The set of triples belonging to the l-th layer for the head entity corresponding to movie v in the movie knowledge graph;
[0144] Step 8 uses attention weights to calculate the embedding vector of movie v at layer l of the movie knowledge graph.
[0145]
[0146] in
[0147]
[0148] Let L be the total number of hops in the film knowledge graph at level l, and let e be the total number of hops in the film knowledge graph. t Indicates the tail entity. This is one of the tail entities in the l-th layer of the film knowledge graph. This represents the embedding vector corresponding to entity e; such as Figure 1 As shown, the area within the dashed box represents the initial set of cooperative movie entities for movie v. This corresponds to layer 0. Entities connected to layer 0 in the movie knowledge graph are layer 1, and so on for other layers.
[0149] In step 8, based on the randomly sampled tail entity set, attention weights are used to calculate the head entity embedding vectors for each layer of the movie knowledge graph.
[0150]
[0151] in It is a set of tail entities that are randomly sampled from all corresponding tail entities in the head entity of the l-th layer; This represents the head entity embedding vector of the l-th layer. This represents the tail entity embedding vector of the l-th layer. This represents the splicing operation, where σ is a non-linear activation function.
[0152] In step 9, the multi-layer embedding vector of the movie knowledge graph is calculated using the head entity embedding vector from step 8.
[0153]
[0154] Attention weight
[0155]
[0156]
[0157] It is the initial embedding vector of movie v.
[0158] In step 10, the embedding vector of movie v is calculated by concatenating the movie's own embedding vector, the co-embedding vector from step 7, the embedding vectors from each layer in step 8, and the multi-layer embedding vectors from step 9.
[0159]
[0160] Traverse the movie set V, repeating steps 7 to 10, and calculate the embedding vectors for all movies;
[0161] Calculate the loss function in step 11.
[0162]
[0163] in
[0164]
[0165] σ is the Sigmoid activation function; function Υ + and Υ - These represent positive and negative samples, respectively. Represents the cross-entropy loss, parameterized by α. It is an L2-regularization term; such as Figure 1 In the interaction matrix Y, any pair of user u and song v is selected to calculate the result. y uv It represents the actual interaction between user u and movie v.
[0166] As described above, the specific implementation steps of this invention make the invention clearer. Any modifications and alterations made to this invention within the spirit and scope of the claims fall within the protection scope of this invention.
Claims
1. A movie recommendation method based on collaborative reinforcement and graph attention neural networks, comprising the following steps: Step 1: Extract the feature information of each entity and the relationship information between entities from the movie dataset to be processed, and construct a movie knowledge graph with entities as nodes and entity relationships as nodes. The nodes include: Movie title node, actor node, theme node, genre node, and year node; obtain user and movie sets based on the user-movie interaction matrix; Step 2: Use the TransH knowledge graph representation learning algorithm to preprocess the movie knowledge graph data to obtain the initial embedding vectors of movie knowledge graph entities and relations; Step 3: Randomly select one user from the user set, calculate its initial set of interactive movie entities using the interaction information, and calculate the user's interaction embedding vector based on this set; Step 4: Based on the user's initial interaction with the movie entity set, map it onto the movie knowledge graph for propagation, and calculate the... The embedding vector of the layer and the head entity embedding vector after random sampling; Step 5: Calculate the multi-layer embedding vector of the end user on the movie knowledge graph using the head entity embedding vector from Step 4; Step 6: Calculate the user's embedding vector using the interaction embedding vector in Step 3, the embedding vectors of each layer in Step 4, and the multi-layer embedding vectors in Step 5; traverse the user set and repeat Steps 3 to 6 to calculate the embedding vectors of all users. Step 7: Take any movie from the movie set, use the collaborative interaction information to calculate its initial collaborative movie entity set, and calculate the collaborative embedding vector of the movie based on the set; Step 8: Map the collaborative interaction movie entity set to the movie knowledge graph for propagation, and calculate the... The embedding vector of the layer and the head entity embedding vector after random sampling; Step 9: Calculate the final multi-layer embedding vector of the movie on the movie knowledge graph using the head entity embedding vector from Step 8; Step 10: Calculate the embedding vector of a movie using its own embedding vector, the co-embedding vector in step 7, the embedding vectors of each layer in step 8, and the multi-layer embedding vectors in step 9; traverse the movie set and repeat steps 7 to 10 to calculate the embedding vector of all movies. Step 11: Predict the probability of a user watching a movie based on the embedding vectors of the user and the movie, calculate the loss function, and end the calculation when the loss value is less than the set minimum loss value; for a user in the set, rank and recommend the top users based on the predicted ratings from high to low. One movie, among which The set number of recommended movies.
2. The method as described in claim 1, characterized in that, In step 1, in the user-movie interaction matrix middle, Represents a set of users. This represents a collection of movies, where the user has watched the movies. ,otherwise ; In step 1, the movies in the user-movie interaction matrix are aligned with their corresponding entities on the movie knowledge graph to obtain the corresponding neighbor attribute features of the movies on the movie knowledge graph.
3. The method as described in claim 2, characterized in that, In step 2, the TransH knowledge graph representation learning algorithm is used to map entities and relations in the knowledge graph to a low-dimensional vector space to obtain initial embedding vectors. (Movie knowledge graph) Depend on Three pairs composition, , and These are the head entity, relation, and tail entity of the triple, respectively. Represents a collection of movie entities. A set representing the relationships between movie entities; In step 3, for any selected user... Obtain its initial set of interactive movie entities, and calculate the user based on this set. Interactive embedding vectors (1) (2) in It is based on the user Interactive movies find corresponding movie entities on the movie knowledge graph. , It corresponds A movie entity in the set The embedding vector.
4. The method as described in claim 3, characterized in that, In step 4, the initial set of interactive movie entities from step 3 is mapped onto the movie knowledge graph for propagation, and the corresponding attention weights are calculated. (3) in (4) (5) (6) Embed vectors for each head entity. Embed the corresponding relation vector. and Both are trainable weights and biases; It is a non-linear activation function. for Activation function For users The corresponding head entity in the movie knowledge graph belongs to the first... The set of triples in a layer; Step 4 uses attention weights to calculate movie users The first in the film knowledge graph Layer embedding vector (7) in (8) For the first The set of all tail entities in the layered film knowledge graph. This represents the total number of hops in the movie knowledge graph. Indicates the tail entity. For the first One of the tail entity embedding vectors in the layered movie knowledge graph. Representing entities The corresponding embedding vector; and the user The initial interactive movie entity set Corresponding to layer 0, the entities connected to layer 0 in the movie knowledge graph are layer 1, and so on for other layers; In step 4, based on the randomly sampled tail entity set, attention weights are used to calculate the head entity embedding vectors for each layer of the movie knowledge graph. (9) in It is the first The set of tail entities that are randomly sampled from all corresponding tail entities in the head entity; Indicates the first Layer head entity embedding vector, Indicates the first The tail entity embedding vector of the layer, This indicates a splicing operation. It is a non-linear activation function.
5. The method as described in claim 4, characterized in that, In step 5, the multi-layer embedding vector of the movie knowledge graph is calculated using the head entity embedding vector from step 4. (10) Attention weight (11) (12) It's a movie. The initial embedding vector.
6. The method as described in claim 5, characterized in that, In step 6, the user is calculated by concatenating the interaction embedding vector from step 3, the embedding vectors of each layer from step 4, and the multi-layer embedding vector from step 5. Embedded vector (13) Traverse the user set Repeat steps 3 through 6 to calculate the embedding vectors for all users; In step 7, for any chosen movie... Obtain its initial set of collaborative movie entities, and calculate the movie based on this set. Collaborative embedding vectors (14) (15) in (16) use Representative films and Common interactive users, Representative and Collaborative neighbors with shared users It is based on the movie Collaborative neighbors find the corresponding movie entities on the movie knowledge graph. .
7. The method as described in claim 6, characterized in that, In step 8, the initial collaborative movie entity set from step 7 is mapped onto the movie knowledge graph for propagation, and the corresponding attention weights are calculated. (17) in (4) (5) (18) Embed vectors for each head entity. Embed the corresponding relation vector. and Both are trainable weights and biases; It is a non-linear activation function. for Activation function For the movie The corresponding head entity in the movie knowledge graph belongs to the first... The set of triples in a layer; Step 8 uses attention weights to calculate the movie The first in the film knowledge graph Layer embedding vector (19) in (20) For the first The set of all tail entities in the layered film knowledge graph. This represents the total number of hops in the movie knowledge graph. Indicates the tail entity. For the first One of the tail entity embedding vectors in the layered movie knowledge graph. Representing entities Corresponding embedding vector; movie Initial collaborative movie entity set Corresponding to layer 0, the entities connected to layer 0 in the movie knowledge graph are layer 1, and so on for other layers; In step 8, based on the randomly sampled tail entity set, attention weights are used to calculate the head entity embedding vectors for each layer of the movie knowledge graph. (21) in It is the first The set of tail entities that are randomly sampled from all corresponding tail entities in the head entity; Indicates the first Layer head entity embedding vector, Indicates the first The tail entity embedding vector of the layer, This indicates a splicing operation. It is a non-linear activation function.
8. The method as described in claim 7, characterized in that, In step 9, the multi-layer embedding vector of the movie knowledge graph is calculated using the head entity embedding vector from step 8. (22) Attention weight (23) (24) It's a movie. The initial embedding vector.
9. The method as described in claim 8, characterized in that, In step 10, the movie's own embedding vector, the co-embedding vector from step 7, the embedding vectors from each layer in step 8, and the multi-layer embedding vectors from step 9 are concatenated to calculate the movie's embedding vector. Embedded vector (25) Traversing the movie collection Repeat steps 7 through 10 to calculate the embedding vectors for all movies.
10. The method as described in claim 9, characterized in that, Calculate the loss function in step 11. (26) in (27) for Activation function; function and These represent positive and negative samples, respectively. Represents the cross-entropy loss, by under parameterization It is an L2-regularization term; User For the movie The actual interaction situation, It is to predict users Watching movies The probability of.
Citation Information
Patent Citations
Personalized recommendation method based on knowledge graph
CN112214685A
Collaborative filtering recommendation method and device based on knowledge graph and deep learning
CN112800334A