Knowledge graph embedding vector determination method and apparatus, electronic device, and storage medium

By using graph convolutional neural networks and relation-enhanced knowledge graphs, the embedding vectors of attributes and entity nodes are updated, solving the accuracy problem of knowledge graph embedding representation and achieving higher accuracy and enhanced sparsity.

CN116501890BActive Publication Date: 2026-01-02HARBIN INST OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310486585.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-28
Publication Date
2026-01-02
Estimated Expiration
2043-04-28

AI Technical Summary

Technical Problem

Existing knowledge graph embedding methods suffer from low accuracy due to the sparsity of the graph structure.

Method used

A graph convolutional neural network is used to determine the embedding vectors of attribute nodes and entity nodes. The embedding vectors of attribute and entity nodes are updated through the knowledge graph with enhanced relationships. The target embedding vector is determined by using preset relationship factors and combination functions.

Benefits of technology

It improves the accuracy of knowledge graph embedding representation, enabling a more accurate grasp of the connection relationships between attributes and entity nodes, enhancing the sparsity of the knowledge graph, and improving the accuracy of determining the target embedding vector.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116501890B_ABST
    Figure CN116501890B_ABST
Patent Text Reader

Abstract

The application provides a knowledge graph embedding vector determination method and device, electronic equipment and a storage medium, and relates to the technical field of knowledge graphs. The method comprises the following steps: determining attribute embedding vectors and attribute node relationship embedding vectors of attribute nodes in a first attribute node knowledge graph according to a graph convolutional neural network, and determining entity embedding vectors and entity node relationship embedding vectors of entity nodes in a first entity node knowledge graph; determining first embedding vectors of each attribute node according to the attribute node relationship embedding vectors; determining the first entity node relationship embedding vectors according to a preset relationship factor; determining a second entity node knowledge graph according to the first embedding vectors and the first entity node relationship embedding vectors; determining second embedding vectors of each entity node according to the first entity node relationship embedding vectors in the second entity node knowledge graph; and determining target embedding vectors of each entity node according to the second embedding vectors and the second entity node relationship embedding vectors.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of knowledge graph, in particular to a knowledge graph embedding vector determination method and device, electronic equipment and storage medium. BACKGROUND

[0002] As a special graph structure, knowledge graph takes entities as nodes and relations as directed edges. In a knowledge graph, each edge is represented as a triple (u, r, v) with the form of (head entity, relation, tail entity) to indicate that two entities u (i.e., head entity) and v (i.e., tail entity) are connected by relation r. In the past few decades, many large-scale knowledge graphs have been built, such as WordNet, Freebase, DBpedia, and YAGO. They have improved various downstream applications, such as structured search, question answering, and entity recommendation, etc.

[0003] Knowledge graph embedding (KGE) is a method of learning embedding representation of entities and relations in a knowledge base, which is the basis of research for many applications such as semantic retrieval, knowledge question answering, and recommendation.

[0004] However, in the existing knowledge graph embedding models, such as TransE, ComplEx and PTransE, the models mainly utilize semantic information to study the connection between nodes and relations in a single triple, while the models such as ChainR and RSN utilize more structural information. However, the existing knowledge graph embedding representation is limited by the sparsity of the structure of the graph, resulting in the problem of low accuracy of the existing knowledge graph embedding representation method. SUMMARY

[0005] To solve the above problems, the present application provides a knowledge graph embedding vector determination method, device, electronic equipment and storage medium.

[0006] According to the first aspect of the present application, a knowledge graph embedding vector determination method is provided, comprising:

[0007] According to the graph convolutional neural network, the attribute embedding vector and the attribute node relation embedding vector of the attribute node in the first attribute node knowledge graph are determined, and the entity embedding vector and the entity node relation embedding vector of the entity node in the first entity node knowledge graph are determined, wherein the entity node includes the attribute node and a non-attribute node, the attribute node is a subset of the entity node, the first attribute node knowledge graph is a subset of the first entity node knowledge graph, and the first attribute node knowledge graph and the first entity node knowledge graph are enhanced by relation.

[0008] updating the attribute embedding vectors of the attribute nodes according to the attribute node relationship embedding vectors, to determine first embedding vectors of each of the attribute nodes;

[0009] updating the entity node relationship embedding vectors of the first entity node knowledge graph according to a preset relationship factor, to determine first entity node relationship embedding vectors;

[0010] updating the first entity node knowledge graph according to the first embedding vectors and the first entity node relationship embedding vectors, to determine a second entity node knowledge graph;

[0011] updating the entity embedding vectors of the entity nodes according to the first entity node relationship embedding vectors in the second entity node knowledge graph, to determine second embedding vectors of each of the entity nodes;

[0012] determining target embedding vectors of each of the entity nodes according to the second embedding vectors and second entity node relationship embedding vectors, wherein the second entity node relationship embedding vectors are determined according to the preset relationship factor and the first entity node relationship embedding vectors.

[0013] Optionally, the updating the attribute embedding vectors of the attribute nodes according to the attribute node relationship embedding vectors, to determine first embedding vectors of each of the attribute nodes, comprises:

[0014] obtaining a set of adjacent attribute nodes corresponding to a to-be-updated attribute node according to the first attribute node knowledge graph;

[0015] determining a set of adjacent attribute relationships according to the set of adjacent attribute nodes;

