Target answer acquisition method and device, electronic equipment and storage medium

By generating a text-based evidence base based on a knowledge graph and utilizing an encoding/decoding module, the problem of low accuracy in evidence base question answering is solved, achieving high-accuracy answer acquisition in complex real-world scenarios and adapting to multi-hop question answering scenarios.

CN115238031BActive Publication Date: 2026-03-03INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-23
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Existing technologies for reasoning-based question answering have low accuracy, especially in complex real-world scenarios where it is difficult to obtain accurate answers effectively. This is mainly due to the small data volume of evidence base question answering datasets and the lack of evidence chain modeling.

Method used

A knowledge graph-based triplet-based evidence library in text form is generated, a complex multi-hop question-and-answer dataset is constructed, and the target answer is obtained by using an encoding/decoding module to utilize the evidence chain. A knowledge distillation encoding/decoding module is used to improve the accuracy of reasoning.

Benefits of technology

It improves the accuracy of reasoning-based question answering in complex real-world scenarios, adapts to multi-hop question answering scenarios, enhances the ability to model evidence chains, and improves the accuracy of answer acquisition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115238031B_ABST
    Figure CN115238031B_ABST
Patent Text Reader

Abstract

The application provides a target answer acquisition method and device, electronic equipment and a storage medium. The method comprises the following steps: generating a text form evidence base based on triples of a knowledge graph; based on a sentence in the evidence base, a first question corresponding to each sentence is constituted, and an evidence chain corresponding to the first question is constituted; wherein, the evidence chain is used to acquire an answer corresponding to the first question; based on a target question input by a user, the first question and the evidence chain corresponding to the first question, a target answer corresponding to the target question is acquired. The embodiment of the application can adapt to a real scene with complex reasoning, and the accuracy of reasoning type question and answer is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing technology, and in particular to a method, apparatus, electronic device, and storage medium for obtaining target answers. Background Technology

[0002] Question answering is a very important research task in natural language processing, and reasoning-based question answering is a challenging aspect of question answering.

[0003] Reasoning-based question answering tasks include a category of evidence-based question answering tasks that focus on reasoning. These tasks require building a model with text database query capabilities, so that the model can obtain and output the answer to the user's input question by querying the evidence-based question answer dataset in text form.

[0004] Currently, the construction of evidence base question-answering datasets is usually based on a small number of entities and relationships between them. The data volume of evidence base question-answering datasets is small, and they are only suitable for simple reasoning scenarios. In real-world scenarios with complex reasoning, the accuracy of reasoning-based question-answering is low. Summary of the Invention

[0005] This invention provides a method, apparatus, electronic device, and storage medium for obtaining target answers, in order to solve the problem of low accuracy in reasoning-based question answering in the prior art.

[0006] This invention provides a method for obtaining a target answer, comprising:

[0007] Based on knowledge graph triples, a text-based evidence database is generated.

[0008] Based on the statements in the evidence database, a first question corresponding to each statement and an evidence chain corresponding to the first question are constructed.

[0009] The chain of evidence is used to obtain the answer to the first question;

[0010] Based on the target question input by the user, the first question, and the evidence chain corresponding to the first question, obtain the target answer corresponding to the target question.

[0011] According to a method for obtaining a target answer provided by the present invention, before constructing a first question corresponding to each statement and an evidence chain corresponding to the first question based on statements in the evidence base, the method further includes:

[0012] Based on the question-answer pairs and program query language of the knowledge graph, generate text-based evidence reasoning statements;

[0013] The program query language is used to represent the mapping relationship between questions and answers in the question-answer pairs of the knowledge graph;

[0014] The process of constructing a first question and a chain of evidence corresponding to each of the statements in the evidence base includes:

[0015] Based on the statements in the evidence database, a first question is constructed corresponding to each statement;

[0016] Based on the statements in the evidence database, obtain the evidence text reasoning statements that match each of the statements;

