Tree rule extraction method and device on knowledge graph

By performing forward and backward reasoning on the chain rules in the knowledge graph, and supplementing candidate atoms to form tree-like rules, the problem of low accuracy of chain rules is solved, and higher rule expression ability and link prediction effect are achieved.

CN116578714BActive Publication Date: 2025-11-18INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310294052.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-23
Publication Date
2025-11-18
Estimated Expiration
2043-03-23

AI Technical Summary

Technical Problem

The accuracy of chain rules extracted from knowledge graphs in existing technologies is not high, which limits the expressive power of the rules.

Method used

By performing forward and backward reasoning on chained rules, candidate atoms are added to form tree-like rules, thereby improving the expressive power of the rules.

Benefits of technology

It improves the accuracy of rules and the effectiveness of link prediction, and enhances the expressive power of rules.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116578714B_ABST
    Figure CN116578714B_ABST
Patent Text Reader

Abstract

The application provides a tree-shaped rule extraction method and device on a knowledge graph, the method comprising: extracting a chain rule from the knowledge graph; performing forward reasoning on the chain rule to obtain a prediction result of a target rule body variable; performing reverse reasoning based on the prediction result to obtain a target rule body variable representation; and supplementing a candidate atom to the target rule body variable based on the target rule body variable representation to obtain a tree-shaped rule. The tree-shaped rule extraction method and device on the knowledge graph provided by the application are based on a chain rule, a candidate atom is supplemented, a tree-shaped rule is obtained, the expression capability of the rule is improved, the rule is more accurate, and better link prediction effect is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing technology, and in particular to a method and apparatus for extracting tree-like rules from knowledge graphs. Background Technology

[0002] Rule mining on knowledge graphs can be used to describe the general patterns in data, which helps in understanding the data and enabling reasoning, completion, and error detection and correction.

