Knowledge graph embedding method based on quaternion double bidirectional rotation and dynamic translation and application thereof

By employing a knowledge graph embedding method based on quaternion double bidirectional rotation and dynamic translation, the semantic paths of head and tail entities are decoupled and nonlinear relationships are modeled. This solves the problem of inaccurate query results caused by the incompleteness of the knowledge graph, thereby improving the performance of intelligent search and question answering systems.

CN121809486APending Publication Date: 2026-04-07YUNNAN NORMAL UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-06
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

The incompleteness of existing knowledge graphs leads to inaccurate query results in intelligent search and question answering systems. Existing models cannot independently capture the heterogeneous semantic interaction relationships between head and tail entities and are difficult to model nonlinear relationship patterns, affecting the accuracy and robustness of search and question answering.

Method used

A knowledge graph embedding method based on quaternion dual bidirectional rotation and dynamic translation is adopted. By mapping entities and relations to quaternion vectors, the semantic transformation paths of the head and tail entities are decoupled using a dual bidirectional rotation mechanism, and nonlinear relations are modeled through a dynamic rotation translation mechanism. Combined with semantic matching score and geometric distance score, the independent transformation of the head and tail entities and the accurate modeling of nonlinear relations are achieved.

Benefits of technology

It improves the understanding depth and accuracy of complex queries, enabling more precise parsing of complex dependencies between entities, and significantly enhances the accuracy and robustness of intelligent search and question answering systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121809486A_ABST
    Figure CN121809486A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of knowledge maps, in particular to a knowledge map embedding method based on quaternion double bidirectional rotation and dynamic translation and application of the knowledge map embedding method. Mapping entities and relationships in the knowledge graph into quaternion vectors, and performing semantic transformation on a head entity and a tail entity by using a double bidirectional rotation mechanism to obtain a semantic matching score; performing geometric transformation on the head entity and the tail entity by using a dynamic rotation translation mechanism to obtain a geometric distance score; and finally, fusing the semantic matching score and the geometric distance score to obtain a final score of the triple. And updating model parameters according to the final score, and performing link prediction through the updated model. The method aims to solve the problem of inaccurate query results caused by incomplete knowledge maps and limited expression ability of existing models in intelligent search systems and the like, so that the performance of an application level is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of knowledge graph technology, and in particular to a knowledge graph embedding method based on quaternion double bidirectional rotation and dynamic translation and its application. Background Technology

[0002] Knowledge graphs, as a structured semantic knowledge base, describe concepts, entities, and complex relationships in the objective world in the form of triples (head entity, relation, tail entity). They have been widely used in key areas such as intelligent search, question answering systems, recommendation systems, and large language model enhancement.

[0003] However, real-world knowledge graphs are generally incomplete, lacking numerous real-world triple relationships, which hinders the performance of downstream applications. Take a typical intelligent search system as an example: it relies on knowledge graphs to understand user query intent and return accurate results. When a user enters "medications for treating hypertension," the system needs to find a link in the knowledge graph between the "hypertension" entity and the "medications" entity established through the "treatment" relationship. If this crucial link is missing in the knowledge graph, the system will be unable to return the correct list of medications, resulting in irrelevant search results or low recall, severely impacting user experience. Similarly, in question-answering systems, missing links in the knowledge graph can lead to incorrect answers or an inability to answer. Knowledge graph embedding, as a core technology for completing missing links, aims to map entities and relationships to a low-dimensional continuous vector space and uses a scoring function to measure the validity of triples, thereby predicting missing links. Its performance directly determines the effectiveness of the aforementioned applications.

