Method and apparatus for discovering causal metaknowledge on basis of knowledge graph

By formally representing causal rules in the knowledge graph and constructing a causal rule discovery algorithm, the problem that the existing technology cannot explain the process of knowledge generation is solved, and the causal rule mining of the knowledge graph is realized, and the accuracy in the application of knowledge graph is improved.

WO2025025582A1PCT designated stage expired Publication Date: 2025-02-06HUAWEI TECH CO LTD +1

Patent Information

Application Number
PCT/CN2024/078593
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-07-28
Filing Date
2024-02-26
Publication Date
2025-02-06

AI Technical Summary

Technical Problem

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.

Method used

By formally representing causal rules in the knowledge graph and encoding structures into variables and samples, a causal rule discovery algorithm is constructed, and the causal relationship in the knowledge graph is learned, thereby explaining the process of knowledge generation.

Benefits of technology

The mining of interpretable, reasonable, and generalizable causal rules at the knowledge graph concept level is realized, and the accuracy of root cause positioning and link prediction is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024078593_06022025_PF_FP_ABST
    Figure CN2024078593_06022025_PF_FP_ABST
Patent Text Reader

Abstract

A method for discovering causal metaknowledge on the basis of a knowledge graph. The method comprises: determining a first knowledge graph schema (KGS), wherein the first KGS comprises a head entity, a tail entity and a target relationship between the head entity and the tail entity, and the target relationship is a set relationship between the head entity and the tail entity; determining a second KGS, wherein the second KGS is a relationship path in a knowledge graph, and the relationship path comprises a plurality of entities; encoding the first KGS into a first variable, and encoding the second KGS into a second variable; encoding into a sample a data object composed of any two entities in the knowledge graph; performing, in the relationship path, sampling on each sample, and determining the value of the second variable on the basis of a sampling result, wherein the sampling result indicates a sampling success or a sampling failure; performing, in a real data set, sampling on each sample, and determining the value of the first variable on the basis of a sampling result; and on the basis of the sample and the corresponding values of the first and second variables, obtaining a causal rule of the knowledge graph.
Need to check novelty before this filing date? Find Prior Art

Description

A method and device for causal meta-knowledge discovery based on knowledge graph

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on July 28, 2023, with application number 202310944037.9 and application name “A method and device for causal meta-knowledge discovery based on knowledge graph”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of artificial intelligence, and in particular to a method and apparatus for causal meta-knowledge discovery based on knowledge graphs. Background Art

[0003] The explosive growth of information in recent years has led to the ever-increasing scale of current knowledge graphs, which in turn increases the burden on people to understand and utilize the real-world physical laws hidden behind surface facts. Consequently, metaknowledge has emerged. Metaknowledge, defined as knowledge about knowledge, can be used to identify the complex processes of knowledge production and reasoning. Although current research on knowledge graphs has extracted rule-based metaknowledge through association-based rule mining methods, these methods cannot explain the knowledge generation process.

[0004] Summary of the Invention

[0005] 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 knowledge graphs, formally represent causal rules through the knowledge graph paradigm (KGS), encode the structure in the knowledge graph as variables and samples, and construct a causal rule discovery algorithm based on these variables and samples. The algorithm is used to learn the causal relationship between KGSs, explain the generation of knowledge from the perspective of causal relationships, reveal the interactions between components in complex systems, and generalize causal rules.

[0006] 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 the 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 being 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, 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 being multiple; sampling each sample in the relationship path, and determining the value of the second variable according to the sampling result; the sampling result comprising successful sampling and failed sampling; sampling each sample in a real data set, and determining the 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 tail entity of the first KGS are the data objects corresponding to the sample of successful sampling.

[0007] 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 the 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.

[0008] As a feasible 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.

[0009] 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 concept-level 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 test data are not identically distributed.

[0010] 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, head entity, and tail entity.

[0011] 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.

[0012] 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 a variable X1, X2...X m .

[0013] 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.

[0014] As a feasible implementation method, determining the second KGS expressing potential causes includes: searching for relational 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 multiple relational paths from a head entity to a tail entity; and determining multiple second KGS expressing potential causes based on the multiple relational paths.

[0015] 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 search efficiency, accuracy and pertinence.