[0003] In related technologies, rules extracted from knowledge graphs are typically chain rules, which take the form of... Where, r0(x0,x1)∧r1(x1,x2)∧…∧r n (x n ,x n+1 The rule body is a chain-like rule, and the rule body consists of multiple atoms (triplets r). n (x n ,x n+1 The conjunctive composition of r(x0, x...), where r represents the relation and x represents the variable entity. n+1 The rule header () is a single atom containing the target predicate. Chained rules can alleviate the combinatorial explosion problem in rule extraction by combining methods such as neural network embedding and Differentiable Inductive Logic Programming (DILP), thereby completing rule extraction.

[0004] The chain rules obtained by the chain rule extraction method have low accuracy because their chain structure limits their expressive power. Summary of the Invention

[0005] This invention provides a method and apparatus for extracting tree-like rules from knowledge graphs, in order to solve the technical problem of low accuracy of chain-like rules in the prior art.

[0006] In a first aspect, the present invention provides a method for extracting tree-like rules from a knowledge graph, comprising:

[0007] Extracting chain rules from knowledge graphs;

[0008] Forward reasoning is performed on the chain rules to obtain the prediction results of the target rule body variables;

[0009] Based on the prediction results, reverse reasoning is performed to obtain the target rule body variable representation;

[0010] Based on the target rule body variable representation, candidate atoms are added to the target rule body variable to obtain a tree-like rule.

[0011] In some embodiments, forward reasoning is performed on the chained rules to obtain prediction results for the target rule body variables, including:

[0012] By performing forward reasoning on the chained rules, the rule head and rule body of the chained rules are obtained;

[0013] The target rule body variable is predicted using the rule head to obtain the first prediction vector in the prediction result, and the target rule body variable is predicted using the rule body to obtain the second prediction vector in the prediction result.

[0014] In some embodiments, backward reasoning is performed based on the prediction results to obtain the target rule body variable representation, including:

[0015] The first prediction vector is multiplied element-wise with the second prediction vector to obtain the positive example entity representation and the negative example entity representation;

[0016] Based on the positive example entity representation and the negative example entity representation, reverse reasoning is performed to obtain the target rule body variable representation.

[0017] In some embodiments, supplementing candidate atoms to the target rule body variable based on the target rule body variable representation includes:

[0018] By using multiple preset candidate atom representations to perform inner products with the target rule volume variable representation, the optimal candidate atom corresponding to the target rule volume variable is selected;

[0019] The optimal candidate atoms are added to the target rule body variables.

[0020] In some embodiments, the optimal candidate atom corresponding to the target rule variable is selected by taking the inner product of multiple preset candidate atom representations with the target rule variable representation, including:

[0021] Determine the inner product value of the inner product between the representation of each candidate atom and the representation of the target rule volume variable;

[0022] The candidate atom corresponding to the maximum inner product value is taken as the optimal candidate atom corresponding to the target rule body variable.

[0023] In some embodiments, forward reasoning of the chained rules includes:

[0024] The chained rules are forward reasoned using a matrix-based knowledge graph representation.

[0025] Secondly, the present invention also provides a tree-like rule extraction device for knowledge graphs, comprising:

[0026] The first extraction module is used to extract chain rules from the knowledge graph;

[0027] The first reasoning module is used to perform forward reasoning on the chain rules to obtain the prediction results of the target rule body variables;

[0028] The second reasoning module is used to perform reverse reasoning based on the prediction results to obtain the target rule body variable representation;

[0029] The second extraction module is used to supplement candidate atoms to the target rule body variable based on the target rule body variable representation to obtain tree-like rules.

[0030] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the tree-like rule extraction method on the knowledge graph as described above.

[0031] Fourthly, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the tree-like rule extraction method on the knowledge graph as described above.

[0032] Fifthly, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements a tree-like rule extraction method on a knowledge graph as described above.

[0033] The method and apparatus for extracting tree-like rules from knowledge graphs provided by this invention are based on chain-like rules, supplemented with candidate atoms to obtain tree-like rules, which improves the expressive power of the rules, makes the rules more accurate, and has better link prediction effect. Attached Figure Description

[0034] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0035] Figure 1 This is a flowchart illustrating the tree-like rule extraction method for knowledge graphs provided by the present invention;

[0036] Figure 2 This is one of the schematic diagrams illustrating the principle of tree-like rule extraction on knowledge graphs provided by this invention;

[0037] Figure 3 This is the second schematic diagram of the tree-like rule extraction principle on the knowledge graph provided by this invention;

[0038] Figure 4This is a schematic diagram of the structure of the tree-like rule extraction device on the knowledge graph provided by the present invention;

[0039] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0040] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0041] Figure 1 This is a flowchart illustrating the tree-like rule extraction method for knowledge graphs provided by this invention, as shown below. Figure 1 As shown, the tree-like rule extraction method on the knowledge graph provided by this invention includes:

[0042] Step 101: Extract chain rules from the knowledge graph.

[0043] Specifically, chain rules can be obtained using existing chain rule extraction methods. For example, chain rules can be mined using the AMIE model, Rudik model, or IterE model.

[0044] Figure 2 This is one of the schematic diagrams illustrating the principle of tree-like rule extraction from knowledge graphs provided by this invention, such as... Figure 2 As shown, extracting a chain rule from a knowledge graph is...

[0045] Step 102: Perform forward reasoning on the chain rule to obtain the prediction result of the target rule body variable.

[0046] Specifically, Figure 3 This is the second schematic diagram of the tree-like rule extraction principle on the knowledge graph provided by this invention, as shown in the example... Figure 3 Taking the reasoning process shown as an example, a matrix-based knowledge graph representation is used to perform forward reasoning on the rules. Entities / variables (x) and relations (r) are represented by one-hot vectors (v) and adjacency matrices (M), respectively, and forward reasoning is completed by performing matrix multiplications consecutively.

[0047] Step 103: Perform reverse reasoning based on the prediction results to obtain the target rule body variable representation.

[0048] Specifically, the prediction results of the rules are back-reasoned. Based on the matching results between the rule body and the rule head, matrix multiplication is performed continuously, and the label representation is back-reasoned to each variable.

