Movie recommendation method and device based on multi-attribute and knowledge attention fusion

CN116383509BActive Publication Date: 2026-10-27HUBEI UNIV OF TECH
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310389085.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-12
Publication Date
2026-10-27
Estimated Expiration
2043-04-12

AI Technical Summary

Technical Problem

[0004]本发明的目的在于提供一种基于多属性和知识注意力融合的电影推荐方法及装置,用于解决现有技术中存在的推荐效果不佳的技术问题

Benefits of technology

[0038]本发明提出了基于多属性和知识注意力融合的电影推荐方法,构建了基于多属性和知识注意力融合的电影推荐模型,其为RippleNet的基础模型,通过每次波纹传递到下一层hop的时候,基于知识感知attention(注意力)判断相关性概率更高的尾实体以及“用户抽象”对每层hop实体间关系优先选择偏好度更高的实体关系,形成了最终的多属性和注意力MultAtt-RippleNet模型。本发明提出的方法提出了“用户抽象”概念,形象地刻画出了用户初始向量表示,用以增添考量“用户抽象”对不同关系的偏好权重,提高最终用户嵌入表达与待预测物品交互;并且采用了一种新的知识感知注意力,根据特定关系下,不同头实体节点对于尾实体节点知识感知相似的权重,更加精准化的提高了每层hop偏好传播的最终用户向量表示。因此能够明显提高模型的性能和推荐的准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116383509B_ABST
    Figure CN116383509B_ABST
Patent Text Reader

Abstract

The application discloses a movie recommendation method and device based on multi-attribute and knowledge attention fusion, first indexes and labels a movie data set, and divides the movie data set into training, verification and test sets; and puts the preprocessed data into a data loader; then inputs user historical click and to-be-predicted item vectors; through regarding the user historical click item as "user abstraction", the degree of preference of a user to a potential entity relationship in a knowledge graph is sought. Meanwhile, the weight of a head entity and a relationship on a tail entity in the knowledge graph is captured by knowledge perception, and the two weights are fused; through embedding the fused weight into "ripple" propagation of the user historical click entity, a user representation of each layer vector is obtained, and a final "real user" representation is obtained by adding the user representations; and through training, the embedding vectors of the knowledge graph entity and the user entity are iteratively updated. The application can fully mine the information propagation amount between potential entities in the knowledge graph, and consider different information of different user preferences for relationships.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of recommendation system technology, and in particular to a movie recommendation method and apparatus based on multi-attribute and knowledge attention fusion. Background Technology

[0002] With the development of information technology, the application areas of recommendation systems based on data analysis are constantly expanding, such as shopping recommendations based on user information and music and movie recommendations based on interaction history data. The most troublesome issues with traditional recommendation models are often the significant cold start problem and the large amount of data sparsity, resulting in poor overall recommendation performance. Therefore, we have gradually shifted our research focus to knowledge graphs, using them as auxiliary knowledge to help make recommendations more comprehensive and accurate. Personalized recommendations based on knowledge graphs have been applied in scenarios such as movies, music, and news. Currently, knowledge graph-based recommendation methods mainly include embedding methods based on representation learning and methods based on meta-paths. Embedding methods based on representation learning mainly perform low-dimensional vectorization of entities and relationships in the knowledge graph to obtain vector representations, then use these vectors to fuse and calculate with traditional collaborative filtering to finally obtain the recommendation list.

[0003] Personalized recommendation technology primarily addresses the problem of information overload. Finding desired information from massive amounts of data is time-consuming, so personalized recommendation technology tailors recommendations to different user preferences, enabling users to efficiently collect relevant and useful information. Collaborative filtering typically involves three steps: 1. Collecting user preferences; 2. Finding similar users or items; 3. Calculating recommendations. However, in practical applications, such as movie, music, and course recommendations, the lack of user ratings or item reviews can severely impact the cold start problem, significantly affecting recommendation accuracy. Summary of the Invention

[0004] The purpose of this invention is to provide a movie recommendation method and apparatus based on multi-attribute and knowledge attention fusion, in order to solve the technical problem of poor recommendation effect in the prior art.

[0005] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows:

