Knowledge graph recommendation method combined with multi-level interactive contrastive learning

By employing a multi-level interactive comparative learning method that combines local and non-local heterogeneous graphs, the problem of uneven information utilization in traditional knowledge graph recommendation is solved, thereby improving the accuracy of recommendations.

CN115982373BActive Publication Date: 2025-12-19CHINA PING AN PROPERTY INSURANCE CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211288281.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-20
Publication Date
2025-12-19
Estimated Expiration
2042-10-20

AI Technical Summary

Technical Problem

Traditional knowledge graph recommendation methods suffer from insufficient supervision information and uneven information utilization due to sparse user-item interactions, and the graph neural network paradigm fails to fully utilize non-domain information.

Method used

A multi-level interactive contrastive learning method is adopted, which combines local and non-local heterogeneous graphs. Through graph encoding and contrastive learning, user-item interactions and knowledge graph entity relationships are used to carry out information interaction and comparison within and between graphs, and to construct representations of users and items.

Benefits of technology

It enables more comprehensive information utilization, improves the accuracy of knowledge graph recommendations, and enhances the consistency and effectiveness of heterogeneous information utilization by combining local and non-local information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115982373B_ABST
    Figure CN115982373B_ABST
Patent Text Reader

Abstract

The application discloses a kind of knowledge graph recommendation methods combined with multi-level interactive contrast learning, comprising the following steps: 1) obtaining user-item interaction collaborative information and knowledge information of knowledge graph entity relationship;2) different order collaborative information is combined with knowledge information, and constitutes local and non-local heterogeneous graph;3) based on the local and non-local graph of user / item constructed, the information of local and non-local two parts in the same graph is interacted and compared;4) the contrast learning between local graph and non-local graph is carried out, and the knowledge information in non-local graph is extracted using local graph;5) according to the intra-graph and inter-graph interactive contrast learning loss, the knowledge graph recommendation result is obtained by using multi-task model training;6) based on the user and item representation of graph coding and intra-graph and inter-graph level interactive contrast learning, the possibility of user clicking on the item is predicted.The method of the application can improve the accuracy of knowledge graph recommendation.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to data mining technology, and in particular to a knowledge graph recommendation method combining multi-level interactive contrastive learning. BACKGROUND

[0002] Traditional knowledge graph recommendation methods usually learn the representation of users and items in a supervised manner based on the graph neural network paradigm. Due to the sparsity of user-item interactions, traditional knowledge graph recommendation methods often face the following difficulties: 1) the sparsity of user-item interactions brings the problem of insufficient supervision information (i.e. the problem of sparse supervision signal); 2) the combination of sparse user-item interactions and rich knowledge facts further leads to the problem of unbalanced information utilization; 3) the graph neural network paradigm usually only aggregates neighbor information, leading to the problem of insufficient information utilization due to the non-utilization of non-domain information. Therefore, the current knowledge graph recommendation model has great limitations. SUMMARY

[0003] The technical problem solved by the present application is to provide a knowledge graph recommendation method combining multi-level interactive contrastive learning in view of the defects in the prior art.

[0004] The technical solution adopted by the present application to solve its technical problem is: a knowledge graph recommendation method combining multi-level interactive contrastive learning, comprising the following steps:

[0005] 1) obtaining user-item interaction collaborative information and knowledge information of knowledge graph entity relationships;

[0006] 2) combining different levels of collaborative information and knowledge information to form a local and non-local heterogeneous graph;

[0007] 2.1) local graph construction, combining first-order collaborative information and knowledge information to construct a local graph, the first-order collaborative information being items interacted by users or items themselves;

[0008] The specific construction method is as follows:

[0009] 2.1.1) find the initial entity set in the knowledge graph corresponding to the first-order collaborative information;

[0010]

[0011]

[0012] wherein, and respectively represent the initial entity set corresponding to the local graph of the user and the item;

[0013] 2.1.2) Find more related entities by propagation in the knowledge graph through the initial entity set, and construct a heterogeneous user / item local graph;