[0049] Step 104: Based on the target rule body variable representation, supplement the candidate atoms to the target rule body variable to obtain tree-like rules.

[0050] Specifically, tree-like rules are obtained by supplementing different positions of the rule body with multiple branch candidate atoms based on the design. For example, the optimal branch is selected by filtering the inner product of the candidate atom representation and the rule body variable representation, and the optimal candidate atom is supplemented to the target rule body variable to obtain the tree-like rules.

[0051] The tree-like rule extraction method for knowledge graphs provided by this invention is based on chain-like rules, supplements candidate atoms to obtain tree-like rules, improves the expressive power of the rules, makes the rules more accurate, and has better link prediction effect.

[0052] In some embodiments, forward reasoning is performed on the chained rules to obtain prediction results for the target rule body variables, including:

[0053] By performing forward reasoning on the chained rules, the rule head and rule body of the chained rules are obtained;

[0054] The target rule body variable is predicted using the rule head to obtain the first prediction vector in the prediction result, and the target rule body variable is predicted using the rule body to obtain the second prediction vector in the prediction result.

[0055] Specifically, with Figure 3 For example, performing forward reasoning on a chain rule yields the rule head and rule body. The rule head is r(x0,x3), and the rule body is r1(x0,x1)∧r2(x1,x2)∧r3(x2,x3). The rule body variable x0 is represented by the vector v. x0 The regular variable x1 is represented by the vector v. x1 The regular variable x2 is represented by the vector v. x2 The regular variable x3 is represented by the vector v. x3 The relation r1 is represented by matrix M. r1 The relation r2 is represented by matrix M. r2 The relation r3 is represented by matrix M. r3 The relation r is represented by matrix M. r .

[0056] The forward reasoning process can then be represented as:

[0057] t x3 =v x0 Mr

[0058]

[0059] Using the rule head r(x0,x3) to predict the rule body variable x3, the first prediction vector t in the prediction result is obtained. x3 The rule body r1(x0,x1)∧r2(x1,x2)∧r3(x2,x3) is used to predict the rule body variable x3, and the second prediction vector v in the prediction result is obtained. x3 .

[0060] The tree-like rule extraction method for knowledge graphs provided by this invention is based on chain-like rules, supplements candidate atoms to obtain tree-like rules, improves the expressive power of the rules, makes the rules more accurate, and has better link prediction effect.

[0061] In some embodiments, backward reasoning is performed based on the prediction results to obtain the target rule body variable representation, including:

[0062] The first prediction vector is multiplied element-wise with the second prediction vector to obtain the positive example entity representation and the negative example entity representation;

[0063] Based on the positive example entity representation and the negative example entity representation, reverse reasoning is performed to obtain the target rule body variable representation.

[0064] Specifically, with Figure 3 For example, let's take the first prediction vector t x3 With the second prediction vector v x3 Element-wise multiplication yields the positive entity representation p. x3 and negative example entity representation n x3 .

[0065] Then, based on the positive example entity representation p x3 and negative example entity representation n x3 By performing reverse reasoning, the target rule body variable representation is obtained.

[0066] In the reverse reasoning process, relation r1 is represented as a matrix. matrix For matrix M r1 The transpose of r2 is given by the matrix r2. matrix For matrix M r2 The transpose of r3 is represented as a matrix. matrix For matrix M r3 The transpose of .

[0067] The process of reverse reasoning can then be represented as:

[0068]

[0069]

[0070] For example, if it is necessary to add candidate atoms at the position of the regular variable x1, then the representation of the regular variable x1 obtained through reverse reasoning is (1-λ)p. x1 +(-λ)n x1 Where λ is a preset hyperparameter, p x1 Let n be the positive instance representation at the rule body variable x1. x1 This represents the negative instance entity at the rule body variable x1.

[0071] The tree-like rule extraction method for knowledge graphs provided by this invention is based on chain-like rules, supplements candidate atoms to obtain tree-like rules, improves the expressive power of the rules, makes the rules more accurate, and has better link prediction effect.