[0006] The first aspect provides a movie recommendation method based on the fusion of multiple attributes and knowledge attention, including:

[0007] S1: Label the preset movie dataset and construct a knowledge graph based on the labeled movie dataset. In the knowledge graph, different movies are composed of head entity, relation, and tail entity triples, and users and entities are identified by index IDs.

[0008] S2: Load the labeled movie dataset into the data loader, store the triples in the knowledge graph according to the triple entities of the user and each hop, and then divide the movie dataset into training set, validation set and test set.

[0009] S3: Construct a movie recommendation model based on multi-attribute and knowledge attention fusion. The model includes a multi-attribute module, a multi-attention module, a fusion module, and a prediction module. The multi-attribute module is used to obtain knowledge perception weights, the multi-attention module is used to obtain user-relationship preference weights, the fusion module is used to fuse the obtained knowledge perception weights and user-relationship preference weights to obtain the final user vector representation, and the prediction module is used to obtain the predicted click probability of the user for the predicted item based on the final user vector representation.

[0010] S4: The movie recommendation model based on multi-attribute and knowledge attention fusion is trained using the training set obtained from the partitioning to obtain the trained movie recommendation model;

[0011] S5: Use the trained movie recommendation model to recommend movies in the test set.

[0012] In one implementation, step S1 of annotating the preset movie dataset includes:

[0013] The movie dataset is divided into positive and negative samples based on the ratings in the pre-defined movie dataset. Positive samples represent items that users are interested in, while negative samples represent items that users are not interested in or have not interacted with.

[0014] In one implementation, the multi-attribute module obtains the knowledge perception weights as follows:

[0015] Obtain the probability of entities connecting to their surrounding neighbors in each hop of each user's historical click matrix, and use this probability as the knowledge-aware weight:

[0016]

[0017] in, The embedding representation of each hop head entity of entity i, r i hop The embedded representation of each level of relational entities of entity i. Let (h,r,t) represent the set of all triple entities that have been interacted with by each user u in the history of the knowledge graph through iterative propagation at each layer hop. Let (h,r,t) represent the triple consisting of the head entity, relation, and tail entity in the knowledge graph. Let π(·) be the neural network function of the multi-attribute module.

[0018] In one implementation, the multi-attention module obtains user-relationship preference weights as follows:

[0019] Obtain the degree of preference of entity j for different relationships of entity pairs at the hop level, and use it as the user-relationship preference weight:

[0020]

[0021]

[0022] Where π′ represents the neural network function of the multi-attention module, u abstract Represents the user's initial embedding encoding vector. This represents the relation vector at the hop level. It represents the set of all the items that the user has clicked in the past.

[0023] In one implementation, the final user vector representation is calculated as follows:

[0024]

[0025] in, This represents the feature fusion probability of a user's knowledge perception and relational preference at each hop, where k represents the entity. This represents the attention weight after incorporating knowledge-awareness weights and user-relationship preference weights. Represents all tail entities of each hop. It represents the set of all triple entities that have been interacted with by each user u in the history of the knowledge graph through iterative propagation at each level of hop.

[0026] In one implementation, the prediction module obtains the predicted click probability of a user for the predicted item based on the final user vector representation as follows:

[0027]

[0028] in, Let v denote the transpose of the final user vector representation, and v denote the embedding vector of the predicted item. This indicates the predicted click probability of the user for the predicted item.

[0029] Based on the same inventive concept, a second aspect of the present invention provides a movie recommendation device based on multi-attribute and knowledge attention fusion, comprising:

[0030] The dataset annotation module is used to annotate the preset movie dataset and construct a knowledge graph based on the annotated movie dataset. In the knowledge graph, different movies are composed of head entity, relation, and tail entity triples, and users and entities are identified by index IDs.

[0031] The dataset partitioning module is used to load the labeled movie dataset into the data loader, store the triples in the knowledge graph according to the triple entities of the user and each hop, and then partition the movie dataset into training set, validation set and test set.

