Knowledge graph connection prediction method based on quaternary quantum space
By adopting the quaternary quantum space method in the knowledge graph embedding model, deeply integrating quantum logic space and geometric space, the problem that existing models fail to fully capture the complex logical relationships of medical knowledge is solved, and higher prediction accuracy and diagnostic capabilities are achieved.
Patent Information
- Application Number
- CN202510348037.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2025-06-24
AI Technical Summary
The existing knowledge graph embedding model fails to deeply unify quantum logic space and quaternary geometric space, resulting in the lack of full synergy between quantum logic space and geometric embedding space, affecting the accuracy of disease prediction and drug recommendation.
The knowledge graph connection prediction method based on quaternary quantum space is adopted, and the deep fusion of quantum logical space and geometric space is achieved by extracting medical entities and relationship information, mapping it into vectors of quaternary quantum space, and a knowledge graph embedding model is constructed, and the model is updated through dual scoring functions and combined loss functions, so as to achieve the deep fusion of quantum logical space and geometric space.
Improves the connection reasoning ability between complex medical entities, enhances the diagnostic accuracy of rare diseases, and obtains state-of-the-art experimental results in the link prediction task.
Smart Images

Figure CN120197683A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of knowledge graphs, and particularly relates to a knowledge graph link prediction method based on a four-element quantum space. Background Art
[0002] In the medical scenario, knowledge graphs (KGs) can be regarded as a large-scale intelligent medical system integrating knowledge and data, which represents an association network of entities and their relationships through a semantic framework. The effectiveness of this graph in applications such as recommendation systems, semantic search, and predictive analysis depends to a large extent on its integrity and accuracy. For this reason, the knowledge graph completion (KGC) task has emerged, which enhances the completeness and precision of the graph by identifying missing associations or mining unknown facts. Among them, the knowledge graph embedding (KGE) model, as the core technology for link prediction, captures its potential semantic and structural features by mapping entities and relationships to a continuous geometric vector space. Such embedding techniques can effectively infer potential associations by quantifying the similarity and compatibility between entities. However, existing studies such as the quaternion graph embedding model QuatE and the dual graph embedding model DualE mainly focus on the dimension optimization of the geometric vector space, and there are still problems with insufficient modeling of potential algebraic logic associations. Existing models either focus on learning based on statistical features of data or rely on representation methods in the geometric embedding space, both of which lack a deep understanding of the potential complex logical relationships in medical knowledge (for example, the causal relationships between drugs and diseases, genes and diseases). This will lead to the inability to fully mine potential complex relationships in tasks such as disease prediction and drug recommendation, thus affecting the prediction accuracy.
[0003] In recent years, the fusion research of quantum logic theory and KGE models has shown significant advantages. The E2R model pioneered the introduction of quantum logic space into the KGC task. On this basis, subsequent models such as QLogicE and QIQE-KGC have tried to combine quantum logic constraints with geometric embedding techniques such as TransE and QuatE. However, due to dimension mismatch or algorithmic structure differences, existing methods have not achieved a deep fusion of quantum logic space and geometric embedding space. Specifically, most studies adopt a loose coupling design, only fusing quantum logic constraints and geometric embedding models in a superimposed or shallow manner, and failing to construct a deep unified framework.
[0004] The core drawback of such methods is that the generated embedding vectors often originate from independent vector spaces. Although these spaces are mathematically compatible, they lack essential structural consistency, resulting in the failure to fully exploit the synergistic effect between the quantum logic space and the geometric embedding space. Given the remarkable potential of quantum embedding technology, it is urgent to deeply explore the mechanism of the deep integration of quantum logic constraints and geometric KGE models to construct a more structurally consistent unified framework.
[0005] However, as a core means of knowledge reasoning and relationship mining, knowledge graph link prediction technology is often applied to knowledge discovery in medical scenarios. However, existing technologies cannot effectively capture logical features and geometric features simultaneously, resulting in the discovered knowledge being often incorrect or difficult to discover hidden knowledge. Summary of the Invention
[0006] In view of the above deficiencies in the prior art, a knowledge graph connection prediction method based on a quaternion quantum space provided by the present invention solves the problem that the existing methods fail to deeply unify the quantum logic space and the quaternion geometric space, resulting in the failure to fully exploit the synergistic effect between the quantum logic space and the geometric embedding space. For example, in the prediction of drug-disease-gene relationships, traditional methods may lead to inaccurate prediction results due to the lack of logical features or the ineffective fusion of logical features and geometric features. However, through the deep integration of the quaternion quantum space, the present invention can effectively enhance the ability to infer the relationships between complex medical entities and improve the diagnostic accuracy of rare diseases.
[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A knowledge graph connection prediction method based on a quaternion quantum space, comprising the following steps:
[0008] S1. Extract the medical entities and medical relationship information of the triples in the knowledge graph to be predicted, and perform deduplication processing using a set;
[0009] S2. Based on the deduplicated triples, map the medical entities and medical relationships to vectors in the quaternion quantum space, and construct a knowledge graph embedding model based on the quaternion quantum space;
[0010] S3. Based on the current medical entity and medical relationship vectors, use the knowledge graph embedding model to calculate the value of the dual scoring function;
[0011] S4. Based on the medical entity and relationship vectors and the value of the dual scoring function, calculate the combined loss function, and update the values of the medical entity vectors and medical relationship vectors in the knowledge graph embedding model with this combined loss function;
[0012] S5. Repeat S3 and S4 until a set end condition is reached;
[0013] S6. According to the dual scoring function, combine the scores and sort the triples in descending order. Select the top K triples, where the selected results are the missing connections predicted for the knowledge graph, thus completing the prediction of the connections in the knowledge graph.
[0014] The beneficial effects of the present invention are as follows: By reconstructing the vector expressions, scoring functions, and loss functions of the knowledge graph embedding model, the present invention realizes the deep integration of the quantum logic space and the quaternion geometric space, thereby enhancing the model's ability to capture the semantic expressions between medical entities and medical relationships from both logical and geometric features, and thus greatly improving the model's ability to discover hidden and correct knowledge in medical scenarios. The experimental results of the link prediction task on various data sets show that the present invention can capture deeper semantic information from both logical and geometric features, thereby achieving state-of-the-art experimental results.
[0015] Further, the specific content of S1 is as follows:
[0016] S101. Define three empty sets, namely the medical head entity set H, the medical tail entity set T, and the medical relationship set R;
[0017] S102. Obtain a triple (h, r, t) in the knowledge graph to be predicted, and add the medical head entity h, the medical tail entity t, and the medical relationship r to the sets. Among them, based on the uniqueness of the set elements, the deduplication operation is automatically completed;
[0018] S103. Repeat S102 until all triples in the predicted knowledge graph have been accessed.
[0019] The beneficial effects of the above further solution are as follows: By using the uniqueness of the set elements, the present invention successfully extracts all non-repetitive medical entities and medical relationships in the knowledge graph to be predicted, which is conducive to the subsequent vector embedding of entities and relationships in the quaternion quantum space.
[0020] Still further, the specific content of S2 is as follows:
[0021] Based on the deduplicated triples, embed the medical head entity h and the medical tail entity t into real vectors of d * d * d * d, where d represents the vector length in each dimension;
[0022] Embed the medical relationship r into the dual four-dimensional vectors r h and r t , so as to map to the vectors in the quaternion quantum space and complete the construction of the knowledge graph embedding model. Among them, r h represents the relationship vector corresponding to the medical head entity h, and r t represents the relationship vector corresponding to the medical tail entity t.
[0023] The beneficial effects of the above further solution are as follows: By embedding entities and relationships into a four-dimensional quantum space, the present invention enables the extraction of latent logical and geometric features of entities and relationships through subsequent function calculations, thereby improving the prediction accuracy of the model.
[0024] Furthermore, the specific content of S3 is as follows:
[0025] Based on the triple (h, r, t), calculate the logical score:
[0026] Based on the triple (h, r, t), calculate the geometric score;
[0027] According to the logical score and the geometric score, calculate the value of the dual score function.
[0028] The beneficial effects of the above further solution are as follows: Through the value of the dual score function, the present invention synthesizes the logical and geometric features between medical entities, enabling the calculation of the subsequent combined loss function and effectively updating the parameters of the embedding vectors of more subsequent medical entities and medical relationships based on the captured features.
[0029] Furthermore, the expression of the dual score function is as follows:
[0030] F score (h, r, t) = f logic (h, r, t) + f geometry (h, r, t)
[0031]
[0032] f logic (h, r, t) = ||(1 - r h ) * h 2 + (1 - r t ) * t 2 ||
[0033] Wherein, F score () represents the dual score function, F score (h, r, t) represents the value of the dual score function for calculating the triple (h, r, t), f geometry () represents the geometric score, f geometry (h, r, t) represents the value of the geometric score for calculating the triple (h, r, t), represents the Hamilton product, f logic () represents the logical score, f logic (h, r, t) represents the value of the logical score for calculating the triple (h, r, t), r h represents the relationship vector corresponding to the medical head entity, r tRepresents the relationship vector corresponding to the medical tail entity, and * represents element-wise multiplication.
[0034] Furthermore, the specific content of S4 is as follows:
[0035] Based on the medical entity and the medical relationship vector, combined with the triple (h, r, t), calculate the logical loss;
[0036] Based on the triple (h, r, t) and the value of the dual scoring function, calculate the geometric loss:
[0037] Based on the triple (h, r, t), calculate the membership loss;
[0038] According to the membership loss, geometric loss, and logical loss, calculate the combined loss value;
[0039] According to the combined loss value, combined with the Adam optimizer, update the vector representation of the knowledge graph embedding model, that is, update the values of the medical entity vector and the medical relationship vector.
[0040] The beneficial effect of the above further solution is that according to the combined loss value, the present invention enables the Adam optimizer to combine logical features and geometric features to quickly and effectively update the vector values of entities and relationships, thereby improving the prediction accuracy of the model.
[0041] Furthermore, the expression of the combined loss value is as follows:
[0042] L loss = L logic + L geometry + L element
[0043]
[0044] L geometry = log(1 + exp(flag(h, r, t) * F score (h, r, t)))
[0045]
[0046] Among them, L loss represents the combined loss value, L element represents the membership loss, r T represents the transpose of the medical relationship vector, r h represents the relationship vector corresponding to the medical head entity h, r t represents the relationship vector corresponding to the medical tail entity t, 0 2d and 1 2d respectively represent a vector of length 2d with all values being 0 and a vector of length 2d with all values being 1, 1 4dA vector of length 4d with all values equal to 1, L logic Denotes the logical loss, L geometry Denotes the geometric loss, and flag(h, r, t) is a discriminant function indicating whether the triple (h, r, t) exists in G, F score (h, r, t) represents the dual score function value of the triple (h, r, t), flag() represents the discriminant function, and G represents the set of all triples in the knowledge graph to be predicted.
[0047] Furthermore, the specific content of S6 is as follows:
[0048] According to the existing medical entities and medical relationships in the knowledge graph to be predicted, arrange and generate all triple sets;
[0049] In the generated triple sets, eliminate the existing triple sets to obtain a candidate triple set;
[0050] According to the embedding vectors of the current medical entity and medical relationship, and the dual scoring function, calculate the scores of all candidate triples in the candidate triple set;
[0051] Based on the magnitudes of the scores of all candidate triples, sort the triples in the candidate triples in descending order;
[0052] Based on the sorting result, select the top k triples from the candidate triple set, and the selected result is the missing connection in the predicted knowledge graph.
[0053] The beneficial effect of the above further solution is that: through the dual score function, the present invention scores the candidate triples, enabling the model to select triples with logical and geometric features similar to those between entities in the existing knowledge graph. Such triples have a higher probability of being the missing triples in the original knowledge graph. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 It is a flowchart of the method of the present invention.
[0055] Figure 2 It is an architecture diagram of a four - element quantum space knowledge graph link prediction model provided by the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0056] The following describes the specific embodiments of the present invention to facilitate those skilled in the art to understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention defined and determined by the appended claims, these changes are obvious, and all inventions made using the concept of the present invention are within the scope of protection.
[0057] Embodiment
[0058] As Figure 1 - Figure 2 shown, the present invention provides a knowledge graph connection prediction method based on a quaternion quantum space, and the implementation method is as follows:
[0059] S1. Extract the medical entities and medical relationship information of the triples in the knowledge graph to be predicted, and use a set to perform deduplication processing. The implementation method is as follows:
[0060] S101. Define three empty sets, namely the medical head entity set H, the medical tail entity set T, and the medical relationship set R;
[0061] In this embodiment, three set data types are defined using python, representing the medical head entity set H, the medical tail entity set T, and the medical relationship set R respectively, with the initial values being empty.
[0062] S102. Obtain a triple (h, r, t) in the knowledge graph to be predicted, and add the medical head entity h, the medical tail entity t, and the medical relationship r to the set. Among them, based on the uniqueness of the set elements, the deduplication operation is automatically completed;
[0063] S103. Repeat S102 until all triples in the prediction knowledge graph have been visited.
[0064] In this embodiment, the for loop in python is used to traverse the triples in the UMLS knowledge graph one by one.
[0065] S2. Based on the deduplicated triples, map the medical entities and medical relationships to vectors in the quaternion quantum space, and construct a knowledge graph embedding model based on the quaternion quantum space. Among them, the knowledge graph embedding model refers to the embedding vectors mapped according to the medical entities and medical relationships, and the embedding method is to use the embedding function in python. The implementation method is as follows:
[0066] Based on the deduplicated triples, embed the medical head entity h and the medical tail entity t into real number vectors of d * d * d * d, where d represents the vector length in each dimension;
[0067] In this embodiment, the medical head entity h and the medical tail entity t are embedded into real number vectors of d * d * d * d, where d represents the vector length in each dimension;
[0068] Embed the medical relationship r into the dual four-dimensional vectors r h and r t , to map to vectors in the quaternion quantum space, and complete the construction of the knowledge graph embedding model. Among them, r h represents the relationship vector corresponding to the medical head entity h, r tRepresents the relationship vector corresponding to the medical tail entity t.
[0069] In this embodiment, entities are directly defined in Python as real - valued vectors of length 4d, relationships are defined as two real - valued vectors of length 4d, and the initialization method is Xavier initialization. During the operation, every d lengths are regarded as one dimension.
[0070] S3. Based on the current medical entity and the medical relationship vector, use the knowledge graph embedding model to calculate the value of the dual scoring function. The implementation method is as follows:
[0071] Based on the triple (h, r, t), calculate the logical score:
[0072] In this embodiment, according to the logical score function formula, combined with the triple (h, r, t), calculate the logical score f logic , where the logical score function formula is as follows:
[0073] f logic (h, r, t)=||(1 - r h )*h 2 +(1 - r t )*t 2 ||
[0074] Among them, * in the logical score function calculation formula represents element - by - element multiplication.
[0075] Based on the triple (h, r, t), calculate the geometric score;
[0076] In this embodiment, according to the geometric score function formula, combined with the triple (h, r, t), calculate the geometric score f geometry , where the geometric score function formula is as follows.
[0077]
[0078] Among them, in the geometric score formula represents the Hamilton product, and its definition is: if there are two four - dimensional vectors q1 and q2, and q1=(a1, b1, c1, d1), q2=(a2, b2, c2, d2), then:
[0079]
[0080] Calculate the value of the dual scoring function according to the logical score and the geometric score.
[0081] In this embodiment, according to the dual scoring function formula, combined with the logical score f logic and the geometric score f geometry , calculate the overall score value Fscore , where the calculation formula of the dual score function is as follows.
[0082] F score (h, r, t) = f logic (h, r, t) + f geometry (h, r, t)
[0083] Among them, F score () represents the dual score function, and F score (h, r, t) represents the value of the dual score function for calculating the triple (h, r, t), and f geometry () represents the geometric score, and f geometry (h, r, t) represents the value of the geometric score for calculating the triple (h, r, t). represents the Hamilton product, and f logic () represents the logical score, and f logic (h, r, t) represents the value of the logical score for calculating the triple (h, r, t), and r h represents the relation vector corresponding to the medical head entity, and r t represents the relation vector corresponding to the medical tail entity, and * represents element-wise multiplication.
[0084] S4. Based on the medical entities, relation vectors, and the value of the dual scoring function, calculate the combined loss function, and update the values of the medical entity vectors and medical relation vectors in the knowledge graph embedding model with this combined loss function. Among them, according to the gradient of the combined loss function, update the values of the embedding vectors. The specific update method is built into the optimizer, and its implementation method is as follows:
[0085] Based on the medical entities and relation vectors, combined with the triple (h, r, t), calculate the logical loss;
[0086] In this embodiment, according to the logical loss function formula, combined with the triple (h, r, t), calculate the logical loss L logic , where the calculation formula of the logical loss function is:
[0087]
[0088] Based on the triple (h, r, t) and the value of the dual scoring function, calculate the geometric loss:
[0089] In this embodiment, according to the geometric loss function formula, combined with the triple (h, r, t) and the value of the dual score function F score , calculate the geometric loss L geometry , where the calculation formula of the geometric loss function is:
[0090] L geometry= log(1 + exp(flag(h, r, t) * F score (h, r, t)))
[0091]
[0092] Based on the triple (h, r, t), the membership loss is calculated;
[0093] In this embodiment, according to the membership loss function formula, combined with the triple (h, r, t), the membership loss L is calculated element , where the membership loss function calculation formula is:
[0094]
[0095] According to the membership loss, geometric loss, and logical loss, the combined loss value is calculated:
[0096] L loss = L logic + L geometry + L element
[0097] where L loss represents the combined loss value, L element represents the membership loss, r T represents the transpose of the medical relationship vector, r h represents the relationship vector corresponding to the medical head entity h, r t represents the relationship vector corresponding to the medical tail entity t, 0 2d and 1 2d represent a vector of length 2d with all values being 0 and a vector of length 2d with all values being 1 respectively, 1 4d represents a vector of length 4d with all values being 1, L logic represents the logical loss, L geometry represents the geometric loss, flag(h, r, t) represents the discriminant function of whether the triple (h, r, t) exists in G, F score (h, r, t) represents the dual score function value of the triple (h, r, t), flag() represents the discriminant function, and G represents the set of all triples in the knowledge graph to be predicted.
[0098] According to the combined loss value, combined with the Adam optimizer, update the vector representation of the knowledge graph embedding model, that is, update the parameter representations of the medical entity and medical relationship vectors.
[0099] S5. Repeat steps S3 and S4 until the set end condition is reached;
[0100] In this embodiment, triples in the UMLS dataset are selected batch by batch for S3 and S4 until S3 and S4 are executed 1000 times.
[0101] S6. According to the dual scoring function, sort the triples in descending order based on the scores, and select the top K triples. Among them, the selected result is the missing connection of the predicted knowledge graph, and the implementation method for predicting the connection of the knowledge graph is as follows:
[0102] Arrange all existing medical entities and medical relationships in the knowledge graph to be predicted to generate all triple sets;
[0103] In this embodiment, using the medical entity and medical relationship information in the UMLS dataset that has been extracted, perform permutations and combinations using Python to obtain all possible triple sets.
[0104] In the generated triple sets, eliminate the existing triple sets to obtain a candidate triple set;
[0105] According to the embedding vectors of the current medical entity and medical relationship, and the dual scoring function, calculate the scores of all candidate triples in the candidate triple set;
[0106] Based on the magnitudes of the scores of all candidate triples, sort the triples in the candidate triples in descending order;
[0107] In this embodiment, the sorting method uses the sort function in Python.
[0108] Based on the sorting result, select the top k triples from the candidate triple set, and the selected result is the missing connection of the predicted knowledge graph.
[0109] In this embodiment, k is a non-zero natural number. The smaller the value, the higher the link confidence. In the present invention, the value of k is 10.
[0110] In the present invention, specific embodiments are used to elaborate on the principles and implementation manners of the present invention. The descriptions of the above embodiments are only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present invention.
[0111] Those of ordinary skill in the art will realize that the embodiments described herein are provided to assist the reader in understanding the principles of the present invention, and it should be understood that the scope of protection of the present invention is not limited to such specific statements and embodiments. Those of ordinary skill in the art can make various other specific deformations and combinations that do not depart from the essence of the present invention based on these technical revelations disclosed in the present invention, and these deformations and combinations are still within the scope of protection of the present invention.
Claims
1. A knowledge graph connection prediction method based on quaternion quantum space, characterized in that: The following steps are involved: S1. Extract the medical entity and medical relationship information of the triples in the knowledge graph to be predicted, and use the set to perform duplicate removal; S2. Based on the deduplicated triples, the medical entities and medical relationships are mapped into vectors in the quaternary quantum space, and a knowledge graph embedding model based on the quaternary quantum space is constructed; S3. Based on the current medical entity and medical relationship vector, the value of the dual scoring function is calculated using the knowledge graph embedding model; S4. Based on the medical entity and relationship vectors and the values of the dual scoring function, a combined loss function is calculated, and the values of the medical entity vectors and medical relationship vectors in the knowledge graph embedding model are updated with the combined loss function; S5, repeat S3 and S4 until the set end condition is reached; S6. According to the dual scoring function, combined with the scores, the triples are arranged in descending order, and the first K triples are selected. The selected results are the predicted missing connections of the knowledge graph, and the prediction of the knowledge graph connection is completed.
2. The knowledge graph connection prediction method based on quaternion quantum space according to claim 1 is characterized in that: The S1 is specifically: S101, define three empty sets, namely, a medical head entity set H, a medical tail entity set T, and a medical relationship set R; S102, obtaining a triple (h, r, t) in the knowledge graph to be predicted, adding the medical head entity h, the medical tail entity t, and the medical relationship r to the set, wherein the deduplication operation is automatically completed based on the singularity of the set elements; S103. Repeat S102 until all triples in the predicted knowledge graph are visited.
3. The knowledge graph connection prediction method based on quaternion quantum space according to claim 1 is characterized in that: The S2 is specifically: Based on the deduplicated triples, the medical head entity h and the medical tail entity t are embedded as real number vectors of d*d*d*d, where d represents the length of the vector in each dimension. Embed the medical relationship r into a dual four-dimensional vector r h and r t , mapped to a vector of the quaternion quantum space, to complete the construction of the knowledge graph embedding model, where r h represents the relationship vector corresponding to the medical head entity h, r t Represents the relationship vector corresponding to the medical tail entity t.
4. The knowledge graph connection prediction method based on quaternion quantum space according to claim 1 is characterized in that: The S3 is specifically: Based on the triple (h, r, t), the logical score is calculated: Based on the triple (h, r, t), the geometric score is calculated; Based on the logical score and the geometric score, the value of the dual score function is calculated.
5. The knowledge graph connection prediction method based on quaternion quantum space according to claim 4 is characterized in that: The expression of the dual score function is as follows: F score (h,r,t)=f logic (h,r,t)+f geometry (h,r,t) f logic (h,r,t)=||(1-r h )*h 2 +(1-r t )*t 2 || Among them, F score () represents the dual score function, F score (h, r, t) represents the calculation of the dual score function value of the triple (h, r, t), f geometry () represents the geometric score, f geometry (h,r,t) means calculating the geometric score value of the triple (h,r,t). represents the Hamilton product, f logic () indicates the logical score, f logic (h, r, t) means calculating the logical score value of the triple (h, r, t), r h Represents the relationship vector corresponding to the medical head entity, r t Represents the relationship vector corresponding to the medical tail entity, and * represents element-by-element multiplication.
6. The knowledge graph connection prediction method based on quaternion quantum space according to claim 1 is characterized in that: The S4 is specifically: Based on the medical entity and medical relationship vectors, combined with the triple (h, r, t), the logical loss is calculated; Based on the triple (h, r, t) and the value of the dual scoring function, the geometric loss is calculated: Based on the triple (h, r, t), the member loss is calculated; The combined loss value is calculated based on the member loss, geometric loss and logical loss; According to the combined loss value, the Adam optimizer is used to update the vector expression of the knowledge graph embedding model, that is, to update the values of the medical entity vector and the medical relationship vector.
7. The knowledge graph connection prediction method based on quaternion quantum space according to claim 6 is characterized in that: The expression of the combined loss value is as follows: L loss =L logic +L geometry +L element L geometry =log(1+exp(flag(h,r,t)*F score (h,r,t))) Among them, L loss Represents the combined loss value, L element represents member loss, r T represents the transpose of the medical relationship vector, r h represents the relationship vector corresponding to the medical head entity h, r t Represents the relationship vector corresponding to the medical tail entity t, 0 2d and 1 2d They represent vectors with length 2d and all values 0 and vectors with length 2d and all values 1, 1 4d represents a vector of length 4d with all values 1, L logic represents the logical loss, L geometry represents the geometric loss, flag(h,r,t) represents the discriminant function of whether the triple (h,r,t) exists in G, F score (h, r, t) represents the dual score function value of the triple (h, r, t), flag() represents the discriminant function, and G represents the set of all triples in the knowledge graph to be predicted.
8. The knowledge graph connection prediction method based on quaternion quantum space according to claim 1 is characterized in that: The S6 is specifically: According to the existing medical entities and medical relations in the knowledge graph to be predicted, all triple sets are arranged and generated; In the generated triple set, the existing triple set is eliminated to obtain a candidate triple set; According to the embedding vectors of the current medical entity and medical relationship, and the dual scoring function, the scores of all candidate triples in the candidate triple set are calculated; Based on the scores of all candidate triples, the triples in the candidate triples are sorted in descending order; Based on the sorting results, the first k triplets are selected from the candidate triple set, where the selected results are the predicted missing connections of the knowledge graph.
Citation Information
Cited By
Quantum circuit enhanced knowledge graph reasoning method
CN122390039A