Method and device for generating reply, equipment, medium and program product

By detecting and updating nodes in directed acyclic graphs, the problem of inaccurate responses generated by deep learning models when dealing with complex problems is solved, achieving more accurate and reliable response generation.

CN120086334APending Publication Date: 2025-06-03BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510156030.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-12
Publication Date
2025-06-03

AI Technical Summary

Technical Problem

When deep learning models deal with complex problems, it is difficult to generate accurate answers, mainly due to inappropriate or error in the splitting of sub-problems, resulting in unsolvable solutions or inaccurate answers of directed acyclic graphs.

Method used

By detecting whether the nodes in the directed acyclic graph need to be updated, dynamically adjust the directed acyclic graph, and use the target model to generate a reply based on the updated graph.

Benefits of technology

Improves the ability to generate accurate responses when facing complex questions, ensuring the accuracy and reliability of the responses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120086334A_ABST
    Figure CN120086334A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a method and device for generating replies, equipment, a storage medium and a computer program product. The method includes generating a directed acyclic graph for a target problem, an intermediate node in the directed acyclic graph representing a sub-problem for the target problem. The method further includes updating the directed acyclic graph in response to one or more nodes in the directed acyclic graph needing to be updated. And according to the updated directed acyclic graph, generating a target reply aiming at the target question by using a target model. According to the method disclosed by the embodiment of the invention, whether the sub-question represented by a certain node needs to be updated can be detected, when a node needs to be updated, the directed acyclic graph can be dynamically adjusted, and the reply is generated based on the updated directed acyclic graph by using the target model, so that an accurate reply aiming at a complex question can be generated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure generally relates to the field of deep learning, and more particularly to methods, devices, equipment, computer-readable storage media, and computer program products for generating responses. Background Art

[0002] With the rapid development and continuous breakthroughs in deep learning technology, more and more deep learning models have been developed. These models usually have a large number of parameters, which enables them to perform highly complex analysis and understanding of data. In the field of natural language processing, such capabilities mean that deep learning models can capture the nuances and deep meanings in language by learning from a large amount of text data.

[0003] For example, through training, these models can identify the relationships between words, sentence structures, and context clues, thereby better understanding human language. Based on this profound understanding, deep learning models can not only generate grammatically correct and coherent text content, but also ensure that this content is logical and consistent. Therefore, deep learning models have begun to affect many aspects of human life. They are used to improve the interaction experience of voice assistants, automate customer service, and even participate in applications in key fields such as education and healthcare. Summary of the Invention

[0004] According to an exemplary embodiment of the present disclosure, there is provided a method, device, equipment, computer storage medium, and computer program product for generating responses.

[0005] In a first aspect of the present disclosure, there is provided a method for generating a response, the method including generating a directed acyclic graph for a target question, where intermediate nodes in the directed acyclic graph represent sub-questions for the target question. The method further includes updating the directed acyclic graph in response to one or more nodes in the directed acyclic graph needing to be updated. The method further includes using a target model to generate a target response for the target question based on the updated directed acyclic graph.

[0006] In a second aspect of the present disclosure, there is provided a device for generating a response, the device including a graph generation module configured to generate a directed acyclic graph for a target question, where intermediate nodes in the directed acyclic graph represent sub-questions for the target question. The device further includes an update module configured to update the directed acyclic graph in response to one or more nodes in the directed acyclic graph needing to be updated. The device further includes a response module configured to use a target model to generate a target response for the target question based on the updated directed acyclic graph.

[0007] In a third aspect of the present disclosure, there is provided an electronic device, comprising: at least one processing unit; at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions, when executed by the at least one processing unit, causing the electronic device to execute the method described in the first aspect of the present disclosure.

[0008] In a fourth aspect of the present disclosure, there is provided a computer-readable storage medium having machine-executable instructions stored thereon, the machine-executable instructions, when executed by a device, causing the device to execute the method described in the first aspect of the present disclosure.

[0009] In a fifth aspect of the present disclosure, there is provided a computer program product comprising computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the method described in the first aspect of the present disclosure.

[0010] The Summary of the Invention is provided to introduce a series of concepts in a simplified form, which will be further described in the Detailed Description below. The Summary of the Invention is not intended to identify the key features or essential features of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 A schematic diagram showing an example environment in which embodiments of the present disclosure can be implemented;

[0012] Figure 2 A flowchart showing a method for generating a reply according to an embodiment of the present disclosure;

[0013] Figure 3A A schematic diagram showing a method for generating a reply according to an embodiment of the present disclosure;

[0014] Figure 3B A schematic diagram showing the execution of a directed acyclic graph according to an embodiment of the present disclosure;

[0015] Figure 3C A schematic diagram showing determining whether a node needs to be updated according to an embodiment of the present disclosure;

[0016] Figure 4 A schematic diagram showing generating a sub-answer according to an embodiment of the present disclosure;

[0017] Figure 5 A schematic diagram showing determining a sub-answer according to an embodiment of the present disclosure;

[0018] Figure 6A A schematic diagram showing a directed acyclic graph according to an embodiment of the present disclosure;

[0019] Figure 6B Shows a schematic diagram of an updated directed acyclic graph according to an embodiment of the present disclosure;

[0020] Figure 7A Shows a schematic diagram of a directed acyclic graph according to an embodiment of the present disclosure;

[0021] Figure 7B Shows a schematic diagram of an updated directed acyclic graph according to an embodiment of the present disclosure;

[0022] Figure 7C Shows a schematic diagram of an updated directed acyclic graph according to an embodiment of the present disclosure;

[0023] Figure 7D Shows a schematic diagram of an updated directed acyclic graph according to an embodiment of the present disclosure;

[0024] Figure 8 Shows a schematic block diagram of an example device according to some embodiments of the present disclosure;

[0025] Figure 9 Shows a block diagram of an example device that can be used to implement embodiments of the present disclosure.

[0026] In all the drawings, the same or similar reference numerals represent the same or similar elements. Detailed implementation manners