[0016] As a feasible implementation method, each sample is sampled in a real data set, 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.

[0017] 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.

[0018] As a feasible 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.

[0019] 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 causal rules. The mined causal rules have stronger interpretability and accuracy.

[0020] As an achievable implementation method, the method further includes: 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 based on the value of .

[0021] In this way, the method provided in the embodiment of the present application innovatively transforms the structured data of the knowledge graph into tabular data for causal discovery, and the intermediate results can be obtained through decompilation and other technologies.

[0022] 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.

[0023] 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 structured facts in the knowledge graph, and mines out explainable, inferable, and generalizable causal rules at the conceptual level of the knowledge graph.

[0024] 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.

[0025] In this way, the method provided in the embodiment of the present application uses AI intelligent algorithms 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. In this way, causal rule mining can be realized on the sample set, the causal relationship between different relationship paths can be identified, and causal meta-knowledge can be discovered.

[0026] As a feasible implementation method, the method also includes: identifying a relationship path with a bidirectional relationship among one or more second variables that meet the requirements; judging 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.

[0027] In this way, the method provided in the embodiment of the present application identifies and processes the bidirectional relationship through secondary verification to obtain the final causal rule.

[0028] In a 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 for determining a first knowledge graph paradigm KGS based on 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 the potential cause, the second KGS being a relationship path from the head entity to the tail entity in the knowledge graph, the relationship path including multiple entities; encoding the first KGS as a first variable, and encoding the second KGS as a second variable; a sample generation module , used to encode a data object consisting 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 based on the sampling result; the sampling results include sampling success and sampling failure; each sample is sampled in the real data set, and the value of the first variable is determined based on the sampling result; the causal relationship mining module is used to obtain the causal rules of the knowledge graph based on the samples and the corresponding values ​​of the first and second variables. 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 successfully sampled samples. Its beneficial effects are similar to those of the first aspect and are not further described here.

[0029] In a third aspect, embodiments of the present application provide a computer-readable storage medium for storing a computer program. When the computer program is executed on a computer, the computer performs any of the methods described in the first aspect. The beneficial effects thereof are similar to those of the first aspect and are not further described here.

[0030] In a fourth aspect, embodiments of the present application provide a computing device comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method according to any one of the first aspects is implemented. The beneficial effects thereof are similar to those of the first aspect and are not further described here. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the technical solutions of the multiple embodiments disclosed in this specification, the following will briefly introduce the drawings required for the description of the embodiments. 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 any creative work.

[0032] The following is a brief introduction to the drawings required for describing the embodiments or prior art.

[0033] Figure 1a is a schematic diagram of a triple of the knowledge graph provided in an embodiment of the present application;

[0034] FIG1b is a schematic diagram of an entity of a knowledge graph provided in an embodiment of the present application;

[0035] FIG2 is an architecture diagram of a causal meta-knowledge discovery system based on a knowledge graph proposed in an embodiment of the present application;

[0036] Figure 3a is a schematic diagram of the process of modeling causal relationships by the potential cause mining module;

[0037] Figure 3b is a schematic diagram of a relationship path in the knowledge graph;

[0038] FIG4 is a schematic diagram of the process of generating a sample set by the sample generation module;

[0039] FIG5 a is a schematic diagram of the process of discovering causal rules by the causal rule mining module;

[0040] Figure 5b is a schematic diagram of the bidirectional relationship between two potential causes in the knowledge graph;

[0041] FIG6 is a flow chart of a method for causal meta-knowledge discovery based on a knowledge graph provided in an embodiment of the present application;

[0042] FIG7 a is a schematic diagram of potential cause mining in a drug redirection application scenario;

[0043] FIG7 b is a flowchart of sample generation in a drug redirection application scenario;

[0044] FIG7 c is a schematic diagram of identifying bidirectional relationships in a drug redirection application scenario;

[0045] FIG8 is a schematic diagram of a causal meta-knowledge discovery device based on a knowledge graph according to an embodiment of the present application;

[0046] FIG9 is a schematic diagram of a computing device provided in an embodiment of the present application;

[0047] FIG10 is a schematic diagram of a computing device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] 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 construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary," "for example," or "for example" is intended to present the relevant concepts in a concrete manner.

