Knowledge graph link prediction method and system based on transformation hypothesis and message passing

By introducing TransGCN's transformation hypothesis and multiple aggregators into DPMPN, the problem of heterogeneous neighborhood information processing in knowledge graph link prediction is solved, the accuracy of node representation and link prediction is improved, and better node information is achieved. distinguish.

CN114048328BActive Publication Date: 2024-09-27QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111383832.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-22
Publication Date
2024-09-27
Estimated Expiration
2041-11-22

AI Technical Summary

Technical Problem

Existing knowledge graph link prediction methods cannot effectively utilize the direction information of directed graphs, resulting in low discrimination of node neighborhood information when processing heterogeneous neighborhoods, affecting the accuracy of link prediction.

Method used

The transformation hypothesis of TransGCN and various aggregators are introduced in DMPPN, and the accuracy of node representation and neighborhood information distinction is improved through the transformation graph network and the attention aggregation graph network, and the accuracy of knowledge graph link prediction is enhanced.

Benefits of technology

It effectively improves the accuracy of full graph node representation and model performance, enhances the accuracy of knowledge graph link prediction, and can better distinguish node neighborhood information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114048328B
    Figure CN114048328B
Patent Text Reader

Abstract

The present invention provides a knowledge graph link prediction method and system based on transformation hypothesis and message passing. The method includes: obtaining data of a knowledge graph that needs to perform a link prediction task; obtaining vector representations of entities and relationships in the knowledge graph through pre-training based on the obtained data of the knowledge graph; obtaining node representations of the whole graph based on the obtained vector representations of entities and relationships and a transformation graph network; obtaining subgraph representations related to the query conditions based on the node representations of the whole graph and based on the query conditions; obtaining new subgraph representations and attention scores based on the obtained subgraph representations and an attention aggregation graph network; and performing knowledge graph link prediction based on the new subgraph representations and attention scores.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of knowledge graph technology, and in particular, relates to a knowledge graph link prediction method and system based on conversion hypothesis and message passing. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] Knowledge graphs, such as Freebase and Wikipedia, encode our real world and have attracted attention in many fields, including knowledge reasoning, knowledge question answering, and recommendation systems. Compared with the existing knowledge in the real world, current knowledge graphs are still shallow and incomplete, which motivates people to predict new knowledge based on known knowledge. Among them, the link prediction task of knowledge graphs has become an important focus task.

[0004] The knowledge graph encodes each entity and the relationship between entities as a directed graph, and each edge is represented by a triple<head,rel,tail> It means that the purpose of link prediction is to predict the missing head entity head, tail entity tail or relationship rel.

[0005] For example, Among them, YaoMing is the head entity head, YaoZhiyuan is the tail entity tail, and sonOf is the relationship rel between the head entity and the tail entity. The task of link prediction here is to predict the given query triple based on the complete triple<head,rel,?> The missing tail entity in .

[0006] Knowledge graph link prediction models can be divided into translation-based models, multiplication models, and deep learning models. Translation models, such as TransE, TransR, TransD, and RotatE, learn entity and relationship embeddings and predict the existence of triple entities by measuring the distance between the head entity and the tail entity. Multiplication models, such as DistMult, generate entity embeddings and relationship embeddings through tensor products. Deep learning models such as ConvE, CANet, and MADLINK use neural networks to encode entities and relationships and embed the encoded entities and relationships into knowledge graphs for prediction. In addition, studies on graph convolutional network (GCN) models, such as the R-GCN model, the TransGCN model, and the DPMPN model, have found that GCN models are very competitive in link prediction tasks. The DPMPN model adopts a dual GNN architecture, including two graph neural network modules based on a message passing framework. Among them, the IGNN module is used for global message passing, which can share node representations in a batch of inputs; the AGNN is used for local message passing, which can dynamically construct and expand subgraphs.

[0007] Existing knowledge graph link prediction methods cannot handle heterogeneous neighborhoods of directed graphs, resulting in the ineffective utilization of the directional information of the directed graphs and the inability to distinguish the information of node neighborhoods well, which leads to low accuracy of link prediction. Summary of the invention

