A movie recommendation method integrating attention mechanism and dual-end knowledge graph

By using the attention mechanism and double-ended knowledge graph in the movie recommendation system to calculate the characteristics of users and movies, it solves the problem of knowledge graph data noise and cold start, improves the accuracy and personalization of recommendation results, and achieves better Recommended results.

CN114329222BActive Publication Date: 2024-09-13LIAONING TECHNICAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111682078.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-31
Publication Date
2024-09-13
Estimated Expiration
2041-12-31

AI Technical Summary

Technical Problem

Existing movie recommendation algorithms are prone to introducing noise when processing large-scale knowledge graph data, resulting in insufficient accuracy and interpretability of recommendation results, cold start problems and poor diversity of results.

Method used

Using a method that integrates the attention mechanism and the double-ended knowledge graph, the attention weight is calculated through the similarity between user-attributes and movie entities, and neighborhood sampling is performed to extract the characteristics of users and movies to improve the personalization and accuracy of recommendation results. sex.

Benefits of technology

It effectively improves the personalization and accuracy of recommendation results, enhances the interpretability of the recommendation system, and shows performance beyond traditional models in experiments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114329222B
    Figure CN114329222B
Patent Text Reader

Abstract

The present invention discloses a movie recommendation method integrating attention mechanism and dual-end knowledge graph, which comprises the following steps: mapping user attribute information into a low-dimensional vector space, constructing a user-attribute bipartite graph G u ; Through the attention mechanism, assign attention scores to the user-attribute relationship and obtain the neighborhood representation of user u; use the aggregator to calculate the user feature matrix U; map the head entity and tail entity in the movie knowledge graph triple to the relational space, and calculate the distance between the head entity and the tail entity in the relational space as the attention score through the attention mechanism#imgabs0# to obtain the neighborhood representation of movie v; use the aggregator to obtain the movie feature V; send U and V to the prediction function to calculate the user's rating y for the movie uv The movie recommendation method of the present invention, which integrates the attention mechanism and the dual-end knowledge graph, effectively improves the personalization, accuracy and interpretability of the recommendation results, and can be applied in a variety of scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of knowledge graphs, and in particular relates to a movie recommendation method that integrates an attention mechanism and a dual-end knowledge graph. Background Art

[0002] Commonly used recommendation algorithms include content-based recommendation algorithms, collaborative filtering-based recommendation algorithms, and knowledge-based recommendation algorithms. The main idea of ​​the first algorithm is to recommend items similar to those that users have liked based on the attributes of the items themselves. The main idea of ​​the second algorithm is to recommend algorithms based on a large amount of user-item interaction information. However, due to the sparsity of the data, it will lead to cold start problems and the interpretability of the results is poor. In order to solve the above problems, a knowledge-based recommendation algorithm is proposed. The knowledge graph is a heterogeneous network rich in semantic association information between entities. Learning low-dimensional vectors for each entity and relationship as auxiliary information of the recommendation system can effectively improve the accuracy, diversity and interpretability of the recommendation results.

[0003] As people's research on algorithms gradually deepens, many researchers have tried to add neural networks to recommendation systems. Since neural networks can process relevant information by adjusting the relationships between internal nodes, they can effectively extract features and are very helpful in constructing user features and project features in knowledge graphs.

[0004] Due to the huge amount of data in the knowledge graph, commonly used methods include fixed number sampling and random sampling, but they will introduce noise and affect the recommendation results. Therefore, the attention mechanism can be used to assign weights to each triple. Sampling according to the weights can reduce the amount of calculation and improve the accuracy and interpretability of the recommendation results. Summary of the invention

[0005] In view of the shortcomings of the prior art, the present invention proposes a movie recommendation method that integrates the attention mechanism and the two-end knowledge graph, so as to utilize the user's preference for relationships to mine more entities that meet the user's interests and calculate the user's characteristics more accurately; utilize the information in the rich entity relationship triples in the movie knowledge graph, assign weights according to the similarity between the head entity and the tail entity, and perform neighborhood sampling according to the weights to obtain more accurate project features, thereby improving the personalization and accuracy of the recommendation results.

[0006] In order to solve the above technical problems, the present invention is implemented by the following technical solutions:

[0007] The present invention provides a movie recommendation method integrating an attention mechanism and a two-end knowledge graph, comprising the following steps:

[0008] Step 1: First, read the user-attribute information from the dataset document, map it to a low-dimensional space, and construct a user-attribute bipartite graph G. u , then construct the corresponding layer with nonlinear activation function in the first fully connected layer, obtain the attention weight between user and attribute, calculate the neighborhood representation of user u, and finally use the aggregator to obtain user feature U;

[0009] Step 2: Input the movie information into the knowledge graph, obtain the test triple (h, r, t), and use the translation-based embedding model TransE to learn the embedding of the triple (e h ,e r ,e t ), and maps the first entity and the last entity in the triple to the relational space into and

[0010] Step 3: Use the nonlinear activation function tanh in the second fully connected layer to construct the corresponding layer so that the attention score depends on and Calculate the attention weights between entities in the knowledge graph under different relationships, calculate the neighborhood representation of movie v, and use the aggregator to obtain the movie feature V;

[0011] Step 4: Use user features U and movie features V as input values ​​of the prediction function to calculate the user's predicted click rate y for the movie uv , to achieve personalized movie recommendations for users.

[0012] Preferably, the nonlinear activation function in step 1 is used to construct the corresponding layer, using the following formula:

[0013]

[0014] in, represents the user-attribute attention score, ReLu is a nonlinear activation function, and u and u i They represent users and their attributes respectively, w1 and b1 represent weight and bias parameters respectively, reflecting the importance of different attributes to the user itself.

[0015] Preferably, in step 2, the movie information is input into the knowledge graph to obtain the movie entity triple (h, r, t), the translation-based embedding model TranE is used to learn the embedding of entities and relations, and the d(h, r, t) function is used to calculate the distance between h+r and t, so as to obtain the embedding e h , and The head entity and the tail entity in the triple are separated by Mapped into the relational space, where and for e h With e t The projection representation in the relational space r uses a loss function to magnify the difference between the existing triples (h, r, t) and the non-existent triples (h′, r, t;):

[0016]

[0017] Furthermore, in step 3, the designed attention weight formula is:

[0018]

[0019] Where tanh is a nonlinear activation function, w r For the relationship weight, the softmax function is used for normalization:

[0020]

[0021] From the above, the movie recommendation method integrating the attention mechanism and the dual-end knowledge graph of the present invention has at least the following beneficial effects:

[0022] The present invention better extracts user characteristics according to user preferences, thereby improving the individuality of recommendation results; better extracts project characteristics according to the similarity between entities, thereby improving the accuracy of recommendation results; integrates the attention mechanism with the two-end knowledge graph, thereby further improving the interpretability and accuracy of recommendation results; and the model proposed by the present invention can be applied to many fields, such as music and books.

[0023] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the following is a detailed description in combination with the preferred embodiments and the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the drawings of the embodiment are briefly introduced below.

[0025] Figure 1 is a flowchart of a movie recommendation method integrating an attention mechanism and a dual-end knowledge graph of the present invention;

[0026] Figure 2 It is a knowledge graph data propagation diagram. DETAILED DESCRIPTION

[0027] The following is a detailed description of the specific embodiments of the present invention in conjunction with the accompanying drawings, which is a part of this specification and illustrates the principles of the present invention through examples. Other aspects, features and advantages of the present invention will become clear from the detailed description. In the referenced drawings, the same or similar components in different figures are represented by the same reference numerals.

[0028] like Figure 1 to Figure 2 As shown, the movie recommendation method integrating the attention mechanism and the dual-end knowledge graph of the present invention includes the following steps:

[0029] Step 1: First, read the user-attribute information from the dataset document, map it to a low-dimensional space, and construct a user-attribute bipartite graph G. u , and then construct the corresponding layer with a nonlinear activation function in the first fully connected layer:

[0030]

[0031] in, represents the user-attribute attention score, ReLu is a nonlinear activation function, and u and u i Represent the user and its attributes respectively, w1 and b1 represent the weight and bias parameters respectively, reflecting the importance of different attributes to the user itself. Use the softmax function to normalize the score:

[0032]

