A knowledge base-based personalized movie recommendation method, system and computing device
By aggregating neighborhood information in a movie knowledge base and utilizing hierarchical attention weighting, the probability of user interaction with movie entities is calculated, solving the problem of insufficient recommendation accuracy in existing technologies and improving the accuracy of personalized movie recommendations.
Patent Information
- Application Number
- CN202310587324.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-24
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2043-05-24
AI Technical Summary
Existing knowledge-based movie recommendation technologies ignore the differences in users' attention to different relationships and fail to effectively utilize high-order neighborhood information in movie knowledge bases, resulting in inaccurate recommendations.
By aggregating neighborhood information from a movie knowledge base, using hierarchical attention to weight the neighborhood information of movie entities, calculating the probability of user interaction with movie entities, and recommending movie entities with a probability value greater than or equal to a preset threshold.
Personalized movie recommendations have been achieved, improving the accuracy of recommendations, solving the problem of ignoring high-order neighborhood information in existing technologies, and enhancing the personalization effect of movie recommendations.
Smart Images

Figure CN116662650B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of content recommendation technology, specifically to a personalized movie recommendation method, system, and computing device based on a knowledge base. Background Technology
[0002] In recent years, online movie information has grown exponentially. While users enjoy the convenience and efficiency that the internet brings to watching movies, they also face the problem of information overload, finding it difficult to extract useful information from the massive amount of data. Recommendation systems have addressed this issue to some extent. Their goal is to predict user preferences for movies based on historical behavioral data, such as movie viewing records and ratings, thereby recommending suitable films. However, existing knowledge-based movie recommendation technologies suffer from the following problems: they ignore the differences in user attention to different relationships and they neglect high-order neighborhood information of entities in the movie knowledge base. Summary of the Invention
[0003] To overcome the shortcomings and deficiencies of existing technologies, this invention provides a knowledge-based personalized movie recommendation method. Based on a movie knowledge base, this invention performs feature modeling on movie entities by aggregating neighborhood information within the knowledge base. Layered attention is used to weight the neighborhood information of movie entities to obtain their corresponding neighborhood representations. These neighborhood representations are then aggregated onto the movie entity to obtain its final feature vector. The user feature vector and the fused movie entity feature vector are input into a prediction function to calculate the probability of user interaction with the movie entity. Movie entities with probability values greater than or equal to a preset threshold are recommended to the user, thus achieving personalized movie recommendations for users and ultimately realizing personalized and accurate recommendations in the field of movie viewing.
[0004] The second objective of this invention is to provide a personalized movie recommendation system based on a knowledge base;
[0005] A third objective of this invention is to provide a computing device;
[0006] To achieve the above objectives, the present invention adopts the following technical solution:
[0007] This invention provides a personalized movie recommendation method based on a knowledge base, comprising the following steps:
[0008] Obtain a movie knowledge base, which includes multiple movie entities;
[0009] Calculate the feature information of the first-order neighborhood of the movie entity, calculate the first attention score of the user on the feature information of the first-order neighborhood of the movie entity, normalize the first attention score, calculate the aggregated feature vector of the first-order neighborhood of the movie entity, and fuse the aggregated feature vector of the first-order neighborhood of the movie entity with the initial features of the movie entity to obtain the features of the movie entity after the first aggregation.
[0010] Calculate the feature information of the second-order neighborhood of the movie entity, calculate the second attention score of the user on the feature information of the second-order neighborhood of the movie entity, normalize the second attention score, calculate the aggregated feature vector of the second-order neighborhood of the movie entity, and fuse the aggregated feature vector of the second-order neighborhood of the movie entity with the initial features of the first-order entity of the movie entity to obtain the features of the higher-order neighborhood of the movie entity.
[0011] The first-order neighborhood feature information of the movie entity is aggregated again, the third attention score of the user on the first-order neighborhood feature information of the movie entity is calculated, the third attention score is normalized, the first-order neighborhood aggregated feature vector of the movie entity is calculated, and the features of the higher-order neighborhood of the movie entity are fused with the first-order neighborhood aggregated feature vector of the movie entity to obtain the features of the movie entity after the second aggregation.
[0012] Based on the features of the movie entities after the second aggregation, the preference prediction score of the movie entities is calculated. Movie entities with preference prediction scores greater than or equal to a preset threshold are output as movie recommendation results.
[0013] As a preferred technical solution, each piece of data in the movie knowledge base is stored as a movie entity in the form of a triple, which is formally represented as follows:
[0014]
[0015] Among them, e i ,={1,..,} represents the movie entities in the movie knowledge base, and E represents all entities in the movie knowledge base;
[0016] The embedding technique is used to map movie knowledge base triples and users to a vector space.
[0017] As a preferred technical solution, the feature information of the first-order neighborhood of the movie entity is specifically represented as follows:
[0018]
[0019] in, Indicates relation-based and entity The first-order neighborhood feature vector, They represent the correspondence. and entity The embedding vector, W1 represents the learnable model parameters, and Concat(·) represents the concatenation operation;
[0020] Traversing movie entity e 1 The set of corresponding edges Get the movie entity e 1 The feature vector corresponding to each edge
[0021] The first attention score of the user to the feature information of the first-order neighborhood of the movie entity is calculated, specifically as follows:
[0022]
[0023] Where ⊙ represents the user vector u and the first-order neighborhood feature vector. The inner product operation, where W2 represents the learnable model parameters;
[0024] Attention scoring is normalized using the softmax(·) function. As shown below:
[0025]
[0026] The first-order neighborhood aggregation feature vector of the movie entity is calculated as follows:
[0027]
[0028] Among them, e g This represents the first-order neighborhood aggregation feature vector of the movie entity. This represents the normalized first attention score;
[0029] By fusing the feature vectors of the first-order neighborhood aggregation of movie entities with the initial features of movie entities, the features of movie entities after the first aggregation are obtained, specifically represented as follows:
[0030] e 1* =σ(W3(e) 1 +e g )+b)
[0031] Among them, e 1 Let represent the initial features of the movie entity, b represent the bias, W3 represent the learnable model parameters, σ(·) represent the activation function, and e represent the initial features of the movie entity. 1* This represents the characteristics of the film entities after their first aggregation.
[0032] As a preferred technical solution, k movie entities e are randomly sampled based on triples in the movie knowledge base. 1 Connected edges yield the movie entity e. 1 The first-order neighborhood of the relationship and the binary tuple formed by the tail entity, if the movie entity e1 If the number of connected edges is less than k, then sample all its edges to obtain the movie entity e. 1 The set of corresponding edges Represented as:
[0033]
[0034] Where k1 represents the set The model, This represents the relation within a pair of tuples. This represents the entity within the binary tuple.
[0035] As a preferred technical solution, the feature information of the second-order neighborhood of the movie entity is calculated, specifically represented as follows:
[0036]
[0037] in, Indicates relation-based and entity The neighborhood feature vector, Representing relations Embedded vector, Representing entities The embedding vector, W1 represents the learnable model parameters, and Concat(·) represents the concatenation operation;
[0038] Traversing entities The set of corresponding edges Obtain the entity The feature vector corresponding to each edge
[0039] The second attention score of the user on the feature information of the second-order neighborhood of the movie entity is calculated and expressed as:
[0040]
[0041] Where ⊙ represents the feature information of the user vector u and the second-order neighborhood of the movie entity. The inner product operation, where W2 represents the learnable model parameters;
[0042] Normalize the second attention score using the softmax(·) function As shown below:
[0043]
[0044] The second-order neighborhood aggregation feature vector of the movie entity is calculated as follows:
[0045]
[0046] Among them, eg This represents the second-order neighborhood aggregation feature vector of the movie entity. This represents the second attention score after normalization.
[0047] By fusing the aggregated feature vector of the second-order neighborhood of the movie entity with the initialization features of the first-order entity of the movie entity, the features of the high-order neighborhood of the movie entity are obtained, specifically represented as follows:
[0048]
[0049] in, Representing entities Initialization features, It represents the features after aggregating its first-order neighborhood, b represents the bias, W3 is the learnable model parameter, and σ(·) is the activation function.
[0050] As a preferred technical solution, second-order neighborhood information is obtained based on the set of binary pairs of first-order neighborhoods, and k1 entities are traversed. And randomly sample k connected edges to obtain the entity. The first-order neighborhood relation and the binary tuple formed by the tail entity, if the entity If the number of directly connected edges is less than k, then sample all its edges to obtain the entity. The set of corresponding edges Represented as:
[0051]
[0052] Where k2 represents the set The model, This represents the relation within a pair of tuples. This represents the entity within the tuple, where the subscript i indicates the i-th entity.
[0053] As a preferred technical solution, the first-order neighborhood feature information of the movie entity is aggregated again, specifically represented as follows:
[0054]
[0055] in, It is a relationship Embedded vector, It is a physical entity Feature vectors after aggregating higher-order neighborhoods Indicates relation-based and entity The neighborhood feature vector, W1 represents the learnable model parameters, and concat(·) represents the concatenation operation;
[0056] Traversing movie entity e 1The set of corresponding edges Get the movie entity e 1 The feature vector corresponding to each edge
[0057] The third attention score for the user's attention to the feature information of the first-order neighborhood of the movie entity is calculated, specifically as follows:
[0058]
[0059] Normalize the third attention score using the softmax(·) function As shown below:
[0060]
[0061] The first-order neighborhood aggregation feature vector of the movie entity is calculated as follows:
[0062]
[0063] Among them, e g This represents the first-order neighborhood aggregation feature vector of the movie entity;
[0064] By fusing the features of the higher-order neighborhood of the film entity with the aggregated feature vector of the first-order neighborhood of the film entity, the features of the film entity after the second aggregation are obtained, specifically represented as follows:
[0065] e 1** =σ(W3(e) 1* +e g )+b)
[0066] Among them, e 1* Represents the movie entity e 1 Features after the first aggregation, e 1** Represents the movie entity e 1 The features after the second aggregation, b represents the bias, W3 is the learnable model parameter, and σ(·) is the activation function.
[0067] As a preferred technical solution, a user's preference prediction score for movie entities is calculated, specifically expressed as follows:
[0068]
[0069] Where f(·) denotes the scoring function as the inner product of two vectors. Let N represent the preference prediction score for user u's movie entity, N represent the total number of movie entities, u represent the user vector, and e represent the prediction score for user u's movie entity. i** This represents the characteristics of the film entities after their second aggregation.
[0070] To achieve the third objective mentioned above, the present invention adopts the following technical solution:
[0071] A knowledge base-based personalized movie recommendation system includes: a movie knowledge base acquisition module, a first-order neighborhood feature aggregation module, a higher-order neighborhood feature aggregation module, a second-order neighborhood feature aggregation module, a preference prediction score calculation module, and a movie recommendation output module.
[0072] The movie knowledge base acquisition module is used to acquire a movie knowledge base, which includes multiple movie entities.
[0073] The first aggregation module of the first-order neighborhood feature is used to calculate the feature information of the first-order neighborhood of the movie entity, calculate the first attention score of the user on the feature information of the first-order neighborhood of the movie entity, normalize the first attention score, calculate the aggregated feature vector of the first-order neighborhood of the movie entity, and fuse the aggregated feature vector of the first-order neighborhood of the movie entity with the initial features of the movie entity to obtain the feature of the movie entity after the first aggregation.
[0074] The higher-order neighborhood feature aggregation module is used to calculate the feature information of the second-order neighborhood of the movie entity, calculate the second attention score of the user on the feature information of the second-order neighborhood of the movie entity, normalize the second attention score, calculate the aggregated feature vector of the second-order neighborhood of the movie entity, and fuse the aggregated feature vector of the second-order neighborhood of the movie entity with the initialization features of the first-order entity of the movie entity to obtain the features of the higher-order neighborhood of the movie entity.
[0075] The second aggregation module of the first-order neighborhood features is used to aggregate the first-order neighborhood feature information of the movie entity again, calculate the third attention score of the user on the feature information of the first-order neighborhood of the movie entity, normalize the third attention score, calculate the aggregated feature vector of the first-order neighborhood of the movie entity, and fuse the features of the higher-order neighborhood of the movie entity with the aggregated feature vector of the first-order neighborhood of the movie entity to obtain the features of the movie entity after the second aggregation.
[0076] The preference prediction score calculation module is used to calculate the preference prediction score of the movie entity based on the features after the second aggregation of the movie entity.
[0077] The movie recommendation output module is used to output the movie entities corresponding to preference prediction scores greater than or equal to a preset threshold as movie recommendation results.
[0078] To achieve the third objective mentioned above, the present invention adopts the following technical solution:
[0079] A computing device includes a processor and a memory for storing a processor-executable program, wherein when the processor executes the program stored in the memory, it implements the knowledge-based personalized movie recommendation method described above.
[0080] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0081] (1) This invention utilizes the attention mechanism to integrate the relational semantics of movie entities and high-order neighborhood information. By aggregating the high-order neighborhood features of movie entities multiple times to enhance their feature representation, it calculates the user's preference for movies and realizes personalized and accurate recommendations in the field of movie viewing.
[0082] (2) This invention solves the problem that existing methods do not consider the relational semantics of the movie knowledge base and fail to model high-order semantic information. It aggregates the high-order neighborhood features of movie entities through an attention mechanism to accurately calculate the user's preference for movies. Attached Figure Description
[0083] Figure 1 This is a flowchart illustrating the knowledge base-based personalized movie recommendation method of the present invention.
[0084] Figure 2 This is a schematic diagram illustrating the implementation framework of the knowledge base-based personalized movie recommendation method of the present invention. Detailed Implementation
[0085] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0086] Example 1
[0087] like Figure 1 , Figure 2 As shown, this embodiment provides a knowledge base-based personalized movie recommendation method. This embodiment utilizes a movie knowledge base to perform feature modeling on movie entities by aggregating neighborhood information. It uses hierarchical attention to weight the neighborhood information of movie entities to obtain their neighborhood representation. The neighborhood features are aggregated into the movie entities to obtain their final feature representation. The user feature vector and the fused movie entity feature vector are input into a prediction function to calculate the probability of user interaction with movie entities. Movie entities with probability values greater than or equal to a preset threshold are recommended to users to achieve user-oriented personalized movie recommendations.
[0088] Specifically, the following steps are included:
[0089] S1: Obtain knowledge description; Obtain a movie knowledge base where each piece of data stores movie information in the form of a triple (head entity, relation, tail entity), such as ("Movie Name", "Director", "Zhang San") or ("Zhang San", "is", "Male Actor"), where "Movie Name" is the head entity, "Director" is the relation, and "Zhang San" is the tail entity. Each triple can be formally represented as (e h ,r q ,e t ), and e h ∈E, e t ∈E, where E represents all entities in the movie knowledge base. Given a movie knowledge base triple storing N movies, formally represented as... Where e i Let i = {1, ..., N} be entities in the movie knowledge base. Let u be a user who recommends watching movies. Finally, using embedding techniques, the movie knowledge base triples and the users are mapped to a vector space. For clarity, they are represented in bold and denoted as (e...). h ,r q ,e t ) and u, where h, q, t are subscripts used to distinguish those that have no practical meaning; meanwhile, the Embedding technique is explained as follows: it is essentially a mapping from semantic space to vector space, which tries to maintain the relationship between the original samples in semantic space as much as possible in vector space. For example, two words with similar semantics are also relatively close in position in vector space.
[0090] S2: Obtain the connection edges of movie entities; randomly sample k movie entities e based on the movie knowledge base triples. 1 Directly connected edges, i.e., movie entity e 1 The first-order neighborhood of the object is a binary tuple composed of the relationship between the object and the tail entity. If the movie entity e... 1 If the number of directly connected edges is less than k, then all of its edges are sampled. The final set of sampled edges is defined as follows: k1 represents the set of binary pairs. The superscript 1 is used for the movie entity e. 1 The first-order neighborhood is determined. Second-order neighborhood information is obtained from the set of binary pairs of the first-order neighborhood, and k1 entities are traversed. And randomly sample its k directly connected edges, i.e., entities The first-order neighborhood relation and the tail entity form a binary tuple. If the entity If the number of directly connected edges is less than k, then all its edges are sampled. Finally, the entity... The set of sampled edges is defined as k2 represents the set of binary pairs. The superscript 2 is used to identify the movie entity e. 1The second-order neighborhood.
[0091] S3: First aggregation of first-order neighborhood features; mainly includes the following steps:
[0092] 1) Calculate the movie entity e 1 The feature information of the first-order neighborhood is shown below:
[0093]
[0094] Indicates relation-based and entity The first-order neighborhood feature vector, It is a relationship Embedded vector, It is a physical entity The embedding vector, W1 represents the learnable model parameters, and Concat(*) represents the concatenation operation. Looping movie entity e 1 The set of corresponding edges The above operations yield entity e. 1 The feature vector corresponding to each edge
[0095] 2) Calculate user u's relationship to movie entity e 1 The attention scores for the feature information of the first-order neighborhood are shown below:
[0096]
[0097] Here, "⊙" represents the inner product operation of two vectors, and W2 represents the learnable model parameters.
[0098] 3) Normalize the attention score using the softmax(·) function. As shown below:
[0099]
[0100] 4) Calculate the movie entity e 1 The feature vector of the first-order neighborhood aggregation is denoted as e. g As shown below:
[0101]
[0102] 5) Integrate the aggregated features of the first-order neighborhood into the initialization features of the movie entity, as shown below:
[0103] e 1* =σ(W3(e) 1 +e g )+b)
[0104] Among them, e1 Represents the movie entity e 1 The initialization features are: b represents the bias, W3 represents the learnable model parameters, σ(·) is the activation function, and e 1* Represents the movie entity e 1 Features after the first aggregation.
[0105] S4: Aggregate high-order neighborhood features, including the following steps:
[0106] 1) Computational Entity The feature information of the first-order neighborhood is shown below:
[0107]
[0108] Indicates relation-based and entity The neighborhood feature vector, It is a relationship Embedded vector, It is a physical entity Embedded vector. Circular entity. The set of corresponding edges The above operations yield the entity. The feature vector corresponding to each edge
[0109] 2) Calculate user u's relationship with entity First-order neighborhood (movie entity e) 1 The attention scores for the feature information of the second-order neighborhood are shown below:
[0110]
[0111] Here, "⊙" represents the inner product operation of two vectors, and W2 represents the learnable model parameters.
[0112] 3) Normalize the attention score using the softmax(·) function. As shown below:
[0113]
[0114] 4) Computational Entity First-order neighborhood (movie entity e) 1 The second-order neighborhood aggregates the feature vectors as follows:
[0115]
[0116] 5) Integrate the features of the second-order neighborhood into the movie entity e 1 First-order entity The initialization features are as follows:
[0117]
[0118] in Representing entities Initialization features, It represents the features after aggregating its first-order neighborhood, b represents the bias, W3 is the learnable model parameter, and σ(·) is the activation function.
[0119] 6) Circular Sets Execute steps 1)-5) sequentially to obtain the entity. Feature representation after aggregating its first-order neighborhood
[0120] S5: The second aggregation of first-order neighborhood features includes the following steps:
[0121] 1) Reassemble the movie entity e 1 The first-order neighborhood feature information is shown below:
[0122]
[0123] It is a relationship Embedded vector, It is a physical entity Feature vectors after aggregating higher-order neighborhoods Indicates relation-based and entity The neighborhood feature vectors are different from the entities. The feature vector has been updated in step S4. Looping movie entity e 1 The set of corresponding edges Performing the above operations yields the movie entity e. 1 The feature vector corresponding to each edge
[0124] 2) The attention score of user u to the feature information of the first-order neighborhood of movie entity e1 is calculated as follows:
[0125]
[0126] 3) Normalize the attention score using the softmax(·) function. As shown below:
[0127]
[0128] 4) Calculate the movie entity e 1 The feature vector of the first-order neighborhood aggregation is denoted as e. g As shown below:
[0129]
[0130] 5) The features of the higher-order neighborhood are integrated into the feature representation of the first-order neighborhood of the movie entity aggregation, as shown below:
[0131] e 1** =σ(W3(e) 1* +e g )+b)
[0132] Where e 1* Represents the shadow entity e 1 Features after the first aggregation, e 1** Represents the movie entity e 1 The features after the second aggregation, b represents the bias, W3 is the learnable model parameter, and σ(·) is the activation function.
[0133] S6: Calculate user ratings for movies; for N movies {e 1 ,e 2 ,…,e N}, by sequentially executing steps S2-S5, a movie feature vector e that is user-oriented u and integrates high-order neighborhood features is obtained. i** ,i={1,…,N}. The final predicted user u's preference rating for N movie entities is as follows:
[0134]
[0135] Where f(·) denotes the scoring function as the inner product of two vectors. If If the value is greater than or equal to the preset threshold of 0.5, then the movie entity e will be... i Recommend it to user u, otherwise do not recommend it.
[0136] This invention utilizes an attention mechanism to learn user preferences for different (relationship, tail entity) binary pairs, thereby weighting the neighborhood of movie entities to form their neighborhood feature representation. It further enhances the feature representation by aggregating high-order neighborhood features of the target movie entity multiple times, and then calculates the user's preference score for the movie to achieve accurate personalized recommendations for users.
[0137] Example 2
[0138] Except for the following technical contents, the technical contents of this embodiment are the same as those of Embodiment 1;
[0139] This embodiment provides a knowledge base-based personalized movie recommendation system, including: a movie knowledge base acquisition module, a first-order neighborhood feature aggregation module, a higher-order neighborhood feature aggregation module, a second-order neighborhood feature aggregation module, a preference prediction score calculation module, and a movie recommendation output module;
[0140] In this embodiment, the movie knowledge base acquisition module is used to acquire a movie knowledge base, which includes multiple movie entities;
[0141] In this embodiment, the first aggregation module of first-order neighborhood features is used to calculate the feature information of the first-order neighborhood of the movie entity, calculate the first attention score of the user on the feature information of the first-order neighborhood of the movie entity, normalize the first attention score, calculate the aggregated feature vector of the first-order neighborhood of the movie entity, and fuse the aggregated feature vector of the first-order neighborhood of the movie entity with the initial features of the movie entity to obtain the features of the movie entity after the first aggregation.
[0142] In this embodiment, the high-order neighborhood feature aggregation module is used to calculate the feature information of the second-order neighborhood of the movie entity, calculate the second attention score of the user on the feature information of the second-order neighborhood of the movie entity, normalize the second attention score, calculate the aggregated feature vector of the second-order neighborhood of the movie entity, and fuse the aggregated feature vector of the second-order neighborhood of the movie entity with the initialization features of the first-order entity of the movie entity to obtain the features of the high-order neighborhood of the movie entity.
[0143] In this embodiment, the first-order neighborhood feature second aggregation module is used to aggregate the first-order neighborhood feature information of the movie entity again, calculate the third attention score of the user on the feature information of the first-order neighborhood of the movie entity, normalize the third attention score, calculate the first-order neighborhood aggregated feature vector of the movie entity, and fuse the features of the higher-order neighborhood of the movie entity with the first-order neighborhood aggregated feature vector of the movie entity to obtain the features of the movie entity after the second aggregation.
[0144] In this embodiment, the preference prediction score calculation module is used to calculate the preference prediction score of the movie entity based on the features after the second aggregation of the movie entity.
[0145] In this embodiment, the movie recommendation output module is used to output the movie entities corresponding to preference prediction scores greater than or equal to a preset threshold as movie recommendation results.
[0146] Example 3
[0147] This embodiment provides a computing device, which may be a desktop computer, laptop computer, smartphone, PDA handheld terminal, tablet computer or other terminal device with display function. The computing device includes a processor and a memory. The memory stores one or more programs. When the processor executes the program stored in the memory, it implements the knowledge base-based personalized movie recommendation method of Embodiment 1.
[0148] 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 changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.
Claims
1. A personalized movie recommendation method based on a knowledge base, characterized in that, Includes the following steps: Obtain a movie knowledge base, which includes multiple movie entities; Calculate the feature information of the first-order neighborhood of the movie entity, calculate the first attention score of the user on the feature information of the first-order neighborhood of the movie entity, normalize the first attention score, calculate the aggregated feature vector of the first-order neighborhood of the movie entity, and fuse the aggregated feature vector of the first-order neighborhood of the movie entity with the initial features of the movie entity to obtain the features of the movie entity after the first aggregation. The feature information of the first-order neighborhood of the movie entity is specifically represented as follows: ; in, Indicates relation-based and entity The first-order neighborhood feature vector, , They represent the correspondence. and entity Embedded vector, Represents the learnable model parameters. Indicates a splicing operation; Traversing movie entities The set of corresponding edges To obtain the physical film The feature vector corresponding to each edge ; The first attention score of the user to the feature information of the first-order neighborhood of the movie entity is calculated, specifically as follows: ; in, User vector and first-order neighborhood feature vector inner product operation, Represents the learnable model parameters; use Function normalization attention scoring As shown below: ; The first-order neighborhood aggregation feature vector of the movie entity is calculated as follows: ; in, This represents the first-order neighborhood aggregation feature vector of the movie entity. This represents the normalized first attention score; By fusing the feature vectors of the first-order neighborhood aggregation of movie entities with the initial features of movie entities, the features of movie entities after the first aggregation are obtained, specifically represented as follows: ; in, This represents the initialization characteristics of the movie entity. Indicates deviation, For learnable model parameters, For activation function, This represents the characteristics of the film entities after their first aggregation; Calculate the feature information of the second-order neighborhood of the movie entity, calculate the second attention score of the user on the feature information of the second-order neighborhood of the movie entity, normalize the second attention score, calculate the aggregated feature vector of the second-order neighborhood of the movie entity, and fuse the aggregated feature vector of the second-order neighborhood of the movie entity with the initial features of the first-order entity of the movie entity to obtain the features of the higher-order neighborhood of the movie entity. The first-order neighborhood feature information of the movie entity is aggregated again, the third attention score of the user on the first-order neighborhood feature information of the movie entity is calculated, the third attention score is normalized, the first-order neighborhood aggregated feature vector of the movie entity is calculated, and the features of the higher-order neighborhood of the movie entity are fused with the first-order neighborhood aggregated feature vector of the movie entity to obtain the features of the movie entity after the second aggregation. Based on the features of the movie entities after the second aggregation, the preference prediction score of the movie entities is calculated. Movie entities with preference prediction scores greater than or equal to a preset threshold are output as movie recommendation results.
2. The personalized movie recommendation method based on a knowledge base according to claim 1, characterized in that, Each piece of data in the movie knowledge base is stored as a movie entity in the form of a triple, which is formally represented as: ; in, For film entities in the film knowledge base, Represents all entities in the movie knowledge base; The embedding technique is used to map movie knowledge base triples and users to a vector space.
3. The personalized movie recommendation method based on a knowledge base according to claim 1, characterized in that, Random sampling based on movie knowledge base triples A film entity Connected edges form the movie entity. The first-order neighborhood of the relationship and the binary tuple formed by the tail entity, if the movie entity The number of connected edges is less than Then sample all its edges to obtain the movie entity. The set of corresponding edges , represented as: ; in, Represents a set The model, This represents the relation within a pair of tuples. This represents the entity within the binary tuple.
4. The personalized movie recommendation method based on a knowledge base according to claim 1, characterized in that, The feature information of the second-order neighborhood of the movie entity is calculated as follows: ; in, Indicates relation-based and entity The neighborhood feature vector, Representing relations Embedded vector, Representing entities Embedded vector, Represents the learnable model parameters. Indicates a splicing operation; Traversing entities The set of corresponding edges , obtain entity The feature vector corresponding to each edge ; The second attention score of the user on the feature information of the second-order neighborhood of the movie entity is calculated and expressed as: ; in, User vector Feature information of the second-order neighborhood of the movie entity inner product operation, Represents the learnable model parameters; use Functional normalization of second attention score As shown below: ; The second-order neighborhood aggregation feature vector of the movie entity is calculated as follows: ; in, This represents the second-order neighborhood aggregation feature vector of the movie entity. This represents the second attention score after normalization. By fusing the aggregated feature vector of the second-order neighborhood of the movie entity with the initialization features of the first-order entity of the movie entity, the features of the high-order neighborhood of the movie entity are obtained, specifically represented as follows: ; in, Representing entities Initialization features, It is the feature after aggregating its first-order neighborhood. Indicates deviation, For learnable model parameters, This is the activation function.
5. The personalized movie recommendation method based on a knowledge base according to claim 1, characterized in that, Obtain second-order neighborhood information from the set of first-order neighborhood pairs, and traverse... individual entities And randomly sample its Connected edges yield the entity. The first-order neighborhood relation and the binary tuple formed by the tail entity, if the entity The number of directly connected edges is less than Then sample all its edges to obtain the entity. The set of corresponding edges , represented as: ; in, Represents a set The model, This represents the relation within a pair of tuples. Represents the entity within a binary tuple, subscript Indicates the first individual entities .
6. The personalized movie recommendation method based on a knowledge base according to claim 1, characterized in that, The first-order neighborhood feature information of the movie entity is aggregated again, specifically represented as follows: ; in, It is a relationship Embedded vector, It is a physical entity Feature vectors after aggregating higher-order neighborhoods Indicates relation-based and entity The neighborhood feature vector, Represents the learnable model parameters. Indicates a splicing operation; Traversing movie entities The set of corresponding edges To obtain the physical film The feature vector corresponding to each edge ; The third attention score for the user's attention to the feature information of the first-order neighborhood of the movie entity is calculated, specifically as follows: ; use Functional normalization third attention score As shown below: ; The first-order neighborhood aggregation feature vector of the movie entity is calculated as follows: ; in, This represents the first-order neighborhood aggregation feature vector of the movie entity; By fusing the features of the higher-order neighborhood of the film entity with the aggregated feature vector of the first-order neighborhood of the film entity, the features of the film entity after the second aggregation are obtained, specifically represented as follows: ; in, Represents the physical entity of a film Features after the first aggregation Represents the physical entity of a film Features after the second aggregation Indicates deviation, For learnable model parameters, This is the activation function.
7. The personalized movie recommendation method based on a knowledge base according to claim 1, characterized in that, Calculate the user's preference prediction score for movie entities, specifically expressed as: ; in, This indicates that the scoring function is the inner product of two vectors. Indicates user Predicted score of preference for film entities This represents the total number of movie entities. Represents the user vector. This represents the characteristics of the film entities after their second aggregation.
8. A personalized movie recommendation system based on a knowledge base, characterized in that, include: The module includes a movie knowledge base acquisition module, a first-order neighborhood feature aggregation module, a higher-order neighborhood feature aggregation module, a second-order neighborhood feature aggregation module, a preference prediction score calculation module, and a movie recommendation output module. The movie knowledge base acquisition module is used to acquire a movie knowledge base, which includes multiple movie entities. The first aggregation module of the first-order neighborhood feature is used to calculate the feature information of the first-order neighborhood of the movie entity, calculate the first attention score of the user on the feature information of the first-order neighborhood of the movie entity, normalize the first attention score, calculate the aggregated feature vector of the first-order neighborhood of the movie entity, and fuse the aggregated feature vector of the first-order neighborhood of the movie entity with the initial features of the movie entity to obtain the feature of the movie entity after the first aggregation. The first aggregation module for the first-order neighborhood features is used to calculate the feature information of the first-order neighborhood of the movie entity, specifically as follows: ; in, Indicates relation-based and entity The first-order neighborhood feature vector, , They represent the correspondence. and entity Embedded vector, Represents the learnable model parameters. Indicates a splicing operation; Traversing movie entities The set of corresponding edges To obtain the physical film The feature vector corresponding to each edge ; The first attention score of the user to the feature information of the first-order neighborhood of the movie entity is calculated, specifically as follows: ; in, User vector and first-order neighborhood feature vector inner product operation, Represents the learnable model parameters; use Function normalization attention scoring As shown below: ; The first-order neighborhood aggregation feature vector of the movie entity is calculated as follows: ; in, This represents the first-order neighborhood aggregation feature vector of the movie entity. This represents the normalized first attention score; By fusing the feature vectors of the first-order neighborhood aggregation of movie entities with the initial features of movie entities, the features of movie entities after the first aggregation are obtained, specifically represented as follows: ; in, This represents the initialization characteristics of the movie entity. Indicates deviation, For learnable model parameters, For activation function, This represents the characteristics of the film entities after their first aggregation; The higher-order neighborhood feature aggregation module is used to calculate the feature information of the second-order neighborhood of the movie entity, calculate the second attention score of the user on the feature information of the second-order neighborhood of the movie entity, normalize the second attention score, calculate the aggregated feature vector of the second-order neighborhood of the movie entity, and fuse the aggregated feature vector of the second-order neighborhood of the movie entity with the initialization features of the first-order entity of the movie entity to obtain the features of the higher-order neighborhood of the movie entity. The second aggregation module of the first-order neighborhood features is used to aggregate the first-order neighborhood feature information of the movie entity again, calculate the third attention score of the user on the feature information of the first-order neighborhood of the movie entity, normalize the third attention score, calculate the aggregated feature vector of the first-order neighborhood of the movie entity, and fuse the features of the higher-order neighborhood of the movie entity with the aggregated feature vector of the first-order neighborhood of the movie entity to obtain the features of the movie entity after the second aggregation. The preference prediction score calculation module is used to calculate the preference prediction score of the movie entity based on the features after the second aggregation of the movie entity. The movie recommendation output module is used to output the movie entities corresponding to preference prediction scores greater than or equal to a preset threshold as movie recommendation results.
9. A computing device, comprising a processor and a memory for storing a processor-executable program, characterized in that, When the processor executes the program stored in the memory, it implements the knowledge base-based personalized movie recommendation method as described in any one of claims 1-7.
Citation Information
Patent Citations
Method for carrying out personalized recommendation on commodities by fusing knowledge graph
CN112232925A
Movie recommendation method fusing attention mechanism and double-end knowledge graph
CN114329222A