[0008] In order to solve the technical problems existing in the above-mentioned background technology, the present invention provides a knowledge graph link prediction method and system based on transformation hypothesis and message passing, which effectively improves the representation accuracy of nodes and the distinction of node neighborhood information by introducing the transformation hypothesis of TransGCN and multiple aggregators in DPMPN, thereby enhancing the accuracy of knowledge graph link prediction.

[0009] In order to achieve the above object, the present invention adopts the following technical solution:

[0010] The first aspect of the present invention provides a knowledge graph link prediction method based on transformation hypothesis and message passing.

[0011] Knowledge graph link prediction methods based on transformation hypothesis and message passing include:

[0012] Get entities and relationships in the knowledge graph;

[0013] According to the acquired entities and relations, the vector representations corresponding to the entities and relations are obtained;

[0014] Processing the transformation hypothesis according to the vector representation of entities and relationships, and obtaining the updated node representation of the whole graph according to the processed vector representation and the transformed graph network;

[0015] According to the obtained updated full-graph node representation, based on the query condition, the sub-graph node representation related to the query condition is obtained;

[0016] According to the obtained subgraph node representation, the attention aggregation graph network and attention mechanism are used to update the node representation and attention score of the subgraph;

[0017] Perform knowledge graph link prediction based on the obtained attention scores.

[0018] The second aspect of the present invention provides a knowledge graph link prediction system based on transformation hypothesis and message passing.

[0019] A knowledge graph link prediction system based on transformation hypothesis and message passing, including:

[0020] A knowledge acquisition module, which is configured to: acquire entity and relationship data of the entire knowledge graph;

[0021] A transformation graph network module is configured to: obtain a node representation of the entire graph according to the acquired entity and relationship data;

[0022] An attention aggregation graph network module is configured to: generate a subgraph related to the query condition according to the node representation of the full graph based on the query condition, and obtain an updated node representation of the subgraph according to the attention scores affected by the full graph node representation and the subgraph node representation;

[0023] The attention module is configured to perform knowledge graph link prediction based on the final attention score.

[0024] A third aspect of the present invention provides a computer-readable storage medium.

[0025] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the knowledge graph link prediction method based on transformation hypothesis and message passing as described in the first aspect above.

[0026] A fourth aspect of the present invention provides a computer device.

[0027] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the knowledge graph link prediction method based on transformation hypothesis and message passing as described in the first aspect above are implemented.

[0028] Compared with the prior art, the present invention has the following beneficial effects:

[0029] 1. The method, system, medium and computer device described in the present invention effectively improve the accuracy of full-graph node representation by introducing the transformation hypothesis and message passing function of TransGCN in DPMPN.

[0030] 2. The method, system, medium and computer device described in the present invention can effectively improve the performance of the model by introducing multiple aggregators in DPMPN and considering different adjacency information when aggregating subgraph messages. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The accompanying drawings in the specification, 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.

[0032] Figure 1 It is a structural diagram of the transformation assumptions with message passing aggregation network model (TMPAN) of the present invention;

[0033] Figure 2 is a comparison chart of experimental results of several models given in the embodiments of the present invention;

[0034] Figure 3 is another comparison chart of experimental results of several models provided in the embodiments of the present invention;

[0035] Figure 4 It is a comparison chart of the model iteration experimental results given in the embodiments of the present invention. DETAILED DESCRIPTION

[0036] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0037] It should be noted that the following detailed descriptions are all illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0038] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0039] It should be noted that the flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the methods and systems according to various embodiments of the present invention. It should be noted that each box in the flowchart or block diagram can represent a module, a program segment, or a part of a code, and the module, program segment, or a part of a code may include one or more executable instructions for implementing the logical functions specified in each embodiment. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, or they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the flowchart and / or block diagram, and the combination of boxes in the flowchart and / or block diagram can be implemented using a dedicated hardware-based system that performs a specified function or operation, or can be implemented using a combination of dedicated hardware and computer instructions.

[0040] Embodiment 1

