An explainable question answering method and system based on fact retrieval and verification enhancement

CN118733742BActive Publication Date: 2026-09-11SHANXI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410960332.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2026-09-11
Estimated Expiration
2044-07-17

AI Technical Summary

Technical Problem

[0006]针对目前结构树生成面临的搜索空间较大和错误累积的问题,本发明提供了一种基于事实检索和验证增强的可解释问答方法及系统

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733742B_ABST
    Figure CN118733742B_ABST
Patent Text Reader

Abstract

The application discloses an explainable question and answer method and system based on fact retrieval and verification enhancement, and belongs to the technical field of natural language processing. In view of the problems of a large search space and error accumulation faced by current structure tree generation, the application provides an explainable question and answer system based on fact retrieval and verification enhancement, which comprises a fact retrieval module, a bidirectional reasoning module, a multi-view contrast learning module, a cross-validation module and a proof search module. The bidirectional reasoning method based on deduction and tracing of the application generates candidate steps in a bottom-up and top-down manner respectively, and a cross-validation and multi-view contrast learning mechanism is designed to enhance the reliability of a single proof step from the perspectives of supportiveness and similarity. Finally, the application searches for the best structured reasoning chain by aligning and fusing the bidirectional structure trees, thereby enhancing the structured explanation and reasoning capability of the question and answer system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of natural language processing technology, specifically relating to an interpretable question-answering method and system based on fact retrieval and verification enhancement. Background Technology

[0002] Intelligent question answering (QA) is a technology that enables computers to understand the semantics of articles and answer related questions. It is an important research task in the field of natural language processing (NLP) and an effective means of evaluating the level of machine intelligence. It has wide application value in information retrieval, intelligent customer service, smart justice and other fields.

[0003] In recent years, with the rapid development of deep learning technology, especially the emergence of large language models such as ChatGPT, the performance of intelligent question answering tasks has been significantly improved, even surpassing human performance in some metrics. However, language models based on deep neural networks are essentially "black boxes," and as the number of model parameters and complexity increase, the uninterpretability of question answering systems becomes increasingly prominent. Users often "know what" the model provides, but not why, which seriously hinders the application of question answering systems in key areas. Therefore, researching the interpretability of question answering systems is crucial; providing the reasoning process from question to answer helps improve the model's tunability and credibility.

[0004] Explainable Question Answering (XQA) aims to provide an explanation along with the answer to a question. Current research focuses on three main aspects: extracting keywords containing the answer, generating multi-hop structured explanation chains, and generating free-form text explanations. Among these, structured implication trees (XIBTs) provide explanations to users in a clearer and richer form by demonstrating the reasoning process from given facts to the answer. The generation of structured implication trees has been extensively studied. Most existing works use a step-by-step approach to generate structured reasoning chains. RLET designed an implication tree generation framework based on reinforcement learning, iteratively performing single-step reasoning through a sentence selection module and a deductive generation module. NLProofs introduces an independent verification mechanism to check the validity of proof steps, preventing invalid steps that generate illusions. MetGen proposes a modular implication tree generation method and introduces backward reasoning to enhance the validity of proof steps.

[0005] Existing tree structure generation methods still face two challenges: (1) combination failures due to the large fact search space; and (2) the accumulation of errors leading to invalid steps. Current work mainly employs forward deductive reasoning to perform single-step reasoning. Deductive reasoning is a bottom-up forward reasoning method that requires iteratively searching known facts to generate intermediate conclusions until the target hypothesis is proven. As new reasoning conclusions are added to the knowledge facts, the search space expands continuously in each iteration, easily leading to combination failures. In addition, the stepwise generation method inherently suffers from the problem of error accumulation. As the number of proof steps increases, the model may quickly generate invalid proofs, leading to the inaccuracy of the tree structure. Summary of the Invention

[0006] To address the problems of large search space and error accumulation in current structure tree generation, this invention provides an interpretable question answering method and system based on fact retrieval and verification enhancement.

[0007] To achieve the above objectives, the present invention employs the following technical solutions:

[0008] An interpretable question-answering system based on fact retrieval and verification enhancement includes a fact retrieval module, a bidirectional reasoning module, a multi-view comparison learning module, a cross-validation module, and a proof search module;

[0009] The fact retrieval module is used to filter the candidate fact set constructed based on context, and dynamically remove facts that are irrelevant to the target hypothesis (constructed by questions and answers) to reduce the search space;

[0010] The bidirectional reasoning module uses a pre-trained language model T5-Large with an encoder-decoder architecture as the deductive and abductive reasoners, respectively. It generates single-step proof steps in a deductive (bottom-up) and abductive (top-down) manner, and obtains candidate structure trees for deductive and abductive reasoning through iterative calculation.

