A method, system, electronic device and storage medium for synthesizing inference tree data

By synthesizing inference tree data using ontology and reasoning engines, the method addresses the scarcity of high-quality logical reasoning data, enhancing model performance in complex tasks.

CN118607647BActive Publication Date: 2024-12-13NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411085826.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-12-13
Estimated Expiration
2044-08-08

AI Technical Summary

Technical Problem

The scarcity of high-quality data with clear logical relationships and correct reasoning processes hinders the training of models to master logical reasoning capabilities, as existing data cannot meet the growing demand for training data.

Method used

A method for synthesizing inference tree data using ontology, graph data, and reasoning engines (Pellet and tuProlog) to derive Prolog queries, forming a tree-structured reasoning process that provides high-quality training data.

Benefits of technology

The method enables models to better understand and evaluate logical reasoning processes, improving their performance in complex reasoning tasks by providing controlled, high-quality training data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118607647B_ABST
    Figure CN118607647B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system, electronic device and storage medium for synthesizing inference tree data, the method comprising obtaining an ontology; synthesizing graph data based on the ontology; using a first inference engine to infer the ontology and the graph data to obtain assertions and derive explanations matching the assertions; using DL2Prolog to convert the explanations into a Prolog knowledge base and the assertions into Prolog queries; and using a second inference engine to infer the Prolog knowledge base and the Prolog queries to obtain an inference tree for deriving the Prolog queries from the Prolog knowledge base. The present invention uses an inference tree representation form in which explanations are converted into argument structures, obtains a sample of the inference process in a tree structure, can continuously synthesize data, and the quality of the synthesized data is more controllable than real data, providing high-quality data for training models.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data synthesis, and in particular relates to a synthesis method, system, electronic device and storage medium for inference tree data. Background Art

[0002] Synthetic data refers to data that is automatically generated by a program rather than actually collected. When real data is lacking due to factors such as privacy, security, confidentiality, and data collection costs, synthetic data is widely used in machine learning training, model testing, simulation experiments, and other aspects.

[0003] Logical reasoning is an important component of intelligence. When using a large language model to perform logical reasoning to solve problems, the model is required to answer questions based on a given context and question by analyzing, reasoning, and judging the logical relationships contained in the text. An important basis for training models to master logical reasoning capabilities is to provide training data sets and illustrate the reasoning process of problem solving.

[0004] However, high-quality data with clear logical relationships and correct reasoning processes are scarce. At the current rate of model growth, the existing high-quality data will be unable to meet the model's demand for training data. Summary of the invention

[0005] In order to overcome the shortcomings of the prior art, the present invention provides a method, system, electronic device and storage medium for synthesizing inference tree data to obtain the logical reasoning process of graph data, so that the training model can better understand the structure of logical reasoning, evaluate and correct the logical reasoning process.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions:

[0007] A method for synthesizing inference tree data, comprising:

[0008] Get the ontology;

[0009] Based on the ontology, synthesize graph data;

[0010] reasoning the ontology and the graph data using a first reasoning engine to obtain assertions and derive explanations matching the assertions;

[0011] Using DL2Prolog to convert the interpretation into a Prolog knowledge base and the assertion into a Prolog query;

[0012] And the Prolog knowledge base and the Prolog query are inferred by using a second inference engine to obtain an inference tree that derives the Prolog query from the Prolog knowledge base.

[0013] Furthermore, the obtaining of the ontology includes:

[0014] Obtaining the ontology expressed in a Web ontology language and a Semantic Web rule language;

[0015] And use the Pellet inference engine to reason about the ontology to detect whether the ontology is consistent. If the ontology is consistent, enter the step of synthesizing graph data based on the ontology.

[0016] Furthermore, the graph data includes a positive assertion set and a negative assertion set.

[0017] Further, the using a first inference engine to reason on the ontology and the graph data to obtain assertions and derive explanations matching the assertions includes:

[0018] Using the Pellet inference engine to infer the knowledge base composed of the ontology and the positive example assertion set;

[0019] For each newly introduced assertion, using the Pellet inference engine to obtain an explanation for deriving the assertion, and forming an assertion-explanation pair with the assertion and the corresponding explanation;

[0020] And for each negative assertion in the negative assertion set, the Pellet inference engine is used to reason on the ontology, the positive assertion set and the negative assertion to obtain an inconsistent explanation, and an assertion-explanation pair is formed with the negation of the negative assertion and the corresponding explanation.

[0021] Further, the using DL2Prolog to convert the interpretation into a Prolog knowledge base and convert the assertion into a Prolog query includes:

[0022] Using DL2Prolog to convert the explanations in the assertion-explanation pairs into a Prolog knowledge base;

[0023] Converting the assertion in the assertion-explanation pair into a Prolog query using DL2Prolog;

[0024] And based on the Prolog knowledge base and the Prolog query, a query-knowledge base pair is formed.

[0025] Further, the using a second inference engine to infer the Prolog knowledge base and the Prolog query to obtain an inference tree for deriving the Prolog query from the Prolog knowledge base includes:

[0026] tuProlog is used to perform reasoning on each query-knowledge base pair, using the Prolog knowledge base and the Prolog query as theory and query input of tuProlog, respectively, to obtain a reasoning tree that derives the Prolog query from the Prolog knowledge base.

[0027] Further, the using a second inference engine to infer the Prolog knowledge base and the Prolog query to obtain an inference tree for deriving the Prolog query from the Prolog knowledge base also includes:

[0028] If the tuProlog does not obtain an inference tree within the preset time, the inference is stopped, and the order of all clauses in the Prolog knowledge base is randomly rearranged, and the rearranged Prolog knowledge base and the Prolog query are used as the theory and query input of the tuProlog for reasoning, until an inference tree that derives the Prolog query from the Prolog knowledge base is successfully obtained within the preset time.

[0029] In addition, the present invention also provides a system using the above-mentioned inference tree data synthesis method, comprising:

[0030] An acquisition module, used to acquire the ontology;

[0031] A graph data synthesis module, used for synthesizing graph data based on the ontology;

[0032] a first reasoning module, configured to use a first reasoning engine to reason on the ontology and the graph data to obtain assertions and derive explanations matching the assertions;

[0033] A conversion module, for converting the interpretation into a Prolog knowledge base and converting the assertion into a Prolog query using DL2Prolog;

[0034] and a second reasoning module, configured to use a second reasoning engine to reason on the Prolog knowledge base and the Prolog query to obtain a reasoning tree for deriving the Prolog query from the Prolog knowledge base.

[0035] In addition, 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 implements the above-mentioned method for synthesizing inference tree data when executing the computer program.

[0036] In addition, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned method for synthesizing inference tree data is implemented.

[0037] In the present invention, the ontology representing the domain knowledge system is obtained from an open source ontology website, and then the graph data is obtained through the graph data synthesis method. Furthermore, the graph data is subjected to ontology reasoning and explanations are generated for the reasoning conclusions. Finally, the explanations are converted into a reasoning tree representation of the argument structure, that is, a tree-structured reasoning process sample is obtained. This method can continuously synthesize data, and the quality of the synthesized data is more controllable than real data, thereby providing high-quality data for the training model. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but do not constitute an improper limitation of the present invention. In the drawings:

[0039] Figure 1 A flowchart of a method for synthesizing inference tree data of the present invention;

[0040] Figure 2 A flowchart of step S1 of the method for synthesizing inference tree data of the present invention;

[0041] Figure 3 A flowchart of step S3 of the method for synthesizing inference tree data of the present invention;

[0042] Figure 4 is a flow chart of step S4 of the method for synthesizing inference tree data of the present invention;

[0043] Figure 5 is a flow chart of step S5 of the method for synthesizing inference tree data of the present invention;