[0016] determining the first embedding vectors of the to-be-updated attribute node according to the embedding vectors of each of the adjacent attribute nodes in the set of adjacent attribute nodes, the embedding vectors of each of the adjacent attribute relationships in the set of adjacent attribute relationships, a first embedding factor and a preset combination function.

[0017] Optionally, the determining the first embedding vectors of the to-be-updated attribute node according to the embedding vectors of each of the adjacent attribute nodes in the set of adjacent attribute nodes, the embedding vectors of each of the adjacent attribute relationships in the set of adjacent attribute relationships, a first embedding factor and a preset combination function, comprises:

[0018] determining the first embedding vectors according to a first formula, wherein the first formula comprises:

[0019]

[0020] wherein, h u denotes the first embedding vector of the attribute node to be updated, N attr (u) denotes the set of adjacent attribute relations corresponding to the attribute node u to be updated, v denotes the adjacent attribute node of the attribute node to be updated, r denotes the adjacent attribute connection relation between the attribute node to be updated and the adjacent attribute node, W attr(r) denotes the first preset embedding factor, φ denotes the combination function, h v denotes the embedding vector of the adjacent attribute node, h r denotes the relation embedding vector of the adjacent attribute node.

[0021] Optionally, the determining of the second embedding vector of each entity node according to the first entity node relation embedding vector in the second entity node knowledge graph comprises:

[0022] According to the first entity node knowledge graph, a set of adjacent entity nodes corresponding to the entity node to be updated is obtained;

[0023] According to the set of adjacent entity nodes, a set of adjacent entity relations is determined;

[0024] According to the embedding vector of each adjacent entity node in the set of adjacent entity nodes, the relation embedding vector of each adjacent entity relation in the set of adjacent entity relations, a second preset embedding factor and a preset combination function, the second embedding vector of the entity node to be updated is determined.

[0025] Optionally, the determining of the second embedding vector of the entity node to be updated according to the embedding vector of each adjacent entity node in the set of adjacent entity nodes, the relation embedding vector of each adjacent entity relation in the set of adjacent entity relations, a second preset embedding factor and a preset combination function comprises:

[0026] The second embedding vector is determined according to a second formula, and the second formula comprises:

[0027]

[0028] wherein, h u' denotes the first embedding vector of the entity node to be updated, N attr (u') denotes the set of adjacent attribute relations corresponding to the entity node u' to be updated, v' denotes the adjacent entity node of the entity node to be updated, r' denotes the adjacent entity connection relation between the entity node to be updated and the adjacent entity node, W (r) denotes the second preset embedding factor, φ denotes the combination function, h v' denotes the embedding vector of the adjacent entity node, h r'representing an adjacency entity node relationship embedding vector.

[0029] Optionally, further comprising:

[0030] obtaining an initial attribute node knowledge graph and an initial entity node knowledge graph;

[0031] enhancing the initial attribute node knowledge graph and the initial entity node knowledge graph according to a preset relationship enhancement strategy, to determine the first attribute node knowledge graph and the first entity node knowledge graph, wherein the preset relationship enhancement strategy comprises at least one of the following: introducing a reverse edge for each edge of the initial attribute node knowledge graph and the initial entity node knowledge graph, and adding a self-loop relationship to the initial attribute node knowledge graph and the initial entity node knowledge graph.

[0032] Optionally, further comprising:

[0033] determining a probability distribution score corresponding to the target embedding vector based on an activation function layer and a Sigmoid layer;

[0034] determining a loss value according to the probability distribution score, wherein the loss value is used to update a preset relationship factor.

[0035] According to a second aspect of the present application, a knowledge graph embedding vector determination device is provided, comprising:

[0036] an acquisition module configured to acquire an attribute node knowledge graph and an entity node knowledge graph after relationship enhancement, wherein an entity node comprises an attribute node and a non-attribute node, the attribute node is a subset of the entity node, and the attribute node knowledge graph is a subset of the entity node knowledge graph;

[0037] a first determination module configured to determine a first embedding vector of each attribute node according to an attribute node relationship embedding vector of the attribute node knowledge graph;

[0038] a first update module configured to update an entity node relationship embedding vector of the first entity node knowledge graph according to a preset relationship factor, to determine a first entity node relationship embedding vector;

[0039] a second update module configured to update the entity node knowledge graph according to the first embedding vector and the first entity node relationship embedding vector, to determine a second entity node knowledge graph;

[0040] a second determination module configured to determine a second embedding vector of each entity node according to the first entity node relationship embedding vector in the second entity node knowledge graph;

[0041] A third determining module is configured to determine a target embedding vector of each entity node according to the second embedding vector and a second entity node relation embedding vector, wherein the second entity node relation embedding vector is determined according to the preset relation factor and the first entity node relation embedding vector.

[0042] According to a third aspect of the present application, an electronic device is provided, which comprises a memory and a processor, the memory is configured to store computer instructions executable on the processor, and the processor is configured to implement the knowledge graph embedding vector determination method according to the first aspect when executing the computer instructions.

[0043] According to a fourth aspect of the present application, a computer readable storage medium is provided, which stores a computer program, and the program is executed by a processor to implement the knowledge graph embedding vector determination method according to the first aspect.

[0044] The technical solution provided by the present application can include the following beneficial effects:

[0045] The knowledge graph embedding vector determination method provided by the present application can determine the attribute embedding vector and the attribute node relation embedding vector of the attribute node in the first attribute node knowledge graph, and determine the entity embedding vector and the entity node relation embedding vector of the entity node in the first entity node knowledge graph, by using the graph convolutional neural network, so that the first embedding vector of each attribute node can be accurately mastered after the sparsity of the knowledge graph is enhanced, thereby realizing the convergence of attribute knowledge. Further, the entity node relation embedding vector of the entity node in the entity node knowledge graph can be updated by using the preset relation factor, so that the connection relationship between each entity node in the entity node knowledge graph can be accurately mastered. Further, the second embedding vector of each entity node can be determined according to the first entity node relation embedding vector in the entity node knowledge graph. Finally, the target embedding vector of each entity node can be determined by using the second embedding vector and the second entity node relation embedding vector, so that the target embedding vector of the entity node converged with attribute knowledge can circulate within the scope of the entity node knowledge graph, thereby the target embedding vector can be accurately determined by accurately using the attribute information of the entity, and the accuracy of determining the target embedding vector of the entity node is improved. BRIEF DESCRIPTION OF DRAWINGS

[0046] Figure 1 A knowledge graph embedding vector determination method flowchart is provided for an embodiment of the present application;

[0047] Figure 2 A mainstream value knowledge graph construction flowchart is provided for another embodiment of the present application;

[0048] Figure 3 A knowledge graph embedding vector determination method flowchart is provided for another embodiment of the present application;

[0049] Figure 4 A knowledge graph embedding vector determination device schematic diagram is provided for another embodiment of the application. DETAILED DESCRIPTION

[0050] The exemplary embodiments will be described in detail herein with reference to the attached drawings. The description of the exemplary embodiments is intended to apply to various alternative embodiments as well. It is to be understood that the description of any exemplary embodiment is intended only to be used to assist in understanding the inventive process. Accordingly, the inventive process is not limited to any specific embodiments described herein, which are undesirable. Rather, the inventive process is limited only by the scope of the claims.

[0051] The terminology used in the present application, and not specifically defined, is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. As used in this description and the appended claims, the singular forms "a," "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0052] It will be understood that, although the terms first, second, third, etc. can be used herein to describe various information, the information should not be limited to these terms. These terms are only used to distinguish one piece of information from another. For example, a first information can also be termed a second information, and, similarly, a second information can also be termed a first information, without departing from the scope of the present application. Depending on the context, the word "if' as used herein can be interpreted as meaning "when" or "in response to determining" or "in response to ascertaining."

[0053] In a first aspect, embodiments of the present application provide a knowledge graph embedding vector determination method, as shown in Figure 1 The method comprises:

[0054] S101, according to the graph convolutional neural network, determining the attribute embedding vector and the attribute node relationship embedding vector of the attribute node in the first attribute node knowledge graph, and determining the entity embedding vector and the entity node relationship embedding vector of the entity node in the first entity node knowledge graph.

[0055] In this embodiment, first, the first attribute node knowledge graph and the first entity node knowledge graph after relationship enhancement are obtained, and then the first attribute node knowledge graph and the first entity node knowledge graph are respectively input into a graph convolutional neural network (GCN) to output attribute embedding vectors of each attribute node in the first attribute node knowledge graph and attribute node relationship embedding vectors between different attribute nodes by using the graph convolutional neural network, and to determine entity embedding vectors of entity nodes in the first entity node knowledge graph by using the graph convolutional neural network.

[0056] In one example, the entity nodes in this embodiment include attribute nodes and non-attribute nodes, the attribute nodes are a subset of the entity nodes, that is, the attribute nodes are part of the entity nodes, the first attribute node knowledge graph is a subset of the first entity node knowledge graph, that is, the first attribute node knowledge graph is a subset of the first entity node graph, and the first attribute node knowledge graph and the first entity node knowledge graph are after relationship enhancement.

[0057] In one example, the initial attribute node knowledge graph and the initial entity node knowledge graph are subjected to relationship enhancement by using a preset relationship enhancement strategy in this embodiment to increase attribute node relationships in the initial attribute node knowledge graph and entity node relationships in the initial entity node knowledge graph, so as to determine the first attribute node knowledge graph and the first entity node knowledge graph. Specifically, the preset relationship enhancement strategy can include introducing a reverse edge for each edge of the initial attribute node knowledge graph and the initial entity node knowledge graph, and adding a self-loop relationship to the initial attribute node knowledge graph and the initial entity node knowledge graph, wherein the edge in the knowledge graph is used to represent the node relationship.

[0058] S102, updating the attribute embedding vector of the attribute node according to the attribute node relationship embedding vector to determine a first embedding vector of each attribute node.

[0059] In this embodiment, after the attribute embedding vector and the attribute node relationship embedding vector of each attribute node in the first attribute node knowledge graph are determined, the attribute embedding vector of each attribute node is updated by using the determined attribute node relationship embedding vector to determine the first embedding vector of each attribute node.

[0060] S103, updating the entity node relationship embedding vector of the first entity node knowledge graph according to a preset relationship factor to determine a first entity node relationship embedding vector.

[0061] In the embodiment, after the first entity node knowledge graph is determined, the preset relationship factor is used to update the entity node relationship embedding vector of the first entity node knowledge graph, so as to determine the first entity node relationship embedding vector, thereby accurately determining the entity node relationship between each entity node.