[0027] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only for illustrative purposes and are not used to limit the scope of these messages or information. It can be understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, usage scopes, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0028] For example, when responding to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested by the user will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, an application program, a server, or a storage medium that performs the operations of the technical solutions of the present disclosure according to the prompt message. As an optional but non-limiting implementation manner, the manner of sending a prompt message to the user in response to receiving an active request from the user may be, for example, in the form of a pop-up window, and the prompt message may be presented in text in the pop-up window. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0029] It is understandable that the above notification and the process of obtaining user authorization are only illustrative and do not limit the implementation manner of the present disclosure. Other manners that comply with relevant laws and regulations can also be applied to the implementation manner of the present disclosure.

[0030] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. On the contrary, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not used to limit the protection scope of the present disclosure.

[0031] In the description of the embodiments of the present disclosure, the term "including" and its similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. can refer to different or the same objects, unless otherwise clearly stated. There may also be other explicit and implicit definitions below.

[0032] When using a deep learning model to answer simple questions, the deep learning model can retrieve for the question and generate an accurate answer by using the trained knowledge. However, when using a deep learning model to answer complex questions, the performance is often poor. In the related art, some technical solutions use a deep learning model to split a complex question into multiple sub-questions, form a directed acyclic graph for the complex question, and separately answer these sub-questions to obtain multiple sub-answers, and then summarize these sub-answers to obtain an answer for the complex question. However, due to the limited performance of the deep language model, the multiple sub-questions split may not be appropriate or correct, resulting in an inability to answer a certain sub-question or a certain sub-answer generated containing an error. The inability to answer any one sub-question will lead to no solution for the entire directed acyclic graph, thus unable to accurately answer the complex question. If a sub-answer contains an error, due to the logical coherence of the directed acyclic graph, the error will be transmitted along the directed acyclic graph, resulting in an inaccurate target answer.

[0033] In response to this, the present disclosure proposes a method for generating an answer. When answering each sub-question of the directed acyclic graph, during the process of answering each sub-question, it can be detected whether the sub-question represented by a certain node needs to be updated. When a node needs to be updated, the directed acyclic graph can be dynamically adjusted, and a target model is used to generate an answer based on the updated directed acyclic graph, which helps to generate an accurate answer for a complex question.

[0034] Embodiments of the present disclosure will be further described in detail below with reference to the accompanying drawings, whereFigure 1 FIG. 1 is a schematic diagram of an exemplary environment 100 in which embodiments of the present disclosure can be implemented. In the exemplary environment 100, computing devices 110 and 120 are included. Computing device 110 may be deployed with one or more models (e.g., large language models), which are all trained models capable of generating corresponding responses according to user requests. Figure 1 Computing device 120 is also shown. In some embodiments, computing device 120 communicates with computing device 110 via network 130. Network 130 may include a wired network, a wireless network, or a combination thereof, for providing communication between computing device 120 and computing device 110. In some embodiments, computing device 120 may be connected to computing device 110 via a data cable. The present disclosure does not limit the connection manner between computing device 110 and computing device 120.

[0035] Computing devices 110 and 120 may include, but are not limited to, personal computers, server computers, handheld or laptop devices, mobile devices (such as mobile phones, personal digital assistants (PDAs), media players, etc.), multi-processor systems, consumer electronics, wearable electronic devices, smart home devices, minicomputers, mainframe computers, edge computing devices, distributed computing systems including any one of the above systems or devices, etc.

[0036] An application program (e.g., a client program) for invoking a target model may be installed in computing device 120. Taking Figure 1 the system 100 in FIG. 1 as an example, computing device 120 may communicate with computing device 110 via network 130, send a target question 142 “What are the market values of the first two companies founded by entrepreneur A?” to computing device 110. Computing device 120 invokes the target model on computing device 110 and inputs the target question into the target model. In an embodiment, computing device 110 generates a directed acyclic graph for the target question (i.e., the directed acyclic graph composed of nodes 142, 144, 146, 148). Nodes 144 and 146 in the directed acyclic graph represent sub-questions for the target question, and node 148 represents a response template. In an embodiment, if one or more nodes in the directed acyclic graph need to be updated, computing device 110 may update the directed acyclic graph. As Figure 1As shown, the sub - problem represented by node 144 is not very appropriate. For example, accurate reference materials cannot be retrieved according to the keywords of this sub - problem, resulting in the inability to answer this sub - problem. Then it can be determined that node 144 needs to be updated. As shown by the dashed arrow, the sub - problem represented by node 144 can be updated to another sub - problem (for example, a sub - problem with different keywords). In an embodiment, not only node 144 can be updated, but also the directed acyclic graph composed of nodes 142, 144, 146, and 148 can be updated. For example, a directed acyclic graph composed of nodes 142, 144, 146, 148, and 150 can be obtained after update. Among them, the sub - problems represented by nodes 144 and 146 and the reply template represented by node 148 may also have changed. That is to say, during the process of replying to the directed acyclic graph, nodes that may be abnormal (for example, those representing inappropriate sub - problems) can be detected (or reflected on) at any time, so as to dynamically update the directed acyclic graph.

[0037] In an embodiment, the computing device 110 can generate a target reply for the target problem according to the updated directed acyclic graph. The computing device 110 can gradually retrieve and answer the sub - problems represented by each node in the updated directed acyclic graph, and generate a reply to the target problem 142 by summarizing the answers of each sub - problem. According to the method of the embodiments of the present disclosure, complex and multi - level problems can be processed because it can not only effectively organize and manage each sub - problem, but also improve the accuracy of the answer through a dynamic adjustment mechanism. In this way, when facing complex problems, accurate and comprehensive answers can be generated by continuously iterating and optimizing the solutions of each sub - problem.

[0038] As Figure 1 shown, in the environment 100, the network 130 can be used to transfer data between the computing device 110 and the computing device 120. The network 130 has a theoretical bandwidth. The theoretical bandwidth refers to the maximum transmission speed supported by the network 130, which represents the maximum amount of data that the network 130 can transmit under ideal conditions, usually measured in bits per second (bps). For example, if the theoretical bandwidth of the network 130 is 100 Mbps, it means that under ideal conditions, it can transmit one hundred million bits of data per second. However, in reality, due to other possible factors in the network (such as signal interference, bandwidth sharing, transmission delay, etc.), the actual transmission speed may not reach 100 Mbps.

[0039] As understood by those of ordinary skill in the art, examples of the computing device 110 can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The servers can be directly or indirectly connected through wired or wireless communication means, and the present application does not limit this here.

