Method for predicting entity relationship and training method and device of relationship prediction model
By combining graph neural networks with embedding algorithms, the problem of low accuracy in entity relationship prediction in existing technologies has been solved, and higher accuracy in entity relationship prediction has been achieved, especially in drug and disease relationship prediction, which reduces the risk of new drug development.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-29
- Publication Date
- 2026-03-31
AI Technical Summary
Existing technologies have low prediction accuracy and incomplete results when predicting entity relationships.
By combining graph neural networks with embedding algorithms, we can predict unconnected entity relationships in a knowledge graph by determining the embedding features of entities and entity relationships, and improve the prediction accuracy by training the model.
It improves the accuracy of entity relationship prediction, enabling better discovery of potential relationships between entities and reducing the risks of new drug development.
Smart Images

Figure CN113961720B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence, specifically to the fields of deep learning and knowledge graphs, and more specifically to a method for predicting entity relationships and a training method, apparatus, electronic device, and storage medium for a relationship prediction model. Background Technology
[0002] Entity relationship prediction is a research hotspot in the field of artificial intelligence applications. In related technologies, methods such as the nearest distance method or random walk method are commonly used to predict entity relationships. However, these methods all suffer from low prediction accuracy and incomplete prediction results. Summary of the Invention
[0003] A method, apparatus, electronic device, and storage medium for predicting entity relationships to improve prediction accuracy are provided.
[0004] One aspect of this disclosure provides a method for predicting entity relationships, comprising: determining a first embedding feature for each entity in a first knowledge graph and a second embedding feature for each entity relationship in the first knowledge graph; and determining an entity relationship between two target entities that do not have an entity relationship in the first knowledge graph based on the first embedding feature, the second embedding feature, and the first knowledge graph, using a relationship prediction model including a graph neural network.
[0005] Another aspect of this disclosure provides a method for training a relation prediction model, comprising: determining a third embedding feature of each entity in a second knowledge graph and a fourth embedding feature of each entity relation in the second knowledge graph; determining sample data for a relation prediction model including a graph neural network based on multiple entities in the second knowledge graph and entity relations between entities, the sample data including the third embedding features of two entities in the second knowledge graph and the actual entity relation between the two entities; determining a predicted entity relation between two entities using the relation prediction model including a graph neural network based on the sample data and the second knowledge graph; and training the relation prediction model including a graph neural network based on the predicted entity relation and the actual entity relation.
[0006] Another aspect of this disclosure provides an apparatus for predicting entity relationships, comprising: a first feature determination module for determining a first embedding feature of each entity in a first knowledge graph and a second embedding feature of each entity relationship in the first knowledge graph; and a first relationship determination module for determining an entity relationship between two target entities in the first knowledge graph that do not have an entity relationship, based on the first embedding feature, the second embedding feature, and the first knowledge graph, using a relationship prediction model including a graph neural network.
[0007] Another aspect of this disclosure provides a training apparatus for a relation prediction model, comprising: a second feature determination module for determining a third embedding feature of each entity in a second knowledge graph and a fourth embedding feature of each entity relation in the second knowledge graph; a sample data determination module for determining sample data for a relation prediction model including a graph neural network based on multiple entities in the second knowledge graph and entity relations between entities, the sample data including the third embedding features of two entities in the second knowledge graph and the actual entity relation between the two entities; a second relation determination module for determining a predicted entity relation between two entities using the relation prediction model including a graph neural network based on the sample data and the second knowledge graph; and a model training module for training the relation prediction model including a graph neural network based on the predicted entity relation and the actual entity relation.
[0008] Another aspect of this disclosure provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method for predicting entity relationships and / or the training method for a relationship prediction model provided in this disclosure.
[0009] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause a computer to execute the method for predicting entity relationships and / or the training method for the relationship prediction model provided in this disclosure.
[0010] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method for predicting entity relationships and / or the training method for a relationship prediction model provided in this disclosure.
[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0012] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0013] Figure 1 This is a schematic diagram illustrating an application scenario of the method for predicting entity relationships and the training method and apparatus for predicting relationship prediction models according to embodiments of this disclosure.
[0014] Figure 2 This is a flowchart illustrating a method for predicting entity relationships according to an embodiment of the present disclosure;
[0015] Figure 3 This is a schematic diagram illustrating the principle of determining the entity relationship between two target entities according to an embodiment of this disclosure;
[0016] Figure 4 This is a schematic diagram illustrating the principle of determining the entity relationship between two target entities according to another embodiment of this disclosure;
[0017] Figure 5 This is a schematic diagram illustrating the principle of determining the context information of each triple according to an embodiment of the present disclosure;
[0018] Figure 6 This is a flowchart illustrating a training method for a relationship prediction model according to an embodiment of the present disclosure;
[0019] Figure 7 This is a structural block diagram of an apparatus for predicting entity relationships according to an embodiment of the present disclosure;
[0020] Figure 8 This is a structural block diagram of a training apparatus for a relation prediction model according to embodiments of the present disclosure; and
[0021] Figure 9 This is a structural block diagram of an electronic device used to implement the method for predicting entity relationships and / or the training method for a relationship prediction model according to embodiments of the present disclosure. Detailed Implementation
[0022] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0023] This disclosure provides a method for predicting entity relationships, comprising a feature determination stage and a relationship determination stage. In the feature determination stage, a first embedding feature of each entity in a first knowledge graph and a second embedding feature of each entity relationship in the first knowledge graph are determined. In the relationship determination stage, based on the first embedding features, the second embedding features, and the first knowledge graph, a relationship prediction model including a graph neural network is used to determine the entity relationship between two target entities that do not currently have an entity relationship in the first knowledge graph.
[0024] The following will combine Figure 1 The application scenarios of the methods and apparatus provided in this disclosure are described.
[0025] Figure 1 This is a schematic diagram illustrating an application scenario of the method for predicting entity relationships and the training method and apparatus for predicting relationship prediction models according to embodiments of this disclosure.
[0026] like Figure 1 As shown, the application scenario 100 of this embodiment may include an electronic device 110. The electronic device 110 may be various devices with processing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0027] For example, the electronic device 110 may have various client applications installed, including but not limited to instant messaging applications, relationship prediction applications, news applications, etc. (for example only).
[0028] like Figure 1 As shown, the electronic device 110 may, for example, store a knowledge graph 120, which includes multiple entities and entity relationships between them. In the knowledge graph 120, each entity is represented by multiple nodes, and the entity relationships between entities are represented by connecting edges between nodes. The electronic device 110 may, for example, mine entity relationships 130 between two entities that do not currently have an entity relationship in the knowledge graph 120. The electronic device 110 may also expand the knowledge graph 120 based on the mined entity relationships 130. In this way, the expanded knowledge graph can better reflect the relationships between entities.
[0029] In one embodiment, for example, the nearest neighbor method or random walk method can be used to mine entity relationships between two unconnected entities in a knowledge graph. Alternatively, an embedding algorithm can be used first to embed the elements (entities and entity relationships) in the knowledge graph, and then a relationship prediction model can be used to mine entity relationships based on the embedding representation. The embedding algorithm can be, for example, a translating embedding algorithm (TransE) or a translating on hyperplanes algorithm (TransH).
[0030] In one embodiment, such as Figure 1 As shown, the application scenario 100 may further include a server 140, which can be a backend management server providing support for client applications running on the electronic device 110. The server 140 may pre-train a relationship prediction model 150 and, in response to a model retrieval request from the electronic device 110, send the relationship prediction model 150 to the electronic device 110. For example, the server 140 may also store a knowledge graph 120 and, based on the entities and relationships between entities in the knowledge graph 120, determine sample data for the relationship prediction model, so as to train the relationship prediction model 150 based on this sample data.
[0031] In one embodiment, server 140 may maintain a knowledge graph 120. Electronic device 110 may send a relationship prediction request to server 140. The relationship prediction request may include two target entities. In response to the relationship prediction request, server 140 may predict the entity relationship between the two target entities based on knowledge graph 120 and relationship prediction model 150. Server 140 may also feed back the predicted entity relationship to electronic device 110 for use or display by electronic device.
[0032] It should be noted that the method for predicting entity relationships provided in this disclosure can be executed by electronic device 110 or server 140. Accordingly, the apparatus for predicting entity relationships provided in this disclosure can be located in electronic device 110 or server 140. The training method for the relationship prediction model provided in this disclosure can be executed by server 140. Accordingly, the training apparatus for the relationship prediction model provided in this disclosure can be located in server 140.
[0033] Understandable, Figure 1 The types of electronic devices, knowledge graphs, and servers shown are merely illustrative. Depending on implementation needs, any type of electronic device, knowledge graph, and server can be used.
[0034] The following will combine Figure 1 ,pass Figures 2-5 The method for predicting entity relationships provided in this disclosure is described in detail.
[0035] Figure 2 This is a flowchart illustrating a method for predicting entity relationships according to an embodiment of the present disclosure.
[0036] like Figure 2 As shown, the method 200 for predicting entity relationships in this embodiment may include operations S210 to S220.
[0037] In operation S210, the first embedding feature of each entity in the first knowledge graph and the second embedding feature of each entity relation in the first knowledge graph are determined.
[0038] According to embodiments of this disclosure, a first knowledge graph can represent multiple entities and entity relationships between them. For example, the first knowledge graph can represent multiple entities through multiple nodes, and the entity relationship between two entities can be represented by edges connecting the nodes. Entities can be, for example, drugs, diseases, doctors, symptoms, etc., or actors, movie titles, directors, movie genres, etc. It is understood that the entity can be set according to actual needs, and correspondingly, the type of entity relationship can be determined based on the entity; this disclosure does not limit this. For example, if the entities in the first knowledge graph include drugs and diseases, then the entity relationship can include a treatment relationship.
[0039] According to embodiments of this disclosure, entities and relationships between entities can be extracted from multimedia information such as professional books, authoritative reports, and magazines to obtain multiple triples. A first knowledge graph can then be constructed based on these triples. Specifically, two entities with an entity relationship and the entity relationship between them constitute a triple. For example, a triple may include a head entity h and a tail entity t, and the entity relationship between these two entities can be represented by r. In the knowledge graph, the connecting edge representing r points from the node representing h to the node representing t.
[0040] According to embodiments of this disclosure, the TransE algorithm and similar algorithms can be used to determine the first and second embedding features. In the TransE algorithm, entities and entity relations are mapped to a vector space, and both entities and entity relations can be represented by vectors. The main idea of the TransE algorithm is to equate the relation in a triple (h, r, t) to the operation of transferring the vector representing the head entity to the vector representing the tail entity; this operation is called translation. The TransE algorithm maximizes the probability of the triple being true by measuring the distance between the sum of the vector H representing h and the vector R representing entity relation r, and the vector T representing t, thereby obtaining the embedding features of the entity and the embedding features of the entity relation. The distance between H+R and T can be, for example, L1 or L2 distance. It is understood that this embodiment can also use the TransH algorithm, TransR algorithm, etc., to obtain the embedding features of the entity and the embedding features of the entity relation.
[0041] In operation S220, based on the first embedded feature, the second embedded feature, and the first knowledge graph, a relationship prediction model including a graph neural network is used to determine the entity relationship between two target entities that do not have an entity relationship in the first knowledge graph.
[0042] According to embodiments of this disclosure, there are no connecting edges between the two nodes representing the two target entities in the first knowledge graph. The two target entities can be entities of two different types, or entities of the same type. For example, if the entities in the first knowledge graph can include drugs and diseases, then one of the two target entities can be a drug, and the other can be a disease.
[0043] According to embodiments of this disclosure, the relationship prediction model may include, for example, a graph neural network and a classification network. This embodiment can input the first embedding feature of each target entity in two target entities and the structural information of a first knowledge graph into the graph neural network to obtain feature data of each target entity represented by its neighboring entities in the first knowledge graph. That is, the graph neural network is used to extract features of each target entity from the first knowledge graph. Thus, two feature data representing the two target entities can be obtained. Subsequently, this embodiment can use these two feature data as input to a classification network, which outputs the probability that the two target entities have an entity relationship. If the probability is greater than a threshold, it can be determined that the two target entities have an entity relationship. The structural information of the first knowledge graph can be obtained by first sequentially encoding each entity in the first knowledge graph, and then representing the sequentially encoded entities using the first embedding feature, thereby obtaining an embedding feature matrix. Each row in the embedding feature matrix represents a first embedding feature of an entity. Setting the first embedding feature as an N-dimensional vector and the number of entities in the first knowledge graph as M, the size of the resulting embedding feature matrix is N×M. Then, based on the entity relationship between any two entities in the sequentially encoded entities, a relation matrix A can be obtained. The relation matrix A has a size of M×M. The element a in the relation matrix... ij This represents the entity relationship between the i-th entity and the j-th entity among M sequentially encoded entities. If there is no entity relationship, then a ij The value is 0. If there are multiple types of entity relationships in the first knowledge graph, different types of entity relationships can be represented by assigning different values to the elements.
[0044] In one embodiment, if there are multiple predicted entity relationships, the classification network outputs multiple probabilities, each corresponding one-to-one with a different entity relationship. This embodiment can select probabilities greater than a threshold from these probabilities and use the entity relationships corresponding to probabilities greater than the threshold as the entity relationships between the two target entities.
[0045] For example, when the two target entities include a drug and a disease, the predicted entity relationship can include therapeutic relationships and adverse relationships. In a drug retargeting scenario, this predicted entity relationship can be a therapeutic relationship. By predicting this entity relationship, the potential efficacy of existing marketed drugs can be identified, allowing the use of older drugs to treat new diseases. This is because marketed drugs already possess complete safety and pharmacokinetic data, which can reduce the development risk of new drug efficacy.
[0046] According to embodiments of this disclosure, the graph neural network can be, for example, a graph convolutional neural network, and the classification network can, for example, determine whether two target entities have an entity relationship based on the similarity between two feature data. Alternatively, the classification network can adopt a structure consisting of multilayer perceptrons and softmax layers, etc., and this disclosure does not limit it in this way.
[0047] This embodiment combines the embedding representation of knowledge graphs with graph neural networks. Based on the embedded features of entities and entity relationships, it learns the features of neighboring entities of an entity via a graph neural network. Compared to random walk algorithms or nearest-neighbor methods in related technologies, this approach considers multi-faceted information when predicting entity relationships, thus improving the prediction accuracy of entity relationships to a certain extent and facilitating the effective discovery of potential relationships between entities.
[0048] Figure 3 This is a schematic diagram illustrating the principle of determining the entity relationship between two target entities according to an embodiment of this disclosure.
[0049] According to embodiments of this disclosure, when performing relationship prediction, for example, it may be possible to predict only whether there is a target entity relationship between two target entities. Accordingly, at least one pair of target entities may be initially screened from the first knowledge graph based on the target entity relationship, and the two entities included in each pair of target entities may have a target entity relationship.
[0050] For example, such as Figure 3 As shown, in this embodiment 300, when determining the entity relationship between two target entities that do not have an entity relationship in the first knowledge graph, the embedding feature of the target entity relationship can be selected from the second embedding feature 310 of the entity relationship in the first knowledge graph, and the found embedding feature can be used as the target embedding feature. For example, in this embodiment, the target entity relationship in the first knowledge graph can be labeled. After obtaining the second embedding feature 310, the embedding feature corresponding to the labeled entity relationship in the second embedding feature can be used as the target embedding feature.
[0051] After obtaining the target embedding feature 320, at least one target entity pair in the first knowledge graph can be determined based on the first embedding feature of the entity in the first knowledge graph and the target embedding feature.
[0052] For example, in this embodiment 300, for each node 331 representing an entity, other nodes not connected to that node through edges are first selected from the first knowledge graph 330, and the entities represented by these other nodes are taken as candidate entities 332. Then, the first embedding feature of each entity is added to the target embedding feature, and the distance between the added feature and the first embedding feature of each candidate entity is calculated. Each candidate entity corresponding to the first embedding feature whose distance to the feature sum is less than a predetermined distance is taken as a target entity 333 that may have a target entity relationship with each entity, and forms a target entity pair with each entity. The distance between the feature sum and the first embedding feature can be represented by L1 distance or L2 distance, etc. For each entity in the knowledge graph, the target entities that may have a target entity relationship with each entity can be determined through the above process. Finally, this embodiment can perform a deduplication operation on all the obtained target entity pairs to obtain at least one target entity pair 340. Each target entity pair in the at least one target entity pair 340 includes two target entities that do not have an entity relationship in the first knowledge graph 330.
[0053] After obtaining at least one target entity pair, a relationship prediction model can be used to determine whether each target entity pair has a target entity relationship based on the at least one target entity pair and the first knowledge graph.
[0054] For example, in this embodiment, the structural information of the first knowledge graph 330 and the two first embedding features 350 of each target entity pair 340 can be input into the relationship prediction model 360, which outputs the probability 370 that the two entities in each target entity pair 340 have a target entity relationship. Thus, at least one probability can be obtained for at least one target entity pair. When there are multiple target entity pairs, this embodiment can use the target entity pairs corresponding to the larger probabilities among the multiple probabilities as the target entity pairs with an entity relationship.
[0055] Figure 4 This is a schematic diagram illustrating the principle of determining the entity relationship between two target entities according to another embodiment of this disclosure.
[0056] According to embodiments of this disclosure, after obtaining at least one target entity pair, the first knowledge graph can be expanded based on the at least one target entity pair, and the expanded knowledge graph can be used to determine whether the target entity pair has a target entity relationship.
[0057] For example, such as Figure 4As shown, in this embodiment 400, the first knowledge graph 410 may include entities 411 to 415. Entities 411 and 413 have entity relationships, entities 412 and 414, entities 412 and 413, and entities 412 and 415 all have entity relationships, and entities 414 and 415 have entity relationships.
[0058] The at least one target entity pair obtained through the foregoing embodiments includes an entity pair consisting of entities 411 and 415, an entity pair consisting of entities 411 and 412, an entity pair consisting of entities 411 and 414, an entity pair consisting of entities 413 and 414, and an entity pair consisting of entities 413 and 415. By adding edges connecting the two nodes representing the two entities in each entity pair to the first knowledge graph 410, the first knowledge graph 410 can be expanded to obtain the expanded knowledge graph 420.
[0059] After obtaining the expanded knowledge graph 420, the first embedding features of the two target entities included in each target entity pair and the structural information of the expanded knowledge graph 420 can be input into the relationship prediction model, and the relationship prediction model outputs the probability that the two target entities in each target entity pair have a target entity relationship.
[0060] It should be noted that in the expanded knowledge graph, weights can be added to the edges representing entity relationships. For example, for a first entity relationship existing in the first knowledge graph, the weight of the edge representing that first entity relationship can be 1. For a second entity relationship obtained by expanding the first knowledge graph, the weight of the edge representing that second entity relationship (such as...) can be... Figure 4 The weight of the edge (represented by the dashed line in the diagram) is a predetermined value less than 1. This predetermined value can be any value such as 0.8 or 0.6, and this disclosure does not limit it.
[0061] This embodiment can improve the accuracy of the features of target entities extracted by the graph neural network by expanding the first knowledge graph, and thus help to improve the accuracy of the determined target entity relationships.
[0062] According to embodiments of this disclosure, a first embedding feature for each entity in the first knowledge graph and a second embedding feature for each entity relation in the first knowledge graph can be determined based on the context information of each triple constituting the first knowledge graph. This improves the expressive power of the embedding features and facilitates improved accuracy of subsequently determined entity relations.
[0063] This embodiment can determine the context information of each triple based on the positions of the two entities in each triple in the knowledge graph.
[0064] For example, other entities connected to the head entity h and other entities connected to the tail entity t in the knowledge graph can be used as context information for triples.
[0065] For example, a first entity connected to the head entity h can be determined as the center point. Then, multiple second entities connected to the first entity in directions away from h can be determined as the center point. All entities and entity relationships within the area enclosed by the multiple second entities are used as the context information of each triple. It can be understood that each process of determining connected entities with an entity as the center point is a knowledge propagation process. In this embodiment, the entities and entity relationships obtained through m knowledge propagation processes with the head entity h as the center point can be used as the context information of the triple to which the head entity h belongs. Here, m can be any positive integer set according to actual needs. During the knowledge propagation process, for example, propagation can only be carried out along the pointing direction of the connecting edges; this disclosure does not limit this.
[0066] In one embodiment, the initial embedding features of each entity and each entity relation in the knowledge graph can be obtained first using the TransE algorithm described above. Then, the weighted feature of the initial embedding features of the other entities connected to the head entity h and the initial embedding feature of the head entity h can be used as the first embedding feature of the head entity h. Similarly, the first embedding feature of the tail entity t can be obtained. The second embedding feature of the entity relation can be obtained using the initial embedding features obtained by the TransE algorithm.
[0067] In one embodiment, after obtaining the context information of each triple, the probability of each triple being true can be determined based on this context information. Then, based on the probability of being true, an objective function associated with the probability of being true is maximized to obtain the first embedding feature of each entity and the second embedding feature of each entity relationship.
[0068] For example, if the context information of a triple (h, r, t) is set as C(h, r, t), then the following fractional function (i.e., formula (1)) can be used to represent the probability of the triple being true. This fractional function is the conditional probability of the embedding representation of all elements in the knowledge graph given the context information.
[0069] f(h, r, t)=P((h, r, t)|C(h, r, t); θ). Formula (1)
[0070] Where f(h, r, t) is the probability of success, and θ is the model parameter, which is a vector of all entities and their relationships.
[0071] After obtaining the probability of each triplet being true, this embodiment can obtain the embedding features of each entity and the embedding features of each entity relation by maximizing the following objective function (i.e., formula (2)):
[0072] P(K|θ)=Π (h,r,t)∈K f(h, r, t). Formula (2)
[0073] Where P(K|θ) is the objective function, and K is the set of triples in the first knowledge graph.
[0074] It is understood that the above-mentioned probability of success and objective function are merely examples to facilitate understanding of this disclosure, and this disclosure does not limit them.
[0075] Figure 5 This is a schematic diagram illustrating the principle of determining the context information of each triple according to an embodiment of the present disclosure.
[0076] According to embodiments of this disclosure, when determining the context information of each triple, the target neighbor entities of the head entity in the first knowledge graph can be determined first for the head entity in each triple. Simultaneously, for the two entities in each triple, the set of paths connecting the two entities in the first knowledge graph is determined. Finally, based on the target neighbor entities and the set of paths, a predetermined embedding algorithm is used to obtain the context information of each triple. The predetermined embedding algorithm can be the TransE algorithm described above, etc.
[0077] In the first knowledge graph, for at least one edge connecting a node representing a head entity, the node pointed to by the edge emanating from that head entity is a target node, and the entity represented by that target node is the target neighbor entity of the head entity. Furthermore, in the set of paths connecting two entities, each path may include one or more entity relationships that can link the two entities.
[0078] According to embodiments of this disclosure, such as Figure 5 As shown, in this embodiment 500, the first knowledge graph is set to have 11 entities, namely entities 501 to 511, and the first knowledge graph has 14 entity relations, namely entity relation r1 to entity relation r2. 14 Among these, there can be multiple identical entity relationships among the 14 entity relationships.
[0079] For the triple {entity 504, r3, entity 501} with entity 504 as the head entity and entity 501 as the tail entity, the determined target neighbor entities can include entities 501 and 509. To avoid an excessive number of path sets, a threshold can be set for the number of entity relationships linking two entities, for example, the threshold can be L. Setting L to 3, then for the triple {entity 504, r3, entity 501}, the determined path set can include path r3 and path r7-r8-r4.
[0080] For example, the target neighbor entity Cn(e) of entity h can be represented by the following formula (3):
[0081]
[0082] For example, the set of paths connecting the head entity h and the tail entity t can be represented by the following formula (4):
[0083]
[0084] Among them, C p (h, t) is the path set, G is the first knowledge graph, and p i A sequence of entity relations. This represents the entity associated with each path in the path set. For example, for the path r7-r8-r4 described above, the associated entities include entity 505 and entity 506.
[0085] After obtaining the target neighbor entities and the path set, the union of the triples, the target neighbor entities, and the path set can be determined. Subsequently, this embodiment can employ a predetermined embedding algorithm to obtain the embedding features of each entity and each edge in the union. The union represented by the embedding features is used as the context information of the triples.
[0086] Based on the method for predicting entity relationships provided in this disclosure, this disclosure also provides a training method for a relationship prediction model, which will be combined with the following... Figure 6 The method is described in detail.
[0087] Figure 6 This is a flowchart illustrating a training method for a relationship prediction model according to an embodiment of the present disclosure.
[0088] like Figure 6 As shown, the training method 600 of the relationship prediction model in this embodiment may include operations S610 to S640.
[0089] In operation S610, the third embedding feature of each entity in the second knowledge graph and the fourth embedding feature of each entity relation in the second knowledge graph are determined.
[0090] According to embodiments of this disclosure, the second knowledge graph can be the same knowledge graph as the first knowledge graph described above, or it can be any knowledge graph including the target entity relationships described above. The implementation of operation S610 is similar to that of operation S210 described above, and will not be repeated here.
[0091] In operation S620, based on multiple entities in the second knowledge graph and the entity relationships between entities, sample data is determined for a relationship prediction model including a graph neural network.
[0092] The sample data includes the third embedding features of two entities in the second knowledge graph and the actual entity relationship between the two entities.
[0093] According to embodiments of this disclosure, two entities with the predicted entity relationship can be found from a second knowledge graph, based on the entity relationship to be predicted. Then, two third embedding features of these two entities and the predicted entity relationship are used to construct a first sample data set. This first sample data set is a positive sample.
[0094] In one embodiment, two entities that do not have the predicted entity relationship can be found in the second knowledge graph. The two third embedding features of these two entities are used to construct a second sample data set, where the actual entity relationship is empty. This second sample data set is a negative sample. Alternatively, two entities that have entity relationships other than the predicted entity relationship can be found in the second knowledge graph. The two third embedding features of these two entities and other entity relationships are used to construct a third sample data set, which is also a negative sample.
[0095] By simultaneously setting positive and negative samples, the learning ability of the relationship prediction model can be improved.
[0096] In operation S630, based on sample data and a second knowledge graph, a relationship prediction model including graph neural networks is used to determine the predicted entity relationship between two entities.
[0097] According to an embodiment of this disclosure, operation S630 may specifically involve determining the predicted entity relationship between two entities using a relationship prediction model including a graph neural network, based on two third embedded features and a second knowledge graph in the sample data. This operation S630 is similar to the method for determining the entity relationship between two target entities described above, and will not be repeated here. The determined entity relationship between the two entities in the sample data is the predicted entity relationship.
[0098] In operation S640, a relationship prediction model, including a graph neural network, is trained based on the predicted entity relationships and the actual entity relationships.
[0099] According to embodiments of this disclosure, the loss of a relationship prediction model can be determined based on the predicted entity relationships and the actual entity relationships. The relationship prediction model is trained by minimizing the loss. The loss of the relationship prediction model can be represented, for example, using a cross-entropy loss function.
[0100] For example, the cross-entropy loss function can be expressed by the following formula (5):
[0101]
[0102] Where, f(S) i f(S) represents the probability of having an entity relationship, obtained by the relationship prediction model based on positive samples in the sample data. j ) represents the probability of an entity relationship obtained by the relationship prediction model based on negative samples in the sample data. Where, Around(S) i ) is the set of negative samples.
[0103] Based on the method for predicting entity relationships provided in this disclosure, this disclosure also provides an apparatus for predicting entity relationships. The following will be combined with... Figure 7 The device is described in detail.
[0104] Figure 7 This is a structural block diagram of an apparatus for predicting entity relationships according to embodiments of the present disclosure.
[0105] like Figure 7 As shown, the apparatus 700 for predicting entity relationships in this embodiment may include a first feature determination module 710 and a first relationship determination module 720.
[0106] The first feature determination module 710 is used to determine the first embedding feature of each entity in the first knowledge graph and the second embedding feature of each entity relationship in the first knowledge graph. In one embodiment, the first feature determination module 710 can be used to perform the operation S210 described above, which will not be repeated here.
[0107] The first relationship determination module 720 is used to determine the entity relationship between two target entities that do not have an entity relationship in the first knowledge graph based on the first embedded features, the second embedded features, and the first knowledge graph, using a relationship prediction model including a graph neural network. In one embodiment, the first relationship determination module 720 can be used to perform the operation S220 described above, which will not be repeated here.
[0108] According to embodiments of this disclosure, the first relationship determination module 720 may include a target feature determination submodule, a target entity determination submodule, and a relationship determination submodule. The target feature determination submodule is used to determine the embedding features of the target entity relationship in the second embedding features, as the target embedding features. The target entity determination submodule is used to determine at least one target entity pair in the first knowledge graph based on the first embedding features and the target embedding features, wherein each target entity pair in the at least one target entity pair includes two target entities that do not have an entity relationship in the first knowledge graph. The relationship determination submodule is used to determine, based on the at least one target entity pair and the first knowledge graph, whether each target entity pair in the at least one pair of target entities has a target entity relationship using a relationship prediction model.
[0109] According to embodiments of this disclosure, the relationship determination submodule may include a graph expansion unit and a relationship determination unit. The graph expansion unit is used to expand a first knowledge graph based on at least one target entity pair to obtain an expanded knowledge graph. The relationship determination unit is used to determine whether each target entity pair has a target entity relationship based on the first embedding features of the two target entities included in each target entity pair and the expanded knowledge graph.
[0110] According to embodiments of this disclosure, the first feature determination module 710 can be specifically used to determine the first embedding feature of each entity in the first knowledge graph and the second embedding feature of each entity relationship in the first knowledge graph based on the context information of each triple constituting the first knowledge graph in the first knowledge graph.
[0111] According to embodiments of this disclosure, the apparatus 700 for predicting entity relationships may further include a neighbor entity determination module, a path set determination module, and an information determination module. The neighbor entity determination module is used to determine, for each head entity in a triplet, the target neighbor entities of the head entity in the first knowledge graph. The path set determination module is used to determine, for each pair of entities in a triplet, the path set determination module is used to determine, for each pair of entities in a triplet, the path set determination module is used to determine, for each pair of entities in a first knowledge graph ...
[0112] According to embodiments of this disclosure, the first feature determination module 710 may include a probability determination submodule and a feature determination submodule. The probability determination submodule is used to determine the probability of each triplet's validity based on the context information of each triplet. The feature determination submodule is used to maximize an objective function associated with the validity probability, based on the validity probability, to obtain a first embedded feature for each entity and a second embedded feature for each entity relationship.
[0113] Based on the training method for the relationship prediction model provided in this disclosure, this disclosure also provides a training apparatus for the relationship prediction model. The following will combine... Figure 8 The device is described in detail.
[0114] Figure 8 This is a structural block diagram of a training apparatus for a relation prediction model according to an embodiment of the present disclosure.
[0115] like Figure 8 As shown, the training device 800 for the relationship prediction model in this embodiment may include a second feature determination module 810, a sample data determination module 820, a second relationship determination module 830, and a model training module 840.
[0116] The second feature determination module 810 is used to determine the third embedding feature of each entity in the second knowledge graph and the fourth embedding feature of each entity relationship in the second knowledge graph. In one embodiment, the second feature determination module 810 can be used to perform the operation S610 described above, which will not be repeated here.
[0117] The sample data determination module 820 is used to determine sample data for a relationship prediction model, including a graph neural network, based on multiple entities in the second knowledge graph and the entity relationships between them. This sample data includes the third embedding features of two entities in the second knowledge graph and the actual entity relationship between the two entities. In one embodiment, the sample data determination module 820 may, for example, be used to perform the operation S620 described above, which will not be repeated here.
[0118] The second relationship determination module 830 is used to determine the predicted entity relationship between two entities based on sample data and a second knowledge graph, using a relationship prediction model including a graph neural network. In one embodiment, the second relationship determination module 830 can be used to perform the operation S630 described above, which will not be repeated here.
[0119] The model training module 840 can be used to train a relationship prediction model, including a graph neural network, based on predicted entity relationships and actual entity relationships. In one embodiment, the model training module 840 can be used to perform the operation S640 described above, which will not be repeated here.
[0120] It should be noted that the acquisition, collection, storage, use, processing, transmission, provision and disclosure of user personal information involved in the technical solution disclosed herein all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0121] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0122] Figure 9 A schematic block diagram of an example electronic device 900 is shown, which can be used to implement methods for predicting entity relationships and / or training methods for relationship prediction models according to embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0123] like Figure 9 As shown, device 900 includes a computing unit 901, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 902 or a computer program loaded from storage unit 908 into random access memory (RAM) 903. RAM 903 may also store various programs and data required for the operation of device 900. The computing unit 901, ROM 902, and RAM 903 are interconnected via bus 904. Input / output (I / O) interface 905 is also connected to bus 904.
[0124] Multiple components in device 900 are connected to I / O interface 905, including: input unit 906, such as keyboard, mouse, etc.; output unit 907, such as various types of monitors, speakers, etc.; storage unit 908, such as disk, optical disk, etc.; and communication unit 909, such as network card, modem, wireless transceiver, etc. Communication unit 909 allows device 900 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0125] The computing unit 901 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 901 performs the various methods and processes described above, such as methods for predicting entity relationships and / or methods for training relationship prediction models. For example, in some embodiments, the methods for predicting entity relationships and / or methods for training relationship prediction models can be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program can be loaded and / or installed on device 900 via ROM 902 and / or communication unit 909. When the computer program is loaded into RAM 903 and executed by the computing unit 901, one or more steps of the methods for predicting entity relationships and / or methods for training relationship prediction models described above can be performed. Alternatively, in other embodiments, the computing unit 901 may be configured by any other suitable means (e.g., by means of firmware) to perform a method for predicting entity relationships and / or a method for training a relationship prediction model.
[0126] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0127] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0128] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0129] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0130] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0131] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is established by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service system, addressing the shortcomings of traditional physical hosts and VPS (Virtual Private Server, or simply "VPS") services, such as high management difficulty and weak business scalability. Servers can also be servers for distributed systems or servers incorporating blockchain technology.
[0132] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0133] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for predicting entity relationships, applied to the field of drug repositioning, comprising: determining first embedding features of each entity in a first knowledge graph and second embedding features of each entity relationship in the first knowledge graph, wherein the first knowledge graph comprises drug entities and disease entities, and an entity relationship between the drug entities and the disease entities represents a treatment relationship; and determining, based on the first embedding features, the second embedding features, and structure information of the first knowledge graph, an entity relationship between two target entities without an entity relationship in the first knowledge graph by using a relationship prediction model comprising a graph neural network, wherein the two target entities without an entity relationship represent drug entities and disease entities without a treatment relationship, and the relationship prediction model is used to mine whether the drug entities and the disease entities without a treatment relationship in the first knowledge graph have a potential treatment relationship; wherein two entities with an entity relationship in the first knowledge graph and the entity relationship between the two entities form a triple, two entities in the triple are a head entity and a tail entity, and the entity relationship is pointed from the head entity to the tail entity; the determining first embedding features of each entity in a first knowledge graph and second embedding features of each entity relationship in the first knowledge graph comprises: taking other entities connected with the head entity and other entities connected with the tail entity in the first knowledge graph as context information of a triple; determining a probability of existence of each triple based on the context information of the triple; and maximizing a target function associated with the probability of existence based on the probability of existence to obtain the first embedding features of each entity and the second embedding features of each entity relationship; wherein the determining an entity relationship between two target entities without an entity relationship in the first knowledge graph by using a relationship prediction model comprising a graph neural network comprises: determining an embedding feature of a target entity relationship in the second embedding features as a target embedding feature; determining at least one target entity pair in the first knowledge graph based on the first embedding features and the target embedding feature, wherein each target entity pair in the at least one target entity pair comprises two target entities without an entity relationship in the first knowledge graph; and determining, based on the at least one target entity pair and the first knowledge graph, whether each target entity pair in the at least one target entity pair has the target entity relationship by using the relationship prediction model; the determining whether each target entity pair in the at least one target entity pair has the target entity relationship by using the relationship prediction model comprises: expanding the first knowledge graph based on the at least one target entity pair to obtain an expanded knowledge graph; and determining whether each target entity pair has the target entity relationship based on the first embedding features of two target entities included in the target entity pair and the expanded knowledge graph; the taking other entities connected with the head entity and other entities connected with the tail entity in the first knowledge graph as context information of a triple comprises: 2. The method of claim 1, wherein, 3. The method of claim 1, wherein, determining, for each of the head entities in the triplets, a target neighbor entity of the head entity in the first knowledge graph; determining, for each of the two entities in the triplets, a set of paths connecting the two entities in the first knowledge graph; and obtaining, based on the target neighbor entity and the set of paths, context information of each of the triplets by using a predetermined embedding algorithm.
4. A training method of a relation prediction model, applied to a drug repositioning field, comprising: determining third embedding features of each entity in a second knowledge graph and fourth embedding features of each entity relation in the second knowledge graph, wherein the second knowledge graph comprises drug entities and disease entities, and an entity relation between the drug entities and the disease entities represents a treatment relation; determining, based on a plurality of entities and entity relations between the entities in the second knowledge graph, sample data for a relation prediction model comprising a graph neural network, the sample data comprising third embedding features of two entities in the second knowledge graph and an actual entity relation between the two entities, wherein the actual entity relation between the two entities represents whether there is actually a treatment relation between the drug entities and the disease entities; determining, based on the sample data and structure information of the second knowledge graph, a predicted entity relation between the two entities by using the relation prediction model comprising the graph neural network, the predicted entity relation representing whether there is a treatment relation between the drug entities and the disease entities by the relation prediction model; and training the relation prediction model comprising the graph neural network based on the predicted entity relation and the actual entity relation; wherein two entities with an entity relation in the second knowledge graph and the entity relation between the two entities form a triplet, two entities in the triplet are a head entity and a tail entity, and the entity relation is pointed from the head entity to the tail entity; the determining of the third embedding features of each entity in the second knowledge graph and the fourth embedding features of each entity relation in the second knowledge graph comprises: taking other entities connected to the head entity and other entities connected to the tail entity in the second knowledge graph as context information of the triplet; determining a probability of establishment of each of the triplets based on the context information of each of the triplets; and maximizing a target function associated with the probability of establishment based on the probability of establishment to obtain the third embedding features of each entity and the fourth embedding features of each entity relation; the determining of the predicted entity relation between the two entities by using the relation prediction model comprising the graph neural network comprises: determining an embedding feature of a target entity relation in the fourth embedding features as a target embedding feature; determining at least one target entity pair in the second knowledge graph based on the third embedding features and the target embedding feature, wherein each of the at least one target entity pair comprises two target entities without an entity relation in the second knowledge graph; and Based on the at least one target entity pair and the second knowledge graph, it is determined by using the relationship prediction model whether each target entity pair in the at least one target entity pair has the target entity relationship.
5. A device for predicting entity relationships, applied to the field of drug repositioning, comprising: a first feature determination module configured to determine first embedding features of each entity in a first knowledge graph and second embedding features of each entity relationship in the first knowledge graph, wherein the first knowledge graph comprises drug entities and disease entities, and an entity relationship between the drug entities and the disease entities represents a treatment relationship; and a first relationship determination module configured to determine, based on the first embedding features, the second embedding features, and structure information of the first knowledge graph, an entity relationship between two target entities without an entity relationship in the first knowledge graph by using a relationship prediction model comprising a graph neural network, wherein the two target entities without an entity relationship represent drug entities and disease entities without a treatment relationship, and the relationship prediction model is used to mine whether the drug entities and the disease entities without a treatment relationship in the first knowledge graph have a potential treatment relationship; wherein two entities with an entity relationship in the first knowledge graph and the entity relationship between the two entities form a triple, two entities in the triple are a head entity and a tail entity, and an entity relationship is pointed from the head entity to the tail entity; the first feature determination module comprises: a context information determination sub-module configured to take other entities connected to the head entity and other entities connected to the tail entity in the first knowledge graph as context information of a triple; a probability determination sub-module configured to determine a probability of being true of each triple based on the context information of the triple; and a feature determination sub-module configured to maximize a target function associated with the probability of being true based on the probability of being true to obtain the first embedding features of each entity and the second embedding features of each entity relationship; wherein the first relationship determination module comprises: a target feature determination sub-module configured to determine an embedding feature of a target entity relationship in the second embedding features as a target embedding feature; a target entity determination sub-module configured to determine at least one target entity pair in the first knowledge graph based on the first embedding features and the target embedding feature, wherein each target entity pair in the at least one target entity pair comprises two target entities without an entity relationship in the first knowledge graph; and a relationship determination sub-module configured to determine, based on the at least one target entity pair and the first knowledge graph, whether each target entity pair in the at least one target entity pair has the target entity relationship by using the relationship prediction model.
6. The apparatus of claim 5, wherein, the relationship determination sub-module comprises: a graph expansion unit configured to expand the first knowledge graph based on the at least one target entity pair to obtain an expanded knowledge graph; and a relationship prediction unit configured to determine, based on the expanded knowledge graph, whether each target entity pair in the at least one target entity pair has the target entity relationship by using the relationship prediction model. The relationship determining unit is configured to determine whether each target entity pair has the target entity relationship based on the first embedding features of the two target entities included in the each target entity pair and the extended knowledge graph.
7. The apparatus of claim 5, wherein, The context information determining sub-module comprises: The neighbor entity determining unit is configured to determine, for the head entity in the each triple, a target neighbor entity of the head entity in the first knowledge graph; The path set determining unit is configured to determine, for the two entities in the each triple, a path set connecting the two entities in the first knowledge graph; and The information determining unit is configured to obtain the context information of the each triple based on the target neighbor entity and the path set by using a predetermined embedding algorithm.
8. A training device of a relationship prediction model, applied to the field of drug repositioning, comprising: A second feature determining module is configured to determine third embedding features of each entity in a second knowledge graph and fourth embedding features of each entity relationship in the second knowledge graph, wherein the second knowledge graph comprises drug entities and disease entities, and the entity relationship between the drug entities and the disease entities represents a treatment relationship; A sample data determining module is configured to determine sample data for a relationship prediction model comprising a graph neural network based on a plurality of entities and entity relationships between the entities in the second knowledge graph, the sample data comprising third embedding features of two entities in the second knowledge graph and an actual entity relationship between the two entities, wherein the actual entity relationship between the two entities represents whether the drug entities and the disease entities actually have a treatment relationship; A second relationship determining module is configured to determine a predicted entity relationship between the two entities by using the relationship prediction model comprising the graph neural network based on the sample data and structure information of the second knowledge graph, the predicted entity relationship representing whether the drug entities and the disease entities have a treatment relationship obtained by the relationship prediction model; and A model training module is configured to train the relationship prediction model comprising the graph neural network based on the predicted entity relationship and the actual entity relationship. Wherein, the two entities having an entity relationship in the second knowledge graph and the entity relationship between the two entities constitute a triple, the two entities in the triple are a head entity and a tail entity, and the entity relationship is pointed from the head entity to the tail entity. The second feature determining module is configured to: take other entities connected with the head entity and other entities connected with the tail entity in the second knowledge graph as context information of a triple; determine a probability of establishment of the each triple based on the context information of the each triple; and maximize a target function associated with the probability of establishment to obtain the third embedding features of the each entity and the fourth embedding features of the each entity relationship based on the probability of establishment. The second relationship determining module is further configured to determine an embedding feature of a target entity relationship in the fourth embedding feature as a target embedding feature; determine at least one target entity pair in the second knowledge graph based on the third embedding feature and the target embedding feature, wherein each target entity pair in the at least one target entity pair includes two target entities without an entity relationship in the second knowledge graph; and determine whether each target entity pair in the at least one target entity pair has the target entity relationship based on the at least one target entity pair and the second knowledge graph by using the relationship prediction model. 9.An electronic device, comprising: at least one processor; and a memory connected with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-4.
10. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to perform the method of any one of claims 1-4. 11.A computer program product comprising a computer program which, when executed by a processor, implements the method of any one of claims 1-4.
Citation Information
Patent Citations
Entity linking method and device for Internet service and storage medium
CN112463914A
Entity relation path reasoning method and system for regulation and control knowledge graph
CN113128689A