[0044] Figure 6 An example diagram of the "explanation" of obtaining a derivation matching assertion of the present invention;

[0045] Figure 7 Example of generated arguments for the assertions of the present invention Figure 1 ;

[0046] Figure 8 Example of generated arguments for the assertions of the present invention Figure 2 ;

[0047] Fig. 9 An example diagram of the arguments of the present invention containing information about the reasoning process and the knowledge required therefor;

[0048] Fig.10This is an example diagram of the present invention using the OntoGraph plug-in in the Protégé tool to visually display the "structure of the argument";

[0049] Fig.11 A structural diagram of a system using a synthesis method of inference tree data according to the present invention;

[0050] Fig.12 It is a schematic structural diagram of the electronic device of the present invention. DETAILED DESCRIPTION

[0051] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0052] In the description of the present invention, it should be understood that the orientation or positional relationship indicated by the terms and the like is based on the orientation or positional relationship shown in the accompanying drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device, element, module, system, platform or device referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. The following description of the present invention is only understood as a description of individual embodiments of the technical solution of the present invention. Other embodiments are not reflected in the following description, but it does not mean that the present invention excludes these other embodiments, and the technical solution of the present invention is not limited to the specific implementation methods described below, and the protection scope of the present invention is not limited to only the specific implementation methods described below. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work should belong to the scope of protection of the present invention.

[0053] It should be noted that if the terms "first", "second", etc. appear in the specification and claims of the present invention and the above-mentioned drawings, the description is only used to distinguish similar objects, and is not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0054] In one embodiment, if Figure 1As shown, the present invention provides a method for synthesizing inference tree data. Inference tree data can represent the deductive process from original information to conclusion, construct an inference tree data set, and form a process example of complex logical reasoning based on complex relationships and rules, which can provide high-quality training data for model learning and improve the performance of the model in complex reasoning tasks. Specifically, the method for synthesizing inference tree data may include:

[0055] S1: Get the ontology;

[0056] The ontology is a consistent ontology that can be expressed in a Web ontology language and a semantic Web rule language. The ontology represents concepts in a domain and the relationships between them, namely, a domain knowledge system.

[0057] S2: based on the ontology, synthesizing graph data;

[0058] Specifically, in the method for synthesizing graph data, ontology programming tools can be used to represent classes, relationships and attributes in a preset domain knowledge system, and class representation, relationship representation and attribute representation in the preset domain can be obtained; then an axiom set describing the class representation and the connection between the class representation and the class representation and a rule set describing the connection between the relationship representation and the relationship representation are obtained, and the axiom set and the rule set are combined to obtain an ontology axiom set; an instance is generated according to the ontology axiom set, and an extended assertion set of the instance, an attribute assertion of the instance and an assertion between the instance are determined according to the ontology axiom set, and an ontology assertion set is obtained according to the extended assertion set, the attribute assertion and the relation assertion; a consistency check is performed on the union of the axiom set and the ontology assertion set according to an ontology reasoning engine to obtain a consistency check result; and synthesized graph data is obtained according to the consistency check result and the rule set. The graph data may include a positive assertion set and a negative assertion set.

[0059] S3: using a first reasoning engine to reason on the ontology and the graph data to obtain assertions and derive explanations matching the assertions;

[0060] Specifically, the Pellet inference engine can be used to reason about the ontology represented by OWL+SWRL. Its basic idea is to use proof by contradiction and consistency detection to derive matching assertions. Its reasoning explanation can be implemented by the Single_JUST-ALGBlack-Box algorithm. The set of knowledge used in the reasoning of the "explanation" of the derivation matching assertion forms the minimum knowledge base required for constructing the reasoning process. In this step, the reasoning process of the tree structure has not been fully formed. However, through Pellet reasoning, it is possible to accurately obtain the knowledge used in the reasoning process, so that the Prolog knowledge base converted in the subsequent steps only contains the knowledge necessary for deriving the conclusion and will not fall into the situation where it cannot be shut down. The reason why Prolog reasoning falls into unnecessary search space and cannot be shut down is because Prolog reasoning uses the SLD-Derivation algorithm to generate the reasoning process. The search process is heavily dependent on the order of arrangement of the content in the knowledge base. Therefore, when the scale of the knowledge base is large and the reasoning process is long, as long as the search process of a sub-link falls into the situation where it cannot be shut down, the entire process cannot be shut down.