[0011] The multi-view contrast learning module constructs a local contrast loss at the encoder end of the deductive and abductive inference system using the target hypothesis and the golden fact sentence given in the training data, and constructs a global contrast loss at the decoder end using the candidate steps generated by the beam search algorithm, the golden steps in the original data, and the remaining target steps in the training batch.

[0012] The cross-validation module utilizes the golden steps in the training data to construct deductive and abductive data and train deductive and abductive scorers to enhance the reliability of individual proof steps during bidirectional reasoning.

[0013] The proof search module aligns the candidate structure trees obtained from deductive and abductive reasoning, and searches the jointly constructed graph to obtain the optimal structure tree, thus obtaining the reasoning steps from the contextual fact sentences to the target hypothesis.

[0014] An interpretable question-answering method based on fact retrieval and verification enhancement for interpretable question-answering systems includes the following steps:

[0015] Step 1: The fact retrieval module performs initial filtering on the context-based candidate fact set, dynamically eliminating knowledge facts that are irrelevant to the hypothesis;

[0016] Step 2: Generate a single proof step using the bidirectional reasoning module, where the deductive and abductive generators generate candidate steps in a bottom-up and top-down manner, respectively;

[0017] Step 3: Use the multi-view comparison learning module to narrow the semantic distance between the hypothesis and the golden facts, and enhance the reliability of the proof steps from the perspective of similarity;

[0018] Step 4: Use the cross-validation module to mutually verify the deductive and abductive steps, thereby enhancing the reliability of the proof steps from the perspective of support.

[0019] Step 5: Align the candidate structure trees obtained by bidirectional reasoning through the proof search module, and design a fusion algorithm to obtain the optimal structure tree.

[0020] Furthermore, step 1, which involves preliminary filtering of the candidate fact set through the fact retrieval module and dynamically eliminating knowledge facts irrelevant to the hypothesis, specifically includes the following steps:

[0021] Step 1.1: Use the pre-trained language model ALBERT as the encoder to process the hypothesis. and facts Encode the hypothesis using average pooling. Sentence embedding representation and sentence embedding representation of each fact ;

[0022] Step 1.2: A multilayer perceptron constructed from a fully connected neural network is used to obtain the relevance score for each fact. The calculation formula is shown below: ;in, It is the sigmoid activation function, and [∙] represents the concatenation operation. It is a multilayer perceptron consisting of two layers of feedforward networks. This represents the relevance score for each sentence;

[0023] In a tree structure, if a fact has a shallower depth, meaning it's closer to the root node, then it should be closer to the target hypothesis than facts with greater depth. Therefore, a marginal ranking is used as the loss for the retrieval machine during training, calculated as follows: ;in, It is a golden tree with a depth of less than The fact These are the remaining irrelevant facts in the candidate fact set S. yes The number of correct ones It is the number of facts that are being interfered with. It is the edge of reality. It is a marginal loss. This is the final loss; based on the above fact scoring, a threshold is designed to dynamically filter each set of candidate facts.

[0024] Furthermore, step 2 utilizes the bidirectional reasoning module to generate a single proof step (including two leaf nodes and a generated intermediate conclusion), wherein the deductive and abductive generators generate candidate steps in a bottom-up and top-down manner, respectively, specifically including the following steps:

[0025] Step 2.1: The pre-trained language model T5-Large with an encoder-decoder architecture is used as the deductive and abductive reasoning engine to generate single-step proof steps from the bottom up and from the top down, respectively.

[0026] Step 2.1.1: Construct training data for deductive and abductive reasoning respectively from the proof steps of the Golden Tree.

[0027] Step 2.1.2, Constructing Deductive Training Data in a Bottom-Up Approach: For deduction, the data is constructed in a bottom-up approach, with each step's input including the hypothesis. In addition to the set of facts, it also includes the output of previous steps; then, the steps generated at the current moment are used as part of the input of the next step model, thus iteratively generating proof steps until the output hypothesis is labeled "hypothesis" and terminated.

[0028] Step 2.1.3: Construct abductive training data in a top-down manner: For abduction, construct training data from the Golden Tree in a top-down manner. Swap the root node of the deductive step with a certain leaf node to construct the abductive step. The abductive model outputs a certain leaf node in the step as an intermediate conclusion generated by the previous abductive model. Then, use this step as the input of the next abductive model and iteratively generate steps. Terminate when no more intermediate conclusions are generated.

[0029] Step 2.2: Construct deductive and abductive training data, and train the deductive and abductive generators respectively. The calculation formulas are shown below: ; ;in, express The proof steps generated at each moment, This represents the filtered set of knowledge facts. This represents the encoder and decoder in a sequence-to-sequence model. Indicates 1 to All abductive steps generated at any given moment; Indicates 1 to All abductive steps generated at any given moment; express The deductive steps generated at each moment; express The abductive steps generated at each time step; during training, the conditional probability likelihood loss is maximized, where the loss calculation formula for the deductive generator is shown below: ; ;in, This represents the training loss of the generator. Represents the total number of training data, steps Each token in the array is represented as , L represents the step length.

