Recommendation system knowledge graph induction and completion method based on global topology relation graph

By constructing a global topological relationship graph and using a multi-head attention mechanism for learning, the problem of modeling new entities and relationships in knowledge graphs is solved, improving the recall coverage and accuracy of e-commerce recommendation systems. This approach is suitable for knowledge graph completion in e-commerce recommendation systems.

CN121212362BActive Publication Date: 2026-05-01TIANJIN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TIANJIN UNIV
Filing Date
2025-11-07
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing knowledge graph completion methods have limitations when dealing with new entities and relationships, especially in e-commerce scenarios where new products/categories are frequently launched and user interests change rapidly. Traditional direct-inference methods struggle to maintain performance, and relationship embedding ignores semantic associations.

Method used

A global topological relationship graph is constructed, relationship embeddings are learned through a multi-head attention mechanism, an adaptive weighting strategy is adopted to form a comprehensive relationship embedding, and a dynamic attention mechanism is used to calculate the attention scores between entities and their neighboring entities. The entity embeddings are updated in combination with the original knowledge graph, negative samples are generated for optimization, and the model is trained using an interval-based ranking loss.

Benefits of technology

In e-commerce recommendation systems, robust modeling of new entities and relationships is achieved, improving recall coverage and accuracy. It can learn relationship patterns and embeddings in fully inductive scenarios, reducing computational complexity and is suitable for knowledge graph completion under offline or near real-time conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121212362B_ABST
    Figure CN121212362B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on global topology relation diagram's recommended system knowledge graph induction completion method, it is related to knowledge graph completion technical field.The method constructs global relation diagram by constructing user and article entity and its relation in e-commerce system.Constructs comprehensive relation embedding by adopting multi-head attention mechanism learning relation embedding and through adaptive weighting strategy.The comprehensive relation embedding is combined with original knowledge graph, and the attention score of target entity and adjacent entity is calculated using dynamic attention mechanism, and the user and article embedding are updated.Negative sample is generated by replacing user or article entity in recommended triple, and the positive and negative samples are scored using the scoring function, and the model is optimized.The recommendation task is converted into target article prediction, and the user preference value is returned through the trained model and the scoring function, and the highest scoring article is selected as the recommendation result.The method is suitable for cold start and long tail scenarios, can efficiently complete the knowledge graph of e-commerce recommendation system, and is suitable for offline or quasi-real-time deployment.
Need to check novelty before this filing date? Find Prior Art

Description

A Knowledge Graph Inductive Completion Method for Recommendation Systems Based on Global Topological Relationship Graphs Technical Field

[0001] This invention relates to the field of knowledge graph completion technology, and in particular to a method for knowledge graph induction and completion in recommendation systems based on a global topological relationship graph. Background Technology

[0002] Knowledge graphs are structured directed graph datasets where data is stored in the form of triples. Nodes in a directed graph represent head or tail entities, and edges represent relationships between entities. Knowledge graphs play a fundamental role in various applications such as recommender systems and question-answering systems because they enhance data interoperability, reasoning capabilities, and semantic query capabilities. Due to inherent incompleteness and inaccuracies in their construction and maintenance, knowledge graph completion has emerged as a solution.

[0003] In existing techniques, inductive knowledge graph completion is used to predict missing triples between new entities not observed during training. They categorize entities and relations into observed entities or relations (observed during training) and unobserved entities or relations (not observed during training).

[0004] However, unlike methods that handle unobserved entities, existing inductive knowledge graph completion methods assume that all relations are known, thus learning relations through inductive reasoning. This assumption has limitations in practical applications because new relations may continuously emerge. More importantly, most existing inductive methods focus on learning the embeddings of new entities, while relation embeddings are often obtained through random initialization or direct processing, inevitably ignoring the semantic connections between relations. Especially in e-commerce scenarios, knowledge graphs are often highly incomplete and time-varying due to frequent new product / category launches and rapid changes in user interests. Traditional inductive reasoning methods struggle to maintain performance when training on unseen entities and relations. Particularly in cold start and long-tail product recall, the lack of new relations (such as new product-attribute / matching relationships) significantly impacts recommendation performance. Summary of the Invention

[0005] Based on this, in order to solve the technical problems in the prior art, this specification provides a knowledge graph completion method, apparatus, medium and device.

[0006] This manual provides a knowledge graph completion method, including:

[0007] Obtain several candidate recommended items from the knowledge graph to be completed in the e-commerce recommendation system; the entities in the knowledge graph to be completed are users and items, and the relationships are browsing, adding to cart, purchasing, favorites, similarity, and matching; based on the topological association of the relationship pairs corresponding to entities in the e-commerce recommendation system, construct a global relationship graph on six types of topologies: "head to tail", "tail to tail", "head to head", "tail to head", "parallel", and "loop".

[0008] Based on the global relationship graph, various relationship embeddings are learned through a multi-head attention mechanism, and an adaptive weighting strategy is adopted to form a comprehensive relationship embedding.

[0009] By combining comprehensive relationship embedding with the original knowledge graph of the e-commerce recommendation system, the attention score of the target entity and its neighboring entities and corresponding recommendation relationships is calculated using a dynamic attention mechanism. Based on the attention weight, all neighboring entities and related recommendation relationships are weighted and aggregated. Based on the aggregation result, the target entity embedding and the corresponding relationship embedding are fused to update the entity embedding of users and items in the e-commerce recommendation system.

[0010] Negative samples are generated by replacing user or item entities in the recommendation triples. The learned entity embeddings and comprehensive relation embeddings are used to initialize the recommendation entities and relations. Forward propagation is set up and the recommendation relation embedding vector and entity embedding vector are obtained. The positive and negative samples are scored respectively using the scoring function in the recommendation scenario. The ranking loss based on the interval is used for optimization to obtain a link prediction model suitable for recommendation systems.

[0011] The task of predicting recommendation links is transformed into the task of predicting target items. Candidate recommended items are inserted one by one into the user-relationship query triple. The trained recommendation link prediction model and the knowledge graph embedding scoring function are used to return a scalar value representing the rationality of the user's preference for the item. The candidate item with the highest score is selected as the recommendation result. At the same time, the knowledge graph of the recommendation system is completed.

[0012] Preferably, the step of learning various relationship embeddings based on the global relationship graph through a multi-head attention mechanism specifically includes:

[0013] ;

[0014] ;

[0015] in, For activation function, Here is the weight matrix for layer l; The adjacency relationship of layer l; The representation vector of layer l; For relationship The set of neighbors on graph A; Attention score; It is a row weight vector; || ] represents the vector concatenation operation.

[0016] Preferably, the step of concatenating the feature embeddings of the multi-head self-attention mechanism to obtain the relation embedding of each specific pattern in the multi-relation graph specifically includes:

[0017] ;

[0018] Here, || represents the concatenation operation. The weight matrix of the linear transformation associated with the k-th attention head.

[0019] Preferably, the application of adaptive weighted aggregation to obtain the comprehensive relationship embedding specifically includes:

[0020] ;

[0021] Where r represents the topological graph; This represents the aggregate weight.

[0022] Preferably, the step of embedding comprehensive relationships with the original knowledge graph of the e-commerce recommendation system and using a dynamic attention mechanism to calculate the attention score of the target entity, its neighboring entities, and the corresponding recommendation relationships specifically includes:

[0023] ;

[0024] ;

[0025] in, Indicates connection and Specific relationship The relation vector at level L; This represents the dynamically learnable attention weights provided by GATv2.

[0026] This specification provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described knowledge graph completion method.

[0027] This specification provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the above-described knowledge graph completion method.

[0028] The above-mentioned technical solutions adopted in this specification can achieve the following beneficial effects:

[0029] The knowledge graph completion method provided in this specification constructs a global relationship graph across topological patterns and employs an inductive learning mechanism. This enables robust modeling of new entities / relationships under offline or near-real-time conditions, improving the recall coverage and accuracy of e-commerce recommendations. Specifically:

[0030] First, relation pairs under six patterns are statistically analyzed, and a multi-relation graph is constructed based on this. Then, relation embeddings are calculated using an attention-based message passing method, which helps identify structural features under each pattern. Finally, the original knowledge graph and relation embeddings are combined, and entity embeddings are aggregated using attention-based neighbor embeddings, maximizing the fact likelihood score of triples in the training knowledge graph. During inference, a new global topological relation graph is reconstructed from the inference knowledge graph, and the attention weights learned during training are used to aggregate the embeddings of adjacent relations to calculate the embeddings of unseen relations and new entities. A relation graph is constructed for each topological structure from the entire graph. Utilizing the invariance of relation structure, relative relation representations are used to parameterize any unseen relation, solving the problem of relation dependence on "degree" and significantly reducing the computational complexity caused by subgraph sampling. Relational patterns and relation embeddings can be learned in fully inductive scenarios, thereby generating a complex relation graph model for inference and link prediction. This invention utilizes graph convolutional networks and graph attention networks, enabling efficient model training, strong scalability, and the ability to handle new relations. It can be applied to knowledge graphs with a large number of incomplete components. Attached Figure Description