[0049] In the description of the embodiments of this application, the term "and / or" is simply a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent the following three situations: A exists alone, B exists alone, and A and B exist at the same time. In addition, unless otherwise specified, the term "plurality" means two or more. For example, "multiple systems" refers to two or more systems, and "multiple terminals" refers to two or more terminals.

[0050] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly identifying the technical features being referred to. Thus, features specified as "first" or "second" may explicitly or implicitly include one or more of such features. The terms "include," "comprising," "having," and their variations all mean "including but not limited to," unless otherwise specifically emphasized.

[0051] 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.

[0052] 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.

[0053] 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 must be executed in this manner. If permitted, the order of the previous and next steps can be interchanged, or they can be executed simultaneously.

[0054] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0055] Related terms involved in the embodiments of this application:

[0056] A knowledge graph (KG) is a structured semantic knowledge base used to symbolically describe concepts and their relationships in the physical world. Its basic building blocks are "entity-relationship-entity" triples, as well as entity and related attribute-value pairs. Entities are connected through relationships, forming a network-like knowledge structure. In a knowledge graph, a triple (h, r, t) is typically used to represent the existence of a relationship r between entity h and entity t, with h pointing to r. The triple (h, r, t) is the smallest knowledge unit in a knowledge graph. Figure 1a shows a triple in a knowledge graph. Circles represent entities, representing the head entity h and the tail entity t, respectively. The line connecting them is an edge, representing a relationship, and arrows point from the head entity to the tail entity t. The triple in Figure 1b can be expressed in natural language as "** actor starred in ## movie." Each entity also has attributes. For example, the tail entity "## movie" can include basic information such as release date, film genre, and number of episodes.

[0057] Metaknowledge is knowledge about knowledge, which is used to identify complex processes of knowledge production and reasoning.

[0058] Knowledge Graph Schema (KGS) is a formal representation of causal rules in knowledge graphs.

[0059] Causal algorithm (Peter Spirtes and Clark Glymour, PC) is an algorithm that finds causal rules from observation data.

[0060] 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 with reference to the accompanying drawings.

[0061] One of the solutions related to knowledge generation is the logical rule mining method, which can be divided into two categories: supervised and unsupervised. Among them, supervised methods use RNN models, matrix decomposition and other methods to construct differentiable logical rule models. By sampling some triples from the knowledge graph, the data obtained is used as supervisory information to learn the parameters of the logical rule model. After training, the model is reversed to generate interpretable inference rules. Unsupervised methods iteratively mine legend rules based on the knowledge base using 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 inference rules being unable to generalize.

[0062] The second approach to knowledge generation is the relational causal model. The basic idea behind the relational causal model is the only known work on causal relationship mining in relational data. It focuses on the characteristics of entities and relationships within certain relational structures, and uses conditional independence relationships between data to mine causal relationships. While the relational causal model assumes that the structural relationships of the data are known, it learns the causal relationships between entity features. However, research on the causal relationships between the structures of entities remains unexplored.

[0063] 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 causal relationship, and reveal the interaction between components in complex systems.

[0064] For example, Figure 2 shows an architecture diagram of a causal meta-knowledge discovery system based on a knowledge graph, as proposed in an embodiment of the present application. As shown in Figure 2 , the system includes: a potential cause mining module 21 , a sample generation module 22 , and a causal relationship mining module 23 .

[0065] The potential cause mining module 21 is primarily used to determine a first knowledge graph paradigm (KGS) based on the causal relationships of the knowledge graph. The first KGS includes the head entity, tail entity, and target relationship between the head and tail entities in the causal graph; the target relationship is the relationship between the head and tail entities. It also determines a second KGS expressing 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. The first KGS is encoded as a first variable, and the second KGS is encoded as a second variable. This allows for modeling of structured causal relationships in the knowledge graph.

[0066] The sample generation module 22 is primarily used to encode data objects consisting of any two entities in the knowledge graph as samples; the number of samples is multiple; each sample is sampled in the relationship path, and the value of the second variable is determined based on the sampling result; the sampling results include sampling success and sampling failure; the value of the second variable is 1 when the sampling is successful, and the value of the second variable is 0 when the sampling fails; each sample is sampled in the real data set, and the value of the first variable is determined based on the sampling result; the value of the first variable is 1 when the sampling is successful, and the value of the first variable is 0 when the sampling fails. This allows the structured data of the knowledge graph to be converted into a sample set or sample table.