[0030] Furthermore, step 3 utilizes a multi-view contrast learning module to narrow the semantic distance between the hypothesis and the golden fact, enhancing the reliability of the proof steps from the perspective of similarity. Specifically, this includes the following steps: designing a multi-view contrast learning loss that integrates local and global information at the encoder and decoder ends of deductive and abductive reasoning, thereby narrowing the distance between the golden fact and the target hypothesis from the semantic representation level, making the generated proof steps closer to the hypothesis.

[0031] Step 3.1: Design local contrast information at the encoder end, for the assumption After encoding the factual sentences, the hypothetical sentence representation is obtained. And the sentence representation of each fact ;

[0032] Step 3.1.1, construct positive and negative samples: take the leaf nodes of the golden tree given in the training data as positive examples, then calculate the cosine similarity between the non-golden facts in the candidate fact set and the hypothesis. Facts with scores greater than a certain threshold are also taken as positive examples, and the remaining facts in the fact set are negative examples.

[0033] Based on the above positive and negative examples, a local-level contrastive loss is constructed, and the calculation process is shown in the following formula: ;in This indicates the embedding of key fact sentences. It is a collection of golden facts. It is a configurable temperature coefficient hyperparameter. It is an embedding of all factual sentences. It is a similarity measurement function, and the calculation formula is shown below: ;in, These represent the embedding of two sentences respectively. This indicates that the embedding vector of sentence x is transposed;

[0034] Step 3.2: Design the contrast loss for global information at the decoder end;

[0035] For the output of generative models, the differences in semantic information between sentences cannot be completely separated by positive and negative sample labels. In other words, even negative samples are not necessarily unrelated to the target output.

[0036] At the decoder end, a beam search algorithm is used to obtain... A diverse set of output embeddings is generated, and then combined with the target output embedding and the outputs of the remaining samples in the current batch to construct a set of contrast samples. and create sample pairs Where k represents the embedding representation of each sample, and + and - are determined by the sample's rank, which is obtained by calculating a sequence-level score with the target output to reflect the relative differences between the contrastive samples; the calculation process for the contrastive learning loss of global information is as follows: ;in, This represents the embedded representation of the target output. , For the embedding representation of the sample, Indicates the boundary, This indicates similarity calculation.

[0037] Furthermore, step 4 utilizes a cross-validation module to mutually validate the deductive and abductive steps, enhancing the reliability of the proof steps from a support perspective. Specifically, this includes the following steps: cross-validating the candidate steps generated by each step of the deductive and abductive inference engine to enhance the reliability of individual proof steps from a support perspective.

[0038] Step 4.1: Convert the steps of the Golden Tree in the training data into abductive steps, and construct deductive pairs and abductive pairs respectively.

[0039] Step 4.2: Jointly learn the deductive and abductive validator by fine-tuning the pre-trained ALBERT language model. For each pair of steps, represent it as (x1, x2, y). Then, concatenate the first two sentences and calculate the relevance score with the last sentence as the score for that step. The calculation process is shown in the following formula: ; ;in, It is the sigmoid activation function. and These are deductive and abductive multilayer perceptrons, respectively. and These are deductive and abductive steps, respectively. The golden proof step is regarded as a positive example, while the negative examples are constructed by randomly replacing one premise in the fact set with a non-golden fact. The ratio of positive to negative is set to 1:1, and the loss function of the validator adopts binary cross-entropy loss.

[0040] Furthermore, step 5 aligns the candidate tree structures obtained by bidirectional reasoning through the proof search module and designs a fusion algorithm to obtain the optimal tree structure. Specifically, this includes the following steps: aligning the trees obtained by the deductive and abductive generators to a proof graph, and searching for the optimal tree structure based on the score of each node. Here, the nodes of the graph come from the nodes of the two candidate trees, and the edges are the premise nodes of each proof step pointing to the conclusion nodes.

[0041] Step 5.1: Construct an initial graph based on the deductive tree obtained by the deductive generator in step 2.2. The leaf nodes and intermediate conclusion nodes of the deductive tree are used as nodes of the initial graph.

[0042] Step 5.2: Then, the part of the abduction tree obtained by the abduction generator in step 2.2 with a confidence score greater than the threshold is incorporated into the initial graph, expanding the nodes and edges of the proof graph, and assigning a score to each node; the leaf node score is set to 1.0, and the score of the intermediate conclusion node is the sum of the confidence score of the autoregressive language model and the cross-validator score;

[0043] Step 5.3: Finally, based on the proof graph and the scores of each node, the optimal structure tree is extracted by exploring different paths on the graph.

[0044] An electronic device includes at least one processor and at least one memory communicatively connected to the processor, the memory storing instructions executable by the at least one processor to enable the at least one processor to perform the fact retrieval and verification-enhanced interpretable question answering method.