[0041] like Figure 1As shown, this embodiment provides a knowledge graph link prediction method based on conversion hypothesis and message passing. This embodiment uses the method applied to a server as an example for illustration. It can be understood that the method can also be applied to a terminal, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network servers, cloud communications, middleware services, domain name services, security services CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in this application. In this embodiment, the method includes the following steps:

[0042] Obtain the data of the knowledge graph required for link prediction tasks;

[0043] Based on the acquired knowledge graph data, vector representations of entities and relationships in the knowledge graph are obtained through pre-training;

[0044] Based on the obtained vector representations of entities and relationships and the transformed graph network, the node representation of the entire graph is obtained;

[0045] According to the node representation of the whole graph, based on the query condition, the subgraph representation related to the query condition is obtained;

[0046] According to the obtained subgraph representation and attention aggregation graph network, a new subgraph representation and attention score are obtained;

[0047] Knowledge graph link prediction based on new subgraph representations and attention scores.

[0048] As one or more implementation modes, the transformation graph network transforms the head entity and the tail entity through the transformation hypothesis and takes the relationship in the triple as the transformation operator, and after the transformation, the tail entity is the transformed head entity.

[0049] As one or more implementation modes, the conversion hypothesis operation between the head and tail entities is specifically: defining the conversion operator of the conversion hypothesis operation according to the entity-relationship combination operation used in pre-training.

[0050] As one or more implementation modes, obtaining the node representation of the entire graph specifically includes: updating the node representation of the entire graph using a message passing function and a node update function that are compatible with the conversion hypothesis, thereby obtaining an updated node representation of the entire graph.

[0051] As one or more implementation modes, the method for obtaining a subgraph representation is specifically as follows: according to a subgraph representation related to a query condition, the subgraph representation is updated through an attention aggregation graph network to obtain a new subgraph representation.

[0052] As one or more implementation modes, the method for aggregating messages in the attention aggregation graph network is specifically as follows: the information of the neighboring points of each node is different, and multiple aggregators can use appropriate aggregation functions according to different neighborhood messages, and then use a node degree-based scaler to amplify or reduce the incoming messages according to the number of messages to be aggregated.

[0053] As one or more implementation modes, the process of performing knowledge graph link prediction based on the new subgraph representation and attention score includes: obtaining the attention score according to the subgraph node information, query conditions and the updated full-graph node representation based on the transfer matrix, and performing knowledge graph link prediction based on the attention score.

[0054] In order to illustrate the technical solution of this implementation, the following is a detailed introduction:

[0055] Obtain the data of the knowledge graph required for link prediction tasks.

[0056] The data of the method in this embodiment is taken from two knowledge graph datasets, FB15K-237 and YAGO3-10.

[0057] Based on the acquired knowledge graph data, vector representations of entities and relationships in the knowledge graph are obtained through pre-training.

[0058] The method of this embodiment uses TransE to initialize the entity and relationship vector representations in the knowledge graph.

[0059] Based on the obtained vector representations of entities and relationships and the transformed graph network, the node representation of the entire graph is obtained.

[0060] The entity and relationship vectors of the initialized knowledge graph are sent to the transformation graph network to calculate the node representation of the entire graph.

[0061] According to the node representation of the whole graph, based on the query condition, the subgraph representation related to the query condition is obtained.

[0062] Based on the query condition, a node representation of a subgraph related to the query condition is obtained from the node representation of the full graph.

[0063] According to the obtained subgraph representation and attention aggregation graph network, new subgraph representation and attention score are obtained.

[0064] The subgraph representation is fed into the attention aggregation graph network to obtain the node representation of the new subgraph. The node representation of the full graph and the node representation of the subgraph will affect the attention score, and the attention score will also affect the calculation of the subgraph node representation.

[0065] Knowledge graph link prediction based on new subgraph representations and attention scores.

[0066] We will use the attention score from the last step as the probability of link prediction.

[0067] The specific implementation process is as follows:

[0068] The transformation hypothesis and message passing aggregation network model structure described in this embodiment is divided into three modules: a transformation graph network module, an attention aggregation graph network module and an attention module. Figure 1 As shown. We use the message passing framework to implement the entire model. The transformation graph network (TGN) module passes messages throughout the graph and calculates the representations of all nodes in the graph. The attentive aggregation graph network (AAGN) module is used to pass messages on small subgraphs. This module relies on the node representations generated by the TGN module and generates node representations based on the input query. The attention module performs streaming attention calculations based on the node representations generated by the TGN module and the AAGN module, affecting the node representations generated by the AAGN. In this section, we will introduce the various modules of the TMPAN model in detail.