[0014]

[0015] wherein o represents a placeholder of user u or item v, represents a set of triples obtained by propagation in the local graph;

[0016] 2.2) Construction of a non-local graph;

[0017] The construction of the non-local graph is completed by combining high-order collaborative information and knowledge information; the high-order collaborative information is co-occurring items obtained through item-user-item relationships;

[0018] 2.2.1) Obtain high-order collaborative information of users / items;

[0019]

[0020]

[0021]

[0022] wherein, and respectively represent items included in the high-order collaborative information of items and users, represents a group of users similar to the user;

[0023] 2.2.2) Propagate the high-order collaborative information in the knowledge graph in the same way as step 2.1.2) to obtain more knowledge entities and construct a heterogeneous non-local graph;

[0024]

[0025] 2.3) Perform graph encoding to obtain user and item representations under local and non-local graphs; the graph encoding method is as follows:

[0026] A graph encoding method combining attention mechanism is used to encode different semantic information of different tail entities in different context environments; considering that (h, r, t) is the i-th triple of the l-th layer, the representation of the l-th layer is obtained as follows:

[0027]

[0028] wherein D represents L or N, i.e. local or non-local graph; m is the total number of triples under the layer; r i are the vector representations of the head entity, the tail entity, and the relationship, respectively;

[0029] weights The calculation method is as follows:

[0030]

[0031]

[0032] Wherein, || is a splicing operation, W and b are trainable weight matrix and bias;

[0033] 3) Based on the constructed user / item local and non-local graph, the local and non-local information in the same graph is interacted and compared;

[0034] Take the collaborative part as the anchor point, take the layers for aggregating user and item representation in the same graph as the positive example pair, and take the remaining layers as the negative example pair (the layers farther away in the graph and not used for graph learning aggregation), compare learning, and pull the distance between the positive example pairs and push the distance between the negative example pairs;

[0035]

[0036] Wherein, τ represents the temperature coefficient in softmax; The interactive contrastive loss of the non-local graph of the item; Indicates the vector representation of the kth layer of the user local graph.

[0037] Similarly, the interactive contrastive loss of the non-local graph of the item is obtained

[0038] Then the intra-graph interactive contrastive loss of the item

[0039]

[0040] 4) The local graph and the non-local graph perform inter-graph contrastive learning, and the local graph is used to extract knowledge information in the non-local graph;

[0041] Take the same layer of different graphs as the positive example pair, and take the other layers as the negative example pair, and perform inter-graph comparison:

[0042]

[0043] Then the inter-graph contrastive loss between the local and non-local graphs of the item is obtained in a similar manner, and the total inter-graph interactive contrastive learning loss is obtained;

[0044]

[0045] 5) According to the intra-graph and inter-graph interactive contrastive learning loss, the knowledge graph recommendation result is obtained by using a multi-task model for training;

[0046] The self-supervised learning task is taken as an auxiliary task, a multi-task training strategy is adopted for model optimization, for the knowledge graph recommendation task, and a loss function is defined by cross entropy:

[0047]

[0048] Wherein O={(u,i,j)|(u,i)∈O + ,(u,j)∈O -} is a set containing actual existing interactions O + And non-existing interactions O - ; σ is a nonlinear activation function;

[0049] By combining the BPR loss with the multi-level contrastive learning loss, the final optimization target is obtained:

[0050]

[0051] Wherein, Θ is a model parameter set, α is a parameter for determining the weight of the intra-graph interaction contrastive loss, λ1 and λ2 are parameters for controlling the contrastive loss and L2 regular term;

[0052] 6) Based on the user and item representation of the graph encoding and the intra-graph and inter-graph level interaction contrastive learning, the final representation vector is obtained by splicing and summation, and the inner product is used to predict the possibility of user clicking the item;

[0053]

[0054]

[0055]

[0056] The present application has the following beneficial effects:

[0057] The present application comprehensively considers local and non-local knowledge information, thereby more fully utilizing external knowledge information, and simultaneously proposes intra-graph interaction contrastive learning, realizes consistent and balanced heterogeneous information utilization, proposes inter-graph interaction contrastive learning, realizes effective and sufficient non-local knowledge information utilization, and successfully realizes comprehensive representation learning improvement. BRIEF DESCRIPTION OF DRAWINGS

[0058] The present application will be further described below in combination with the drawings and examples, wherein:

[0059] Figure 1 is a method flowchart of the embodiment of the present application;

[0060] Figure 2is a method flowchart of an embodiment of the present application; DETAILED DESCRIPTION

[0061] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application is further described in detail below in combination with embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.

[0062] As shown in Figure 1 and Figure 2 , a knowledge graph recommendation method combining multi-level interactive contrast learning includes the following steps:

[0063] 1) Obtain the collaborative information (i.e. user-item interaction, click history) and knowledge information (i.e. knowledge graph entities and relationships under the same field) in the data set;

[0064] 2) Combine the collaborative information and knowledge information of different levels to form a local and non-local heterogeneous graph;

[0065] 2.1) Local graph construction, local graph construction is performed by combining the first-order collaborative information and the knowledge information, the first-order collaborative information being the items interacted by the user or the items themselves;

[0066] The specific construction method is as follows:

[0067] 2.1.1) Find the initial entity set in the knowledge graph through the first-order collaborative information;

[0068]

[0069]

[0070] wherein, and respectively represent the initial entity set corresponding to the local graph of the user and the item;

[0071] 2.1.2) Find more related entities through the propagation of the initial entity set in the knowledge graph to construct a heterogeneous user / item local graph;

[0072]

[0073] wherein, o represents a placeholder of the user u or the item v, represents a triple set obtained through propagation in the local graph;

[0074] 2.2) Construction of a non-local graph;

[0075] The construction of the non-local graph is completed by combining high-order collaborative information with knowledge information; the high-order collaborative information is co-occurring items obtained through item-user-item relationships;

[0076] 2.2.1) Obtain high-order collaborative information of users / items;

[0077]

[0078]

[0079]

[0080] wherein, and respectively represent items and users included in the high-order collaborative information of items and users, represent a user group similar to the user;

[0081] 2.2.2) Propagate the high-order collaborative information in the knowledge graph in the same way as step 2.1.2) to obtain more knowledge entities and construct a heterogeneous non-local graph;

[0082]

[0083] 2.3) Perform graph encoding to obtain user and item representations under local and non-local graphs; the graph encoding method is as follows:

[0084] A graph encoding method combining attention mechanism is used to encode different semantic information of different tail entities in different context environments; considering that (h, r, t) is the i-th triple of the l-th layer, the representation of the l-th layer is obtained as follows:

[0085]

[0086] wherein, D represents L or N, i.e. local or non-local graph; m is the total number of triples under the layer; r i are vector representations of the head entity, the tail entity and the relationship, respectively;

[0087] The calculation method of the weight is as follows:

[0088]

[0089]

[0090] wherein, || is a splicing operation, and W and b are trainable weight matrix and bias;

[0091] 3) Based on the constructed user / item local and non-local graphs, the local and non-local information in the same graph is interacted and compared;

[0092] With the collaborative part as the anchor point, the layers used to aggregate user and item representations in the same graph are taken as positive pairs, and the remaining layers are taken as negative pairs (layers farther away in the graph that are not used for graph learning aggregation), and contrastive learning is performed to pull the distance between positive pairs and push the distance between negative pairs;

[0093]

[0094]

[0095] where τ represents the temperature coefficient in softmax; is the interactive contrastive loss of the non-local graph of the item; represents the vector representation of the kth layer of the user local graph, represents the vector representation of the kth layer of the user non-local graph.

[0096] Similarly, the interactive contrastive loss of the non-local graph of the item is obtained

[0097] The intra-graph interactive contrastive loss of the item is

[0098]