[0045] A non-transitory computer-readable storage medium storing computer instructions, wherein a computer program is stored thereon, the computer program being executed by a processor of the aforementioned fact retrieval and verification-enhanced interpretable question-answering method.

[0046] Compared with the prior art, the present invention has the following advantages:

[0047] (1) This invention proposes an interpretable question answering method and system based on fact retrieval and verification enhancement. By dynamically filtering knowledge facts that are not relevant to the target hypothesis through fact retrieval, the search space is effectively reduced.

[0048] (2) This invention designs a bidirectional proof generation method based on deductive-abductive reasoning, and proposes a cross-validation and multi-view comparison learning mechanism to enhance the reliability of a single proof step from the perspectives of support and similarity.

[0049] (3) By optimizing the learning of each sub-task, the present invention can accurately generate a structured reasoning chain for answering questions, thereby enhancing the interpretability of the question-answering system. Attached Figure Description

[0050] Figure 1 This is an overall architecture diagram of an interpretable question-answering method based on fact retrieval and verification enhancement, provided in an embodiment of the present invention.

[0051] Figure 2 This is a data example used in this invention;

[0052] Figure 3 This is a structural diagram of the fact retrieval module of the present invention;

[0053] Figure 4 This is a structural diagram of the bidirectional reasoning module of the present invention;

[0054] Figure 5 This is a structural diagram of the multi-view comparison learning module of the present invention;

[0055] Figure 6 This is the structure tree generation algorithm of the present invention;

[0056] Figure 7 A schematic diagram of the structure of an interpretable question-answering system based on fact retrieval and verification enhancement provided by the present invention;

[0057] Figure 8 This is a schematic diagram of the overall structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0058] To gain a deeper understanding of this invention, we will provide a comprehensive and detailed description. However, this invention has various implementations and is not limited to the specific examples listed herein. These examples are presented to enhance a full understanding of the disclosure of this invention.

[0059] like Figure 7 As shown in the structural diagram, the present invention provides an interpretable question-answering system based on fact retrieval and verification enhancement, including a fact retrieval module, a bidirectional reasoning module, a multi-view comparison learning module, a cross-validation module, and a proof search module.

[0060] The fact retrieval module is used to filter the candidate fact set constructed based on context, and dynamically remove facts that are irrelevant to the target hypothesis (constructed by questions and answers) to reduce the search space;

[0061] The bidirectional reasoning module uses a pre-trained language model T5-Large with an encoder-decoder architecture as the deductive and abductive reasoners, respectively. It generates single-step proof steps in a deductive (bottom-up) and abductive (top-down) manner, and obtains candidate structure trees for deductive and abductive reasoning through iterative calculation.

[0062] The multi-view contrast learning module constructs a local contrast loss at the encoder end of the deductive and abductive inference system using the target hypothesis and the golden fact sentence given in the training data, and constructs a global contrast loss at the decoder end using the candidate steps generated by the beam search algorithm, the golden steps in the original data, and the remaining target steps in the training batch.

[0063] The cross-validation module utilizes the golden steps in the training data to construct deductive and abductive data and train deductive and abductive scorers to enhance the reliability of individual proof steps during bidirectional reasoning.

[0064] The proof search module aligns the candidate structure trees obtained from deductive and abductive reasoning, and searches the jointly constructed graph to obtain the optimal structure tree, thus obtaining the reasoning steps from the contextual fact sentences to the target hypothesis.

[0065] Example 1

[0066] Figure 2 This is an example of the EntailmentBank structured interpretable question-answering dataset, containing 1840 implication trees and 5881 inference steps. Each tree shows that a question-answer pair is implied by a small number of related sentences. On average, each implication tree in the dataset has 7.6 nodes (including leaf nodes, intermediate nodes, and the root node) and approximately 3.2 implication steps.

[0067] like Figure 1 The diagram shown illustrates the overall architecture of an interpretable question-answering method based on fact retrieval and verification enhancement, as provided in an embodiment of the present invention. The interpretable question-answering dataset will be further described in detail below with reference to the accompanying drawings:

[0068] Step 1: First, use the fact retrieval module to perform initial filtering of the candidate fact set, dynamically eliminating knowledge facts that are irrelevant to the hypothesis. Figure 3 This is a structural diagram of the module. This invention uses the pre-trained language model ALBERT as the encoder to process the hypotheses. and facts Encode the hypothesis using average pooling. Sentence embedding representation and sentence embedding representation of each fact Then, a multilayer perceptron constructed from a fully connected neural network is used to obtain the relevance score for each fact, calculated as follows: ;in, It is the sigmoid activation function, and [∙] represents the concatenation operation. It is a multilayer perceptron consisting of two layers of feedforward networks. This represents the relevance score for each sentence. In the tree structure, if a fact has a lower depth, i.e., is closer to the root node, then it should be closer to the target hypothesis than facts with a higher depth. Therefore, a marginal ranking is used as the loss for the retrieval machine during training, calculated as follows: ;in It is a golden tree with a depth of less than The fact These are the remaining irrelevant facts in S. yes The number of correct ones It is the number of facts that are being interfered with. It is the edge of reality. It is a marginal loss. This is the final loss. A threshold is designed based on the above fact scoring to dynamically filter each set of candidate facts.