[0032] The model building module is used to build a movie recommendation model based on multi-attribute and knowledge attention fusion. The model includes a multi-attribute module, a multi-attention module, a fusion module, and a prediction module. The multi-attribute module is used to obtain knowledge perception weights, the multi-attention module is used to obtain user-relationship preference weights, the fusion module is used to fuse the obtained knowledge perception weights and user-relationship preference weights to obtain the final user vector representation, and the prediction module is used to obtain the predicted click probability of the user for the predicted item based on the final user vector representation.

[0033] The model training module is used to train the constructed movie recommendation model based on multi-attribute and knowledge attention fusion using the partitioned training set, so as to obtain the trained movie recommendation model.

[0034] The recommendation module is used to recommend movies from the test set using a pre-trained movie recommendation model.

[0035] Based on the same inventive concept, a third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed, implements the method described in the first aspect.

[0036] Based on the same inventive concept, a fourth aspect of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in the first aspect.

[0037] Compared with the prior art, the advantages and beneficial technical effects of the present invention are as follows:

[0038] This invention proposes a movie recommendation method based on multi-attribute and knowledge attention fusion, constructing a movie recommendation model based on multi-attribute and knowledge attention fusion, which serves as the foundation model for RippleNet. By using knowledge-aware attention to determine the tail entities with higher relevance probabilities and prioritizing entity relationships with higher preference in each hop based on "user abstraction," the final multi-attribute and attention-based MultAtt-RippleNet model is formed. The proposed method introduces the concept of "user abstraction," vividly depicting the user's initial vector representation, to add consideration of the "user abstraction's" preference weights for different relationships, improving the interaction between the final user embedding and the predicted item. Furthermore, it employs a novel knowledge-aware attention method, based on the similarity of knowledge perception weights between different head entity nodes and tail entity nodes under specific relationships, more accurately improving the final user vector representation of preference propagation in each hop. Therefore, it can significantly improve the model's performance and recommendation accuracy. Attached Figure Description

[0039] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0040] Figure 1 This is a flowchart of a movie recommendation method based on multi-attribute and knowledge attention fusion in an embodiment of the present invention;

[0041] Figure 2 This is a general framework diagram of the MultAtt-RippleNet model in an embodiment of the present invention. Detailed Implementation

[0042] The purpose of this invention is to provide a movie recommendation method based on a multi-attribute and knowledge attention fusion network, which mines the latent semantic information in the hidden layer of the user-item interaction propagation domain, thereby improving the effectiveness and efficiency of movie recommendation.

[0043] To achieve the above objectives, the main concept of this invention is as follows:

[0044] The MultAtt-RippleNet model is constructed by first indexing and labeling the movie dataset and dividing it into training, validation, and test sets. Preprocessed data is then fed into a data loader. Next, user history clicks and the vector of the item to be predicted are input. User history clicks are considered as "user abstractions" to seek the degree of user preference for potential entity relationships in the knowledge graph. Simultaneously, knowledge awareness is used to capture the weights of head entities and relationships to tail entities in the knowledge graph, and these two weights are then fused. The fused weights are embedded into the "ripple" propagation of user history click entities, and the user representations of each layer are summed to obtain the final "real user" representation. Finally, through training, the embedding vectors of knowledge graph entities and user entities are iteratively updated. This method can fully explore the information propagation between potential entities in the knowledge graph and takes into account the different personal preferences of different users for relationships.

[0045] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0046] Example 1

[0047] This invention provides a movie recommendation method based on multi-attribute and knowledge attention fusion, including:

[0048] S1: Label the preset movie dataset and construct a knowledge graph based on the labeled movie dataset. In the knowledge graph, different movies are composed of head entity, relation, and tail entity triples, and users and entities are identified by index IDs.

[0049] S2: Load the labeled movie dataset into the data loader, store the triples in the knowledge graph according to the triple entities of the user and each hop, and then divide the movie dataset into training set, validation set and test set.

[0050] S3: Construct a movie recommendation model based on multi-attribute and knowledge attention fusion. The model includes a multi-attribute module, a multi-attention module, a fusion module, and a prediction module. The multi-attribute module is used to obtain knowledge perception weights, the multi-attention module is used to obtain user-relationship preference weights, the fusion module is used to fuse the obtained knowledge perception weights and user-relationship preference weights to obtain the final user vector representation, and the prediction module is used to obtain the predicted click probability of the user for the predicted item based on the final user vector representation.