[0017] The evidence chain corresponding to the first question is constituted based on at least one of the evidence text reasoning statements that match the same statement.

[0018] According to a method for obtaining a target answer provided by the present invention, the step of obtaining a target answer corresponding to the target question based on a target question input by a user, a first question, and an evidence chain corresponding to the first question includes:

[0019] The target problem, the first problem, and the evidence chain corresponding to the first problem are used as inputs to the encoding / decoding module;

[0020] The output of the encoding / decoding module is obtained as the target answer.

[0021] According to a method for obtaining a target answer provided by the present invention, the encoding / decoding module is an encoding / decoding module that has undergone knowledge distillation.

[0022] According to a method for obtaining a target answer provided by the present invention, the method for generating a text-based evidence base based on knowledge graph triples includes:

[0023] The triples of the knowledge graph are used as input to the pre-trained model;

[0024] The evidence library is generated based on the output of the pre-trained model;

[0025] The pre-trained model is a model trained using the datatotext method for text generation.

[0026] The present invention also provides a target answer acquisition device, comprising:

[0027] The generation module is used to generate a text-based evidence library based on knowledge graph triples.

[0028] The constitutive module is used to construct a first question corresponding to each of the statements and an evidence chain corresponding to the first question based on the statements in the evidence base.

[0029] The chain of evidence is used to obtain the answer to the first question;

[0030] The acquisition module is used to acquire the target answer corresponding to the target question based on the target question input by the user, the first question, and the evidence chain corresponding to the first question.

[0031] According to a target answer acquisition device provided by the present invention, the generation module is further configured to generate text-based evidence text reasoning statements based on the question-answer pairs and program query language of the knowledge graph;

[0032] The program query language is used to represent the mapping relationship between questions and answers in the question-answer pairs of the knowledge graph;

[0033] The constitutive module is specifically used to construct a first question corresponding to each statement based on the statements in the evidence base.

[0034] The constitutive module is further specifically used to obtain, based on the statements in the evidence database, the evidence text reasoning statements that match each of the statements; and to constitute the evidence chain corresponding to the first question based on at least one of the evidence text reasoning statements that match the same statement.

[0035] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the target answer acquisition method as described above.

[0036] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the target answer acquisition method as described above.

[0037] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the target answer acquisition method as described above.

[0038] The target answer acquisition method, apparatus, electronic device, and storage medium provided in this invention generate a text-based evidence library based on triples of a knowledge graph. Compared to current evidence library construction, which is usually based on a small number of entities and relationships between entities, the evidence library generated by this invention has a large amount of data due to the large number of entities and relationships between entities in a knowledge graph. Based on the statements in this complex and realistic evidence library, a first question and an evidence chain for obtaining the answer to the first question are constructed. Then, based on the target question input by the user, the first question, and the corresponding evidence chain, the target answer corresponding to the target question can be obtained. This can adapt to complex real-world reasoning scenarios and improve the accuracy of reasoning-based question answering. Attached Figure Description

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

[0040] Figure 1 This is a flowchart illustrating the target answer acquisition method provided by the present invention;

[0041] Figure 2 This is one of the structural schematic diagrams of the target answer acquisition device provided by the present invention;

[0042] Figure 3 This is the second schematic diagram of the target answer acquisition device provided by the present invention;

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

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

[0045] The relevant knowledge involved in this invention is introduced below:

[0046] Question answering is a very important research task in natural language processing. Reasoning-based question answering is a challenging problem in question answering, involving various reasoning knowledge and requiring a knowledge system as support.

[0047] Currently, knowledge systems fall into three categories: 1) structured knowledge graphs; 2) numerically pre-trained language models; and 3) unstructured text knowledge bases. Each of these three types of knowledge systems has its own characteristics. Specifically, in terms of knowledge type and richness, knowledge graphs are constructed semi-automatically by humans, have a fixed knowledge framework, are primarily based on factual knowledge, and possess highly precise knowledge. Numerically pre-trained models are trained unsupervised on large-scale texts, storing knowledge in the form of numerical network parameters, and are characterized by imprecise but extensive knowledge. Text knowledge bases, existing in the form of natural language, can be accessed in large quantities. Although they lack the precise knowledge framework of knowledge graphs, they contain the richest knowledge and the greatest overall information.

