A recommendation system based on knowledge graph completion
By combining a multi-relation graph attention network and a multi-scale convolutional knowledge graph completion module, the problem of insufficient heterogeneous multi-relation connections and multi-dimensional feature interactions in existing technologies is solved, thereby improving the accuracy of knowledge graph completion and the output performance of the recommendation system.
Patent Information
- Application Number
- CN202411126645.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2044-08-16
AI Technical Summary
Existing knowledge graph completion techniques fail to fully utilize heterogeneous multi-relational connections and struggle to extract multi-dimensional feature interactions simultaneously, resulting in unsatisfactory output results from recommendation systems.
A knowledge graph completion module based on a multi-relation graph attention network and multi-scale convolution is adopted. By constructing an encoder-decoder structure, the attention module is used to calculate the attention scores of neighboring entities. Combined with multi-scale convolution to extract features and generate fused features to predict tail entities.
It improves the accuracy of knowledge graph completion and the output accuracy of the recommendation system, and enhances the interpretability of the knowledge graph and the completeness of the recommendation results.
Smart Images

Figure CN119228477B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to knowledge graph technology, and in particular to a knowledge graph completion technology combining a multi-relation graph attention network and a multi-scale convolution. BACKGROUND
[0002] In an information-based society, the increasing flow of information has facilitated people's lives, but it has also brought the problem of information overload. The huge amount of information often exceeds the limits that can be accepted and processed by individuals or systems, so how to effectively filter out the information that users really need from the vast amount of information has always been a popular topic in academia and industry. Based on this, recommendation systems have emerged, which mainly model user profiles and historical preferences to recommend information that is truly valuable and interesting to users. Currently, recommendation systems are widely used in e-commerce, news push, streaming media platforms and other fields. Recommendation systems predict the target that users may be interested in and output according to the associated commodity or behavior information in the user's historical data.
[0003] Knowledge graph, also known as knowledge domain visualization or knowledge domain mapping map, is a series of different graphs that show the development process and structural relationship of knowledge. It uses visualization technology to describe, mine, analyze, construct, draw and display knowledge and their interrelationships. It displays complex knowledge domains through data mining, information processing, knowledge measurement and picture drawing, and reveals the dynamic development law of knowledge domains.
[0004] Knowledge graph stores a large number of user behaviors or associated commodity objective facts in the form of triples, and is widely used in recommendation systems. The triple data result is composed of three elements: head entity, relationship and tail entity. Through the theme represented by the head entity, the predicate, and the object represented by the tail entity, the relationship or attribute between the subject and the object is expressed by the predicate. In the recommendation system, the head entity and the tail entity can be a user or a user-associated commodity. The relationship can be a user behavior. In real-world scenarios, the amount of information of a large number of users grows exponentially, and the update speed of the knowledge graph is far from keeping up with the growth of the amount of user information, resulting in a sparse and incomplete state of the knowledge graph storing a large amount of user information, thereby affecting the accuracy of the output results of the recommendation system.
[0005] Therefore, it is of great significance to identify the missing triples using knowledge graph completion technology.
[0006] The existing knowledge graph completion technology based on a graph neural network learns the feature embedding representation of entities and relations in the knowledge graph by iteratively aggregating the neighborhood structure information in the knowledge graph, so that the entities and relations can learn the local neighborhood information and the structure information of the entire knowledge graph. The method based on the graph neural network often adopts an encoder-decoder structure, takes the graph neural network structure as an encoder, generates an entity-relation embedding representation containing neighborhood information and global structure, and after obtaining the updated entity-relation embedding representation, still needs to use a decoder to score the candidate triplets, calculate the loss value of the current batch training, update the training parameters of the encoder layer by using back propagation, and complete the knowledge graph completion through multiple training. The method based on the graph attention network combines the graph neural network and the attention mechanism, so as to selectively retain important information in the process of aggregating neighborhood information.
[0007] There are many behaviors between the user and the associated commodity, such as clicking, evaluating, purchasing, sharing, adding to the shopping cart, etc. These heterogeneous and variable relationships can more effectively provide user information. However, the existing encoder does not consider the heterogeneous multi-relationship connection when aggregating key neighborhood information, and the decoder only adopts a convolution structure, which is difficult to simultaneously extract feature interactions of entity and relation embedding representation in the same dimension and different dimensions, so that the knowledge graph completion model effect is not ideal, and finally affects the output result of the recommendation system. SUMMARY
[0008] The technical problem to be solved by the present application is to provide a recommendation system that can more accurately output recommended commodities by constructing a knowledge graph completion module that can fully utilize heterogeneous multi-relationship connections and can simultaneously extract multi-dimensional feature interactions.
[0009] The technical solution adopted by the present application to solve the above technical problem is a recommendation system based on knowledge graph completion, comprising:
[0010] The knowledge graph construction module: the collected user information, commodity information and user association operations on commodities are entered into the knowledge graph of the recommendation system in the form of triplets; the user information is taken as the head entity, the user association operations on commodities are taken as the relation, and the commodity information is taken as the tail entity to form triplets; when the knowledge graph has a tail entity to be completed in the triplet, the knowledge graph completion module is triggered, and the tail entity predicted by the knowledge graph completion module is added to the current knowledge graph to complete the update;
[0011] The knowledge graph completion module: according to the current constructed knowledge graph, the candidate entity in the knowledge graph and the known entity and the relationship form a candidate triple, then the score function is used to calculate the score of all candidate triples, finally the highest score is selected as the completion result for predicting the corresponding tail entity of the known head entity and relationship; and the predicted tail entity is output to the knowledge graph construction module;
[0012] The commodity recommendation module: based on the latest knowledge graph in the knowledge graph construction module, the recommended commodities are output to the user;
[0013] The knowledge graph completion module is an encoder-decoder structure, and the encoder includes an attention module and an aggregation module.
[0014] The attention module is used for calculating the attention score between the center entity and the neighbor entity of the center entity; the center entity is the known head entity in the triple to be completed; the neighbor entity is the entity connected with the center entity through the relationship;
[0015] The aggregation module is used for aggregating the neighbor information of the center entity into the center entity according to the attention score calculated by the attention module, so as to generate the embedding representation of the center entity fused with the neighborhood information, wherein the attention score controls how much the neighbor information of the center entity is aggregated; and the embedding representation of the relationship is updated according to the learnable relationship matrix;
[0016] The decoder is used for inputting the embedding representation of the center entity and the relationship into the multi-scale interaction feature extraction layer to capture the interaction feature and complete the feature fusion to form the fusion feature of the center entity and the relationship, and then calculating the similarity between the fusion feature and the embedding representation of the candidate tail entity to obtain the score of the candidate completion triple.
[0017] The knowledge graph completion of the present application combines the multi-relation graph attention network and the multi-scale convolution, which makes up for the defects that the existing method does not consider the heterogeneous multi-relation connection and is difficult to extract multi-dimensional feature interaction at the same time, so that the knowledge graph completion task is better completed, and the recommendation system has a more complete knowledge graph when reasoning for commodity recommendation.
[0018] The beneficial effects of the present application are that the heterogeneous multi-relation connection problem of user data given by the recommendation system in the process of constructing the knowledge graph is fully considered, the importance of other users or goods associated with the target user to the target user is calculated through the attention mechanism, the embedding representation of the target user is updated according to the attention score aggregation neighborhood information, thereby improving the knowledge graph completion effect involving the target user, and improving the explainability of the knowledge graph based on the recommendation system. The embedding representation of the target user and the operation behavior is obtained in the same and different dimensions in the completion process, which further improves the effect of the knowledge graph completion model under the graph attention network structure in the recommendation system, and effectively improves the accuracy of the output recommendation result of the recommendation system. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 A flowchart of the knowledge graph completion module;
[0020] Figure 2 An encoder schematic diagram of the knowledge graph completion module of the present embodiment;
[0021] Figure 3 A process schematic diagram of the present embodiment for knowledge graph completion. DETAILED DESCRIPTION
[0022] A recommendation system based on knowledge graph completion, comprising a knowledge graph construction module, a knowledge graph completion module and a commodity recommendation module. The knowledge graph construction module and the commodity recommendation module respectively adopt an existing knowledge graph construction method and a knowledge graph reasoning method. The specific implementation mode of the knowledge graph completion module is proposed in the present application, which will be described in detail.
[0023] The knowledge graph construction module is used to enter the collected user information, commodity information and user associated operations on commodities into the knowledge graph of the recommendation system in the form of triples; the user information is taken as the head entity, the user associated operations on commodities are taken as the relationship, and the commodity information is taken as the tail entity to form triples; when the knowledge graph has a tail entity to be completed in the triples, the knowledge graph completion module is triggered, and the tail entity predicted by the knowledge graph completion module is added to the current knowledge graph to complete the update; the user associated operations on commodities include clicking, evaluating, purchasing, sharing and adding to the shopping cart.
[0024] The knowledge graph completion module is of an encoder-decoder structure, and the tail entity predicted according to the known head entity and relationship in the triple with completion is output to the knowledge graph construction module;
[0025] The commodity recommendation module: based on the latest knowledge graph in the knowledge graph construction module, the recommended commodities are output to the user;
[0026] The encoder of the knowledge graph completion module comprises an attention module and an aggregation module.
[0027] The attention module is configured to calculate attention scores between a center entity and neighbor entities of the center entity; the center entity is a known head entity in a to-be-completed triple; and the neighbor entities are entities connected to the center entity through a relationship.
[0028] The aggregation module is configured to aggregate neighbor information of the center entity into the center entity according to the attention scores calculated by the attention module, so as to generate an embedded representation of the center entity fused with the neighbor information, wherein the attention scores control how much the neighbor information of the center entity is aggregated respectively; and the embedded representation of the relationship is updated according to a learnable relationship matrix.
[0029] The decoder is configured to input the embedded representations of the center entity and the relationship into a multi-scale interactive feature extraction layer to capture interactive features and complete feature fusion to form fused features of the center entity and the relationship, and then calculate a similarity between the fused features and an embedded representation of a candidate tail entity to obtain a score of a candidate completed triple.
[0030] The knowledge graph completion module combines a multi-relation graph attention network and a multi-scale convolution-based knowledge graph completion method to compensate for the defects that existing completion methods do not consider heterogeneous multi-relation connections and are difficult to extract multi-dimensional feature interactions simultaneously, so that the knowledge graph completion task is better completed. The completion implementation process is as follows:
[0031] A. Training a knowledge graph completion model:
[0032] A1. Randomly initializing entities through a normal distribution and initializing relationships with a linear combination of a set of basis vectors to obtain random initial embedded representations of the entities and the relationships;
[0033] A2. The attention module calculates attention scores between a center entity and neighbor entities of the center entity.
[0034] A3. The aggregation module aggregates neighbor information of the center entity into the center entity according to the attention scores calculated by the attention module, so as to generate an embedded representation of the center entity fused with the neighbor information, wherein the attention scores control how much the neighbor information of the center entity is aggregated respectively, and the embedded representation of the relationship is updated according to a learnable relationship matrix.
[0035] A4. The updated embedded representations of the entities and the relationships are provided to the decoder, the embedded representations of the head entity and the relationship are fused through multi-scale interactive feature extraction layers to capture interactive features, and then a similarity between the fused features and an embedded representation of a tail entity is calculated to obtain a score of a triple.
[0036] A5, calculate the loss value of the model by the loss function, and train the knowledge graph completion model based on the loss value by the gradient descent method, optimize the network parameters, and obtain the trained completion model;
[0037] B, based on the knowledge graph completion model, perform the completion task:
[0038] The trained knowledge graph completion model is used for actual knowledge graph completion tasks, candidate entities in the knowledge graph and known entities and relationships are combined to form candidate triples, and then the scores of all candidate triples are calculated by a scoring function, and the highest score is finally selected as the completion result.
[0039] Step A1 is specifically:
[0040] A11, the entities of the knowledge graph to be completed are initialized by Xavier normal, and the entity initialization embedding representation e u is obtained.
[0041] A12, the initial embedding representation of the relationship is represented by a linear combination of a set of basis vectors, and the relationship initialization embedding representation e r is obtained.
[0042] Step A2 specifically includes:
[0043] A21, define a learnable key matrix K r and a query matrix Q r for each type of relationship.
[0044] A22, the query matrix projects the embedding representation of the center entity into the query vector The key matrix transforms the embedding representation of the neighbor entity to obtain the key vector
[0045] A23, calculate the dot product of the query vector and the key vector to obtain the attention coefficient e ij , and obtain the attention score a ij between the entity pair of the center entity and the neighbor entity.
[0046] Step A3 specifically includes:
[0047] A31, linearly combine the embedding representation vectors of the neighbor entities according to the attention score to aggregate and update the embedding representation of the center entity
[0048] A32, use multi-head attention to update the embedding representation of the entity, combine multiple results to output an embedding vector
[0049] A33, add residual connection to retain the original information of the central entity, and obtain the embedding representation e of the central entity i ′
[0050] A34, update the embedding representation of the relationship through a learnable relationship weight matrix to obtain e r ′
[0051] Step A4 specifically includes:
[0052] A41, extract the same-dimensional feature using a one-dimensional convolution kernel to obtain a same-dimensional feature vector v1;
[0053] A42, extract the different-dimensional interaction feature using a three-dimensional convolution kernel to obtain a different-dimensional feature vector v2;
[0054] A43, project the obtained same-dimensional and different-dimensional feature vectors to the embedding representation dimension of the original entity through a fully connected layer, and fuse them to obtain the output fusion feature vector v;
[0055] A44, perform inner product on the obtained fusion feature vector corresponding to the head entity and the relationship and the tail entity embedding representation e t to obtain the score of the triple
[0056] Step A5 specifically includes:
[0057] A51, map the score of the triple to the range of (0, 1);
[0058] A52, train the knowledge graph completion model using a cross-entropy loss function.
[0059] Referring to Figure 1 , the specific completion implementation process is as follows:
[0060] S1, initialize the entity and relationship embedding representation of the knowledge graph to be completed:
[0061] S11, perform Xavier normal initialization on the entity of the knowledge graph to be completed, so that the input and output conform to the same normal distribution as much as possible, which can ensure that the gradient of the network is relatively stable, effectively avoiding the occurrence of gradient disappearance or gradient explosion;
[0062] S12, in order to prevent over-parameterization, the initial embedding representation of the relationship is represented by a linear combination of a set of basis vectors, specifically represented as:
[0063]
[0064] where e r is the embedding representation of the relationship, and let {v1, v2, …v B is a set of learnable basis vectors, is the learnable scalar weight corresponding to the relationship;
[0065] S2, attention module: since there are heterogeneous connections between entities in the knowledge graph, that is, a center entity may be connected to the same neighbor entity through different relationships, or a center entity is connected to multiple neighbor entities through the same relationship, or a center entity is connected to multiple neighbor entities through different relationships, therefore, the attention score between each center entity and its neighbor entity is calculated using the attention mechanism. In this process, the embedding representation of all entities is input, denoted as In the first pass through the process, the input is the initialized entity embedding representation, and after that, the updated entity embedding representation output by the last output, the output is the attention score of all entities related to the neighbor entity, where N represents the number of all entities in the knowledge graph, and D represents the dimension of the entity embedding representation:
[0066] S21, first define a learnable key matrix and query matrix for each relationship: let the key matrix be K r , represents the key matrix corresponding to the relationship r, where Let the query matrix be Q r , represents the query matrix corresponding to the relationship r, F is the dimension of the key vector and the query vector;
[0067] S22, given a center entity and a set of neighbor entities of the entity, the query matrix projects the embedding representation of the center entity into the query vector, and the key matrix transforms the embedding representation of the neighbor entity to obtain the key vector, the calculation process is as follows:
[0068]
[0069] where e i represents the embedding representation of the center entity, e j represents the embedding representation of the neighbor entity, and r is the relationship between the two entities, is the query vector of the center entity corresponding to the relationship r, is the key vector of the neighbor entity corresponding to the relationship r;
[0070] S23, after obtaining the query vector and the key vector, the dot product of the query vector and the key vector is calculated to obtain the attention score between the entity pair of the center entity and the neighbor entity, and the dot product of the two vectors is obtained. Attention coefficient, as follows:
[0071]
[0072] Then the attention coefficients are normalized using the softmax function to obtain the attention scores of the entity pairs as follows:
[0073]
[0074] where a ij represents the attention score of the neighbor entity j for the center entity i pair, N i represents the set of all neighbor entities of entity i.
[0075] S3, aggregation module: according to the obtained attention score, the neighbor information of the center entity is aggregated into the center entity, thereby generating an entity embedding representation that integrates neighborhood information, and updating the embedding representation of the relationship according to the learnable relationship matrix:
[0076] S31, linear combination of the embedding representation vectors of the neighbor entities according to the attention score to update the embedding representation of the center entity by aggregation, the aggregation of neighborhood information process is as follows:
[0077]
[0078] where is a learnable linear transformation matrix, is the aggregated center entity embedding representation;
[0079] S32, using multi-head attention mechanism can stabilize the convergence of parameters during training and can extract more rich feature information, therefore using multi-head attention to update the embedding representation of the entity, combining multiple results to output an embedding vector as follows:
[0080]
[0081] where represents the embedding vector generated by the Kth attention head, concat represents vector splicing, is a learnable linear transformation matrix that transforms the spliced vector to the original dimension;
[0082] S33, residual connection: when aggregating the information of the neighbor entities, the information of the center entity itself is lost, therefore a residual connection is added to retain the original information e i of the center entity, and the center entity embedding representation update process is as follows:
[0083]
[0084] where σ(·) is a nonlinear activation function, to obtain the updated all entity embedding representation update W is the weight of the residual connection;
[0085] S34, update the embedding representation of the relation, the update process is as follows:
[0086] e r ′ =e r W rel
[0087] where is a learnable relation weight matrix, which projects the relation embedding representation into the same embedding space as the entities.
[0088] The encoder principle in the above steps S2-S3 is shown in Figure 2
[0089] S4, decoder scoring: provide the updated entity and relation embedding representations to the decoder, pass the head entity and relation embedding representations through a multi-scale interaction feature extraction layer, fuse the captured interaction features, and then calculate the similarity with the tail entity embedding representation to obtain the score of the triple:
[0090] S41, homogeneous feature extraction: simply stack the updated head entity embedding representation e u and the relation embedding representation e r to form a two-dimensional matrix, and then use a one-dimensional convolution kernel ω1 to perform convolution operation on the two-dimensional matrix, where represents the use of m convolution kernels, respectively obtain m homogeneous feature maps as follows:
[0091]
[0092] where is the i-th homogeneous feature map, [e u ; e r ] represents simply stacking the entity and the relation, * represents the traditional convolution operation, and f(·) represents the nonlinear activation function.
[0093] Then concatenate the m homogeneous feature maps to obtain a homogeneous feature vector as follows:
[0094]
[0095] where
[0096] S42, heterogeneous feature interaction extraction: reshape the head entity embedding representation e u and the relation embedding representation e r obtained in S3 into three-dimensional matrices respectively, and then cross-stack them to maximize the heterogeneous feature interaction of the entity and relation embedding representations, and use a three-dimensional convolution kernel for convolution operation, where denotes using n convolution kernels, respectively denoted as The n heterogeneous feature maps are obtained as follows:
[0097]
[0098] wherein and denote the head entity embedding and the relation embedding reshaped into a three-dimensional matrix, denotes a cross-stacking operation, and the homogeneous feature map obtained is
[0099]
[0100] The n homogeneous feature maps are spliced into a heterogeneous feature vector as follows:
[0101]
[0102] wherein
[0103] S43, Feature Fusion: The homogeneous and heterogeneous feature vectors obtained by S41 and S42 are projected to the embedding representation dimension of the original entity through a fully connected layer, and are fused to obtain the output fusion feature vector as follows:
[0104] v = v1W1 + v2W2
[0105] wherein
[0106] S44, Triple Score: The fusion feature vector corresponding to the head entity and the relation obtained by S43 is calculated and the tail entity embedding representation e t is performed, and the score of the triple is obtained as follows:
[0107]
[0108] S5, The loss value of the model is calculated by the loss function, and the knowledge graph completion model is trained based on the loss value by the gradient descent method, the network parameters are optimized, and the trained completion model is obtained:
[0109] S51, The score of the triple obtained by S44 is mapped to the range of (0, 1) using the sigmoid activation function, which intuitively represents the possibility of the triple being true, as follows:
[0110]
[0111] wherein σ(·) is the sigmoid function.
[0112] S52, the model adopts a 1-N scoring strategy to train the model, taking the head entity and the relation as input, the candidate tail entity and the head entity and the relation to form a candidate triple, and calculating the scores of all candidate triples. The knowledge graph completion model is trained using a cross-entropy loss function, as follows:
[0113]
[0114] wherein represents the set of correct triples, represents the set of incorrect triples obtained by replacing the head and tail entities of the correct triples, y i represents the label of the i-th sample, and the corresponding values are as follows:
[0115]
[0116] S6, the trained knowledge graph completion model is used for actual knowledge graph completion tasks, candidate entities in the knowledge graph and known entities and relations are combined to form candidate triples, and then a scoring function is used to calculate the scores of all candidate triples, and finally the triple with the highest score is selected as the completion result:
[0117] As shown in Figure 3 , for example, given a triple to be completed (h, r,?), the tail entity corresponding to the head entity and the relation is predicted, the candidate entity set is input into the step S4 to score the triple, and a score set {score0, score1, …, score m} is obtained, the score set is sorted, and the candidate triple with the highest score is obtained as the knowledge graph completion result.
[0118] After outputting the knowledge graph completion result to the knowledge graph construction module, the system's commodity recommendation module performs reasoning based on the latest complete knowledge graph constructed in the knowledge graph construction module, thereby more accurately outputting recommended commodities to the user.
[0119] Although the present application has been described herein with reference to the embodiments thereof, the above embodiments are only preferred embodiments of the present application, and the embodiments of the present application are not limited by the above embodiments. It should be understood that those skilled in the art can design many other modifications and embodiments, which will fall within the scope and spirit of the principles disclosed in the present application.
Claims
1. A recommendation system based on knowledge graph completion, characterized in that, Comprise: A knowledge graph construction module: the collected user information, commodity information and user's associated operation on the commodity are input into the knowledge graph of the recommendation system in the form of triples; Take the user information as the head entity, the user's associated operation on the commodity as the relationship, and the commodity information as the tail entity to form a triple; when the knowledge graph has a tail entity to be completed in the triple, trigger the knowledge graph completion module, and add the tail entity predicted by the knowledge graph completion module to the current knowledge graph to complete the update; The knowledge graph completion module: according to the current constructed knowledge graph, the candidate entities in the knowledge graph, the known entities and the relationship form candidate triples, then calculate the scores of all candidate triples through the scoring function, and finally select the highest score as the completion result to predict the corresponding tail entity of the known head entity and relationship; and output the predicted tail entity to the knowledge graph construction module; The commodity recommendation module: based on the latest knowledge graph in the knowledge graph construction module, reasoning is carried out to output the recommended commodities to the user; The knowledge graph completion module is an encoder-decoder structure, and the encoder includes an attention module and an aggregation module; The attention module is used to calculate the attention score between the center entity and the neighbor entity; the center entity is the known head entity in the triple to be completed; the neighbor entity is the entity connected with the center entity through the relationship; The aggregation module is used to aggregate the neighbor information of the center entity into the center entity according to the attention score calculated by the attention module, so as to generate the embedding representation of the center entity fused with the neighborhood information, wherein the attention score controls how much the neighbor information of the center entity is aggregated; and update the embedding representation of the relationship according to the learnable relationship matrix; The decoder is used to input the embedding representation of the center entity and the relationship into the multi-scale interaction feature extraction layer to capture the interaction features and complete feature fusion to form the fusion features of the center entity and the relationship, and then calculate the similarity between the fusion features and the embedding representation of the candidate tail entity to obtain the score of the candidate completion triple.
2. The system of claim 1, wherein, The aggregation module randomly initializes the embedding representation of the center entity and the embedding representation of the tail entity through normal distribution, and initializes the embedding representation of the relationship through linear combination of a group of basis vectors.
3. The system of claim 1, wherein, The knowledge graph completion module calculates the loss value of the model through the cross entropy function during the training process, and optimizes the network parameters of the knowledge graph completion module based on the loss value through the gradient descent method.
4. The system of claim 1, wherein, The specific way of the attention module to calculate the attention score between the center entity and the neighbor entity is: The attention module defines a learnable key matrix and a query matrix for each relationship between the center entity and the neighbor entity; the query matrix projects the embedding representation of the center entity into a query vector, and the key matrix transforms the embedding representation of the neighbor entity to obtain a key vector; The attention module calculates the dot product of the query vector and the key vector to obtain the attention coefficient, and obtains the attention score between the center entity and the neighbor entity based on the attention coefficient.
5. The system of claim 1, wherein, The specific way of the aggregation module to generate the embedding representation of the center entity fused with the neighborhood information is: The aggregation module linearly combines embedding representation vectors of neighbor entities according to attention scores, aggregates the linear combination on the center entity to update the embedding representation of the center entity; uses multi-head attention to update the embedding representation of the center entity, combines multi-head results to output an embedding vector; and obtains the embedding representation of the center entity by combining the embedding vector with the embedding representation of the center entity to which a residual connection is added.
6. The system of claim 1, wherein, The specific manner in which the multi-scale interactive feature extraction layer in the decoder obtains the fusion feature of the center entity and the relation is as follows: A one-dimensional convolution kernel is used to extract same-dimensional features to obtain a same-dimensional feature vector; a three-dimensional convolution kernel is used to extract different-dimensional interactive features to obtain a different-dimensional feature vector; and the obtained same-dimensional and different-dimensional feature vectors are projected to the embedding representation dimension of the center entity and the relation through a full connection layer to obtain a fusion feature.
7. The system of claim 1, wherein, The specific manner in which the similarity between the fusion feature and the embedding representation of the candidate tail entity is calculated to obtain the score of the candidate completed triple is as follows: The inner product of the fusion feature and the tail entity embedding representation is calculated, and the obtained inner product result is used to represent the score of the triple.
Citation Information
Patent Citations
Recommendation system and method based on commodity knowledge graph and user social graph
CN116308652A
Recommendation algorithm based on knowledge graph and neural network
CN116955647A