Response generation method and device, medium and program product
By introducing a lightweight additional network into the generative model to generate inference information, the problem of long response time in the prior art is solved, and faster and more accurate response generation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- KE COM (BEIJING) TECHNOLOGY CO LTD
- Filing Date
- 2025-12-04
- Publication Date
- 2026-04-24
AI Technical Summary
Existing response generation methods are time-consuming and have poor response results.
By introducing additional networks to generate inference information, and combining lightweight networks such as Adapter networks with the generative model, intermediate process information is generated to guide the generation of response text.
It improved the accuracy and efficiency of responses, shortened response time, and increased user satisfaction.
Smart Images

Figure CN121920320A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a response generation method, apparatus, medium, and program product. Background Technology
[0002] In various industries and daily life, there is a widespread need for automated responses to user statements (such as user-generated questions) to provide convenience. The inventors' research revealed that related technologies have unsatisfactory response effects, such as long response times, and therefore require further improvement. Summary of the Invention
[0003] To solve the above-mentioned technical problems, or at least partially solve them, this disclosure provides a response generation method, apparatus, medium, and program product.
[0004] This disclosure provides a response generation method, the method comprising: acquiring target text; generating inference information based on the target text through an additional network corresponding to a preset generation model; wherein the inference information is intermediate process information used to infer a response text corresponding to the target text; and generating the response text corresponding to the target text through the preset generation model based on the inference information and the target text.
[0005] Optionally, generating inference information includes: obtaining a query vector; wherein the query vector is used to guide the additional network to extract feature vectors related to inference information corresponding to the target text; and generating inference information based on the target text and the query vector.
[0006] Optionally, generating inference information based on the target text and the query vector includes: processing the target text and the query vector based on a cross-attention mechanism to obtain inference information represented in the form of feature vectors.
[0007] Optionally, the preset generation model includes multiple target network blocks with the same structure, and the multiple target network blocks are connected in series; the number of additional networks is the same as the number of target network blocks, and each target network block embeds one additional network.
[0008] Optionally, the input information of the target network block includes text information and query information; the output information of the target network block includes the hidden state of the text information corresponding to the target network block and the hidden state of the query information corresponding to the target network block; wherein, the text information corresponding to the first target network block is the target text, and the query information corresponding to the first target network block is the query vector corresponding to the additional network in the target network block; the text information corresponding to non-first target network blocks is the hidden state of the text information corresponding to the previous target network block, and the query information corresponding to non-first target network blocks is the hidden state of the query information corresponding to the previous target network block.
[0009] Optionally, the additional network within the target network block is used to generate an injection vector based on the input information of the target network block; the target network block is used to obtain the output information of the target network block based on the text information corresponding to the target network block and the injection vector; wherein, the injection vector is a feature vector related to the inference information corresponding to the target text.
[0010] Optionally, obtaining the target text includes: obtaining the question text to be answered; if historical dialogue text related to the question text is detected, using the historical dialogue text and the question text as target text; if no historical dialogue text related to the question text is detected, using the question text as target text.
[0011] This disclosure also provides an electronic device, comprising: a storage device storing a computer program thereon; and a processing device for executing the computer program in the storage device to implement the response generation method provided in this disclosure.
[0012] This disclosure also provides a computer-readable storage medium storing a computer program for executing the response generation method provided in this disclosure.
[0013] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the response generation method provided in this disclosure.
[0014] The technical solution provided in this disclosure does not directly provide the target text to be responded to to the model, so that the generation model can generate the response text corresponding to the target text. Instead, it configures an additional network for the generation model, first generating inference information (i.e., intermediate process information used to infer the response text corresponding to the target text) through the additional network. Based on this, the generation model generates the response text based on the inference information and the target text. The additional network not only provides the generation model with intermediate process information used to infer the response text corresponding to the target text, enabling the generation model to generate more accurate and reliable response text, but also saves the time of the generation model in generating response text, which helps to shorten the response time and comprehensively improve user satisfaction.
[0015] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0016] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0017] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 A schematic flowchart of a response generation method provided in an embodiment of this disclosure; Figure 2 This is a schematic diagram of a response generation process provided in an embodiment of the present disclosure; Figure 3 A schematic diagram of a model structure provided in an embodiment of this disclosure; Figure 4 A schematic diagram of a network structure provided in an embodiment of this disclosure; Figure 5 This is a schematic diagram of the structure of a response generation device provided in an embodiment of the present disclosure; Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0019] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0020] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.
[0021] Figure 1 This is a flowchart illustrating a response generation method provided in an embodiment of the present disclosure. The method can be executed by a response generation device, which can be implemented in software and / or hardware, and is generally integrated into an electronic device. Figure 1 As shown, the method mainly includes the following steps S102 to S106: Step S102: Obtain the target text.
[0022] The target text is the text to be answered. In practical applications, if a user's voice message to be answered is received, the voice message to be answered can be converted into text, and the converted text can be used as the target text for subsequent processing.
[0023] To improve response accuracy, in some specific examples, the text of the question to be answered can be obtained first. If historical dialogue text related to the question text is detected, this historical dialogue text and the question text are used as the target text. If no historical dialogue text related to the question text is detected, the question text is used as the target text. Historical dialogue text related to the target question can be determined in ways such as: using the dialogue text of the user to which the target question belongs within a specified time period; and / or, using the dialogue text under the topic to which the target question belongs. These methods provide contextual information related to the question text to be answered, which helps to obtain more accurate response results.
[0024] Step S104: Based on the target text, generate inference information through an additional network corresponding to the preset generation model; wherein, the inference information is intermediate process information used to infer the response text corresponding to the target text.
[0025] This disclosure does not limit the structure of the generative model or the structure of the supplementary network. For example, the generative model can be a large language model, and the supplementary network can be a lightweight network. Exemplarily, the supplementary network includes multiple cascaded Transformer network blocks, with cross-attention units added to the Transformer network blocks to better facilitate information interaction. In some specific examples, the supplementary network can be an Adapter network, which effectively achieves the effects of being lightweight, easy to train, and easy to combine with the generative model. The supplementary network can perform processing such as feature extraction, feature mapping, and querying features related to inference information based on the target text to generate inference information. This inference information can also be referred to as the implicit thought process generated by the supplementary network for the target text, and can be specifically represented in the form of feature vectors. The supplementary network can be combined with some networks in the generative model, and this inference information can be injected into the corresponding generation process (such as the response generation process) of the generative model through some networks in the generative model.
[0026] While some generative models employ a thought chain approach to reason about responses, this method requires processing a large number of lexical units, significantly increasing the overall length of the lexical sequence, resulting in high computational cost, long processing time, and limited controllability. This embodiment of the present disclosure fully considers these issues and therefore utilizes an additional network to prioritize the generation of reasoning information. This additional network is typically a lightweight network with fewer parameters and requires less information processing; both the number of network parameters and the amount of information processed are far less than in the generative model. Furthermore, training this additional network effectively ensures the controllability of the output results, thus guaranteeing the reliability of the reasoning information. The additional network provides the reasoning information to the generative model, which serves as a directional guide, leading the model to quickly generate accurate responses without the need for a time-consuming thought chain approach, thus reducing model response time. Additionally, by configuring an additional network for the generative model, the impact on the original performance of the generative model is minimized, and implementation is easier.
[0027] Step S106: Based on the inference information and the target text, generate the response text corresponding to the target text using a preset generation model. For example, the inference information and the target text can be concatenated, and the concatenation result can be input into the generation model to obtain the response text output by the generation model. This response text is the model's reply information to the target text.
[0028] In practical applications, the response text can also be converted into audio and played to achieve the effect of voice interaction with the user.
[0029] For easier understanding, you can also refer to Figure 2The diagram illustrates a response generation process. It should be noted that, in order to clearly present the information interaction relationships, Figure 2 The additional network and the generative model are illustrated separately. In practical applications, the additional network and the generative model can be combined. For example, the additional network can be embedded inside the generative model. This disclosure does not limit the way the additional network and the generative model can be combined.
[0030] The technical solution provided in this disclosure does not directly provide the target text to be responded to to the model. Instead, it first uses the additional network configured by the generative model to generate inference information, and then the generative model generates response text based on the inference information and the target text. The generative model no longer needs to spend a long time thinking about how to respond using methods such as thought chains. Instead, it can respond quickly and accurately under the guidance of the inference information, which can improve the quality of response and shorten the response time, thus effectively improving user satisfaction.
[0031] In some implementations, the steps for generating reasoning information described above can refer to steps a and b as follows: Step a, obtain the query vector; where the query vector is a vector learned by the additional network through training, that is, the above query vector is a learnable vector; for example, the initial state of the query vector can be a random vector. By training the additional network, the query vector is continuously learned and updated, and the query vector obtained after training is used as the above-obtained query vector. The query vector is used to guide the additional network to extract feature vectors related to the reasoning information corresponding to the target text.
[0032] Step b involves generating inference information based on the target text and query vector. The query vector guides the additional network to focus on the most relevant and useful parts of the target text and to consider the direction of the response, thereby obtaining inference information and making subsequent processing simpler and more efficient.
[0033] To ensure the reliability of the generated inference information, in some specific examples, a cross-attention mechanism can be used to process the target text and query vector to obtain inference information represented in the form of feature vectors. The cross-attention mechanism can handle the relationship between the target text and the query vector, enabling interaction between them. Based on this mechanism, the relevance of each piece of information in the query vector and the target text can be determined, and the attention weights corresponding to each piece of information can be obtained. Based on this, the information in the target text that needs to be focused on can be identified, thereby generating intermediate process information for inference to obtain the corresponding response text.
[0034] In some implementations, the preset generative model includes multiple target network blocks with identical structures, which are connected serially. The number of additional networks is the same as the number of target network blocks, and each target network block embeds one additional network. These target network blocks are the network blocks in the generative model used to combine with the additional networks. For ease of understanding, see [link to relevant documentation]. Figure 3 The diagram illustrates a model structure, showing multiple target network blocks connected in series, each target network block embedding an additional network. This disclosure does not limit the structure of the target network blocks; for example, it can be implemented based on Transformer network units. It should be noted that the preset generative model may also include other networks besides the target network blocks, such as an input embedding layer before the first target network block and an output embedding layer after the last target network block, or it may include other functional network units; these are not limited here.
[0035] In some specific examples, the additional network can be placed before the original network units in the target network block. For instance, the original network units of the target network block include a sequentially connected multi-head attention mechanism unit and a multilayer perceptron; the additional network in the target network block is located before the multi-head attention mechanism unit. The multi-head attention mechanism unit enables the model to focus on the correlations between different positions in the input sequence, establishing long-distance dependencies. The multilayer perceptron introduces nonlinear transformations, performing nonlinear transformations and semantic enhancement on the features output by the multi-head attention mechanism unit, which can effectively enhance the model's expressive power. It should be noted that the original network units of the target network block may include not only the sequentially connected multi-head attention mechanism unit and multilayer perceptron, but also units such as residual connections and normalization processing units, which will not be elaborated further here.
[0036] In some specific examples, the input information of the target network block includes text information and query information; the output information of the target network block includes the hidden state of the text information corresponding to the target network block and the hidden state of the query information corresponding to the target network block. Specifically, the text information corresponding to the first target network block is the target text, and the query information corresponding to the first target network block is the query vector corresponding to the additional network in that target network block; the text information corresponding to non-first target network blocks is the hidden state of the text information corresponding to the previous target network block, and the query information corresponding to non-first target network blocks is the hidden state of the query information corresponding to the previous target network block. The target network block can generate corresponding hidden states based on its input data. These hidden states can be represented in the form of feature vectors, which can be understood as intermediate representation vectors obtained by the target network block processing its input data. For example, they can also be understood as encoding the abstract features and information of the corresponding data at a specific layer. For instance, the hidden state of text information is the abstract feature corresponding to the text information, carrying deeper information related to the text information. By iterating through multiple target network blocks, deeper and richer information can be gradually obtained, contributing to more accurate response results.
[0037] For ease of understanding, see [link to relevant documentation]. Figure 4 The diagram shown illustrates a network structure, simply demonstrating the information interaction between target network block 1 and target network block 2. Figure 4 The diagram illustrates that the target network block mainly comprises a multi-head attention mechanism unit and a multilayer perceptron. For example, any additional networks, such as Additional Network 1 and Additional Network 2, can be implemented using an Adapter network. The input to target network block 1 is a query vector and target text. Additional Network 1 can perform interactive attention processing based on the query vector and target text to generate a feature vector representing the inference information. This feature vector, along with the target text, is then provided to the original network layers of target network block 1. The target network block can output the hidden state 1 of the text information and the hidden state 2 of the query information. The processing logic of target network block 2 is basically the same as that of target network block 1, and the remaining target network blocks are similar, so they will not be elaborated further here. It should be noted that through layer-by-layer processing, more accurate and effective inference information can be extracted using the additional networks, and more reliable response text can be gradually obtained using the target network blocks.
[0038] An additional network within the target network block generates an injection vector based on the input information of the target network block. The target network block then generates its output information based on the corresponding text information and the injection vector. The injection vector is a feature vector related to the inference information corresponding to the target text, and can be directly considered as at least part of the inference information. This injection vector can be injected as a condition into the target network block, thereby guiding it to gradually generate accurate response results.
[0039] In practical applications, the generative model and the additional network can be trained jointly. For example, the initial generative model and the initial additional network can be jointly trained using text samples carrying response samples until the training termination condition is met, such as until the loss value between the response text output by the generative model for the text sample and the corresponding response sample is less than a preset threshold, then the training ends.
[0040] In summary, the response generation method provided in this embodiment of the present disclosure, by introducing additional networks such as Adapter networks to generate inference information in advance, not only provides the generation model with intermediate process information for inferring the response text corresponding to the target text, enabling the generation model to generate more accurate and reliable response text, but also greatly reduces the time for the generation model to generate complete response text, which helps to shorten response time and comprehensively improve user satisfaction.
[0041] This disclosure does not limit the application scenarios of the above-described response generation method; it can be applied to any scenario requiring intelligent response using a generative model. In some specific examples, it can be applied to dialogue simulation scenarios, such as using a generative model to simulate a designated role accompanying a user in dialogue practice to improve the user's professional communication skills and assist the user in familiarizing themselves with business-related knowledge. This designated role can be flexibly set; for example, the user's identity could be a salesperson, and the designated role simulated by the generative model could be a customer. The response generation method provided by this disclosure can effectively achieve intelligent human-computer interaction, ensure the quality of human-computer interaction, and effectively reduce the response time of the generative model, thus reducing user waiting time.
[0042] Corresponding to the aforementioned response generation method, this disclosure further provides a response generation apparatus. Figure 5 This is a schematic diagram of a response generation device provided in an embodiment of the present disclosure. The device can be implemented by software and / or hardware, and is generally integrated into an electronic device, such as... Figure 5 As shown, the response generation device includes: The text acquisition module 502 is used to acquire the target text.
[0043] The reasoning information generation module 504 generates reasoning information based on the target text through an additional network corresponding to a preset generation model; wherein, the reasoning information is intermediate process information used to reason the response text corresponding to the target text; The response text generation module 506 generates the response text corresponding to the target text based on the reasoning information and the target text, using the preset generation model.
[0044] The apparatus provided in this embodiment does not directly provide the target text to be responded to to the model. Instead, it first uses the additional network configured by the generative model to generate inference information, and then the generative model generates response text based on the inference information and the target text. The generative model no longer needs to spend a long time thinking about how to respond using thought chains or other methods. Instead, it can respond quickly and accurately under the guidance of the inference information, which can improve the quality of response and shorten the response time, thereby effectively improving user satisfaction.
[0045] In some implementations, the inference information generation module 504 is specifically used to: obtain a query vector; wherein the query vector is a vector learned by the supplementary network through training, and the query vector is used to guide the supplementary network to extract feature vectors related to the inference information corresponding to the target text; and generate inference information based on the target text and the query vector.
[0046] In some implementations, the reasoning information generation module 504 is specifically used to: process the target text and the query vector based on a cross-attention mechanism to obtain reasoning information represented in the form of feature vectors.
[0047] In some implementations, the preset generation model includes multiple target network blocks with identical structures, and the multiple target network blocks are connected in series; the number of additional networks is the same as the number of target network blocks, and each target network block embeds one additional network.
[0048] In some implementations, the input information of the target network block includes text information and query information; the output information of the target network block includes the hidden state of the text information corresponding to the target network block and the hidden state of the query information corresponding to the target network block; wherein, the text information corresponding to the first target network block is the target text, and the query information corresponding to the first target network block is the query vector corresponding to the additional network in the target network block; the text information corresponding to non-first target network blocks is the hidden state of the text information corresponding to the previous target network block, and the query information corresponding to non-first target network blocks is the hidden state of the query information corresponding to the previous target network block.
[0049] In some implementations, an additional network within the target network block is used to generate an injection vector based on the input information of the target network block; the target network block is used to obtain the output information of the target network block based on the text information corresponding to the target network block and the injection vector; wherein, the injection vector is a feature vector related to the inference information corresponding to the target text.
[0050] In some implementations, the text acquisition module 502 is specifically used to: acquire the question text to be answered; if historical dialogue text related to the question text is detected, use the historical dialogue text and the question text as target text; if no historical dialogue text related to the question text is detected, use the question text as target text.
[0051] The response generation apparatus provided in this disclosure can execute the response generation method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0052] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device embodiments can be referred to the corresponding process in the method embodiments, and will not be repeated here.
[0053] This disclosure provides an electronic device, which includes: a storage device storing a computer program thereon; and a processing device for executing the computer program in the storage device to implement the steps of any method of this disclosure.
[0054] The following is for reference. Figure 6 The diagram illustrates a structural schematic of an electronic device 600 suitable for implementing embodiments of the present disclosure. Terminal devices in embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0055] like Figure 6 As shown, electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 601, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 602 or a program loaded from storage device 608 into random access memory (RAM) 603. RAM 603 also stores various programs and data required for the operation of electronic device 600. Processing device 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.
[0056] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, magnetic tapes, hard disks, etc.; and communication devices 609. Communication device 609 allows electronic device 600 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 An electronic device 600 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0057] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, it performs the functions defined in the methods of embodiments of this disclosure.
[0058] In addition to the methods and devices described above, embodiments of this disclosure can also be computer program products, comprising computer program instructions that, when executed by a processor, cause the processor to perform the methods provided in the embodiments of this disclosure. The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of this disclosure. These programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on a user computing device, partially on a user device, as a standalone software package, partially on a user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0059] Furthermore, embodiments of this disclosure may also be computer-readable storage media storing computer program instructions that, when executed by a processor, cause the processor to perform the response generation method provided in embodiments of this disclosure.
[0060] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.
[0061] This disclosure also provides a computer program product, including a computer program / instruction that, when executed by a processor, implements the response generation method in this disclosure.
[0062] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0063] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0064] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose whether to "agree" or "disagree" to provide personal information to the electronic device.
[0065] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0066] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0067] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily 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 this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A response generation method, characterized in that, include: Get the target text; Based on the target text, inference information is generated through an additional network corresponding to a preset generation model; wherein, the inference information is intermediate process information used to infer the response text corresponding to the target text; Based on the reasoning information and the target text, the response text corresponding to the target text is generated through the preset generation model.
2. The method according to claim 1, characterized in that, The generated reasoning information includes: Obtain a query vector; wherein the query vector is used to guide the additional network to extract feature vectors related to the inference information corresponding to the target text; Inference information is generated based on the target text and the query vector.
3. The method according to claim 2, characterized in that, The generation of inference information based on the target text and the query vector includes: The target text and the query vector are processed based on a cross-attention mechanism to obtain inference information represented in the form of feature vectors.
4. The method according to claim 1, characterized in that, The preset generation model includes multiple target network blocks with the same structure, and the multiple target network blocks are connected in series; the number of additional networks is the same as the number of target network blocks, and each target network block embeds one additional network.
5. The method according to claim 4, characterized in that, The input information of the target network block includes text information and query information; the output information of the target network block includes the hidden state of the text information corresponding to the target network block and the hidden state of the query information corresponding to the target network block; wherein... The text information corresponding to the first target network block is the target text, and the query information corresponding to the first target network block is the query vector corresponding to the additional network in the target network block. The text information corresponding to the target network block that is not the first one is the hidden state of the text information corresponding to the previous target network block, and the query information corresponding to the target network block that is not the first one is the hidden state of the query information corresponding to the previous target network block.
6. The method according to claim 5, characterized in that, The additional network within the target network block is used to generate an injection vector based on the input information of the target network block; the target network block is used to obtain the output information of the target network block based on the text information corresponding to the target network block and the injection vector; wherein, the injection vector is a feature vector related to the inference information corresponding to the target text.
7. The method according to any one of claims 1 to 6, characterized in that, The acquisition of the target text includes: Retrieve the text of the question to be answered; If historical dialogue text related to the question text is detected, the historical dialogue text and the question text are used as target text. If no historical dialogue text related to the question text is detected, the question text will be used as the target text.
8. An electronic device, characterized in that, The electronic device includes: A storage device on which computer programs are stored; A processing device for executing the computer program in the storage device to implement the steps of the response generation method according to any one of claims 1-7.
9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program for executing the response generation method according to any one of claims 1-7.
10. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the response generation method according to any one of claims 1-7.