[0067] The causal relationship mining module 23 is primarily used to derive causal rules from the knowledge graph based on samples and the corresponding values ​​of first and second variables. The causal rules are as follows: the relationship path corresponding to the second variable is the cause of the causal relationship expressed by the first KGS, and the head and tail entities of the first KGS are the data objects corresponding to the successfully sampled samples. This allows causal rule mining to be performed on a sample set, identifying causal relationships between different relationship paths and discovering causal meta-knowledge.

[0068] Figure 3a is a schematic diagram of the process of modeling causal relationships by the potential cause mining module. As shown in Figure 3a, the potential cause mining module models the structured causal relationships of the knowledge graph through the following steps S311-S313.

[0069] S311, obtain the knowledge graph paradigm KGS based on the structured causal relationship of the knowledge graph.

[0070] First, determine the structured causal relationship of the knowledge graph as: S C (v h,C ,v t,C )→S E (v h,E ,v t,E ):w (1)

[0071] 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. S 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 make up 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.

[0072] 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 that constitutes 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 .

[0073] 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.

[0074] Then, according to formula (1), the structured causal relationship of the knowledge graph is modeled as: KGS = R(C h ,C t ) (2)

[0075] In formula (2), KGS is the knowledge graph paradigm, which is the conceptual representation of the causal relationship structured in the knowledge graph. h is 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): KGS0 = R h (C h ,C t ) (3)

[0077] 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.

[0078] 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. 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.

[0079] 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. As shown in Figure 3b, 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 tail entity C t One or more relationship paths, each relationship path includes a relationship from the head entity C h To the end entity C t There are multiple triples with relationships 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.

[0080] In some feasible implementations, all paths of the knowledge graph can be traversed 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.

[0081] In some possible implementations, a random walk algorithm, a depth-first search algorithm, or a breadth-first search algorithm is used to search for multiple potential causes in a given knowledge graph. The input of the random walk algorithm, the depth-first search 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. Multiple second KGSs expressing the potential causes are determined based on the multiple relationship paths.

[0082] S313: Based on at least one potential cause in the knowledge graph that matches the target relationship, a KGS set of potential causes is obtained. The KGS set of potential causes includes one or more relationship paths that match the target relationship paradigm. The KGS set of potential causes can be recorded as a second KGS.

[0083] The data of one or more relationship paths are represented as KGS, and the KGS set of potential causes is obtained as follows:

[0084] Formula (4) includes the KGS of m potential causes, l1, l2…lm are the number of entities in each relationship path.

[0085] 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.

[0086] 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:

[0087] 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. m = 0, indicating that the mth potential cause does not exist, X m =1 indicates that the mth potential cause exists.

[0088] Figure 4 is a schematic diagram of the sample generation module's sample set generation process. As shown in Figure 4, the sample generation module generates a sample set based on the structured data of the knowledge graph through steps S321-S323.

[0089] 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

[0090] 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.

[0091] The sampling rule can be expressed by the following formula:

[0092] The sampling rule of formula (6) is: for each data object corresponding to a sample in the relationship path Perform sampling and determine the second variable X 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 is 1, when sampling fails, the second variable X i The value of is 0. Sampling success means that the relationship path includes the data object And it meets R b Defined relationships; sampling failure means that the relationship path does not include the data object or does not meet R b Defined relationship.

[0093] The sampling rule of formula (7) is: for each sample in the real data set, h ,C t ) is sampled, and the value of the first variable Y is determined 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. Wherein, 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.

[0094] For example, Varenicline is a compound, Nicotine Dependence is nicotine dependence, and the causal relationship R between the sampling and data objects in the dataset corresponding to the knowledge graph is b If the sampling is successful, the variable X i Assign a value of 1. If the 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.

[0095] 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.

[0096] For example, 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.

[0097] 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.

[0098] S324, based on 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 title of the table and the variable "X i " and "Y" as other column headers of the table, and each data object 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.

