Most domain space fusion knowledge graph embedding method, system, device and medium

By combining rotational transformations of the real number field, complex number field, and quaternion field in the knowledge graph embedding method, the problem of difficulty in modeling complex relationships in a single number field space is solved, the triple matching accuracy of the knowledge graph completion task is improved, and it is suitable for large-scale knowledge graph applications.

CN115795050BActive Publication Date: 2026-03-24CHENGDU UNION BIG DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-02
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing knowledge graph embedding methods are difficult to effectively model complex relationships, such as symmetrical relationships, one-to-many relationships, and many-to-one relationships. Single domain space transformations are insufficient to meet modeling requirements.

Method used

A multi-domain space fusion approach is adopted, combining rotational transformations of the real number field, complex number field, and quaternion field. The relationship of triples is modeled in different number domain spaces through an attention mechanism, and the gradient descent algorithm is used for iterative training to improve the accuracy of the knowledge graph embedding model.

Benefits of technology

It improves the accuracy of triple matching in knowledge graph completion tasks, effectively models complex relationships, and is suitable for large-scale knowledge graph applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115795050B_ABST
    Figure CN115795050B_ABST
Patent Text Reader

Abstract

The application provides a multi-domain space fusion knowledge graph embedding method, system, device and medium, and relates to the field of knowledge graph embedding.The method comprises the following steps: (1) constructing a training set; (2) performing initialization processing on the training set; (3) performing sampling processing on the training set to construct a training subset; (4) importing the training subset into a knowledge graph embedding model to obtain triple scores and attention scores in different number domain spaces; (5) iteratively training the knowledge graph embedding model using the triple scores and attention scores in different number domain spaces until convergence; and (6) inputting triples of a knowledge graph into the iteratively trained knowledge graph embedding model for completion.The application combines attention mechanisms with calculations in real number domains, complex number domains and quaternion number domains to capture feature information of entities from different spaces and deeply depict spatial representations of entities and relationships, thereby improving the accuracy of triple matching in a knowledge graph completion task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of knowledge graph embedding, and more specifically, to a method, system, device, and medium for knowledge graph embedding with multi-domain spatial fusion. Background Technology

[0002] Knowledge graph embedding is one of the important methods for solving the knowledge graph completion problem. This technique learns the features of nodes and edges in the knowledge graph and represents them as low-dimensional dense vectors. Research on knowledge graph embedding mainly focuses on modeling entities and relations in triples. Current research usually uses a similarity theory to characterize the connections between entities and relations.

[0003] Currently, knowledge graph embedding primarily employs translation or rotation models to model the relationship between the head and tail entities in triples. Translation models assume a translation relationship between the head and tail entities in a triple, meaning that the head entity h, after being translated by relation r, will approach the tail entity t. Rotation models, on the other hand, assume a rotation relationship between the head and tail entities in a triple, meaning that the head entity h, after being rotated by the rotation matrix represented by relation r, will approach the tail entity t. Translation models can model asymmetric and combinatorial relationships, but cannot model symmetric, one-to-many, or many-to-one complex relationships. Rotation models address this issue, but still cannot solve the problem of modeling multiple complex relationships. Summary of the Invention

[0004] This invention provides a knowledge graph embedding method, system, device, and medium that integrates multiple domain spaces. It uses a rotation model as a base point and combines rotation transformations under different domain spaces to model complex relationships in existing knowledge graphs.

[0005] In a first aspect, embodiments of the present invention provide a knowledge graph embedding method for multi-domain spatial fusion, the method comprising the following steps:

[0006] (1) Construct a training set based on the triples and attention parameters of the knowledge graph, and import the training set into the knowledge graph embedding model;

[0007] (2) Initialize the triplet and attention parameters in different number domains;

[0008] (3) Sample the training set to construct a training subset Δ new_batch ;

[0009] (4) The training subset Δ new_batch Import the knowledge graph embedding model and obtain attention scores and triplet scores in different number domain spaces based on rotation transformation;