[0048] In terms of reasoning, knowledge graphs have precise knowledge and a fixed framework, and can be directly queried using the query language SparQL; text databases can be used for reasoning and analysis through the logic between texts, but the reasoning process is prone to ambiguity and requires searching through a large number of text databases, resulting in low efficiency; the usage paradigm of numerical pre-trained models is to fine-tune downstream tasks with a large amount of supervised data and extract knowledge using prompt methods.

[0049] Current reasoning question answering technologies include evidence-based question answering that focuses on reasoning. Real-world, personal assistant-style evidence-based question answering requires models with text database query capabilities, answering user questions based on a text database, which is of significant research value. However, previous evidence-based question answering datasets were built based on a limited number of relations and templates, and on the closed-world assumption, making them unsuitable for real-world needs. Furthermore, previous evidence-based question answering models focused solely on question-answering performance, neglecting the importance of evidence chains, resulting in models that cannot effectively model evidence chains.

[0050] This invention addresses the issues of evidence base quality and missing evidence chain modeling in evidence base question answering. It generates a complex multi-hop question answering dataset as an evidence base, using a text evidence base and a pre-trained model as knowledge carriers. Furthermore, it proposes an evidence chain retrieval model framework suitable for multi-hop question answering, thus filling some gaps in the research of evidence base question answering.

[0051] The method for obtaining the target answer according to an embodiment of the present invention is described below with reference to the accompanying drawings.

[0052] Figure 1 This is a flowchart illustrating the target answer acquisition method provided by the present invention. Please refer to it. Figure 1 The method includes steps 101 to 103.

[0053] Step 101: Generate a text-based evidence library based on knowledge graph triples.

[0054] Specifically, the triple in a knowledge graph is the basic unit of knowledge representation in the knowledge graph. The triple in a knowledge graph is used to represent the relationship between entities, or to represent the attribute value of a certain attribute of an entity.

[0055] For example, a triple in a knowledge graph is:<Mansfield,population,50212> .

[0056] The generated text-based evidence base contains numerous statements. For example, the evidence base might include the following statements:

[0057] Mansfield has a population of 50212;

[0058] Mansfield is in the 80.095537area;

[0059] Trevor Rabin is portrayed by Con Air;

[0060] Eugene population is 137893;

[0061] Eugene is in the area of ​​114.33245.

[0062] It is evident that triples based on knowledge graphs<Mansfield,population,50212> The generated evidence base contains the statement "Mansfield has a population of 50212". By transforming a large number of triples from the knowledge graph, a large set of statements can be generated as the evidence base.

[0063] Step 102: Based on the statements in the evidence base, construct the first question corresponding to each statement and the evidence chain corresponding to the first question.

[0064] Specifically, the chain of evidence is used to obtain the answer to the first question.

[0065] An example illustrating one implementation of step 102, "constructing the first question corresponding to each statement based on the statements in the evidence base," is as follows:

[0066] Based on the statement "A's father's wife is B" in the evidence base, the first question corresponding to this statement can be "Who is A's father's wife?", "Who is A's father's wife?", "Who is A's father's wife?", or "Who is A's father's wife?" etc. That is, based on a statement in the evidence base, the embodiments of the present invention can constitute a first question or multiple first questions that conform to the same semantics.

[0067] Step 103: Based on the target question, the first question, and the evidence chain corresponding to the first question input by the user, obtain the target answer corresponding to the target question.

[0068] Specifically, the target question input by the user can be matched with each first question, and the target answer corresponding to the target question can be obtained based on the evidence chain corresponding to the first question that matches the target question input by the user.