[0061] like Figure 6 As shown, the process of obtaining reasoning explanations is shown, where the input is given formally represented data and ontology; the output is the rules, definitions, and formally represented data used in the reasoning process to derive a given conclusion.

[0062] S4: using DL2Prolog to convert the interpretation into a Prolog knowledge base and convert the assertion into a Prolog query;

[0063] By converting the reasoning explanation generated by Pellet reasoning into a Prolog knowledge base, Prolog reasoning is used to obtain the reasoning process information and convert it into an argument representation, which contains all the information of the reasoning process.

[0064] S5: using a second inference engine to infer the Prolog knowledge base and the Prolog query to obtain an inference tree that derives the Prolog query from the Prolog knowledge base;

[0065] Specifically, tuProlog is used to infer the Prolog knowledge base to obtain a matching chain reasoning structure, namely, a reasoning tree, so that the reasoning process is organized in the form of step-by-step reasoning, making it easier for people to understand.

[0066] Through the synthesis method of the inference tree data of the present invention, the ontology representing the domain knowledge system can be first obtained from the open source ontology website, and then the graph data can be obtained through the graph data synthesis method. Further, the graph data is subjected to ontology reasoning and an explanation is generated for the reasoning conclusion. Finally, the explanation is converted into a reasoning tree representation of the argument structure, that is, a tree-structured reasoning process sample is obtained. By constructing an inference tree data set and forming a process example of complex logical reasoning based on complex relationships and rules, high-quality training data can be provided for model learning, and the performance of the model in complex reasoning tasks can be improved; using a tree structure to express the intermediate process of reasoning can be used to improve prompt engineering, that is, by designing appropriate questions and prompts, the reasoning ability of the model can be better exerted.

[0067] In some embodiments, Figure 2 As shown, the step S1 of obtaining the ontology includes:

[0068] S11: Obtain the ontology expressed in a Web ontology language and a semantic Web rule language;

[0069] S12: Use the Pellet inference engine to infer the ontology to detect whether the ontology is consistent. If the ontology is consistent, enter the step of synthesizing graph data based on the ontology.

[0070] Specifically, the ontology is inferred through the Pellet reasoning engine to detect the consistency of its knowledge system. If the detection result is not "inconsistent", it means that the ontology can be used to synthesize graph data and enter the subsequent step of synthesizing graph data. Otherwise, the ontology is re-acquired to obtain other domain ontologies and detect consistency until a consistent ontology represented by OWL+SWRL is obtained.

[0071] In some embodiments, Figure 3 As shown, step S3 may include:

[0072] S31: using the Pellet inference engine to infer the knowledge base composed of the ontology and the positive example assertion set;

[0073] S32: for each newly introduced assertion, using the Pellet inference engine to obtain an explanation for deriving the assertion, and forming an assertion-explanation pair with the assertion and the corresponding explanation;

[0074] S33: For each negative assertion in the negative assertion set, use the Pellet inference engine to reason on the ontology, the positive assertion set and the negative assertion to obtain an inconsistent explanation, and form an assertion-explanation pair with the negation of the negative assertion and the corresponding explanation.

[0075] In some embodiments, Figure 4 As shown, step S4 may include:

[0076] S41: using DL2Prolog to convert the interpretation in the assertion-interpretation pair into a Prolog knowledge base;

[0077] S42: using DL2Prolog to convert the assertion in the assertion-explanation pair into a Prolog query;

