A Recommendation Method with Enhanced Comparison of Project Neighbor Information
By introducing the technology of project neighbor information comparison enhancement in the recommendation method, the problems of weak knowledge noise and supervision signals are solved, and more efficient user and project feature representation and recommendation effects are achieved.
Patent Information
- Application Number
- CN202310904542.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-21
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2043-07-21
AI Technical Summary
Existing knowledge graph-based recommendation methods perform poorly in dealing with problems of weak knowledge noise and supervision signals, resulting in poor recommendation performance.
A recommended method for project neighbor information comparison enhancement is proposed. By obtaining the original user-project interaction data and preprocessing, the association between users, projects and knowledge graphs is established, and the initial propagation set and neighbor set of users and projects are obtained using collaborative communication and knowledge dissemination. The knowledge-aware attention mechanism is used to allocate attention weights, perform data augmentation and comparison learning, reduce noise and enhance supervision signals.
It effectively reduces the knowledge noise of project neighbors, enhances supervision signals, improves recommendation effect, improves user and project feature representation, and improves recommendation accuracy.
Smart Images

Figure CN117150117B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of personalized recommendation, and in particular to a recommendation method for enhancing comparison of item neighbor information. Background Art
[0002] Personalized recommendation algorithms can mine the content of interest to users from a vast amount of information to meet the personalized preferences of users. The early recommendation method based on collaborative filtering with good effects models through the data of user-item interactions to predict user preferences. However, such methods usually face the problems of sparse user-item interaction data and cold start of new users. Therefore, methods for introducing other auxiliary information, such as user or item attributes, social networks, and knowledge graphs, to assist in improving the recommendation effect have received increasing attention. As an effective auxiliary information in the recommendation method, the knowledge graph is widely used in the recommendation method because it contains a large amount of semantically related knowledge, and by establishing the association between entities and users and items in the recommendation, it alleviates the problems of data sparsity and cold start.
[0003] The existing knowledge graph-based recommendation work mainly focuses on the research of methods for effectively integrating heterogeneous information of the knowledge graph into the latent vector representations of users and items. It can be roughly divided into three categories: path-based methods, embedding-based methods, and propagation-based methods. Path-based methods construct meta-structures (such as meta-paths, meta-graphs, etc.) through the relationships in the knowledge graph, calculate the semantic similarity between entities under different paths, and then mine the potential relationships between users and items in the graph to enhance the recommendation. Embedding-based methods use knowledge graph embedding technology to map high-dimensional sparse entities and relationships in the KG to a low-dimensional dense vector space, reduce its computational complexity, and integrate low-dimensional entity embeddings and relationship embeddings into the recommendation framework through entity and item alignment to enrich the features of users and items, thereby making recommendations. Hybrid methods adopt an embedding propagation mechanism, combine the semantic information of the KG with the paths in the KG, and obtain multi-hop neighbor information through propagation and aggregation operations, and then enrich the features of users or items and make recommendations. Generally speaking, propagation-based methods combine the semantic information of the knowledge graph with the paths in the KG, synthesize the advantages of path-based and embedding-based methods, and overcome the limitations of these two types of methods. Therefore, propagation-based methods have become the mainstream choice in knowledge graph-based recommendation systems. However, most of the existing propagation-based methods focus on the design of propagation and aggregation mechanisms, and rarely pay attention to the problems of knowledge noise and weak supervision information in the knowledge graph, resulting in poor recommendation performance. Summary of the Invention
[0004] The object of the present invention is to overcome the shortcomings and deficiencies of the prior art, and propose a recommendation method for enhancing the comparison of item neighbor information, which can reduce knowledge noise and enhance supervision signals, fully excavate the potential features of users and items, and improve the recommendation effect.
[0005] To achieve the above object, the technical solution provided by the present invention is: a recommendation method for enhancing the comparison of item neighbor information, comprising the following steps:
[0006] S1: Obtain the original user-item interaction data, and preprocess the data to obtain the user-item interaction data in a unified format;
[0007] S2: Align the entities of the preprocessed user-item interaction data to establish the association between users, items and the knowledge graph; obtain the initial propagation sets of users and items through collaborative propagation, and obtain the neighbor sets of users and items through knowledge propagation;
[0008] S3: Use the knowledge-aware attention mechanism to assign attention weights to the neighbor sets of users and items, and distinguish the importance of the neighbor features of users and items to users and items according to the size of the attention weights; wherein, the knowledge-aware attention mechanism is used to calculate the weights of the knowledge in the neighbor set, that is, the triples, to realize fine-grained neighbor information encoding and obtain the neighbor features of users and items;
[0009] S4: Take the neighbor features of the items obtained through the knowledge-aware attention mechanism as the original view, and perform data augmentation processing to obtain the enhanced neighbor features of the items as the enhanced view;
[0010] S5: Between the enhanced view and the original view, use contrastive learning to calculate the common features between the two views, reduce the number of noises in the item neighbor features, and output the enhanced view and the original view as the neighbor features of the items and the enhanced neighbor features of the items;
[0011] S6: Perform an inner product operation between the neighbor features of the items, the enhanced neighbor features of the items and the neighbor features of the users to predict the probability that the user clicks on each item.
[0012] Further, the step S2 includes the following steps:
[0013] S21: For the input user-item interaction data, collaborative propagation is to obtain the key collaborative signals from the user-item interaction data and explicitly encode them as the representations of users and items; according to the user-item interaction data can reflect part of the preferences of users, the representation of users is reflected by relevant items; the initial entity set of user u is defined as the following formula:
[0014]
[0015] In the formula, A is the project-entity alignment set, and y uv = 1 represents the data of the interaction between the user and the project, v is the project, and e is the entity;
[0016] Considering the scenario where a project can be interacted with by multiple users, a "project-user-project" propagation strategy is adopted to include the user-project interaction data in the initial entity set of the project to enrich the representation of the project; therefore, the initial entity set of project v is defined as follows:
[0017]
[0018] In the formula, represents the association between different projects of the same user, and explicitly includes the user-project collaboration signal in the project-project view;
[0019] S22: Use the initial entity set of user u and the initial entity set of project v as the seeds of knowledge propagation, and propagate along the relationships in the knowledge graph to obtain associated entities, and construct the multi-hop entity sets of user u and project v; for the associated entities generated by the propagation of the l-th order of users and projects in the knowledge graph is defined as follows:
[0020]
[0021] In the formula, o is a unified placeholder for user u or project v, G represents the knowledge graph, (h, r, t) is a triple in the knowledge graph, h is the head entity, r is the relationship, t is the tail entity, l is the number of hops of propagation, and the value range is between 1 and L, expresses finding the associated tail entity t in the knowledge graph with as the head entity as the head entity of the l-th order;
[0022] S23: Use the associated entities generated by knowledge propagation as the head entity set, and obtain each triple as the neighbor set of the user and the project; for the neighbor set of the l-th order user or project define the head entity set as Find the corresponding relationship and tail entity in the triple of the knowledge graph to form the neighbor sets of the user and the project, and the l-th order neighbor set is defined as follows:
[0023]
[0024] In the formula, expresses the triple set formed with the entity set as the head entity;
[0025] S24: Repeat steps S22 and S23 for L times to obtain each neighbor set where represents the triple set of the L-hop user or item, providing materials for mining the structural and semantic information in the knowledge graph and enhancing the feature representation of users and items.
[0026] Further, step S3 includes the following steps:
[0027] S31: For the input neighbor set In the knowledge-aware attention mechanism, calculate the attention weights of each triple in the neighbor set to reveal the differences in the meanings expressed by different triples, so as to effectively encode each piece of knowledge in the neighbor, that is, the triples; consider the knowledge-aware attention embedding β m of the m-th triple in
[0028] β m = α m t m
[0029] α m = σ(W 2 Leakrelu(W 1 (Leakrelu(W 0 (h m || r m || t m ) + b 0 )) + b 1 ) + b 2 )
[0030] In the formula, α m is the knowledge-aware attention function, used to learn the importance of each triple in the neighbor; Leakrelu is a non-linear activation function to prevent gradient disappearance; σ is the activation function sigmoid, ‖ is the concatenation operation; W 0 , W 1 , W 2 are network parameters, updated with backpropagation, b 0 , b 1 , b 2 are biases, h m is the head entity of the m-th triple, r m is the relation of the m-th triple, t m is the tail entity of the m-th triple;
[0031] S32: For each triple in neighbor successively adopt the knowledge-aware attention mechanism to obtain the knowledge-aware attention embedding where represents neighbor The number of triples included; accumulate the knowledge-aware attention embeddings of neighbors to obtain the embedding of neighbors as follows: It is expressed as the following formula:
[0032]
[0033] In the formula, m represents the m-th triple, and ∑ is the summation operation; for the neighbor set perform L operations of the knowledge-aware attention mechanism to obtain the knowledge-aware attention embedding where represents the l-th knowledge-aware attention embedding of the user or item.
[0034] Furthermore, step S4 includes the following steps:
[0035] S41: For the embedding of the input item neighbors perform data augmentation on the item neighbors, introduce noise obeying the uniform distribution, and simulate the uniformity of item features; for the l-hop item neighbor embedding its enhanced embedding of item neighbors is given by the following formula:
[0036]
[0037] In the formula, Δ s is the added noise vector, and ||Δ s || = ε is a small constant;
[0038] S42: To restrict Δ s to be numerically equivalent to points on the hypersphere with a radius of ε, the formula for Δ s is as follows:
[0039]
[0040] In the formula, X is data obeying the 0-1 uniform distribution, sign is the sign function, and R d represents that the dimension of X is d;
[0041] S43: Propagate the results of steps S41 and S42 through L iterations to obtain the enhanced set of item neighbor features where represents the L-th enhanced item neighbor feature.
[0042] Furthermore, in step S5, the enhanced set of item neighbor features and the set of embeddings of item neighbors are regarded as two views for contrastive learning; the item neighbor embeddings of the same order are regarded as positive pairs, that is and On the contrary, it is regarded as a negative pair; among them, the contrast loss function L infoNCE is as follows:
[0043]
[0044] In the formula, τ is the temperature parameter, which regulates the uniform distribution of samples; by introducing additional supervision information through the contrast loss function, it is possible to encourage the project neighbor embeddings to be evenly distributed in the latent space for better discrimination of their differences during prediction.
[0045] Furthermore, the step S6 includes the following steps:
[0046] S61: The set of neighbor embeddings encoded by the knowledge-aware attention mechanism is And the initial entity sets of users and projects contain collaborative information, and their user and project collaborative embedding representations are:
[0047]
[0048]
[0049] In the formula, Embedding is the embedding function, is the collaborative embedding of the user, is the collaborative embedding of the project;
[0050] By concatenating each neighbor embedding and collaborative embedding to obtain the embeddings e o of users and projects, which is expressed as follows:
[0051]
[0052] In the formula, o is a unified placeholder representing the features of user u and project v, is the collaborative embedding of the user or project; in addition, considering that project neighbor enhancement is to add weak noise to enhance the neighbor embeddings of the project, the enhanced set of project neighbor embeddings is directly used for the recommendation task; the final project representation is as follows:
[0053]
[0054]
[0055] In the formula, e v represents the embedding concatenation representation of the project, e′ v is the enhanced embedding concatenation representation of the project, represents the enhanced collaborative embedding of the project, and + represents the addition operation;
[0056] S62: According to the final user representation e u and the item representation The user preference function y(u, v) is defined as:
[0057]
[0058] where T represents the transpose operation;
[0059] S63: To combine the recommendation task and contrastive learning, a multi-task training strategy is adopted to train the recommendation task and contrastive learning together to optimize the learnable parameters. For the knowledge-aware recommendation task, the BPR loss function is adopted, as shown in the following formula:
[0060]
[0061] where L BPR is the BPR loss function, is the predicted value of the positive sample, is the predicted value of the negative sample, u represents the user, i represents the positive sample, j is the negative sample, o′ = {(u, i, j)|(u, i) ∈ o + , (u, j) ∈ o -} is the trainable dataset, and the user-item interaction is denoted as o + , and the non-interaction between the user and the item is denoted as o - , and o + and o - are set with a data ratio of 1:1, and σ is the sigmoid function;
[0062] S64: Adopt a multi-task learning strategy to combine the BPR loss function L BPR and the contrastive loss function L infoNCE , and the final loss function L is as follows:
[0063]
[0064] where Θ is the set of parameters, λ 1 and λ 2 are parameters, is the L2 norm with λ 2 as the parameter.
[0065] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0066] 1. The present invention designs a knowledge-aware attention mechanism, which can effectively capture the key triple information in the neighbors.
[0067] 2. The present invention designs a method for enhancing item neighbors, which reduces the knowledge noise of item neighbors. There is no need to reconstruct a new view, which reduces the time complexity.
[0068] 3. The present invention uses contrastive learning to mutually learn between project views, alleviating the problem of sparse interaction signals.
[0069] In summary, the present invention can improve the quality of acquired features by using contrastive learning and attention mechanism, alleviate the sparsity of user-project interaction data, and enhance the supervision signal. By combining the knowledge graph and user-project interaction information, it fully excavates the potential features of users and projects, purposefully enhances project neighbors, compares the information between project neighbors, reduces the knowledge redundancy in the knowledge graph, and effectively enhances project features. Brief Description of the Drawings
[0070] Figure 1 It is a framework diagram of the method of the present invention.
[0071] Figure 2 It is a schematic diagram of heterogeneous propagation.
[0072] Figure 3 It is a schematic diagram of the knowledge-aware attention mechanism.
[0073] Figure 4 It is a schematic diagram of the contrastive learning of project neighbors. Detailed Embodiment
[0074] The present invention will be further described in detail below in conjunction with the embodiments and the drawings, but the embodiments of the present invention are not limited thereto.
[0075] As Figure 1 shown, this embodiment discloses a recommendation method for enhancing the comparison of project neighbor information, using a relevant knowledge graph as auxiliary information and contrastive learning, which includes the following steps:
[0076] 1) Heterogeneous propagation:
[0077] Heterogeneous propagation consists of collaborative propagation and knowledge propagation, as Figure 2 shown. Considering the different combination ways of user-project interaction data and the knowledge graph, the entities linked by users and projects are different, affecting the embedding of users and projects. Through collaborative propagation, an initial entity set for users and projects to propagate in the knowledge graph is obtained from the user-project interaction data, and deep entities are obtained through knowledge graph propagation to enhance the representation of users and projects. It includes the following steps:
[0078] 1.1) For the input user-project interaction data, collaborative propagation is to obtain key collaborative signals from the user-project interaction data and explicitly encode them as the representations of users and projects. According to the user-project interaction data can reflect part of the user's preferences, the representation of the user can be reflected by relevant projects. The initial entity set of user u is defined as the following formula:
[0079]
[0080] In the formula, A is the project-entity alignment set, and y uv = 1 represents the data of the user's interaction with the project, v is the project, and e is the entity.
[0081] Considering the scenario where a project can be interacted with by multiple users, a "project-user-project" propagation strategy is adopted to include the user-project interaction data in the initial entity set of the project to enrich the representation of the project; therefore, the initial entity set of project v is defined as the following formula:
[0082]
[0083] In the formula, represents the association between different projects of the same user, and explicitly includes the user-project collaborative signal in the project-project view.
[0084] 1.2) Use the initial entity set of user u and the initial entity set of project v as the seeds for knowledge propagation, and propagate along the relationships in the knowledge graph to obtain associated entities, and construct the multi-hop entity sets of user u and project v. For the associated entities generated by the propagation of the l-th order of users and projects in the knowledge graph are defined as follows:
[0085]
[0086] In the formula, o is a unified placeholder for user u or project v. G represents the knowledge graph, (h, r, t) is a triple in the knowledge graph, h is the head entity, r is the relationship, and t is the tail entity. l is the number of hops of propagation, and its value range is between 1 and L. Express finding the associated tail entity t in the knowledge graph with as the head entity as the head entity of the l-th order.
[0087] 1.3) Use the associated entities generated by knowledge propagation as the head entity set, and obtain each triple as the neighbor set of the user and the project. For the neighbor set of the l-th order user or project define the head entity set as Find the corresponding relationship and tail entity in the triples of the knowledge graph to form the neighbor sets of the user and the project. The l-th order neighbor set is defined as follows:
[0088]
[0089] In the formula, expresses the triple set formed with the entity set as the head entity.
[0090] 1.4) Repeat steps S22 and S23 for L times to obtain each neighbor set where represents the set of L-hop triple groups, providing materials for mining the structural and semantic information in the knowledge graph and enhancing the feature representations of users and items
[0091] 2) Knowledge-aware attention mechanism:
[0092] As Figure 3 shown, there is irrelevant triple information in each neighbor set of users and items. Therefore, the knowledge-aware attention embedding weights β are obtained for each neighbor set of users and items through the knowledge-aware attention mechanism. The greater the weight, the higher the importance. It includes the following steps:
[0093] 2.1) For the input of each neighbor set In the knowledge-aware attention mechanism, calculate the attention weight of each triple in the neighbor set to reveal the differences in the meanings expressed by different triples, so as to effectively encode each knowledge (triple) in the neighbor; consider the m-th triple in, the knowledge-aware attention embedding β m is calculated as follows:
[0094] β m = α m t m
[0095] α m = σ(W 2 Leakrelu(W 1 (Leakrelu(W 0 (h m || r m || t m ) + b 0 )) + b 1 ) + b 2 )
[0096] In the formula, α m is the knowledge-aware attention function, used to learn the importance of each triple in the neighbor. Leakrelu is a non-linear activation function to prevent gradient vanishing. σ is the activation function sigmoid, and ‖ is the concatenation operation. W 0 、W 1 、W 2 are network parameters, updated with backpropagation, and b 0 、b 1 、b 2 are biases, h m is the head entity of the m-th triple, r m is the relation of the m-th triple, and tm is the tail entity of the m-th triple.
[0097] 2.2) For each triple in the neighbor the knowledge-aware attention mechanism is sequentially adopted to obtain the knowledge-aware attention embedding where represents the number of triples contained in the neighbor . The knowledge-aware attention embeddings of the neighbor are accumulated to obtain the embedding of the neighbor which can be expressed as the following formula:
[0098]
[0099] In the formula, m represents the current m-th triple. ∑ is the summation operation. For the neighbor set the knowledge-aware attention mechanism is operated L times to obtain the knowledge-aware attention embedding where represents the L-th knowledge-aware attention embedding.
[0100] 3) As Figure 4 shown, for the neighbor features of the item obtained by the knowledge-aware attention mechanism, item neighbor data augmentation processing is performed to obtain the enhanced neighbor features of the item. Between the enhanced neighbor feature view of the item and the neighbor feature view of the item, contrastive learning is used to calculate the common features between the two views to reduce the number of noises in the item neighbor embedding. The specific operation steps are as follows:
[0101] 3.1) For the input embedding set of the item neighbors item neighbor augmentation is performed, and noise obeying the uniform distribution is introduced to simulate the uniformity of the item features. For the l-th hop item neighbor embedding the formula for its item neighbor augmented embedding is as follows:
[0102]
[0103] In the formula, Δ s is the added noise vector, and ||Δ s || = ε is a small constant (ε < 0.3).
[0104] 3.2) To limit Δ s to points numerically equivalent to those on the hypersphere with a radius of ε, the formula for Δ s is as follows:
[0105]
[0106] where X is the data following a uniform distribution between 0 and 1, sign is the sign function, and R d represents that the dimension of X is d.
[0107] 3.3) Propagate the results of steps 3.1) and 3.2) through L iterations to obtain an enhanced set of item neighbor features where represents the L-th enhanced item neighbor feature.
[0108] 3.4) Treat the enhanced set of item neighbor features and the embedding set of item neighbors as two views for contrastive learning. Consider item neighbor embeddings of the same order as positive pairs (i.e., and ), and vice versa as negative pairs. The contrastive loss function L infoNCE is given by the following formula:
[0109]
[0110] where τ is the temperature parameter that regulates the uniform distribution of samples. Introducing additional supervision information through the contrastive loss function can encourage the item neighbor embeddings to be uniformly distributed in the latent space for better discrimination of their differences during prediction.
[0111] 4) Predict the probability that a user clicks on each item based on the inner product operation of item neighbor features and user neighbor features.
[0112] 4.1) The set of neighbor embeddings after knowledge-aware attention encoding is while the initial entity sets of users and items ( and ) contain collaborative information, and their collaborative embeddings for users and items are represented as:
[0113]
[0114]
[0115] where Embedding is the embedding function, is the collaborative embedding of the user, is the collaborative embedding of the item.
[0116] Concatenate each neighbor embedding and collaborative embedding to obtain the embeddings of the user and item, e o which is represented as follows:
[0117]
[0118] where o is a unified placeholder representing the features of user u and item v, Collaborative embedding for users or projects; in addition, considering that project neighbor enhancement is to add weak noise to enhance the neighbor embedding of projects, the enhanced neighbor embedding set of projects is directly used for the recommendation task. The final project representation is as follows:
[0119]
[0120]
[0121] In the formula, e v represents the embedding concatenation representation of the project, and e′ v is the embedding concatenation representation of the enhanced project, represents the enhanced project collaborative embedding, and + represents the addition operation.
[0122] 4.2) According to the final user representation e u and the project representation the user preference function y(u, v) is defined as:
[0123]
[0124] In the formula, T represents the transpose operation.
[0125] 4.3) In order to combine the recommendation task and self-supervised learning, a multi-task training strategy is adopted, and the recommendation task and contrastive learning are trained together to optimize the learnable parameters. For the knowledge-aware recommendation task, the BPR loss function is adopted, as follows:
[0126]
[0127] In the formula, L BPR is the BPR loss function, is the predicted value of the positive sample, is the predicted value of the negative sample, u represents the user, i represents the positive sample, j is the negative sample, o′ = {(u, i, j)|(u, i) ∈ o + ,(u, j) ∈ o -} is the trainable data set, and the user-item interaction is denoted as o + , and the non-interaction between the user and the item is denoted as o - , and o + and o - The data ratio is 1:1, and σ is the sigmoid function;
[0128] 4.4) Adopt a multi-task learning strategy to combine the BPR loss function L BPR and the contrastive loss function L infoNCE The final loss function L is as follows:
[0129]
[0130] In the formula, Θ is the parameter set, λ 1 and λ 2 are parameters, is the L2 norm with λ 2 as the parameter.
[0131] The MovieLen-1M dataset comes from the MovieLens movie website and contains 376,886 interactions of 6,036 users with 2,347 items; the Last.FM dataset is provided by the last.fm online music system and includes 21,173 clicks of 1,892 users on 3,846 singers in the online music service; Book-Crossing is book rating data collected from bookcrossing.com, which contains 69,873 ratings of 14,967 books by 17,860 readers.
[0132] To verify the effectiveness of the experiment, the dataset is further divided, and the division results are shown in Table 1.
[0133] Table 1 Dataset Details
[0134] Dataset Name Number of Users Number of Items Number of Interactions Training Set Validation Set MovieLens-1M 6036 2347 376886 301508 75378 Last.FM 1872 3846 21173 17738 3435 Book-Crossing 17860 14967 69873 55178 14695
[0135] Click prediction is a common method for evaluating the performance of recommendation algorithms. In this experiment, AUC (Area Under Curve, AUC) and F1 are used as evaluation criteria. The calculation method of AUC is as follows:
[0136]
[0137] In the formula, rank i is the ranking value of the i-th sample, C and D are the numbers of positive samples and negative samples respectively, represents the sum of all positive sample score values.
[0138] F1 is the harmonic mean of the precision P (Precision) and the recall R (Recall). The value of F1 ranges from [0, 1]. The larger the F1 value, the better the model's recommendation ability. The calculation method of F1-Score is as follows:
[0139] P = TP / (TP + FP)
[0140] F1 = 2×(P×R) / (P + R)
[0141] In the formula, TP (True Positive) represents the number of positive samples correctly predicted as positive samples by the model, and FP (False Positive) represents the number of negative samples wrongly predicted as positive samples by the model.
[0142] To verify the effectiveness of the method of the present invention, AUC and F1 are used as evaluation criteria. On three commonly used datasets, Movie-1M, Book-Crossing, and Last.FM, a comparative analysis is conducted with methods such as RippleNet, KGCN, KGNN-LS, KGAT, CKAN, COAT, LKG, KGIN, CG-KGR, and KGIC. The average values of the experimental results are shown in Table 2.
[0143] Table 2 Analysis Table of Experimental Results
[0144]
[0145]
[0146] The experimental results can fully prove the effectiveness of the method of the present invention. By means of co-propagation and knowledge graph propagation to generate multi-hop neighbors, and using item enhancement of neighbors to generate item neighbor data. Contrastive learning is carried out between two item neighbor views, forcing the two views to share information, thereby alleviating the weak supervision signal. In addition, item neighbor enhancement can effectively reduce the time overhead and the problem of knowledge redundancy in the knowledge graph without constructing a structural view.
[0147] Experimental Conclusion: Aiming at the problems of weak user-item interaction supervision signals in existing algorithms and the presence of noisy information in the knowledge graph, the present invention proposes a recommendation method for contrastive enhancement of item neighbor information. Experimental evaluations on three publicly available datasets, MovieLen-1M, Book-Crossing, and Last.FM, show that the use of the method of the present invention has a certain improvement in recommendation accuracy and is superior to existing methods. In the next research, the recommendation method for social networks and the application of reinforcement learning in the recommendation task of the knowledge graph will be explored, which has good application prospects and is worthy of promotion.
[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 other changes, modifications, substitutions, combinations, and simplifications made without departing from the spirit and principle of the present invention shall be equivalent replacement methods and are all included in the protection scope of the present invention.
Claims
1. A recommendation method for enhancing the comparison of item neighbor information, characterized in that, it includes the following steps: S1: Obtain the original user-item interaction data and preprocess the data to obtain user-item interaction data in a unified format; S2: Align the entities in the preprocessed user-item interaction data to establish the association between users, items, and the knowledge graph; Obtain the initial propagation sets of users and items through collaborative propagation, and use knowledge propagation to obtain the neighbor sets of users and items; S3: Use the knowledge-aware attention mechanism to assign attention weights to the neighbor sets of users and items, and distinguish the importance of the neighbor features of users and items for users and items according to the magnitude of the attention weights; among them, the knowledge-aware attention mechanism is used to calculate the weights of the knowledge, that is, triples, in the neighbor set to achieve fine-grained neighbor information encoding and obtain the neighbor features of users and items; S4: Take the neighbor features of the item obtained by the knowledge-aware attention mechanism as the original view, and perform data augmentation processing to obtain enhanced item neighbor features as the enhanced view, including the following steps: S41: Embedding of input item neighbors Perform data augmentation on item neighbors, introduce noise obeying a uniform distribution to simulate the uniformity of item features; for the l-hop item neighbor embedding The enhanced embedding of its item neighbors The formula is as follows: where, Δ s is the added noise vector, and ||Δ s || = ε is a small constant; S42: To limit Δ s is numerically equivalent to a point on a hypersphere with radius ε, and the formula for Δ s is as follows: where X is data following a uniform distribution between 0 and 1, sign is the sign function, and R d represents that the dimension of X is d; S43: Propagate the results of steps S41 and S42 through L iterations to obtain an enhanced set of item neighbor features where represents the L-th enhanced item neighbor feature; S5: Between the enhanced view and the original view, use contrastive learning to calculate the common features between the two views, reduce the number of noises in the item neighbor features, and output the enhanced view and the original view as the neighbor features of the item and the enhanced item neighbor features; S6: Perform an inner product operation among the neighbor features of the item, the enhanced item neighbor features, and the user neighbor features to predict the probability that the user clicks on each item.
2. A recommendation method for enhancing the comparison of item neighbor information according to claim 1, characterized in that, the step S2 includes the following steps: S21: For the input user-item interaction data, collaborative propagation is to obtain key collaborative signals from the user-item interaction data and explicitly encode them as representations of users and items; according to the fact that user-item interaction data can reflect some preferences of users, the representation of users is reflected by relevant items; the initial entity set of user u is defined as follows: where A is the project-entity alignment set, y uv = 1 represents the data of the user's interaction with the project, v is the project, and e is the entity; Considering the scenario where a project can be interacted with by multiple users, the "project-user-project" propagation strategy is adopted, and the user-project interaction data is included in the initial entity set of the project to enrich the representation of the project; thus, the initial entity set of project v is defined as follows: wherein, represents the association between different items of the same user, and explicitly includes the user-item collaboration signal in the item-item view; S22: Use the initial entity sets of user u and item v as the seeds for knowledge propagation, and propagate along the relationships in the knowledge graph to obtain associated entities, and construct the multi-hop entity sets of user u and item v; for the associated entities generated by the propagation of users and items of the l-th order in the knowledge graph are defined as follows: Wherein, o is a unified placeholder for user u or item v, G represents a knowledge graph, (h, r, t) is a triple in the knowledge graph, h is the head entity, r is the relationship, t is the tail entity, l is the number of hops of propagation, and the value range is between 1 and L. Express taking as the head entity to find the associated tail entity t in the knowledge graph as the head entity of the l-th order; S23: Use the associated entities generated by knowledge dissemination as the head entity set, and obtain each triple as the neighbor set of users and items; for the neighbor set of the l-th order users or items Define the head entity set as Search for the corresponding relationships and tail entities in the triples of the knowledge graph to form the neighbor sets of users and items, the l-th order neighbor set is defined as follows: In the formula, represents a set of triples with the entity set as the head entity; S24: Repeat steps S22 and S23 for L times to obtain each neighbor set where represents the triple set of the L-th hop users or items, providing materials for mining the structural and semantic information in the knowledge graph and enhancing the feature representation of users and items.
3. A recommendation method for enhancing the comparison of item neighbor information according to claim 2, characterized in that, the step S3 includes the following steps: S31: For the input neighbor set In the knowledge-aware attention mechanism, calculate the attention weights of each triple in the neighbor set to reveal the differences in the meanings expressed by different triples, so as to effectively encode each piece of knowledge in the neighbor, that is, the triple; Consider For the m-th triple in, the knowledge-aware attention embedding β m The formula is as follows: β m =α m t m α m = σ(W 2 Leakrelu(W 1 (Leakrelu(W 0 (h m ||r m ||t m ) + b 0 )) + b 1 ) + b 2 ) where α m is the knowledge-aware attention function, which is used to learn the importance of each triple in the neighborhood; Leakrelu is a non-linear activation function to prevent gradient vanishing; σ is the sigmoid activation function, || is the concatenation operation; W 0 , W 1 , W 2 are network parameters, which are updated with backpropagation, b 0 , b 1 , b 2 are biases, h m is the head entity of the m-th triple, r m is the relation of the m-th triple, t m is the tail entity of the m-th triple; S32: For each triple in the neighbor successively apply the knowledge-aware attention mechanism to obtain the knowledge-aware attention embedding where represents the number of triples included in the neighbor ; accumulate the knowledge-aware attention embeddings of the neighbor to obtain the embedding of the neighbor as follows: It is expressed as the following formula: In the formula, m represents the m-th triple currently, and ∑ represents the summation operation; for the neighbor set perform the knowledge-aware attention mechanism operation L times to obtain the knowledge-aware attention embedding where represents the knowledge-aware attention embedding of the user or item at the l-th time.
4. A recommendation method for enhancing the comparison of item neighbor information according to claim 3, characterized in that, In step S5, the enhanced item neighbor feature set and the embedding set of item neighbors are regarded as two views for contrastive learning; the item neighbor embeddings of the same order are regarded as positive pairs, that is and Conversely, they are regarded as negative pairs; among them, the contrastive loss function L infoNCE has the following formula: where τ is the temperature parameter, which regulates the uniform distribution of samples; by introducing additional supervision information through the contrastive loss function, it can encourage the item neighbor embeddings to be uniformly distributed in the latent space so as to better distinguish their differences during prediction.
5. A recommendation method for enhancing the comparison of item neighbor information according to claim 4, characterized in that, the step S6 includes the following steps: S61: The neighbor embedding set encoded by the knowledge-aware attention mechanism is The initial entity sets of users and items contain collaborative information, and their collaborative embedding representations of users and items are: where Embedding is the embedding function, is the collaborative embedding of the user, is the collaborative embedding of the item; Obtain the embeddings \(e\) of the user and item by splicing each neighbor embedding and collaborative embedding, which is expressed as follows: o , which is expressed as follows: where \(o\) is a unified placeholder representing the features of user \(u\) and item \(v\), is the collaborative embedding of the user or item; in addition, considering that item neighbor enhancement is to add weak noise to enhance the neighbor embedding of the item, the enhanced neighbor embedding set of the item is directly used for the recommendation task; the final item representation is as follows: where, e v represents the embedded splicing representation of the item, and e v ' is the embedded splicing representation of the enhanced item, represents the enhanced item co-embedding, and + represents the addition operation; S62: According to the final user representation e u and the item representation The user preference function y(u, v) is defined as: where T represents the transpose operation; S63: In order to combine the recommendation task and contrastive learning, adopt a multi-task training strategy to train the recommendation task and contrastive learning together to optimize the learnable parameters; for the knowledge-aware recommendation task, use the BPR loss function, as follows: Where L BPR is the BPR loss function, is the predicted value of the positive sample, is the predicted value of the negative sample, u represents the user, i represents the positive sample, j represents the negative sample, o′ = {(u, i, j)|(u, i) ∈ o + , (u, j) ∈ o -} is the trainable dataset, and the user-item interaction is denoted as o + , and the non-interaction between the user and the item is denoted as o - , and set the data ratio of o + and o - to be 1:1, and σ is the sigmoid function; S64: Adopt a multi-task learning strategy to combine the BPR loss function L BPR and the contrastive loss function L infoNCE The final loss function L is as follows: where Θ is a parameter set, λ 1 and λ 2 are parameters, is the L2 norm with parameter λ 2 .
Citation Information
Patent Citations
Recommendation method based on heterogeneous propagation collaborative knowledge awareness network
CN111737592A
Course knowledge point recommendation method based on graph convolutional network under knowledge graph perspective
CN115422171A