[0072] In some embodiments, supplementing candidate atoms to the target rule body variable based on the target rule body variable representation includes:

[0073] By using multiple preset candidate atom representations to perform inner products with the target rule volume variable representation, the optimal candidate atom corresponding to the target rule volume variable is selected;

[0074] The optimal candidate atoms are added to the target rule body variables.

[0075] Specifically, after obtaining the target rule body variable representation through reverse reasoning, the inner product of various preset candidate atom representations with the target rule body variable representation is used to select the optimal candidate atom corresponding to the target rule body variable, and finally the optimal candidate atom is added to the target rule body variable.

[0076] by Figure 3 For example, if it is necessary to add candidate atoms at the position of the rule body variable x1, then after reverse reasoning, the representation of the rule body variable x1 is (1-λ)p. x1 +(-λ)n x1 Then, the inner product is performed with various preset candidate atom representations to filter out the optimal candidate atom corresponding to the target rule body variable. Finally, the optimal candidate atom is added to the rule body variable x1.

[0077] The tree-like rule extraction method for knowledge graphs provided by this invention is based on chain-like rules, supplements candidate atoms to obtain tree-like rules, improves the expressive power of the rules, makes the rules more accurate, and has better link prediction effect.

[0078] In some embodiments, the optimal candidate atom corresponding to the target rule variable is selected by taking the inner product of multiple preset candidate atom representations with the target rule variable representation, including:

[0079] Determine the inner product value of the inner product between the representation of each candidate atom and the representation of the target rule volume variable;

[0080] The candidate atom corresponding to the maximum inner product value is taken as the optimal candidate atom corresponding to the target rule body variable.

[0081] Specifically, with Figure 3 For example, if it is necessary to add candidate atoms at the position of the rule body variable x1, then after reverse reasoning, the representation of the rule body variable x1 is (1-λ)p. x1 +(-λ)n x1 Then, it is inner-producted with various preset candidate atom representations respectively. The inner-product value of the inner-product of each candidate atom representation and the representation of the rule body variable x1 is determined. The candidate atom corresponding to the largest inner-product value is taken as the optimal candidate atom corresponding to the rule body variable x1. Finally, the optimal candidate atom is added to the rule body variable x1.

[0082] The tree-like rule extraction method for knowledge graphs provided by this invention is based on chain-like rules, supplements candidate atoms to obtain tree-like rules, improves the expressive power of the rules, makes the rules more accurate, and has better link prediction effect.

[0083] In some embodiments, the optimal candidate atoms corresponding to the target rule variable are selected by taking the inner product of two preset candidate atom representations with the target rule variable representation.

[0084] The effectiveness of the method of the present invention is illustrated below through specific examples and experimental results:

[0085] This invention was experimentally explored on two open-source link prediction datasets, FB15k-237 and YAGO3-10. The chain rule induction methods selected included BBFS, AMIE, and AnyBurl.

[0086] First, the average confidence scores of the chain rule and its improved tree rule were compared, as shown in Table 1. The comparison revealed that the tree rule generally has a higher confidence score.

[0087] Table 1: Comparison of Average Confidence Levels

[0088]

[0089] The effectiveness of this invention is illustrated by comparing the connection prediction performance of chain rules and the improved tree rules. The overall performance comparison is shown in Table 2. As can be seen from the results, tree rules generally have better connection prediction performance than chain rules, which proves the effectiveness of this method.

[0090] Table 2: Overall Performance Comparison

[0091]

[0092] Table 2 also presents the results of the ablation experiment, showing that the complete method (MIX) achieves the best link prediction results compared to using only one candidate atom (AUX, ENT). This experiment demonstrates the effectiveness of the two branching atoms proposed in this invention.

[0093] The following describes the tree-like rule extraction device for knowledge graphs provided by the present invention. The tree-like rule extraction device for knowledge graphs described below can be referred to in correspondence with the tree-like rule extraction method for knowledge graphs described above.