[0069] (1) Transformation Graph Network Module

[0070] The knowledge graph is a directed graph, which leads to the problem of heterogeneous neighborhoods. That is, traditional graph neural networks transmit information along the edge direction on a directed graph, but the direction of the relationship between the central entity and the adjacent entities is different. IGNN transmits messages according to the direction of the relationship, making it impossible for nodes to collect information contained in the opposite direction, that is, the IGNN module of DPMPN cannot effectively handle the heterogeneous relationships that lead to heterogeneous neighborhoods in the knowledge graph. To solve this problem, we designed a TGN module to replace the IGNN module of DPMPN. Here we introduce the conversion hypothesis in TransGCN to convert the heterogeneous neighborhoods in the knowledge graph into homogeneous neighborhoods. Specifically, we introduce the conversion hypothesis in TransGCN, using the relationship in the knowledge graph as the conversion operation to transform the head and tail entities. Through the conversion hypothesis, we pass the information in the knowledge graph relationship to the central node in the opposite direction.

[0071] Next, we describe the operation of the transformation hypothesis in detail. Transformations between entities include translation, rotation, etc. After the relational transformation of the triples in the knowledge graph, the tail entity is the transformed head entity, so that the head entity can estimate the embedding of the tail entity. The formula for this transformation is as follows:

[0072]

[0073] Where ◇ and · are defined as two transformation operators, which are specially designed to handle the direction of relations. Taking TransE as an example, given an entity v i And out-degree triples (v i ,r k ,v j ), and v i Based on (v i ,r k ,v j ) is estimated (v j -r k ) is defined as v i neighborhood. Similarly, for entity v i The in-degree triplet (v l ,r m ,v i ), we define the embedding estimates of other neighbors as (v l +r m ). After transformation, the heterogeneous neighborhoods in the knowledge graph are transformed into homogeneous neighborhoods, and the graph neural network can better aggregate the information in the neighborhood of the central node.

[0074] In the TGN module, we introduce the TransGCN message passing function to pass global messages. Each node v is initialized as Each edge generates a message at κ steps, defined as M κ . This information is combined with the self-loop information to update the node state. The function is calculated as follows:

[0075] Message passing functions:

[0076] Node update function:

[0077] where c i is with v i The relevant node degree, W is a layer-specific matrix, and ρ is the activation function ReLu. After κ steps, we output the node state to the next module.

[0078] (2) Attention Aggregation Graph Network Module

[0079] To solve the single-shot problem of the AGNN module in DPMPN, we introduce the various aggregators proposed in PNA and replace AGNN with our new module AAGN. AAGN uses the results of the TGN module and the input query of the training dataset: <e head ,e rel ,? > is used to calculate the node representation, defined as We perform pruned message passing on the subgraph. The message aggregation method in AAGN adopts a combination of a node degree-based scaler and multiple aggregators. The combination of aggregators and scalers can produce multiple aggregation modes. Multiple aggregation modes can effectively alleviate the single-shot problem, improve the differentiation of node information, and enable each node to better understand the information distribution of its neighbors. At the same time, the node degree-based scaler can amplify or attenuate the signal according to the degree of each node, thereby effectively improving the differentiation of node information during message passing. In the initial step 0, from e head Initially, the message passing information is defined as M k (x). The function is calculated as follows:

[0080] Message passing functions:

[0081] Among them, η represents a two-layer MLP, the first layer is the activation function leakyReLu, and the second layer is the activation function tanh.

[0082] Message aggregation is done by the scaler based on node degree and multiple aggregators. The function calculation is as follows:

[0083] Node degree based scaler:

[0084]

[0085] The scaler formula based on node degree defines scaler, S(d,α); d is the degree of the node, when d>0, S(d,α) is an injective function, α is a variable parameter, and δ is a standardized parameter calculated on the training set.