[0004] Among the relevant technical solutions, hybrid models that attempt to integrate semantic and geometric information still suffer from two key drawbacks: First, their semantic module uses only a single relation vector to rotate both the head and tail entities, resulting in highly coupled semantic transformation paths between them. This makes it impossible to independently capture the heterogeneous and complex interactive dependencies between them. In practical applications, such as handling complex queries requiring multi-hop reasoning like "company-founder-person," the model cannot independently and precisely capture the different semantic roles of the head entity (company) and the tail entity (person) in their interaction with the 'founder,' thus limiting the system's ability to deeply understand complex queries and leading to superficial or inaccurate search or question-answering results. Second, the adaptive translation terms of its geometric distance module can only model linear relationships, making it difficult to flexibly express the non-linear key relationship patterns commonly found in knowledge graphs, thus limiting the model's expressive power and reasoning performance. In practical applications, this manifests as the model's inability to accurately distinguish and reason when dealing with variable relationship patterns such as "parent-child relationship" (symmetric) and "leader and follower" (inverse relationship), thereby affecting the precision of intelligent search and the credibility of the answers in the question-answering system.

[0005] Therefore, this application proposes a novel knowledge graph embedding method, which aims to decouple the semantic interaction paths of head and tail entities to improve the understanding depth of complex queries, and enhance the geometric module's ability to model nonlinear relationships to improve the reasoning accuracy and robustness in practical search systems. Summary of the Invention

[0006] The main purpose of this application is to provide a knowledge graph embedding method based on quaternion double bidirectional rotation and dynamic translation, which aims to solve the problem of inaccurate query results caused by incomplete knowledge graphs and limited expressive capabilities of existing models in intelligent search and other systems, thereby significantly improving the performance at the application level.

[0007] To achieve the above objectives, this application provides a knowledge graph embedding method based on quaternion double bidirectional rotation and dynamic translation, applied to a search system. The method includes the following steps:

[0008] S10, map the entities and relations in the knowledge graph to be processed into triples represented by quaternion vectors, wherein the triples include a relation vector, a head entity, and a tail entity;

[0009] S20, introduce two quaternion rotation vectors into each relation vector in the triplet, and perform left rotation transformation / right rotation transformation on the head entity and the tail entity based on the relation vector and the two quaternion rotation vectors, and use the inner product between the transformed head entity and the tail entity as the semantic matching score.

[0010] S30, introduce two rotation vectors and one translation vector into each relation vector in the triplet, perform Hamiltonian product rotation transformation on the head entity and the tail entity based on the two rotation vectors respectively, and take the L1 norm of the difference vector obtained by weighted sum of the head entity and tail entity after rotation transformation and the translation vector as the geometric distance score.

[0011] S40, the weighted sum of the semantic matching score and the geometric distance score is used as the target score corresponding to the triple;

[0012] S50, based on the target score, update the parameters of the knowledge graph embedding model of the search system so that the search system can perform connection prediction through the knowledge graph embedding model with updated parameters.

[0013] Optionally, in step S20, the step of performing left-rotation / right-rotation transformations on the head entity and the tail entity based on the relation vector and the two quaternion rotation vectors specifically includes:

[0014] S21, the relation vector and the relation vector The corresponding first quaternion rotation vector Second quaternion rotation vector Normalize them separately to obtain unit relation vectors Unit first quaternion rotation vector and the unit second quaternion rotation vector ;

[0015] S22, rotating the vector through the unit first quaternion. Perform a first right rotation on the head entity, then pass through the unit relation vector. Perform a second right rotation on the head entity to obtain the transformed head entity. :

[0016]

[0017] In the formula, h represents the head entity before the transformation;

[0018] S23, Determine the unit second quaternion rotation vector inverse rotation vector and the unit relation vector inverse relation vector Through the inverse rotation vector Perform a first left rotation on the tail entity, and then pass through the inverse relation vector. The tail entity is rotated left a second time to obtain the transformed tail entity. :

[0019]

[0020] In the formula, Represents the tail entity before the transformation;

[0021] Optionally, the semantic matching score The expression is:

[0022]

[0023] In the formula, This represents the transformed head entity. Represents the transformed tail entity .

[0024] Optionally, S30 includes:

[0025] S31, the relation vector The corresponding first rotation vector Second rotation vector Normalize each vector to obtain the unit first rotation vector. Unit second rotation vector ;