[0040] The computing device 120 can be any type of mobile computing device, including mobile computers (e.g., personal digital assistants (PDAs), laptop computers, notebook computers, tablet computers, netbooks, etc.), mobile phones (e.g., cellular phones, smartphones, etc.), wearable computing devices (e.g., smartwatches, head-mounted devices, including smart glasses, etc.) or other types of mobile devices. In some embodiments, the computing device 120 can also be a stationary computing device, such as a desktop computer, a gaming console, a smart TV, etc. It should be understood that, when the computing device 120 has sufficient computing power, the computing device 120 can replace the computing device 110 to complete the above operations, or the computing device 110 and the computing device 120 can jointly complete the above operations.

[0041] It should be understood that the architecture and functions in the example environment 100 are described only for exemplary purposes, and do not imply any limitation on the scope of the present disclosure. Embodiments of the present disclosure can also be applied to other environments with different structures and / or functions.

[0042] Figure 2The flowchart of method 200 for generating a response according to certain embodiments of the present disclosure is shown. In this embodiment, this method can be executed by computing device 110. At block 202, a directed acyclic graph for a target question is generated, and the intermediate nodes in the directed acyclic graph represent sub-questions for the target question. A directed acyclic graph (DAG) is a type of graph data structure. A directed acyclic graph is a set composed of nodes (or called vertices) and edges. When these edges have directions and there are no any loops in the whole graph (that is, starting from any node and traveling along the direction of the edge, it is impossible to return to the starting node). In this directed acyclic graph, the nodes represent sub-questions obtained by splitting the target question. In an embodiment, a deep learning model can be used to generate a directed acyclic graph according to the target question. In an embodiment, prompt information can be utilized to generate a directed acyclic graph. In this prompt, the following requirement can be made. If a node depends on a certain parent node, all the information required to answer this node only depends on the answer of this parent node, rather than the answers of other nodes that have no direct association (such as sibling nodes, ancestor nodes, etc.).

[0043] At block 204, in response to one or more nodes in the directed acyclic graph needing to be updated, the directed acyclic graph is updated. After the initial directed acyclic graph is constructed, if it is found that some nodes (i.e., sub-questions) in the directed acyclic graph need to be updated, for example, according to new keywords or another expression, then the update operation will be executed. This update mechanism allows for the refinement or correction of specific sub-questions to ensure that the answer to this sub-question is as accurate as possible. For example, when it is detected that a certain sub-question is not relevant to the reference content, it is considered that this sub-question needs to be updated.

[0044] At block 206, according to the updated directed acyclic graph, a target response for the target question is generated using a target model. Based on the updated directed acyclic graph, the target model is utilized to generate a response to the original target question. Since the necessary adjustments and optimizations have been made to the directed acyclic graph in the previous steps, it is possible to prevent errors from being passed on, ensuring that the finally generated answer has high accuracy and reliability.

[0045] According to the method of the embodiments of the present disclosure, when answering each sub-question of the directed acyclic graph, during the process of answering each sub-question, it is possible to detect whether the sub-question represented by a certain node needs to be updated. When there is a node that needs to be updated, the directed acyclic graph can be dynamically adjusted, and a target model is used to generate a response based on the updated directed acyclic graph, which helps to generate an accurate response to a complex question.

[0046] Figure 3AA schematic diagram of a method for generating a response according to an embodiment of the present disclosure is shown. At 302, a user may input a target question using a computing device 120 and send it to the computing device 110. At 304, the computing device 110 may determine whether the question is a complex question. For example, the computing device 110 may use a deep learning model to determine whether the complexity of the target question is less than a third threshold. The third threshold may be the length of the question, keywords, semantic complexity, etc. If the question is not a complex question, at 306, the computing device 110 may directly call a target model to retrieve the target question to obtain reference content for the target question. The target model may be a pre-trained language model capable of quickly finding reference content related to the question from a database or knowledge base. At 312, the computing device 110 further calls the target model to generate a target response based on the retrieved reference content.

[0047] If it is determined at 304 that the question is a complex question, then at 308, a directed acyclic graph for the target question is generated to represent the decomposition and solution order of the complex question. For example, in a question-and-answer system, a complex question may need to answer "what" first, then "why", and finally "how". The DAG can clearly represent this dependency. At 310, the directed acyclic graph is updated while being executed. That is, starting from the child nodes of the root node of the directed acyclic graph, the target model is used to answer each sub-question represented by each sub-node one by one. During the execution process, it is possible to detect or reflect in real time whether each sub-question is appropriate and whether it needs to be updated as the sub-questions are answered. At 312, a target response for the target question is generated. By decomposing a complex question into multiple sub-questions, the system can process complex queries more efficiently. This method has significant advantages for questions that require multi-step reasoning.

[0048] For the process of generating a directed acyclic graph, in an embodiment, a target model is used to generate a plurality of binary tuples according to the target question, where the binary tuples form the edges of the directed acyclic graph. The binary tuple determines the dependency relationship between the nodes. In an embodiment, a directed acyclic graph is generated according to the plurality of binary tuples and the target question, where the target question is located at the root node of the directed acyclic graph. Figure 3B A schematic diagram of executing a directed acyclic graph according to an embodiment of the present disclosure is shown. As Figure 3B shown, the target question 320 may be split into a directed acyclic graph composed of the following respective nodes. The directed acyclic graph may be an original directed acyclic graph that has not been updated, or an updated directed acyclic graph that has been updated one or more times. In an embodiment, each node of the directed acyclic graph includes a level attribute, and the level attribute indicates the level of the node in the updated directed acyclic graph, and the updated directed acyclic graph includes multiple levels. In an embodiment, each node also has a position attribute, and the position attribute indicates the ordinal number of the node in this level.

[0049] For example, the computing device 110 can set a label for each node <q level,m>, where Q indicates that the label is for a sub - question, level indicates the level of the node, and m indicates the ordinal number of the node in this level. In addition, the computing device 110 can set labels for each node <a level,m>, where A indicates that the tag is for the sub - answer of the parent node, level indicates the level of the parent node, and m indicates the ordinal number of the parent node in this level. In this way, the child node can describe which parent node it depends on through the tag for the sub - answer of the parent node. For example, the child node can record <a 3.5>, which means that the sub-question here should be replaced with the sub-answer of the 5th node at the 3rd level.