[0062] In one example, the third formula is used to determine the first entity node relationship embedding vector, and the third formula is specifically as follows:

[0063] h r' =W rel h r ;

[0064] Wherein, h r' is the first entity node relationship embedding vector, W rel is the preset relationship factor, and h r is the entity node relationship embedding vector of the first entity node knowledge graph.

[0065] S104, updating the first entity node knowledge graph according to the first embedding vector and the first entity node relationship embedding vector to determine a second entity node knowledge graph.

[0066] In the embodiment, after S102 and S103 are performed, after the first embedding vector of each attribute node and the first entity node relationship embedding vector are determined, the embedding vector of the attribute node in the first entity node knowledge graph is replaced by using the first embedding vector, and the entity node relationship embedding vector of the first entity node knowledge graph is replaced by using the first entity node relationship embedding vector, thereby determining the second entity node knowledge graph. That is, the embedding vector of the attribute node in the second entity node relationship graph is the first embedding vector, the embedding vector of the non-attribute node is the embedding vector of the non-attribute node in the first entity node knowledge graph, and the node relationship embedding vector between different entity nodes in the second entity node relationship graph is the first entity node relationship embedding vector.

[0067] S105, determining a second embedding vector of each entity node according to the first entity node relationship embedding vector in the second entity node knowledge graph.

[0068] In the embodiment, after step S104 is performed, the embedding vector of the entity node in the second entity node knowledge graph is updated by using the first entity node embedding vector in the second entity node knowledge graph, thereby determining the second embedding vector of each entity node in the second entity node knowledge graph.

[0069] S106, determining a target embedding vector of each entity node according to the second embedding vector and the second entity node relationship embedding vector.

[0070] In this embodiment, after S105 is performed, first, the second entity node relationship embedding vector in the second entity node knowledge graph is determined according to the preset relationship factor and the first entity node relationship embedding vector, and further, the target embedding vector of each entity node in the second entity node knowledge graph is determined by using the second embedding vector and the second entity node relationship embedding vector.

[0071] In one example, the second entity node relationship embedding vector in this embodiment is determined by a fourth formula, and the fourth formula is specifically as follows:

[0072] h r” =W rel h r' ;

[0073] Wherein, h r” is the second entity node relationship embedding vector.

[0074] In one example, the target embedding vector in this embodiment is determined by a fifth formula, and the fifth formula is specifically as follows:

[0075] X=φ(h u' ,h r” );

[0076] Wherein, X is the target embedding vector, φ is a combination function, and h u' is the second embedding vector.

[0077] In one example, the combination function in this embodiment can include three modes of addition, multiplication and cyclic correlation.

[0078] The knowledge graph embedding vector determination method provided by the embodiment of the application can accurately master the first embedding vector of each attribute node after enhancing the sparsity of the knowledge graph, thereby realizing the convergence of attribute knowledge. Further, the entity node relationship embedding vector of the entity node knowledge graph is updated by using the preset relationship factor, so that the connection relationship between each entity node in the entity node knowledge graph can be accurately mastered. Further, the second embedding vector of each entity node is determined according to the first entity node relationship embedding vector in the entity node knowledge graph. Finally, the target embedding vector of each entity node is determined by using the second embedding vector and the second entity node relationship embedding vector, so that the target embedding vector of the entity node converging attribute knowledge can circulate in the range of the entity node knowledge graph, thereby the target embedding vector can be accurately determined by accurately using the attribute information of the entity, and the accuracy of determining the target embedding vector of the entity node is improved.

[0079] Further, when S102 is performed, the following steps can be included:

[0080] S1021, acquiring, according to the first attribute node knowledge graph, a set of adjacent attribute nodes corresponding to the attribute node to be updated.

[0081] In this embodiment, when the first embedding vector is determined, the attribute node to be updated in the first attribute node knowledge graph is acquired first, that is, each attribute node is acquired in sequence, so that the adjacent attribute nodes connected with the attribute node to be updated are determined in sequence according to the position of the attribute node to be updated in the first attribute node knowledge graph, thereby the set of adjacent attribute nodes is determined.

[0082] S1022, determining, according to the set of adjacent attribute nodes, a set of adjacent attribute relationships;

[0083] In this embodiment, after the set of adjacent attribute nodes is determined, the adjacent attribute node relationship vector between each adjacent attribute node and the attribute node to be updated is counted, so that the set of adjacent attribute relationships is determined.

[0084] S1023, determining, according to the adjacent attribute node embedding vector of each adjacent attribute node in the set of adjacent attribute nodes, the adjacent attribute node relationship embedding vector of each adjacent relationship in the set of adjacent attribute relationships, the first embedding factor and a preset combination function, the first embedding vector of the attribute node to be updated.

[0085] In this embodiment, after determining the attribute node to be updated and the set of adjacent attribute relationships, the first embedding vector of the attribute node to be updated is determined according to the adjacent attribute node embedding vector of each adjacent attribute node in the set of adjacent attribute nodes, the adjacent attribute node relationship embedding vector of each adjacent relationship in the set of adjacent attribute relationships, the first embedding factor and the preset combination function.

[0086] In one example, the first embedding vector is determined by the first formula, and the first formula is specifically as follows:

[0087]

[0088] wherein h u represents the first embedding vector of the attribute node to be updated, N attr (u) represents the set of adjacent attribute relationships corresponding to the attribute node to be updated u, v represents the adjacent attribute node of the attribute node to be updated, r represents the adjacent attribute connection relationship between the attribute node to be updated and the adjacent attribute node, W attr(r) represents the first preset embedding factor, φ represents the combination function, and h v represents the adjacent attribute node embedding vector, h r represents the adjacent attribute node relationship embedding vector.

[0089] In one example, W attr(r) is determined according to the direction of the adjacent attribute connection relationship, and W attr(r) is specifically determined by the sixth formula, and the specific formula is as follows:

[0090]

[0091] wherein R o is the out-edge relationship set in the set of adjacent attribute relationships starting from the attribute node to be updated, R inv o is the in-edge relationship set in the set of adjacent attribute relationships ending at the attribute node to be updated, r slef-loop o is the self-loop relationship set of the attribute node to be updated in the set of adjacent attribute relationships.

[0092] Further, when S105 is performed, the embodiment can include the following steps:

[0093] S1051, according to the first entity node knowledge graph, obtaining the set of adjacent entity nodes corresponding to the entity node to be updated.

[0094] In this embodiment, when the second embedding vector is determined, the second entity node knowledge graph is first acquired, that is, each entity node is acquired in sequence, and then the adjacent entity nodes connected with the to-be-updated entity node are determined in sequence according to the position of the to-be-updated entity node in the first entity node knowledge graph, so as to determine the set of adjacent entity nodes.

[0095] In S1052, the set of adjacent entity relationship is determined according to the set of adjacent entity nodes.

[0096] In this embodiment, after the set of adjacent entity nodes is determined, the set of adjacent entity relationship is determined by counting the adjacent entity node relationship vectors between each adjacent entity node and the to-be-updated entity node.

[0097] In S1053, the second embedding vector of the to-be-updated entity node is determined according to the adjacent entity node embedding vector of each adjacent entity node in the set of adjacent entity nodes, the adjacent entity node relationship embedding vector of each adjacent entity relationship in the set of adjacent entity relationship, the second preset embedding factor and the preset combination function.

[0098] In this embodiment, after the set of adjacent entity nodes and the set of adjacent entity relationship are determined, the second embedding vector of the to-be-updated entity node is determined according to the adjacent entity node embedding vector of each adjacent entity node in the set of adjacent entity nodes, the adjacent entity node relationship embedding vector of each adjacent entity relationship in the set of adjacent entity relationship, the second preset embedding factor and the preset combination function.

[0099] In one example, the second embedding vector is determined by the second formula, and the second formula is specifically as follows:

[0100]

[0101] wherein h u' represents the first embedding vector of the to-be-updated entity node, N attr (u') represents the set of adjacent attribute relationship corresponding to the to-be-updated entity node u', v' represents the adjacent entity node of the to-be-updated entity node, r' represents the adjacent entity connection relationship between the to-be-updated entity node and the adjacent entity node, W (r) represents the second preset embedding factor, and φ represents the combination function, h v' represents the adjacent entity node embedding vector, h r' represents the adjacent entity node relationship embedding vector.

[0102] Further, the embodiment further includes the following steps:

[0103] In S107, the initial attribute node knowledge graph and the initial entity node knowledge graph are acquired.

[0104] In this embodiment, information is first collected to construct an initial entity node knowledge graph, and further, each entity node in the initial entity node knowledge graph is classified to determine attribute nodes and non-attribute nodes, and the initial attribute node knowledge graph is constructed using the attribute nodes.

[0105] In one example, taking the mainstream value concept knowledge graph as an example, the mainstream value concept knowledge graph can be constructed by a "combination of man and machine" method, as shown in FIG. 1, which is a flowchart of the construction of the mainstream value concept knowledge graph provided by another embodiment of the present application. In the process of constructing the mainstream value concept knowledge graph, first, social science experts define and hierarchically divide the top-level knowledge of the mainstream value concept knowledge graph, i.e., the value concept. Figure 2

[0106] Further, Table 1 lists the entity categories and the corresponding relationships of the entities.

[0107] Table 1

[0108]

[0109]

[0110] Further, the mainstream value concept knowledge graph can also be expanded by the following methods, including:

[0111] (1) For core word, core main word and other lexical entity, through Baidu Chinese, the attribute information such as definition, synonym, antonym and example sentence is crawled;

[0112] (2) The entities with positive polarity are easy to collect on a large scale and automatically, and the negative entities, such as negative characters, banned books, banned films and television dramas, are expanded by manual collection;

[0113] (3) The semantic information of the lexical entity is enhanced by expanding the synonym and antonym relationship, and it is specified that the synonym of a word contains itself, the antonym of the synonym of the word is added to the antonym of the word, and the synonym of the antonym is added to enhance the connection relationship between entities.

[0114] The specific scale details of each category of entity in the updated mainstream value concept knowledge graph are shown in Table 2 below.

[0115] Table 2

[0116]

[0117] Among them, the value concept, core main word and core word are collected and labeled by social experts, and the entity information of the remaining categories is collected and expanded by means of crawler, knowledge base data migration, rule-based knowledge reasoning, etc.​

[0118] S108, enhancing the initial attribute node knowledge graph and the initial entity node knowledge graph according to a preset relationship enhancement strategy.

