Knowledge graph-based causal meta-knowledge discovery method and device
By constructing a causal rule discovery algorithm in the knowledge graph and explaining the process of knowledge generation, the problem of difficult to explain the generation of knowledge in the knowledge graph in the existing technology is solved, and high-precision root cause positioning and link prediction are achieved.
Patent Information
- Application Number
- CN202310944037.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-28
- Publication Date
- 2025-02-14
AI Technical Summary
The prior art is difficult to explain the process of generating knowledge in the knowledge graph, and the rule-based meta-knowledge mining method cannot explain the process of generating knowledge.
The causal rules are formalized through the knowledge graph paradigm, the structure in the knowledge graph is encoded into variables and samples, and the causal rule discovery algorithm is constructed based on these variables and samples to learn the causal relationship between the knowledge graphs, thereby explaining the process of knowledge generation .
The causal rule mining at the concept level of knowledge graphs is realized, and causal rules that are interpretable, reasonable and generalizable are obtained, which improves the accuracy of root cause positioning and link prediction.
Smart Images

Figure CN119443222A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and in particular to a method and device for causal meta-knowledge discovery based on knowledge graphs. Background Art
[0002] In recent years, the explosive growth of information has made the scale of current knowledge graphs increasingly large, which has also increased the burden on people to understand and utilize the physical laws of the real world hidden behind the surface facts. Therefore, metaknowledge came into being, which is defined as knowledge about knowledge and can be used to identify complex knowledge production and reasoning processes. Although the association-based rule mining method in the current research on knowledge graphs has extracted rule-based metaknowledge, they cannot explain the process of knowledge generation. Summary of the invention
[0003] In order to solve the above problems, the embodiments of the present application provide a method and device for causal meta-knowledge discovery based on a knowledge graph. The causal rules are formally represented through the knowledge graph paradigm (KGS), the structure in the knowledge graph is encoded as variables and samples, and a causal rule discovery algorithm is constructed based on these variables and samples. The algorithm is used to learn the causal relationship between KGS, explain the generation of knowledge from the perspective of causal relationship, reveal the interaction between the components in a complex system, and the causal rules can be generalized.
[0004] In a first aspect, an embodiment of the present application provides a causal meta-knowledge discovery method based on a knowledge graph, the method comprising: determining a first knowledge graph paradigm KGS according to a causal relationship of the knowledge graph, the first KGS comprising a head entity, a tail entity, and a target relationship between the head entity and the tail entity in the causal graph; the target relationship is a rule obtained from a structured causal relationship of the knowledge graph; determining a second KGS expressing a potential cause, the second KGS being a relationship path from a head entity to a tail entity in the knowledge graph, the relationship path comprising a plurality of entities; encoding the first KGS as a first variable, and encoding the second KGS as a second variable; encoding a data object consisting of any two entities in the knowledge graph as a sample; the number of samples is multiple; sampling each sample in the relationship path, and determining a value of the second variable according to the sampling result; the sampling result comprises a sampling success and a sampling failure; sampling each sample in a real data set, and determining a value of the first variable according to the sampling result; obtaining a causal rule of the knowledge graph according to the sample and the corresponding values of the first and second variables, the causal rule being: the potential cause corresponding to the second variable is the cause of the target relationship expressed by the first KGS, and the head entity and the tail entity of the first KGS are data objects corresponding to the sample of successful sampling.
[0005] Therefore, the embodiment of the present application proposes a causal meta-knowledge discovery method based on the knowledge graph. Through the causal discovery technology, the causal rules at the concept level of the knowledge graph are mined, the formal representation of the causal rules is determined, the structured facts in the knowledge graph are encoded as variables and samples, and causal rule mining is performed to mine interpretable, reasonable, and generalizable causal rules at the concept level of the knowledge graph, which can achieve higher accuracy in root cause location and link prediction tasks.
[0006] As an achievable implementation method, the number of relationship paths is multiple, and determining the second KGS expressing the potential cause includes: searching for multiple relationship paths from the head entity to the tail entity in the knowledge graph; and obtaining a set of second KGS expressing multiple potential causes based on the multiple relationship paths.
[0007] In this way, the method provided in the embodiment of the present application determines the reasonable form of the potential cause based on the expression of the conceptual layer causal relationship and the given target relationship, so that the link task of the prediction knowledge graph can be comprehensively searched according to the reasonable form of the potential cause, and the structured causal relationship of the knowledge graph can be modeled. This has higher prediction accuracy than other baseline algorithms, especially in tasks where the training data and the test data are not identically distributed.
[0008] As a feasible implementation method, multiple relationship paths from the head entity to the tail entity are searched in the knowledge graph, including: within the set constraints, traversing all paths of the knowledge graph to obtain multiple potential causes, wherein the set constraints include the set jump, the head entity, and the tail entity.
[0009] In this way, the method provided in the embodiment of the present application can search the relationship path in the knowledge graph according to different constraints such as the set jump, head entity or tail entity, thereby improving the efficiency of the search and being accurate and targeted.
[0010] As an achievable implementation, encoding the first KGS as a first variable and encoding the second KGS as a second variable includes: encoding the first KGS as a first variable Y; encoding each second KGS in a set of multiple potential causes of the second KGS as variables X1, X2, ..., X m .
[0011] In this way, the method provided in the embodiment of the present application can encode a large number of structured facts in the knowledge graph into variables and samples, so as to map data objects to variable values.
[0012] As an achievable implementation method, determining a second KGS expressing potential causes includes: searching for relationship paths in a knowledge graph through a random walk algorithm, a depth-first algorithm, or a breadth-first search algorithm; wherein the input of the random walk algorithm, the depth-first algorithm, or the breadth-first search algorithm is a knowledge graph, and the output is a plurality of relationship paths from a head entity to a tail entity; and determining a plurality of second KGS expressing potential causes based on the plurality of relationship paths.
[0013] In this way, the method provided in the embodiment of the present application can perform random search, deep search or breadth search to obtain the reasonable form of potential causes in the structured causal relationship of a certain knowledge graph, thereby improving the search efficiency, accuracy and pertinence.
[0014] As a feasible implementation method, each sample in the real data set is sampled, and the value of the first variable is determined according to the sampling result, including: when the sampling is successful, the value of the first variable is true / 1, and when the sampling fails, the value of the first variable is false / 0.
[0015] In this way, the method provided in the embodiment of the present application can determine the sampling rules, establish a mapping from data objects to variable values in the real data set according to the sampling rules, and mine the target relationship based on massive historical data. The mined target relationship has stronger interpretability and accuracy.
[0016] As an achievable implementation method, each sample in the relationship path is sampled, and the value of the second variable is determined according to the sampling result, including: when the sampling is successful, the value of the second variable is true / 1, and when the sampling fails, the value of the second variable is false / 0.
[0017] In this way, the method provided in the embodiment of the present application can determine the sampling rules, and according to the sampling rules, establish a mapping from data objects to variable values based on the knowledge graph, and mine out causal rules. The mined causal rules have stronger interpretability and accuracy.
[0018] As an achievable implementation, the method further includes: according to the data object, the value of the first variable Y, a plurality of second variables X1, X2, ... m , generate a sample table or sample set.
[0019] In this way, the method provided in the embodiment of the present application transforms the structured data of the knowledge graph into tabular data through innovation for causal discovery, and the intermediate results can be obtained through decompilation and other technologies.
[0020] As a feasible implementation method, when the same sample is sampled successfully and the values of the first and second variables are both true / 1, the causal rules of the knowledge graph are obtained.
[0021] In this way, the method provided in the embodiment of the present application performs causal rule mining based on the variables and samples corresponding to the structured facts in the knowledge graph, and mines out interpretable, inferable, and generalizable causal rules at the conceptual level of the knowledge graph.
[0022] As an achievable implementation method, the method also includes: inputting the sample table into a PC-like algorithm, outputting one or more second variables that meet the requirements, and the one or more second variables that meet the requirements are the corresponding potential causes of the target relationship indicated by the first variable Y.
[0023] In this way, the method provided in the embodiment of the present application uses an AI intelligent algorithm to perform knowledge mining on the tabular data of the knowledge graph. The algorithm input is the tabular data corresponding to the structured facts of the complete knowledge graph, and the output is the causal relationship between the sub-graphs. This can realize causal rule mining on the sample set, identify the causal relationship between different relationship paths, and discover causal meta-knowledge.
[0024] As an achievable implementation method, the method also includes: identifying a relationship path with a bidirectional relationship in one or more second variables that meet the requirements; determining the conditional independence of each relationship path in the relationship path with a bidirectional relationship, eliminating an edge that does not meet the conditional independence, and obtaining the final causal rule.
[0025] In this way, the method provided in the embodiment of the present application identifies and processes the bidirectional relationship through secondary inspection to obtain the final causal rule.
[0026] In the second aspect, an embodiment of the present application provides a causal meta-knowledge discovery device based on a knowledge graph, including: a potential cause mining module, used to determine a first knowledge graph paradigm KGS according to the causal relationship of the knowledge graph, the first KGS including a head entity, a tail entity, and a target relationship between the head entity and the tail entity in the causal graph; the target relationship is a rule obtained from the structured causal relationship of the knowledge graph; determine a second KGS expressing a potential cause, the second KGS is a relationship path from the head entity to the tail entity in the knowledge graph, and the relationship path includes multiple entities; encode the first KGS as a first variable, and encode the second KGS as a second variable; a sample generation module , used to encode the data object composed of any two entities in the knowledge graph as a sample; the number of samples is multiple; each sample is sampled in the relationship path, and the value of the second variable is determined according to the sampling result; the sampling result includes sampling success and sampling failure; each sample is sampled in the real data set, and the value of the first variable is determined according to the sampling result; the causal relationship mining module is used to obtain the causal rules of the knowledge graph according to the sample and the corresponding first and second variable values, and the causal rule is: the potential cause corresponding to the second variable is the cause of the target relationship expressed by the first KGS, and the head entity and tail entity of the first KGS are the data objects corresponding to the sample that was successfully sampled. Its beneficial effects are as in the first aspect, and will not be repeated here.
[0027] In a third aspect, an embodiment of the present application provides a computer-readable storage medium for storing a computer program. When the computer program is executed in a computer, the computer executes any method in the first aspect. Its beneficial effects are the same as those in the first aspect and will not be repeated here.
[0028] In a fourth aspect, an embodiment of the present application provides a computing device, including a memory and a processor, wherein an executable code is stored in the memory, and when the processor executes the executable code, the method of any one of the first aspects is implemented. The beneficial effects are the same as those of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions of the multiple embodiments disclosed in this specification, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only the multiple embodiments disclosed in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0030] The following is a brief introduction to the drawings required for describing the embodiments or prior art.
[0031] Figure 1a A triple diagram of the knowledge graph provided in the embodiment of the present application;
[0032] Figure 1b An entity diagram of the knowledge graph provided in the embodiment of the present application;
[0033] Figure 2 An architecture diagram of a causal meta-knowledge discovery system based on a knowledge graph proposed in an embodiment of the present application;
[0034] Figure 3a Schematic diagram of the process of modeling causal relationships for the potential cause mining module;
[0035] Figure 3b A schematic diagram of a relationship path in the knowledge graph;
[0036] Figure 4 A schematic diagram of the process of generating a sample set by a sample generation module;
[0037] Figure 5a Schematic diagram of the process of discovering causal rules for the causal rule mining module;
[0038] Figure 5b Schematic diagram of the bidirectional relationship between two potential causes in the knowledge graph;
[0039] Figure 6 A flow chart of a method for causal meta-knowledge discovery based on a knowledge graph provided in an embodiment of the present application;
[0040] Figure 7a A schematic diagram of potential cause mining in drug redirection application scenarios;
[0041] Figure 7b Flowchart for sample generation in drug redirection application scenarios;
[0042] Figure 7c Schematic diagram for identifying bidirectional relationships in drug redirection application scenarios;
[0043] Figure 8 A schematic diagram of a causal meta-knowledge discovery device based on a knowledge graph provided in an embodiment of the present application;
[0044] Fig. 9 A schematic diagram of a computing device provided in an embodiment of the present application;
[0045] Fig.10 A schematic diagram of a computing device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] In the description of the embodiments of the present application, words such as "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a concrete way.
[0047] In the description of the embodiments of the present application, the term "and / or" is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, B exists alone, and A and B exist at the same time. In addition, unless otherwise specified, the term "multiple" means two or more. For example, multiple systems refers to two or more systems, and multiple terminals refers to two or more terminals.
[0048] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprises", "has" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0049] In the description of the embodiments of the present application, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0050] In the description of the embodiments of the present application, the terms "first\second\third, etc." or module A, module B, module C, etc. are only used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that the specific order or sequence can be interchanged where permitted so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
[0051] In the description of the embodiments of the present application, the numbers representing the steps, such as S110, S120, etc., do not necessarily mean that the steps will be executed in this manner. If permitted, the order of the previous and next steps can be interchanged, or they can be executed simultaneously.
[0052] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0053] Relevant terms involved in the embodiments of this application:
[0054] Knowledge graph (KG) is a structured semantic knowledge base used to describe concepts and their relationships in the physical world in symbolic form. Its basic components are "entity-relationship-entity" triples, as well as entities and their related attribute-value pairs. Entities are connected to each other through relationships to form a network of knowledge structures. In the knowledge graph, the triple (h, r, t) is generally used to indicate that there is a relationship r between entity h and entity t, and h points to r. The triple (h, r, t) is the smallest knowledge unit of the knowledge graph. Figure 1a The triples of the knowledge graph shown in the figure, the circles represent entities, representing the head entity h and the tail entity t respectively, the line between the two is the edge, representing the relationship, and the arrow points from the head entity to the tail entity t. Figure 1b The triples in can be expressed in natural language as "** actor starred in ## movie". At the same time, each entity also has some attributes. For example, the tail entity of "## movie" can take some basic information as attributes, such as release time, film type, number of episodes, etc.
[0055] Metaknowledge is knowledge about knowledge and is used to identify complex processes of knowledge production and reasoning.
[0056] Knowledge Graph Schema (KGS) is a formal representation of the causal rules of knowledge graphs.
[0057] Causal algorithm (Peter Spirtes and Clark Glymour, PC) is an algorithm for finding causal rules from observed data.
[0058] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0059] One of the solutions related to knowledge generation is the logical rule mining method, which can be divided into supervised and unsupervised methods. Among them, supervised methods use RNN models, matrix decomposition and other methods to build differentiable logical rule models. The data obtained by sampling some triples in the knowledge graph is used as supervisory information to learn the parameters of the logical rule model. After the training is completed, the interpretable inference rules are generated by inversely solving the model. Unsupervised methods iteratively mine legend rules based on the knowledge base through predefined confidence indicators. Logical rule mining methods essentially rely on the correlation strength between inference information and target relationships to perform relationship mining. This type of method may mine false associations in the data, resulting in the inability to generalize inference rules.
[0060] The second solution related to knowledge generation is the relational causal model. The basic idea of the relational causal model is that it is the only known work on causal relationship mining on relational data. It takes the characteristics of entities and relationships under certain relational structure constraints as the research object, and conducts causal relationship mining through the conditional independence relationship between data. The relational causal model learns the causal relationship between entity features when the structural relationship of the data is known, but the research on the causal relationship between the structures of entities is still unexplored.
[0061] In view of this, the method for causal meta-knowledge discovery based on knowledge graph in the embodiment of the present application captures meta-knowledge with causal relationships, formalizes causal rules through the knowledge graph paradigm (KGS), encodes the structure in the knowledge graph as variables and samples, and constructs a causal rule discovery algorithm based on these variables and samples. The algorithm is used to learn the causal relationship between KGS, explain the generation of knowledge from the perspective of causality, and reveal the interaction between components in a complex system.
[0062] For example, Figure 2 FIG. 1 shows an architecture diagram of a causal meta-knowledge discovery system based on a knowledge graph proposed in an embodiment of the present application. Figure 2 As shown, it includes: a potential cause mining module 21, a sample generation module 22 and a causal relationship mining module 23.
[0063] The potential cause mining module 21 is mainly used to determine the first knowledge graph paradigm KGS according to the causal relationship of the knowledge graph. The first KGS includes the head entity, the tail entity, and the target relationship between the head entity and the tail entity in the causal graph; the target relationship is the set relationship between the head entity and the tail entity; determine the second KGS that expresses the potential cause, the second KGS is the relationship path from the head entity to the tail entity in the knowledge graph, and the relationship path includes multiple entities; encode the first KGS as a first variable, and encode the second KGS as a second variable. In this way, the structured causal relationship of the knowledge graph can be modeled.
[0064] The sample generation module 22 is mainly used to encode the data object composed of any two entities in the knowledge graph into a sample; the number of samples is multiple; each sample is sampled in the relationship path, and the value of the second variable is determined according to the sampling result; the sampling result includes sampling success and sampling failure; when the sampling is successful, the value of the second variable is 1, and when the sampling fails, the value of the second variable is 0; each sample is sampled in the real data set, and the value of the first variable is determined according to the sampling result; when the sampling is successful, the value of the first variable is 1, and when the sampling fails, the value of the first variable is 0. In this way, the structured data of the knowledge graph can be converted into a sample set or a sample table.
[0065] The causal relationship mining module 23 is mainly used to obtain the causal rules of the knowledge graph according to the sample and the corresponding first and second variable values. The causal rule is: the relationship path corresponding to the second variable is the cause of the causal relationship expressed by the first KGS, and the head entity and tail entity of the first KGS are the data objects corresponding to the sample that has been successfully sampled. In this way, causal rule mining can be realized for the sample set, the causal relationship between different relationship paths can be identified, and causal meta-knowledge can be discovered.
[0066] Figure 3a Schematic diagram of the process of modeling causal relationships for the potential cause mining module. Figure 3a As shown, the potential cause mining module models the structured causal relationship of the knowledge graph through the following steps S311-S313.
[0067] S311, obtain the knowledge graph paradigm KGS based on the structured causal relationship of the knowledge graph.
[0068] First, determine the structured causal relationship of the knowledge graph as:
[0069] S C (v h,C , v t,C ) → S E (v h,E , v t,E ): w (1)
[0070] In formula (1), S C (v h,C , v t,C ) is represented as a relation path in the knowledge graph; v h,C is the first head entity that constitutes the relationship path, v t,C The first tail entity that forms the relationship path. E (v h,E , v t,E ) represents the result, v h,E , v t,E The second head entity and the second tail entity that constitute the result. “→” indicates a causal relationship, pointing from the relationship path to the result. “:w” indicates the weight of the causal relationship, which is used to measure the strength of the impact.
[0071] The expression (1) can be expressed in natural language as follows: C (v h,c , v t,c ) can get the result S E (v h,E , v t,E ), or S C (v h,C , v t,C ) is S E (v h,E , v t,E ) potential causes. Among them, S C (v h,c , v t,c ) includes at least the first header entity v h,c and the first trailing entity v t,c ; S constituting the result E (v h,E , v t,E ) includes at least the second header entity v h,c and the second trailing entity v t,c .
[0072] When no distinction is required, the first header entity and the second header entity are collectively referred to as the header entity, and the first tail entity and the second tail entity are collectively referred to as the tail entity.
[0073] Then, according to formula (1), the structured causal relationship of the knowledge graph is modeled as:
[0074] KGS=R(C h ,C t ) (2)
[0075] In formula (2), KGS is the knowledge graph paradigm. The knowledge graph paradigm (KGS) is a conceptual representation of the causal relationship structured in the knowledge graph. his the head entity in the causal relationship; C t is the tail entity in the causal relationship; R is the relationship function between the head entity and the tail entity.
[0076] Next, the knowledge graph paradigm of the target relationship is defined according to the knowledge graph paradigm of formula (2):
[0077] KGS0=R h (C h ,C t ) (3)
[0078] The target relationship expressed by formula (3) is the rule obtained from the structured causal relationship of the knowledge graph. KGS0 is the knowledge graph paradigm of the target relationship, R h is the head entity C in the target relation h With the tail entity C t The target relationship KGS0 can be recorded as the first KGS.
[0079] S312, according to the knowledge graph paradigm of the head rule of formula (3), the knowledge graph is searched for potential reasons that meet the head rule, and a potential reason is that the knowledge graph includes a relationship path from the head entity to the tail entity, and each relationship path includes a path from the head entity C to the tail entity. h To the end entity C t Multiple entities with relationships between them.
[0080] Each relationship path is a combination of one or more triples, and two adjacent triples are connected by a common entity. One or more relationship paths are one or more subgraphs of the knowledge graph. Figure 3b As shown, according to the knowledge graph paradigm of the head rule of formula (3), C h is the head entity, with C t For the tail entity, traverse and search the structure of the given knowledge graph A from the head entity C h To the end entity C t One or more relationship paths, each of which consists of a relationship path from the head entity C h To the end entity C t There are multiple triplets with relations between them, such as Where R1(C h ,C 1,1 ) represents the first triple in the knowledge graph structure A, R2(C 1,1 ,C 1,2 ) is the second triplet, and so on, each two adjacent triplets are connected by a common entity.
[0081] In some feasible implementations, it is possible to traverse all paths of the knowledge graph within set constraints to obtain multiple potential causes, where the set constraints include set jumps, head entities, tail entities, etc., and each of the multiple potential causes is a subgraph that conforms to the causal knowledge graph.
[0082] In some achievable implementations, multiple potential causes of a given knowledge graph are searched by a random walk algorithm, a depth-first algorithm, or a breadth-first search algorithm, wherein the input of the random walk algorithm, the depth-first algorithm, or the breadth-first search algorithm is a complete knowledge graph, and the output is multiple relationship paths from the head entity to the tail entity, and multiple second KGS expressing potential causes are determined according to the multiple relationship paths.
[0083] S313, according to at least one potential cause in the knowledge graph that meets the target relationship, a KGS set of potential causes is obtained, wherein the KGS set of potential causes includes one or more relationship paths that meet the target relationship paradigm. The KGS of potential causes can be recorded as a second KGS.
[0084] The data of one or more relationship paths are represented as KGS, and the KGS set of potential causes is obtained as follows:
[0085]
[0086] Formula (4) includes the KGS of m potential causes, l1, l2…l m are the number of entities in each relationship path, respectively.
[0087] S314, encode the KGS0 of the target relationship in the knowledge graph as the first variable Y, and encode the KGS of the potential cause as the second variable X.
[0088] In some achievable implementations, the KGS0 of the target relationship in the knowledge graph is encoded as Y, and the KGS1, KGS2, ..., KGS of the potential cause corresponding to each relationship path are encoded as m Encoded as variables X1, X2…X m , and the variable set is:
[0089]
[0090] In formula (5), when Y = 0, it means that the target relationship does not hold in the real data set, and when Y = 1, it means that the target relationship holds in the real data set; when X1 = 0, it means that the first potential cause does not exist, and when X1 = 1, it means that the first potential cause exists; when X2 = 0, it means that the second potential cause does not exist, and when X2 = 1, it means that the second potential cause exists; and so on, X m = 0 means the mth potential cause does not exist, X m=1 indicates that the mth potential cause exists.
[0091] Figure 4 Figure 1 is a schematic diagram of the sample generation module's sample set generation process. Figure 4 As shown, the sample generation module generates a sample set according to the structured data of the knowledge graph through steps S321-S323.
[0092] S321, set multiple groups of data objects (DO), each of which includes header data e h and tail data e t Exemplarily, the data objects determined according to the paradigm of the target relationship of formula (3) include: DO1 is the first data object, including the first header data and the first tail data DO2 is the second data object, including the second header data and the second tail data The mth data object, including the mth header data and the mth tail data
[0093] S322, taking a data object consisting of any two entities in the knowledge graph as a sample, the number of samples is multiple; determining a sampling rule based on the mapping of data objects to variables.
[0094] The sampling rule can be expressed by the following formula:
[0095]
[0096]
[0097] The sampling rule of formula (6) is: for each data object corresponding to a sample in the relationship path Sampling is performed and the second variable X is determined based on the sampling results. i The sampling results include sampling success and sampling failure; when the sampling is successful, the second variable X i The value of X is 1 when sampling fails. i The value of is 0. Among them, sampling success means that the relationship path includes the data object And it meets R b A sampling failure means that the relationship path does not include the data object. or does not meet R b Defined relationship.
[0098] The sampling rule of formula (7) is: for each sample in the real data set,h ,C t ) to perform sampling, and determine the value of the first variable Y according to the sampling result; when the sampling is successful, the value of the first variable Y is 1, and when the sampling fails, the value of the first variable Y is 0. Among them, the sampling success means that the relationship path includes the data object (C h ,C t ), and meets R h The relationship defined; sampling failure means that the relationship path does not include the data object (C h ,C t ), or does not meet R h Defined relationship.
[0099] For example, Among them, varenicline is a compound, Nicotine Dependence is nicotine dependence, and the causal relationship R between sampling and data objects in the dataset corresponding to the knowledge graph b Corresponding data structure (varenicline, Nicotine Dependence), if the sampling is successful, the variable X i Assign a value of 1. If sampling fails, the variable X i Assign a value of 0. In the real data set, if the relationship between varenicline and nicotine dependence holds, then Y = 1; if the relationship between varenicline and nicotine dependence does not hold, then Y = 0.
[0100] S323, sampling is performed based on the sampling rules of formula (6) and formula (7) to obtain a sampling result, where the sampling result includes sampling success or sampling failure.
[0101] Exemplarily, the data object DO1 includes the first header data and the first tail data Sample the first header data in the relationship path corresponding to variable X1 and the first tail data The relationship between the two b If the sampling is successful, the variable X1 is assigned to 1; if the sampling fails, the variable X1 is assigned to 0. … And so on. In the real data set, the sampling is consistent with the first head data. and the first tail data The relationship between the two h If the sampling is successful, the variable Y is assigned a value of 1; if the sampling fails, the variable Y is assigned a value of 0.
[0102] When Y=0, it means that the data object does not exist in the real data set, and when Y=1, it means that the data object exists in the real data set; when X1=0, it means that the data object does not exist in the first potential cause, and when X1=1, it means that the data object exists in the first potential cause; ... and so on.
[0103] S324, according to the data object, the second variable X i , the first variable Y and the sampling result generate a sample set. i In this case, you can use "data object" as the first heading of the table and the variable "X i " and "Y" as other column headings of the table, and and each variable X i , the sampling result corresponding to Y is used as the sampling data in the corresponding cell to generate a sample table. The data in the sample table is a sample set. The sample set includes each data object VARIABLE X i , variable Y and the corresponding sampling results.
[0104] Figure 5a Schematic diagram of the process of discovering causal meta-knowledge for the causal rule mining module. Figure 5a As shown, the causal rule mining module performs causal rule mining on the data in the sample table through the following steps S331-S333 to discover causal meta-knowledge.
[0105] S331, input the sample set / sample table into the PC-like algorithm, and output one or more second variables X and corresponding data objects that meet the requirements. The one or more second variables X that meet the requirements are variables X whose Y value is 1 when the sampling is successful.
[0106] The PC-like algorithm includes the PC model, the PC inference model, etc. For example, the sample table obtained in S324 is input into the trained PC-like algorithm, and the outputs X1, X2 and X 10 , and the corresponding data objects, X1, X2, and X 10 The sampling is successful and the value of Y corresponding to the data object in the real data set is 1.
[0107] S332: Determine the potential causes corresponding to one or more second variables X that meet the requirements as the causes of the target relationship expressed by the first variable Y.
[0108] For example, determine X1, X2 and X that meet the requirements 10 The indicated potential cause is the cause of the target relationship indicated by the first variable Y.
[0109] S333: Determine the causal rule according to the output of S331: the potential causes corresponding to one or more second variables X that meet the requirements are the causes of the target relationship expressed by the first variable Y.
[0110] Exemplarily, the causal rule is determined as follows: according to X1, X2 and / or X 10 The corresponding KGS can obtain the target relationship R h (C h ,C t ), R h (C h ,C t ) are entities and relations existing in the real dataset.
[0111] In determining the causal rules according to the output of S331, there are often structures with bidirectional relationships. Bidirectional relationships refer to structures corresponding to two potential causes in the knowledge graph being potential causes of each other. Figure 5b As shown, the relationship path between the two potential causes corresponding to X1 and X2 in the knowledge graph is:
[0112] KGS1={R 1,1 (C h ,C 1,1 ),R 1,2 (C 1,1 ,C 1,2 ),...,R 1,6 (C 1,5 ,C 1,6 )R 1,7 (C 1,6 ,C t )},
[0113] KGS2={R 1,1 (C h ,C 1,1 ),R 2,1 (C 1,1 ,C 2,1 ),R 2,2 (C 2,1 ,C 1,5 ),R 1,6 (C 1,5 ,C 1,6 ),R 1,7 (C 1,6 ,C t )}
[0114] In the process of causal relationship mining, the relationship paths of bidirectional relationships in the knowledge graph can be identified and processed through secondary inspection to map out the final causal rules.
[0115] In some possible implementations, the bidirectional relationship may be identified by operations between variables X1, X2, and Y:
[0116] X1⊥Y|X2 and X2⊥Y|X1 (8)
[0117] When the value of formula (8) is 1, KGS1 and KGS2 of the two relationship paths in the knowledge graph corresponding to variables X1 and X2 have a bidirectional relationship. The natural language description of formula (8) is that when both variables X1 and X2 are potential causes of Y, and the first variable X1 is the potential cause of the second variable X2, and the second variable X2 is the potential cause of the first variable X1, KGS1 and KGS2 of the two relationship paths in the knowledge graph corresponding to variables X1 and X2 have a bidirectional relationship. For bidirectional relationships, the conditional independence of each relationship path is determined, and the relationship paths that do not meet the conditional independence are eliminated to obtain the final causal rule.
[0118] For example, for the bidirectional edges KGS1 and KGS2, the conditional independence of each edge is determined, and the edge KGS2 that does not satisfy the conditional independence is eliminated. The final causal rule is: according to X1 and / or X 10 The corresponding KGS can obtain the target relationship R h (C h , C t ), and the target relation R h (C h , C t ) is an entity existing in the real dataset.
[0119] The above is an introduction to the causal meta-knowledge discovery system based on the knowledge graph provided in the embodiment of the present application. Next, based on the above-described content, the causal meta-knowledge discovery method based on the knowledge graph provided in the embodiment of the present application is introduced.
[0120] The causal meta-knowledge discovery method based on knowledge graph provided in the embodiment of the present application can be deployed in a server or a unified server cluster. The above-mentioned server generally refers to a general-purpose computer system installed with a mainstream operating system (Unix, Windows, etc.).
[0121] Figure 6 Flowchart of the method for causal meta-knowledge discovery based on knowledge graph provided in the embodiment of the present application. It can be understood that the method can be executed by any device, equipment, platform, or device cluster with computing and processing capabilities. In addition, some or all steps of the causal meta-knowledge discovery method based on knowledge graph can refer to the aforementioned Figure 2 - Related description in Figure 5. Figure 6As shown, the method for causal meta-knowledge discovery based on knowledge graph provided by the embodiment of the present application includes: S61, determining a first knowledge graph paradigm KGS according to the causal relationship of the knowledge graph, the first KGS including a head entity, a tail entity, and a target relationship between the head entity and the tail entity in the causal graph; the target relationship is a rule obtained from the structured causal relationship of the knowledge graph; determining a second KGS expressing a potential cause, the second KGS being a relationship path from the head entity to the tail entity in the knowledge graph, and the relationship path including multiple entities; S62, encoding the first KGS as a first variable, and encoding the second KGS as a second variable; S63, encoding a data object consisting of any two entities in the knowledge graph as a sample; the number of samples is a plurality of S64, sample each sample in the relationship path, and determine the value of the second variable according to the sampling result; the sampling result includes sampling success and sampling failure; when the sampling is successful, the value of the second variable is 1, and when the sampling fails, the value of the second variable is 0; S65, sample each sample in the real data set, and determine the value of the first variable according to the sampling result; when the sampling is successful, the value of the first variable is 1, and when the sampling fails, the value of the first variable is 0; S66, obtain the causal rule of the knowledge graph according to the sample and the corresponding values of the first and second variables, and the causal rule is: the relationship path corresponding to the second variable is the cause of the causal relationship expressed by the first KGS, and the head entity and tail entity of the first KGS are the data objects corresponding to the sample with successful sampling.
[0122] The embodiment of the present application proposes a causal meta-knowledge discovery method based on a knowledge graph. Through the causal discovery technology, the causal rules at the concept level of the knowledge graph are mined, the formal representation of the causal rules is determined, the structured facts in the knowledge graph are encoded as variables and samples, and causal rule mining is performed to mine explainable, reasonable, and generalizable causal rules at the concept level of the knowledge graph, which can achieve higher accuracy in root cause location and link prediction tasks.
[0123] In some embodiments, there are multiple relationship paths, and multiple relationship paths from the head entity to the tail entity are searched in the knowledge graph; a set of second KGS expressing multiple potential causes is obtained according to the multiple relationship paths. Further, the first KGS can be encoded as a first variable Y; each second KGS in the set of the second KGS of multiple potential causes is encoded as a variable X1, X2...X m .
[0124] In some feasible implementations, it is possible to traverse all paths of the knowledge graph within set constraints to obtain multiple potential causes, where the set constraints include set jumps, head entities, tail entities, etc., and each of the multiple potential causes is a subgraph that conforms to the causal knowledge graph.
[0125] In some achievable implementations, one or more relationship paths in a knowledge graph may be searched using a random walk algorithm, a depth-first algorithm, or a breadth-first search algorithm; wherein the input of the random walk algorithm, the depth-first algorithm, or the breadth-first search algorithm is a knowledge graph, and the output is one or more relationship paths from a head entity to a tail entity; and multiple second KGSs expressing the potential causes are determined based on the multiple relationship paths.
[0126] It should be noted that each of the samples is sampled in the real data set, and the value of the first variable is determined according to the sampling result, including: if the sampling is successful, the value of the first variable is true / 1, and if the sampling fails, the value of the first variable is false / 0. Each sample is sampled in the relationship path, and the value of the second variable is determined according to the sampling result, including: if the sampling is successful, the value of the second variable is true / 1, and if the sampling fails, the value of the second variable is false / 0. When the same sample is sampled successfully and the values of the first and second variables are both true / 1, the causal rules of the knowledge graph are obtained.
[0127] It can be understood that each sample is sampled in multiple relationship paths, and the value of the corresponding second variable is determined according to the sampling result of each sample in each relationship path. According to the data object corresponding to each sample, the value of the first variable Y, each second variable X1, X2...X m The sample table is generated by inputting the sample table into the PC-like algorithm, and one or more second variables satisfying the causal rule are output, and the one or more second variables satisfying the causal rule are the causes of the causal relationship expressed by the first KGS.
[0128] In some feasible implementations, a relationship path with a bidirectional relationship among one or more second variables that meet the requirements is identified; the conditional independence of each relationship path in the relationship path with the bidirectional relationship is determined, and an edge that does not meet the conditional independence is eliminated to obtain a final causal rule.
[0129] The causal meta-knowledge discovery method based on knowledge graph provided in the embodiment of the present application is applied to the knowledge mining module of the AI intelligent tool for knowledge graph. In the traditional knowledge graph link prediction task, the method of the embodiment of the present application has higher prediction accuracy than other baseline algorithms, especially in the task where the training data and the test data are not identically distributed.
[0130] The causal meta-knowledge discovery method based on knowledge graph proposed in the embodiment of the present application mines causal rules at the concept level of the knowledge graph through a causal rule discovery algorithm; determines the formal representation of causal rules, encodes structured facts in the knowledge graph as variables and samples, performs causal rule mining, and mines interpretable, reasonable, and generalizable causal rules at the concept level of the knowledge graph, which can achieve higher accuracy in root cause location and link prediction tasks.
[0131] The knowledge graph-based causal meta-knowledge discovery method proposed in the embodiment of the present application has higher prediction accuracy in traditional knowledge graph link prediction tasks than other baseline algorithms, especially in tasks where training data and test data are not identically distributed.
[0132] The causal meta-knowledge discovery method based on the knowledge graph provided in the embodiment of the present application converts the structured data of the knowledge graph into tabular data for causal discovery, and outputs the causal relationship between the subgraphs of the knowledge graph.
[0133] A large number of experiments conducted on simulated data sets and real-world data sets in the embodiments of the present application have demonstrated the effectiveness of causal rules. In particular, detailed analysis shows that the rules based on causal relationship mining have good interpretability.
[0134] The method for causal meta-knowledge discovery based on knowledge graph provided in the embodiment of the present application can be applied in scenarios including drug redirection knowledge mining, intelligent operation and maintenance, link prediction and root cause location, etc.
[0135] Example 1
[0136] Figure 7a-7c This is a schematic diagram of the method for causal meta-knowledge discovery based on knowledge graph in the drug redirection application scenario of Example 1 of the present application. Figure 7a A schematic diagram of potential cause mining in the drug redirection application scenario is given. Figure 7a As shown, the potential cause mining of the drug redirection knowledge graph can be achieved through the following steps S411-S413.
[0137] S411, obtain the knowledge graph paradigm according to the structured causal relationship of the knowledge graph of given drug redirection.
[0138] The structured causal relationship of the drug redirection knowledge graph can be determined with reference to step S311 as follows:
[0139] R b (Compound 1, Disease 1) → R h (Compound 1, Disease 1):w (9)
[0140] In formula (9), R b(Compound 1, Disease 1) is the relationship path in the drug redirection knowledge graph, R h (Compound 1, Disease 1) is the target relationship in the drug redirection knowledge graph. If the relationship path R in the knowledge graph b (Compound 1, Disease 1) can be obtained as R h (Compound 1, Disease 1) expression result, then R b (Compound 1, Disease 1) is R h (Compound 1, Disease 1) Cause. Figure 7a In the formula, compound 1 is the head entity that constitutes the potential cause, and disease 1 is the tail entity that constitutes the potential cause. h (Compound 1, Disease 1) represents the target relationship, Figure 7a In, R h The target relationship expressed by (Compound 1, Disease 1) is that Compound 1 treats Disease 1; “:w” represents the weight of the causal relationship, which is used to measure the strength of the impact.
[0141] Then, according to formula (9), the structured causal relationship modeling of the knowledge graph of drug redirection is obtained, and the knowledge graph paradigm corresponding to formula (2) is obtained as follows:
[0142] KGS=R(C h ,C t )
[0143] In Example 1 of the present application, KGS in formula (2) is a conceptual representation of the structured causal relationship in the knowledge graph of drug redirection, C h represent Figure 7a Compound 1; C t represent Figure 7a Disease 1 in the equation; R is the relationship function between compound 1 and disease 1.
[0144] Next, the paradigm of defining the target relationship according to the knowledge graph paradigm of formula (2) is shown in formula (3):
[0145] KGS0=R h (C h ,C t )
[0146] In Example 1 of the present application, the target relationship expressed by formula (3) is a rule obtained from the relationship path of the structured causal relationship of the knowledge graph: Compound 1 can treat disease 1.
[0147] S412, searching for at least one potential cause that meets the target relationship in the existing knowledge graph of drug redirection according to the knowledge graph paradigm of the target relationship, each potential cause is a structure from compound 1 to disease 1 in the knowledge graph, wherein each structure is a subgraph of the knowledge graph of drug redirection. The data of each structure includes one or more triples having a relationship from compound 1 to disease 1, and two adjacent triples are connected by a shared entity.
[0148] The potential causes may be searched by one of a random walk algorithm, a depth-first algorithm, or a breadth-first search algorithm. For example, the complete knowledge graph of drug redirection may be input into a breadth-first search algorithm, the breadth-first search algorithm outputs the causal relationship between the subgraphs of the knowledge graph, and a plurality of potential causes are obtained according to the causal relationship between the subgraphs of the knowledge graph.
[0149] like Figure 7a As shown, according to the target relationship paradigm of formula (3), compound 1 is taken as the head entity and disease 1 is taken as the tail entity, and multiple relationship paths from compound 1 to disease 1 in the structure of the given drug redirection knowledge graph are traversed and searched. Each relationship path includes multiple triples, such as: R b,1 = {R 1,1 (C h ,C 1,1 ),R 1,2 (C 1,1 ,C t )}, where C 1,1 Represents gene 1, R 1,1 (C h ,C 1,1 ) represents that compound 1 has a binding relationship with gene 1, R 1,2 (C 1,1 ,C t ) indicates that gene 1 is associated with disease 1; R b,2 = {R 2,1 (C h ,C 2,1 ),R 2,2 (C 2,1 ,C t ,)}, where C 2,1 Represents disease 2, R 2,1 (C h ,C 2,1 ) represents that compound 1 can treat disease 2, R 2,2 (C 2,1 ,C 2,2 ) means that disease 2 is similar to disease 1 (resemble); ... and so on, R b,k = {R1,1 (C h ,C 1,1 ),R k,2 (C 1,1 ,C k,2 ,),R k,3 (C k,2 ,C t ,)}, where C k,2 Represents gene 2, R k,2 (C 1,1 ,C k,2 ) indicates that gene 1 is upregulated by compound 2, R k,3 (C k,2 ,C t ,) represents compound 2 for treating disease 1. b,1 , R b,2 , … R b,k as potential reasons.
[0150] S413, according to R b,1 , R b,2 …R b,k , and obtain the KGS set of potential causes.
[0151] R b,1 , R b,2 …R b,k Expressed as KGS, the KGS set of potential causes is as follows:
[0152]
[0153] Formula (12) includes the KGS of k potential causes.
[0154] S414, encode the target relationship KGS and the KGS set of potential causes into variables respectively to obtain a variable set.
[0155] In Example 1 of the present application, KGS0 of the target relationship in the knowledge graph is encoded as variable Y, and KGS1, KGS2...KGS of the potential causes corresponding to each relationship path are encoded as k Encoded as variables X1, X2…X k , and the variable set is:
[0156]
[0157] In formula (13), when Y = 0, it means that the expression of the target relationship "Compound 1 treats disease 1" in the real data set is not established, and when Y = 1, it means that the expression of the target relationship "Compound 1 treats disease 1" in the real data set is established; the first potential cause R b,1The KGS1 code of "Compound 1 binds to gene 1, and gene 1 is associated with disease 1" is X1. When X1=0, it means that the first potential cause does not exist, and when X1=1, it means that the first potential cause exists. The KGS2 code of the second potential cause "Compound 1 treats disease 2, and disease 2 is similar to disease 1" is X2. When X2=0, it means that the second potential cause does not exist, and when X2=1, it means that the second potential cause exists. ... and so on, the KGS of the kth potential cause "Compound 1 binds to gene 1, compound 2 on gene 1, and compound 2 treats disease 1" k Coded as X k , X k = 0 means that the kth potential cause does not exist, X k =1 indicates that the kth potential cause exists.
[0158] Figure 7b A flow chart for sample generation in the drug redirection application scenario is given. Figure 7b As shown, the data object in the drug redirection application scenario is an entity pair. Step S421 determines one of the multiple entity pairs as (compound 1, disease 1) according to the target relationship of drug redirection. S422 determines the sampling rule of drug redirection according to the mapping of the entity pair (compound 1, disease 1) to each variable in the variable set. S423 samples in the knowledge graph of drug redirection according to the sampling rule, obtains the sampling result, and generates a sample table. Steps S421-S423 are further described below.
[0159] S421, define compound 1 as head data e h , disease 1 is defined as the tail data e t . Determine multiple entity pair sets based on the KGS0 of the target relationship, each entity pair includes header data e h and tail data e t The specific implementation method may refer to step S321, which will not be described in detail here.
[0160] S422, determining a sampling rule according to the mapping of entity pairs to variable sets, which can be expressed by formula (6) and formula (7).
[0161] In Example 1 of the present application, the data object is a plurality of sets of entity pairs in the drug redirection application scenario. The sampling rule of formula (6) can be defined as: Where N = 1, 2, 3, ... k. The corresponding structure data R in the knowledge graph of drug redirection b,1 , R b,2 …R b,k The sample includes the relationship path between compound N and disease N. If the sampling is successful, the variable X i Assign a value of 1. If sampling fails, the variable Xi Assign a value of 0.
[0162] The sampling rule of formula (7) can be defined as: in the real data set, when "compound N treats disease N" is true, then Y=1; when "compound N treats disease N" is not true, then Y=0.
[0163] S423, sampling in the knowledge graph according to the sampling rules, obtaining sampling results, and Variable set X i , entity variable Y and sampling results generate a sample table. In Example 1 of the present application, based on the sampling rule of step S422, sampling is performed in the knowledge graph subgraph corresponding to each variable to obtain a sampling result, which includes sampling success or sampling failure. Under the condition of successful sampling, the corresponding variable X i Assign a value of 1. If sampling fails, the corresponding variable X i Assign a value of 0.
[0164] When sampling in a real data set, if "Compound N treats Disease N" is true, then Y=1; if "Compound N treats Disease N" is not true, then Y=0.
[0165] In Example 1 of the present application, “Entity Pair” can be used as the first title of the table, and the variable name “X i " and "Y" as the other column headings of the table, and and each variable X i , the sampling result corresponding to Y is used as the sampling data in the corresponding cell to generate a sample table. The data in the sample table is a sample set, which includes entity pairs, cause variables X i , entity variables Y and sampling results.
[0166] Potential cause mining in the drug redirection application scenario includes the following steps S431-S432.
[0167] S431, input the sample set of drug redirection into the trained causal rule discovery algorithm, and the output variables are X1 and X k , for X1 and X k It is the causal variable that satisfies sampling success and the value of Y is 1.
[0168] In Example 1 of the present application, the causal rule discovery algorithm may be a PC-like algorithm. The sample set will include Cause variable X i , sample Y and the sample set / sample table of sampling results are input into the trained PC-like algorithm, and the output is X1 and X k , X1 corresponds to KGS1 and Xk Corresponding to KGS k . It can be seen that the entity pair (compound 1, disease 1) is successfully sampled in the knowledge graph, and the entity pair sample exists in KGS1 = {R 1,1 (C h ,C 1,1 ),R 1,2 (C 1,1 ,C t )} and KGS k = {R k,1 (C h ,C k,1 ),R k,2 (C k,1 ,C k,2 ,),R k,3 (C k,2 ,C t ,)}In both relationship paths, “Compound 1 treats disease 1” is true in the real data set, satisfying the target relationship that the value of Y is 1.
[0169] S432, determine the causal rule as follows: determine the target relationship R according to KGS1 corresponding to the cause variable X1 h (C h , C t ) and according to the cause variable X k Corresponding KGS k Determine the target relationship R h (C h , C t ).
[0170] For example, the causal rule is determined as follows: and / or Determine the corresponding KGS1 and / or KGS k The structure in the corresponding knowledge graph of drug redirection can obtain "Compound 1 treats disease 1".
[0171] The above embodiment 1 provides a process for identifying complex knowledge production and reasoning based on a given knowledge graph in a drug redirection application scenario. In the knowledge graph of drug redirection, there are relationship paths with bidirectional relationships. In this case, the relationship paths of the bidirectional relationships in the knowledge graph can be identified and processed through secondary inspection to map out the final causal rules.
[0172] Figure 7c A schematic diagram of identifying bidirectional relationships in drug redirection application scenarios is given. Figure 7c As shown in the figure, the relationship paths corresponding to the two potential causes in the knowledge graph in the drug redirection application scenario:
[0173] KGS2={R 2,1 (C h ,C 2,1 ),R 2,2 (C 2,1 ,C t ,)} and KGS k = {R k,1 (C h ,C k,1 ),R k,2 (C k,1 ,C k,2 ,),R k,3 (C k,2 ,C t ,)};
[0174] The variables X2 and KGS corresponding to KGS2 k The corresponding variable X k Substituting into formula (8), we get formula (9):
[0175] X k ⊥Y|X2 and X2⊥Y|X k (9)
[0176] According to formula (9), the bidirectional relationship is determined: when two variables X k X2 and X3 are both the cause variables of sample Y, and X k is the causal variable of X2, and X2 is X k When the cause variable is X k , X2 has a bidirectional relationship.
[0177] For a bidirectional relationship X k and X2, determine the conditional independence of each relationship path, and when X2 does not satisfy the conditional independence, eliminate X2 that does not satisfy the conditional independence to obtain the final causal rule.
[0178] After the second test, the final causal rule is: according to X1 and / or X k The corresponding KGS can obtain the target relation Rh(Ch, Ct), and the target relation Rh(Ch, Ct) is an entity existing in the real data set.
[0179] The method of causal meta-knowledge discovery based on knowledge graph in the embodiment of the present application can also be applied in the recommendation search field, using the knowledge graph to mine the user's potential preferences. For example, the method provided in the embodiment of the present application is used to mine the user's potential preferences based on massive historical data, such as the preferred actors, movies, and basic information of the movies including directors, types (including action, literature, science fiction, history, fairy tales, etc.), as well as the relationship paths of the knowledge graph, and the user preference recommendations are made on the application recommendation data set, and the recommendation results obtained have strong interpretability and accuracy.
[0180] Next, a causal meta-knowledge discovery device based on knowledge graph provided in an embodiment of the present application is introduced. Figure 6 The model training method described in is proposed.
[0181] Figure 8 A schematic diagram of a causal meta-knowledge discovery device based on a knowledge graph is provided in an embodiment of the present application. Figure 8 As shown, the causal meta-knowledge discovery device 800 based on the knowledge graph includes:
[0182] The potential cause mining module 81 determines a first knowledge graph paradigm KGS according to the causal relationship of the knowledge graph, wherein the first KGS includes a head entity, a tail entity, and a target relationship between the head entity and the tail entity in the causal graph; the target relationship is a set relationship between the head entity and the tail entity; determines a second KGS expressing the potential cause, wherein the second KGS is a relationship path from the head entity to the tail entity in the knowledge graph, and the relationship path includes multiple entities; encodes the first KGS as a first variable, and encodes the second KGS as a second variable; encodes a data object consisting of any two entities in the knowledge graph as a sample; and the number of samples is multiple;
[0183] The sample generation module 82 samples each sample in the relationship path and determines the value of the second variable according to the sampling result; the sampling result includes sampling success and sampling failure; when the sampling is successful, the value of the second variable is 1, and when the sampling fails, the value of the second variable is 0; samples each sample in the real data set and determines the value of the first variable according to the sampling result; when the sampling is successful, the value of the first variable is 1, and when the sampling fails, the value of the first variable is 0;
[0184] The causal relationship mining module 83 obtains the causal rules of the knowledge graph according to the samples and the corresponding values of the first and second variables. The causal rules are: the relationship path corresponding to the second variable is the cause of the causal relationship expressed by the first KGS, and the head entity and tail entity of the first KGS are the data objects corresponding to the successfully sampled samples.
[0185] It should be understood that the above-mentioned device is used to execute the method in the above-mentioned embodiment. The implementation principle and technical effect of the corresponding program module in the device are similar to those described in the above-mentioned method. The working process of the device can refer to the corresponding process in the above-mentioned method, which will not be repeated here.
[0186] In some embodiments, Figure 8 The potential cause mining module 81, the sample generation module 82 and the causal relationship mining module 83 shown in the figure can be implemented by software or hardware. Figure 8 Taking the potential cause mining module 81 shown in FIG. 8 as an example, the implementation method of the potential cause mining module 81 of the acquisition module is introduced.
[0187] As an example of a software functional unit, the potential cause mining module 81 may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned computing instance may be one or more. For example, the potential cause mining module 81 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code can be distributed in the same region (region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code can be distributed in the same availability zone (AZ) or in different AZs, each AZ including a data center or multiple data centers with similar geographical locations. Among them, usually a region can include multiple AZs.
[0188] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.
[0189] As an example of a hardware functional unit, the potential cause mining module 81 may include at least one computing device, such as a server, etc. Alternatively, the potential cause mining module 81 may also be a device implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
[0190] The multiple computing devices included in the potential cause mining module 81 can be distributed in the same region or in different regions. The multiple computing devices included in the potential cause mining module 81 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the potential cause mining module 81 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0191] It should be noted that, in other embodiments, the potential cause mining module 81 can be used to execute any step in the method shown in FIG. 5 . Figure 8 The potential cause mining module 81 shown in FIG. 5 can be used to execute any step in the method provided in the above-mentioned FIG. 5 . Figure 8 The steps implemented by the potential cause mining module 81, the sample generation module 82 and the causal relationship mining module 83 shown in FIG. 8 can be specified as needed, and the potential cause mining module 81, the sample generation module 82 and the causal relationship mining module 83 respectively implement the above steps. Figure 6 The different steps in the method provided in the embodiment can realize all functions of the causal meta-knowledge discovery device 800 based on the knowledge graph.
[0192] The present application also provides a computing device 1000. Fig. 9 As shown, computing device 1000 includes: bus 1002, processor 1004, memory 1006 and communication interface 1008. Processor 1004, memory 1006 and communication interface 1008 communicate through bus 1002. Computing device 1000 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in computing device 1000.
[0193] The bus 1002 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 The bus 1004 may include a path for transmitting information between various components of the computing device 1000 (eg, the memory 1006, the processor 1004, and the communication interface 1008).
[0194] The processor 1004 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0195] The memory 1006 may include a volatile memory, such as a random access memory (RAM). The processor 104 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0196] The memory 1006 stores executable program codes, and the processor 1004 executes the executable program codes to respectively implement the aforementioned Figure 8 The functions of the potential cause mining module 81, the sample generation module 82 and the causal relationship mining module 83 shown in the embodiment are implemented to realize all or part of the steps of the method in the above embodiment. That is, the memory 1006 stores instructions for executing all or part of the steps in the method in the above embodiment.
[0197] Alternatively, the memory 1006 stores executable codes, and the processor 1004 executes the executable codes to respectively implement the functions of the configuration migration device 1000, thereby implementing all or part of the steps in the above embodiment method. That is, the memory 1006 stores instructions for executing all or part of the steps in the above embodiment method.
[0198] The communication interface 1003 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 100 and other devices or a communication network.
[0199] The embodiment of the present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.
[0200] like Fig.10 As shown, the computing device cluster includes at least one computing device 1000. The memory 1006 in one or more computing devices 1000 in the computing device cluster may store the same instructions for executing all or part of the steps in the above embodiment method.
[0201] In some possible implementations, the memory 1006 of one or more computing devices 1000 in the computing device cluster may also store partial instructions for executing all or part of the steps in the above-mentioned embodiment method. In other words, the combination of one or more computing devices 1000 may jointly execute instructions for executing all or part of the steps in the above-mentioned embodiment method.
[0202] It should be noted that the memory 1006 in different computing devices 1000 in the computing device cluster can store different instructions, which are respectively used to execute part of the functions of the causal meta-knowledge discovery device 800 based on the knowledge graph. That is, the instructions stored in the memory 1006 in different computing devices 1000 can implement the aforementioned Figure 8 The functions of one or more of the potential cause mining module 81, sample generation module 82 and causal relationship mining module 83 shown in FIG.
[0203] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network.
[0204] Based on the method in the above embodiment, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method in the above embodiment.
[0205] Based on the method in the above embodiment, an embodiment of the present application provides a computer program product. When the computer program product runs on a processor, the processor executes the method in the above embodiment.
Claims
1. A causal meta-knowledge discovery method based on knowledge graph, characterized in that: The method comprises: Determine a first knowledge graph paradigm KGS according to the causal relationship of the knowledge graph, wherein the first KGS includes a head entity, a tail entity, and a target relationship between the head entity and the tail entity in the causal graph; the target relationship is a rule obtained from the structured causal relationship of the knowledge graph; Determine a second KGS for expressing a potential cause, where the second KGS is a relationship path from the head entity to the tail entity in the knowledge graph, where the relationship path includes a plurality of entities; Encode the first KGS as a first variable, and encode the second KGS as a second variable; Encode a data object consisting of any two entities in the knowledge graph as a sample; the number of the samples is multiple; Sampling each of the samples in the relationship path, and determining the value of the second variable according to the sampling result; the sampling result includes sampling success and sampling failure; Sampling each of the samples in the real data set, and determining the value of the first variable according to the sampling result; The causal rule of the knowledge graph is obtained according to the sample and the corresponding values of the first and second variables, and the causal rule is: the potential cause corresponding to the second variable is the cause of the target relationship expressed by the first KGS, and the head entity and the tail entity of the first KGS are the data objects corresponding to the sample that has been successfully sampled.
2. The method according to claim 1, characterized in that The number of the relationship paths is multiple, and determining the second KGS that expresses potential causes includes: searching for multiple relationship paths from the head entity to the tail entity in the knowledge graph; and obtaining a set of second KGS that expresses multiple potential causes based on the multiple relationship paths.
3. The method according to claim 2, characterized in that The searching for multiple relationship paths from the head entity to the tail entity in the knowledge graph includes: within set constraints, traversing all paths of the knowledge graph to obtain multiple potential causes, wherein the set constraints include set jumps, head entities, and tail entities.
4. The method according to claim 2 or 3, characterized in that: The step of encoding the first KGS into a first variable and encoding the second KGS into a second variable comprises: Encode the first KGS into a first variable Y; Each second KGS in the set of the plurality of potential causes of the second KGS is encoded as a variable X1, X2, ..., X m .
5. The method according to any one of claims 1 to 4, characterized in that: The second KGS for determining the potential cause of expression comprises: Searching for a relationship path in the knowledge graph by using a random walk algorithm, a depth-first algorithm, or a breadth-first search algorithm; The input of the random walk algorithm, the depth-first algorithm or the breadth-first search algorithm is the knowledge graph, and the output is a plurality of relationship paths from the head entity to the tail entity; A plurality of second KGSs expressing the potential causes are determined according to the plurality of relationship paths.
6. The method according to any one of claims 1 to 5, characterized in that: The step of sampling each of the samples in the real data set and determining the value of the first variable according to the sampling result includes: When the sampling is successful, the value of the first variable is true / 1, and when the sampling fails, the value of the first variable is false / 0.
7. The method according to any one of claims 1 to 6, characterized in that: Sampling each of the samples in the relationship path, and determining the value of the second variable according to the sampling result, includes: If the sampling is successful, the value of the second variable is true / 1, and if the sampling fails, the value of the second variable is false / 0.
8. The method according to any one of claims 1 to 7, characterized in that: When the same sample is sampled successfully and the values of the first and second variables are both true / 1, the causal rules of the knowledge graph are obtained.
9. The method according to any one of claims 1 to 8, characterized in that: The method further comprises: According to the data object, the value of the first variable Y, a plurality of second variables X1, X2, ...X m , generate a sample table or sample set.
10. The method according to any one of claims 9, characterized in that: The method further comprises: The sample table is input into the PC-like algorithm, and one or more second variables that meet the requirements are output, where the one or more second variables that meet the requirements are the causes of the target relationship indicated by the first variable Y for the corresponding potential causes.
11. The method according to any one of claims 1 to 10, characterized in that: The method further comprises: Identifying a relationship path having a bidirectional relationship among the one or more second variables that meet the requirements; The conditional independence of each relationship path in the relationship path with the bidirectional relationship is determined, and a relationship path that does not satisfy the conditional independence is eliminated to obtain a final causal rule.
12. A causal meta-knowledge discovery device based on knowledge graph, comprising: A potential cause mining module is used to determine a first knowledge graph paradigm KGS according to the causal relationship of the knowledge graph, wherein the first KGS includes a head entity, a tail entity, and a target relationship between the head entity and the tail entity in the causal graph; the target relationship is a rule obtained from the structured causal relationship of the knowledge graph; determine a second KGS expressing a potential cause, wherein the second KGS is a relationship path from the head entity to the tail entity in the knowledge graph, and the relationship path includes multiple entities; encode the first KGS as a first variable, and encode the second KGS as a second variable; A sample generation module, used for encoding a data object consisting of any two entities in the knowledge graph as a sample; the number of the samples is multiple; sampling each of the samples in the relationship path, and determining the value of the second variable according to the sampling result; the sampling result includes sampling success and sampling failure; Sampling each of the samples in the real data set, and determining the value of the first variable according to the sampling result; A causal relationship mining module is used to obtain the causal rules of the knowledge graph according to the sample and the corresponding values of the first and second variables, wherein the causal rules are as follows: the potential cause corresponding to the second variable is the cause of the target relationship expressed by the first KGS, and the head entity and tail entity of the first KGS are data objects corresponding to the successfully sampled samples.
13. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 11.
14. A computing device comprising a memory and a processor, characterized in that: The memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 11 is implemented.
Citation Information
Cited By
Multi-dimensional information integration and intelligent query method for immigrant archives
CN121456016A
Method and device for constructing a causal knowledge graph of complications of silicone gel implant radiotherapy
CN122797696A