[0010] (5) Use attention scores and triplet scores in different number domains to iteratively train the knowledge graph embedding model until convergence;

[0011] (6) Input the triples of the knowledge graph into the knowledge graph embedding model after iterative training to complete it.

[0012] In the above embodiments, by combining triples and attention mechanisms in the real number domain, complex number domain, and quaternion domain, feature information of entities (head entities or tail entities) is captured from different spaces, deeply characterizing the spatial representation of entities and relationships, thereby improving the accuracy of triple matching in knowledge graph completion tasks.

[0013] As some alternative implementations of this application, the triple includes a head entity h, a relation r, and a tail entity t.

[0014] As some optional implementations of this application, the steps for initializing triples and attention parameters in different number domains are as follows:

[0015] (2.1) Randomly initialize the head entity h and tail entity t of the triples in the training set as one-dimensional vectors to obtain the entity embedding vector e, wherein the entity embedding vector e includes the head entity embedding vector e. h End-of-tail entity embedding vector e t The relation r of the triples in the training set is randomly initialized as a one-dimensional vector to obtain the relation embedding vector e. r Furthermore, the attention parameters are initialized as a one-dimensional vector, resulting in the attention parameter vector α. r ;

[0016] (2.2) In the real space, embed the entity embedding vector e and the relation embedding vector e r As input to the knowledge graph embedding model;

[0017] (2.3) In the complex space, embed the entity embedding vector e and the relation embedding vector e r Transform it into a complex vector and use the complex vector as input to the knowledge graph embedding model;

[0018] (2.4) In the quaternion space, embed the entity embedding vector e and the relation embedding vector e r It is transformed into a quaternion vector, and the quaternion vector is used as the input to the knowledge graph embedding model.

[0019] In the above embodiments, by initializing the triples and attention parameters, triple data of the training set in different number domains can be obtained, which facilitates the subsequent construction of the training subset Δ. new_batch Quickly obtain the relevant data.

[0020] As one of the optional implementations of this application, the training set is sampled to construct a training subset Δ. new_batch The steps are as follows:

[0021] (3.1) Sample several triples and attention parameters from the training set to construct a training subset Δ batch And mark the triples as positive examples;

[0022] (3.2) Replace the tail entity of the triple to obtain the incorrect triple and mark the incorrect triple as a negative example;

[0023] (3.3) Add negative examples to positive examples to construct a new training subset Δ new_batch .

[0024] (1) In the above embodiments, by constructing a training subset Δ new_batch Training knowledge graph embedding models, which involves modeling complex knowledge graph relationships using fewer parameters, is beneficial for large-scale knowledge graph applications.

[0025] As some optional implementations of this application, the steps for obtaining attention scores and triplet scores in different number domain spaces based on rotation transformation are as follows:

[0026] (4.1) Obtain the training subset Δ new_batch The head entity embedding vector e of the middle triple h and relation embedding vector e r ;

[0027] (4.2) In the real space, for the relation embedding vector e r Perform a rotation transformation to obtain the rotation matrix M in real space. r And based on the rotation matrix M r and head entity embedding vector e h Obtain the head entity embedding vector f of the rotation transformation. E =M r e h ;

[0028] (4.3) In complex space, for the head entity embedding vector e h Perform a rotation transformation to obtain the head entity embedding vector f after the rotation transformation. C ;

[0029] (4.4) In the quaternion space, the embedding vector e of the head entity is... h Perform a rotation transformation to obtain the head entity embedding vector f after the rotation transformation. Q ;

[0030] (4.5) Embed the head entity in complex space into the vector f CThe concatenation results in a complex concatenation vector f′ with the same dimensions as the real-time space. C Embed the head entity in the quaternion space into the vector f Q The concatenation results in a quaternion concatenation vector f′ with the same dimensions as the real-time space. Q ;