[0050] At Figure 3B In the directed acyclic graph shown, the first level includes n nodes, the node 322 representing sub - question 1.1, the node 324 representing sub - question 1.2, and the node 326 representing sub - question 1.n. The sub - question 2.1 represented by the node 328 in the second level depends on the sub - question 1.1 represented by the node 322. That is, the sub - question 2.1 represented by the node 328 needs to utilize the sub - answer for the sub - question 1.1 to obtain a complete sub - question. For example, the subject of sub - question 2.1 can be the sub - answer for sub - question 1.1. Similarly, the sub - question 2.2 represented by the node 330 depends on the sub - question 1.1 represented by the node 322, the sub - question 2.3 represented by the node 332 depends on the sub - question 1.2 represented by the node 324, the sub - questions 2.x represented by the node 334 and 2.y represented by the node 336 depend on 1.n, and the sub - question 3.x represented by the node 338 depends on the sub - question 2.2 represented by the node 330 and the sub - question 2.3 represented by the node 332. The sub - question 3.y represented by the node 340 depends on the sub - question 2.3 represented by the node 332, and so on.

[0051] Therefore, when generating sub - answers for each node in the current level in parallel, a reply operation is performed in parallel for each node in the current level. In an embodiment, the reply operation includes obtaining the sub - answer corresponding to the parent node of the node according to the dependency relationship of the node. In an embodiment, the reply operation includes incorporating the sub - answer into the sub - question represented by the node. In an embodiment, the reply operation includes using a target model to generate a sub - answer corresponding to the node according to the sub - question. For example, the sub - answer can be generated according to formula (1).

[0052] Sub - answer(q)=f(sub - answer(parent node(q)),q,retrieval(q)) (1) where q represents the node number, sub - answer(q) represents the sub - answer of node q, parent node(q) represents the parent node that node q depends on, retrieval result(q) represents the reference content of node q, and f represents the action of calling the target model to generate the sub - answer. That is, obtain the sub - answer corresponding to the parent node, and then incorporate it into the sub - question represented by this node. Retrieve for this sub - question, and use the retrieval result as the reference content for this node. Then call the target model to generate the sub - answer according to this reference content and the sub - question.

[0053] Figure 4 Shows a schematic diagram of generating sub - answers according to an embodiment of the present disclosure. As Figure 4 As shown, the root node 402 represents the target question "What are the current market values of the first two companies founded by Entrepreneur A?" As the root node, it can be split into 4 nodes representing 4 sub-questions, namely node 404 representing the sub-question "<Q1.1>What is the first company founded by Entrepreneur A?", node 406 representing the sub-question "<Q1.2>What is the second company founded by Entrepreneur A?", node 408 representing the sub-question "<Q2.1><A1.1>What is the current market value?", and node 410 representing the sub-question "<Q2.2><A1.2>What is the current market value?". At the lowest level of the directed acyclic graph, the node 412 representing the answer template "The current market values of the first two companies founded by Entrepreneur A are <A2.1> and <A2.2>" can be determined based on these 4 sub-questions. This node 412 is a leaf node in the graph. The answer <A1.1> of node 404 forms the subject of the sub-question represented by node 408, and the answer <A1.2> of node 406 forms the subject of the sub-question represented by node 410. Therefore, after generating the sub-answer for node 404 using the target model, the sub-answer is incorporated into node 408, and the sub-answer for node 408 is generated using the target model. The sub-answer for node 410 is generated in a similar manner. In the embodiment, the sub-answers <A2.1> and <A2.2> are incorporated into node 412 to generate the answer for the root node 402 as the target response.

[0054] Return reference Figure 3B , during the execution of the DAG, for example, the first level among multiple levels is determined as the current level. The response operation is repeatedly executed until the current level is the lowest level. The response operation includes generating sub-answers for each node in the current level in parallel. The response operation also includes updating the next level of the current level to the current level. That is to say, for the n nodes in the first level, each node and its sub-nodes form an independent task chain, and these n task chains can be executed in parallel, thereby improving the response efficiency. During the execution, it is executed in parallel in units of levels. For example, the n nodes in the first level are executed in parallel, and after completion, the multiple nodes in the second level are executed in parallel. As the levels are continuously iterated in this way, the execution of the DAG can be gradually completed.

[0055] After reaching the lowest level, a target response is generated based on the sub-answers of the nodes at the level above the current level and the response template represented by node 342 at the current level. That is, when generating the target response, the sub-answers of all the parent nodes of node 342 are aggregated into response template 342. For example, response template 342 may be the same as the content of question 320, except that some content in response template 342 is replaced by the sub-answers of the parent nodes. In an embodiment, a target model is used to generate the target response by comprehensively analyzing each sub-answer. By decomposing a complex question into multiple sub-questions and using a directed acyclic graph (DAG) to organize and manage the logical relationships between these sub-questions, and simultaneously detecting the rationality of the DAG in real time, this method can ensure the rationality of the split questions and can more accurately handle complex response tasks.

[0056] During the execution of the DAG, for the problem of determining whether a node needs to be updated, it can be achieved by detecting relevance. In an embodiment, the first reference content is retrieved according to the target sub-question. This retrieval can be achieved in various ways, such as by calling a search engine. In an embodiment, a detection model is used to determine the first detection result based on the target sub-question and the first reference content. In an embodiment, if the first detection result indicates that the target sub-question and the first reference content are not relevant, it is determined that the target node needs to be updated. The reason for the irrelevance of the first reference content may be that there are not enough reference materials for the keywords of the target sub-question in the database, etc. Therefore, the sub-answer based on this first reference content will inevitably be inaccurate. So at this time, updating the sub-question represented by this node is a proper choice, which is beneficial to improving the accuracy of generating the target response to the target question. For example, the formula (2) can be used to determine whether a node needs to be updated.

[0057] Relevance = r1(q, retrieve(q)) (2) where q represents the node number, retrieve(q) indicates the reference content of sub-question q, and r1 indicates the action of calling the detection model to determine the relevance.