[0099] Figure 5a is a schematic diagram of the process of the causal rule mining module discovering causal meta-knowledge. As shown in Figure 5a, 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.

[0100] 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.

[0101] PC-like algorithms include PC models, PC inference models, etc. For example, the sample table obtained in S324 is input into the trained PC-like algorithm, and the outputs X1, X2 and X10 , 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.

[0102] 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.

[0103] 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.

[0104] S333 , determining the causal rule based on 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.

[0105] For example, 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.

[0106] In determining the causal rules based on the output of S331, there are often structures with bidirectional relationships. Bidirectional relationships refer to the structures corresponding to two potential causes in the knowledge graph being potential causes of each other. As shown in Figure 5b, the relationship path between the two potential causes corresponding to X1 and X2 in the knowledge graph is: 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 )} 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 )}

[0107] 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.

[0108] In some possible implementations, a bidirectional relationship can be identified by operations between variables X1, X2, and Y: X1⊥Y|X2and X2⊥Y|X1 (8)

[0109] When the value of formula (8) is 1, the two relationship paths KGS1 and KGS2 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 a potential cause of the second variable X2, and the second variable X2 is a potential cause of the first variable X1, the two relationship paths KGS1 and KGS2 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.

[0110] For example, for the bidirectional edges KGS1 and KGS2, the conditional independence of each edge is determined, and the edge KGS2 that does not meet 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 ) are entities that exist in the real dataset.

[0111] 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.

[0112] 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.).

[0113] Figure 6 is a flow chart of the method for causal meta-knowledge discovery based on knowledge graph provided by an 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 of the steps of the causal meta-knowledge discovery method based on knowledge graph can refer to the relevant descriptions in the aforementioned Figures 2 to 5. As shown in Figure 6, the method for causal meta-knowledge discovery based on knowledge graph provided by an 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 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; determining a second KGS that expresses the 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; 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 multiple; S64, sampling each sample 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; 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, sampling each sample in the real data set, and determining 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, obtaining the causal rule of the knowledge graph according to the sample and the corresponding values ​​of the first and second variables, 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.

[0114] The embodiment of the present application proposes a causal meta-knowledge discovery method based on a knowledge graph. Through causal discovery technology, 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.

[0115] 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 KGSs expressing multiple potential causes is obtained based on the multiple relationship paths. Furthermore, the first KGS can be encoded as a first variable Y; each second KGS in the set of the multiple potential causes of the second KGS is encoded as a variable X1, X2...X m .

[0116] 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.

[0117] In some feasible 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.

[0118] It should be noted that each sample is sampled in a real dataset, and the value of the first variable is determined based on the sampling results. This includes: if the sampling is successful, the value of the first variable is true / 1; if the sampling fails, the value of the first variable is false / 0. Each sample is sampled in a relationship path, and the value of the second variable is determined based on the sampling results. This includes: if the sampling is successful, the value of the second variable is true / 1; if the sampling fails, the value of the second variable is false / 0. If the sampling is successful for the same sample and both the first and second variables have the values ​​true / 1, the causal rules of the knowledge graph are obtained.

[0119] 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. m The sample table is generated by inputting the sample table into the PC-like algorithm, which outputs one or more second variables that satisfy the causal rule. The one or more second variables that satisfy the causal rule are the causes of the causal relationship expressed by the first KGS.

[0120] 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 the final causal rule.

[0121] The knowledge graph-based causal meta-knowledge discovery method provided in this embodiment is applied to the knowledge mining module of an AI intelligent tool targeting knowledge graphs. In traditional knowledge graph link prediction tasks, the method in this embodiment achieves higher prediction accuracy than other baseline algorithms, especially in tasks where the training and test data are not identically distributed.

[0122] 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 into variables and samples, and performs causal rule mining 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.

[0123] 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.

[0124] The embodiment of the present application provides a knowledge graph-based causal meta-knowledge discovery method that 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.

[0125] Extensive experiments conducted on simulated and real-world datasets demonstrate the effectiveness of causal rules. In particular, detailed analysis shows that rules based on causal relationship mining have good interpretability.

[0126] The method for causal meta-knowledge discovery based on knowledge graphs provided in the embodiments 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.

[0127] Example 1