[0078] S43: Form a query-knowledge base pair.

[0079] In some embodiments, Figure 5 As shown, step S5 may include:

[0080] S51: using tuProlog to perform reasoning on each query-knowledge base pair, using the Prolog knowledge base and the Prolog query as the theory and query input of tuProlog respectively;

[0081] S52: Whether the tuProlog obtains the inference tree within a preset time;

[0082] S53: If yes, then obtain an inference tree for deriving the query from the Prolog knowledge base;

[0083] S54: If no, stop the reasoning;

[0084] S55: Randomly arrange the order of all clauses in the Prolog knowledge base;

[0085] Then enter step S51.

[0086] From the above, we can get the inference tree, and use the inference tree as input to construct an argument. The top rule of the argument is that the conclusion of the argument is the root node of the inference tree. Initialize the direct sub-argument set subArgSet to an empty set, delete the root node of the inference tree, and if a subtree can be obtained, then for each subtree, use the subtree as input to construct an argument as the direct sub-argument of the argument, and add the constructed argument to subArgSet; if a subtree cannot be obtained, the argument is the basic argument. The direct sub-argument set of the argument is subArgSet.

[0087] Specifically, the present invention is carried out through the following Figure 7-Figure 10 Let’s illustrate the arguments generated for the assertion grandParentOf(wuzetian,li4) and use the tool to visualize the reasoning process.

[0088] like Figure 7-8As shown in the figure, in the process of generating arguments for grandParentOf(wuzetian,li4), three basic arguments and two derived arguments are derived. Among them, the argument grandParentOf_wuzetian_li4 is the target argument, which represents the reasoning process of grandParentOf(wuzetian,li4).

[0089] like Fig. 9 As shown, Fig. 9 The necessary knowledge required to construct the argument is shown below; in the figure, the argument grandParentOf_wuzetian_li4 has 2 direct sub-arguments, 1 top rule (rule-479622569) and 1 conclusion (conc349977974, i.e., assertion grandParentOf(wuzetian,li4)).

[0090] Direct child argument of grandParentOf_wuzetian_li4

[0091]

[0092] The argument is constructed by applying the top rule based on a series of direct sub-arguments. The conclusion of the argument is derived by combining the conclusions of the direct sub-arguments with the top rule deduction, such as Fig.10 As shown, the top rule of argument grandParentOf_wuzetian_li4 is rule-479622569, and the content of the rule is shown below:

[0093]

[0094] It can be seen from the content of this rule that by taking the conclusions of each direct sub-argument as the premise and applying this rule, we can deduce the conclusion of the argument grandParentOf_wuzetian_li4, "grandParentOf(wuzetian,li4)".

[0095] According to grandParentOf_wuzetian_li4's argument structure, the reasoning process can be converted into the following representation for model training:

[0096]

[0097] The present invention can obtain the logical reasoning process of graph data by synthesizing data of the inference tree structure. Using the inference tree, the model can better understand the structure of logical reasoning, evaluate and correct the logical reasoning process. Using the tree structure to express the intermediate process of reasoning can be used to improve the prompt engineering, that is, by designing appropriate questions and prompts, the reasoning ability of the model can be better exerted.

[0098] In some embodiments, Fig.11 As shown, the present invention also provides a system 1 using the above-mentioned synthesis method of inference tree data, comprising:

[0099] An acquisition module 11 is used to acquire the entity;

[0100] A graph data synthesis module 12, used for synthesizing graph data based on the ontology;

[0101] A first reasoning module 13, configured to use a first reasoning engine to reason on the ontology and the graph data to obtain assertions and derive explanations matching the assertions;

[0102] A conversion module 14, configured to convert the interpretation into a Prolog knowledge base and the assertion into a Prolog query using DL2Prolog;

[0103] and a second reasoning module 15, for reasoning the Prolog knowledge base and the Prolog query using a second reasoning engine to obtain a reasoning tree for deriving the Prolog query from the Prolog knowledge base.