[0031] (4.6) Based on head entity embedding vector f E Complex concatenation vector f′ C Quaternion concatenation vector f′ Q and attention parameter vector α r Calculate the attention score a in different number domain spaces. E ,a C ,a Q ;

[0032] (4.7) Attention score a based on different number domain spaces E ,a C ,a Q and tail entity embedding vector e t Calculate the triplet fractions under transformations in different number fields.

[0033] As some optional implementations of this application, the steps for iteratively training the knowledge graph embedding model are as follows:

[0034] (5.1) Based on the training subset Δ new_batch Calculate the training subset Δ for all triplet scores. new_batch The loss function;

[0035] (5.2) The gradient descent algorithm is used to update the entity embedding vector e and the relation embedding vector e of the triple. r and attention parameter vector α r ;

[0036] (5.3) Repeatedly construct new training subsets Δ new_batch And based on the new training subset Δ new_batch Train the knowledge graph embedding model until it converges.

[0037] As some optional implementations of this application, the steps for inputting the triples of the knowledge graph into the iteratively trained knowledge graph embedding model for completion are as follows:

[0038] (6.1) Input the triples of the knowledge graph into the iteratively trained knowledge graph embedding model, and complete the triples through the knowledge graph embedding model;

[0039] (6.2) Calculate the triple score of the triple by using the knowledge embedding model. When the triple score is greater than the preset threshold T, the corresponding triple completion is successful; otherwise, the triple completion is unsuccessful.

[0040] In a second aspect, the present invention provides a knowledge graph embedding system for multi-domain spatial fusion, the system comprising:

[0041] A training set construction unit constructs a training set based on triples and attention parameters of the knowledge graph, and imports the training set into the knowledge graph embedding model.

[0042] A data initialization unit is used to initialize triples and attention parameters in different data domain spaces.

[0043] Training subset construction unit, which is used to sample the training set and construct a training subset Δ new_batch ;

[0044] The triplet score acquisition unit is used to obtain the training subset Δ new_batch Import the knowledge graph embedding model and obtain attention scores and triplet scores in different number domain spaces based on rotation transformation;

[0045] A knowledge graph embedding model training unit is used to iteratively train the knowledge graph embedding model until convergence using attention scores and triplet scores in different number domains.

[0046] The knowledge graph embedding and completion unit is used to complete the knowledge graph embedding model by inputting the triples of the knowledge graph into the iteratively trained knowledge graph.

[0047] In a third aspect, the present invention provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor performing the knowledge graph embedding method of multi-domain spatial fusion.

[0048] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the knowledge graph embedding method for multi-domain spatial fusion.

[0049] The beneficial effects of this invention are as follows:

[0050] (2) This invention solves the problem that a single number domain space transformation is difficult to model complex spatial relationships. By combining multiple number domain spaces, it constructs complex transformations to model the spatial relationships that the knowledge graph conforms to, thereby improving the accuracy of the knowledge graph in all tasks.

[0051] (3) This invention can model complex knowledge graph relationships by using fewer parameters, which is beneficial for the application of large-scale knowledge graphs. Attached Figure Description

[0052] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0053] Figure 1 This is a flowchart illustrating the steps of the knowledge graph embedding method according to an embodiment of the present invention;

[0054] Figure 2 This is a schematic diagram of data processing for the knowledge graph embedding model according to an embodiment of the present invention. Detailed Implementation

[0055] To better understand the above technical solutions, the technical solutions of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solutions of the present invention, rather than limitations on the technical solutions of the present invention. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.

[0056] It should also be understood that, in order to simplify the description of the invention and thus aid in the understanding of at least one embodiment, multiple features may sometimes be grouped into a single embodiment, drawing, or description thereof in the foregoing description of the embodiments of the invention. However, this method of disclosure does not imply that the subject matter of the invention requires more features than those mentioned in the claims. In fact, the embodiments contain fewer features than all the features of the single embodiment disclosed above.

[0057] Example 1

[0058] This invention provides a knowledge graph embedding method for multi-domain spatial fusion, the method comprising:

[0059] (1) Construct a training set based on the triples and attention parameters of the knowledge graph, and import the training set into the knowledge graph embedding model; wherein, the triples include the head entity h, the relation r and the tail entity t, that is, (h,r,t), and the knowledge graph is an existing knowledge graph.

[0060] (2) Initialize the triples and attention parameters in different number domains.

[0061] In this embodiment of the invention, the steps for initializing the triples and attention parameters are as follows:

[0062] (2.1) The head entity h and tail entity t of the triples in the training set are randomly initialized as n-dimensional vectors with each component value in the range (0,1) to obtain the entity embedding vector e, which includes the head entity embedding vector e. h End-of-tail entity embedding vector e t The relation r of the triples in the training set is randomly initialized into an n-dimensional vector with each component value in the range (0,1), resulting in the relation embedding vector e. r Furthermore, the attention parameters are initialized as an n-dimensional vector with each component value in the range (0,1), resulting in the attention parameter vector α. r , where the relation embedding vector e r and attention parameter vector α r One-to-one correspondence.

[0063] (2.2) In the real space, embed the entity embedding vector e and the relation embedding vector e r As input to the knowledge graph embedding model;

[0064] (2.3) In the complex space, embed the entity embedding vector e and the relation embedding vector e r Transform it into a complex vector and use the complex vector as input to the knowledge graph embedding model;

[0065] The complex number transformation formula is as follows: R represents the real number field, and n represents the dimension of the real number embedding vector.

[0066] Because the entity embedding vector:

[0067] e = [e1, e2, ..., e n ]

[0068] Therefore, in the real part of the complex space:

[0069]

[0070] In the imaginary part of the complex space:

[0071]

[0072] Where a represents the real part of the complex space, b represents the imaginary part of the complex space, C represents the complex space, and n represents the dimension of the real number embedding vector;

[0073] (2.4) In the quaternion space, embed the entity embedding vector e and the relation embedding vector e r It is transformed into a quaternion vector, and the quaternion vector is used as the input to the knowledge graph embedding model.

[0074] The quaternion conversion formula is as follows:

[0075]

[0076] Because the entity embedding vector:

[0077] e = [e1, e2, ..., e n ]

[0078] Therefore, in the real part of the quaternion space:

[0079]

[0080] The imaginary part of the quaternion space:

[0081]

[0082]

[0083]

[0084] Where a represents the real part of the quaternion space, b represents the imaginary part of the quaternion space, c represents the imaginary part of the quaternion space, d represents the imaginary part of the quaternion space, Q represents the quaternion space, and n represents the dimension of the real number embedding vector.

[0085] (3) Sample the training set to construct a training subset Δ new_batch ;

[0086] In this embodiment of the invention, a training subset Δ is constructed. new_batch The steps are as follows:

[0087] (3.1) Sample several triples (h,r,t) and attention parameters from the training set to construct a training subset Δ batch And mark the triples as positive examples;