[0058] Figure 3C A schematic diagram showing whether a node needs to be updated according to an embodiment of the present disclosure is shown. At 370, the sub-problem represented by the current node is obtained. At 372, the sub-problem is input into an embedding model for feature extraction to obtain a vector representation of the sub-problem. At 374, a plurality of documents are obtained, and the plurality of documents record various information. At 376, each document is input into the embedding model for feature extraction to obtain a vector representation of the document. And the vector representation of the document is stored in a vector database as retrieval materials. At 378, the vector representation of the sub-problem and the vector representation of the document are matched according to the similarity to retrieve relevant documents from the vector database. At 380, the relevant documents are input into a fine-ranking model for fine matching, and the retrieval result is screened out as the first reference content for the sub-problem. The fine-ranking model can be the target model or other deep learning models. At 382, a detection model is used to detect whether the first reference content is relevant to the sub-problem. If not, at 384, the sub-problem is updated, for example, the sub-problem represented by the node is regenerated using an update model. If relevant, at 386, the target model is used to generate a sub-answer for the sub-problem. As described above, this can improve the relevance and accuracy of the sub-answer, and thus improve the accuracy of the target response.

[0059] Regarding how to update the sub-problem, in an embodiment, if the target node needs to be updated, an update model is used to update the target sub-problem according to the target sub-problem and the target problem. The update model can be, for example, the target model or other deep learning models. In an embodiment, the target node is updated according to the updated target sub-problem to update the directed acyclic graph. For example, the updated sub-problem may have a different expression, different keywords, etc. from the previous sub-problem.

[0060] To update the sub-problem more accurately, in an embodiment, the computing device 110 can determine the first error reason of the target sub-problem according to the target sub-problem, the target problem, and the first reference content. The error reason can be diverse, such as unreasonable semantic logic, inaccurate data, etc. In an embodiment, the computing device 110 can then generate the first prompt word information according to the target sub-problem, the target problem, the first reference content, and the first error reason. The prompt word information can help the update model better understand the task requirements. In an embodiment, the computing device 110 can further use the update model to update the target sub-problem according to the first prompt word information. By analyzing the error reason, it can help avoid the same error in the updated sub-problem, thereby improving the update efficiency.

[0061] Figure 6A - Figure 6B A schematic diagram showing the update of the sub-problem according to an embodiment of the present disclosure is shown. Figure 6A A schematic diagram of a directed acyclic graph according to an embodiment of the present disclosure is shown. The root node 602 represents the target question "What are the current market values of the first two companies founded by Entrepreneur A?" As the root node, it can be split into 4 sub-questions, namely the node 604 representing the sub-question "<Q1.1>What is the first company founded by Entrepreneur A?", the node 606 representing the sub-question "<Q1.2>What is the second company founded by Entrepreneur A?", the node 608 representing the sub-question "<Q2.1><A1.1>What is the current market value?", and the node 610 representing the sub-question "<Q2.2><A1.2>What is the current market value?". At the lowest level of the directed acyclic graph, the node 612 representing the answer template "The current market values of the first two companies founded by Entrepreneur A are <A2.1> and <A2.2>" can be determined based on these 4 sub-questions. This node 612 is a leaf node in the graph. For the node 608, if the first reference content retrieved for this sub-question is not relevant to this sub-question, then this sub-question and the target question can be input into the update model to generate an updated sub-question.

[0062] Figure 6B A schematic diagram of an updated directed acyclic graph according to an embodiment of the present disclosure is shown. The sub-question represented by the node 608 is updated to "<Q2.1><A1.1>What is the market value in this year's financial statements?" In this way, the market value of the first company can be understood by retrieving the financial statements. This updated sub-question provides a relatively clear retrieval measure, which helps to answer the target question.

[0063] Sometimes, there may be a situation where the target question still cannot be accurately answered after updating the sub-question multiple times. In the embodiment, the target update times for the target node are determined. In the embodiment, if the target update times are greater than the first threshold, the update model is used to generate a new directed acyclic graph based on the directed acyclic graph and the target question. The first threshold can be 5 times or 10 times, etc. In the embodiment, the new directed acyclic graph is used to update the directed acyclic graph. If the target question still cannot be answered after multiple updates, it is possible that the splitting logic of the entire directed acyclic graph is problematic. Therefore, by re-splitting the target question to update the directed acyclic graph, it is beneficial to overcome the defects of the sub-questions and thus generate an accurate target answer.

[0064] Whether to update a node is determined not only based on the relevance of the reference content, but also based on the correctness of the sub-answer. In an embodiment, according to the target sub-question and the first reference content, a target model is used to generate a target sub-answer. In an embodiment, a detection model is used to determine a second detection result based on the target sub-question and the target sub-answer. The detection model can be the same model as the target model or a different model, such as a dedicated detection model. In an embodiment, if the second detection result indicates that the target sub-answer does not correctly answer the target sub-question, it is determined that the target node needs to be updated. If a sub-answer has a certain error, due to the logical coherence of the DAG, then this error will be transmitted along the node chain to the target answer, resulting in an inaccurate target answer. Therefore, this embodiment ensures that the sub-answer has sufficient correctness, which can improve the accuracy of the target answer. For example, the sub-answer can be detected according to formula (3).

[0065] Correctness = r2(q, f(q, retrieve(q))) Formula (3) where q represents the node number, retrieve(q) indicates the reference content of sub-question q, f indicates the action of calling the target model to generate the sub-answer, and r2 indicates the action of calling the detection model to determine the correctness.

[0066] In an embodiment, if the target node of the directed acyclic graph needs to be updated, the target model is used to update the target sub-answer according to the target sub-question and the target sub-answer. For example, the target model can be used to regenerate a sub-answer while excluding the previous sub-answer. In an embodiment, the second update count for the target node is determined. The second update count indicates the number of times the sub-answer is regenerated, indicating that the previously generated sub-answers are all unqualified. In an embodiment, if the second update count is greater than the second threshold, the update model is used to update the target sub-question to update the directed acyclic graph. If the correct sub-answer still cannot be obtained after updating the sub-answer multiple times, it is very likely that there is some defect in the sub-question itself. In this case, the sub-answer can no longer be updated, but the sub-question can be updated, and the sub-answer can be regenerated according to the updated sub-question.

[0067] Figure 5 A schematic diagram of determining a sub - answer according to an embodiment of the present disclosure is shown. Assume that the current execution reaches a certain node. At 502, the sub - answers of the parent node of this node are retrieved and incorporated into the sub - question represented by this node. At 504, a retrieval is performed for this sub - question to determine the reference content for this sub - question. At 506, a detection model is used to determine whether the reference content is relevant to this sub - question. If it is not relevant, then at 508, it is determined whether the update count of this sub - question exceeds a first threshold. If it has exceeded the first threshold, then at 510, the target problem is re - split using the target model to generate a new DAG as the updated DAG, and the updated DAG is executed. If it is determined at 508 that the first threshold has not been exceeded, then at 512, the sub - question is updated, and the process returns to 502 to re - answer this sub - node.