[0069] The target answer acquisition method provided in this invention generates a text-based evidence base based on triples in a knowledge graph. Compared to current evidence base construction methods that typically rely on a small number of entities and relationships, the evidence base generated by this invention has a large data volume due to the large number of entities and relationships in a knowledge graph. Based on the statements in this complex and realistic evidence base, a first question and an evidence chain for obtaining the answer to the first question are constructed. Then, based on the target question input by the user, the first question, and the corresponding evidence chain, the target answer corresponding to the target question can be obtained. This method can adapt to complex real-world reasoning scenarios and improves the accuracy of reasoning-based question answering.

[0070] Optionally, based on triples from the knowledge graph, a text-based evidence base is generated, including:

[0071] Use the triples of the knowledge graph as input to the pre-trained model;

[0072] An evidence base is generated based on the output of the pre-trained model.

[0073] The pre-trained model is a model trained using the datatotext method of text generation.

[0074] Specifically, the triples of the knowledge graph can include factual knowledge. In this embodiment of the invention, the triples of the knowledge graph including factual knowledge can be used as input to a pre-trained model. The pre-trained model uses the datatotext method to output text statements including factual knowledge, thereby generating a set of these output statements as an evidence base, so as to transform the structured knowledge graph into a textual evidence base.

[0075] Before being trained using the datatotext method, the aforementioned pre-trained model can be a pre-trained model initialized with Wikipedia.

[0076] Optionally, before constructing the first question corresponding to each statement and the evidence chain corresponding to the first question based on the statements in the evidence base, the method further includes:

[0077] Based on knowledge graph question-answer pairs and program query language, generate text-based evidence reasoning statements;

[0078] Among them, the program query language is used to represent the mapping relationship between questions and answers in the question-answer pairs of the knowledge graph;

[0079] Based on the statements in the evidence base, a first question corresponding to each statement and an evidence chain corresponding to the first question are constructed, including:

[0080] Based on the statements in the evidence base, construct the first question corresponding to each statement;

[0081] Based on the statements in the evidence base, obtain the evidence text reasoning statements that match each statement;

[0082] Based on at least one evidentiary text reasoning statement that matches the same statement, an evidentiary chain corresponding to the first question is formed.

[0083] For example, a question-answer pair in a knowledge graph might be: the question in the question-answer pair is "Who is A's father?", and the corresponding question in the question-answer pair is "C". The program query language is used to represent the mapping relationship between the questions in the question-answer pair and the corresponding questions, so as to link the questions with the answers.

[0084] Based on the question-answer pairs of the knowledge graph and the program query language, the embodiment of the present invention can obtain the answer to the question "Who is A's father?" as "C", and then generate the text-based evidence text reasoning statement "A's father is C".

[0085] For example, a question-answer pair in a knowledge graph might be: the question in the question-answer pair is "Who is C's wife?", and the corresponding question in the question-answer pair is "B". The program query language is used to represent the mapping relationship between the questions in the question-answer pair and the corresponding questions, so as to link the questions with the answers.

[0086] Based on the question-answer pairs of the knowledge graph and the program query language, the embodiment of the present invention can obtain the answer to the question "Who is C's wife?" as "B", and then generate the text-based evidence text reasoning statement "C's wife is B".

[0087] Based on the statement "A's father's wife is B" in the evidence base, the first question "Who is A's father's wife?" can be constructed. Based on the statement "A's father's wife is B" in the evidence base, the evidence text reasoning statements "A's father is C" and "C's wife is B" can be retrieved and found to match this statement. Therefore, "A's father is C" and "C's wife is B" are combined into a set, which serves as the evidence chain corresponding to the statement "A's father's wife is B".

[0088] Optionally, embodiments of the present invention can also use a retrieval module to progressively retrieve evidence text reasoning statements from the evidence database. During the retrieval process, distribution constraints can be used to make the model representation fit the evidence text reasoning statements at each step.

[0089] Optionally, based on the target question, the first question, and the evidence chain corresponding to the first question input by the user, the target answer corresponding to the target question is obtained, including:

[0090] The target question, the first question, and the corresponding evidence chain for the first question are used as inputs to the encoding / decoding module;

[0091] Obtain the output of the encoding / decoding module as the target answer.

[0092] Optionally, the encoding / decoding module is a knowledge-distilled encoding / decoding module. In practice, knowledge distillation is performed on the model within the encoding / decoding module; it can also be approximated as compressing the model within the module, resulting in a smaller memory footprint after knowledge distillation.

[0093] The target answer acquisition method provided in this invention generates a text-based evidence base based on triples in a knowledge graph. Compared to current evidence base construction methods that typically rely on a small number of entities and relationships, the evidence base generated by this invention is much larger due to the large number of entities and relationships in a knowledge graph. Furthermore, this invention constructs a first question and an evidence chain for obtaining the answer to the first question based on statements in this complex and realistic evidence base, resulting in a clearer reasoning framework. Based on the user-input target question, the first question, and the corresponding evidence chain, the target answer for the target question can be obtained. This method is adaptable to complex real-world reasoning scenarios, such as multi-hop question-and-answer scenarios, thus improving the accuracy of reasoning-based question answering.

[0094] The target answer acquisition device provided by the present invention is described below. The target answer acquisition device described below can be referred to in correspondence with the target answer acquisition method described above.

[0095] Figure 2 This is one of the structural schematic diagrams of the target answer acquisition device provided by the present invention. Please refer to it. Figure 2 The target answer acquisition device 200 includes:

[0096] The generation module 201 is used to generate a text-based evidence library based on knowledge graph triples;

[0097] The constitutive module 202 is used to construct the first question corresponding to each statement and the evidence chain corresponding to the first question based on the statements in the evidence base.

[0098] The chain of evidence is used to obtain the answer to the first question;

[0099] The acquisition module 203 is used to acquire the target answer corresponding to the target question based on the target question, the first question, and the evidence chain corresponding to the first question input by the user.

[0100] The target answer acquisition device provided in this embodiment of the invention generates a text-based evidence library based on triples of a knowledge graph. Compared to current evidence library construction, which is usually based on a small number of entities and relationships between entities, the evidence library generated by this invention has a large amount of data due to the large number of entities and relationships between entities in the knowledge graph. The construction module constructs a first question and an evidence chain for obtaining the answer to the first question based on the statements in this complex and realistic evidence library. Then, the acquisition module can obtain the target answer corresponding to the target question based on the target question input by the user, the first question, and the corresponding evidence chain. This device can adapt to complex real-world reasoning scenarios and improve the accuracy of reasoning-based question answering.

[0101] Optionally, the generation module 201 is also used to generate text-based evidence text reasoning statements based on knowledge graph question-answer pairs and program query language;

[0102] Among them, the program query language is used to represent the mapping relationship between questions and answers in the question-answer pairs of the knowledge graph;

[0103] The constitutive module 202 is specifically used to constitut the first question corresponding to each statement based on the statements in the evidence base;

[0104] The constitutive module 202 is also specifically used to obtain evidence text reasoning statements that match each statement based on the statements in the evidence base; and to form an evidence chain corresponding to the first question based on at least one evidence text reasoning statement that matches the same statement.

[0105] Optionally, the acquisition module 203 is specifically used to take the target question, the first question, and the evidence chain corresponding to the first question as input to the encoding and decoding module; and to acquire the output of the encoding and decoding module as the target answer.

[0106] Optionally, the encoding / decoding module is a knowledge-distilled encoding / decoding module.

[0107] Optionally, the generation module 201 is specifically used to take the triples of the knowledge graph as input to the pre-trained model;

[0108] An evidence base is generated based on the output of the pre-trained model.

[0109] The pre-trained model is a model trained using the datatotext method of text generation.

[0110] This invention also provides a target answer acquisition device. Figure 3 This is the second schematic diagram of the target answer acquisition device provided by the present invention. Please refer to it. Figure 3 The target answer acquisition device 300 includes: an evidence base construction module 301; a reasoning path construction module 302; a retrieval module 303; and an encoding / decoding module 304.