[0088] (3.2) Replace the tail entity of the triple to obtain the incorrect triple (h,r,t'), and mark the incorrect triple as a negative example;

[0089] (3.3) Add negative examples to positive examples to construct a new training subset Δnew_batch ;

[0090] Where, Δ new_batch ={(h,r,t,y)}, where y = 1 when the triplet is a positive example and -1 when it is a negative example.

[0091] (4) The training subset Δ new_batch To import a knowledge graph embedding model and obtain attention scores and triplet scores in different number domains, please refer to [link / reference]. Figure 2 ;

[0092] In this embodiment of the invention, the steps for obtaining attention scores and triplet scores in different number domains based on rotation transformation are as follows:

[0093] (4.1) Obtain the training subset Δ new_batch The head entity embedding vector e of the middle triple h and relation embedding vector e r ;

[0094] (4.2) In the real space, for the relation embedding vector e r Perform a rotation transformation to obtain the rotation matrix M in real space. r And based on the rotation matrix M r and head entity embedding vector e h Obtain the head entity embedding vector f of the rotation transformation. E =M r e h ;

[0095] The calculation formulas involved are as follows:

[0096] relation embedding vector e r =[e r,1 ,e r,2 ,…,e r,n ];

[0097] Cosine relation components based on relation vectors:

[0098]

[0099]

[0100] Submatrices based on cosine and sine relation components:

[0101]

[0102] Rotation matrix based on submatrices:

[0103]

[0104] Based on the rotation matrix Mr and head entity embedding vector e h Obtain the head entity embedding vector for the rotation transformation: f E =M r e h .

[0105] (4.3) In the complex space, the head entity embedding vector e is obtained by using complex multiplication. h Perform a rotation transformation to obtain the head entity embedding vector f after the rotation transformation. C ;

[0106] The calculation formulas involved are as follows:

[0107]

[0108] in, This represents the real part of the head entity embedding vector in complex space. Represents the imaginary part of the head entity embedding vector in complex space; Represents the real part of the relation embedding vector in the complex space. It represents the imaginary part of the relation embedding vector in the complex space; This represents the product of the real parts of the head entity embedding vector and the relation embedding vector in the complex space. This represents the product of the imaginary parts of the head entity embedding vector and the relation embedding vector in the complex space.

[0109] (4.4) In the quaternion space, the embedding vector e of the head entity is... h Perform a rotation transformation to obtain the head entity embedding vector f after the rotation transformation. Q ;

[0110] The calculation process involved is as follows:

[0111]

[0112] in,

[0113]

[0114] therefore,

[0115]

[0116] The quaternion space has one real part and three imaginary parts. This represents the real part of the head entity embedding vector in the quaternion space. Represents the imaginary part of the head entity embedding vector in the quaternion space. Represents the imaginary part of the head entity embedding vector in the quaternion space. Represents the imaginary part of the head entity embedding vector in the quaternion space; represents the real part of the relation embedding vector in the quaternion space. Represents the imaginary part of the relation embedding vector in the quaternion space. Represents the imaginary part of the relation embedding vector in the quaternion space. Represents the imaginary part of the relation embedding vector in the quaternion space; This represents the product of the real parts of the head entity embedding vector and the relation embedding vector in the quaternion space. These represent the product of the imaginary parts of the head entity embedding vector and the relation embedding vector in the quaternion space, respectively.

[0117] (4.5) Embed the head entity in complex space into the vector f C The concatenation results in a complex concatenation vector f′ with the same dimensions as the real-time space. C Embed the head entity in the quaternion space into the vector f Q The concatenation results in a quaternion concatenation vector f′ with the same dimensions as the real-time space. Q ;

[0118] Specifically, concatenating complex vectors:

[0119]

[0120] Quaternion concatenation vector:

[0121] (4.6) Based on head entity embedding vector f E Complex concatenation vector f′ C Quaternion concatenation vector f′ Q and attention parameter vector α r Calculate the attention score (a) in different number domain spaces. E ,a C ,a Q ) = Softmax(α r f E ,α r f′ C ,α r f′ Q ), where Softmax is an existing normalized exponential function, so the detailed calculation process of the function will not be described in detail.

[0122] (4.7) Attention score a based on different number domain spaces E ,a C ,a Q and tail entity embedding vector e t Calculate the triplet fractions under transformations in different number domains;

[0123] Specifically, attention-based head entity embedding transformation Att(f) E ,f C ,f Q ;α r ) = a E f E +a C f′ C +a Q f′ Q Therefore, the triplet score is Score = Att(f E ,f C ,f Q ;α r )e t ;

[0124] (5) Iteratively train the knowledge graph embedding model using triplet scores and attention scores in different number domains;

[0125] In this embodiment of the invention, the steps for iteratively training the knowledge graph embedding model are as follows:

[0126] (5.1) Based on the training subset Δ new_batch Calculate the training subset Δ for all triplet scores. new_batch The loss function;