[0031] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:

[0032] Figure 1 is a flowchart illustrating a knowledge graph induction and completion method for a recommendation system based on a global topological relationship graph, as provided in this specification. Detailed Implementation

[0033] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments in this specification without creative effort are within the scope of protection of this invention.

[0034] Traditional knowledge graph completion primarily focuses on link prediction or entity completion based on existing knowledge to fill in missing information, such as embedding-based methods like TransE and RotatE. However, these methods belong to inductive learning, meaning all entities and relations are known during the training and inference phases, making them difficult to handle new entities and relations. In recent years, some scholars have introduced inductive knowledge graph completion to predict missing triples between new entities not observed during training. They categorize entities and relations into observed entities or relations (observed during training) and unobserved entities or relations (not observed during training). However, unlike handling unobserved entities, existing inductive knowledge graph completion methods assume all relations are known, thus performing inductive learning of relations. This assumption has limitations in practical applications because new relations may continuously emerge. More importantly, most existing inductive methods focus on learning the embeddings of new entities, while relation embeddings are often obtained through random initialization or direct processing, inevitably ignoring the semantic connections between relations. The inductive knowledge graph completion model is divided into traditional inductive scenarios, semi-inductive scenarios, and fully inductive scenarios. The main distinguishing indicator is the proportion of new relations, namely, relations that are fully known (traditional), relations that are partially known (semi-inductive), and relations that are completely unknown (fully inductive).

[0035] The purpose of this invention is to overcome the problem of learning representations of new entities and new relations in inductive scenarios, and to propose a novel inductive knowledge graph completion model based on graph neural networks that can adaptively scale up new relations. Simultaneously, it utilizes relation topology structures to generate a global topological relation graph, thereby further learning representations of new relations and new entities. Updated relation representations also guide the updating of entity representations, achieving bidirectional promotion. To achieve the above objectives, the technical solution adopted in this invention is a relation graph generation method based on graph convolutional networks and graph self-attention, which further updates relation representations and aggregates entity representations based on existing relation graphs. The method involves: using graph convolutional networks to construct a global relation graph for each topology structure, integrating the topology structure into the aforementioned relation graph to learn global relation embeddings, which are then used to update entity embeddings. The generated global relation graph spans different topologies, ensuring that the relation interaction graph remains consistent even if relations change between training and inference. When relations change during inference, the interactions between relations are preserved and captured by the global relation graph, thus effectively generalizing to knowledge graph completion in inductive scenarios. The entire model training process uses the Adam optimizer to train the neural network parameters.

[0036] Example 1

[0037] Figure 1 illustrates the flowchart of the knowledge graph induction and completion method for the recommendation system based on the global topological relationship graph in this embodiment. The method is described in detail below with reference to Figure 1, specifically including the following steps:

[0038] Step 1: Analyze the relation topology. Analyze the global relation patterns in the input knowledge graph. Relation topology patterns are categorized into seven types: "Head-to-Tail," "Tail-to-Tail," "Head-to-Head," "Tail-to-Head," "Parallel," "Loop," and "Non-connected." "Non-connected" patterns are excluded because they are irrelevant to the link prediction task. These six patterns are named "HT," "TT," "HH," "TH," "PARA," and "LOOP," respectively. For example, (r1, HT, r2) represents the correlation between r1 and r2, where r2 has the "HT" pattern, indicating that r1 and r2 are head-to-tail connected. (r1, PARA, r2) indicates that these two relations have the same head and tail entities, while (r1, LOOP, r2) indicates that these two relations resemble a cycle.