[0111] There are some problems with the current evidence base question-answering dataset:

[0112] 1. The problem is constructed from dozens of templates, making it simple and singular; it involves very few relationships; the depth of the problem is mostly one hop, making the reasoning simple.

[0113] 2. There are errors in the labeling of the evidence extraction section.

[0114] Because the KBQA dataset has the advantages of realistic and complex questions and clear evidence chains, in order to construct a more realistic question-and-answer scenario, this invention proposes to build a more realistic and comprehensive text question-and-answer database based on the KQA-Pro dataset and the Knowledge Graph-based Generative Natural Language Corpus (KELM) method.

[0115] The evidence base construction module 301 first uses the triples of KQA-pro as triples of the knowledge graph, processes them into a subgraph tiling format, and then inputs them into a fine-tuning model to obtain the statements in the evidence base. The fine-tuning model here is roughly the same as the pre-trained model trained by the datatotext method in the above embodiment. The evidence base construction module 301 then constructs multiple datasets based on different sizes and various irrelevant evidence methods.

[0116] The evidence library of this invention has the following advantages: it realizes the correspondence between knowledge graph triples and text-based evidence library through the datatotext method, constructs subgraphs through triples, and then generates real evidence sentences from the subgraphs as statements in the evidence library, providing a complex and realistic evidence library. The evidence library can exist in various forms such as evidence sentences, documents, and open domain databases.

[0117] The quality of the evidence database in the embodiments of the present invention was sampled and manually evaluated. In the evidence database of forty samples of 25 each, the accuracy of the target answer obtained can reach 100%. All questions can be answered through the evidence database. The interfering evidence is difficult to obtain. Most questions have multiple pieces of evidence, which ensures the difficulty of the questions.

[0118] The inference path construction module 302 first extracts question-answer pairs and corresponding procedural query languages ​​from the KBQA dataset. Then, using the query language, it finds the corresponding triples in the knowledge graph and maps them to the knowledge base text of the subgraph, constructing an inference path according to SparQL or a program. The advantages of this question-answer dataset are: the questions originate from KBQA multi-hop SparQL inference and are manually transcribed; the questions are complex and closer to real-world question-answering scenarios; and the SparQL and program in the KBQA dataset provide clear and correct inference paths to ensure the accuracy of the selected evidence sentences.

[0119] Traditional retrieval modules can be divided into discrete retrieval and dense retrieval, which extract corresponding texts from large-scale text databases without order.

[0120] The retrieval module 303 of this embodiment of the invention is used to adopt an iterative training framework for the retrieval machine, in which the next piece of evidence is made as close as possible to the representation of the current query in each step, while other evidence is gradually moved away. Specifically, the model in the detection module 303 is trained using the following formulas (1) to (3):

[0121]

[0122]

[0123] L AR =L Close +L Pull (3)

[0124] Among them, L Close L is the first loss function used to characterize query accuracy. Pull L is the second loss function used to characterize stopping accuracy. AR The total loss function is represented by q, which represents the problem, and p represents the candidate evidence sentences. The superscript is... + Sentences (positive samples) in the chain of evidence are represented by superscripts. - The sentence not in the evidence chain (negative sample) is represented by T, the last text sentence in the evidence chain is represented by T, and the Sim function is used to represent the similarity between two vectors A and B. The specific formula of the Sim function is as follows (4):

[0125]

[0126] Using loss function L Pull To stop the retrieval, after calculating the last piece of evidence in a chain of evidence, the final hidden representation is distanced from all other evidence vectors.

[0127] After the model in the detection module 303 is trained with loss, evidence is selected at each step using a multi-step maximum inner product search method to construct an evidence chain.