[0051] S4: The movie recommendation model based on multi-attribute and knowledge attention fusion is trained using the training set obtained from the partitioning to obtain the trained movie recommendation model;

[0052] S5: Use the trained movie recommendation model to recommend movies in the test set.

[0053] Specifically, the knowledge graph is the search engine functionality that Google essentially completed in 2012. It includes a logical structure, which can be divided into two layers: the schema layer and the data layer. The data layer mainly consists of a series of facts, such as (entity 1, relation, entity 2). The schema layer is built on top of the data layer and primarily uses an ontology library to standardize the representation of these facts.

[0054] The default movie dataset in S1 is the MovieLens-1M dataset, which contains 1 million ratings from 6,000 users for 4,000 movies, ranging from 1 to 5 stars. These are all display feedback.

[0055] The division ratio in S2 can be set according to the actual situation.

[0056] Please see Figure 1 This is a flowchart of a movie recommendation method based on multi-attribute and knowledge attention fusion in an embodiment of the present invention.

[0057] The MultAtt-RippleNet model (a movie recommendation model based on the fusion of multi-attribute and knowledge attention) uses a multi-attribute module to increase the weight of user preferences for different relationships, and a multi-attention module to increase the attention weight of different head entities attached to different relationships.

[0058] In the specific implementation, the hyperparameters of the MultAtt-RippleNet model were set to d=16, H=2, λ1=10⁻⁷, λ2=0.01, and η=0.01, ready for training. The multi-attribute module embedded the user's historically interacted items and currently interacted items in the knowledge graph, searching for potential preference movies for each Hop level. The encodings of different users' historical items were summed to obtain an abstract user representation, seeking the weight pj for the abstract user's preference for each Hop entity relationship. Simultaneously, the movie head entity and relationship embedding vectors were processed through a knowledge-aware attention module (multi-attention module) to capture and assign weight pi to each neighboring entity. Then, the fusion module fused and concatenated the two weights pi and pj, and normalized them to obtain the final weight, used for ripple propagation from the head entity to the tail entity in each layer of the knowledge graph. Finally, the prediction module summed the user representations of each Hop level to obtain the final user representation predicting the click probability of the predicted item. The user and item embeddings are continuously updated using the difference between the predicted tail entity and the true tail entity vector, along with regularization parameters, as the loss function, and training continues indefinitely. The final result is the user's predicted item click probability. The model's performance is evaluated based on the AUC and ACC values.

[0059] In one implementation, step S1 of annotating the preset movie dataset includes:

[0060] The movie dataset is divided into positive and negative samples based on the ratings of the rating data contained in the preset movie dataset. Positive samples represent items that users are interested in, while negative samples represent items that users are not interested in or have not interacted with.

[0061] In the specific implementation process, a score of 4 or higher can be classified as a positive sample, and otherwise as a negative sample; positive samples are labeled as 1, and negative samples as 0; the correlations between movie entities, movie relationships, and movie entity triples in the knowledge graph are statistically analyzed, and then labeled with entity and relationship indexes respectively. The index IDs are sorted from smallest to largest to obtain positive and negative samples from different users.

[0062] In one implementation, the multi-attribute module obtains the knowledge perception weights as follows:

[0063] Obtain the probability of entities connecting to their surrounding neighbors in each hop of each user's historical click matrix, and use this probability as the knowledge-aware weight:

[0064]

[0065] in, The embedding representation of each hop head entity of entity i, r i hop The embedded representation of each level of relational entities of entity i. Let (h,r,t) represent the set of all triple entities that have been interacted with by each user u in the history of the knowledge graph through iterative propagation at each layer hop. Let (h,r,t) represent the triple consisting of the head entity, relation, and tail entity in the knowledge graph. Let π represent the neural network function of the multi-attribute module, which controls the amount of information transmitted by the head entity and relation to represent the attention weight of the multi-attribute module, as the knowledge perception weight.