[0039] The entities in the knowledge graph of the e-commerce recommendation system are users, products, categories, and brands, and the relationships are browsing, adding to cart, purchasing, favorites, similarity, and matching. For the topological associations of user-item, item-item, and user-user relationships in the e-commerce recommendation system, global relationship graphs are constructed on six types of topologies: "head-to-tail," "tail-to-tail," "head-to-head," "tail-to-head," "parallel," and "loop." The global relationship topology graph in the recommendation domain is specifically constructed for typical recommendation relationships in recommendation systems, such as "user-purchase-item," "user-browse-item," "item-belong to-category," and "user-following-user." Each type of topology corresponds to a relationship graph, used to characterize the structural invariance of recommendation relationship pairs globally, thus maintaining consistent interaction structures for new users, new items, and new recommendation relationships during the inference phase.

[0040] Step two involves constructing a multi-relation graph containing six patterns. Building upon Step one, the multi-relation graph is constructed. In the given knowledge graph, patterns are first identified. Each relation is considered a node v, and the connections between different relation pairs (topological patterns) are considered edges e, thus constructing a directed multi-relation graph. Since different datasets have different topological structures, the number of relations (i.e., nodes in the multi-graph) also varies (as shown in Figure 1). The multi-graph helps extract adjacency matrices with consistent shapes, facilitating subsequent operations. Specifically, a three-dimensional tensor is defined. ,in Indicates the topology type. This represents the number of edges (nodes). Each segment corresponds to an adjacency matrix of relation pairs of a specific type. Adjacency tensor Represents a node and Does it exist between them? Edges of a certain type can be easily obtained through traversal. By constructing a global relational graph spanning different topological patterns, it can be ensured that even if the relationships differ during inference, their interactions remain unchanged and are captured by the global relational graph. This allows the model to be generalized to inductive scenarios.

[0041] Step three involves the forward propagation process and attention in relation embedding learning. Using the methods described above, six different patterns of topological relation graphs were derived. Each graph is characterized by its adjacency matrix. It defines the adjacency relationships for each type of relation. For undefined relations and entities, Glorot initialization is used to generate their initial feature vectors. Then, GNN message passing is used to update the feature embeddings of relation nodes and entity nodes. The forward propagation process and attention can be defined as follows:

[0042] ;

[0043] ;

[0044] in, For activation function, Here is the weight matrix for layer l; The adjacency relationship of layer l; The representation vector of layer l; For relationship The set of neighbors on graph A; Attention score; It is a row weight vector; || ] represents the vector concatenation operation.

[0045] Step four involves extending the attention score to a multi-head attention mechanism, thereby effectively stabilizing the learning process of the self-attention mechanism. Specifically, this involves performing transformations using K independent attention heads, and then concatenating the feature embeddings of these attention heads to obtain the final comprehensive output feature embedding:

[0046] ;

[0047] Here, || represents the concatenation operation. The weight matrix of the linear transformation associated with the k-th attention head.

[0048] Step five: Through the above aggregation, the relation embeddings for each specific pattern are obtained. When constructing six different relation graphs, these relation embeddings are connected, and an adaptive weighted aggregation strategy is applied to form the final comprehensive relation embedding:

[0049] ;

[0050] Where r represents the topological graph; This represents the aggregate weight.

[0051] Step six involves combining the original knowledge graph with relation embeddings and updating entity embeddings through neighbor aggregation using an attention mechanism. Entity-level aggregation includes embeddings from the entity's neighborhood, i.e., self-loops and adjacency relationships. The calculation of self-loops is as follows:

[0052] ;

[0053] This method combines initial features with neighborhood aggregation, enabling entities to capture more complex and diverse structural features in multi-layered relationship graphs. Inspired by GATv2, the attention score for each entity pair and its relevance is calculated as follows:

[0054] ;

[0055] in, Indicates connection and Specific relationship The relation vector at level L; This represents the dynamically learnable attention weights provided by GATv2.

[0056] Step seven: Normalize these raw attention scores using the softmax function, converting them into interpretable weights. This function can be defined as:

[0057] ;

[0058] Step eight, using these standardized attention weights, performs aggregation, applying a weighted sum of all adjacent entities and related relationships to:

[0059] ;

[0060] Step nine, update the embedding of the target node using aggregated information, by combining the node's information with the information of its neighbors, i.e.:

[0061] ;