[0128] Figures 7a-7c are schematic diagrams illustrating the method for causal meta-knowledge discovery based on a knowledge graph in Example 1 of this application in a drug redirection application scenario. Figure 7a illustrates a schematic diagram of potential cause mining in a drug redirection application scenario. As shown in Figure 7a, potential cause mining in a drug redirection knowledge graph can be implemented through the following steps S411-S413.

[0129] S411, obtain the knowledge graph paradigm according to the structured causal relationship of the knowledge graph of given drug redirection.

[0130] The structured causal relationship of the drug redirection knowledge graph can be determined with reference to step S311 as follows: b (Compound 1, Disease 1) → R h (Compound 1, Disease 1):w (9)

[0131] 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 b (Compound 1, disease 1) can be obtained R h (Compound 1, Disease 1) expression results, then R b (Compound 1, Disease 1) is R h (Compound 1, Disease 1) Cause. In Figure 7a, Compound 1 is the head entity of the potential cause, and Disease 1 is the tail entity of the potential cause. h (Compound 1, Disease 1) represents the target relationship. In Figure 7a, 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.

[0132] 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: KGS=R(C h ,C t )

[0133] In Example 1 of the present application, the KGS in formula (2) is a conceptual representation of the structured causal relationship in the knowledge graph of drug redirection, C h Represents compound 1 in Figure 7a; C t represents disease 1 in Figure 7a; R is the relationship function between compound 1 and disease 1.

[0134] Next, the target relationship is defined according to the knowledge graph paradigm of formula (2) as shown in formula (3): KGS0 = R h (C h ,C t )

[0135] 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.

[0136] S412: Search the existing drug redirection knowledge graph for at least one potential cause that matches the target relationship based on the target relationship knowledge graph paradigm. Each potential cause is a structure in the knowledge graph that includes compound 1 and disease 1, where each structure is a subgraph of the drug redirection knowledge graph. Each structure includes one or more triplets that have a relationship from compound 1 to disease 1, with adjacent triplets connected by a shared entity.

[0137] The potential causes can be searched using a random walk algorithm, a depth-first search algorithm, or a breadth-first search algorithm. For example, a complete knowledge graph of drug redirection can be input into a breadth-first search algorithm, and the breadth-first search algorithm outputs causal relationships between subgraphs of the knowledge graph, and multiple potential causes are obtained based on the causal relationships between the subgraphs of the knowledge graph.