[0068] If it is determined at 506 that the reference content is sufficiently relevant to this sub - node, then proceed to 516, and a sub - answer is generated using the target model. At 518, a detection model is used to determine whether this sub - answer correctly answers this sub - question. If it correctly answers, then this sub - answer is confirmed, and at 520, this sub - answer is incorporated into the sub - question represented by the next node. If it does not correctly answer, then proceed to 522, and a detection model is used to determine whether the update count of this sub - answer exceeds a second threshold. If it has not exceeded the second threshold, then at 516, the target model is used to re - generate the sub - answer. If it has exceeded the second threshold, then there is no need to continue updating the second answer. Instead, proceed to 512, and an update model is used to update the sub - question, and the entire process restarts at 502. According to an embodiment of the present disclosure, the DAG is dynamically adjusted from two aspects: updating the sub - question and updating the sub - answer, ensuring the correctness of each node of the DAG, thereby ensuring that the finally generated target response has a high accuracy.

[0069] Figure 7A - Figure 7D A schematic diagram of updating a directed acyclic graph according to an embodiment of the present disclosure is shown. Figure 7A A schematic diagram of a directed acyclic graph according to an embodiment of the present disclosure is shown. The root node 702 represents the target question "What are the current market values of the first two companies founded by entrepreneur A?" As the root node, it can be split into 2 sub - questions, which are the node 704 representing the sub - question "<Q1.1>What is the market value of the first company founded by entrepreneur A?", the node 706 representing the sub - question "<Q1.2>What is the market value of the second company founded by entrepreneur A?", and the node 708 represents the answer template "The current market values of the first two companies founded by entrepreneur A are <A1.1> and <A1.2> respectively."

[0070] If the sub - node 704 needs to be updated, the target model can be used to re - generate the sub - question. Figure 7B A schematic diagram of an updated directed acyclic graph according to an embodiment of the present disclosure is shown. Among them, the sub-node 704 is updated to the sub-node 710, and other nodes remain unchanged. It can be seen that the sub-question is updated to "<Q1.1> What is the market value shown in the financial statements of the first company founded by entrepreneur A?" In the subsequent process, the target model can be used to answer the updated sub-question to generate a target response.

[0071] It is also possible that the sub-question still needs to be updated, for example, there is not enough relevant reference content. Figure 7C A schematic diagram of an updated directed acyclic graph according to an embodiment of the present disclosure is shown. Among them, the sub-node 704 is updated to the sub-node 712, and other nodes remain unchanged. It can be seen that the sub-question is updated to "<Q1.1> What is the market value of the first company founded by entrepreneur A this year?" In the subsequent process, the target model can be used to answer the updated sub-question to generate a target response.

[0072] It is also possible that the sub-question still needs to be updated. Assuming that the first threshold is set to 1, the node 704 is updated twice, and the number of updates is greater than the first threshold. At this time, the entire DAG needs to be updated. Figure 7D A schematic diagram of an updated directed acyclic graph according to an embodiment of the present disclosure is shown. The root node 702 represents the target question "What are the current market values of the first two companies founded by entrepreneur A?" As the root node, it can be split into 4 nodes representing 4 sub-questions, namely the node 720 representing the sub-question "<Q1.1> What is the first company founded by entrepreneur A?", the node 722 representing the sub-question "<Q1.2> What is the second company founded by entrepreneur A?", the node 724 representing the sub-question "<Q2.1><A1.1> What is the current market value?", and the node 726 representing the sub-question "<Q2.2><A1.2> What is the current market value?". At the lowest level of the directed acyclic graph, the node 728 representing the response template "The current market values of the first two companies founded by entrepreneur A are <A2.1> and <A2.2>" can be determined according to these 4 sub-questions. This node 728 is the leaf node in the graph. Thus, it can be seen that Figure 7D The updated DAG shown has a detailed logical chain, and the target response generated for this DAG has higher accuracy. This method of dynamically adjusting the DAG can significantly improve the accuracy of the target response.

[0073] Figure 8 A schematic block diagram of an example device 800 according to some embodiments of the present disclosure is shown. The device 800 can be implemented by software, hardware, or a combination of both. As Figure 8 shown, the device 800 includes a graph generation module 810, an update module 820, and a response module 830.

[0074] In an embodiment, the generation module 810 may be configured to generate a directed acyclic graph for a target problem, where intermediate nodes in the directed acyclic graph represent sub-problems for the target problem. The update module 820 may be configured to update the directed acyclic graph in response to one or more nodes in the directed acyclic graph needing to be updated. The reply module 830 may be configured to generate a target reply for the target problem using the target model based on the updated directed acyclic graph.

[0075] In an embodiment, the target node represents a target sub-problem, and the apparatus 800 further includes a first retrieval module configured to retrieve first reference content according to the target sub-problem. The apparatus 800 further includes a first determination module configured to use a detection model to determine a first detection result according to the target sub-problem and the first reference content. The apparatus 800 further includes a second determination module configured to determine that the target node needs to be updated in response to the first detection result indicating that the target sub-problem and the first reference content are not relevant.

[0076] In an embodiment, the update module 820 includes a second update module configured to update the target sub-problem using an update model according to the target sub-problem and the target problem in response to the target node needing to be updated. The update module 820 includes a third update module configured to update the target node according to the updated target sub-problem to update the directed acyclic graph.

[0077] In an embodiment, the second update module includes a third determination module configured to determine a first error reason of the target sub-problem according to the target sub-problem, the target problem, and the first reference content. The second update module further includes a second generation module configured to generate first prompt word information according to the target sub-problem, the target problem, the first reference content, and the first error reason. The second update module further includes a fourth update module configured to update the target sub-problem using the update model according to the first prompt word information.

[0078] In an embodiment, the update module 820 includes a fourth determination module configured to determine a target update count for the target node. The update module 820 further includes a third generation module configured to generate a new directed acyclic graph using the update model according to the directed acyclic graph and the target problem in response to the target update count being greater than a first threshold. The update module 820 further includes a fifth update module configured to update the directed acyclic graph using the new directed acyclic graph.