[0062] Step 10, change the positive triplet Use the head or tail entity in the middle to generate negative triples ,in Then, the entities and relations are initialized using their respective learned embeddings to set up the forward propagation and obtain the embedding vectors of the relations. and entity embedding vector Since the goal is to simplify the problem, all link prediction tasks are transformed into tasks that predict tail entities. Therefore, link prediction in knowledge graph completion is considered... Each candidate entity Insert into the query triples. Then use a knowledge graph embedding scoring function, using... This indicates that it returns a scalar value representing the given triple. The rationale for this is that the entity with the highest score is defined as the missing entity. The ranking loss based on margins is defined as:

[0063] ;

[0064] After loss calculation, gradients are obtained through backpropagation, and gradient pruning is applied to maintain stable training dynamics. The parameters are updated at the end of each epoch using the Adam optimizer. Essentially, this process utilizes an optimization loop to update model parameters, ensemble loss evaluation, and perform backpropagation via Adam.

[0065] This invention achieves high-quality representation learning for new entities and relationships by using a relationship graph generation method based on graph convolutional networks and graph self-attention. By constructing a global relationship graph spanning different topologies, this invention ensures consistency in relationship interactions during training and inference. Updated relationship representations further guide the updating of entity representations, achieving a bidirectional promotion effect. Visualizing the global relationship graph allows observation of the distribution of relationships and entities in the embedding space, validating the effectiveness of this method in capturing relationship interactions and improving representation quality. Therefore, the method of this invention can effectively complete knowledge graphs and obtain high-quality relationship and entity representations in inductive scenarios with varying proportions of new relationships.

[0066] Table 1 provides a detailed description of the selected test data.

[0067] Table 1: Test Data

[0068]

[0069] Table 2 compares the experimental results of this invention with those of other knowledge graph completion methods on four metrics, including the average rank (MR) of correct entities, the average inverse rank (MRR) of correct entities, and the accuracy of the top 1 / 10 of correct entities (Hit@1 and Hit@10).

[0070] Table 2: Comparison Results of Knowledge Graph Completion Methods

[0071]

[0072] Based on the knowledge graph completion method shown in Figure 1, a relation graph is constructed for each topology from a global perspective (the entire graph). The invariance of relation structure is utilized, and relative relation embeddings are used to parameterize any unseen relations. Furthermore, an inductive knowledge graph completion model is proposed. This model can aggregate relation topology graphs and embeddings of new entities and relations in fully inductive scenarios to address the high complexity and limitations associated with sampling of closed subgraphs. This invention utilizes graph convolutional networks and graph attention networks, enabling efficient model training. The model possesses strong scalability and the ability to handle new relations, making it applicable to knowledge graphs with a large number of incomplete relationships. Experiments on multiple real-world datasets demonstrate that the proposed method achieves high accuracy even with entirely new relations and entities, proving its robustness and effectiveness. In e-commerce scenarios, this invention shows significant advantages in tasks such as cold start and long-tail recommendation, similarity and matching recall, and cross-category interest transfer, and is suitable for integrated offline and near-real-time deployment.

[0073] Example 2: E-commerce Recommendation System (Offline / Near Real-Time)

[0074] In this embodiment, the present invention is applied to the recall and similarity retrieval tasks of an e-commerce recommendation system.

[0075] Step 1, Entity and Relationship Modeling:

[0076] Entities: User u, Product i, Category c, Brand b, Theme / Tag t, Content / Activity a.

[0077] Relationships: u-browse -> i, u-add to cart -> i, u-purchase -> i, u-favorite -> i, i-same type -> i, i-same brand -> i, i-match -> i, i-similar -> i, i-belongs to -> c, i-brand -> b, i-theme -> t, etc.

[0078] Step 2, Construction of a multi-relationship graph:

[0079] Following steps one and two of Example 1, the above relationships are used to construct a multi-relationship graph 𝔸∈ based on the six topological patterns 'HT / TT / HH / TH / PARA / LOOP'. ^{6×M×M}.

[0080] Step 3, Training Phase (Offline):

[0081] A triplet set T_tr is generated from the behavior log (positive samples are derived from real interactions, and negative samples are formed by replacing the head / tail). Relationship / entity embedding learning and optimization are performed using steps three through nine of Example 1. For relationships or new entities not appearing during training, Glorot is used for initialization, and inductive representation is achieved through attention aggregation of the global topological relationship graph.

[0082] Step 4, Inference Phase (Offline / Near Real-Time):