[0127] (5.2) The gradient descent algorithm is used to update the entity embedding vector e and the relation embedding vector e of the triple. r and attention parameter vector α r ;

[0128] (5.3) Repeatedly construct new training subsets Δ new_batch And based on the new training subset Δ new_batch Train the knowledge graph embedding model until it converges, and retain the entity embedding vector e and relation embedding vector e at this point. r and attention parameter vector α r .

[0129] (6) Input the triples of the knowledge graph into the knowledge graph embedding model after iterative training to complete it.

[0130] In this embodiment of the invention, the steps for completing the knowledge graph are as follows:

[0131] (6.1) Input the triples of the knowledge graph into the iteratively trained knowledge graph embedding model, and complete the triples through the knowledge graph embedding model. The knowledge graph is the knowledge graph to be completed.

[0132] (6.2) Calculate the triple score of the triple by using the knowledge embedding model. When the triple score is greater than the preset threshold T, the corresponding triple completion is successful; otherwise, the triple completion is unsuccessful.

[0133] In the above embodiments, by combining the attention mechanism with computation in the real number domain, complex number domain, and quaternion domain, feature information of entities is captured from different spaces, deeply characterizing the spatial representation of entities and relationships, thereby improving the accuracy of triple matching in knowledge graph completion tasks.

[0134] Example 2

[0135] This invention provides a knowledge graph embedding system for multi-domain spatial fusion, the system comprising:

[0136] A training set construction unit constructs a training set based on triples and attention parameters of the knowledge graph, and imports the training set into the knowledge graph embedding model.

[0137] A data initialization unit is used to initialize triples and attention parameters in different data domain spaces.

[0138] Training subset construction unit, which is used to sample the training set and construct a training subset Δ new_batch ;

[0139] The triplet score acquisition unit is used to obtain the training subset Δ new_batch Import the knowledge graph embedding model and obtain attention scores and triplet scores in different number domain spaces based on rotation transformation;

[0140] A knowledge graph embedding model training unit is used to iteratively train the knowledge graph embedding model until convergence using attention scores and triplet scores in different number domains.

[0141] The knowledge graph embedding and completion unit is used to complete the knowledge graph embedding model by inputting the triples of the knowledge graph into the iteratively trained knowledge graph.

[0142] Example 3

[0143] This invention provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the computer program executes a knowledge graph embedding method for multi-domain spatial fusion as described in Embodiment 1 when the processor is running.

[0144] The computer device provided in this embodiment can implement the method described in Embodiment 1. To avoid repetition, it will not be described again here.

[0145] Example 4

[0146] This invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements a knowledge graph embedding method for multi-domain spatial fusion as described in Embodiment 1.

[0147] The computer-readable storage medium provided in this embodiment can implement the method described in Embodiment 1. To avoid repetition, it will not be described again here.

[0148] The processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0149] The memory can be used to store the computer program and / or modules. The processor implements various functions of the knowledge graph embedding system with multi-domain spatial fusion in the invention by running or executing the data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, RAM, plug-in hard disk, smart memory card, secure digital card, flash memory card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0150] Most knowledge graph embedding systems that integrate domain spaces, if implemented as software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program that can be stored in a computer-readable storage medium. When executed by a processor, this computer program can implement the steps of the various method embodiments described above. The computer program includes computer program code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory, random access memory, dot carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.

[0151] The basic concepts of this invention have been described. It is obvious to those skilled in the art that the detailed disclosure above is merely illustrative and does not constitute a limitation of this specification. Although not explicitly stated herein, those skilled in the art may make various modifications, improvements, and corrections to this specification. Such modifications, improvements, and corrections are suggested in this specification and therefore remain within the spirit and scope of the exemplary embodiments described herein.