[0119] In this embodiment, after obtaining the initial attribute node knowledge graph and the initial entity node knowledge graph, the connection relationships between the attribute nodes in the initial attribute node knowledge graph are enhanced by using the preset relationship enhancement strategy to increase the connection relationships between different attribute nodes, and the connection relationships between the entity nodes in the initial entity node knowledge graph are enhanced by using the preset relationship enhancement strategy to increase the connection relationships between different entity nodes.

[0120] Further, the knowledge graph embedding vector determination method of this embodiment can further include the following steps:

[0121] S109, determining a probability distribution score corresponding to the target embedding vector based on an activation function layer and a Sigmoid layer.

[0122] In this embodiment, the probability distribution score is determined by the seventh formula and the eighth formula.

[0123] The seventh formula is specifically as follows:

[0124] X' = ReLU(WX + b);

[0125] wherein X' represents the first target embedding vector, ReLU represents the activation function, W represents the first calculation factor, and b represents the second calculation factor.

[0126] The eighth formula is specifically as follows:

[0127] score = Sigmoid(X');

[0128] wherein score represents the probability distribution function, and Sigmoid represents the activation function.

[0129] S110, determining a loss value according to the probability distribution score, wherein the loss value is used to update a preset relationship factor.

[0130] In this embodiment, the loss value is determined by the ninth formula.

[0131] The ninth formula is specifically as follows:

[0132] loss = BCE Loss(score, label);

[0133] wherein loss represents the loss value, BCE Loss represents the loss function, and label represents the true label.

[0134] Another embodiment of the present application provides a knowledge graph embedding vector determination method, as shown in the following formula (1): Figure 3

[0135] In the determination of the knowledge graph embedding vector, first, the information for constructing the knowledge graph is collected to construct an initial entity node knowledge graph, and further, the entity nodes in the initial entity node knowledge graph are distinguished to determine the attribute nodes and non-attribute nodes in the entity nodes, so as to determine the initial attribute node knowledge graph by using the attribute nodes, and further determine the initial entity node knowledge graph and the initial attribute node knowledge graph.

[0136] Further, the initial entity node knowledge graph and the initial attribute node knowledge graph are respectively enhanced according to a preset relationship enhancement strategy to enhance the relationship, so as to determine the first attribute node knowledge graph and the first entity node knowledge graph, and further, according to the graph convolutional neural network, the attribute embedding vector and the attribute node relationship embedding vector of the attribute nodes in the first attribute node knowledge graph are determined, and the entity embedding vector and the entity node relationship embedding vector of the entity nodes in the first entity node knowledge graph are determined.

[0137] Further, the to-be-updated attribute node in the first attribute node knowledge graph is obtained, that is, each attribute node is obtained in sequence, so as to determine the adjacent attribute nodes connected with the to-be-updated attribute node according to the position of the to-be-updated attribute node in the first attribute node knowledge graph, thereby determining the adjacent attribute node set, and the adjacent attribute node relationship vector between each adjacent attribute node and the to-be-updated attribute node is counted to determine the adjacent attribute relationship set, and finally, based on the first formula, the first embedding vector of the to-be-updated attribute node is determined according to the adjacent attribute node embedding vector of each adjacent attribute node in the adjacent attribute node set, the adjacent attribute node relationship embedding vector of each adjacent relationship in the adjacent attribute relationship set, the first embedding factor and the preset combination function.

[0138] ​Meanwhile, according to a preset relationship factor, the entity node relationship embedding vector of the first entity node knowledge graph is updated to determine a first entity node relationship embedding vector, the first embedding vector and the first entity node relationship embedding vector are used to update the first entity node knowledge graph, a second entity node knowledge graph is determined, and a to-be-updated entity node is obtained in the second entity node knowledge graph, that is, each entity node is sequentially obtained, the adjacent entity nodes connected with the to-be-updated entity node are sequentially determined according to the position of the to-be-updated entity node in the second entity node knowledge graph, so that a set of adjacent entity nodes is determined, the adjacent entity node relationship vector between each adjacent entity node and the to-be-updated entity node is further counted to determine a set of adjacent entity relationship, and finally, according to the adjacent entity node embedding vector of each adjacent entity node in the set of adjacent entity nodes, the adjacent entity node relationship embedding vector of each adjacent entity relationship in the set of adjacent entity relationship, a second preset embedding factor and a preset combination function, the second embedding vector of the to-be-updated entity node is determined based on a second formula.

[0139] Further, the second entity node relationship embedding vector is determined according to the preset relationship factor and the first entity node relationship embedding vector, and the target embedding vector of each entity node is determined based on a fifth formula according to the second embedding vector and the second entity node relationship embedding vector.

[0140] Further, based on the activation function layer and the Sigmoid layer, the probability distribution score corresponding to the target embedding vector is determined, the loss value is determined according to the probability distribution score, and the preset relationship factor is updated according to the loss value.

[0141] Another embodiment of the present application provides a knowledge graph embedding vector determination device, as shown in the figure, the knowledge graph embedding vector determination device comprises: Figure 4

[0142] The first determination module 401 is configured to determine the attribute embedding vector and the attribute node relationship embedding vector of the attribute node in the first attribute node knowledge graph and determine the entity embedding vector and the entity node relationship embedding vector of the entity node in the first entity node knowledge graph according to the graph convolutional neural network, wherein the entity node comprises the attribute node and a non-attribute node, the attribute node is a subset of the entity node, the first attribute node knowledge graph is a subset of the first entity node knowledge graph, and the first attribute node knowledge graph and the first entity node knowledge graph are after relationship enhancement.

[0143] The second determination module 402 is configured to update the attribute embedding vector of the attribute node according to the attribute node relationship embedding vector and determine the first embedding vector of each attribute node.

[0144] ​The first updating module 403 is configured to update the entity node relationship embedding vector of the first entity node knowledge graph according to a preset relationship factor, and determine a first entity node relationship embedding vector.

[0145] The second updating module 404 is configured to update the first entity node knowledge graph according to the first embedding vector and the first entity node relationship embedding vector, and determine a second entity node knowledge graph.

[0146] The third determining module 405 is configured to update the entity embedding vector of the entity node according to the first entity node relationship embedding vector in the second entity node knowledge graph, and determine a second embedding vector of each entity node.

[0147] The fourth determining module 406 is configured to determine a target embedding vector of each entity node according to the second embedding vector and a second entity node relationship embedding vector, wherein the second entity node relationship embedding vector is determined according to the preset relationship factor and the first entity node relationship embedding vector.

[0148] Another embodiment of the present application provides an electronic device, which comprises a memory and a processor, the memory is used to store computer instructions executable on the processor, and the processor is used to execute the computer instructions to implement the drug side effect prediction method according to the embodiments of the present application.

[0149] Another embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to implement the drug side effect prediction method according to the embodiments of the present application.

[0150] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.

[0151] The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems can be used with these teachings, with or without accompanying software. In addition, the present application is not inherently related to any particular programming language. It will be appreciated that there are many alternative ways of implementing the application described herein. Likewise, the present application is practiced with a variety of computer system configurations, including personal computers, server computers, hand-held devices, and multiprocessor systems. The present application is not necessarily limited to any one particular distributed architecture, platform, or configuration. There are no restrictions on the nature, scope or format of processing techniques and protocols that can be used in conjunction with the teachings presented herein. The language used herein has been principally selected for readability and instructional purposes and it can not have been selected to delineate or circumscribe the patent rights. It is therefore intended that the scope of the application be determined by the following claims and their equivalents.

[0152] In addition, the memory can include non-persistent memory in computer readable media, random access memory (RAM) and / or non-volatile memory, such as read only memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.

[0153] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0154] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0155] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.