[0026] S32, via the unit first rotation vector Perform a Hamiltonian product on the head entity h, and through the unit second rotation vector Perform the Hamiltonian product on the tail entity t:

[0027]

[0028]

[0029] S33, Introducing Learnable Parameters and Weight the rotated vectors of the head and tail entities separately, and combine them with the translation vector. Calculate the difference vector after weighted translation:

[0030]

[0031] S34, take the L1 norm of the difference vector as the geometric distance score. :

[0032] .

[0033] Optionally, the target score The expression is:

[0034]

[0035] In the formula, λ is a learnable adaptive parameter used to balance the geometric distance score. and semantic matching score . contributions.

[0036] Optionally, the triple includes a relation vector r, a head entity h, and a tail entity t, and the expression for the triple is:

[0037]

[0038] In the formula, , and These represent the real units of the head entity, relation vector, and tail entity, respectively. , and These represent the three imaginary coefficients of the head entity; , and These represent the three imaginary coefficients of the relation vector; , and These represent the three imaginary coefficients of the tail entity; , , All represent imaginary units, which satisfy Hamilton's rule: .

[0039] Optionally, before step S30 or step S20, the method further includes:

[0040] Learnable parameter vectors Introducing global adjustment items For relation vectors Make minor adjustments.

[0041] Furthermore, to achieve the above objectives, this application also provides a knowledge graph embedding method based on quaternion double bidirectional rotation and dynamic translation as described in any of the preceding claims, for the application of predicting missing links in a knowledge graph.

[0042] In addition, to achieve the above objectives, this application also provides a computer system comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the knowledge graph embedding method based on quaternion dual bidirectional rotation and dynamic translation as described in any of the preceding claims.

[0043] In addition, to achieve the above objectives, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the knowledge graph embedding method based on quaternion double bidirectional rotation and dynamic translation as described in any of the preceding claims.

[0044] This application has at least the following beneficial effects:

[0045] 1. Addressing the issue of insufficient understanding depth in complex queries: By employing a dual bidirectional rotation mechanism, the semantic transformation paths of the head and tail entities are completely decoupled, enabling the model to independently capture their heterogeneous semantics within the relational context. In complex queries involving multiple constraints, it can more accurately parse the complex dependencies between entities, thereby returning more relevant and in-depth search results, thus improving the system's cognitive intelligence level and user satisfaction.

[0046] 2. To address the issue of inaccurate modeling of nonlinear relationships, a dynamic rotation translation mechanism was implemented to achieve relation-aware nonlinear rotation transformation, overcoming the expressive bottleneck of linear translation models. This technological improvement enables the system to accurately capture and model key relationship patterns such as "partner" (symmetric) and "superior" (antisymmetric), thereby significantly improving the accuracy and logical consistency of application output.

[0047] 3. Through adaptive fusion of semantic and geometric scoring, the method of this invention exhibits stronger robustness and accuracy in completing missing links in knowledge graphs. Attached Figure Description

[0048] Figure 1 This is a flowchart illustrating the knowledge graph embedding method based on quaternion double bidirectional rotation and dynamic translation involved in the embodiments of this application;

[0049] Figure 2 This is a schematic diagram of the hardware operating environment of the computer system involved in the embodiments of this application.

[0050] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0051] To better understand the above technical solutions, exemplary embodiments of this disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of this disclosure to those skilled in the art.

[0052] First Embodiment

[0053] Reference Figure 1 This embodiment provides a knowledge graph embedding method based on quaternion double bidirectional rotation and dynamic translation. This method is applied to a search system and includes the following steps:

[0054] S10, map the entities and relations in the knowledge graph to be processed into triples represented by quaternion vectors, wherein the triples include a relation vector, a head entity, and a tail entity;

[0055] In this embodiment, entities and relations in the knowledge graph are first mapped to quaternion vectors.

[0056] Specifically, the triple includes a relation vector r, a head entity h, and a tail entity t, and the expression for the triple is:

[0057]