[0152] Computer storage media may contain a propagated data signal containing computer program code, for example, on baseband or as part of a carrier wave. This propagated signal may take various forms, including electromagnetic, optical, and suitable combinations thereof. Computer storage media can be any computer-readable medium other than a computer-readable storage medium, which can be connected to an instruction execution system, apparatus, or device to enable communication, propagation, or transmission of a program for use. The program code located on the computer storage medium can be propagated through any suitable medium, including radio, cable, fiber optic cable, RF, or similar media, or any combination of the above media.

Claims

1. A knowledge graph embedding method for multi-domain spatial fusion, characterized in that, The method includes the following steps: (1) Construct a training set based on the triples and attention parameters of the knowledge graph, and import the training set into the knowledge graph embedding model; (2) Initialize the triples and attention parameters in different number domains; (3) Sample the training set to construct a training subset Δ new_batch ; (4) The training subset Δ new_batch Import the knowledge graph embedding model and obtain attention scores and triplet scores in different number domain spaces based on rotation transformation; The steps for obtaining attention scores and triplet scores in different number domains based on rotation transformation are as follows: (4.1) Obtain the training subset Δ new_batch The head entity embedding vector e of the middle triple h and relation embedding vector e r ; (4.2) In the real space, for the relation embedding vector e r Perform a rotation transformation to obtain the rotation matrix M in real space. r And based on the rotation matrix M r and head entity embedding vector e h Obtain the head entity embedding vector f of the rotation transformation. E ; (4.3) In complex space, for the head entity embedding vector e h Perform a rotation transformation to obtain the head entity embedding vector f after the rotation transformation. C ; (4.4) In the quaternion space, the head entity embedding vector e h Perform a rotation transformation to obtain the head entity embedding vector f after the rotation transformation. Q ; (4.5) Embed the head entity in the complex space into the vector f C Concatenate them into a complex concatenated vector with the same dimensions as the real-time space. Embed the head entity in the quaternion space into the vector f Q Concatenate them into a quaternion concatenation vector with the same dimensions as the real-time space. ; (4.6) Based on the head entity embedding vector f E Complex concatenation vectors Quaternion concatenation vector and attention parameter vector α r Calculate the attention score a in different number domain spaces. E ,a C ,a Q ; (4.7) Attention score a based on different number domain spaces E ,a C ,a Q and tail entity embedding vector e t Calculate the triplet fractions under transformations in different number domains; (5) The knowledge graph embedding model is iteratively trained until convergence using attention scores and triplet scores in different number domains; (6) Input the triples of the knowledge graph into the knowledge graph embedding model after iterative training to complete it.

2. The knowledge graph embedding method for multi-domain spatial fusion according to claim 1, characterized in that, The triple includes a head entity h, a relation r, and a tail entity t.

3. The knowledge graph embedding method for multi-domain spatial fusion according to claim 2, characterized in that, The steps for initializing triples and attention parameters in different number domains are as follows: (2.1) Randomly initialize the head entity h and tail entity t of the triples in the training set as n-dimensional vectors to obtain the entity embedding vector e, wherein the entity embedding vector e includes the head entity embedding vector e. h End-of-tail entity embedding vector e t The relation r of the triples in the training set is randomly initialized as an n-dimensional vector to obtain the relation embedding vector e. r Furthermore, the attention parameters are initialized as an n-dimensional vector, resulting in the attention parameter vector α. r ; (2.2) In the real space, embed the entity embedding vector e and the relation embedding vector e r As input to the knowledge graph embedding model; (2.3) In the complex space, embed the entity embedding vector e and the relation embedding vector e r Transform it into a complex vector and use the complex vector as input to the knowledge graph embedding model; (2.4) In the quaternion space, embed the entity embedding vector e and the relation embedding vector e r It is transformed into a quaternion vector, and the quaternion vector is used as the input to the knowledge graph embedding model.