[0066] Please see Figure 2 This is the overall framework diagram of the MultAtt-RippleNet model in this embodiment of the invention.

[0067] Specifically, the MultAtt-RippleNet recommendation model is an end-to-end model framework based on knowledge graph recommendation. It takes user-item pairs as input and outputs the probability of a user clicking on an item. Its expression is: Where u represents the user, v represents the item to be predicted, and F() represents the prediction function used to solve for the user u.

[0068] Are you interested in items v that you haven't interacted with? Θ is the predicted click probability result for user u on item v, and Θ is the model training parameter of function F.

[0069] User movie interaction data is obtained by iteratively expanding the user's interests and potential interests through layers of links in the KG (Keywords, Data Library), thereby uncovering each user's latent interest preferences. The specific process is as follows:

[0070] U = {u1, u2, u3, ...} and V = {v1, v2, v3, ...} represent the user and project datasets, respectively, and X = {x uv |u∈U,v∈V} represents the user-item interaction matrix. If user u interacts with item v, then x uv The value is 1 if the condition is not met, and 0 otherwise; where x represents the value of each interaction item in the user's project. The k-hop related entity set of user u in the knowledge graph KG is defined as:

[0071]

[0072] When K=0, it represents the user's historical clicked items, which are considered as the seed set of user u in KG:

[0073]

[0074] The K-hop ripple set of user u is defined as a knowledge triple starting from EuK-1:

[0075]

[0076] The proposed model incorporates knowledge-aware attention, passing more weighted attributes from the head node entity movie of each hop to the tail node entity. This weighted attribute is derived from embedding the head and relation nodes of each hop in the ripple formed by the user's historical clicks into vectors, which the model then learns to represent the feature vector relationships between them. Because each tail entity in a KG ripple has a different head entity and relation, it naturally contains vector representations of potential semantic relationships, as illustrated in the following example:

[0077] For example, the same characters like Zhang Fei and Liu Bei, or those from the same historical periods, appear in works such as *Shu Benji*, *Wu Shu*, and *Jiangbiao Zhuan*. The newly used attention mechanism employs a five-layer structure: a fully connected layer, a ReLU layer, another fully connected layer, a ReLU layer, a fully connected layer, and a Sigmoid function. In the (h,r,t) triplet, the weight of the tail entity knowledge attention for each hop of the ripple is p. i hop :

[0078]

[0079] In the above formula, p i hop This means the weight of each entity i in a certain hop of the Ripple set connecting to the next hop entity, and h i hop r i hop These are the embedding representations of the hop heads and relationships at each layer, respectively, and π represents the neural network function of the multi-attribute module.

[0080]

[0081]

[0082] In the above formula, the parameters for training the neural network model include the weights w. 0,1,2 and bias b 0,1,2, The & sign means concatenating two matrices, ReLU represents the activation function, and σ represents the sigmoid function.

[0083]

[0084] This represents the probability of an entity connecting to its neighbors in each hop of each user's historical click matrix, thus successfully incorporating knowledge-aware weights. Here, knowledge-aware p is directly chosen during the ripple propagation of entities at each layer of the KG. i hop Replaces H which connects to surrounding entity neighbors i R i Vectors are aggregated with the tail entities of each hop as more precise weights.

[0085] In one implementation, the multi-attention module obtains user-relationship preference weights as follows:

[0086] Obtain the degree of preference of user j for different relations of entities at the hop level, and use it as the user-relationship preference weight:

[0087]

[0088]

[0089] Where π′ represents the neural network function of the multi-attention module, u abstract Represents the user's initial embedding encoding vector. This represents the relation vector at the hop level. It represents the set of all the items that the user has clicked in the past.

[0090] Specifically, the π′ function can be used to obtain the attention score of the "user abstraction" regarding its preference for different relationships. The difference between π′ and π is that one is the user's attention score regarding relationship preference, while the other is the attention score of each tail entity in the "ripple propagation" based on the head entity and the relationship. j represents an entity in the multi-attention module and is used to distinguish i in the multi-attribute module.