[0069] Step 2: Use the bidirectional reasoning module to generate a single proof step. Figure 4 This is a structural diagram of the module. This invention uses the pre-trained language model T5-Large as the deductive and abductive inference engine, respectively executing bottom-up and top-down single-step proof generation. Specifically, training data for deductive and abductive reasoning is first constructed from the proof steps of the Golden Tree. For deductive reasoning, it is constructed in a bottom-up manner, with each step's input including the assumption... In addition to the fact set, the output of previous steps is also included. The step generated at the current moment is then used as part of the input for the next step, iteratively generating proof steps until the output hypothesis is labeled "hypothesis". For abduction, training data is constructed from the Golden Tree in a top-down manner. The root node of the deductive step is swapped with a leaf node to construct the abduction step. A leaf node in the output step of the abduction model is an intermediate conclusion generated by the previous abduction model. This step is then used as the input for the next abduction model, iteratively generating steps until no more intermediate conclusions are generated. Deductive and abduction training data are constructed in the above manner, and the deductive and abduction generators are trained separately. The calculation formulas are shown below: ; ;in, express The proof steps generated at each moment, This represents the filtered set of knowledge facts. This represents the encoder and decoder in a sequence-to-sequence model. Indicates 1 to All abductive steps generated at any given moment; Indicates 1 to All abductive steps generated at any given moment; express The deductive steps generated at each moment; express The abductive steps generated at each time step; during training, the conditional probability likelihood loss is maximized, where the loss calculation formula for the deductive generator is shown below: ; among the steps Each token in the array is represented as , This represents the total number of training data. This represents the training loss of the generator. L represents the step length.

[0070] Step 3: Utilize the multi-view comparison learning module to narrow the semantic distance between the hypothesis and the golden fact, enhancing the reliability of the proof step from the perspective of similarity. Figure 5 This is a structural diagram of the module. This invention designs a multi-view contrastive learning loss that integrates local and global information at the encoder and decoder ends of deductive and abductive reasoning. This brings the golden facts closer to the target hypothesis at the semantic representation level, making the generated proof steps more closely resemble the hypothesis. Specifically, firstly, local contrastive information is designed at the encoder end to... After encoding the factual sentences, the hypothetical sentence representation is obtained. And the sentence representation of each fact The construction of positive and negative samples is as follows: the leaf nodes of the golden tree given in the training data are used as positive examples, and then the cosine similarity between the non-golden facts in the fact set and the hypothesis is calculated. Facts with scores greater than a certain threshold are also used as positive examples, and the remaining facts in the fact set are negative examples.

[0071] Based on the above positive and negative examples, a local-level contrastive loss is constructed, and the calculation process is shown in the following formula: ;in This indicates the embedding of key fact sentences. It is a collection of golden facts. It is a configurable temperature coefficient hyperparameter. It is an embedding of all factual sentences. It is a similarity measurement function, and the calculation formula is shown below: ;in These represent the embedding of two sentences respectively. This involves transposing the embedding vector of sentence x; then, a contrastive loss based on global information is designed at the decoder. First, a beam search algorithm is used to obtain... A diverse set of output embeddings is generated, and then combined with the target output embedding and the outputs of the remaining samples in the current batch to construct a set of contrast samples. and create sample pairs , where k represents the embedding representation of each sample, and + and - are determined by the sample's rank, which is obtained by calculating a sequence-level score with the target output, reflecting the relative differences between the contrastive samples; the calculation process for the contrastive learning loss of global information is as follows: ;in, This represents the embedded representation of the target output. , For the embedding representation of the sample, Indicates the boundary, This indicates similarity calculation.

[0072] Step 4: The cross-validation module is used to mutually validate the deductive and abductive steps, enhancing the reliability of the proof steps from a supportive perspective. This invention performs cross-validation on the candidate steps generated by each step of the deductive and abductive inference engine, enhancing the reliability of individual proof steps from a supportive perspective. Specifically, each individual step in the Golden Tree is converted into a single inference step in abductive form, constructing deductive and abductive pairs respectively; then, the deductive and abductive validators are jointly learned by fine-tuning the pre-trained ALBERT language model. For each pair of steps, it is represented as (x1, x2, y), and the relevance score calculated between the first two sentences and the last sentence is used as the score for that step. The calculation process is shown in the following formula: ; ;in, It is the sigmoid activation function. and These are deductive and abductive multilayer perceptrons, respectively. and These are deductive and abductive steps, respectively. The golden proof step is considered as a positive example, while negative examples are constructed by randomly replacing one premise in the fact set with a non-golden fact. The ratio of positive to negative is set to 1:1, and the loss function of the validator adopts binary cross-entropy loss.