[0156] In a typical configuration, an electronic device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0157] The memory can include non-persistent memory and / or volatile memory, such as a random access memory (RAM) including a cache area for the temporary storage of data. The memory can also include non-volatile memory, such as read only memory (ROM) for storing structural information and / or instruction code to implement the functions of the computing device. The memory can also include solid state non-volatile memory such as flash memory, or other memory, such as disk or tape.

[0158] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology for storing information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.

[0159] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or apparatus that comprises a list of elements does not only include those elements, but can also include other elements not expressly listed or inherent to such process, method, article or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.

Claims

1. A method for determining a knowledge graph embedding vector, characterized in that, The method comprises the following steps: According to the graph convolutional neural network, the attribute node relationship embedding vector of the first attribute node knowledge graph and the entity node relationship embedding vector of the first entity node knowledge graph are determined, wherein the entity node comprises the attribute node and a non-attribute node, the attribute node is a subset of the entity node, the first attribute node knowledge graph is a subset of the first entity node knowledge graph, and the first attribute node knowledge graph and the first entity node knowledge graph are enhanced by relationship; According to the attribute node relationship embedding vector, the attribute embedding vector of the attribute node is updated, and the first embedding vector of each attribute node is determined; According to the preset relationship factor, the entity node relationship embedding vector of the first entity node knowledge graph is updated, and the first entity node relationship embedding vector is determined; According to the first embedding vector and the first entity node relationship embedding vector, the first entity node knowledge graph is updated, and the second entity node knowledge graph is determined; According to the first entity node relationship embedding vector in the second entity node knowledge graph, the entity embedding vector of the entity node is updated, and the second embedding vector of each entity node is determined; According to the second embedding vector and the second entity node relationship embedding vector, the target embedding vector of each entity node is determined, wherein the second entity node relationship embedding vector is determined according to the preset relationship factor and the first entity node relationship embedding vector; An initial attribute node knowledge graph and an initial entity node knowledge graph are obtained; Specifically, information is collected to construct the initial entity node knowledge graph, each entity node in the initial entity node knowledge graph is classified to determine the attribute node, and the initial attribute node knowledge graph is constructed according to the attribute node. For the initial entity node knowledge graph and the initial attribute node knowledge graph, the connection relationship between entities is enhanced by crawling the paraphrase, synonym, antonym and example sentence of the core word and the core main word, and collecting the positive entity and the negative entity. 2.The method of claim 1, wherein, According to the attribute node relationship embedding vector, the attribute embedding vector of the attribute node is updated, and the first embedding vector of each attribute node is determined, comprising: According to the first attribute node knowledge graph, a set of adjacent attribute nodes corresponding to the attribute node to be updated is obtained; According to the set of adjacent attribute nodes, a set of adjacent attribute relationships is determined; According to the adjacent attribute node embedding vector of each adjacent attribute node in the set of adjacent attribute nodes, the adjacent attribute node relationship embedding vector of each adjacent relationship in the set of adjacent attribute relationships, the first embedding factor and the preset combination function, the first embedding vector of the attribute node to be updated is determined. 3.The method of claim 2, wherein, The first embedding vector of the to-be-updated attribute node is determined according to the adjacency attribute node embedding vectors of the respective adjacency attribute nodes in the set of adjacency attribute nodes, the adjacency attribute node relation embedding vectors of the respective adjacency relations in the set of adjacency attribute relations, a first embedding factor and a preset combination function, and the first embedding vector of the to-be-updated attribute node is determined according to the following formula: determining the first embedding vector according to a first formula, the first formula comprising: ; wherein, denotes a first embedding vector of the attribute node to be updated, denotes a set of adjacent attribute relations corresponding to the attribute node to be updated u, denotes an adjacent attribute node of the attribute node to be updated, denotes an adjacent attribute connection relation between the attribute node to be updated and the adjacent attribute node, denotes a first preset embedding factor, denotes a combination function, denotes an adjacent attribute node embedding vector, denotes an adjacent attribute node relation embedding vector. 4.The method of claim 1, wherein, The second embedding vector of each entity node is determined according to the first entity node relation embedding vector in the second entity node knowledge graph, and the second embedding vector of each entity node is determined according to the following formula: According to the first entity node knowledge graph, a set of adjacent entity nodes corresponding to a to-be-updated entity node is acquired; According to the set of adjacent entity nodes, a set of adjacent entity relations is determined; The second embedding vector of the to-be-updated entity node is determined according to the adjacency entity node embedding vectors of the respective adjacency entity nodes in the set of adjacency entity nodes, the adjacency entity node relation embedding vectors of the respective adjacency entity relations in the set of adjacency entity relations, a second preset embedding factor and a preset combination function. 5.The method of claim 4, wherein, The second embedding vector of the to-be-updated entity node is determined according to the adjacency entity node embedding vectors of the respective adjacency entity nodes in the set of adjacency entity nodes, the adjacency entity node relation embedding vectors of the respective adjacency entity relations in the set of adjacency entity relations, a second preset embedding factor and a preset combination function, and the second embedding vector of the to-be-updated entity node is determined according to the following formula: The second embedding vector is determined according to a second formula, and the second formula includes: ; wherein, denotes a first embedding vector of an entity node to be updated, denotes an entity node to be updated corresponding to the adjacent attribute relationship set, denotes an adjacent entity node of the entity node to be updated, denotes an adjacent entity connection relationship between the entity node to be updated and the adjacent entity node, denotes a second preset embedding factor, denotes a combination function, denotes an adjacent entity node embedding vector, denotes an adjacent entity node relationship embedding vector. 6.The method of Claim 1, wherein, Further comprising: An initial attribute node knowledge graph and an initial entity node knowledge graph are acquired; The initial attribute node knowledge graph and the initial entity node knowledge graph are enhanced according to a preset relation enhancement strategy to determine the first attribute node knowledge graph and the first entity node knowledge graph, and the preset relation enhancement strategy includes at least one of introducing a reverse edge for each edge of the initial attribute node knowledge graph and the initial entity node knowledge graph and adding a self-loop relation to the initial attribute node knowledge graph and the initial entity node knowledge graph. 7.The method of claim 1, wherein, Further comprising: Based on an activation function layer and a Sigmoid layer, a probability distribution score corresponding to the target embedding vector is determined; A loss value is determined according to the probability distribution score, and the loss value is used to update a preset relation factor.