[0083] New product i' launched: i''s inductive embedding is obtained by aggregating learned attention weights based solely on its neighborhood (category c, brand b, attribute t, entities extracted from text, etc.);

[0084] Recall Task A (User Recall Products): Predict the Top N tail entities of (u, Purchase / Add to Cart / Browse, ?);

[0085] Recall Task B (Similar / Matching Recall): Predict (i, Similar / Matching, ?) to obtain the set of similar / matching products;

[0086] The Top N candidates are output and then rearranged by the business (features such as price, timeliness, and exposure control can be incorporated).

[0087] Step 5, Deployment and Update Strategy:

[0088] Training: T+1 offline training or hourly incremental training;

[0089] Inference: Near real-time feature updates (minute-level), batch scoring or streaming scoring is both possible;

[0090] Resources: It can be trained offline on GPU and scored online on CPU, meeting offline / near real-time requirements.

[0091] Step Six, Indicators and Results:

[0092] Offline metrics: Recall@K, NDCG@K, MRR, Hit@K (pay special attention to cold start / long tail stratification);

[0093] Online metrics (if any): CTR, CVR, long-tail click contribution, exposure balance.

[0094] This embodiment utilizes a global topological relationship graph to stably learn the representation of relationships and entities in a fully inductive scenario, thereby enhancing cold start, new product, and long-tail recommendations in e-commerce scenarios.

[0095] In summary, the present invention has the following characteristics:

[0096] a. It leverages the invariance of relational structures to learn robust relation embeddings from a global perspective, driven by the data itself and without introducing additional prior knowledge. b. The global topological relational graph enables mutually reinforcing relationship embeddings and entity embeddings. c. It employs completely unsupervised learning, without relying on manual labeling. d. The model training is efficient and highly scalable, applicable to knowledge graph completion in fully inductive scenarios. e. It can be applied to numerous fields such as recommendation systems and search.

[0097] The above are one or more embodiments of the knowledge graph completion method provided in this specification. Based on the same idea, this specification also provides a corresponding knowledge graph completion device, including:

[0098] The classification module is used to obtain the relation topology structure to be completed and classify the relation topology structure based on the entity connection relationships in the relation topology structure;

[0099] The relation embedding learning module is used to construct a multi-relation graph containing all classification topological patterns. It updates the feature embeddings of nodes in the multi-relation graph through a graph neural network to learn the relation embedding process of the multi-relation graph.

[0100] The comprehensive relation embedding acquisition module is used to concatenate the feature embeddings of the multi-head self-attention mechanism to obtain the relation embedding of each specific pattern in the multi-relation graph, connect the relation embeddings of each specific pattern in the multi-relation graph, and apply adaptive weighted aggregation to obtain the comprehensive relation embedding.

[0101] The node embedding update module combines the original knowledge graph with relation embeddings and uses an attention mechanism to obtain the attention score for each entity pair and related relation; it then weights all adjacent entities and related relations based on the attention scores; and finally, based on the weighting result, it updates the embedding of the target node using aggregated information.

[0102] The embedding vector acquisition module is used to change the head or tail entities in positive triples to generate negative triples. It initializes entities and relations using their respective learned embeddings to set up forward propagation and acquire the embedding vectors of relations and entities.

[0103] The missing entity acquisition module is used to transform all link prediction tasks into tail entity prediction tasks. It inserts each candidate entity into the query triple and uses a knowledge graph embedding scoring function to return a scalar value representing the reasonableness of a given triple. The entity with the highest score is defined as the missing entity.

[0104] For specific limitations regarding the knowledge graph completion device, please refer to the limitations on the knowledge graph completion method above, which will not be repeated here. Each module in the aforementioned knowledge graph completion device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0105] This specification also provides a computer-readable storage medium storing a computer program that can be used to execute the knowledge graph completion method provided in Figure 1 above.

[0106] This specification also provides the structure of the computer device. At the hardware level, the computer device includes a processor, internal bus, network interface, memory, and non-volatile memory, and may also include other hardware required for business operations. The processor reads the corresponding computer program from the non-volatile memory into memory and then runs it to implement the knowledge graph completion method shown in Figure 1 above.