[0058] In the formula, , and These represent the real units of the head entity, relation vector, and tail entity, respectively. , and These represent the three imaginary coefficients of the head entity; , and These represent the three imaginary coefficients of the relation vector; , and These represent the three imaginary coefficients of the tail entity; , , All represent imaginary units, which satisfy Hamilton's rule: .

[0059] S20, introduce two quaternion rotation vectors into each relation vector in the triplet, and perform left rotation transformation / right rotation transformation on the head entity and the tail entity based on the relation vector and the two quaternion rotation vectors, and use the inner product between the transformed head entity and the tail entity as the semantic matching score.

[0060] This embodiment proposes a dual bidirectional rotation mechanism to perform semantic transformation on the head and tail entities and obtain a semantic matching score.

[0061] It should be noted that the dual bidirectional rotation mechanism set in this embodiment is based on the principle of decoupling the semantic transformation paths of the head and tail entities, enabling the model to independently capture their heterogeneous semantics in the relational context. For example, when the search system processes complex queries involving multiple constraints, such as "finding people who are both executives of Company A and alumni of University B," it can more accurately parse the complex dependencies between entities, thereby returning more relevant and in-depth search results, improving the system's cognitive intelligence level and user satisfaction.

[0062] In this step, each relation vector Introduce two independent, learnable quaternion rotation vectors. and These are used for semantic transformation of the head and tail entities, respectively; then based on relation vectors... and the two quaternion rotation vectors and The head entity and the tail entity are subjected to left-hand rotation and right-hand rotation respectively, specifically including:

[0063] First, to avoid the scaling effect on semantic representation, in step S21, the relation vector is... and the relation vector The corresponding first quaternion rotation vector Second quaternion rotation vector Normalize them separately to obtain unit relation vectors Unit first quaternion rotation vector ; and the unit second quaternion rotation vector ;

[0064] in:

[0065]

[0066] In the formula, , , and Let represent the real coefficients and three imaginary coefficients of the first quaternion rotation vector, respectively. , , and These represent the real coefficients and three imaginary coefficients of the second quaternion rotation vector, respectively.

[0067] Next, in S22, the vector is rotated through the unit first quaternion. Perform a first right rotation on the head entity, then pass through the unit relation vector. Perform a second right rotation on the head entity to obtain the transformed head entity. :

[0068]

[0069] In the formula, h represents the head entity before the transformation;

[0070] S23, Determine the unit second quaternion rotation vector inverse rotation vector and the unit relation vector inverse relation vector Through the inverse rotation vector Perform a first left rotation on the tail entity, and then pass through the inverse relation vector. The tail entity is rotated left a second time to obtain the transformed tail entity. :

[0071]

[0072] in, Represents the tail entity before the transformation;

[0073] Further and optionally, the semantic matching score The expression is:

[0074]

[0075] In the formula, This represents the transformed head entity. Represents the transformed tail entity .

[0076] S30, introduce two rotation vectors and one translation vector into each relation vector in the triplet, perform Hamiltonian product rotation transformation on the head entity and the tail entity based on the two rotation vectors respectively, and take the L1 norm of the difference vector obtained by weighted sum of the head entity and tail entity after rotation transformation and the translation vector as the geometric distance score.

[0077] In this embodiment, we also propose a dynamic rotation translation mechanism, which performs geometric transformations on the head and tail entities to obtain a geometric distance score.

[0078] It should be noted that, in order to address the problem of inaccurate nonlinear relation modeling in traditional knowledge graphs, we propose a dynamic rotation translation mechanism to achieve relation-aware nonlinear rotation transformation, thus breaking through the expression bottleneck of traditional linear translation models.

[0079] For example, by capturing and modeling key relationship patterns such as "spouse" (symmetric) and "superior" (antisymmetric), search systems can make more accurate relational inferences. For instance, they can avoid incorrectly inferring "Zhang San's wife is Li Si" as "Li Si's wife is Zhang San," or more accurately infer the reporting hierarchy of a company, thereby significantly improving the accuracy and logical consistency of application outputs.

