Answer generation method, device, equipment and medium

By performing multi-layer disassembly and inverting the to-process problems, a solution topology diagram is generated and the problem answers are answered according to the figure, the problem of low performance and poor interpretability of the retrieval enhancement generative model when processing complex queries is solved, and high performance and high interpretability answer generation is achieved.

CN119760073APending Publication Date: 2025-04-04CHINA ELECTRONICS CLOUD DIGITAL INTELLIGENCE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411819681.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The search-enhanced generative model has low performance when dealing with complex queries with more inference steps, it is difficult to generate accurate outputs, and the output answers are poorly interpretable.

Method used

By performing multi-layer disassembly processing on the problem to be processed, the problem disassembly tree is obtained, and the tree is inverted to obtain the answer topology diagram. Then, follow the answer topology diagram to perform multi-layered questions and get the target answer.

Benefits of technology

It realizes decomposing complex problems into multi-layer sub-problems. By answering sub-questions, the performance and accuracy of answer generation are improved, and the process of determining answers is highly interpretable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119760073A_ABST
    Figure CN119760073A_ABST
Patent Text Reader

Abstract

The disclosed embodiment relates to an answer generation method, device, equipment and medium, the method comprising: obtaining a problem to be processed; performing multi-layer decomposition processing on the problem to be processed to obtain a problem decomposition tree corresponding to the problem to be processed; wherein the problem decomposition tree comprises a plurality of nodes corresponding to the problem one by one, the directed line in the problem decomposition tree points from the decomposition problem to the decomposition problem, the decomposition problem is a sub-problem of the corresponding decomposition problem, and the root node of the problem decomposition tree is the problem to be processed; performing inversion processing on the problem decomposition tree to obtain a solution topology map corresponding to the problem to be processed; performing multi-layer problem solution processing according to the solution topology map to obtain a target answer corresponding to the problem to be processed. Thus, the inherent solution logic of the problem to be processed is excavated, the performance of generating answers is improved, the accuracy of problem solutions is improved, and the process of determining answers has strong interpretability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of natural language processing, and in particular to an answer generation method, device, equipment and medium. Background Art

[0002] With the development of natural language processing, it is becoming more and more common to answer questions through natural language processing. In related technologies, questions can be answered through the Retrieval Augmented Generation (RAG) model. However, when faced with complex queries with many reasoning steps, the performance of the RAG model is low, it is difficult to generate accurate output, and the output answer is poorly interpretable. Summary of the invention

[0003] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides an answer generation method, device, equipment and medium.

[0004] The present disclosure provides an answer generation method, including:

[0005] Get pending issues;

[0006] Perform multi-layer decomposition processing on the problem to be processed to obtain a problem decomposition tree corresponding to the problem to be processed; wherein the problem decomposition tree includes a plurality of nodes corresponding to the problems one by one, a tree directed line in the problem decomposition tree points from the decomposition problem to the decomposition problem, the decomposition problem is a sub-problem of the corresponding decomposition problem, and the root node of the problem decomposition tree is the problem to be processed;

[0007] Inverting the problem decomposition tree to obtain a solution topology diagram corresponding to the problem to be processed;

[0008] A multi-layer problem solving process is performed according to the solution topology diagram to obtain a target answer corresponding to the problem to be solved.

[0009] The present disclosure also provides an answer generation device, including:

[0010] The acquisition module is used to obtain pending issues;

[0011] A disassembly module, used for performing multi-layer disassembly processing on the problem to be processed to obtain a problem disassembly tree corresponding to the problem to be processed; wherein the problem disassembly tree includes a plurality of nodes corresponding to the problems one by one, a tree directed line in the problem disassembly tree points from the disassembled problem to the disassembly problem, the disassembly problem is a sub-problem of the corresponding disassembled problem, and the root node of the problem disassembly tree is the problem to be processed;

[0012] An inversion module, used to invert the problem decomposition tree to obtain a solution topology corresponding to the problem to be processed;

[0013] The answering module is used to perform multi-layer problem answering processing according to the answering topology diagram to obtain a target answer corresponding to the problem to be processed.

[0014] An embodiment of the present disclosure also provides an electronic device, which includes: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement the answer generation method provided in the embodiment of the present disclosure.

[0015] The embodiment of the present disclosure also provides a computer-readable storage medium, which stores a computer program, and the computer program is used to execute the answer generation method provided by the embodiment of the present disclosure.

[0016] The technical solution provided by the embodiments of the present disclosure has the following advantages over the prior art: the answer generation solution provided in the embodiments of the present disclosure, the method comprising: obtaining a problem to be processed; performing multi-layer decomposition processing on the problem to be processed to obtain a problem decomposition tree corresponding to the problem to be processed; wherein the problem decomposition tree comprises a plurality of nodes corresponding one to one to the problems, and the directed lines in the problem decomposition tree point from the decomposed problem to the decomposition problem, the decomposition problem is a sub-problem of the corresponding decomposition problem, and the root node of the problem decomposition tree is the problem to be processed; performing inversion processing on the problem decomposition tree to obtain a solution topology graph corresponding to the problem to be processed; performing multi-layer problem solution processing according to the solution topology graph to obtain a target answer corresponding to the problem to be processed. By adopting the above technical scheme, the problem to be processed is decomposed into multiple layers of sub-problems to obtain a problem decomposition tree and invert the problem decomposition tree to obtain a solution topology map, and the problems recorded in the solution topology map are answered and processed in sequence to obtain the target answer to the problem to be processed, thereby decomposing a relatively complex problem into multiple layers of sub-problems with clear logical relationships, and solving the decomposed problems in sequence to achieve the solution to the problem to be processed, excavating the inherent solution logic of the problem to be processed, improving the performance of generating answers, improving the accuracy of problem solving, and the process of determining the answer has strong explainability. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0019] Figure 1 A flowchart of a method for generating an answer provided by an embodiment of the present disclosure;

[0020] Figure 2 A schematic diagram of a problem decomposition tree provided in an embodiment of the present disclosure;

[0021] Figure 3 A schematic diagram of a solution topology diagram provided in an embodiment of the present disclosure;

[0022] Figure 4 A flowchart of another answer generation method provided by an embodiment of the present disclosure;

[0023] Figure 5 A schematic diagram of determining a combination problem provided by an embodiment of the present disclosure;

[0024] Figure 6 A schematic diagram of the structure of an answer generation device provided in an embodiment of the present disclosure;

[0025] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0026] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0027] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.

[0028] With the development of natural language processing, it is becoming more and more common to answer questions through natural language processing. In related technologies, questions can be answered through a retrieval augmented generation (RAG) model, which enhances the performance of the model by retrieving relevant information.

[0029] However, retrieval-augmented generative models suffer from low performance and hallucination problems when processing complex queries with many reasoning steps. They are prone to inaccurate outputs and it is difficult to track the specific reasons for the generated results. There is a lack of effective attribution mechanisms, and the model has low interpretability and trustworthiness.

[0030] In order to solve the above problems, the embodiments of the present disclosure provide an answer generation method, which is introduced below in conjunction with specific embodiments.

[0031] Figure 1 The following is a flow chart of an answer generation method provided by an embodiment of the present disclosure. The answer generation method can be applied to an answer generation device. The answer generation device can be implemented by software and / or hardware, and the answer generation device can generally be integrated in an electronic device. Figure 1 As shown, the answer generation method includes:

[0032] Step 101, obtaining issues to be processed.

[0033] The pending question may be a question to be answered, and the pending question may be a question with a relatively complex answer logic. For example, the pending question may be a question whose answer cannot be directly found in the preset knowledge base. This embodiment does not limit the pending question. For example, the pending question may be "What is the distance between the venues of the last two competitions?"

[0034] In the embodiment of the present disclosure, the user can input a pending question that needs to be answered by the answer generating device in the question input box, and the answer generating device obtains the pending question.

[0035] Step 102, perform multi-layer decomposition processing on the problem to be processed to obtain a problem decomposition tree corresponding to the problem to be processed; wherein the problem decomposition tree includes multiple nodes corresponding to the problems one by one, and the directed lines in the problem decomposition tree point from the decomposed problem to the decomposition problem, and the decomposition problem is a sub-problem of the corresponding decomposition problem, and the root node of the problem decomposition tree is the problem to be processed.

[0036] Among them, the problem decomposition tree can be used to record the process of decomposing the problem to be processed layer by layer, and the problem decomposition tree can be a tree structure. In the problem decomposition tree, starting from the problem to be processed, several sub-problems are subdivided like branches. The node can be a basic constituent element in a tree or a topological diagram, and the node can be a specific problem. This embodiment does not limit the type of problem. For example, the problem can include query-type problems whose answers are determined by retrieval and reasoning-type problems whose answers are determined by reasoning. The tree directed line can be a line from one node to another node in the problem decomposition tree, and the tree directed line can represent one or more sub-problems decomposed from a problem in the problem decomposition tree.

[0037] The decomposed problem may be a decomposed problem. The decomposed problem may be a sub-problem decomposed from the decomposed problem. The present embodiment does not limit the quantitative relationship between the decomposed problem and the decomposed problem. For example, a decomposed problem may correspond to one or more decomposed problems. A sub-problem may be a lower-level problem decomposed from a problem. It can be understood that by decomposing a complex and large-scale problem into one or more smaller and more specific sub-problems, the problem can be refined and segmented, and a complex problem can be converted into smaller and easier-to-solve sub-problems, which is more conducive to solving the problem in a systematic and targeted manner. The root node may be the starting point of the problem decomposition tree. The root node is the source of other nodes in the problem decomposition tree. The root node does not have a parent node.

[0038] In the embodiment of the present disclosure, the answer generation device can use the problem to be processed as the root node of the problem decomposition tree, and extend it based on the problem to be processed. The extended nodes represent the lower-level decomposition of the problem to be processed in different dimensions. Each node is further decomposed to finally obtain a problem decomposition tree with a tree structure.

[0039] In some embodiments of the present disclosure, a multi-layer decomposition process is performed on the problem to be processed to obtain a problem decomposition tree corresponding to the problem to be processed, including: inputting the problem to be processed and multi-layer decomposition prompt words into a problem decomposition model to obtain a problem decomposition tree output by the problem decomposition model.

[0040] Among them, the multi-layer disassembly prompt words can be used to guide the model to perform multi-layer disassembly processing on the problem to be processed, and obtain the corresponding problem disassembly tree. This embodiment does not limit the multi-layer disassembly prompt words. For example, the multi-layer disassembly prompt words may include "What information is needed to analyze and solve the problem? And determine whether the information can be directly obtained through information retrieval?" Or, the multi-layer disassembly prompt words may also include "Determine whether the index requirements corresponding to the information can continue to be disassembled." Optionally, the multi-layer disassembly prompt words can be used to specify a threshold number of layers for disassembling the problem to be processed. The problem disassembly model can be a model with language processing functions. This embodiment does not limit the type of the problem disassembly model. For example, the problem disassembly model can be a large prediction model.

[0041] In this embodiment, the answer generation device can input the problem to be processed and the pre-set multi-layer disassembly prompt words into the trained problem disassembly model, so that the problem disassembly model processes the problem to be processed under the prompt of the multi-layer disassembly prompt words, and obtains the problem disassembly tree output by the problem disassembly model.

[0042] Optionally, the multi-layer disassembly prompt word is used to prompt that the problem to be processed is treated as the problem to be disassembled, and the problem to be disassembled is disassembled to obtain an intermediate problem, and it is determined whether there is an answer corresponding to the intermediate problem in the preset database. If so, the intermediate problem is used as the basic problem, otherwise, the intermediate problem is returned as a new problem to be disassembled, and the new intermediate problem is determined until there is an answer corresponding to the new intermediate problem in the preset database, or the number of iteration layers reaches a layer threshold.

[0043] Among them, the problem to be disassembled can be the problem currently being disassembled, and the disassembly process can be understood as further decomposing and refining the specific problem, and disassembling a problem into one or more lower-level sub-problems. The intermediate problem can be the sub-problem disassembled from the problem to be disassembled. The preset database can be a preset knowledge base, and the preset database can be a database pre-configured for the Retrieval-Augmented Generation (RAG) model. The preset database can be configured according to user needs, application scenarios, etc., and this embodiment does not limit it. The basic problem can be a problem that is a leaf node in the problem disassembly tree, and the basic problem can be the end of the problem disassembly tree, and the basic problem does not have a corresponding child node. The basic problem can be an atomic problem that is no longer divided in the problem disassembly tree. For example, the basic problem can be a problem whose answer can be queried in the preset database, or the basic problem can be a problem whose iteration layer reaches the layer threshold.

[0044] In this embodiment, the multi-layer disassembly prompt word can guide the problem disassembly model to disassemble the problem to be processed. First, the problem to be processed is used as the problem to be disassembled currently to be disassembled, and the problem to be disassembled is disassembled, and the sub-problems obtained by disassembly are used as intermediate problems. The number of iteration layers corresponding to the intermediate problem is the cumulative number of layers plus 1, and the initial value of the current number of layers can be 0. Further, it is determined whether the answer to the intermediate problem can be queried in the preset database. If so, the intermediate problem is used as the basic problem and no further disassembly of the intermediate problem is performed. If the answer to the intermediate problem cannot be found in the preset database, the intermediate problem is used as a new problem to be disassembled, and the problem to be disassembled is returned to be disassembled to obtain a new intermediate problem, until the new intermediate problem is the basic problem, or the corresponding number of iteration layers reaches the layer number threshold, then the iteration is stopped, and the problem disassembly tree corresponding to the problem to be processed is obtained. Thus, the disassembly requirements of the problem to be processed are recorded through the multi-layer disassembly prompt word, and the determination of the problem disassembly tree is realized.

[0045] Optionally, the answer generation method further includes: displaying the problem disassembly tree, and adjusting and updating the problem disassembly tree in response to the user's modification operation on the problem disassembly tree. In this embodiment, after determining the problem disassembly tree, the answer generation device can display the problem disassembly tree to the user, and the user analyzes the problem disassembly tree to determine the problematic part of the problem disassembly tree, and modifies the nodes and / or tree directed lines in the problem disassembly tree through the modification operation. The answer generation device generates a modified problem disassembly tree in response to the modification operation, and updates the original problem disassembly tree according to the modified problem disassembly tree. Thereby, the correction of the disassembly process of the problem to be processed is achieved.

[0046] Step 103, invert the problem decomposition tree to obtain a solution topology diagram corresponding to the problem to be processed.

[0047] Among them, the solution topology graph can record the process of gradually solving the problem and finally solving the problem to be processed. The solution topology graph can include multiple nodes corresponding to the problems one by one, and the solution topology graph includes a graph directed line, and the graph directed line points from the disassembled problem to the disassembled problem. The solution topology graph can take the basic problem as the entrance and reach the problem to be processed according to the guidance of the graph directed line. The solution topology graph can be a directed acyclic graph (DAG), so that based on the structure of the directed acyclic graph, it is easy to debug and trace back the answer generation process, and the debuggability of the answer generation process is improved.

[0048] In the disclosed embodiment, after determining the problem decomposition tree, the answer generation device can reverse the problem connections on the problem decomposition tree to achieve the structural conversion of the tree structure to a directed acyclic graph, and obtain the solution topology graph corresponding to the problem to be processed.

[0049] In some embodiments of the present disclosure, the problem decomposition tree is inverted to obtain a solution topology graph corresponding to the problem to be processed, including: reversing the tree directed lines in the problem decomposition tree to obtain the graph directed lines in the solution topology graph, and using the basic problems that serve as leaf nodes in the problem decomposition tree as entry problems in the solution topology graph to obtain the solution topology graph.

[0050] The directed line of the graph may be a line pointing from one node to another node in the solution topology graph, and the directed line of the graph may represent the solution of the next problem based on the answer to one problem in the solution topology graph. The entry question may be a question that serves as the processing entry of the solution topology graph.

[0051] In this embodiment, the answer generation device can adjust the tree directed line in the problem decomposition tree from the decomposition problem pointing to the decomposition problem to the decomposition problem pointing to the decomposition problem, and obtain the graph directed line in the answer topology map. The basic problem in the problem decomposition tree is used as the entry problem in the answer topology map, and the problem to be processed is used as the final answer problem in the answer topology map, so as to achieve the inversion between the layers of the problem in the problem decomposition tree, and then obtain the answer topology map. Therefore, the answer topology map is determined based on the problem decomposition tree, providing a specific path basis for the answer to the problem to be processed.

[0052] For example, Figure 2 A schematic diagram of a problem decomposition tree provided by an embodiment of the present disclosure, such as Figure 2 As shown in the figure, the problem to be solved is "What is the distance between the venues of the two most recent competitions?". The two sub-problems of this problem include "What is the longitude and latitude of the venue of the previous competition?" and "What is the longitude and latitude of the venue of the previous competition?". The sub-problem of "What is the longitude and latitude of the venue of the previous competition?" is "Where was the venue of the previous competition?". The sub-problem of "What is the longitude and latitude of the venue of the previous competition?" is "Where was the venue of the previous competition?". The problem decomposition tree is inverted to obtain the solution topology. Figure 3 A schematic diagram of a solution topology diagram provided in an embodiment of the present disclosure, such as Figure 3 As shown, in the solution topology graph corresponding to the problem decomposition tree, the root node in the problem decomposition tree is used as the final problem in the solution topology graph, and the leaf nodes in the problem decomposition tree are used as the entry problems in the solution topology graph.

[0053] Step 104, perform multi-layer problem solving processing according to the solution topology diagram to obtain a target answer corresponding to the problem to be solved.

[0054] The target answer may be an answer corresponding to the problem to be processed determined based on the solution topology graph.

[0055] In the embodiment of the present disclosure, after determining the solution topology graph, the answer generation device can query the questions in the solution topology graph in sequence according to the directions of the directed lines in the solution topology graph, thereby realizing the logical solutions to the problems to be processed, until the problem to be processed in the solution topology graph is reached, and the target answer corresponding to the problem to be processed is obtained.

[0056] In some embodiments of the present disclosure, parallel branches in the same parallel branch group in the solution topology graph are processed in parallel, and the parallel branches in the same parallel branch group are connected to the same node in the solution topology graph. In this embodiment, the parallel branches in the same parallel branch group can be different branches pointed to by the directed lines of the same node in the solution topology graph, and the branch can include one or more nodes.

[0057] In the above scheme, by processing the parallel branches in the same parallel branch group in parallel, the efficiency of processing the solution topology graph is improved, the time for responding to the problems to be processed is reduced, and when processing the problems connected by the parallel branch group, the problem can be processed based on the answers to all the sub-problems of the problem, thereby improving the accuracy of problem processing.

[0058] Figure 4 A flowchart of another answer generation method provided by an embodiment of the present disclosure is shown as follows: Figure 4 As shown, multi-layer problem solving is performed according to the solution topology diagram to obtain the target answer corresponding to the problem to be solved, including:

[0059] Step 401, taking the entry question as the question to be queried, inputting the question to be queried into the question answering model, and obtaining the query result corresponding to the question to be queried.

[0060] The question to be queried may be a question currently being processed in the answer topology map. The question answering model may be a model for answering questions, and the question answering model may be a retrieval enhancement model. The query result may be an answer corresponding to the question to be queried.

[0061] In this embodiment, the answer generation device can use each entry question as a question to be queried, input the question to be queried into the question answering model, and the question answering model performs query processing on the question to be queried based on a preset database to obtain a query result corresponding to the question to be queried. Optionally, the answer generation method may also include: obtaining an identifier of the text that generates the query result in the preset database, and storing the identifier. Thus, the generation of the query result is attributed to a specific text, which improves the interpretability of the query result, improves the credibility of the query result, and also improves the interpretability and credibility of the final target answer.

[0062] Step 402: Combine the query result and the next question pointed to by the query question to obtain a combined question.

[0063] The next question may be a question pointed to by the directed line of the graph to the question to be queried, and the combined question may be a question obtained by semantically combining the query result and the question to be queried.

[0064] In this implementation example, after determining the query result of the question to be queried, the next question pointed to by the question to be queried is determined as the next question, and the query result is used as the input parameter of the next question to realize the text combination of the query result and the next question to obtain a combined question.

[0065] In some embodiments of the present disclosure, the query result and the next question pointed to by the question to be queried are textually combined to obtain a combined question, including: determining whether the first semantic type and the second semantic type are the same, and if so, textually combining the query result and the next question to obtain a combined question; wherein the first semantic type is the semantic type of the query result, and the second semantic type is the semantic type of the part to be supplemented in the next question.

[0066] The semantic type may be the type of semantics represented by the text, and this embodiment does not limit the semantic type. For example, the semantic type may include a city, a person's name, etc. The part to be supplemented may be the part corresponding to the entry parameter of the next question.

[0067] In this embodiment, the answer generation device can perform semantic analysis on the query result to obtain the first semantic type corresponding to the query result, and obtain the second semantic type of the next question, and determine whether the first semantic type and the second semantic type match. If so, the query result and the next question are combined textually to obtain a combined question. For example, Figure 5 A schematic diagram of determining a combination problem provided by an embodiment of the present disclosure, such as Figure 5 As shown in the figure, after determining that the query result of Q1.1 is "Area A", the semantic types corresponding to Region A and the next question are both region types, so "Area A" is combined with "What are the longitude and latitude of the venue of the previous competition?" to obtain the combined question "What are the longitude and latitude of Region A?" If the first semantic type and the second semantic type are different, a semantic conflict prompt message is generated.

[0068] In the above scheme, when the query result of the combined question matches the semantic type of the next question, the query result is combined with the text of the next question, thereby improving the semantic rationality of the generated combined question.

[0069] Step 403, taking the combined question as a new question to be queried, returning and determining a new query result corresponding to the new question to be queried, until the new question to be queried is generated based on the question to be processed, and taking the new query result as the target answer.

[0070] In this embodiment, after determining the combined question, the combined question is determined as a new question to be queried, and the new question to be queried is input into the question answering model. The question answering model performs query processing on the new question to be queried based on the preset database to obtain a new query result corresponding to the new question to be queried. If the new question to be queried is generated with the question to be processed as the next question, the new query result corresponding to the new question to be queried is determined as the target answer.

[0071] In the above scheme, the next question is completed based on the result of the previous question to obtain a combined question, and the result question is used as the answer to the next question that follows the previous question, thereby realizing problem solving based on the solution topology map and improving the accuracy of the target answer.

[0072] The answer generation method provided by the embodiment of the present disclosure includes: obtaining a problem to be processed; performing multi-layer decomposition processing on the problem to be processed to obtain a problem decomposition tree corresponding to the problem to be processed; wherein the problem decomposition tree includes multiple nodes corresponding to the problem one by one, the tree directed line in the problem decomposition tree points from the decomposition problem to the decomposition problem, the decomposition problem is the sub-problem of the corresponding decomposition problem, and the root node of the problem decomposition tree is the problem to be processed; inverting the problem decomposition tree to obtain a solution topology map corresponding to the problem to be processed; performing multi-layer problem solution processing according to the solution topology map to obtain the target answer corresponding to the problem to be processed. By adopting the above technical scheme, the problem to be processed is decomposed into multi-layer sub-problems to obtain the problem decomposition tree and inverting the problem decomposition tree to obtain the solution topology map, and the problems recorded in the solution topology map are solved in sequence to obtain the target answer to the problem to be processed, so as to realize the decomposition of a relatively complex problem into multi-layer sub-problems with clear logical relationships, and the solution of the problem to be processed is realized by solving the decomposed problems in sequence, and the internal solution logic of the problem to be processed is excavated, the performance of generating answers is improved, the accuracy of problem solving is improved, and the process of determining the answer has strong interpretability.

[0073] In addition, by decomposing the problem to be processed into a problem decomposition tree, inverting the problem decomposition tree to obtain a solution topology graph, and solving the problem to be processed based on the solution topology graph, the retrieval-reasoning paradigm in the retrieval enhanced generation model is transformed into a planning-retrieval paradigm, and the solution to the problem to be processed is made more explainable through planning.

[0074] Next, the answer generation method in the embodiment of the present disclosure is further explained through a specific example. In this example, the answer generation device can decompose the problem to be processed into multiple levels of sub-problems, and the multiple levels of sub-problems and their associations are recorded through a solution topology map. Specifically, the answer generation device can input the problem to be processed and the multi-layer disassembly prompt words into the problem disassembly model to obtain a problem disassembly tree, and invert the problem disassembly tree to obtain a solution topology map. Furthermore, the answer generation device can sequentially answer the questions in the solution topology map according to the answer order of the questions recorded in the solution topology map. During the processing, the query result of the previous question is used as the input parameter of the next question to obtain a combined question, and the combined question is answered. Until the next question is the problem to be processed, the target answer is obtained.

[0075] The above-mentioned answer generation method provided by the embodiment of the present disclosure improves the processing efficiency and accuracy of the problem to be processed by decomposing the problem to be processed into sub-problems in the answer topology map and solving them in parallel. By constructing the problem to be processed as an answer topology map, the generation of the corresponding result of each problem can be attributed to a specific document, which improves the interpretability and trustworthiness of generating the target answer based on the problem to be processed. In addition, the user can adjust and trace back the problem decomposition tree or the answer topology map, identify errors in the problem decomposition tree or the answer topology map and correct them.

[0076] Figure 6 This is a schematic diagram of the structure of an answer generation device provided by an embodiment of the present disclosure. The device can be implemented by software and / or hardware, and the device can also be integrated in an electronic device. Figure 6 As shown, the answer generating device comprises:

[0077] An acquisition module 601 is used to acquire a problem to be processed;

[0078] The disassembly module 602 is used to perform multi-layer disassembly processing on the problem to be processed to obtain a problem disassembly tree corresponding to the problem to be processed; wherein the problem disassembly tree includes a plurality of nodes corresponding to the problems one by one, and the directed line in the problem disassembly tree points from the disassembled problem to the disassembly problem, and the disassembly problem is a sub-problem of the corresponding disassembled problem, and the root node of the problem disassembly tree is the problem to be processed;

[0079] An inversion module 603 is used to invert the problem decomposition tree to obtain a solution topology diagram corresponding to the problem to be processed;

[0080] The answering module 604 is used to perform multi-layer question answering processing according to the answering topology diagram to obtain a target answer corresponding to the problem to be processed.

[0081] Optionally, the decomposition module 602 is used to: input the problem to be processed and the multi-layer decomposition prompt words into a problem decomposition model to obtain the problem decomposition tree output by the problem decomposition model.

[0082] Optionally, the multi-layer disassembly prompt word is used to prompt the problem to be processed to be treated as the problem to be disassembled, to disassemble the problem to be disassembled to obtain an intermediate problem, and to determine whether there is an answer corresponding to the intermediate problem in a preset database. If so, the intermediate problem is used as the basic problem; otherwise, the intermediate problem is returned to be used as a new problem to be disassembled, and a new intermediate problem is determined until there is an answer corresponding to the new intermediate problem in the preset database, or the number of iteration layers reaches a layer threshold.

[0083] Optionally, the inversion module 603 is used to: reversely process the tree directed lines in the problem decomposition tree to obtain the graph directed lines in the solution topology graph, and use the basic problems that are leaf nodes in the problem decomposition tree as entry problems in the solution topology graph to obtain the solution topology graph.

[0084] Optionally, the answer module 604 includes:

[0085] An input submodule, used to take the entry question as a question to be queried, input the question to be queried into a question answering model, and obtain a query result corresponding to the question to be queried;

[0086] A combining submodule, used for combining the query result with the next question pointed to by the query question to obtain a combined question;

[0087] The iterative submodule is used to take the combined question as a new question to be queried, return a new query result corresponding to the new question to be queried, until the new question to be queried is generated based on the question to be processed, and then take the new query result as the target answer.

[0088] Optionally, the combining submodule is used to:

[0089] Determine whether the first semantic type and the second semantic type are the same. If so, textually combine the query result and the next question to obtain the combined question; wherein the first semantic type is the semantic type of the query result, and the second semantic type is the semantic type of the part to be supplemented of the next question.

[0090] Optionally, the parallel branches in the same parallel branch group in the solution topology graph are processed in parallel, and the parallel branches in the same parallel branch group are connected to the same node in the solution topology graph.

[0091] It should be noted that Figure 6 The answer generation device 600 shown can execute each step in the above-mentioned answer generation method embodiment, and realize each process and effect in the above-mentioned answer generation method embodiment, which will not be described in detail here.

[0092] Figure 7 The structure diagram of an electronic device provided by the embodiment of the present disclosure is shown in FIG. Figure 7 As shown, the electronic device 700 includes one or more processors 701 and a memory 702 .

[0093] The processor 701 may be a central processing unit (CPU) or other forms of processing units having answer generation capability and / or instruction execution capability, and may control other components in the electronic device 700 to perform desired functions.

[0094] The memory 702 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, a random access memory (RAM) and / or a cache memory (cache), etc. The non-volatile memory may include, for example, a read-only memory (ROM), a hard disk, a flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 701 may run the program instructions to implement the answer generation method of the embodiment of the present disclosure described above and / or other desired functions. Various contents such as input signals, signal components, noise components, etc. may also be stored in the computer-readable storage medium.

[0095] In one example, the electronic device 700 may further include: an input device 703 and an output device 704, and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).

[0096] In addition, the input device 703 may also include, for example, a keyboard, a mouse, and the like.

[0097] The output device 704 can output various information to the outside, including the determined distance information, direction information, etc. The output device 704 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.

[0098] Of course, to simplify, Figure 7 Only some of the components related to the present disclosure in the electronic device 700 are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device 700 may also include any other appropriate components.

[0099] In addition to the above method and device, the embodiment of the present disclosure may also be a computer program product, which includes computer program instructions. When the computer program instructions are executed by a processor, the processor executes the answer generation method provided by the embodiment of the present disclosure.

[0100] The computer program product may be written in any combination of one or more programming languages ​​to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0101] In addition, the embodiment of the present disclosure may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the answer generation method provided by the embodiment of the present disclosure.

[0102] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0103] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0104] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for generating an answer, characterized in that: include: Get pending issues; Perform multi-layer decomposition processing on the problem to be processed to obtain a problem decomposition tree corresponding to the problem to be processed; wherein the problem decomposition tree includes a plurality of nodes corresponding to the problems one by one, a tree directed line in the problem decomposition tree points from the decomposition problem to the decomposition problem, the decomposition problem is a sub-problem of the corresponding decomposition problem, and the root node of the problem decomposition tree is the problem to be processed; Inverting the problem decomposition tree to obtain a solution topology diagram corresponding to the problem to be processed; A multi-layer problem solving process is performed according to the solution topology diagram to obtain a target answer corresponding to the problem to be solved.

2. The method according to claim 1, characterized in that The multi-layer decomposition process is performed on the problem to be processed to obtain a problem decomposition tree corresponding to the problem to be processed, including: The problem to be processed and the multi-layer disassembly prompt words are input into the problem disassembly model to obtain the problem disassembly tree output by the problem disassembly model.

3. The method according to claim 2, characterized in that The multi-layer disassembly prompt word is used to prompt the problem to be processed to be taken as the problem to be disassembled, to disassemble the problem to be disassembled to obtain an intermediate problem, and to determine whether there is an answer corresponding to the intermediate problem in the preset database. If so, the intermediate problem is taken as the basic problem. Otherwise, the intermediate problem is returned to be taken as a new problem to be disassembled, and a new intermediate problem is determined until there is an answer corresponding to the new intermediate problem in the preset database, or the number of iteration layers reaches a layer threshold.

4. The method according to claim 1, characterized in that The inverting of the problem decomposition tree to obtain a solution topology diagram corresponding to the problem to be processed includes: The tree directed lines in the problem decomposition tree are processed in reverse order to obtain the graph directed lines in the solution topology graph, and the basic problems as leaf nodes in the problem decomposition tree are used as entry problems in the solution topology graph to obtain the solution topology graph.

5. The method according to claim 4, characterized in that The multi-layer problem solving process is performed according to the solution topology diagram to obtain a target answer corresponding to the problem to be solved, including: Taking the entry question as the question to be queried, inputting the question to be queried into the question answering model, and obtaining a query result corresponding to the question to be queried; Combining the query result with the next question pointed to by the query question to obtain a combined question; The combined question is used as a new question to be queried, and a new query result corresponding to the new question to be queried is returned and determined, until the new question to be queried is generated based on the question to be processed, and the new query result is used as the target answer.

6. The method according to claim 5, characterized in that The step of text-combining the query result with the next question pointed to by the question to be queried to obtain a combined question includes: Determine whether the first semantic type and the second semantic type are the same. If so, textually combine the query result and the next question to obtain the combined question; wherein the first semantic type is the semantic type of the query result, and the second semantic type is the semantic type of the part to be supplemented of the next question.

7. The method according to claim 1, characterized in that The parallel branches in the same parallel branch group in the solution topology graph are processed in parallel, and the parallel branches in the same parallel branch group are connected to the same node in the solution topology graph.

8. An answer generation device, characterized in that: include: The acquisition module is used to obtain pending issues; A disassembly module, used for performing multi-layer disassembly processing on the problem to be processed to obtain a problem disassembly tree corresponding to the problem to be processed; wherein the problem disassembly tree includes a plurality of nodes corresponding to the problems one by one, a tree directed line in the problem disassembly tree points from the disassembled problem to the disassembly problem, the disassembly problem is a sub-problem of the corresponding disassembled problem, and the root node of the problem disassembly tree is the problem to be processed; An inversion module, used to invert the problem decomposition tree to obtain a solution topology corresponding to the problem to be processed; The answering module is used to perform multi-layer problem answering processing according to the answering topology diagram to obtain a target answer corresponding to the problem to be processed.

9. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the answer generation method described in any one of claims 1-7 above.

10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program is used to execute the answer generation method described in any one of claims 1 to 7.