[0091] The model of this invention adds a multi-attention module, namely, user-relationship preference. Its practical significance is as follows: different users have completely different focuses when it comes to liking different movies and books. Some users are more concerned with whether the movie or book features the same actors, such as whether it stars high-profile actresses like Liu Yifei or Yang Mi; while other users are more concerned with whether the movie or book matches their preferred genre, thus determining whether they will watch or read it. The core lies in seeking a user embedding vector representation. The novel application here is the idea of ​​abstractly characterizing the user profile, that is, abstracting each user's unique historical click matrix as the user's characteristic features.

[0092] This is used as the initial embedding encoding vector, which we call the "user abstraction" in this paper and denoted as U. abstract .

[0093] Each abstract user Uabstract There will always be a p for the relationship j The evaluation weights, where each jump-head entity is connected to the upper and lower tail entities through relationships, must consider both knowledge perception p. i The weights should also take into account user-relationship preference weights p j Each layer of hop entity p j hop The formula is as follows:

[0094]

[0095] Where p j It uses "user abstraction" to score preferences for different relationships, u abstract It refers to the "user abstraction" vectors of different users, r j hop The expansion formula for representing all relations at each hop level is as follows:

[0096]

[0097] This represents the score of "user abstraction" after relational regularization. Finally, our formula for "user abstraction" is as follows:

[0098]

[0099] Where S u hop=0 This represents all the item entities that user u has clicked in the past when hop equals 0. The embedding vectors of these entities are summed to form the "user abstraction" vector.

[0100] In one implementation, the final user vector representation is calculated as follows:

[0101]

[0102] in, This represents the feature fusion probability of a user's knowledge perception and relational preference at each hop. This indicates the integration of knowledge-aware weights. User-relationship preference weights Subsequent attention weights, Represents all tail entities in each hop. It represents the set of all triple entities that have been interacted with by each user u in the history of the knowledge graph through iterative propagation at each level of hop.

[0103] Specifically, the features of perceived attention and linked user relationship preferences are fused to obtain a dual-feature fusion P. k The formula is as follows:

[0104] p k =soft max(p i |p j (10)

[0105] Here, the "|" symbol represents the fusion and concatenation of two feature matrices. The resulting feature fusion probability of the user's knowledge perception and relational preference at each hop is calculated using the following formula:

[0106]

[0107] In the above formula, the new model obtains each layer of hop. Adding them all together yields a more accurate, user-characteristic, and expressive final user vector representation u. real The formula is shown below:

[0108]

[0109] In the above formula, k represents each entity of user u on different hops, i.e., the merged entity k, used to distinguish entities i and j from those mentioned earlier.

[0110] In one implementation, the prediction module obtains the predicted click probability of a user for the predicted item based on the final user vector representation as follows:

[0111]

[0112] in, Let v denote the transpose of the final user vector representation, and v denote the embedding vector of the predicted item. This indicates the predicted click probability of the user for the predicted item.

[0113] This invention employs the RippleNet basic model. By leveraging knowledge-aware attention to determine the tail entities with higher relevance probabilities and prioritizing relationships between entities in each hop based on "user abstraction," a final multi-attribute and attention-based MultAtt-RippleNet model is formed. The unique feature of this model is the creation of a novel "user abstraction" concept, vividly depicting the user's initial vector representation. This adds weights to the "user abstraction's" preference for different relationships, improving the interaction between the final user embedding and the predicted item. Furthermore, it utilizes a novel knowledge-aware attention approach, based on the similarity of knowledge perception weights between different head entity nodes and tail entity nodes under specific relationships, more accurately improving the final user vector representation of preference propagation in each hop. Finally, this significantly improves the model's performance and accuracy.

[0114] This invention utilizes knowledge-aware attention, self-attention, transformer decoding, feature fusion, etc., to comprehensively improve accuracy by taking into account the key aspects that the basic model ignores, while the entire framework is still jointly trained.

[0115] Example 2

[0116] Based on the same inventive concept, this invention discloses a movie recommendation device based on the fusion of multiple attributes and knowledge attention, comprising:

[0117] The dataset annotation module is used to annotate the preset movie dataset and construct a knowledge graph based on the annotated movie dataset. In the knowledge graph, different movies are composed of head entity, relation, and tail entity triples, and users and entities are identified by user IDs.

[0118] The dataset partitioning module is used to load the labeled movie dataset into the data loader, store the triples in the knowledge graph according to the triple entities of users and each hop, and then partition the movie dataset into training set, validation set and test set.

[0119] The model building module is used to build a movie recommendation model based on multi-attribute and knowledge attention fusion. The model includes a multi-attribute module, a multi-attention module, a fusion module, and a prediction module. The multi-attribute module is used to obtain knowledge perception weights, the multi-attention module is used to obtain user-relationship preference weights, the fusion module is used to fuse the obtained knowledge perception weights and user-relationship preference weights to obtain the final user vector representation, and the prediction module is used to obtain the predicted click probability of the user for the predicted item based on the final user vector representation.

[0120] The model training module is used to train the constructed movie recommendation model based on multi-attribute and knowledge attention fusion using the partitioned training set, so as to obtain the trained movie recommendation model.

[0121] The recommendation module is used to recommend movies from the test set using a pre-trained movie recommendation model.

[0122] Since the device described in Embodiment 2 of this invention is the same device used to implement the movie recommendation method based on multi-attribute and knowledge attention fusion in Embodiment 1 of this invention, those skilled in the art can understand the specific structure and variations of this device based on the method described in Embodiment 1 of this invention, and therefore will not be repeated here. All devices used in the method of Embodiment 1 of this invention fall within the scope of protection of this invention.

[0123] Example 3

[0124] Based on the same inventive concept, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed, implements the method described in Embodiment 1.

[0125] Since the computer-readable storage medium described in Embodiment 3 of this invention is the same computer-readable storage medium used in implementing the movie recommendation method based on multi-attribute and knowledge attention fusion in Embodiment 1 of this invention, those skilled in the art can understand the specific structure and variations of this computer-readable storage medium based on the method described in Embodiment 1 of this invention, and therefore will not be repeated here. All computer-readable storage media used in the method of Embodiment 1 of this invention fall within the scope of protection of this invention.

[0126] Example 4

[0127] Based on the same inventive concept, this application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method in Embodiment 1.

[0128] Since the computer device described in Embodiment 4 of this invention is the same computer device used to implement the movie recommendation method based on multi-attribute and knowledge attention fusion in Embodiment 1 of this invention, those skilled in the art can understand the specific structure and variations of this computer device based on the method described in Embodiment 1 of this invention, and therefore will not be repeated here. All computer devices used in the method of Embodiment 1 of this invention fall within the scope of protection of this invention.

[0129] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0130] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0131] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention. Clearly, those skilled in the art can make various modifications and variations to the embodiments of the invention without departing from the spirit and scope of the invention. Thus, if these modifications and variations of the embodiments of the invention fall within the scope of the claims of the invention and their equivalents, the invention also intends to include these modifications and variations.

Claims

1. A movie recommendation method based on multi-attribute and knowledge attention fusion, characterized in that, include: S1: Label the preset movie dataset and construct a knowledge graph based on the labeled movie dataset. In the knowledge graph, different movies are composed of head entity, relation, and tail entity triples, and users and entities are identified by index IDs. S2: Load the labeled movie dataset into the data loader, store the triples in the knowledge graph according to the triple entities of the user and each hop, and then divide the movie dataset into training set, validation set and test set. S3: Construct a movie recommendation model based on multi-attribute and knowledge attention fusion. The model includes a multi-attribute module, a multi-attention module, a fusion module, and a prediction module. The multi-attribute module is used to obtain knowledge perception weights, the multi-attention module is used to obtain user-relationship preference weights, the fusion module is used to fuse the obtained knowledge perception weights and user-relationship preference weights to obtain the final user vector representation, and the prediction module is used to obtain the predicted click probability of the user for the predicted item based on the final user vector representation. Specifically, the fusion module is used to fuse and concatenate the two feature matrices of knowledge perception weights and user-relationship preference weights, and then normalize them through the softmax function to obtain the final fusion weights used to guide ripple propagation. S4: The movie recommendation model based on multi-attribute and knowledge attention fusion is trained using the training set obtained from the partitioning to obtain the trained movie recommendation model; S5: Use the trained movie recommendation model to recommend movies in the test set; The multi-attention module obtains user-relationship preference weights in the following way: Obtain the user's preference for different relationships among entities at the hop level, and use this as the user-relationship preference weight: in, A neural network function representing a multi-attention module. represents the score of the user abstraction after relation regularization, and j represents the entity in the multi-attention module. Represents the user's initial embedding encoding vector. This represents the relation vector at the hop level. This represents the set of all items that the user has clicked in the past. The final user vector representation is calculated as follows: in, This represents the feature fusion probability of a user's knowledge perception and relational preference at each hop, where k represents the entity in the fusion module. This represents the attention weight after incorporating knowledge-awareness weights and user-relationship preference weights. Represents all tail entities of each hop. It represents the set of all triple entities that have been interacted with by each user u in the history of the knowledge graph through iterative propagation at each level of hop.