[0104] The above-mentioned system 1 using the synthesis method of inference tree data can be implemented in the form of a computer program. The computer program can be used in Fig.12 Runs on the computer device shown.

[0105] See also Fig.12 , Fig.12 1 is a schematic block diagram of a computer device provided by an embodiment of the present invention. The computer device may be used to execute a synthesis method of inference tree data to enable an application to run stably and provide services to customers.

[0106] See also Fig.12 The computer device 300 includes a processor 301, a memory and a network interface 304 connected through a system bus, wherein the memory may include a storage medium 302 and an internal memory 303.

[0107] The storage medium 302 may store an operating system 3021 and a computer program 3022. When the computer program 3022 is executed, the processor 301 may execute the method for synthesizing inference tree data, wherein the storage medium 302 may be a volatile storage medium or a non-volatile storage medium.

[0108] The processor 301 is used to provide computing and control capabilities to support the operation of the entire computer device 300 .

[0109] The internal memory 303 provides an environment for the operation of the computer program 3022 in the storage medium 302. When the computer program 3022 is executed by the processor 301, the processor 301 can execute the method for synthesizing inference tree data.

[0110] The network interface 304 is used for network communication, such as providing data information transmission, etc. Those skilled in the art will understand that Fig.12 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device 300 to which the solution of the present invention is applied. The specific computer device 300 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0111] The processor 301 is used to run the computer program 3022 stored in the memory to implement the corresponding functions in the above-mentioned method for synthesizing inference tree data.

[0112] Those skilled in the art will understand that Fig.12 The embodiments of the computer device shown in the figure do not constitute a limitation on the specific composition of the computer device. In other embodiments, the computer device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. For example, in some embodiments, the computer device may only include a memory and a processor. In such embodiments, the structure and function of the memory and the processor are the same as those of the embodiment of the present invention. Figure 4 The embodiments shown are consistent and will not be described again here.

[0113] It should be understood that in the embodiment of the present invention, the processor 301 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0114] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium may be a volatile or non-volatile computer-readable storage medium. The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps included in the above-mentioned method for synthesizing inference tree data are implemented.

[0115] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the above-described equipment, system and unit can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. Those of ordinary skill in the art can appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0116] Optionally, specific examples in the present invention may refer to the examples described in the above embodiments and optional implementation modes.

[0117] The specific embodiments of the present invention described above are for description only and do not represent the advantages or disadvantages of the embodiments.

[0118] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0119] In the several embodiments provided by the present invention, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the system embodiments described above are only exemplary, for example, multiple devices can be combined or integrated into another system, or some features can be ignored or not executed.

[0120] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for synthesizing inference tree data, characterized in that: include: Get the ontology; Based on the ontology, synthesizing graph data, the graph data including a positive example assertion set and a negative example assertion set; reasoning the ontology and the graph data using a first reasoning engine to obtain assertions and derive explanations matching the assertions; Using DL2Prolog to convert the interpretation into a Prolog knowledge base and the assertion into a Prolog query; and using a second inference engine to infer the Prolog knowledge base and the Prolog query to obtain an inference tree that derives the Prolog query from the Prolog knowledge base; The method of using a first inference engine to reason with the ontology and the graph data to obtain assertions and derive explanations matching the assertions includes: using a Pellet inference engine to reason with a knowledge base jointly constituted by the ontology and the positive assertion set; for each newly introduced assertion, using the Pellet inference engine to derive an explanation of the assertion, and forming an assertion-explanation pair with the assertion and the corresponding explanation; and for each negative assertion in the negative assertion set, using the Pellet inference engine to reason with the ontology, the positive assertion set and the negative assertion to obtain an inconsistent explanation, and forming an assertion-explanation pair with the negation of the negative assertion and the corresponding explanation; The method of converting the explanation into a Prolog knowledge base and the assertion into a Prolog query by using DL2Prolog includes: converting the explanation in the assertion-explanation pair into a Prolog knowledge base by using DL2Prolog; converting the assertion in the assertion-explanation pair into a Prolog query by using DL2Prolog; and forming a query-knowledge base pair based on the Prolog knowledge base and the Prolog query; The method of using a second inference engine to reason with the Prolog knowledge base and the Prolog query to obtain an inference tree for deriving the Prolog query from the Prolog knowledge base comprises: using tuProlog to reason with each query-knowledge base pair, using the Prolog knowledge base and the Prolog query as theory and query input of tuProlog respectively, to obtain an inference tree for deriving the Prolog query from the Prolog knowledge base.