[0079] In an embodiment, the apparatus 800 further includes a fourth generation module configured to generate a target sub - answer for a target sub - question and a first reference content by using a target model. The apparatus 800 further includes a fifth determination module configured to use a detection model to determine a second detection result based on the target sub - question and the target sub - answer. The apparatus 800 further includes a sixth determination module configured to determine that a target node needs to be updated in response to the second detection result indicating that the target sub - answer does not correctly answer the target sub - question.

[0080] In an embodiment, the update module 820 includes a sixth update module configured to update the target sub - answer for a target sub - question and a target sub - answer by using a target model in response to a target node of a directed acyclic graph needing to be updated. The update module 820 further includes a seventh determination module configured to determine a second update count for the target node. The update module 820 further includes a seventh update module configured to update the target sub - question by using an update model to update the directed acyclic graph in response to the second update count being greater than a second threshold.

[0081] In an embodiment, the generation module 810 includes a binary - tuple generation module configured to generate a plurality of binary - tuples for a target question by using a target model, where the binary - tuples form edges of a directed acyclic graph. The generation module 810 further includes a fifth generation module configured to generate a directed acyclic graph based on the plurality of binary - tuples and the target question, where the target question is located at a root node of the directed acyclic graph.

[0082] In an embodiment, each node of the updated directed acyclic graph includes a level attribute, the level attribute indicating the level of the node in the updated directed acyclic graph, a leaf node of the updated directed acyclic graph represents a reply template, and the updated directed acyclic graph includes a plurality of levels, and the reply module 830 includes an eighth determination module configured to determine a first level among the plurality of levels as the current level. The reply module 830 further includes a first iteration module configured to repeatedly perform the following operations until the current level is the lowest level: generate sub - answers for each node in the current level in parallel; and update the next level of the current level to the current level. The reply module 830 further includes a sixth generation module configured to generate a target reply based on the sub - answer of the node in the upper level of the current level and the reply template represented by the node in the current level.

[0083] In an embodiment, the binary - tuple indicates a dependency relationship between two nodes, and the first iteration module includes a second iteration module configured to perform the following operations in parallel for each node in the current level: obtain the sub - answer corresponding to the parent node of the node according to the dependency relationship of the node; incorporate the sub - answer into the sub - question represented by the node; and generate the sub - answer corresponding to the node by using a target model according to the sub - question.

[0084] In an embodiment, the apparatus 800 further includes an obtaining module configured to obtain a second question. The apparatus 800 further includes a second retrieval module configured to retrieve second reference content for the second question in response to the complexity of the second question being less than a third threshold. The apparatus 800 further includes an eighth generation module configured to generate a second response for the second question using a target model.

[0085] The division of modules or units in the embodiments of the present disclosure is illustrative, merely a logical function division. In actual implementation, there may be other division methods. Additionally, in the embodiments of the present disclosure, each functional unit may be integrated into one unit, may exist physically alone, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of a software functional unit.

[0086] Figure 9 A block diagram of an example device 900 that can be used to implement the embodiments of the present disclosure is shown. It should be understood that Figure 9 The shown device 900 is merely exemplary and should not constitute any limitation to the functions and scope of the implementations described herein. For example, the device 900 may correspond to the computing device 110 described herein in conjunction with Figure 1 and may be used to execute the processes described above.

[0087] As Figure 9 shown, the device 900 is in the form of a general-purpose computing device. The components of the computing device 900 may include, but are not limited to, one or more processors or processing units 910, a memory 920, a storage device 930, one or more communication units 940, one or more input devices 950, and one or more output devices 960. The processing unit 910 may be an actual or virtual processor and is capable of performing various processes according to the programs stored in the memory 920. In a multi-processor system, multiple processing units execute computer-executable instructions in parallel to improve the parallel processing ability of the computing device 900.

[0088] Computing device 900 generally includes multiple computer storage media. Such media can be any available media accessible to computing device 900, including but not limited to volatile and non-volatile media, removable and non-removable media. Memory 920 can be volatile memory (such as registers, caches, random access memory (RAM)), non-volatile memory (such as read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory), or some combination thereof. Storage device 930 can be removable or non-removable media and can include machine-readable media such as a flash drive, a magnetic disk, or any other media that can be capable of storing information and / or data (such as training data for training) and can be accessed within computing device 900.

[0089] Computing device 900 can further include additional removable / non-removable, volatile / non-volatile storage media. Although not shown in Figure 9 it, a disk drive for reading from or writing to a removable, non-volatile magnetic disk (such as a "floppy disk") and an optical disk drive for reading from or writing to a removable, non-volatile optical disk can be provided. In these cases, each drive can be connected to a bus (not shown) by one or more data media interfaces. Memory 920 can include a computer program product 925 having one or more program modules that are configured to perform the various methods or actions of the various implementations of the present disclosure.

[0090] Communication unit 940 enables communication with other computing devices through a communication medium. Additionally, the functions of the components of computing device 900 can be implemented in a single computing cluster or multiple computer machines that can communicate through a communication connection. Thus, computing device 900 can operate in a networked environment using a logical connection with one or more other servers, network personal computers (PCs), or another network node.

[0091] The input device 950 can be one or more input devices, such as a mouse, a keyboard, a trackball, etc. The output device 960 can be one or more output devices, such as a display, a speaker, a printer, etc. The computing device 900 can also communicate with one or more external devices (not shown) as needed through the communication unit 940. The external devices such as a storage device, a display device, etc., communicate with one or more devices that enable a user to interact with the computing device 900, or communicate with any device (e.g., a network card, a modem, etc.) that enables the computing device 900 to communicate with one or more other computing devices. Such communication can be performed via an input / output (I / O) interface (not shown).

[0092] According to an example implementation of the present disclosure, there is provided a computer-readable storage medium having computer-executable instructions stored thereon, wherein the computer-executable instructions are executed by a processor to implement the method described above. According to an example implementation of the present disclosure, there is also provided a computer program product, the computer program product being tangibly stored on a non-transitory computer-readable medium and including computer-executable instructions, and the computer-executable instructions being executed by a processor to implement the method described above. According to an example implementation of the present disclosure, there is provided a computer program product having a computer program stored thereon, and the program, when executed by a processor, implements the method described above.