[0086] Message aggregation function:

[0087] In the message aggregation function, σ is a linear neural network layer, I means there is no scaler, Represents vector multiplication. Aggregators include four aggregation functions: mean, max, min, and std.

[0088] We update the node state in combination with node attention, and the function calculation is as follows:

[0089] Node attention function: in is the attention score and W is a learnable matrix.

[0090] Node update function:

[0091]

[0092] The node attention information is the attention score obtained by the attention module. and the node representations of the TGN module passed to the AAGN module and projected by the learnable matrix W. Represents the context vector of the input query of the training dataset. ξ represents a two-layer MLP, the first layer is the activation function leakyReLu, and the second layer is the activation function tanh.

[0093] In our AAGN module, for the message passing function, node attention function, and node state update function, we follow the functions of AGNN in the DPMPN model. At the same time, we introduce the scaler and multiple aggregators of PNA to form the message aggregation function.

[0094] (3) Attention Module

[0095] We use the attention module in DPMPN. Here, the k-step attention is represented by the probability distribution sequence of nodes, defined as a k (k=1,2,...,K). a is initialized as a one-hot vector, and we calculate the transition matrix K at each step k To distract attention. The attention module relies on TGN and AAGN to obtain the interaction between visible nodes and invisible neighbors. The function is calculated as follows:

[0096]

[0097]

[0098]

[0099] Where W1 and W2 are two learnable matrices. Each MLP is a single layer with the activation function leakyReLu. At step k, node v j There are n largest attention scores, and the next attention transition uses node v j The formula for calculating the new attention score is: k+1 =K k a k / ||K k a k ||. The attention score of the last step is used as the probability of predicting the tail node.

[0100] Embodiment 2

[0101] Knowledge graph link prediction methods based on transformation hypothesis and message passing include:

[0102] Obtain the data of the knowledge graph required for link prediction tasks;

[0103] Based on the acquired knowledge graph data, vector representations of entities and relationships in the knowledge graph are obtained through pre-training;

[0104] Based on the obtained vector representations of entities and relationships and the transformed graph network, the node representation of the entire graph is obtained;

[0105] According to the node representation of the whole graph, based on the query condition, the subgraph representation related to the query condition is obtained;

[0106] According to the obtained subgraph representation and attention aggregation graph network, a new subgraph representation and attention score are obtained;

[0107] Knowledge graph link prediction based on new subgraph representations and attention scores.

[0108] The technical solution of this embodiment can be applied in the medical field, and the solution of this embodiment can be used as a prediction of the knowledge graph link of family genetic medical history. For example: the query condition is: (Zhao, the reason for diabetes,?), Zhao was diagnosed with diabetes, which may be a family genetic disease, then according to this query condition, the knowledge graph of all people with diabetes who are related to Zhao can be updated, and then the knowledge graph of all direct family members with diabetes who are elders of Zhao can be screened out. Finally, it is predicted that Zhao got diabetes because he inherited the diabetes of Zhao's grandfather, thus obtaining the knowledge graph link (Zhao, the reason for diabetes, genetic).

[0109] Embodiment 3

[0110] This embodiment provides a knowledge graph link prediction system based on transformation hypothesis and message passing.

[0111] A knowledge graph link prediction system based on transformation hypothesis and message passing, including:

[0112] The knowledge acquisition module is configured to: acquire data of the knowledge graph required for link prediction tasks;

[0113] The transformation graph network module is configured to: obtain vector representations of entities and relationships in the knowledge graph through pre-training based on the acquired knowledge graph data, and obtain node representations of the entire graph based on the obtained vector representations of entities and relationships and the transformation graph network;

[0114] The attention aggregation graph network module is configured to: obtain a subgraph representation related to the query condition based on the node representation of the full graph and the query condition, and obtain a new subgraph representation and attention score based on the obtained subgraph representation and the attention aggregation graph network and the attention score;

[0115] The attention module is configured to perform knowledge graph link prediction based on the new subgraph representation and attention scores.

[0116] It should be noted that the above prediction module and model building module are the same as the examples and application scenarios implemented by the steps in Embodiment 1, but are not limited to the contents disclosed in Embodiment 1. It should be noted that the above modules as part of the system can be executed in a computer system such as a set of computer executable instructions.