[0080] It is worth noting that steps S30 and S20 are parallel rather than progressive in execution logic; that is, when the search system determines the semantic matching score and geometric distance score of the knowledge graph to be processed, the two scores do not affect each other. However, the execution order is not limited in this embodiment.

[0081] Specifically, step S30 includes:

[0082] S31, the relation vector The corresponding first rotation vector Second rotation vector Normalize each vector to obtain the unit first rotation vector. Unit second rotation vector ;

[0083] Specifically, for each relationship Initialize a translation vector :

[0084]

[0085] In the formula, , , and Represent quaternions respectively real part, quaternion The coefficients corresponding to the three imaginary parts.

[0086] Based on translation vectors Construct a first rotation vector for rotating the relation-specific vectors of the head and tail entities. Second rotation vector :

[0087]

[0088]

[0089] In the formula, , , , Represent quaternions respectively The real part and the imaginary axis , , The coefficients corresponding to the three imaginary parts above; , , and Represent quaternions respectively The real part and the imaginary axis , , The coefficients corresponding to the three imaginary parts above;

[0090] Two rotation vectors and Convert to unit quaternions via normalization and To eliminate scaling effects:

[0091]

[0092]

[0093] S32, via the unit first rotation vector Perform a Hamiltonian product on the head entity h, and through the unit second rotation vector Perform the Hamiltonian product on the tail entity t:

[0094]

[0095]

[0096] It should be noted that we define the Hamiltonian product of two quaternions as:

[0097]

[0098] in, This represents element-wise multiplication; , , and Represent quaternions respectively real part, quaternion On the three imaginary axes , , The imaginary part coefficient; , , and Represent quaternions respectively real part, quaternion On the three imaginary axes , , The imaginary part coefficient.

[0099] Two quaternions and The inner product is defined as:

[0100] S33, Introducing Learnable Parameters and Weight the rotated vectors of the head and tail entities separately, and combine them with the translation vector. Calculate the difference vector after weighted translation:

[0101]

[0102] S34, take the L1 norm of the difference vector as the geometric distance score. :

[0103] .

[0104] S40, the weighted sum of the semantic matching score and the geometric distance score is used as the target score corresponding to the triple;

[0105] After completing steps S20 and S30, the semantic matching score and geometric distance score are weighted and fused using a learnable parameter λ to obtain the final target score of the triple:

[0106] Final target score The function expression is:

[0107]

[0108] In the formula, λ is a learnable adaptive parameter used to balance the geometric distance score. and semantic matching score . contributions.

[0109] S50, based on the target score, update the parameters of the knowledge graph embedding model of the search system so that the search system can perform connection prediction through the knowledge graph embedding model with updated parameters.

[0110] In this embodiment, after obtaining the target score, the parameters of the knowledge graph embedding model of the search system are updated based on the target score, thereby training the knowledge graph embedding model so that the search system can perform connection prediction through the knowledge graph embedding model with updated parameters.

[0111] In some optional implementations, the target score is used as the performance quantification standard of the knowledge graph embedding model. After each update, it is verified whether the target score of the knowledge graph embedding model for the current iteration is greater than a preset score threshold. If it is greater, it is considered to meet the performance requirements, and the knowledge graph embedding model for the current iteration is output for the search system to perform connection prediction. Otherwise, the parameters are updated.

[0112] The following example illustrates how a search system performs connection prediction using a knowledge graph embedding model with updated parameters:

[0113] For example, for a query The task is for the model to predict the most likely tail entity. For queries The task then requires predicting the most likely head entity. .

[0114] The specific operation is as follows: Taking the prediction of tail entities as an example, For all candidate entities The input is fed into the trained model to calculate its score. .

[0115] Finally, all candidate entities are sorted from highest to lowest according to their corresponding scores. The higher the ranking of a candidate entity, the greater the probability that it is a missing tail entity. Ultimately, the entity with the highest ranking is taken as the prediction result, or the Top-K results are returned.