[0073] Step 5: Align the candidate structure trees obtained from bidirectional reasoning using the proof search module, and design a fusion algorithm to obtain the optimal structure tree. This invention aligns the trees obtained from deduction and abduction generators in Step 2 into a proof graph, and searches for the optimal structure tree based on the score of each node. The nodes in the graph come from nodes in both candidate trees, and the edges are the premise nodes pointing to the conclusion nodes of each proof step. Specifically, first, an initial graph is constructed based on the deduction tree. Then, abduction trees with confidence scores greater than a threshold are integrated into the initial graph, expanding the nodes and edges of the proof graph, and assigning a score to each node. The leaf node score is set to 1.0, and the score of the intermediate conclusion node is the sum of the confidence score of the autoregressive language model and the cross-validator score. Finally, based on the proof graph and the scores of each node, the optimal structure tree is extracted by exploring different paths on the graph. The structured explanation generation algorithm of this invention is as follows: Figure 6 As shown.

[0074] Example 2

[0075] This invention provides an interpretable question-answering device based on fact retrieval and verification enhancement, specifically executing the process of the above-described embodiment of an interpretable question-answering method based on fact retrieval and verification enhancement. For details, please refer to the content of the above-described embodiment of an interpretable question-answering method based on fact retrieval and verification enhancement, which will not be repeated here.

[0076] This embodiment provides an electronic device. Figure 8 This is a schematic diagram of the overall structure of an electronic device provided in an embodiment of the present invention. The device includes a processor, a memory, a communication bus, and a communication interface. The processor, communication interface, and memory communicate with each other via the communication bus. The memory stores program instructions executable by the processor. The processor can execute the methods provided in the above-described method embodiments by calling the program instructions. These methods include, for example, encoding questions, factual sentences, and hypotheses using a pre-trained language model to output semantic representations of the information; generating a single proof step using deductive and abductive reasoning; enhancing the reliability of the single proof step based on bidirectional cross-validation and multi-view contrastive learning; and searching for the optimal structured reasoning chain through the alignment and fusion of the tree structure.

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

[0078] This embodiment provides a non-transitory computer-readable storage medium that stores computer instructions. The computer instructions cause the computer to execute the methods provided in the above-described method embodiments, such as: encoding questions, factual sentences, and hypotheses using a pre-trained language model to output semantic representations of the above information; generating a single proof step using deductive and abductive reasoning; enhancing the reliability of the single proof step based on bidirectional cross-validation and multi-view contrastive learning; and searching for the optimal structured reasoning chain through alignment and fusion of the tree structure.

[0079] Contents not described in detail in this specification are prior art known to those skilled in the art. Although illustrative specific embodiments of the invention have been described above to facilitate understanding by those skilled in the art, it should be understood that the invention is not limited to the scope of the specific embodiments. Various modifications are readily apparent to those skilled in the art as long as they fall within the spirit and scope of the invention as defined and determined by the appended claims, and all inventions utilizing the concept of this invention are protected.

Claims

1. An interpretable question-answering system based on fact retrieval and verification enhancement, characterized in that: It includes a fact retrieval module, a bidirectional reasoning module, a multi-view comparison learning module, a cross-validation module, and a proof search module; The fact retrieval module is used to filter the candidate fact set constructed based on context, and dynamically remove facts that are irrelevant to the target hypothesis in order to reduce the search space; The bidirectional reasoning module uses the pre-trained language model T5-Large with an encoder-decoder architecture as the deductive and abductive reasoners, respectively. It generates single-step proof steps in a bottom-up deductive and top-down abductive manner, and obtains the deductive and abductive candidate structure trees through iterative calculation. The single-step proof process, which uses both bottom-up deduction and top-down abductive reasoning, specifically includes the following steps: Step 2.1: The pre-trained language model T5-Large with an encoder-decoder architecture is used as the deductive and abductive reasoning engine to generate single-step proof steps from the bottom up and from the top down, respectively. Step 2.1.1: Construct training data for deductive and abductive reasoning respectively from the proof steps of the Golden Tree. Step 2.1.2, Constructing Deductive Training Data in a Bottom-Up Approach: For deduction, the data is constructed in a bottom-up approach, with each step's input including the hypothesis. In addition to the set of facts, it also includes the output of previous steps; then, the steps generated at the current moment are used as part of the input of the next model, thus iteratively generating proof steps until the output hypothesis is labeled "hypothesis" and terminated. Step 2.1.3: Construct abductive training data in a top-down manner: For abduction, construct training data from the Golden Tree in a top-down manner. Swap the root node of the deductive step with a certain leaf node to construct the abductive step. The abductive model outputs a certain leaf node in the step as an intermediate conclusion generated by the previous abductive model. Then, use this step as the input of the next abductive model and iteratively generate steps. Terminate when no more intermediate conclusions are generated. Step 2.2: Construct deductive and abductive training data, and train the deductive and abductive generators respectively. The calculation formulas are shown below: ; ;in, This represents the filtered set of knowledge facts. This represents the encoder and decoder in a sequence-to-sequence model. Indicates 1 to All deductive steps generated at any given moment; Indicates 1 to All abductive steps generated at any given moment; express The deductive steps generated at each moment; express The abductive steps generated at each time step; during training, the conditional probability likelihood loss is maximized, where the loss calculation formula for the deductive generator is shown below: ; ;in, This represents the training loss of the generator. Represents the total number of training data, steps Each token in the array is represented as , L represents the step length; The multi-view contrast learning module constructs a local contrast loss at the encoder end of the deductive and abductive inference system using the target hypothesis and the golden fact sentence given in the training data, and constructs a global contrast loss at the decoder end using the candidate steps generated by the beam search algorithm, the golden steps in the original data, and the remaining target steps in the training batch. The cross-validation module utilizes the golden steps in the training data to construct deductive and abductive data and train deductive and abductive scorers to enhance the reliability of individual proof steps during bidirectional reasoning. The proof search module aligns the candidate structure trees obtained from deductive and abductive reasoning, and searches the jointly constructed graph to obtain the optimal structure tree, thus obtaining the reasoning steps from the contextual fact sentences to the target hypothesis.