4. The knowledge graph embedding method for multi-domain spatial fusion according to claim 1, characterized in that, The training set is sampled to construct a training subset Δ. new_batch The steps are as follows: (3.1) Sample several triples and attention parameters from the training set to construct the original training subset Δ batch And mark the triples as positive examples; (3.2) Replace the triples to obtain incorrect triples and mark the incorrect triples as negative examples; (3.3) Add negative examples to positive examples to construct a new training subset Δ new_batch .

5. The knowledge graph embedding method for multi-domain spatial fusion according to claim 3, characterized in that, The steps for iteratively training a knowledge graph embedding model are as follows: (5.1) Based on the training subset Δ new_batch Calculate the training subset Δ for all triplet scores. new_batch The loss function; (5.2) Update the entity embedding vector e and relation embedding vector e of the triple using the gradient descent algorithm. r and attention parameter vector α r ; (5.3) Repeatedly construct new training subsets Δ new_batch And based on the new training subset Δ new_batch Train the knowledge graph embedding model until it converges.

6. The knowledge graph embedding method for multi-domain spatial fusion according to claim 1, characterized in that, The steps for inputting the triples of the knowledge graph into the embedded model after iterative training to complete the model are as follows: (6.1) Input the triples of the knowledge graph into the iteratively trained knowledge graph embedding model, and complete the triples through the knowledge graph embedding model; (6.2) Calculate the triple score of the triple by using the knowledge embedding model. When the triple score is greater than the preset threshold T, the corresponding triple completion is successful; otherwise, the triple completion is unsuccessful.

7. A knowledge graph embedding system that integrates multiple domain spaces, characterized in that, The system includes: A training set construction unit constructs a training set based on triples and attention parameters of the knowledge graph, and imports the training set into the knowledge graph embedding model. A data initialization unit is used to initialize triples and attention parameters in different data domain spaces. Training subset construction unit, which is used to sample the training set and construct a training subset Δ new_batch ; The triplet score acquisition unit is used to obtain the training subset Δ new_batch Import the knowledge graph embedding model and obtain attention scores and triplet scores in different number domain spaces based on rotation transformation; The steps for obtaining attention scores and triplet scores in different number domains based on rotation transformation are as follows: (4.1) Obtain the training subset Δ new_batch The head entity embedding vector e of the middle triple h and relation embedding vector e r ; (4.2) In the real space, for the relation embedding vector e r Perform a rotation transformation to obtain the rotation matrix M in real space. r And based on the rotation matrix M r and head entity embedding vector e h Obtain the head entity embedding vector f of the rotation transformation. E ; (4.3) In complex space, for the head entity embedding vector e h Perform a rotation transformation to obtain the head entity embedding vector f after the rotation transformation. C ; (4.4) In the quaternion space, the head entity embedding vector e h Perform a rotation transformation to obtain the head entity embedding vector f after the rotation transformation. Q ; (4.5) Embed the head entity in the complex space into the vector f C Concatenate them into a complex concatenated vector with the same dimensions as the real-time space. Embed the head entity in the quaternion space into the vector f Q Concatenate them into a quaternion concatenation vector with the same dimensions as the real-time space. ; (4.6) Based on the head entity embedding vector f E Complex concatenation vectors Quaternion concatenation vector and attention parameter vector α r Calculate the attention score a in different number domain spaces. E ,a C ,a Q ; (4.7) Attention score a based on different number domain spaces E ,a C ,a Q and tail entity embedding vector e t Calculate the triplet fractions under transformations in different number domains; A knowledge graph embedding model training unit is used to iteratively train the knowledge graph embedding model until convergence using attention scores and triplet scores in different number domains. The knowledge graph embedding and completion unit is used to complete the knowledge graph embedding model by inputting the triples of the knowledge graph into the iteratively trained knowledge graph.

8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it implements a knowledge graph embedding method for multi-domain spatial fusion as described in any one of claims 1-6.

9. 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 knowledge graph embedding method for multi-domain spatial fusion as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Theme generation method and device, equipment and medium

    CN110442733A

  • Three-dimensional rotation embedding method for 3DRTE time knowledge graph

    CN112231469A