2. The method for synthesizing inference tree data according to claim 1, characterized in that: The obtaining of the ontology comprises: The ontology is obtained by expressing a Web ontology language and a semantic Web rule language; and the ontology is inferred by using a Pellet inference engine to detect whether the ontology is consistent. If the ontology is consistent, the step of synthesizing graph data based on the ontology is entered.

3. The method for synthesizing inference tree data according to claim 2, characterized in that: The method of using a second inference engine to infer the Prolog knowledge base and the Prolog query to obtain an inference tree for deriving the Prolog query from the Prolog knowledge base further includes: If the tuProlog does not obtain an inference tree within the preset time, the inference is stopped, and the order of all clauses in the Prolog knowledge base is randomly rearranged, and the rearranged Prolog knowledge base and the Prolog query are used as the theory and query input of the tuProlog for reasoning, until an inference tree that derives the Prolog query from the Prolog knowledge base is successfully obtained within the preset time.

4. A system using the method for synthesizing inference tree data according to any one of claims 1 to 3, characterized in that: include: An acquisition module, used to acquire the ontology; A graph data synthesis module, used to synthesize graph data based on the ontology, wherein the graph data includes a positive example assertion set and a negative example assertion set; a first reasoning module, configured to use a first reasoning engine to reason on the ontology and the graph data to obtain assertions and derive explanations matching the assertions; A conversion module, for converting the interpretation into a Prolog knowledge base and converting the assertion into a Prolog query using DL2Prolog; and a second reasoning module, configured to use a second reasoning engine to reason on the Prolog knowledge base and the Prolog query to obtain a reasoning tree for deriving the Prolog query from the Prolog knowledge base; The adopting of the first inference engine to reason with the ontology and the graph data to obtain assertions and derive explanations matching the assertions comprises: using the Pellet inference engine to reason with the knowledge base jointly constituted by the ontology and the positive example assertion set; for each newly introduced assertion, using the Pellet inference engine to obtain an explanation for deriving the assertion, and forming an assertion-explanation pair with the assertion and the corresponding explanation; and for each negative example assertion in the negative example assertion set, using the Pellet inference engine to reason with the ontology, the positive example assertion set and the negative example assertion to obtain an inconsistent explanation, and forming an assertion-explanation pair with the negation of the negative example assertion and the corresponding explanation; The method of converting the explanation into a Prolog knowledge base and the assertion into a Prolog query by using DL2Prolog includes: converting the explanation in the assertion-explanation pair into a Prolog knowledge base by using DL2Prolog; converting the assertion in the assertion-explanation pair into a Prolog query by using DL2Prolog; and forming a query-knowledge base pair based on the Prolog knowledge base and the Prolog query; The method of using a second inference engine to reason with the Prolog knowledge base and the Prolog query to obtain an inference tree for deriving the Prolog query from the Prolog knowledge base comprises: using tuProlog to reason with each query-knowledge base pair, using the Prolog knowledge base and the Prolog query as theory and query input of tuProlog respectively, to obtain an inference tree for deriving the Prolog query from the Prolog knowledge base.

5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method for synthesizing inference tree data according to any one of claims 1 to 3 is implemented.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for synthesizing inference tree data according to any one of claims 1 to 3 is implemented.