[0107] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this specification can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0108] Specifically, in e-commerce recommendation applications, the corresponding modules for each device are: Classification module: based on the e-commerce knowledge graph, statistically analyzes the topological patterns of relationships such as user-product-category-brand; Relationship embedding learning module: performs attention message passing on the e-commerce multi-relationship graph to learn the relationship embeddings under each topological pattern; Comprehensive relationship embedding acquisition module: performs multi-head attention and adaptive weighted aggregation on the six types of topological pattern embeddings; Node embedding update module: combines the original knowledge graph with comprehensive relationship embeddings, updating the embeddings of user / product entities through neighbor aggregation; Embedding vector acquisition module: generates offline and periodically updates user, product, and relationship vectors; Missing entity acquisition module: used for e-commerce recommendation recall and similarity retrieval, such as predicting (u, purchase, ?) or (i, similar, ?), outputting the set of entities with the highest scores as the recall result.

[0109] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

Claims

1. A method for knowledge graph induction and completion in a recommender system based on a global topological relationship graph, characterized in that, include: Obtain several candidate recommended items from the knowledge graph to be completed in the e-commerce recommendation system; The entities in the knowledge graph to be completed are users and items, and the relationships are browsing, adding to cart, purchasing, favorites, similarity, and matching. Based on the topological association of the relationship pairs between entities in the e-commerce recommendation system, a global relationship graph is constructed on six types of topologies: "head to tail", "tail to tail", "head to head", "tail to head", "parallel", and "loop". Based on the global relationship graph, various relationship embeddings are learned through a multi-head attention mechanism, and an adaptive weighting strategy is used to form a comprehensive relationship embedding. This comprehensive relationship embedding is then combined with the original knowledge graph of the e-commerce recommendation system. A dynamic attention mechanism is used to calculate the attention scores of the target entity, its neighboring entities, and corresponding recommendation relationships. Based on the attention weights, all neighboring entities and related recommendation relationships are weighted and aggregated. The target entity embedding and corresponding relationship embedding are then fused together based on the aggregation results to update the entity embeddings of users and items in the e-commerce recommendation system. Negative samples are generated by replacing user or item entities in the recommendation triples, and the learned entity embeddings and comprehensive relationships are then used to further refine these negative samples. The system embeds and initializes recommended entities and relationships, sets up forward propagation, and obtains the embedded vectors of recommended relationships and entities. It then uses a scoring function specific to the recommendation scenario to score positive and negative samples, optimizing the model with an interval-based ranking loss to obtain a link prediction model suitable for the recommendation system. The system transforms the link prediction task into a target item prediction task, inserting candidate recommended items one by one into the user-relationship query triples. Using the trained link prediction model and the knowledge graph embedding scoring function, it returns a scalar value representing the reasonableness of the user's item preference. The candidate item with the highest score is selected as the recommendation result, and the knowledge graph of the recommendation system is simultaneously completed.

2. The method for knowledge graph induction and completion in a recommendation system based on a global topological relationship graph as described in claim 1, characterized in that, The step of learning various relationship embeddings based on the global relationship graph through a multi-head attention mechanism specifically includes: ; ;in, For activation function, Here is the weight matrix for layer l; The adjacency relationship of layer l; The representation vector of layer l; For relationship The set of neighbors on graph A; Attention score; It is a row weight vector; || ] represents the vector concatenation operation.

3. The method for knowledge graph induction and completion in a recommendation system based on a global topological relationship graph as described in claim 2, characterized in that, The feature embeddings of the multi-head self-attention mechanism are concatenated to obtain the relation embeddings of each specific pattern in the multi-relation graph, specifically including: ; where || represents the concatenation operation, The weight matrix of the linear transformation associated with the k-th attention head.

4. The method for knowledge graph induction and completion in a recommendation system based on a global topological relationship graph as described in claim 3, characterized in that, The adoption of an adaptive weighting strategy to form a comprehensive relationship embedding specifically includes: Where r represents the topological graph; This represents the aggregate weight.

5. The method for knowledge graph induction and completion in a recommendation system based on a global topological relationship graph as described in claim 4, characterized in that, The method of embedding comprehensive relationships with the original knowledge graph of the e-commerce recommendation system and using a dynamic attention mechanism to calculate the attention score of the target entity, its neighboring entities, and the corresponding recommendation relationship specifically includes: ; ;in, Indicates connection and Specific relationship The relation vector at level L; This represents the dynamically learnable attention weights provided by GATv2.

6. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the method described in any one of claims 1 to 5.

7. A computer device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in any one of claims 1 to 5.