[0093] Aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of methods, apparatuses, devices, and computer program products implemented according to the present disclosure. It should be understood that each block of the flowcharts and / or block diagrams, and the combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer-readable program instructions.

[0094] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine such that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device is produced that implements the functions / acts specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause a computer, a programmable data processing device, and / or other devices to work in a specific manner. Thus, the computer-readable medium storing the instructions includes a manufacture, which includes instructions for implementing various aspects of the functions / acts specified in one or more blocks of the flowchart and / or block diagram.

[0095] Computer-readable program instructions may be loaded onto a computer, other programmable data processing apparatus, or other device, causing a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to generate a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / acts specified in one or more boxes of the flowchart and / or block diagram.

[0096] The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various implementations of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of an instruction, which contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions noted in the blocks may occur in an order different from that noted in the figures. For example, two consecutive blocks may in fact be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or acts, or by a combination of dedicated hardware and computer instructions.

[0097] The various implementations of the present disclosure have been described above. The above description is exemplary, not exhaustive, and is not limited to the disclosed implementations. Many modifications and variations will be apparent to those of ordinary skill in the art in the field without departing from the scope and spirit of the described implementations. The choice of terms used herein is intended to best explain the principles of the implementations, the practical application, or the improvement of the technology in the market, or to enable other ordinary skilled artisans in the art to understand the various implementations disclosed herein.< / q>

Claims

1. A method for generating a reply, comprising: Generate a directed acyclic graph for a target problem, wherein intermediate nodes in the directed acyclic graph represent sub-problems for the target problem; In response to one or more nodes in the directed acyclic graph needing to be updated, updating the directed acyclic graph; as well as Based on the updated directed acyclic graph, a target answer to the target question is generated using a target model.

2. The method of claim 1, wherein the target node represents a target sub-problem, and the method further comprises: Retrieving a first reference content according to the target sub-question; Using a detection model, determining a first detection result according to the target sub-question and the first reference content; as well as In response to the first detection result indicating that the target sub-question is not related to the first reference content, it is determined that the target node needs to be updated.

3. The method according to claim 2, wherein in response to one or more nodes in the directed acyclic graph needing to be updated, updating the directed acyclic graph comprises: In response to the target node needing to be updated, using an update model, updating the target subproblem according to the target subproblem and the target problem; as well as The target node is updated according to the updated target subproblem to update the directed acyclic graph.

4. The method of claim 3, wherein updating the target subproblem according to the target subproblem and the target problem using an update model comprises: determining a first error cause of the target sub-problem according to the target sub-problem, the target problem, and the first reference content; Generate first prompt word information according to the target sub-question, the target question, the first reference content, and the first error cause; as well as Using the updated model, the target sub-problem is updated according to the first prompt word information.

5. The method according to claim 2, wherein in response to one or more nodes in the directed acyclic graph needing to be updated, updating the directed acyclic graph comprises: Determining a target update number for the target node; In response to the target update number being greater than a first threshold, using an update model to generate a new directed acyclic graph according to the directed acyclic graph and the target problem; as well as The directed acyclic graph is updated using the new directed acyclic graph.

6. The method according to claim 2, further comprising: Generate a target sub-answer using the target model according to the target sub-question and the first reference content; Using the detection model, determining a second detection result according to the target sub-question and the target sub-answer; as well as In response to the second detection result indicating that the target sub-answer does not correctly solve the target sub-question, it is determined that the target node needs to be updated.

7. The method according to claim 6, wherein in response to one or more nodes in the directed acyclic graph needing to be updated, updating the directed acyclic graph comprises: In response to a target node of the directed acyclic graph needing to be updated, using the target model, updating the target sub-answer according to the target sub-question and the target sub-answer; Determining a second update number for the target node; as well as In response to the second update number being greater than a second threshold, the target subproblem is updated using an update model to update the directed acyclic graph.

8. The method of claim 1, wherein generating a directed acyclic graph for a target problem comprises: Using the target model, generating a plurality of bigrams according to the target problem, wherein the bigrams constitute edges of the directed acyclic graph; as well as The directed acyclic graph is generated according to the multiple binary groups and the target question, wherein the target question is located at a root node of the directed acyclic graph.

9. The method according to claim 8, wherein each node of the updated directed acyclic graph comprises a level attribute, the level attribute indicates the level of the node in the updated directed acyclic graph, a leaf node of the updated directed acyclic graph represents a reply template, and the updated directed acyclic graph comprises a plurality of levels, and according to the updated directed acyclic graph, generating a target reply for the target question using a target model comprises: determining a first level among the plurality of levels as a current level; Repeat the following steps until the current level is the lowest level: Generate a sub-answer for each node in the current level in parallel; as well as Updating the next level of the current level to the current level; The target reply is generated according to the sub-answers of the nodes at the previous level of the current level and the reply template represented by the nodes at the current level.

10. The method of claim 9, wherein the two-tuple indicates a dependency relationship between two nodes, and generating a sub-answer for each node in the current level in parallel comprises: Perform the following operations in parallel for each node in the current level: According to the dependency relationship of the node, obtain the child answer corresponding to the parent node of the node; Incorporating the sub-answer into the sub-question represented by the node; as well as Using the target model, a sub-answer corresponding to the node is generated according to the sub-question.

11. The method according to claim 1, further comprising: Get the second question; In response to the complexity of the second question being less than a third threshold, retrieving second reference content for the second question; A second response to the second question is generated using the target model.

12. An apparatus for generating a reply, comprising: A graph generation module is configured to generate a directed acyclic graph for a target problem, wherein intermediate nodes in the directed acyclic graph represent sub-problems for the target problem; An updating module, configured to update the directed acyclic graph in response to one or more nodes in the directed acyclic graph needing to be updated; as well as The answer module is configured to generate a target answer to the target question using a target model based on the updated directed acyclic graph.

13. An electronic device comprising: at least one processing unit; At least one memory, the at least one memory being coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions, when executed by the at least one processing unit, causing the electronic device to perform the method according to any one of claims 1 to 11.

14. A computer program product having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method according to any one of claims 1 to 11.

Citation Information

Cited By

  • Multi-round retrieval enhancement generation method and device, equipment and storage medium

    CN120950634A

  • Multi-round search enhanced generation method and device, equipment and storage medium

    CN120950634B