[0116] In the technical solution provided in this embodiment, entities and relations in the knowledge graph are mapped as quaternion vectors. A dual bidirectional rotation mechanism is used to perform semantic transformation on the head and tail entities to obtain a semantic matching score. Then, a dynamic rotation translation mechanism is used to perform geometric transformation on the head and tail entities to obtain a geometric distance score. Finally, the semantic matching score and the geometric distance score are fused to obtain the final score of the triple. The model parameters are updated based on the final score, and the updated model is used to predict links, thereby providing high-quality embedding for upstream knowledge graph completion. Ultimately, this improves the query accuracy and result completeness of applications such as intelligent search when dealing with complex and heterogeneous relationships.

[0117] Second Embodiment

[0118] Based on the first embodiment, in this embodiment, for each relation By adding a learnable parameter vector, a global adjustment term is introduced for the relationship. Make minor adjustments: .in, It is a hyperparameter used to control the adjustment range; It is a normalized learnable vector that is shared by relations and provides a bias in direction.

[0119] Third Embodiment

[0120] Based on any of the above embodiments, this embodiment provides a method for setting the loss function during the parameter update process of a knowledge graph embedding model. Specifically, a negative sampling strategy and a logistic loss function with L2 regularization are adopted during training. Perform model optimization:

[0121]

[0122] in, Indicates the relation Connected head entity Tail-end entity The triplet formed Represents the set of observed triples. Denotes the set of triplets that have never been observed. Negative samples obtained by uniform sampling in the middle; The triplet labels are 1 for positive samples and -1 for negative samples; E and R are the embedding matrices for all entities and relations, respectively. and Here, E represents the entity embedding matrix and R represents the relation embedding matrix; This indicates the probability that a given triplet holds true in a vector space.

[0123] Furthermore, as an implementation scheme, this embodiment also provides a knowledge graph embedding method based on quaternion double bidirectional rotation and dynamic translation as described above, and its application in predicting missing links in a knowledge graph.

[0124] To verify the effectiveness of this patent, we conducted comparative experiments on the standard datasets FB15k-237, WN18RR, and WN18, comparing our proposed method with traditional methods. The experimental results are shown in Table 1. Our proposed method (Ours) achieved comprehensive performance leadership on the most challenging FB15K-237 dataset; on the WN18RR dataset, it matched the state-of-the-art DaBR model in MRR and achieved further breakthroughs in Hits@10, demonstrating that our method captures deep semantic relationships while possessing superior ranking retrieval capabilities; and on the relatively simple WN18 dataset, it achieved optimal values ​​for all metrics.

[0125] Table 1. Comparative Experiment Table

[0126]

[0127] Furthermore, as an implementation scheme, Figure 2 This is a schematic diagram of the hardware operating environment of the computer system involved in the embodiments of this application.

[0128] like Figure 2 As shown, the computer system may include: a processor 1001, such as a CPU; a memory 1005; a user interface 1003; a network interface 1004; and a communication bus 1002. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0129] Those skilled in the art will understand that Figure 2 The computer system architecture shown does not constitute a limitation on the computer system and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0130] like Figure 2As shown, the memory 1005, as a storage medium, may include an operating system, a network communication module, a user interface module, and computer programs. The operating system is a program that manages and controls the hardware and software resources of the computer system, as well as the operation of the computer programs and other software or programs.

[0131] exist Figure 2 In the computer system shown, the user interface 1003 is mainly used to connect to the terminal and communicate with the terminal; the network interface 1004 is mainly used to communicate with the backend server; and the processor 1001 can be used to call the computer program stored in the memory 1005.

[0132] In this embodiment, the computer system includes: a memory 1005, a processor 1001, and a computer program stored in the memory and executable on the processor, wherein:

[0133] When processor 1001 calls a computer program stored in memory 1005, it performs the following operations:

[0134] S10, map the entities and relations in the knowledge graph to be processed into triples represented by quaternion vectors, wherein the triples include a relation vector, a head entity, and a tail entity;

[0135] S20, introduce two quaternion rotation vectors into each relation vector in the triplet, and perform left rotation transformation / right rotation transformation on the head entity and the tail entity based on the relation vector and the two quaternion rotation vectors, and use the inner product between the transformed head entity and the tail entity as the semantic matching score.

