Reverse relational rotation embedding knowledge representation method and system based on convolutional quaternion
By introducing inverse relational vectors and convolutional quaternion representations, the limitations of existing knowledge graph representation methods in relational pattern modeling are solved, the semantic matching between head entities and tail entities is enhanced, and the link prediction accuracy of knowledge graphs and the representation ability of the model are improved.
Patent Information
- Application Number
- CN202211078094.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-05
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2042-09-05
AI Technical Summary
The existing knowledge graph representation method has limitations when dealing with one-to-many, many-to-one, and many-to-many relationships. It is impossible to effectively distinguish different entities with the same relationship, and it is impossible to model and reason about relationship patterns such as inversion, symmetry, and anti-symmetry at the same time, resulting in insufficient accuracy of missing link prediction.
Introduce inverse relationship vectors, use convolutional quaternions to represent entities and relationships, and process embedded vectors through convolutional neural networks to enhance the correlation between head and tail entities, and use the rotation flexibility of quaternions to model rich semantic matching.
It improves the accuracy of knowledge graph link prediction, enhances the semantic matching ability between head entities and tail entities, and improves the model's performance in link prediction and triple classification tasks.
Smart Images

Figure CN115481256B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of knowledge graph technology, and in particular relates to a convolutional quaternion-based inverse relational rotation embedding knowledge representation method and system. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute the prior art that has been known to those skilled in the art.
[0003] Knowledge graphs are currently widely used in various fields. However, since most knowledge graphs contain missing information, graph completion requires reasoning based on multiple relational patterns. Knowledge graph embedding maps entities and relationships in a knowledge graph into a low-dimensional, continuous vector space. The learned vector representations of entities and relationships not only effectively preserve their original semantic information but also enable them to predict missing links and complete the knowledge graph.
[0004] Among existing knowledge representation learning methods, the TransE model is a highly representative approach. This approach considers the translation invariance of word vectors and treats relations in the knowledge base as translation vectors between entities. Specifically, it represents the Euclidean distance between the head entity vector and the tail entity vector after transformation through the relation vector in the knowledge representation space. The TransE model has fewer parameters and lower computational complexity, enabling it to directly establish complex semantic relationships between entities and relations. However, it has limitations in handling one-to-many, many-to-one, and many-to-many relations, making it ineffective at distinguishing different entities with the same relation. The TransR model, an improvement on TransE, addresses these issues but cannot simultaneously model and reason about inversion, symmetry, and antisymmetry relational patterns. RotatE can model and reason about all three relational patterns, but uses the same embedding generation class during embedding vector generation, resulting in insufficient connections between the head and tail entity vectors. Furthermore, the RotatE model only has one complex rotation plane, limiting the flexibility of rotating entities and relations. This prevents rich semantic matching between the head and tail entities, making it difficult to accurately predict missing links. Summary of the Invention
[0005] In order to solve the above problems, the present invention provides a convolutional quaternion-based inverse relational rotation embedding knowledge representation method and system. By introducing an inverse relational vector, the correlation between the head entity and the tail entity is enhanced, and a more expressive quaternion representation is used to model entities and relationships. Finally, a convolutional neural network is used to process the input embedding vector, so that there is a rich semantic match between the head entity and the tail entity, thereby improving the accuracy of knowledge graph link prediction.
[0006] In order to achieve the above object, the present invention mainly includes the following aspects:
[0007] In a first aspect, an embodiment of the present invention provides a method for representing inverse relational rotation embedding knowledge based on convolutional quaternions, comprising:
[0008] Mapping the entities and relations of the triples in the acquired knowledge graph to a complex vector space, wherein the entities include a head entity and a tail entity, and each relation is defined as a rotation from the head entity to the tail entity;
[0009] Generate embedding vectors for the head entity and the tail entity, so that the embedding of each entity has two vectors, the two vectors are used to capture the behavior of the entity as the head of the relationship and the tail of the relationship, and use the inverse relation embedding function to enhance the mutual dependence between the two vectors;
[0010] Hypercomplex representation is introduced to model entities and relationships, and input into the preset convolutional neural network for score prediction and loss correction to obtain the embedded knowledge representation of triples.
[0011] In one possible implementation, given a triple (e i ,r,e j ), where e i and e j are two different entities, r is the relationship between the entities; use h e ,t e They are used to capture the behavior of entity e as the head and tail of the relationship respectively. For each relationship, an inverse relationship vector r is introduced. -1 , by using the inverse relation embedding function, we can get i ,r,e j ) on the scoring function f r (h,t):
[0012]
[0013] in, For entity e i As the head entity, For entity e i As the tail entity, For entity e j As the head entity, For entity e j As the tail entity, Represents the Hadmard product.
[0014] In one possible implementation, the head entity and the tail entity are mapped into a hypercomplex space to obtain an embedded knowledge representation of the triple; the embedded knowledge representation of the triple is input into a convolutional layer of a convolutional neural network, different filters are used in the convolutional layer to extract the global relationship between the same-dimensional items of the triple, a feature map is generated, and multiple feature maps are connected into a feature vector; and the score of the triple is determined based on the feature vector.
[0015] In one possible implementation, the embedded knowledge representation of the triplet is used as a positive triplet, self-adversarial negative sampling is used to generate a negative triplet, and the positive triplet and the negative triplet are input into a convolutional neural network for score prediction and loss correction.
[0016] In one possible implementation, the self-adversarial negative sampling extracts negative triplet samples from the following distribution:
[0017]
[0018] Among them, α is the sampling degree, which is used to adjust the sampling strategy, (h′ i ,r,t′ i ) represents the i-th negative sample, p(·) is the probability;
[0019] Taking the probability as the negative sample weight, the loss function of the self-adversarial negative sampling is defined as:
[0020]
[0021] Among them, γ is a fixed-value edge hyperparameter, σ is the sigmoid activation function, (h′ j ,r,t′ j ) represents the jth negative triplet, (h′ i ,r,t′ i ) represents the i-th negative triplet, which is composed of positive triplet with the head entity or tail entity randomly replaced.
[0022] In one possible implementation, a triple matrix constructed by multiple training steps in the quaternion inverse relation embedding process is used to initialize the embedding of entities and relations, and the triple matrix is trained through convolution operations to perform score prediction and loss correction on the extracted triplets.
[0023] In one possible implementation, the scoring function for a triple is defined as:
[0024] f r (h,r,t)=concat(g([h,r,t]*Ω))·W;
[0025] Where g represents the ReLU activation function, h represents the head entity, t represents the tail entity, r represents the relationship between entities, Ω and W are shared hyperparameters, * represents the convolution operator, and concat represents the concatenation operator;
[0026] The Adam optimizer is used to continuously update the parameters and train the convolutional neural network by minimizing the loss function L through regularization:
[0027]
[0028] Where λ is The weight of l is, S and S′ represent the set of positive triples and negative triples respectively. The positive triples and negative triples determine l (h,r,t) The value of , where:
[0029]
[0030] In a second aspect, an embodiment of the present invention provides a convolutional quaternion-based inverse relational rotation embedding knowledge representation system, comprising:
[0031] A relationship mapping module is used to map the entities and relationships of the triples in the acquired knowledge graph to a complex vector space, where the entities include a head entity and a tail entity, and each relationship is defined as a rotation from the head entity to the tail entity;
[0032] A vector generation module is used to generate embedding vectors for the head entity and the tail entity, so that the embedding of each entity has two vectors, which are used to capture the behavior of the entity as the head and the tail of the relationship respectively, and use the inverse relationship embedding function to enhance the mutual dependence between the two vectors;
[0033] The score prediction module is used to introduce hypercomplex representation to model entities and relationships, and input them into the preset convolutional neural network for score prediction and loss correction to obtain the embedded knowledge representation of triples.
[0034] In a third aspect, an embodiment of the present invention provides a computer device comprising: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the inverse relational rotation embedding knowledge representation method based on convolutional quaternions as described in the first aspect and any possible implementation scheme of the first aspect are performed.
[0035] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the inverse relational rotation embedding knowledge representation method based on convolution quaternions as described in the first aspect and any possible implementation scheme of the first aspect are executed.
[0036] One or more of the above technical solutions have the following beneficial effects:
[0037] The present invention provides a convolutional quaternion-based inverse relational rotation embedding knowledge representation method and system. By introducing an inverse relational vector, the correlation between the head entity and the tail entity is enhanced, and a more expressive quaternion representation is used to model entities and relationships. Finally, a convolutional neural network is used to process the input embedding vector, so that there is a rich semantic match between the head entity and the tail entity, thereby improving the accuracy of knowledge graph link prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0039] Figure 1 1 is a flow chart of a convolution quaternion-based inverse relational rotation embedding knowledge representation method provided in the first embodiment of the present invention;
[0040] Figure 2 is a vector diagram provided by the first embodiment of the present invention that is processed using an inverse relationship and rotated in the complex plane;
[0041] Figure 3 This is a schematic diagram of the processing flow of using quaternions to expand complex-valued space and convolutional neural network in cQuaIE provided in Example 1 of the present invention. DETAILED DESCRIPTION
[0042] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0043] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present invention belongs.
[0044] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.
[0045] Example 1
[0046] See also Figure 1 This embodiment provides a convolutional quaternion-based inverse relational rotation embedding knowledge representation method (cQuaIE), which specifically includes the following steps:
[0047] S101: Mapping the entities and relations of the triples in the acquired knowledge graph to a complex vector space, where the entities include a head entity and a tail entity, and each relation is defined as a rotation from the head entity to the tail entity.
[0048] In the implementation, the first step is to construct a knowledge graph. Taking healthcare data as an example, distributed web crawler technology is used to obtain medical data from professional medical websites. This data is then cleaned using a stop word library and a maximum forward / backward matching algorithm. Entities, relationships, and attributes are then extracted to produce structured triples of knowledge. Finally, the healthcare knowledge graph, including the numerous entities and relationships within the knowledge graph, is stored in a Neo4j graph database.
[0049] The reasoning ability of the knowledge representation learning model depends largely on its ability to model various relational patterns in the knowledge graph. In RotatE, entities and relations are mapped to complex vector space, and each relation is defined as a rotation from the head entity to the tail entity, which enables modeling and inference of symmetric / antisymmetric, inverse and combined relational patterns. So for the triple (h, r, t), the expectation is in, is the embedding vector, h represents the head entity, t represents the tail entity, and r represents the relationship between entities. Denotes the Hadmard product. According to the above definition, for each triple (h, r, t), the scoring function f of RotatE is r (h,t) is defined as follows:
[0050]
[0051] However, the RotatE model uses the same embedding generation class, that is, the head entity and the tail entity are embedded and generated in the same way, and the entity is only considered as the head entity or the tail entity. The two are relatively independent and have few connections, so that the head entity vector and the tail entity vector do not establish sufficient connection. Using different embedding generation classes means that for an entity, it is embedded into a vector that captures the head entity and a vector that captures the tail entity. For example, entity e is embedded as the head entity h through two different embeddings. e and tail entity t e ,In this way, the accuracy of the prediction score can be improved by increasing the types of entities considered.
[0052] S102: Generate embedding vectors for the head entity and the tail entity, so that the embedding of each entity has two vectors, and the two vectors are used to capture the behavior of the entity as the head of the relationship and the tail of the relationship respectively, and use the inverse relationship embedding function to enhance the mutual dependence between the two vectors.
[0053] In the specific implementation, inspired by the SimpIE model, based on the canonical polytomy (CP) problem, the embedding of each entity e has two vectors h e ,t e , use h e ,t e They are used to capture the behavior of entity e as the head and tail of the relation respectively. Secondly, in the CP problem, the two embedding vectors related to the entity are independent of each other. Assuming that a given triple (e i ,r,e j ), where e i and e j are two different entities, and r is the relationship between the entities. Here, only and Get updated, and Unable to get update.
[0054] Therefore, for each relationship, in addition to the relationship vector itself, an additional inverse relationship vector r is introduced -1 , that is, for each relation r there are two vectors r,r -1 , through the use of the inverse relation embedding function, the mutual dependence between the head embedding vector and the tail embedding vector is realized. So in the triple (e i ,r,e j ) on the scoring function f r (h,t) is defined as:
[0055]
[0056] Figure 2Depicts the difference between the model that models r as a rotation from h to t in the complex plane and the model that models r -1 is modeled as a rotation from t to h in the complex plane. Therefore, the scoring function for a triplet is defined as (e i ,r,e j ) and (e j ,r,e i ) scores. By using different embedding generation classes to generate embedding vectors for the head entity and the tail entity, the model can learn more effectively, while reducing the number of training steps and improving computational efficiency.
[0057] S103: Introduce hypercomplex representation to model entities and relationships, and input them into the preset convolutional neural network for score prediction and loss correction to obtain the embedded knowledge representation of triples.
[0058] In the specific implementation, since the RotatE model has only one complex rotation plane, the rotation flexibility of entities and relationships will be limited. Therefore, quaternions are used to extend the complex value space and introduce more expressive hypercomplex representations to model entities and relationships. While providing geometric interpretation, it also meets the modeling requirements of relational patterns such as symmetry / antisymmetry, inversion, and combination. Specifically, quaternion embeddings are used to represent entities and relationships. Each quaternion embedding is a vector in the hypercomplex vector space H, which has three imaginary components i, j, and k, that is,
[0059] Q=a+bi+cj+dk;
[0060] Where a, b, c, and d represent the coefficients of each component, and Q represents a quaternion.
[0061] Map the head entity and the tail entity into the hypercomplex space, i.e. h,t∈H k , is the quaternion embedding vector in the hypercomplex space, and each relation r is defined as the rotation from the head entity to the tail entity, such as Figure 3 So for a given triple (h, r, t), the expectation is: in Represents the Hadmard product. For each dimension of the vector element in the hypercomplex space, there is t i =h i r i , the subscript i represents the vector element in the dimension.
[0062] Leveraging the advantages of quaternion representation, we achieve expressive semantic matching between head and tail entities. Unlike RotatE, which has only one rotation plane, our model has two. This allows for greater rotation flexibility for entities and relationships in quaternion space than in the complex plane. Quaternions are also more efficient and numerically stable than rotation matrices.
[0063] prove:
[0064] By introducing more expressive hypercomplex representations to model entities and relations, this method can model and reason about three types of relations: symmetric / antisymmetric, inverse, and composition.
[0065] Symmetric / antisymmetric relationship mode:
[0066] If (e i ,r,e j ) and (e j ,r,e i ) holds, then:
[0067]
[0068] If (e i ,r,e j )and (e j ,r,e i ) holds, then:
[0069]
[0070] Inverse relationship pattern:
[0071] If (e i ,r1,e j ) and (e j ,r2,e i ) holds, then:
[0072]
[0073] Combination relationship mode:
[0074] If (e i ,r1,e k )、(e i ,r2,e j ) and (e j ,r3,e k ) holds, then:
[0075]
[0076] In order to generate effective embedding vectors and input them into the convolutional neural network, the self-adversarial negative sampling proposed in RotatE is used to generate negative samples to train the above process. Self-adversarial negative sampling extracts negative triplet samples from the following distribution according to the model:
[0077]
[0078] Among them, α is the sampling degree, which is used to adjust the sampling strategy; p(·) is the probability; the above probability is used as the negative sample weight, so the loss function of self-adversarial negative sampling is defined as:
[0079]
[0080] Among them, γ is a fixed-value edge hyperparameter, σ is the sigmoid activation function, (h′ j ,r,t′ j ) represents the jth negative triplet, (h′ i ,r,t′ i ) represents the i-th negative triplet, which is composed of positive triplet with the head entity or tail entity randomly replaced.
[0081] The triplet embedding trained by the above process is used as the input of the convolutional neural network part of the cQuaIE model, where the embedded triplet is represented by an intuitive and accurate quaternion, such as Figure 3 As shown in Figure 2, we define a knowledge graph G, which is a set of valid triples represented as (h, r, t), such that h, t∈E, r∈R, where E is the entity set and R is the relationship set.
[0082] For entities and relations in a triple, k is used to represent their embedding dimension, and the corresponding k-dimensional embedding triple (h, r, t) is represented as a matrix in Denotes the i-th row of the matrix. This input matrix is fed to the convolutional layer, where different filters are used. Extract global relationships between entries of the same dimension of the embedding triples. These filters ω are repeatedly operated on each row of the input matrix M, resulting in feature maps The specific calculation is as follows:
[0083] v i =g(ω·M i +b);
[0084] in, is the bias term, and g is the ReLU activation function.
[0085] Set τ and Ω to represent the number of filters and the set of filters, i.e. τ = |Ω|. So we get τ feature maps connected into a feature vector, and calculate the dot product between the feature vector and the weight vector Thus, the score of the triple (h, r, t) is obtained.
[0086] Specifically, in the cQuaIE model, the triple matrix constructed by multiple training runs during the quaternion inverse relational embedding process is used to initialize the embedding of entities and relations. The matrix is then trained using convolution operations. Score prediction and loss correction are performed for the extracted triples. The cQuaIE score function is defined as:
[0087] f r (h,r,t)=concat(g([h,r,t]*Ω))·W;
[0088] Among them, Ω and W are shared hyperparameters, * represents the convolution operator, and concat represents the concatenation operator.
[0089] The Adam optimizer is used to continuously update the parameters and train cQuaIE by minimizing the loss function through regularization:
[0090]
[0091] In the above formula, λ is The weight of the positive triple and the negative triple are respectively represented by S and S′. The negative triple is formed by randomly replacing the head entity or the tail entity of the training triple. The positive triple and the negative triple determine l (h,r,t) The value of:
[0092]
[0093] In a specific application, a question-answering system is designed using a convolutional quaternion-based inverse relational rotation embedding knowledge representation method. For the extracted triple knowledge, different embedding generation classes are used to generate embedding vectors for the head and tail entities, resulting in each entity embedding having two vectors, one capturing the entity's behavior as the head and the other capturing the tail of the relationship. The inverse relational embedding function is then used to enhance the interdependence between the two vectors. Quaternions are used to expand the complex-valued space, and hypercomplex representations are introduced to model entities and relationships, enhancing their rotational flexibility. Finally, the quaternion embedding vectors of the entities and relationships trained in this process are fed into a convolutional neural network for processing, thereby improving the model's representational capabilities. Through this process, queries are performed within the knowledge graph to obtain question-answering results.
[0094] By extracting, integrating, and storing knowledge from healthcare data, we build a knowledge graph for the healthcare sector. Using Python, the Neo4j graph database, the Python-based web framework Flask, and Node.js+Vue front-end technology, we ultimately achieve the construction and visualization of a healthcare knowledge graph based on knowledge representation learning.
[0095] The convolutional quaternion-based reverse relational rotation embedding knowledge representation method (cQuaIE) proposed in this embodiment is evaluated using the link prediction task on the benchmarks WN18, FB15K, WN18RR, and FB15K-237. The gap between this method and the current state-of-the-art model is compared. The evaluation results are shown in the following table:
[0096] Table 1 Experimental results of link prediction using cQuaIE and baseline models on the WN18 and FB15K datasets
[0097]
[0098] Table 2 Experimental results of link prediction using cQuaIE and baseline models on the WN18RR and FB15K-237 datasets
[0099]
[0100] The experimental results in the table above demonstrate that cQuaIE demonstrates strong competitiveness compared to existing models and methods. Different embedding generation classes are used to generate embedding vectors for the head and tail entities, resulting in two embedding vectors for each entity. The inverse relation embedding function is then used to enhance the interdependence between the two vectors. Quaternions are used to expand the complex-valued space, enhancing the rotational flexibility of entities and relations. Finally, the quaternion embedding vectors of the entities and relations trained in the above process are fed into a convolutional neural network for processing, thereby improving the model's link prediction accuracy. Consequently, the cQuaIE model achieves significant improvements across all metrics in both link prediction and triple classification tasks, demonstrating its superiority.
[0101] Example 2
[0102] The embodiment of the present invention further provides a convolution quaternion-based inverse relational rotation embedding knowledge representation system, comprising:
[0103] A relationship mapping module is used to map the entities and relationships of the triples in the acquired knowledge graph to a complex vector space, where the entities include a head entity and a tail entity, and each relationship is defined as a rotation from the head entity to the tail entity;
[0104] A vector generation module is used to generate embedding vectors for the head entity and the tail entity, so that the embedding of each entity has two vectors, which are used to capture the behavior of the entity as the head and the tail of the relationship respectively, and use the inverse relationship embedding function to enhance the mutual dependence between the two vectors;
[0105] The score prediction module is used to introduce hypercomplex representation to model entities and relationships, and input them into the preset convolutional neural network for score prediction and loss correction to obtain the embedded knowledge representation of triples.
[0106] The inverse relational rotation embedding knowledge representation system based on convolution quaternion provided in this embodiment is used to implement the aforementioned inverse relational rotation embedding knowledge representation method based on convolution quaternion. Therefore, the specific implementation method of the inverse relational rotation embedding knowledge representation system based on convolution quaternion can be seen in the embodiment part of the inverse relational rotation embedding knowledge representation method based on convolution quaternion in the previous article, and will not be repeated here.
[0107] Example 3
[0108] An embodiment of the present invention further provides a computer device, which includes a processor, a memory, and a bus.
[0109] The memory stores machine-readable instructions executable by the processor. When the computer device is running, the processor communicates with the memory via a bus. When the machine-readable instructions are executed by the processor, the above-mentioned Figure 1 The steps of the convolution quaternion-based inverse relational rotation embedding knowledge representation method in the method embodiment shown are specifically implemented in the method embodiment and will not be repeated here.
[0110] Example 4
[0111] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the inverse relational rotation embedding knowledge representation method based on convolution quaternions described in the above method embodiment are executed.
[0112] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware through a computer program. The program can be stored in a computer-readable storage medium, and when executed, the program can include the processes in the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0113] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A convolutional quaternion-based inverse relational rotation embedding knowledge representation method, characterized by: include: Mapping the entities and relations of the triples in the acquired knowledge graph to a complex vector space, wherein the entities include a head entity and a tail entity, and each relation is defined as a rotation from the head entity to the tail entity; Generate embedding vectors for the head entity and the tail entity, so that the embedding of each entity has two vectors, the two vectors are used to capture the behavior of the entity as the head of the relationship and the tail of the relationship, and use the inverse relation embedding function to enhance the mutual dependence between the two vectors; Hypercomplex representations are introduced to model entities and relationships, and then fed into a pre-set convolutional neural network for score prediction and loss correction. This yields an embedded knowledge representation of triples, enabling rich semantic matching between the head and tail entities and improving the accuracy of knowledge graph link prediction. Given a triple ,in, and are two different entities, r is the relationship between the entities; use Used to capture entities As the head of the relationship and the tail of the relationship, for each relationship, an inverse relationship vector is introduced , by using the inverse relation embedding function, we get Scoring function on : ; in, For Entity As the head entity, For Entity As the tail entity, For Entity As the head entity, For Entity As the tail entity, represents the Hadmard product; The head entity and the tail entity are mapped into a hypercomplex space to obtain an embedded knowledge representation of the triple; the embedded knowledge representation of the triple is input into a convolutional layer of a convolutional neural network, different filters are used in the convolutional layer to extract the global relationship between the same-dimensional items of the triple, a feature map is generated, and multiple feature maps are connected into a feature vector; and the score of the triple is determined based on the feature vector.
2. The convolution quaternion-based inverse relational rotation embedding knowledge representation method according to claim 1, wherein: The embedded knowledge representation of the triplet is used as a positive triplet, and a negative triplet is generated by self-adversarial negative sampling. The positive triplet and the negative triplet are input into a convolutional neural network for score prediction and loss correction.
3. The convolution quaternion-based inverse relational rotation embedding knowledge representation method according to claim 2, wherein: The self-adversarial negative sampling extracts negative triplet samples from the following distribution: ; in, is the sampling degree, used to adjust the sampling strategy, is the probability; Taking the probability as the negative sample weight, the loss function of the self-adversarial negative sampling is defined as: ; in, is a fixed-valued marginal hyperparameter, is the sigmoid activation function, Indicates the negative triples, Indicates the A negative triplet is formed by randomly replacing the head entity or the tail entity of a positive triplet.
4. The convolution quaternion-based inverse relational rotation embedding knowledge representation method according to claim 1, wherein: The triple matrix constructed by multiple trainings in the quaternion inverse relation embedding process is used to initialize the embedding of entities and relations, and the triple matrix is trained through convolution operations for score prediction and loss correction of the extracted triplets.
5. The convolution quaternion-based inverse relational rotation embedding knowledge representation method according to claim 1, wherein: The score function of a triplet is defined as: ; in, represents the ReLU activation function, Represents the head entity, Represents the tail entity, Represents the relationship between entities, and To share hyperparameters, represents the convolution operator, Represents the concatenation operator; The Adam optimizer is used to continuously update the parameters and train the convolutional neural network by minimizing the loss function L through regularization: ; in, yes The weight of and Represents the set of positive triples and negative triples respectively, which determine The value of , where: 。 6. A convolutional quaternion-based inverse relational rotation embedding knowledge representation system, characterized by: include: A relationship mapping module is used to map the entities and relationships of the triples in the acquired knowledge graph to a complex vector space, where the entities include a head entity and a tail entity, and each relationship is defined as a rotation from the head entity to the tail entity; A vector generation module is used to generate embedding vectors for the head entity and the tail entity, so that the embedding of each entity has two vectors, which are used to capture the behavior of the entity as the head and the tail of the relationship respectively, and use the inverse relationship embedding function to enhance the mutual dependence between the two vectors; The score prediction module is used to introduce hypercomplex representations to model entities and relationships, and input them into a preset convolutional neural network for score prediction and loss correction. This module obtains an embedded knowledge representation of triples, which ensures rich semantic matching between the head and tail entities and improves the accuracy of knowledge graph link prediction. Given a triple ,in, and are two different entities, r is the relationship between the entities; use Used to capture entities As the head of the relationship and the tail of the relationship, for each relationship, an inverse relationship vector is introduced , by using the inverse relation embedding function, we get Scoring function on : ; in, For Entity As the head entity, For Entity As the tail entity, For Entity As the head entity, For Entity As the tail entity, represents the Hadmard product; The head entity and the tail entity are mapped into a hypercomplex space to obtain an embedded knowledge representation of the triple; the embedded knowledge representation of the triple is input into a convolutional layer of a convolutional neural network, different filters are used in the convolutional layer to extract the global relationship between the same-dimensional items of the triple, a feature map is generated, and multiple feature maps are connected into a feature vector; and the score of the triple is determined based on the feature vector.
7. A computer device, characterized in that: include: A processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the computer device is running, the processor and the memory communicate via the bus. When the machine-readable instructions are executed by the processor, the steps of the inverse relational rotation embedding knowledge representation method based on convolutional quaternions are performed.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the inverse relational rotation embedding knowledge representation method based on convolutional quaternions are executed.
Citation Information
Patent Citations
A path-based knowledge graph embedding method
CN109815345A
Knowledge graph embedding method and device based on relation rotation and entity rotation
CN112860910A