[0138] As shown in Figure 7a, according to the target relationship paradigm of formula (3), with compound 1 as the head entity and disease 1 as the tail entity, 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 compound 1 capable of treating 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 ={R 1,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 ,Ck,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. R b,1 , R b,2 ,…R b,k For potential reasons.

[0139] S413, according to R b,1 , R b,2 …R b,k , and obtain the KGS set of potential causes.

[0140] R b,1 , R b,2 …R b,k Expressed as KGS, the KGS set of potential causes is as follows:

[0141] Formula (12) includes the KGS of k potential causes.

[0142] S414: Encode the target relationship KGS and the potential cause KGS set into variables respectively to obtain a variable set.

[0143] In Example 1 of the present application, the target relationship KGS0 in the knowledge graph is encoded as variable Y, and the potential causes KGS1, KGS2...KGS corresponding to each relationship path are encoded as variable Y. k Encoded as variables X1, X2…X k , and the variable set is:

[0144] 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,1 The KGS1 of "Compound 1 binds to gene 1, and gene 1 is associated with disease 1" is coded as X1. When X1=0, it indicates that the first potential cause does not exist, and when X1=1, it indicates that the first potential cause exists. The KGS2 of the second potential cause "Compound 1 treats disease 2, and disease 2 is similar to disease 1" is coded as X2. When X2=0, it indicates that the second potential cause does not exist, and when X2=1, it indicates 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, indicating that the kth potential cause does not exist, X k=1, indicating that the kth potential cause exists.

[0145] Figure 7b shows a flowchart for sample generation in the drug redirection application scenario. As shown in Figure 7b, the data objects in the drug redirection application scenario are entity pairs. Step S421 determines one of the multiple entity pairs as (Compound 1, Disease 1) based on the target relationship of drug redirection. Step S422 determines the sampling rules for drug redirection based on the mapping of the entity pair (Compound 1, Disease 1) to each variable in the variable set. Step S423 samples the drug redirection knowledge graph based on the sampling rules, obtains the sampling results, and generates a sample table. Steps S421-S423 are further explained below.

[0146] S421, define compound 1 as head data e h , disease 1 is defined as the tail data e t . According to the KGS0 of the target relationship, multiple entity pair sets are determined, each entity pair includes header data e h and tail data e t The specific implementation method can refer to step S321 and will not be described in detail here.

[0147] S422: Determine a sampling rule based on the mapping of entity pairs to variable sets, which can be expressed by formula (6) and formula (7).

[0148] In Example 1 of the present application, the data object is a set 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 sampling 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 the sampling fails, the variable X i Assign a value of 0.

[0149] The sampling rule of formula (7) can be defined as: in the 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.

[0150] S423, sampling in the knowledge graph according to the sampling rules, obtaining the 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 the sampling fails, the corresponding variable X i Assign a value of 0.

[0151] 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.

[0152] In Example 1 of the present application, “Entity Pair” can be used as the first title of the table, and the name of the variable “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. The sample set includes entity pairs, cause variables X i , entity variables Y and sampling results.

[0153] The potential cause mining in the drug redirection application scenario includes the following steps S431-S432.

[0154] 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 The causal variable that satisfies sampling success and the value of Y is 1.

[0155] 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 X k Corresponding to KGS k From this, we can see that the entity pair (Compound 1, Disease 1) is sampled successfully 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 (Ch ,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 where the value of Y is 1.

[0156] S432, determine the causal rule: determine the target relationship R according to the 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 ).

[0157] For example, the causal rule is determined as follows: and / or Inverse mapping to determine the corresponding KGS1 and / or KGS k The structure in the corresponding drug redirection knowledge graph can obtain "Compound 1 treats disease 1".

[0158] Example 1 above illustrates the process of identifying complex knowledge production and reasoning based on a given knowledge graph in a drug redirection application scenario. In the drug redirection knowledge graph, there are bidirectional relationship paths. In this case, secondary verification can be used to identify and process the bidirectional relationship paths in the knowledge graph, mapping the final causal rules.

[0159] FIG7c shows a schematic diagram of identifying bidirectional relationships in the drug redirection application scenario. As shown in FIG7c, the relationship paths corresponding to the two potential causes in the knowledge graph in the drug redirection application scenario are: 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 ,)};

[0160] The variables X2 and KGS corresponding to KGS2 k The corresponding variable X k Substituting into formula (8), we get formula (9): X k ⊥Y|X2and X2⊥Y|X k (9)

[0161] According to formula (9), the bidirectional relationship is determined: when two variables X k , X2 are the cause variables of sample Y, and X k is the causal variable of X2, and X2 is the k When the cause variable is X k , X2 have a bidirectional relationship.

[0162] For a bidirectional relationship X k and X2, judge the conditional independence of each relationship path, and when X2 does not meet the conditional independence, eliminate X2 that does not meet the conditional independence to obtain the final causal rule.

[0163] 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 dataset.

[0164] The method for causal meta-knowledge discovery based on knowledge graphs in the embodiment of the present application can also be applied in the field of recommendation search, using knowledge graphs to mine users' potential preferences. For example, the method provided in the embodiment of the present application is used to mine users' potential preferences based on massive historical data, such as preferred actors, films, and basic information about the films, including directors, types (including action, literature, science fiction, history, and fairy tales), as well as relationship paths in the knowledge graph. User preference recommendations are made on the application recommendation data set, and the obtained recommendation results are highly interpretable and accurate.

[0165] Next, a causal meta-knowledge discovery device based on a knowledge graph provided in an embodiment of the present application is introduced. The device is mainly proposed based on the model training method described in the aforementioned FIG6 .

[0166] FIG8 is a schematic diagram of a causal meta-knowledge discovery device based on a knowledge graph according to an embodiment of the present application. As shown in FIG8 , the causal meta-knowledge discovery device 800 based on a knowledge graph includes:

[0167] The potential cause mining module 81 determines a first knowledge graph paradigm KGS based on 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 the 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 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.