[0094] Figure 4 This is a schematic diagram of the structure of the tree-like rule extraction device on the knowledge graph provided by the present invention, as shown below. Figure 4 As shown, the present invention provides a tree-like rule extraction device for a knowledge graph, comprising a first extraction module 401, a first reasoning module 402, a second reasoning module 403, and a second extraction module 404, wherein:

[0095] The first extraction module 401 is used to extract chain rules from the knowledge graph; the first reasoning module 402 is used to perform forward reasoning on the chain rules to obtain the prediction result of the target rule body variable; the second reasoning module 403 is used to perform backward reasoning based on the prediction result to obtain the representation of the target rule body variable; the second extraction module 404 is used to supplement the target rule body variable with candidate atoms based on the representation of the target rule body variable to obtain tree-like rules.

[0096] In some embodiments, the first inference module includes a first inference unit and a first prediction unit;

[0097] The first reasoning unit is used to perform forward reasoning on the chain rule to obtain the rule head and rule body of the chain rule;

[0098] The first prediction unit is used to predict the target rule body variable using the rule head to obtain the first prediction vector in the prediction result, and to predict the target rule body variable using the rule body to obtain the second prediction vector in the prediction result.

[0099] In some embodiments, the second inference module includes a first processing unit and a second inference unit;

[0100] The first processing unit is used to multiply the first prediction vector and the second prediction vector element by element to obtain positive example entity representation and negative example entity representation;

[0101] The second reasoning unit is used to perform reverse reasoning based on the positive example entity representation and the negative example entity representation to obtain the target rule body variable representation.

[0102] In some embodiments, the second extraction module includes a second processing unit and a supplementary unit;

[0103] The second processing unit is used to select the optimal candidate atom corresponding to the target rule variable by performing inner product with multiple preset candidate atom representations respectively;

[0104] The supplementary unit is used to supplement the target rule body variable with the optimal candidate atom.

[0105] In some embodiments, the second processing unit includes an inner product sub-unit and a filtering sub-unit;

[0106] The inner product subunit is used to determine the inner product value of each candidate atom representation and the target rule volume variable representation, respectively;

[0107] The filtering subunit is used to select the candidate atom corresponding to the maximum inner product value as the optimal candidate atom corresponding to the target rule body variable.

[0108] In some embodiments, the first reasoning module is specifically used to perform forward reasoning on the chained rules using a matrix-based knowledge graph representation.

[0109] Specifically, the tree-like rule extraction device on the knowledge graph provided by the present invention can implement all the method steps implemented in the above-mentioned tree-like rule extraction method embodiment on the knowledge graph, and can achieve the same technical effect. Here, the parts that are the same as those in the method embodiment and the beneficial effects will not be described in detail.

[0110] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530, and a communication bus 540, wherein the processor 510, the communication interface 520, and the memory 530 communicate with each other through the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute a tree-like rule extraction method on the knowledge graph, the method including:

[0111] Extracting chain rules from knowledge graphs;

[0112] Forward reasoning is performed on the chain rules to obtain the prediction results of the target rule body variables;

[0113] Based on the prediction results, reverse reasoning is performed to obtain the target rule body variable representation;

[0114] Based on the target rule body variable representation, candidate atoms are added to the target rule body variable to obtain a tree-like rule.

[0115] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0116] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program that can be stored on a non-transitory computer-readable storage medium, wherein when the computer program is executed by a processor, the computer is able to execute the tree-like rule extraction method on the knowledge graph provided by the above methods, the method comprising:

[0117] Extracting chain rules from knowledge graphs;

[0118] Forward reasoning is performed on the chain rules to obtain the prediction results of the target rule body variables;

[0119] Based on the prediction results, reverse reasoning is performed to obtain the target rule body variable representation;

[0120] Based on the target rule body variable representation, candidate atoms are added to the target rule body variable to obtain a tree-like rule.

[0121] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a tree-like rule extraction method on a knowledge graph provided by the methods described above, the method comprising:

[0122] Extracting chain rules from knowledge graphs;

[0123] Forward reasoning is performed on the chain rules to obtain the prediction results of the target rule body variables;

[0124] Based on the prediction results, reverse reasoning is performed to obtain the target rule body variable representation;

[0125] Based on the target rule body variable representation, candidate atoms are added to the target rule body variable to obtain a tree-like rule.

[0126] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0127] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0128] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for extracting tree-like rules from a knowledge graph, characterized in that, include: Extracting chain rules from knowledge graphs; Forward reasoning is performed on the chain rules to obtain the prediction results of the target rule body variables; Based on the prediction results, reverse reasoning is performed to obtain the target rule body variable representation; Based on the target rule body variable representation, candidate atoms are added to the target rule body variable to obtain a tree-like rule; Forward reasoning is performed on the chained rules to obtain prediction results for the target rule body variables, including: By performing forward reasoning on the chained rules, the rule head and rule body of the chained rules are obtained; The target rule body variable is predicted using the rule head to obtain the first prediction vector in the prediction result, and the target rule body variable is predicted using the rule body to obtain the second prediction vector in the prediction result. Based on the prediction results, reverse reasoning is performed to obtain the target rule body variable representation, including: The first prediction vector is multiplied element-wise with the second prediction vector to obtain the positive example entity representation and the negative example entity representation; Based on the positive example entity representation and the negative example entity representation, reverse reasoning is performed to obtain the target rule body variable representation.

2. The method for extracting tree-like rules from a knowledge graph according to claim 1, characterized in that, Based on the target rule body variable representation, candidate atoms are added to the target rule body variable, including: By using multiple preset candidate atom representations to perform inner products with the target rule volume variable representation, the optimal candidate atom corresponding to the target rule volume variable is selected; The optimal candidate atoms are added to the target rule body variables.

3. The method for extracting tree-like rules from a knowledge graph according to claim 2, characterized in that, By performing inner products between various pre-defined candidate atom representations and the target rule volume variable representation, the optimal candidate atoms corresponding to the target rule volume variable are selected, including: Determine the inner product value of the inner product between the representation of each candidate atom and the representation of the target rule volume variable; The candidate atom corresponding to the maximum inner product value is taken as the optimal candidate atom corresponding to the target rule body variable.

4. The method for extracting tree-like rules from a knowledge graph according to any one of claims 1 to 3, characterized in that, Forward reasoning of the chain rules includes: The chained rules are forward reasoned using a matrix-based knowledge graph representation.

5. A tree-like rule extraction device for knowledge graphs, characterized in that, include: The first extraction module is used to extract chain rules from the knowledge graph; The first reasoning module is used to perform forward reasoning on the chain rules to obtain the prediction results of the target rule body variables; The second reasoning module is used to perform reverse reasoning based on the prediction results to obtain the target rule body variable representation; The second extraction module is used to supplement candidate atoms to the target rule body variable based on the target rule body variable representation to obtain tree-like rules; Forward reasoning is performed on the chained rules to obtain prediction results for the target rule body variables, including: By performing forward reasoning on the chained rules, the rule head and rule body of the chained rules are obtained; The target rule body variable is predicted using the rule head to obtain the first prediction vector in the prediction result, and the target rule body variable is predicted using the rule body to obtain the second prediction vector in the prediction result. Based on the prediction results, reverse reasoning is performed to obtain the target rule body variable representation, including: The first prediction vector is multiplied element-wise with the second prediction vector to obtain the positive example entity representation and the negative example entity representation; Based on the positive example entity representation and the negative example entity representation, reverse reasoning is performed to obtain the target rule body variable representation.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the tree-like rule extraction method on the knowledge graph as described in any one of claims 1 to 4.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the tree-like rule extraction method on the knowledge graph as described in any one of claims 1 to 4.

8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the tree-like rule extraction method on the knowledge graph as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Knowledge graph data expansion method and system based on association between rules

    CN114741460A

  • Dynamic clinical diagnosis and treatment auxiliary system based on medical knowledge graph

    CN115440370A