[0136] S30, introduce two rotation vectors and one translation vector into each relation vector in the triplet, perform Hamiltonian product rotation transformation on the head entity and the tail entity based on the two rotation vectors respectively, and take the L1 norm of the difference vector obtained by weighted sum of the head entity and tail entity after rotation transformation and the translation vector as the geometric distance score.

[0137] S40, the weighted sum of the semantic matching score and the geometric distance score is used as the target score corresponding to the triple;

[0138] S50, based on the target score, update the parameters of the knowledge graph embedding model of the search system so that the search system can perform connection prediction through the knowledge graph embedding model with updated parameters.

[0139] When processor 1001 calls a computer program stored in memory 1005, it performs the following operations:

[0140] S21, the relation vector and the relation vector The corresponding first quaternion rotation vector Second quaternion rotation vector Normalize them separately to obtain unit relation vectors Unit first quaternion rotation vector ; and the unit second quaternion rotation vector ;

[0141] S22, rotating the vector through the unit first quaternion. Perform a first right rotation on the head entity, then pass through the unit relation vector. Perform a second right rotation on the head entity to obtain the transformed head entity. :

[0142]

[0143] S23, Determine the unit second quaternion rotation vector inverse rotation vector and the unit relation vector inverse relation vector Through the inverse rotation vector Perform a first left rotation on the tail entity, and then pass through the inverse relation vector. The tail entity is rotated left a second time to obtain the transformed tail entity. :

[0144]

[0145] When processor 1001 calls a computer program stored in memory 1005, it performs the following operations:

[0146] S31, the relation vector The corresponding first rotation vector Second rotation vector Normalize each vector to obtain the unit first rotation vector. Unit second rotation vector ;

[0147] S32, via the unit first rotation vector Perform a Hamiltonian product on the head entity h, and through the unit second rotation vector Perform the Hamiltonian product on the tail entity t:

[0148]

[0149]

[0150] S33, Introducing Learnable Parameters and Weight the rotated vectors of the head and tail entities separately, and combine them with the translation vector. Calculate the difference vector after weighted translation:

[0151]

[0152] S34, take the L1 norm of the difference vector as the geometric distance score. :

[0153] .

[0154] Furthermore, 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 includes program instructions and can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in a computer system to implement the process steps of the embodiments of the above methods.

[0155] Therefore, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the various steps of the knowledge graph embedding method based on quaternion dual bidirectional rotation and dynamic translation as described in the above embodiments.

[0156] The computer-readable storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.

[0157] It should be noted that, since the storage medium provided in the embodiments of this application is the storage medium used to implement the methods of the embodiments of this application, those skilled in the art can understand the specific structure and variations of the storage medium based on the methods described in the embodiments of this application, and therefore will not be repeated here. All storage media used in the methods of the embodiments of this application fall within the scope of protection of this application.

[0158] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0159] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0160] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0161] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0162] It should be noted that any reference signs placed between parentheses in the claims should not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. This application can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.

[0163] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0164] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A knowledge graph embedding method based on quaternion double bidirectional rotation and dynamic translation, characterized in that, Applied to a search system, the method includes the following steps: S10, map the entities and relations in the knowledge graph to be processed into triples represented by quaternion vectors, wherein the triples include a relation vector, a head entity, and a tail entity; S20, introduce two quaternion rotation vectors into each relation vector in the triplet, and perform left rotation transformation / right rotation transformation on the head entity and the tail entity based on the relation vector and the two quaternion rotation vectors, and use the inner product between the transformed head entity and the tail entity as the semantic matching score. S30, introduce two rotation vectors and one translation vector into each relation vector in the triplet, perform Hamiltonian product rotation transformation on the head entity and the tail entity based on the two rotation vectors respectively, and take the L1 norm of the difference vector obtained by weighted sum of the head entity and tail entity after rotation transformation and the translation vector as the geometric distance score. S40, the weighted sum of the semantic matching score and the geometric distance score is used as the target score corresponding to the triple; S50, based on the target score, update the parameters of the knowledge graph embedding model of the search system so that the search system can perform connection prediction through the knowledge graph embedding model with updated parameters.