2. The interpretable question-answering method for an interpretable question-answering system based on fact retrieval and verification enhancement according to claim 1, characterized in that: Includes the following steps: Step 1: The fact retrieval module performs initial filtering on the context-based candidate fact set, dynamically eliminating knowledge facts that are irrelevant to the hypothesis; Step 2: Generate a single proof step using the bidirectional reasoning module, where the deductive and abductive generators generate candidate steps in a bottom-up and top-down manner, respectively; Step 3: Use the multi-view comparison learning module to narrow the semantic distance between the hypothesis and the golden facts, and enhance the reliability of the proof steps from the perspective of similarity; Step 4: Use the cross-validation module to mutually verify the deductive and abductive steps, thereby enhancing the reliability of the proof steps from the perspective of support. Step 5: Align the candidate structure trees obtained by bidirectional reasoning through the proof search module, and design a fusion algorithm to obtain the optimal structure tree; Step 2 utilizes the bidirectional reasoning module to generate a single proof step, wherein the deductive and abductive generators generate candidate steps in a bottom-up and top-down manner, respectively, specifically including the following steps: Step 2.1: The pre-trained language model T5-Large with an encoder-decoder architecture is used as the deductive and abductive reasoning engine to generate single-step proof steps from the bottom up and from the top down, respectively. Step 2.1.1: Construct training data for deductive and abductive reasoning respectively from the proof steps of the Golden Tree. Step 2.1.2, Constructing Deductive Training Data in a Bottom-Up Approach: For deduction, the data is constructed in a bottom-up approach, with each step's input including the hypothesis. In addition to the set of facts, it also includes the output of previous steps; then, the steps generated at the current moment are used as part of the input of the next model, thus iteratively generating proof steps until the output hypothesis is labeled "hypothesis" and terminated. Step 2.1.3: Construct abductive training data in a top-down manner: For abduction, construct training data from the Golden Tree in a top-down manner. Swap the root node of the deductive step with a certain leaf node to construct the abductive step. The abductive model outputs a certain leaf node in the step as an intermediate conclusion generated by the previous abductive model. Then, use this step as the input of the next abductive model and iteratively generate steps. Terminate when no more intermediate conclusions are generated. Step 2.2: Construct deductive and abductive training data, and train the deductive and abductive generators respectively. The calculation formulas are shown below: ; ;in, This represents the filtered set of knowledge facts. This represents the encoder and decoder in a sequence-to-sequence model. Indicates 1 to All deductive steps generated at any given moment; Indicates 1 to All abductive steps generated at any given moment; express The deductive steps generated at each moment; express The abductive steps generated at each time step; during training, the conditional probability likelihood loss is maximized, where the loss calculation formula for the deductive generator is shown below: ; ;in, This represents the training loss of the generator. Represents the total number of training data, steps Each token in the array is represented as , L represents the step length.