8. A knowledge graph embedding vector determination apparatus characterized by comprising: The knowledge graph embedding vector determination apparatus includes: A first determination module is configured to determine attribute embedding vectors and attribute node relation embedding vectors of attribute nodes in a first attribute node knowledge graph and determine entity embedding vectors and entity node relation embedding vectors of entity nodes in a first entity node knowledge graph according to a graph convolutional neural network, wherein the entity nodes include the attribute nodes and non-attribute nodes, the attribute nodes are a subset of the entity nodes, the first attribute node knowledge graph is a subset of the first entity node knowledge graph, and the first attribute node knowledge graph and the first entity node knowledge graph are after relation enhancement; A second determination module is configured to update the attribute embedding vectors of the attribute nodes according to the attribute node relation embedding vectors, and determine first embedding vectors of the respective attribute nodes. The first updating module is configured to update the entity node relationship embedding vector of the first entity node knowledge graph according to a preset relationship factor, and determine a first entity node relationship embedding vector. The second updating module is configured to update the first entity node knowledge graph according to the first embedding vector and the first entity node relationship embedding vector, and determine a second entity node knowledge graph. The third determining module is configured to update the entity embedding vector of the entity node according to the first entity node relationship embedding vector in the second entity node knowledge graph, and determine a second embedding vector of each entity node. The fourth determining module is configured to determine a target embedding vector of each entity node according to the second embedding vector and a second entity node relationship embedding vector, wherein the second entity node relationship embedding vector is determined according to the preset relationship factor and the first entity node relationship embedding vector.

9. An electronic device, comprising: The electronic device comprises a memory and a processor, the memory is configured to store computer instructions executable on the processor, and the processor is configured to execute the computer instructions to determine the knowledge graph embedding vector according to the method in any one of claims 1 to 7.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the knowledge graph embedding vector determination method in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Knowledge reasoning method based on multi-modal knowledge graph

    CN112288091A

  • Knowledge graph embedding using graph convolutional networks with relation-aware attention

    US20220245425A1