[0128] The encoding / decoding module 304 is used to answer questions based on the encoded evidence chain and questions input by the retrieval module 303. The architecture of the encoding / decoding module 304 is an encoder-decoder architecture. The encoder of the encoding / decoding module 304 uses the encoder that encodes the order of the evidence chain to distill the encoder part of the reader, so that the encoding / decoding module 304 can better encode the information of the evidence chain.

[0129] The performance of this method is verified by experimental results. Specifically, its effectiveness is illustrated by comparing the results of existing methods with those of this method. Detailed experimental results are shown in Table 1.

[0130] Table 1 Experimental results of the detection module

[0131]

[0132] The post-processing in Table 1 refers to the deduplication of multi-hop links in the evidence base. Table 1 compares the loss functions L of the two retrievers. Close and L Pull The performance of the loss function is as follows: the edit distance refers to the difference between the answer retrieved by the retrieval module 303 and the target answer. The smaller the edit distance, the higher the accuracy of obtaining the target answer. It can be seen that the two loss functions can complement each other and perform best in the overall evidence chain.

[0133] The experimental results of the encoding / decoding module are presented below. Table 2 shows the experimental results of the encoding / decoding module:

[0134] Table 2 Experimental results of the encoding / decoding module

[0135] Models EM F1 FID 70.94% 71.55% NLDB 72.24% 72.85% Ours 82.89% 83.75%

[0136] Here, EM is the percentage of Exact Matches, and F1 refers to the F1 score.

[0137] The middle two rows of Table 2 show the performance of the baseline open-domain classical model (fusion in decoder) and the text library retrieval question answering method (NeuralDB), respectively. The last row shows the performance of the target answer acquisition method provided by the embodiments of the present invention. It can be seen that the target answer acquisition method provided by the embodiments of the present invention achieves better results.

[0138] Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 4 As shown, the electronic device 400 may include: a processor 410, a communication interface 420, a memory 430, and a communication bus 440, wherein the processor 410, the communication interface 420, and the memory 430 communicate with each other through the communication bus 440. The processor 410 can call logical instructions in the memory 430 to execute a method for obtaining the target answer, which includes:

[0139] Based on knowledge graph triples, a text-based evidence database is generated.

[0140] Based on the statements in the evidence database, a first question corresponding to each statement and an evidence chain corresponding to the first question are constructed.

[0141] The chain of evidence is used to obtain the answer to the first question;

[0142] Based on the target question input by the user, the first question, and the evidence chain corresponding to the first question, obtain the target answer corresponding to the target question.

[0143] Optionally, before constructing the first question corresponding to each statement and the chain of evidence corresponding to the first question based on the statements in the evidence base, the method further includes:

[0144] Based on the question-answer pairs and program query language of the knowledge graph, generate text-based evidence reasoning statements;

[0145] The program query language is used to represent the mapping relationship between questions and answers in the question-answer pairs of the knowledge graph;

[0146] The process of constructing a first question and a chain of evidence corresponding to each of the statements in the evidence base includes:

[0147] Based on the statements in the evidence database, a first question is constructed corresponding to each statement;

[0148] Based on the statements in the evidence database, obtain the evidence text reasoning statements that match each of the statements;

[0149] The evidence chain corresponding to the first question is constituted based on at least one of the evidence text reasoning statements that match the same statement.

[0150] Optionally, obtaining the target answer corresponding to the target question based on the user-input target question, the first question, and the evidence chain corresponding to the first question includes:

[0151] The target problem, the first problem, and the evidence chain corresponding to the first problem are used as inputs to the encoding / decoding module;

[0152] The output of the encoding / decoding module is obtained as the target answer.

[0153] Optionally, the encoding / decoding module is a knowledge-distilled encoding / decoding module.

[0154] Optionally, the knowledge graph-based triples generate a text-based evidence base, including:

[0155] The triples of the knowledge graph are used as input to the pre-trained model;

[0156] The evidence library is generated based on the output of the pre-trained model;

[0157] The pre-trained model is a model trained using the datatotext method for text generation.

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

[0159] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program that can be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer is able to execute the target answer acquisition method provided by the above methods, the method comprising:

[0160] Based on knowledge graph triples, a text-based evidence database is generated.

[0161] Based on the statements in the evidence database, a first question corresponding to each statement and an evidence chain corresponding to the first question are constructed.

[0162] The chain of evidence is used to obtain the answer to the first question;

[0163] Based on the target question input by the user, the first question, and the evidence chain corresponding to the first question, obtain the target answer corresponding to the target question.

[0164] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for obtaining the target answer provided by the methods described above, the method comprising:

[0165] Based on knowledge graph triples, a text-based evidence database is generated.

[0166] Based on the statements in the evidence database, a first question corresponding to each statement and an evidence chain corresponding to the first question are constructed.

[0167] The chain of evidence is used to obtain the answer to the first question;

[0168] Based on the target question input by the user, the first question, and the evidence chain corresponding to the first question, obtain the target answer corresponding to the target question.

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

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

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

Claims

1. A method for obtaining a target answer, characterized by, The method comprises the following steps: generating an evidence base in the form of text based on triples of a knowledge graph; constructing a first question corresponding to each sentence in the evidence base based on the sentence; obtaining an evidence text reasoning sentence matched with each sentence in the evidence base based on the sentence; constructing an evidence chain corresponding to the first question based on at least one evidence text reasoning sentence matched with the same sentence; wherein the evidence chain is used to obtain an answer corresponding to the first question; obtaining a target answer corresponding to a target question input by a user based on the target question, the first question and the evidence chain corresponding to the first question.

2. The target answer acquisition method according to claim 1, characterized by, Before the step of constructing a first question corresponding to each sentence in the evidence base and an evidence chain corresponding to the first question based on the sentence, the method further comprises the following steps: generating an evidence text reasoning sentence in the form of text based on a question and answer pair and a program query language of the knowledge graph; wherein the program query language is used to represent a mapping relationship between a question and an answer in the question and answer pair of the knowledge graph. 3.The target answer acquisition method according to claim 2, characterized in that, The step of obtaining a target answer corresponding to a target question input by a user based on the target question, the first question and the evidence chain corresponding to the first question comprises the following steps: taking the target question, the first question and the evidence chain corresponding to the first question as inputs of a coding and decoding module; obtaining an output of the coding and decoding module as the target answer.

4. The target answer acquisition method according to claim 3, characterized by, The coding and decoding module is a coding and decoding module distilled by knowledge. 5.The target answer acquisition method according to any one of claims 1 to 4, characterized in that, The step of generating an evidence base in the form of text based on triples of a knowledge graph comprises the following steps: taking the triples of the knowledge graph as inputs of a pre-training model; generating the evidence base based on an output of the pre-training model; wherein the pre-training model is a model trained by a text generation datatotext method.

6. A target answer acquisition apparatus characterized by comprising: The device comprises: a generating module configured to generate an evidence base in the form of text based on triples of a knowledge graph; a constructing module configured to construct a first question corresponding to each sentence in the evidence base based on the sentence, and obtain an evidence text reasoning sentence matched with each sentence in the evidence base based on the sentence, and construct an evidence chain corresponding to the first question based on at least one evidence text reasoning sentence matched with the same sentence; wherein the evidence chain is used to obtain an answer corresponding to the first question; an obtaining module configured to obtain a target answer corresponding to a target question input by a user based on the target question, the first question and the evidence chain corresponding to the first question.

7. The target answer obtaining device according to claim 6, wherein the generating module is further configured to generate an evidence text reasoning sentence in the form of text based on a question and answer pair and a program query language of the knowledge graph; wherein the program query language is used to represent a mapping relationship between a question and an answer in the question and answer pair of the knowledge graph.

8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the target answer obtaining method according to any one of claims 1 to 5 when executing the program. 9.A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program implements the target answer obtaining method according to any one of claims 1 to 5 when executed by the processor.

10. A computer program product comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the target answer obtaining method according to any one of claims 1 to 5.