[0099] 4) The local graph and the non-local graph perform inter-graph contrastive learning, and the local graph is used to extract knowledge information in the non-local graph;

[0100] The same layer of different graphs is taken as a positive pair, and other layers are taken as negative pairs, and inter-graph contrastive learning is performed:

[0101]

[0102] Then, the inter-graph contrastive loss between the local and non-local graphs of the item is obtained in a similar manner, and the total inter-graph interactive contrastive learning loss is obtained;

[0103]

[0104] 5) According to the intra-graph and inter-graph interactive contrastive learning losses, a multi-task model is used to train and obtain a knowledge graph recommendation result;

[0105] The model includes a supervised and self-supervised task, so we take the self-supervised learning task as an auxiliary task and use a multi-task training strategy to optimize the model. For the knowledge graph recommendation task, the loss function is defined by cross-entropy:

[0106]

[0107] where O = {(u, i, j) | (u, i) element-of O + ,(u,j) element-of O -} is the set containing actual existing interactions O + and non-existing interactions O - ; sigma is a nonlinear activation function;

[0108] By combining the BPR loss with the multi-level contrastive learning loss, the final optimization objective is obtained:

[0109]

[0110] where Theta is the model parameter set, alpha is the parameter determining the weight of the intra-graph interaction contrastive loss, and lambda1 and lambda2 are the parameters controlling the contrastive loss and L2 regularization term;

[0111] 6) Based on the user and item representation based on graph encoding and intra-graph and inter-graph level interactive contrastive learning, the final representation vector is obtained by splicing and summation, and the inner product is used to predict the possibility of user clicking the item;

[0112]

[0113]

[0114]

[0115] Experiments show that compared with existing mainstream methods, the knowledge graph recommendation method of the present application achieves better results. The experiment uses three benchmark short sequence recommendation data sets for evaluation, namely the MovieLens-1M data set, the Book-Crossing data set and the Last.FM data set. The detailed information of the data sets is shown in Table 1.

[0116] Table 1 Corpus information

[0117]

[0118] The experimental part aims to evaluate the effectiveness of the knowledge graph recommendation model proposed in the present application on different data sets. Specifically, we take the AUC and F1 results of the model on the three data sets as the evaluation indicators of the model, and the experimental comparison results are given in Table 2.

[0119] Table 2 Comparison results of knowledge graph recommendation experiments

[0120]

[0121] It is worth noting that from the above table, it can be observed that the method proposed in the present application is always superior to all these benchmark models in different indicators. Because these models mostly only use GNN to aggregate local neighbor information on the graph, while relying on sparse user-item interactions as a supervised signal for supervised learning. The present application considers non-local graph information and uses self-supervised local and non-local graph information, models from intra-graph and inter-graph levels respectively through the proposed interactive contrastive learning mechanism, strengthens the use of local and non-local information, and thus improves the accuracy of knowledge graph recommendation.

[0122] It should be understood that, for those skilled in the art, improvements or changes can be made according to the above description, and all these improvements and changes shall belong to the protection scope of the appended claims of the present application.

Claims

1. A knowledge graph recommendation method combining multi-level interactive contrastive learning, characterized in that, The method comprises the following steps: 1) obtaining user-item interaction collaborative information and knowledge information of knowledge graph entity relationship; 2) combining different levels of collaborative information and knowledge information to form local and non-local heterogeneous graphs; 2.1) local graph construction, which is constructed by combining first-order collaborative information and knowledge information, the first-order collaborative information being items interacted by users or items themselves; 2.2) construction of a non-local graph; The construction of the non-local graph is completed by combining high-order collaborative information and knowledge information; the high-order collaborative information being co-occurring items obtained through item-user-item relationships; 2.3) graph encoding is performed to obtain user and item representations under local and non-local graphs; 3) based on the constructed user / item local and non-local graphs, the local and non-local information in the same graph is interacted and compared; 4) based on the constructed local and non-local graphs, inter-graph contrast learning is performed, and the knowledge information in the non-local graph is extracted using the local graph; 5) according to the intra-graph and inter-graph interactive contrast learning loss, a multi-task model is trained to obtain a knowledge graph recommendation result; 6) based on the user and item representations obtained by the intra-graph and inter-graph level interactive contrast learning, the possibility of user clicking on an item is predicted.