3. The interpretable question-answering method for an interpretable question-answering system based on fact retrieval and verification enhancement according to claim 2, characterized in that: Step 1, which involves preliminary filtering of the candidate fact set through the fact retrieval module and dynamically eliminating knowledge facts that are irrelevant to the hypothesis, specifically includes the following steps: Step 1.1: Use the pre-trained language model ALBERT as the encoder to process the hypothesis. and facts Encode the hypothesis using average pooling. Sentence embedding representation and sentence embedding representation of each fact ; Step 1.2: A multilayer perceptron constructed from a fully connected neural network is used to obtain the relevance score for each fact. The calculation formula is shown below: ;in, It is the sigmoid activation function, and [∙] represents the concatenation operation. It is a multilayer perceptron consisting of two layers of feedforward networks. This represents the relevance score of each sentence; during training, a marginal ranking is used as the loss of the retrieval machine, calculated as follows: ;in, It is a golden tree with a depth of less than The fact These are the remaining irrelevant facts in the fact set S. yes The number of correct ones It is the number of facts that are being interfered with. It is the edge of reality. It is a marginal loss. This is the final loss; based on the above fact scoring, a threshold is designed to dynamically filter each set of candidate facts.

4. The interpretable question-answering method based on fact retrieval and verification enhancement according to claim 2, characterized in that: Step 3 utilizes a multi-view comparison learning module to narrow the semantic distance between the hypothesis and the golden fact, enhancing the reliability of the proof step from the perspective of similarity. Specifically, it includes the following steps: Step 3.1: Design local contrast information at the encoder end, for the assumption After encoding the factual sentences, the hypothetical sentence representation is obtained. And the sentence representation of each fact ; Step 3.1.1, construct positive and negative samples: take the leaf nodes of the golden tree given in the training data as positive examples, then calculate the cosine similarity between the non-golden facts in the candidate fact set and the hypothesis. Facts with scores greater than a certain threshold are also taken as positive examples, and the remaining facts in the fact set are negative examples. Based on the above positive and negative samples, a local-level contrastive loss is constructed, and the calculation process is shown in the following formula: ;in This indicates the embedding of key fact sentences. It is a collection of golden facts. It is a configurable temperature coefficient hyperparameter. It is an embedding of all factual sentences. It is a similarity measurement function, and the calculation formula is shown below: ;in, These represent the embedding of two sentences respectively. This indicates that the embedding vector of sentence x is transposed; Step 3.2, design the contrast loss of global information at the decoder end: firstly, obtain the result through the beam search algorithm. A diverse set of output embeddings is generated, and then combined with the target output embedding and the outputs of the remaining samples in the current batch to construct a set of contrast samples. and create sample pairs Where k represents the embedding representation of each sample, and + and - are determined by the sample's rank, which is obtained by calculating a sequence-level score with the target output to reflect the relative differences between the contrastive samples; the calculation process for the contrastive learning loss of global information is as follows: ;in, This represents the embedded representation of the target output. , For the embedding representation of the sample, Indicates the boundary, This indicates similarity calculation.

5. The interpretable question-answering method based on fact retrieval and verification enhancement according to claim 2, characterized in that: Step 4 utilizes a cross-validation module to mutually verify the deductive and abductive steps, enhancing the reliability of the proof steps from a supportive perspective. This specifically includes the following steps: Step 4.1: Convert the steps of the Golden Tree in the training data into abductive steps, and construct deductive pairs and abductive pairs respectively; Step 4.2: Jointly learn the deductive and abductive validator by fine-tuning the pre-trained ALBERT language model. For each pair of steps, represent it as (x1, x2, y). Then, concatenate the first two sentences and calculate the relevance score with the last sentence as the score for that step. The calculation process is shown in the following formula: ; ;in, It is the sigmoid activation function. and These are deductive and abductive multilayer perceptrons, respectively. and These are deductive and abductive steps, respectively. The golden proof step is regarded as a positive example, while the negative examples are constructed by randomly replacing one premise in the fact set with a non-golden fact. The ratio of positive to negative is set to 1:1, and the loss function of the validator adopts binary cross-entropy loss.

6. The interpretable question-answering method based on fact retrieval and verification enhancement according to claim 2, characterized in that: Step 5, which aligns the candidate structure trees obtained through bidirectional reasoning using the proof search module and designs a fusion algorithm to obtain the optimal structure tree, specifically includes the following steps: Step 5.1: Construct an initial graph based on the deductive tree obtained by the deductive generator in step 2.

2. The leaf nodes and intermediate conclusion nodes of the deductive tree are used as nodes of the initial graph. Step 5.2: Then, the abduction trees with confidence scores greater than the threshold are incorporated into the initial graph, the nodes and edges of the proof graph are expanded, and a score is assigned to each node; the leaf node score is set to 1.0, and the score of the intermediate conclusion node is the sum of the confidence score of the autoregressive language model and the cross-validator score. Step 5.3: Finally, based on the proof graph and the scores of each node, the optimal structure tree is extracted by exploring different paths on the graph.

7. An electronic device, characterized in that: It includes at least one processor and at least one memory communicatively connected to the processor, the memory storing instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the explainable question-answering method based on fact retrieval and verification enhancement as described in any one of claims 2 to 6.

8. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: It stores a computer program that is executed by a processor as the interpretable question-answering method based on fact retrieval and verification enhancement as described in any one of claims 2 to 6.