2. The knowledge graph embedding method based on quaternion double bidirectional rotation and dynamic translation as described in claim 1, characterized in that, In step S20, the step of performing left-rotation / right-rotation transformations on the head entity and the tail entity based on the relation vector and the two quaternion rotation vectors specifically includes: S21, the relation vector and the relation vector The corresponding first quaternion rotation vector Second quaternion rotation vector Normalize them separately to obtain unit relation vectors Unit first quaternion rotation vector ; and the unit second quaternion rotation vector ; S22, rotating the vector through the unit first quaternion. Perform a first right rotation on the head entity, then pass through the unit relation vector. Perform a second right rotation on the head entity to obtain the transformed head entity. : ; In the formula, h represents the head entity before the transformation; S23, Determine the unit second quaternion rotation vector inverse rotation vector and the unit relation vector inverse relation vector Through the inverse rotation vector Perform a first left rotation on the tail entity, and then pass through the inverse relation vector. The tail entity is rotated left a second time to obtain the transformed tail entity. : ; In the formula, This represents the tail entity before the transformation.

3. The knowledge graph embedding method based on quaternion dual bidirectional rotation and dynamic translation as described in claim 2, characterized in that, The semantic matching score The expression is: ; In the formula, This represents the transformed head entity. This represents the transformed tail entity.

4. The knowledge graph embedding method based on quaternion double bidirectional rotation and dynamic translation as described in claim 1, characterized in that, S30 includes: S31, the relation vector The corresponding first rotation vector Second rotation vector Normalize each vector to obtain the unit first rotation vector. Unit second rotation vector ; S32, via the unit first rotation vector Perform a Hamiltonian product on the head entity h, and through the unit second rotation vector Perform the Hamiltonian product on the tail entity t: ; ; S33, Introducing Learnable Parameters and Weight the rotated vectors of the head and tail entities separately, and combine them with the translation vector. Calculate the difference vector after weighted translation: ; S34, take the L1 norm of the difference vector as the geometric distance score. : 。 5. The knowledge graph embedding method based on quaternion double bidirectional rotation and dynamic translation as described in claim 1, characterized in that, The target score The expression is: ; In the formula, λ is a learnable adaptive parameter used to balance the geometric distance score. and semantic matching score . contributions.

6. The knowledge graph embedding method based on quaternion dual bidirectional rotation and dynamic translation as described in claim 1, characterized in that, The triplet comprises a relation vector r, a head entity h, and a tail entity t, and the expression for the triplet is: ; In the formula, , and These represent the real units of the head entity, relation vector, and tail entity, respectively. , and These represent the three imaginary coefficients of the head entity; , and These represent the three imaginary coefficients of the relation vector; , and These represent the three imaginary coefficients of the tail entity; , , All represent imaginary units, which satisfy Hamilton's rule: .

7. The knowledge graph embedding method based on quaternion double bidirectional rotation and dynamic translation as described in any one of claims 1 to 6, characterized in that, Before step S30 or step S20, the following is also included: Learnable parameter vectors Introducing global adjustment items For relation vectors Make minor adjustments.

8. The application of a knowledge graph embedding method based on quaternion double bidirectional rotation and dynamic translation as described in any one of claims 1 to 7 in predicting missing links in a knowledge graph.

9. A computer system, characterized in that, The computer system includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, it implements the steps of the knowledge graph embedding method based on quaternion dual bidirectional rotation and dynamic translation as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the knowledge graph embedding method based on quaternion double bidirectional rotation and dynamic translation as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Time sequence knowledge graph representation learning method based on quaternion rotation

    CN114756651A

  • Reverse relation rotation embedding knowledge representation method and system based on convolution quaternion

    CN115481256A

  • Relation-enhancement knowledge graph embedding method and system

    US20230297553A1