[0117] Embodiment 4

[0118] This embodiment provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the steps in the knowledge graph link prediction method based on conversion hypothesis and message passing as described in the above-mentioned embodiment 1 or embodiment 2 are implemented.

[0119] Embodiment 5

[0120] This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps in the knowledge graph link prediction method based on transformation hypothesis and message passing as described in the above-mentioned embodiment 1 or embodiment 2 are implemented.

[0121] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.

[0122] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0123] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0124] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0125] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0126] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A knowledge graph link prediction method based on transformation hypothesis and message passing, characterized in that: Applications in the medical field include: Obtain the data of the knowledge graph required for link prediction tasks; Based on the acquired knowledge graph data, vector representations of entities and relationships in the knowledge graph are obtained through pre-training; Based on the obtained vector representations of entities and relationships and the transformed graph network, the node representation of the entire graph is obtained; The transformation graph network transforms the head entity and the tail entity through the transformation hypothesis and takes the relationship in the triple as the transformation operator, and after the transformation, the tail entity is the transformed head entity; The conversion hypothesis operation between the head and tail entities is specifically: defining the conversion operator of the conversion hypothesis operation according to the entity-relation combination operation used in pre-training; According to the node representation of the whole graph, based on the query condition, the subgraph representation related to the query condition is obtained; The obtaining of the node representation of the entire graph specifically comprises: updating the node representation of the entire graph using a message passing function and a node updating function adapted to the transformation hypothesis, thereby obtaining an updated node representation of the entire graph; According to the obtained subgraph representation and attention aggregation graph network, a new subgraph representation and attention score are obtained; The method for obtaining the subgraph representation is specifically as follows: according to the subgraph representation related to the query condition, the subgraph representation is updated by the attention aggregation graph network to obtain a new subgraph representation; The method for aggregating messages in the attention aggregation graph network is as follows: the information of the neighboring points of each node is different, and multiple aggregators can use appropriate aggregation functions according to different neighborhood messages, and then use a node degree-based scaler to amplify or reduce the incoming messages according to the number of messages to be aggregated; Perform knowledge graph link prediction based on new subgraph representations and attention scores; The process of performing knowledge graph link prediction based on the new subgraph representation and the attention score includes: obtaining the attention score according to the subgraph node information, the query condition and the updated full graph node representation according to the transfer matrix, and performing knowledge graph link prediction based on the attention score; Among them, the knowledge graph that needs to perform the link prediction task is the knowledge graph for predicting family genetic disease history; the query condition is the reason why the patient suffers from diabetes, and the subgraph related to the query condition is represented by the knowledge graph of all direct family members who have an elder relationship with the patient and suffer from diabetes.

2. The system of the knowledge graph link prediction method based on transformation hypothesis and message passing according to claim 1 is characterized in that: Applications in the medical field include: The knowledge acquisition module is configured to: acquire data of the knowledge graph required for link prediction tasks; The transformation graph network module is configured to: obtain vector representations of entities and relationships in the knowledge graph through pre-training based on the acquired knowledge graph data, and obtain node representations of the entire graph based on the obtained vector representations of entities and relationships and the transformation graph network; The attention aggregation graph network module is configured to: obtain a subgraph representation related to the query condition based on the node representation of the full graph and the query condition, and obtain a new subgraph representation and attention score based on the obtained subgraph representation and the attention aggregation graph network and the attention score; The attention module is configured to: perform knowledge graph link prediction based on the new subgraph representation and attention scores; Among them, the knowledge graph that needs to perform the link prediction task is the knowledge graph for predicting family genetic disease history; the query condition is the reason why the patient suffers from diabetes, and the subgraph related to the query condition is represented by the knowledge graph of all direct family members who have an elder relationship with the patient and suffer from diabetes.

3. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the knowledge graph link prediction method based on conversion hypothesis and message passing as described in claim 1 are implemented.

4. 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 program, the steps in the knowledge graph link prediction method based on conversion hypothesis and message passing as described in claim 1 are implemented.