[0033] Then calculate the neighborhood representation of user u:

[0034]

[0035] where u N(u) Denoted as the neighborhood representation of u, N(u) is the set of attributes directly connected to user u.

[0036] Finally, the aggregator is used to obtain the user features U.

[0037] Step 2: Input the movie information into the knowledge graph, obtain the test triple (h, r, t), and use the translation-based embedding model TransE to learn the embedding of the triple (e h ,e r ,e t ), and maps the first entity and the last entity in the triple to the relational space into and

[0038] After getting the embedding of the triples, we use the loss function to expand the difference between the two triples. Input the movie information into the knowledge graph to get the movie entity triples (h, r, t), use the translation-based embedding model TranE to learn the embedding of entities and relations, and use the d(h, r, t) function to calculate the distance between h+r and t, and get the embedding e h , and The head entity and the tail entity in the triple are separated by Mapped into the relational space, where and for e h With e t The projection representation in the relational space r. And use the loss function to expand the difference between the existing triples (h, r, t) and the non-existent triples (h′, r, t;):

[0039]

[0040] Where S is a set storing triplets, (h, r, t) is an existing triplet, and h and t in the triplet are randomly replaced to generate a non-existent triplet (h′, r, t′).

[0041] Step 3: Use the nonlinear activation function tanh in the second fully connected layer to construct the corresponding layer so that the attention score depends on and Calculate the attention weights between entities in the knowledge graph under different relationships, calculate the neighborhood representation of movie v, and use the aggregator to obtain the movie feature V.

[0042] The attention weight formula designed by the present invention for the distance between entities is:

[0043]

[0044] Where tanh is a nonlinear activation function, w r is the relationship weight. Use the softmax function to achieve normalization:

[0045]

[0046] Then calculate the neighborhood representation of movie v:

[0047]

[0048] where v S(h) is the domain representation of h, and S(h) is the set of entities directly connected to h.

[0049] Finally, the aggregator is used to obtain the movie matrix V.

[0050] Step 4: Use user features U and movie features V as input values ​​of the prediction function to calculate the user's predicted click rate y for the movie uv , thereby achieving personalized movie recommendations for users.

[0051] It is worth noting that, unlike the traditional method of calculating weights in knowledge graphs, this invention uses the attention mechanism to design two attention weight formulas based on users and movies respectively. The attention weight is calculated by user-attribute information to fully obtain the user's preference characteristics and improve the personalization of recommendations; the attention weight is calculated by the similarity between the head entity and the tail entity to fully obtain the characteristics of the movie and improve the accuracy of recommendations. The user side and the movie side are combined for recommendation, which effectively improves the recommendation effect of the model. In subsequent experiments, it is compared with other knowledge graph models to prove the effectiveness of this model.

[0052] Example: The dataset used in the present invention is MovieLens-1M. The MovieLens-1M dataset contains 830,000 rating data from 6,040 users on 3,629 movies, including: user ratings, user information, and movie information. The data after data preprocessing is shown in Table 1 below:

[0053] Table 1 Data of relevant datasets

[0054]

[0055] The present invention will verify its effectiveness in the CTR (click-through rate prediction) scenario: the model of the present invention is used to predict the data in the test set, and the accuracy of the model prediction is evaluated using ACC and AUC.

[0056] The baseline models of the experiment are: CKE (Collaborative Knowledge Embedding): Collaborative knowledge embedding, combining knowledge graph with collaborative filtering algorithm to make recommendations to users. KGCN (knowledge graph convolutional networks for recommender systems): KGCN propagates with items as the centric entity, adds attention mechanism, and realizes personalized recommendation. RippleNet: Set the user's historical interests as the seeds of interest propagation, and continuously iterate and propagate the user's interests along KG according to the triples (h, r, t). LibFM (Factorization Machine Library): It is a feature-based factor decomposition model for click-through rate prediction. PER (Personalized Entity Recommendation): According to the heterogeneity of knowledge graph, the user's invisible feedback is expanded based on the original path to realize the personalization of recommendation results. The above five baseline models and the model of the present invention were experimented on two data sets, and the experimental results are shown in Table 2 below:

[0057]

[0058]

