Knowledge perception recommendation method and device, equipment and storage medium
By constructing and collaboratively supervising users and projects, the traditional recommendation method solves the problems of sparse and cold start problems and the generation of knowledge graph noise, achieving more accurate and personalized recommendation effects.
Patent Information
- Application Number
- CN202411512127.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-02-18
AI Technical Summary
Traditional recommendation methods have sparse and cold start problems when processing massive Internet data, and the unrelated edges in the knowledge graph lead to noise generation, affecting the accuracy of knowledge-aware recommendations.
By obtaining the interactive information and knowledge graph of users and projects, we build preference views, feature views and joint views, and use the view building block, preference view encoder, feature view encoder, joint view encoder and prediction module for collaborative supervision to generate users Match scores with entities in the knowledge graph for personalized recommendations.
Effectively prevent the introduction of noise information, improve the accuracy of recommendations, enhance the ability to provide users with personalized recommendations, obtain global structural information, and improve the effectiveness of the recommendation system.
Smart Images

Figure CN119474532A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data mining technology, and in particular to a knowledge-aware recommendation method, device, equipment and storage medium. Background Art
[0002] As an important part of Internet data mining system, recommendation can effectively help users obtain effective information from massive Internet data, thereby improving user experience. However, due to the problems of sparsity and cold start in traditional recommendation methods, knowledge graph as a static database can be used to enhance product representation and recommendation effect.
[0003] Knowledge-aware recommendation aims to obtain rich auxiliary information of products from the knowledge graph to learn user and product representation. However, the knowledge graph itself has a large number of irrelevant edges, which aggravates the generation of noise and poses a challenge to the accuracy of knowledge-aware recommendation. Therefore, the current recommendation methods have high distortion and it is difficult to achieve satisfactory recommendation results. Summary of the invention
[0004] In view of this, the purpose of this application is to provide a knowledge-aware recommendation method, device, equipment and storage medium, which can enhance the ability to provide personalized recommendations to users, effectively prevent the introduction of noise information, and improve the accuracy of recommendations. The specific technical solution is as follows:
[0005] In a first aspect, the present application provides a knowledge-aware recommendation method, the method comprising:
[0006] Obtaining interaction information between users and projects and a knowledge graph corresponding to the projects;
[0007] Inputting the interaction information and the knowledge graph into a knowledge-aware recommendation model to obtain a matching score between the user and an entity in the knowledge graph, wherein the matching score represents an interaction probability between the user and the entity, wherein the knowledge-aware recommendation model comprises a view construction module, a preference view encoder, a feature view encoder, a joint view encoder, and a prediction module, wherein the view construction module is used to construct a preference view, a feature view, and a joint view according to the interaction information and the knowledge graph;
[0008] Based on the matching score, recommendations are made to the user.
[0009] In a possible implementation, inputting the interaction information and the knowledge graph into a knowledge-aware recommendation model to obtain a matching score between the user and an entity in the knowledge graph includes:
[0010] Based on the view construction module, a view is constructed on the interaction information and the knowledge graph to obtain a preference view, a feature view and a joint view;
[0011] encoding the preference view based on the preference view encoder to obtain a user preference representation;
[0012] encoding the feature view based on the feature view encoder to obtain an item feature representation;
[0013] encoding the joint view based on the joint view encoder to obtain a user joint representation and an item joint representation;
[0014] Based on the prediction module, probability prediction is performed on the user preference representation, the item feature representation, the user joint representation and the item joint representation to obtain the matching score.
[0015] In a possible implementation manner, encoding the preference view based on the preference view encoder to obtain a user preference representation includes:
[0016] Based on the preference view encoder, the preference view is subjected to preference learning by utilizing an attention mechanism to obtain the user preference representation.
[0017] In a possible implementation, the performing probability prediction on the user preference representation, the item feature representation, the user joint representation, and the item joint representation based on the prediction module to obtain the matching score includes:
[0018] Based on the prediction module, comparative learning is performed on the user preference representation, the item feature representation, the user joint representation, and the item joint representation to obtain a user embedding representation and an item embedding representation;
[0019] The user embedding representation and the item embedding representation are integrated based on the prediction module to obtain the matching score.
[0020] In a possible implementation, the integrating the user embedding representation and the item embedding representation based on the prediction module to obtain the matching score includes:
[0021] An inner product calculation is performed on the user embedding representation and the item embedding representation based on the prediction module to obtain the matching score.
[0022] In a second aspect, the present application further provides a knowledge-aware recommendation device, the device comprising:
[0023] An acquisition module, used to acquire interaction information between users and projects and a knowledge graph corresponding to the projects;
[0024] An input module, used to input the interaction information and the knowledge graph into a knowledge-aware recommendation model to obtain a matching score between the user and an entity in the knowledge graph, wherein the matching score represents an interaction probability between the user and the entity. The knowledge-aware recommendation model includes a view construction module, a preference view encoder, a feature view encoder, a joint view encoder, and a prediction module. The view construction module is used to construct a preference view, a feature view, and a joint view according to the interaction information and the knowledge graph.
[0025] A recommendation module is used to make recommendations to the user based on the matching score.
[0026] In a possible implementation, the input module includes:
[0027] A view construction unit, configured to construct a view of the interaction information and the knowledge graph based on the view construction module to obtain a preference view, a feature view, and a joint view;
[0028] a preference encoding unit, configured to encode the preference view based on the preference view encoder to obtain a user preference representation;
[0029] a feature encoding unit, configured to encode the feature view based on the feature view encoder to obtain an item feature representation;
[0030] a joint encoding unit, configured to encode the joint view based on the joint view encoder to obtain a user joint representation and an item joint representation;
[0031] A prediction unit is used to perform probability prediction on the user preference representation, the item feature representation, the user joint representation and the item joint representation based on the prediction module to obtain the matching score.
[0032] In a possible implementation manner, the prediction unit is specifically configured to:
[0033] Based on the prediction module, comparative learning is performed on the user preference representation, the item feature representation, the user joint representation, and the item joint representation to obtain a user embedding representation and an item embedding representation;
[0034] The user embedding representation and the item embedding representation are integrated based on the prediction module to obtain the matching score.
[0035] In a third aspect, the present application further provides a computer device, including: a memory and a processor;
[0036] Wherein, the memory is used to store computer programs;
[0037] The processor is used to execute the computer program in the memory to implement the method described in the first aspect or any one of the first aspects.
[0038] In a fourth aspect, the present application further provides a computer-readable storage medium storing instructions, which, when executed on a computer, enables the computer to execute the method described in the first aspect or any one of the first aspects.
[0039] In this application, the interaction information between the user and the project and the knowledge graph corresponding to the project are obtained; the interaction information and the knowledge graph are input into the knowledge-aware recommendation model to obtain the matching score between the user and the entity in the knowledge graph. The matching score represents the probability of interaction between the user and the entity. The knowledge-aware recommendation model includes a view construction module, a preference view encoder, a feature view encoder, a joint view encoder, and a prediction module. The view construction module is used to construct a preference view, a feature view, and a joint view according to the interaction information and the knowledge graph; based on the matching score, recommendations are made to users. This application can enhance the learning of project representations by collaboratively supervising the three views through the knowledge-aware recommendation model. Starting from the projects that the user directly interacts with, it can enhance the ability to provide personalized recommendations to users and effectively prevent the introduction of noise information. Constructing a joint view can also help obtain global structural information and improve the accuracy of recommendations. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0041] Figure 1 A flow chart of a knowledge-aware recommendation method provided in an embodiment of the present application is shown;
[0042] Figure 2 A schematic diagram showing a preference view, a feature view and a joint view provided in an embodiment of the present application is shown;
[0043] Figure 3 A schematic diagram of a model framework of a knowledge-aware recommendation model provided in an embodiment of the present application is shown;
[0044] Figure 4 A flow chart of obtaining a matching score provided in an embodiment of the present application is shown;
[0045] Figure 5 A schematic diagram of the structure of a knowledge-aware recommendation device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0047] Faced with the massive amount of data and information in the Internet era, recommendation systems have become the key to providing users with items of interest. In previous application scenarios, collaborative filtering (CF) has been widely used to filter information to improve the accuracy and effectiveness of recommendations. However, its reliance on historical interaction data has led to data sparsity and cold start problems. In addition, collaborative filtering methods are not robust enough when faced with noise in interaction networks. A solution that has proven to be quite effective and widely adopted is to introduce side information into the recommendation system. Among various side information, the knowledge graph (KG) stands out as a directed information heterogeneous network containing a large amount of project background information and relationships between projects, which is used to improve recommendation effects. The knowledge graph is integrated into the recommendation system to obtain high-quality user and project representations.
[0048] Knowledge graph-aware recommendation, or knowledge-aware recommendation, aims to provide relevant knowledge and information recommendations based on the interests and needs of users. By analyzing the user's historical behavior, preferences, and interests, a user's interest model is established to understand their preference for different topics and fields. This can help the recommendation system better understand the user's interests and provide personalized recommendations. For example, in e-commerce applications, the recommendation system can build a user's interest model based on the user's purchase history and browsing behavior, and recommend products that match their interests. The diversity and personalization of recommendation results avoid overly concentrated or single recommendations to meet the different needs and interests of users. This can help the system provide more comprehensive and satisfactory recommendations. For example, in social media platforms, the recommendation system can recommend diverse content, including different types of posts, articles, and videos, based on the user's interests and social circles.
[0049] So far, the industry has been conducting research on the topic of knowledge-aware recommendation for quite some time, attempting to use external knowledge in knowledge graphs to learn better user and item representations. Existing knowledge-aware recommendation can be roughly divided into three categories: embedding-based recommendation, path-based recommendation, and propagation-based recommendation.
[0050] Embedding-based recommendation methods generally use different knowledge graph embedding models to pre-train entity embeddings, which are then used to improve the representation of items. However, these methods handle the item-entity relationship independently and cannot extract enough knowledge information from the knowledge graph.
[0051] Path-based recommendation methods hope to capture remote knowledge graph information through paths to enrich collaborative filtering. This method can explore deeper relationships, but it also faces the problems of high computational complexity, difficult path optimization, and extreme dependence on expert knowledge.
[0052] Most of the recommendation methods based on propagation use Graph Neural Network (GNN) to explore high-order correlations to improve the accuracy of recommendations. The typical GNN paradigm usually performs recursive message propagation on a unified graph consisting of a user-item bipartite graph and a knowledge graph. However, this method is performed under supervision, and it is not easy to obtain labels for some data. In real recommendation applications, labels are usually scarce.
[0053] In general, the recommendation schemes proposed above need to be trained in a supervised learning manner, and their supervisory signals only come from sparse historical interactions.
[0054] Contrastive learning has a powerful ability to learn embedding from unlabeled sample data by maximizing the distance between negative samples and minimizing the distance between positive samples. Therefore, the embodiment of the present application designs a knowledge-aware recommendation model in the contrastive learning paradigm to make full use of limited user-item interaction information and additional KG knowledge for recommendation.
[0055] See also Figure 1 , shows a flow chart of a knowledge-aware recommendation method provided in an embodiment of the present application, and the embodiment of the present application at least includes the following steps:
[0056] S11, obtaining the interaction information between the user and the project and the knowledge graph corresponding to the project.
[0057] When recommendations are needed for users, the interaction information between users and items and the knowledge graph corresponding to the items are collected. Items can be one or more items that users have interacted with. Knowledge graphs can be used to describe the relationship between items and entities. In the knowledge graph corresponding to items, items can be used as special entities.
[0058] S12, input the interaction information and knowledge graph into the knowledge-aware recommendation model to obtain the matching score between the user and the entity in the knowledge graph.
[0059] The knowledge-aware recommendation model may include a view construction module, a preference view encoder, a feature view encoder, a joint view encoder, and a prediction module. The embodiment of the present application may pre-train the knowledge-aware recommendation model so that the knowledge-aware recommendation model has the ability of probability prediction. Among them, the view construction module is used to construct the preference view, feature view, and joint view according to the interaction information and the knowledge graph, the preference view encoder is used to encode the preference view, the feature view encoder is used to encode the feature view, the joint view encoder is used to encode the joint view, and the prediction model is used to combine the outputs of each encoder for probability prediction. The matching score represents the probability of interaction between the user and the entity.
[0060] The preference view is a user-item interaction graph, which is a triple structure {U, I, Y}, which includes the user set U, the item set I, and the interaction relationship Y between users and items. The interaction relationship can be the user's rating, click, purchase and other behaviors on a certain item.
[0061] The feature view is a project-entity interaction graph, which is also the knowledge graph corresponding to the project collected in the embodiment of the present application. It is a triple structure {V, R, E}, which includes an entity set V, a relationship set R, and an edge set E between entities. An element on the edge set is a triple, which includes a head entity, a relationship, and a tail entity.
[0062] The joint view is a user-item-entity interaction graph, which is obtained by combining the user-item interaction graph and the item-entity interaction graph. The relationship between the user-item interaction graph, the item-entity interaction graph and the joint view is as follows: Figure 2 shown.
[0063] S13, recommending users based on the matching scores.
[0064] In the embodiment of the present application, entities can be sorted according to the matching scores, for example, entities are sorted in descending order of matching scores, and entities at the front of the specified digits after sorting are recommended objects. After the recommended object is determined, the recommended object is displayed to the user.
[0065] In an embodiment of the present application, the interaction information between the user and the project and the knowledge graph corresponding to the project are obtained; the interaction information and the knowledge graph are input into the knowledge-aware recommendation model to obtain the matching score between the user and the entity in the knowledge graph, and the matching score represents the probability of interaction between the user and the entity. The knowledge-aware recommendation model includes a view construction module, a preference view encoder, a feature view encoder, a joint view encoder, and a prediction module. The view construction module is used to construct a preference view, a feature view, and a joint view according to the interaction information and the knowledge graph; based on the matching score, recommendations are made to the user. The embodiment of the present application can enhance the learning of project representations by collaboratively supervising the three views through the knowledge-aware recommendation model. Starting from the projects that the user directly interacts with, it can enhance the ability to provide personalized recommendations to users and effectively prevent the introduction of noise information. Constructing a joint view can also help obtain global structural information and improve the accuracy of recommendations.
[0066] Next, combine Figure 3 The knowledge-aware recommendation model shown in the figure introduces the process of obtaining a matching score. Figure 4 A flowchart of obtaining a matching score provided by an embodiment of the present application is shown. The embodiment of the present application inputs the interactive information and the knowledge graph into the knowledge-aware recommendation model to obtain the matching score between the user and the entity in the knowledge graph, which includes at least the following steps:
[0067] S41, construct views of the interactive information and the knowledge graph based on the view construction module to obtain preference views, feature views and joint views.
[0068] The view construction module of the embodiment of the present application can obtain all project nodes that the user u has interacted with on the preferred view to form a project set N u , you can also u Randomly sample multiple interactive project nodes to form a project sampling set C u Because the interactive neighbors of the sampled project nodes and entity nodes can obtain the feature information of the project nodes, the embodiment of the present application can use the project nodes as the central nodes for sampling and collect the first-order and higher-order interactive information. In order to retain more KG information, the following relationship can be retained for the sampled nodes in the project sampling, which is specifically expressed as:
[0069]
[0070] in, Represents the x-th hop interactive neighbor entity set of the project node, Represents the set of entity nodes that directly interact with the project node, r represents the relationship between the head node and the tail node, t represents the tail node, h represents the head node, item represents the set of all project nodes, t' represents the tail node that has interacted in the previous hop, r' represents the relationship in the previous hop, i represents the project node, hop represents the number of hops from the entity node to the project node, that is, the path length required to connect the project node and the entity node, and x is a positive integer.
[0071] The view construction module can randomly sample the x-th hop interactive neighbor entity set. The number of samples of each hop interactive neighbor entity set can be pre-set to avoid inconsistent numbers of nodes sampled by different projects.
[0072]
[0073]
[0074] in, Represents the x-th hop interactive neighbor entity sampling set of the project node, where X is the maximum value of x and the value of X can be set according to the actual situation.
[0075] The view construction module can collect the interactive neighbor entity samples sampled at different hops and form a sampling sequence. The sampling sequence is expressed as:
[0076] P i ={i,G i}={i, (r1, t1), (r2, t2),...}.
[0077] In the embodiment of the present application, the rotation operator can be used to model the relationship r, and finally a neighbor sequence is obtained. The neighbor sequence is expressed as:
[0078] Where ⊙ represents element-wise multiplication. Element-wise multiplication, also known as dot multiplication, is specifically, given two arrays or matrices A and B of the same size, each element C[y] in the result C of element-wise multiplication is the product of the element A[y] at the corresponding position in A and the element B[y] at the corresponding position in B. That is, for all y, C[y]=A[y]×B[y].
[0079] S42, encoding the preference view based on the preference view encoder to obtain a user preference representation.
[0080] By directly considering the interacting items, the impact of different items on user preferences can be distinguished. To achieve this, the embodiment of the present application uses the GATv2 layer (GraphAttentionNetwork v2 Layer) as a preference view encoder to learn user preferences. Unlike the static attention mechanism used in the GraphAttention Network (GAT), the GAT v2 layer includes a dynamic attention mechanism, allowing more flexible learning of user preferences.
[0081] The interaction data node pair (u, i) is obtained from the preference view, and the preference level of the user node u for the item node i can be learned through the attention mechanism. That is, the embodiment of the present application uses the attention mechanism to perform preference learning on the preference view based on the preference view encoder, thereby obtaining the user preference representation.
[0082] Attention score ui The calculation is as follows:
[0083] e ui =Attention(h u ,h i ,a);
[0084] Among them, h u is the initial embedding representation of user u, h i represents the initial embedding representation of item i, a represents a learnable parameter, and Attention is the attention function.
[0085] The attention score e ui Normalized, the calculation is as follows:
[0086]
[0087] Among them, α ui represents the attention score, that is, the normalized attention score, softmax is the activation function, T represents transposition, F represents the LeakyReLU activation function, j represents any project node in Cu, and h j represents the initial embedding representation of item j.
[0088] The present application embodiment also provides the difference between GAT and GATv2 in calculating the attention score:
[0089] GAT_v2=a T F(W[h u ||h i ]);
[0090] GAT=F(a T ·[Wh u ||Wh i]);
[0091] Where W represents the learnable matrix.
[0092] Based on the attention score, the information of each item can be aggregated to form the user preference representation of user u The calculation is as follows:
[0093]
[0094] S43, encode the feature view based on the feature view encoder to obtain the item feature representation.
[0095] The feature view encoder is actually a Transformer encoder, which can include two parts: Multi-head self-attention (MSA) and Feedforward Neural Network (FFN). The embodiment of the present application follows the implementation of the vanilla Transformer encoder, and the FFN consists of two linear layers with a sigmoid nonlinear function.
[0096] In this embodiment of the present application, the neighbor sequence can be Input the feature view encoder to obtain the item feature representation, which is calculated as follows:
[0097]
[0098] Where l=1,…,L represents the lth layer of the Transformer encoder, LN represents layer normalization, represents the embedding representation sequence obtained after the Transformer encoder l-1 layer, represents the item feature representation of item i, represents the final neighbor sequence obtained after the L-layer Transformer encoder, Represents the first representation in the final neighbor sequence.
[0099] S44, encoding the joint view based on the joint view encoder to obtain a user joint representation and an item joint representation.
[0100] In order to encode the joint view, the embodiment of the present application uses a path-aware GNN as a joint view encoder, while maintaining the path information, it aggregates the adjacent information X times, that is, user-interaction-item-relationship-entity to transmit information.
[0101] The xth information propagation is expressed as follows:
[0102]
[0103] in, represents the user propagated embedding representation that memorizes the relational signal and entity embedding signal propagated from x-hop neighbors, represents the item propagation embedding representation that memorizes the relation signal and entity embedding signal propagated from x-hop neighbors, N i represents the set of entity nodes that interact with item node i, β(i,r,t) represents the importance of different tail nodes of the same head node to the head node, and h r The initial embedding representation representing the relationship between the head node and the tail node, h t Represents the initial embedding representation of the tail node.
[0104] For each relation and entity, the attention weight is:
[0105]
[0106] Among them, || represents the concatenation operation.
[0107] The embodiment of the present application can add up all the information transmission representations to obtain the final global embedding representation:
[0108]
[0109] in, represents the user joint representation, The project jointly stated that
[0110] S45, based on the prediction module, probability prediction is performed on the user preference representation, the item feature representation, the user joint representation and the item joint representation to obtain a matching score.
[0111] The embodiment of the present application proposes a cross-view contrast learning mechanism to collaboratively supervise the preference view, feature view and joint view, that is, to compare the preference view and feature view with the joint view respectively to capture the preference information and feature information.
[0112] Specifically, the embodiment of the present application performs comparative learning on user preference representation, project feature representation, user joint representation and project joint representation based on the prediction module to obtain user embedding representation and project embedding representation, and then integrates the user embedding representation and the project embedding representation to obtain a matching score.
[0113] The user embedding representation and item embedding representation are as follows:
[0114]
[0115] After obtaining the user embedding representation and the item embedding representation, the matching score can be obtained by calculating the inner product of the user embedding representation and the item embedding representation.
[0116]
[0117] During the training process of the knowledge-aware recommendation model, the embodiments of the present application can define positive samples and negative samples. For any node in one view, the same node embedding learned by another view forms a positive sample, and the node embeddings other than it are naturally regarded as negative samples.
[0118] When positive and negative samples are defined, the preference contrast loss L pre as follows:
[0119]
[0120] Among them, s(·) is the cosine similarity calculation, τ is the temperature parameter, and m represents other users except user u, which is used as negative samples here. represents the preference representation of user m obtained from the preference view encoder, Denote the joint representation of user m obtained from the joint view encoder.
[0121] Feature contrast loss L kg as follows:
[0122]
[0123] Where n represents N u The other items except item i are used as negative samples. represents the feature representation of item n obtained from the feature view encoder, Denote the joint representation of item n obtained from the joint view encoder.
[0124] In order to provide better personalized recommendations, the embodiment of the present application uses BPR (Bayesian Personalized Ranking) loss in the training process of the knowledge-aware recommendation model, which can encourage the prediction scores of the user's historical items to be higher than those of unobserved items:
[0125]
[0126] Among them, L BPR represents the BPR loss, O = {(u,i,j)|(u,i)∈O + ,(u,j)∈O -} represents the training data set, O + represents a positive sample, O -represents negative samples, and σ represents the activation function.
[0127] The final target loss function is:
[0128]
[0129] Among them, γ represents the temperature coefficient of preference contrast loss, δ represents the temperature coefficient of feature contrast loss, and λ represents the temperature coefficient of L2 regularization loss. is the L2 regularization loss. Setting the L2 regularization term can prevent the model from overfitting.
[0130] The embodiment of the present application can use the Adam optimizer to optimize the parameters of the knowledge-aware recommendation model.
[0131] The embodiment of the present application designs three different views: preference view, feature view and joint view, which respectively contain information on the user-item interaction graph, knowledge graph and global graph, which can help strengthen the representation learning of nodes. Extracting preference representations from projects with which users directly interact can enhance the system's ability to provide personalized recommendations to users and effectively prevent the introduction of noise information. Using transformers in feature views can help project nodes interact directly with high-order neighbors, which enables project nodes to better acquire long-range dependencies.
[0132] Next, a knowledge-aware recommendation device provided in an embodiment of the present application is introduced. The knowledge-aware recommendation device introduced below and the knowledge-aware recommendation method introduced above can refer to each other.
[0133] See also Figure 5 , showing a schematic diagram of the structure of a knowledge-aware recommendation device provided in an embodiment of the present application, the device comprising:
[0134] An acquisition module 501 is used to acquire interaction information between a user and a project and a knowledge graph corresponding to the project;
[0135] An input module 502 is used to input the interaction information and the knowledge graph into a knowledge-aware recommendation model to obtain a matching score between the user and an entity in the knowledge graph, wherein the matching score represents an interaction probability between the user and the entity. The knowledge-aware recommendation model includes a view construction module, a preference view encoder, a feature view encoder, a joint view encoder, and a prediction module. The view construction module is used to construct a preference view, a feature view, and a joint view according to the interaction information and the knowledge graph.
[0136] The recommendation module 503 is used to make recommendations to the user based on the matching score.
[0137] In the embodiment of the present application, the input module 502 includes:
[0138] A view construction unit, configured to construct a view of the interaction information and the knowledge graph based on the view construction module to obtain a preference view, a feature view, and a joint view;
[0139] a preference encoding unit, configured to encode the preference view based on the preference view encoder to obtain a user preference representation;
[0140] a feature encoding unit, configured to encode the feature view based on the feature view encoder to obtain an item feature representation;
[0141] a joint encoding unit, configured to encode the joint view based on the joint view encoder to obtain a user joint representation and an item joint representation;
[0142] A prediction unit is used to perform probability prediction on the user preference representation, the item feature representation, the user joint representation and the item joint representation based on the prediction module to obtain the matching score.
[0143] In the embodiment of the present application, the preference encoding unit is specifically used to:
[0144] Based on the preference view encoder, the preference view is subjected to preference learning by utilizing an attention mechanism to obtain the user preference representation.
[0145] In the embodiment of the present application, the prediction unit is specifically used for:
[0146] Based on the prediction module, comparative learning is performed on the user preference representation, the item feature representation, the user joint representation, and the item joint representation to obtain a user embedding representation and an item embedding representation;
[0147] The user embedding representation and the item embedding representation are integrated based on the prediction module to obtain the matching score.
[0148] In the embodiment of the present application, when the prediction unit integrates the user embedding representation and the item embedding representation based on the prediction module to obtain the matching score, it is specifically used to:
[0149] An inner product calculation is performed on the user embedding representation and the item embedding representation based on the prediction module to obtain the matching score.
[0150] The embodiment of the present application also provides a computer device, including: a memory and a processor;
[0151] Wherein, the memory is used to store computer programs;
[0152] The processor is used to execute the computer program in the memory to implement the method described in the above method embodiment.
[0153] The embodiment of the present application also provides a computer-readable storage medium storing instructions, which, when executed on a computer, enables the computer to execute the method described in the above method embodiment.
[0154] In an embodiment of the present application, an acquisition module acquires the interaction information between the user and the project and the knowledge graph corresponding to the project; an input module inputs the interaction information and the knowledge graph into a knowledge-aware recommendation model to obtain a matching score between the user and the entity in the knowledge graph, and the matching score represents the probability of interaction between the user and the entity. The knowledge-aware recommendation model includes a view construction module, a preference view encoder, a feature view encoder, a joint view encoder, and a prediction module. The view construction module is used to construct a preference view, a feature view, and a joint view according to the interaction information and the knowledge graph; the recommendation module recommends to the user based on the matching score. The embodiment of the present application can enhance the learning of project representations by collaboratively supervising the three views through the knowledge-aware recommendation model. Starting from the projects that the user directly interacts with, it can enhance the ability to provide personalized recommendations to users and effectively prevent the introduction of noise information. Constructing a joint view can also help obtain global structural information and improve the accuracy of recommendations.
[0155] It should be noted that the same or similar parts between the various embodiments can be referred to each other. As for the device embodiment and the system embodiment, since they are 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.
[0156] For the above-mentioned embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0157] Finally, it should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of more restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0158] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
[0159] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A knowledge-aware recommendation method, characterized in that: The method comprises: Obtaining interaction information between users and projects and a knowledge graph corresponding to the projects; Inputting the interaction information and the knowledge graph into a knowledge-aware recommendation model to obtain a matching score between the user and an entity in the knowledge graph, wherein the matching score represents an interaction probability between the user and the entity, wherein the knowledge-aware recommendation model comprises a view construction module, a preference view encoder, a feature view encoder, a joint view encoder, and a prediction module, wherein the view construction module is used to construct a preference view, a feature view, and a joint view according to the interaction information and the knowledge graph; Based on the matching score, recommendations are made to the user.
2. The method according to claim 1, characterized in that The step of inputting the interaction information and the knowledge graph into a knowledge-aware recommendation model to obtain a matching score between the user and an entity in the knowledge graph includes: Based on the view construction module, a view is constructed on the interaction information and the knowledge graph to obtain a preference view, a feature view and a joint view; encoding the preference view based on the preference view encoder to obtain a user preference representation; encoding the feature view based on the feature view encoder to obtain an item feature representation; encoding the joint view based on the joint view encoder to obtain a user joint representation and an item joint representation; Based on the prediction module, probability prediction is performed on the user preference representation, the item feature representation, the user joint representation and the item joint representation to obtain the matching score.
3. The method according to claim 2, characterized in that The encoding the preference view based on the preference view encoder to obtain a user preference representation includes: Based on the preference view encoder, the preference view is subjected to preference learning by utilizing an attention mechanism to obtain the user preference representation.
4. The method according to claim 2, characterized in that: The performing probability prediction on the user preference representation, the item feature representation, the user joint representation and the item joint representation based on the prediction module to obtain the matching score includes: Based on the prediction module, comparative learning is performed on the user preference representation, the item feature representation, the user joint representation, and the item joint representation to obtain a user embedding representation and an item embedding representation; The user embedding representation and the item embedding representation are integrated based on the prediction module to obtain the matching score.
5. The method according to claim 4, characterized in that The step of integrating the user embedding representation and the item embedding representation based on the prediction module to obtain the matching score includes: An inner product calculation is performed on the user embedding representation and the item embedding representation based on the prediction module to obtain the matching score.
6. A knowledge-aware recommendation device, characterized in that: The device comprises: An acquisition module, used to acquire interaction information between users and projects and a knowledge graph corresponding to the projects; An input module, used to input the interaction information and the knowledge graph into a knowledge-aware recommendation model to obtain a matching score between the user and an entity in the knowledge graph, wherein the matching score represents an interaction probability between the user and the entity. The knowledge-aware recommendation model includes a view construction module, a preference view encoder, a feature view encoder, a joint view encoder, and a prediction module. The view construction module is used to construct a preference view, a feature view, and a joint view according to the interaction information and the knowledge graph. A recommendation module is used to make recommendations to the user based on the matching score.
7. The device according to claim 6, characterized in that The input module comprises: A view construction unit, configured to construct a view of the interaction information and the knowledge graph based on the view construction module to obtain a preference view, a feature view, and a joint view; a preference encoding unit, configured to encode the preference view based on the preference view encoder to obtain a user preference representation; a feature encoding unit, configured to encode the feature view based on the feature view encoder to obtain an item feature representation; a joint encoding unit, configured to encode the joint view based on the joint view encoder to obtain a user joint representation and an item joint representation; A prediction unit is used to perform probability prediction on the user preference representation, the item feature representation, the user joint representation and the item joint representation based on the prediction module to obtain the matching score.
8. The device according to claim 7, characterized in that The prediction unit is specifically used for: Based on the prediction module, comparative learning is performed on the user preference representation, the item feature representation, the user joint representation, and the item joint representation to obtain a user embedding representation and an item embedding representation; The user embedding representation and the item embedding representation are integrated based on the prediction module to obtain the matching score.
9. A computer device, characterized in that: include: Memory and processor; The memory is used to store computer programs; The processor is configured to execute the computer program in the memory to implement the method according to any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that: The device stores instructions which, when executed on a computer, cause the computer to execute the method according to any one of claims 1 to 5.