2. The knowledge graph recommendation method combining multi-level interactive contrast learning according to claim 1, wherein the specific method of local graph construction in step 2) is as follows: 2.1.1) find the initial entity set in the knowledge graph through the first-order collaborative information; wherein and respectively represent the initial entity sets corresponding to the local graph of users and items; 2.1.2) find more related entities through the propagation of the initial entity set in the knowledge graph to construct a heterogeneous user / item local graph; where o denotes a placeholder for either a user u or an item v, denotes the set of triples obtained by propagation in the local graph.

3. The knowledge graph recommendation method of claim 2, wherein, The specific method of non-local graph construction in step 2.2) is as follows: 2.2.1) obtain high-order collaborative information of users / items; wherein, and respectively represent an item and a user group similar to the user. respectively represent an item and a user group similar to the user. 2.2.2) propagate the high-order collaborative information in the knowledge graph to obtain more knowledge entities and construct a heterogeneous non-local graph; 4. The knowledge graph recommendation method of claim 1, wherein, In step 2.3), the graph encoding method is as follows: A graph encoding method combining an attention mechanism is used to encode different semantic information of different tail entities in different context environments; considering that (h, r, t) is the i-th triple of the l-th layer, the representation of the l-th layer is obtained as follows: where D denotes L or N, i.e. local or non-local graph; m is the total number of triplets under this layer; r i are the vector representations of head entity, tail entity, and relation, respectively; Weight is calculated as follows: Where || is a concatenation operation, W and b are trainable weight matrices and biases.

5. The knowledge graph recommendation method of claim 1, wherein, In step 3), the local and non-local information in the same graph is interacted and compared; Specifically: Take the collaborative part as an anchor point, take the layers used to aggregate user and item representations in the same graph as positive pairs, and take the other layers as negative pairs, perform contrast learning, and narrow the distance between positive pairs and widen the distance between negative pairs; wherein, denotes the temperature coefficient in softmax; is the user's non-local graph interactive contrastive loss; denotes the vector representation of the user's local graph at the kth layer, denotes the vector representation of the user's non-local graph at the kth layer; Non-local map interactive contrastive loss for obtaining an item Intra-graph level interactive contrastive loss for an item 6. The knowledge graph recommendation method of claim 5, wherein, In step 4), based on the constructed local and non-local graphs, inter-graph contrast learning is performed, and the knowledge information in the non-local graph is extracted using the local graph; specifically: Take the same layers of different graphs as positive pairs and the other layers as negative pairs to perform inter-graph contrast: Then obtain the contrast loss between the item local and non-local graphs, and obtain the total inter-graph interactive contrast learning loss; 7. The method of claim 6, wherein the method further comprises: In step 5), the loss function of the model is as follows: The self-supervised learning task is taken as an auxiliary task, and a multi-task training strategy is adopted for model optimization. where O = {(u, i, j) | (u, i) G O + , (u, j) G O -} is the set containing actual existing interactions O + and non-existing interactions O - ; σ is a non-linear activation function; The loss function is defined by cross-entropy for the knowledge graph recommendation task. The final optimization target is obtained by combining the BPR loss and the multi-level contrastive learning loss. 8.The knowledge graph recommendation method incorporating multi-level interactive contrastive learning according to claim 1, characterized in that, Wherein, Θ is the model parameter set, α is the parameter for determining the weight of the intra-graph interactive contrastive loss, and λ1 and λ2 are the parameters for controlling the contrastive loss and the L2 regular term. In step 6), based on the user and item representations obtained through graph encoding and intra-graph and inter-graph interactive contrastive learning, the final representation vector is obtained through splicing and summation, and the inner product is used to predict the possibility of user clicking on the item.