[0168] The sample generation module 82 samples each sample in the relationship path and determines the value of the second variable based on the sampling results; the sampling results include 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 based on the sampling results; 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;

[0169] The causal relationship mining module 83 obtains the causal rules of the knowledge graph based on the sample 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.

[0170] 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 and will not be repeated here.

[0171] In some embodiments, the potential cause mining module 81, sample generation module 82, and causal relationship mining module 83 shown in FIG8 can all be implemented by software or hardware. For example, the implementation of the potential cause mining module 81 of the acquisition module will be described below using the potential cause mining module 81 shown in FIG8 as an example.

[0172] As an example of a software functional unit, the potential cause mining module 81 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the 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 may be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically close data centers. Typically, a region may include multiple AZs.

[0173] Similarly, multiple hosts / virtual machines / containers running the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.

[0174] 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. Alternatively, the potential cause mining module 81 may be implemented using 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.

[0175] 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.

[0176] 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 FIG5 , and the potential cause mining module 81 shown in FIG8 can be used to execute any step in the method provided in FIG5 . The steps implemented by the potential cause mining module 81, the sample generation module 82, and the causal relationship mining module 83 shown in FIG8 can be specified as needed. By respectively implementing different steps in the method provided in FIG6 , the potential cause mining module 81, the sample generation module 82, and the causal relationship mining module 83 can realize all the functions of the causal meta-knowledge discovery device 800 based on the knowledge graph.

[0177] This application also provides a computing device 1000. As shown in Figure 9, computing device 1000 includes a bus 1002, a processor 1004, a memory 1006, and a communication interface 1008. Processor 1004, memory 1006, and communication interface 1008 communicate with each other via bus 1002. Computing device 1000 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in computing device 1000.

[0178] Bus 1002 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG9 illustrates a single bus line, but this does not imply a single bus or type of bus. Bus 1004 may include a path for transmitting information between various components of computing device 1000 (e.g., memory 1006, processor 1004, and communication interface 1008).

[0179] The processor 1004 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0180] The memory 1006 may include volatile memory, such as random access memory (RAM). The processor 104 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0181] Memory 1006 stores executable program code. Processor 1004 executes the executable program code to implement the functions of potential cause mining module 81, sample generation module 82, and causal relationship mining module 83 shown in FIG8 , thereby implementing all or part of the steps of the method in the above-described embodiment. In other words, memory 1006 stores instructions for executing all or part of the steps of the method in the above-described embodiment.

[0182] Alternatively, the memory 1006 stores executable code, and the processor 1004 executes the executable code to respectively implement the functions of the configuration migration apparatus 1000, thereby implementing all or part of the steps in the above-described embodiment method. In other words, the memory 1006 stores instructions for executing all or part of the steps in the above-described embodiment method.

[0183] 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.

[0184] Embodiments of the present application also provide 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 smartphone.

[0185] As shown in Figure 10, 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.

[0186] 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-described method. In other words, the combination of one or more computing devices 1000 can jointly execute instructions for executing all or part of the steps in the above-described method.

[0187] It should be noted that the memory 1006 in different computing devices 1000 in the computing device cluster can store different instructions, each for executing part of the functions of the knowledge graph-based causal meta-knowledge discovery apparatus 800. In other words, the instructions stored in the memory 1006 in different computing devices 1000 can implement 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 FIG8 .

[0188] In some possible implementations, one or more computing devices in a computing device cluster may be connected via a network, which may be a wide area network or a local area network.

[0189] 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.

[0190] 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, wherein 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

Patent Citations

  • Causal discovery method combining knowledge graph and automatic variational coding

    CN112949860A

  • Entity and triple joint reasoning-oriented knowledge representation learning model construction method

    CN115563304A

  • Real-time root cause analysis method based on operation and maintenance knowledge graph

    CN116225760A

  • System and method for generating a graphical model

    US10706104B1

  • Method, apparatus, device and storage medium for information processing

    US20210304076A1

Cited By

  • Causal path generation method and device, equipment, medium and product

    CN120354928A

  • Data updating method and device for water conservancy knowledge graph and medium

    CN120804111A

  • Quality evaluation method and device for purchasing bid invitation document

    CN121903725A

  • Mining equipment fault causal analysis method based on mapping knowledge domain

    CN122134329A