2. The movie recommendation method based on multi-attribute and knowledge attention fusion as described in claim 1, characterized in that, Step S1 involves labeling the preset movie dataset, including: The movie dataset is divided into positive and negative samples based on the ratings in the pre-defined movie dataset. Positive samples represent items that users are interested in, while negative samples represent items that users are not interested in or have not interacted with.

3. The movie recommendation method based on multi-attribute and knowledge attention fusion as described in claim 1, characterized in that, The multi-attribute module obtains knowledge perception weights in the following way: Obtain the probability of entities connecting to their surrounding neighbors in each hop of each user's historical click matrix, and use this probability as the knowledge-aware weight: in, This represents the embedded representation of each hop header entity of entity i, where i represents the entity in the multi-attribute module. The embedded representation of each level of relational entities of entity i. This represents the set of all triple entities that have been interacted with by each user u throughout the history of the knowledge graph, through iterative propagation at each hop level. This represents a triple consisting of a head entity, a relation, and a tail entity in a knowledge graph. (·) represents the neural network function for a multi-attribute module.

4. The movie recommendation method based on multi-attribute and knowledge attention fusion as described in claim 1, characterized in that, The prediction module obtains the predicted click probability of a user for the predicted item based on the final user vector representation as follows: in, This represents the transpose of the final user vector representation. This represents the embedding vector of the predicted item. This indicates the predicted click probability of the user for the predicted item.

5. A movie recommendation device based on multi-attribute and knowledge attention fusion, characterized in that, Based on the method described in claim 1, it includes: The dataset annotation module is used to annotate the preset movie dataset and construct a knowledge graph based on the annotated movie dataset. In the knowledge graph, different movies are composed of head entity, relation, and tail entity triples, and users and entities are identified by index IDs. The dataset partitioning module is used to load the labeled movie dataset into the data loader, store the triples in the knowledge graph according to the triple entities of the user and each hop, and then partition the movie dataset into training set, validation set and test set. The model building module is used to construct a movie recommendation model based on multi-attribute and knowledge attention fusion. The model includes a multi-attribute module, a multi-attention module, a fusion module, and a prediction module. The multi-attribute module is used to obtain knowledge perception weights, the multi-attention module is used to obtain user-relationship preference weights, the fusion module is used to fuse the obtained knowledge perception weights and user-relationship preference weights to obtain the final user vector representation, and the prediction module is used to obtain the predicted click probability of the user for the predicted item based on the final user vector representation. Specifically, the fusion module is used to fuse and concatenate the two feature matrices of knowledge perception weights and user-relationship preference weights, and then normalize them through the softmax function to obtain the final fusion weights used to guide ripple propagation. The model training module is used to train the constructed movie recommendation model based on multi-attribute and knowledge attention fusion using the partitioned training set, so as to obtain the trained movie recommendation model. The recommendation module is used to recommend movies from the test set using a pre-trained movie recommendation model.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed, it implements the method as described in any one of claims 1 to 4.

7. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Personalized recommendation method based on knowledge graph

    CN112214685A

  • Movie recommendation method fusing attention mechanism of knowledge graph

    CN112765486A

  • Knowledge graph recommendation method based on propagation

    CN114637863A