[0059] It can be seen from Table 2 that compared with the well-known recommendation algorithms LibFM and PER and the algorithms RippleNet, KGCN, and CKE algorithms related to knowledge graphs, the algorithm designed by the present invention has improved various data on the MovieLens-1M dataset. On the MovieLens-1M dataset, compared with the optimal data, the AUC and ACC data values ​​are increased by 1.1% and 1.3%, respectively. Compared with the above models, the present invention predicts each entity in the knowledge graph and selects the top n to continue expanding, which ensures the validity of the data, and increases the k value in k-hop, which can increase sampling to obtain better user and product features.

[0060] The impact of the number of sampled neighbors and the number of aggregation hops on the algorithm are shown in Tables 3 and 4. Table 3 shows the impact of the number of sampled neighbors on the algorithm. Too high or too low a value will affect the performance of the algorithm itself. Too low a value will result in a small number of aggregated entities and fail to obtain more effective information; too high a value will result in more noise being incorporated and the corresponding amount of calculation will be increased.

[0061] Table 3 AUC values ​​under different sampling numbers

[0062]

[0063] It can be seen from Table 4 that the number of hops has a stronger impact on the algorithm. When the number of hops increases, the algorithm performs best in the first 3 hops, and the value drops significantly when it reaches 4 hops. The 1-hop neighbor information introduced in the knowledge graph is the direct neighborhood of the user's interest, and an excessively large L will reduce the effectiveness of the introduced information.

[0064] Table 4 AUC values ​​under different hop counts

[0065]

[0066]

[0067] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0068] The above is only a preferred embodiment of the present invention, which certainly cannot be used to limit the scope of rights of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and changes can be made without departing from the principle of the present invention, and these improvements and changes are also regarded as the protection scope of the present invention.

Claims

1. A movie recommendation method that integrates attention mechanism and dual-end knowledge graph, It is characterized in that The following steps are involved: Step 1: First, read the user-attribute information from the dataset document, map it to a low-dimensional space, and construct a user-attribute bipartite graph G. u , then construct the corresponding layer with nonlinear activation function in the first fully connected layer, obtain the attention weight between user and attribute, calculate the neighborhood representation of user u, and finally use the aggregator to obtain user feature U; Step 2: Input the movie information into the knowledge graph, obtain the test triple (h, r, t), and use the translation-based embedding model TransE to learn the embedding of the triple (e hi e r ,e t ), and maps the head entity and tail entity in the triple to the relational space into and Step 3: Use the nonlinear activation function tanh in the second fully connected layer to construct the corresponding layer so that the attention score depends on and Calculate the attention weights between entities in the knowledge graph under different relationships, calculate the neighborhood representation of movie v, and use the aggregator to obtain the movie feature V; Step 4: Use user features U and movie features V as input values ​​of the prediction function to calculate the user's predicted click rate y for the movie uv , to achieve personalized movie recommendations for users.

2. The movie recommendation method integrating the attention mechanism and the dual-end knowledge graph as claimed in claim 1, It is characterized in that The nonlinear activation function in step 1 is used to construct the corresponding layer, using the following formula: in, represents the user-attribute attention score, ReLu is a nonlinear activation function, and u and u i Represent users and their attributes respectively, w 1 With b 1 They represent weight and bias parameters respectively, reflecting the importance of different attributes to the user himself.

3. The movie recommendation method integrating the attention mechanism and the dual-end knowledge graph as claimed in claim 1, It is characterized in that In step 2, the movie information is input into the knowledge graph to obtain the movie entity triple (h, r, t), the translation-based embedding model TranE is used to learn the embedding of entities and relations, and the d(h, r, t) function is used to calculate the distance between h+r and t to obtain the embedding and The head entity and the tail entity in the triple are separated by Mapped into the relational space, where and for e h With e t The projection representation in the relational space r uses a loss function to magnify the difference between the existing triples (h, r, t) and the non-existent triples (h', r, t;):

4. The movie recommendation method integrating the attention mechanism and the dual-end knowledge graph as claimed in claim 3, It is characterized in that In step 3, the designed attention weight formula is: Where tanh is a nonlinear activation function, w r For the relationship weight, the softmax function is used for normalization: