Inference method and device, computer equipment, storage medium and computer program product

By performing semantic transformation and multi-model reasoning on the query object, combined with knowledge base verification, and selecting the most reliable reasoning result, the problem of unreliability of a single model is solved, and a more reliable reasoning result output is achieved.

CN121660080APending Publication Date: 2026-03-13CHINA LIFE INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-02
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

In existing technologies, single inference models often produce inaccurate or unreliable inference results due to limitations in training data, algorithmic bias, or domain-specific knowledge.

Method used

By performing semantic transformation on the query objects, multiple query objects are generated and input into different inference models. The semantic differences and logical relationships of the inference results are analyzed, and the confidence level of the facts is determined in combination with the target knowledge base. Finally, the most reliable inference result is selected.

Benefits of technology

It improves the reliability of inference results, reduces the limitations of individual models, and ensures that the output results are more accurate and reliable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121660080A_ABST
    Figure CN121660080A_ABST
Patent Text Reader

Abstract

The invention relates to an inference method and device, computer equipment, a storage medium and a computer program product. The method comprises the steps of obtaining query objects, performing semantic transformation processing on the query objects to further obtain a plurality of query objects, and inputting the query objects into different reasoning models to obtain a plurality of reasoning results output by the reasoning models for the query objects; for any two reasoning results, determining a semantic difference between the two reasoning results, and determining a logical relationship between the two reasoning results; based on a target knowledge base corresponding to the query object, determining the fact confidence of each reasoning result; and determining a target reasoning result from the reasoning results based on the semantic difference of the reasoning results, the logic relationship and the fact confidence. The method can improve the reliability of the reasoning result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a reasoning method, apparatus, computer device, storage medium, and computer program product. Background Technology

[0002] Currently, AI-generated content and large-scale language models are widely used in reasoning tasks such as logical reasoning, mathematical calculations, and fact-checking. Existing technologies typically rely on a single reasoning model to process user queries. For example, when a user enters a query, the system directly uses a pre-trained reasoning model (such as a rule-based or machine learning model) to generate the reasoning result.

[0003] However, this single-model approach has significant limitations: because each inference model may be constrained by its training data, algorithmic biases, or domain-specific knowledge, the generated inference results are often inaccurate or unreliable. Therefore, improving the reliability of inference results has become an urgent problem to be solved. Summary of the Invention

[0004] Therefore, it is necessary to provide a reasoning method, apparatus, computer device, storage medium, and computer program product to address the aforementioned technical problems.

[0005] Firstly, this application provides a reasoning method. The method includes:

[0006] Obtain a query object, perform semantic transformation on the query object to obtain multiple query objects, and input each query object into a different inference model to obtain multiple inference results output by each inference model for each query object.

[0007] For any two inference results, determine the semantic differences between the two inference results and determine the logical relationship between the two inference results;

[0008] Based on the target knowledge base corresponding to the query object, the fact confidence level of each of the inference results is determined respectively;

[0009] Based on the semantic differences of each of the inference results, the logical relationships, and the factual confidence, the target inference result is determined from each of the inference results.

[0010] In one embodiment, determining the factual confidence level of each inference result based on the target knowledge base corresponding to the query object includes:

[0011] For any of the aforementioned reasoning results, entity information and relational information are extracted from the reasoning results, and the target knowledge base corresponding to the query object is queried based on each of the aforementioned entity information to obtain the query results;

[0012] The factual confidence of the inference result is determined based on whether the relationships between the entity information represented by the query results match the relationship information.

[0013] In one embodiment, determining the target inference result from the inference results based on the semantic differences, logical relationships, and factual confidence levels includes:

[0014] Based on the semantic differences of each reasoning result, the logical relationships, and the factual confidence, a global reasoning credibility index is determined;

[0015] When the global reasoning credibility index is greater than or equal to a preset index threshold, the reasoning results with fact confidence greater than the first preset credibility threshold are taken as candidate reasoning results, and the target reasoning result is determined from each candidate reasoning result based on the semantic differences and logical relationships between each candidate reasoning result and other reasoning results.

[0016] In one embodiment, the method further includes:

[0017] When the global reasoning credibility index is less than the preset index threshold, the reasoning results with fact confidence less than the second preset credibility threshold are taken as reasoning results to be deleted, and the reasoning results with corresponding contradictory logical relationships are taken as reasoning results to be deleted.

[0018] The process involves deleting the inference result to be deleted from each of the inference results and then proceeding to the step of determining a global inference credibility index based on the semantic differences, logical relationships, and factual confidence of each of the inference results.

[0019] In one embodiment, determining the global reasoning credibility index based on the semantic differences of each reasoning result, the logical relationship, and the factual confidence level includes:

[0020] For any of the query objects, based on the semantic differences between the inference results corresponding to the query objects, a semantic uncertainty index corresponding to the query object is determined, and a global semantic uncertainty index is determined based on the semantic uncertainty index of each of the query objects;

[0021] Based on the fact confidence levels of each of the aforementioned inference results, a global fact confidence index is determined;

[0022] Based on the number of contradictory logical relationships, determine the global logical uncertainty index;

[0023] The global reasoning credibility index is determined based on the global semantic uncertainty index, the global fact confidence index, and the global logical uncertainty index.

[0024] In one embodiment, determining the target reasoning result from the candidate reasoning results based on the semantic differences and logical relationships between each candidate reasoning result and other reasoning results includes:

[0025] For any of the candidate reasoning results, a reasoning credibility index is determined based on the semantic differences and logical relationships between the other reasoning results and the candidate reasoning results.

[0026] Based on the reasoning credibility index of each candidate reasoning result, the target reasoning result is determined from each candidate reasoning result.

[0027] Secondly, this application also provides a reasoning device. The device includes:

[0028] The acquisition module is used to acquire query objects, perform semantic transformation processing on the query objects to obtain multiple query objects, and input each query object into a different inference model to obtain multiple inference results output by each inference model for each query object.

[0029] The first determining module is used to determine the semantic difference between any two inference results and to determine the logical relationship between the two inference results;

[0030] The second determining module is used to determine the fact confidence level of each of the inference results based on the target knowledge base corresponding to the query object.

[0031] The third determining module is used to determine the target reasoning result from the reasoning results based on the semantic differences of each reasoning result, the logical relationship, and the factual confidence level.

[0032] In one embodiment, the second determining module is further configured to:

[0033] For any of the aforementioned reasoning results, entity information and relational information are extracted from the reasoning results, and the target knowledge base corresponding to the query object is queried based on each of the aforementioned entity information to obtain the query results;

[0034] The factual confidence of the inference result is determined based on whether the relationships between the entity information represented by the query results match the relationship information.

[0035] In one embodiment, the third determining module is further configured to:

[0036] Based on the semantic differences of each reasoning result, the logical relationships, and the factual confidence, a global reasoning credibility index is determined;

[0037] When the global reasoning credibility index is greater than or equal to a preset index threshold, the reasoning results with fact confidence greater than the first preset credibility threshold are taken as candidate reasoning results, and the target reasoning result is determined from each candidate reasoning result based on the semantic differences and logical relationships between each candidate reasoning result and other reasoning results.

[0038] In one embodiment, the device further includes:

[0039] The processing module is used to, when the global reasoning confidence index is less than a preset index threshold, take the reasoning result with the fact confidence index less than a second preset confidence threshold as the reasoning result to be deleted, and take the reasoning result with the corresponding logical relationship that is contradictory as the reasoning result to be deleted.

[0040] The deletion module is used to delete the inference result to be deleted from each of the inference results, and jump to the step of determining the global inference credibility index based on the semantic differences of each of the inference results, the logical relationship and the factual confidence.

[0041] In one embodiment, the third determining module is further configured to:

[0042] For any of the query objects, based on the semantic differences between the inference results corresponding to the query objects, a semantic uncertainty index corresponding to the query object is determined, and a global semantic uncertainty index is determined based on the semantic uncertainty index of each of the query objects;

[0043] Based on the fact confidence levels of each of the aforementioned inference results, a global fact confidence index is determined;

[0044] Based on the number of contradictory logical relationships, determine the global logical uncertainty index;

[0045] The global reasoning credibility index is determined based on the global semantic uncertainty index, the global fact confidence index, and the global logical uncertainty index.

[0046] In one embodiment, the third determining module is further configured to:

[0047] For any of the candidate reasoning results, a reasoning credibility index is determined based on the semantic differences and logical relationships between the other reasoning results and the candidate reasoning results.

[0048] Based on the reasoning credibility index of each candidate reasoning result, the target reasoning result is determined from each candidate reasoning result.

[0049] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement any of the methods described above.

[0050] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements any of the above methods.

[0051] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements any of the above methods.

[0052] The aforementioned reasoning methods, apparatus, computer devices, storage media, and computer program products first perform semantic transformation processing on the query object to generate multiple query objects, which are then input into different reasoning models to obtain multiple reasoning results. Next, by analyzing the semantic differences and logical relationships between any two reasoning results and combining this with a target knowledge base, the factual confidence level of each reasoning result is determined. Finally, the target reasoning result is selected based on a comprehensive analysis of these indicators. This application's embodiments generate multiple reasoning results for multiple semantic heterogeneities of the query object using multiple models, and cross-validate these results with a knowledge base. Finally, the most reliable reasoning result is selected for output based on the cross-validation results, thus reducing the limitations of a single model and improving the reliability of the final target reasoning result. Attached Figure Description

[0053] Figure 1 This is a flowchart illustrating the reasoning method in one embodiment;

[0054] Figure 2 This is a structural block diagram of the inference device in one embodiment;

[0055] Figure 3 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0056] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0057] In one embodiment, such as Figure 1As shown, a reasoning method is provided. This embodiment illustrates the method applied to a server; however, it is understood that the method can also be applied to a terminal, and further to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0058] Step 102: Obtain the query object, perform semantic transformation on the query object to obtain multiple query objects, and input each query object into a different inference model to obtain multiple inference results output by each inference model for each query object.

[0059] In this embodiment, the query object is the text input by the user. Semantic transformation refers to changing the expression of the query object by adjusting its language form while keeping its core meaning unchanged. Semantic transformation can take forms including, but not limited to, rewriting, translation, and logical expression conversion. For example, if the original query object is "Can fact b be inferred from fact a?", the rewritten query object might be "Is there a causal relationship between fact a and fact b?" or "Is a->b correct?"

[0060] After performing different forms of semantic transformation on the query object, we can obtain multiple heterogeneous representations of the original query object. These heterogeneous representations are also used as query objects, thus obtaining a set of query objects derived from the original query object.

[0061] Furthermore, multiple different inference models are obtained, and for each inference model, inference is performed once on each query object in the query object set to obtain the inference result output by each inference model for each query object. That is, if the query object set obtained based on the original query object is: original query object Q1 and derived query object Q2, and inference is performed using inference models A and B respectively, then the final inference results are: A outputs result R1A for Q1 and result R2A for Q2, B outputs result R1B for Q1 and result R2B for Q2. In other words, each combination of inference model and query object corresponds to an inference result, thus providing sufficient support for the subsequent cross-validation stage.

[0062] Step 104: For any two inference results, determine the semantic differences between the two inference results and determine the logical relationship between the two inference results.

[0063] In this embodiment, semantic difference is used to characterize whether different inference models produce contradictions when processing different heterogeneous representations of query objects. Semantic difference can be characterized in various forms. In one example, semantic difference can refer to the text similarity between inference results: each inference result can be converted into a text vector, and then the text similarity between any two inference results can be calculated using methods such as cosine similarity, and the text similarity can be used as semantic difference.

[0064] In another example, a model containing a semantic recognition module and a classification module can be pre-trained. The semantic recognition module receives the inference result as input and outputs the semantics extracted from the inference result. The classification module is used to receive the semantics of any two inference results and output the classification result of whether the two semantics are contradictory or not, and thus the classification result can be used as the semantic difference.

[0065] In another example, semantic differences can also be calculated based on the probability distribution of the inference results. A pre-trained embedding model can be used to map each inference result into a high-dimensional vector, and then the cosine similarity between the high-dimensional vector of each inference result and the high-dimensional vector of another result can be calculated. These similarities are then converted into probability distributions using a softmax function. Algorithms such as JSD (Jensen-Shannon Divergence) can then be used to calculate the similarity of the probability distributions corresponding to each inference result, and this similarity can be used as the semantic difference.

[0066] Logical relationships can be obtained using any natural language inference model. A natural language inference model can determine whether a text segment contains, contradicts, or remains neutral with another. By applying a natural language inference model to any two inference results, the logical relationship between them can be obtained.

[0067] Step 106: Based on the target knowledge base corresponding to the query object, determine the factual confidence of each reasoning result.

[0068] In this embodiment, the target knowledge base is the knowledge base of the domain to which the query object belongs. Based on the target knowledge base, the facts involved in each reasoning result can be examined to determine the factual confidence of each reasoning result.

[0069] This application does not specifically limit how to set the fact confidence level. In one example, the method for calculating the fact confidence level includes:

[0070] For any reasoning result, entity information and relational information are extracted from the reasoning result, and the target knowledge base corresponding to the query object is queried based on each entity information to obtain the query result;

[0071] The factual confidence of the inference result is determined based on whether the relationships between the entity information represented by the query results match the relationship information.

[0072] In this embodiment, any natural language processing model capable of named entity recognition and relation extraction is used to extract entity information and the relationship information between entity information from the reasoning result. For example, for the reasoning result "Yes, based on fact a, fact b can be inferred, because based on a, c can be inferred, and c can infer b", the entity information extracted may include: fact a, fact b, and fact c. The relationship information between these entity information is: a and c are inference relations, c and b are inference relations, and a and b are inference relations.

[0073] Then, based on the factual information, the system queries the target knowledge base for factual triples. For any pair of factual information to be verified, if the semantic similarity between the two entities in a factual triple and the pair of factual information is greater than a threshold, it is considered that a factual triple matching the pair of factual information has been retrieved from the target knowledge base. A confidence score can then be assigned to the pair of factual information based on whether the relation recorded in the factual triple matches the relation information between the pair of factual information.

[0074] This application does not limit how the score is set. For example, if the semantic similarity between the relation information and the relation recorded in the triple is greater than a threshold, it can be determined that the relation information matches the relation recorded in the triple, and the confidence score is set to 1. If the semantic similarity is less than or equal to the threshold, the confidence score is set to 0.

[0075] For fact pairs that do not have matching fact triples, the confidence score between such fact pairs can be set to 0.5, indicating that the knowledge base cannot verify the truth or falsehood of the relationship information between the fact pairs. After obtaining the confidence scores between all fact pairs, the average of the confidence scores can be used to obtain the fact confidence of this inference result.

[0076] Step 108: Based on the semantic differences, logical relationships and factual confidence of each reasoning result, determine the target reasoning result from each reasoning result.

[0077] In this embodiment of the application, based on the semantic differences, logical relationships and factual confidence calculated in the aforementioned steps, one or more optimal target reasoning results are selected from each reasoning result.

[0078] In one example, each inference result can be assigned an inference credibility score based on semantic differences, logical relationships, and factual confidence. The inference result with the highest score or a score greater than a threshold is selected as the target inference result. As an example, the scoring method could include: obtaining the semantic differences between the inference result and other inference results and calculating the average of these semantic differences; a larger average value results in a lower score for semantic differences (due to significant inconsistencies between the inference result and other inference results); obtaining the logical relationships between the inference result and other inference results; the more contradictory relationships among these logical relationships, the lower the score for logical relationships (due to contradictions between the inference result and other inference results); and obtaining the factual confidence of the inference result; a higher factual confidence value results in a higher score for factual confidence. Finally, the weighted sum of these three scores yields the inference credibility score.

[0079] In another example, before selecting a reasoning result as the target reasoning result, it is first determined whether the consistency among the various reasoning results is high. If the various reasoning results are generally consistent, then the selection of the target reasoning result proceeds. If the various reasoning results are inconsistent, there may be erroneous results among them that interfere with consistency. In this case, erroneous results need to be removed before selecting the target reasoning result to avoid erroneous results interfering with the determination of the target reasoning result. The above method specifically includes:

[0080] Based on the semantic differences, logical relationships, and factual confidence of each reasoning result, a global reasoning credibility index is determined.

[0081] When the global reasoning credibility index is greater than or equal to the preset index threshold, the reasoning results with fact confidence greater than the first preset credibility threshold are taken as candidate reasoning results, and the target reasoning result is determined from each candidate reasoning result based on the semantic differences and logical relationships between each candidate reasoning result and other reasoning results.

[0082] In this embodiment, a global reasoning credibility index is determined based on the semantic differences, logical relationships, and factual confidence levels of each reasoning result. The global reasoning credibility index characterizes the consistency level and reliability of all reasoning results. In one example, calculating this index may include: calculating the proportion of all pairwise reasoning result pairs where the semantic differences are below a preset difference threshold and the logical relationship is non-contradictory (i.e., neutral or inclusive), to obtain a consistency score; calculating the average factual confidence level of all reasoning results to obtain a reliability score; and then weighted summing the consistency score and reliability score to obtain the global reasoning credibility index.

[0083] In another example, the method for calculating this metric could also include:

[0084] For any query object, based on the semantic differences between the inference results corresponding to the query object, determine the semantic uncertainty index corresponding to the query object, and determine the global semantic uncertainty index based on the semantic uncertainty index of each query object;

[0085] Based on the factual confidence of each reasoning result, determine the global factual confidence index;

[0086] Based on the number of contradictory logical relationships, determine the global logical uncertainty index;

[0087] The global reasoning credibility index is determined based on the global semantic uncertainty index, the global fact confidence index, and the global logical uncertainty index.

[0088] In this embodiment, a global semantic uncertainty index, a global factual confidence index, and a global logical uncertainty index are statistically analyzed for all inference results, and then a global inference credibility index is generated based on these three indices. The global semantic uncertainty index indicates whether there are discrepancies in the inference results generated by different inference models for the same query object. For any query object, the average of the semantic differences between all pairwise inference result pairs for that query object can be calculated as its semantic uncertainty index. Furthermore, the semantic uncertainty indices of all query objects can be aggregated (e.g., by taking the average or summing) to determine the global semantic uncertainty index. The higher the value of this index, the greater the discrepancy in the understanding of the same semantic core among different inference models, and the stronger the global semantic uncertainty.

[0089] The global fact confidence index is used to indicate the overall factual reliability of various inference results. It can be calculated as the average or weighted average of the fact confidence scores of all inference results.

[0090] The global logical uncertainty index is used to indicate whether there are contradictions among the various inference results. It is calculated as the proportion of contradictory relationships to the total number of logical relationships; this proportion is used as the global logical uncertainty index. The higher the index, the more severe the logical conflicts within the set of inference results.

[0091] Furthermore, a global reasoning credibility index can be calculated based on the global semantic uncertainty index, the global factual confidence index, and the global logical uncertainty index. For example, to ensure that a higher global reasoning credibility index indicates a more credible reasoning result, a positive weight can be assigned to the global factual confidence index, while negative weights can be assigned to the global semantic uncertainty index and the global logical uncertainty index. The global reasoning credibility index is then calculated using a weighted summation method.

[0092] If the global reasoning credibility index is greater than or equal to a preset index threshold, the process proceeds to the branch where the target reasoning result is selected from the reasoning results. In one embodiment, the above method further includes:

[0093] For any candidate reasoning result, the reasoning credibility index of the candidate reasoning result is determined based on the semantic differences and logical relationships between other reasoning results and the candidate reasoning result.

[0094] Based on the reasoning credibility index of each candidate reasoning result, the target reasoning result is determined from each candidate reasoning result.

[0095] In this embodiment of the application, when the global reasoning credibility index is greater than or equal to a preset index threshold, one or more reasoning results can be selected as the target reasoning result.

[0096] Specifically, reasoning results with a factual confidence level greater than a first preset confidence threshold can be selected as candidate reasoning results. Then, the target reasoning result is determined from these candidate results, ensuring that the content of the target reasoning result is verified by the target knowledge base and possesses high reliability. The first preset confidence threshold can be set by those skilled in the art according to actual needs.

[0097] Then, for any candidate reasoning result, based on the semantic differences and logical relationships between the candidate reasoning result and other reasoning results (including those not selected as candidates and other candidate reasoning results), the reasoning credibility index of the candidate reasoning result is determined. In one example, the calculation of this index may include: calculating the semantic differences between the candidate reasoning result and each other reasoning result, and taking the inverse average of these semantic differences; the higher the value, the more consistent the candidate result is with the group; simultaneously, counting the number of logical contradictions between the candidate reasoning result and all other reasoning results; the fewer the number, the better its logical consistency. The inverse average and the inverse of the number of contradictions can then be weighted and summed to obtain the reasoning credibility index of the candidate reasoning result.

[0098] After obtaining the reasoning credibility index of all candidate reasoning results, the final target reasoning result is determined from each candidate reasoning result. This application embodiment does not limit the determination method. For example, the candidate reasoning result with the highest reasoning credibility index can be selected as the target reasoning result; or all candidate reasoning results with reasoning credibility indices greater than a threshold can be determined as the target reasoning result and output, allowing the user to determine which target reasoning result to select as the final reasoning result.

[0099] In one embodiment, the above method further includes:

[0100] When the global reasoning credibility index is less than the preset index threshold, reasoning results with factual confidence less than the second preset credibility threshold are used as reasoning results to be deleted, and reasoning results with corresponding logical relationships that are contradictory are used as reasoning results to be deleted.

[0101] Remove the inference results to be deleted from each inference result, and jump to the step of determining the global inference credibility index based on the semantic differences, logical relationships and factual confidence of each inference result.

[0102] In this embodiment of the application, when the global reasoning credibility index is less than the preset index threshold, it indicates that there is a significant contradiction between the reasoning results or the reliability of the facts is not strong. At this time, it is necessary to determine one or more reasoning results to be deleted from the reasoning results to avoid unreliable reasoning results interfering with the selection of the target reasoning result.

[0103] Reasoning results to be deleted can be those with low factual confidence or those that significantly contradict other reasoning results. When judging based on factual confidence, reasoning results with a factual confidence level lower than a second preset confidence threshold can be considered as reasoning results to be deleted. The second preset confidence threshold can be set lower than the aforementioned first preset confidence threshold. When judging based on whether there is a contradiction with other reasoning results, reasoning results corresponding to contradictory logical relationships can be considered as reasoning results to be deleted.

[0104] After deleting the inference results to be deleted from each inference result, re-execute the step of calculating the global inference credibility index. If the recalculated global inference credibility index is still lower than the threshold, repeat the above filtering and recalculation process (each time it is repeated, the second preset credibility threshold can be appropriately lowered to delete more unreliable inference results) until the global inference credibility index meets the threshold requirement, and then proceed to the step of determining the target inference result.

[0105] The reasoning method provided in this application first performs semantic transformation on the query object to generate multiple query objects, and inputs each into a different reasoning model to obtain multiple reasoning results. Then, by analyzing the semantic differences and logical relationships between any two reasoning results and combining this with a target knowledge base, the factual confidence level of each reasoning result is determined. Finally, the target reasoning result is selected based on a comprehensive analysis of these indicators. This application generates multiple reasoning results for multiple semantic heterogeneities of the query object using multiple models, and cross-validates these results with a knowledge base. Finally, the most reliable reasoning result is selected for output based on the cross-validation results, thus reducing the limitations of a single model and improving the reliability of the final target reasoning result.

[0106] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0107] Based on the same inventive concept, this application also provides a reasoning apparatus for implementing the reasoning method described above. The solution provided by this apparatus is similar to the solution described in the above method; therefore, specific limitations in one or more of the reasoning apparatus embodiments provided below can be found in the limitations of the reasoning method described above, and will not be repeated here.

[0108] In one embodiment, such as Figure 2 As shown, a reasoning device 200 is provided, including: an acquisition module 202, a first determination module 204, a second determination module 206, and a third determination module 208, wherein:

[0109] The acquisition module 202 is used to acquire a query object, perform semantic transformation processing on the query object to obtain multiple query objects, and input each query object into a different reasoning model to obtain multiple reasoning results output by each reasoning model for each query object.

[0110] The first determining module 204 is used to determine the semantic difference between any two inference results and to determine the logical relationship between the two inference results;

[0111] The second determining module 206 is used to determine the fact confidence level of each of the inference results based on the target knowledge base corresponding to the query object;

[0112] The third determining module 208 is used to determine the target reasoning result from the reasoning results based on the semantic differences of each reasoning result, the logical relationship, and the factual confidence level.

[0113] In one embodiment, the second determining module 206 is further configured to:

[0114] For any of the aforementioned reasoning results, entity information and relational information are extracted from the reasoning results, and the target knowledge base corresponding to the query object is queried based on each of the aforementioned entity information to obtain the query results;

[0115] The factual confidence of the inference result is determined based on whether the relationships between the entity information represented by the query results match the relationship information.

[0116] In one embodiment, the third determining module 208 is further configured to:

[0117] Based on the semantic differences of each reasoning result, the logical relationships, and the factual confidence, a global reasoning credibility index is determined;

[0118] When the global reasoning credibility index is greater than or equal to a preset index threshold, the reasoning results with fact confidence greater than the first preset credibility threshold are taken as candidate reasoning results, and the target reasoning result is determined from each candidate reasoning result based on the semantic differences and logical relationships between each candidate reasoning result and other reasoning results.

[0119] In one embodiment, the device further includes:

[0120] The processing module is used to, when the global reasoning confidence index is less than a preset index threshold, take the reasoning result with the fact confidence index less than a second preset confidence threshold as the reasoning result to be deleted, and take the reasoning result with the corresponding logical relationship that is contradictory as the reasoning result to be deleted.

[0121] The deletion module is used to delete the inference result to be deleted from each of the inference results, and jump to the step of determining the global inference credibility index based on the semantic differences of each of the inference results, the logical relationship and the factual confidence.

[0122] In one embodiment, the third determining module 208 is further configured to:

[0123] For any of the query objects, based on the semantic differences between the inference results corresponding to the query objects, a semantic uncertainty index corresponding to the query object is determined, and a global semantic uncertainty index is determined based on the semantic uncertainty index of each of the query objects;

[0124] Based on the fact confidence levels of each of the aforementioned inference results, a global fact confidence index is determined;

[0125] Based on the number of contradictory logical relationships, determine the global logical uncertainty index;

[0126] The global reasoning credibility index is determined based on the global semantic uncertainty index, the global fact confidence index, and the global logical uncertainty index.

[0127] In one embodiment, the third determining module is further configured to:

[0128] For any of the candidate reasoning results, a reasoning credibility index is determined based on the semantic differences and logical relationships between the other reasoning results and the candidate reasoning results.

[0129] Based on the reasoning credibility index of each candidate reasoning result, the target reasoning result is determined from each candidate reasoning result.

[0130] Each module in the above-mentioned device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0131] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 3 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a reasoning method.

[0132] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0133] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0134] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0135] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0136] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0137] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0138] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0139] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A reasoning method, characterized in that, The method includes: Obtain a query object, perform semantic transformation on the query object to obtain multiple query objects, and input each query object into a different inference model to obtain multiple inference results output by each inference model for each query object. For any two inference results, determine the semantic differences between the two inference results and determine the logical relationship between the two inference results; Based on the target knowledge base corresponding to the query object, the fact confidence of each of the inference results is determined respectively; Based on the semantic differences of each of the inference results, the logical relationships, and the factual confidence, the target inference result is determined from each of the inference results.

2. The method according to claim 1, characterized in that, The step of determining the factual confidence level of each inference result based on the target knowledge base corresponding to the query object includes: For any of the aforementioned reasoning results, entity information and relational information are extracted from the reasoning results, and the target knowledge base corresponding to the query object is queried based on each of the aforementioned entity information to obtain the query results; The factual confidence of the inference result is determined based on whether the relationships between the entity information represented by the query results match the relationship information.

3. The method according to claim 1, characterized in that, The process of determining the target inference result from the inference results based on the semantic differences, logical relationships, and factual confidence levels includes: Based on the semantic differences of each reasoning result, the logical relationships, and the factual confidence, a global reasoning credibility index is determined; When the global reasoning credibility index is greater than or equal to a preset index threshold, the reasoning results with fact confidence greater than the first preset credibility threshold are taken as candidate reasoning results, and the target reasoning result is determined from each candidate reasoning result based on the semantic differences and logical relationships between each candidate reasoning result and other reasoning results.

4. The method according to claim 3, characterized in that, The method further includes: When the global reasoning credibility index is less than the preset index threshold, the reasoning results with fact confidence less than the second preset credibility threshold are taken as reasoning results to be deleted, and the reasoning results with corresponding contradictory logical relationships are taken as reasoning results to be deleted. The process involves deleting the inference result to be deleted from each of the inference results and then proceeding to the step of determining a global inference credibility index based on the semantic differences, logical relationships, and factual confidence of each of the inference results.

5. The method according to claim 3, characterized in that, The determination of a global reasoning credibility index based on the semantic differences of each reasoning result, the logical relationships, and the factual confidence level includes: For any of the query objects, based on the semantic differences between the inference results corresponding to the query objects, a semantic uncertainty index corresponding to the query object is determined, and a global semantic uncertainty index is determined based on the semantic uncertainty index of each of the query objects; Based on the fact confidence levels of each of the aforementioned inference results, a global fact confidence index is determined; Based on the number of contradictory logical relationships, determine the global logical uncertainty index; The global reasoning credibility index is determined based on the global semantic uncertainty index, the global fact confidence index, and the global logical uncertainty index.

6. The method according to claim 3, characterized in that, The step of determining the target reasoning result from the candidate reasoning results based on the semantic differences and logical relationships between each candidate reasoning result and other reasoning results includes: For any of the candidate reasoning results, a reasoning credibility index is determined based on the semantic differences and logical relationships between the other reasoning results and the candidate reasoning results. Based on the reasoning credibility index of each candidate reasoning result, the target reasoning result is determined from each candidate reasoning result.

7. A reasoning device, characterized in that, The device includes: The acquisition module is used to acquire query objects, perform semantic transformation processing on the query objects to obtain multiple query objects, and input each query object into a different inference model to obtain multiple inference results output by each inference model for each query object. The first determining module is used to determine the semantic difference between any two inference results and to determine the logical relationship between the two inference results; The second determining module is used to determine the fact confidence level of each of the inference results based on the target knowledge base corresponding to the query object. The third determining module is used to determine the target reasoning result from the reasoning results based on the semantic differences of each reasoning result, the logical relationship, and the factual confidence level.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A 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 steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.