Conversation processing method and device
By managing historical dialogues through user actions and optimizing dialogue content generation using large language models and recommendation models, the problem of contextual understanding difficulty in multi-turn dialogues is solved, thereby improving dialogue quality and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2026-03-10
AI Technical Summary
In multi-turn dialogues, as the number of historical conversations increases, especially when there are many topics, the model's understanding of the context becomes more difficult, affecting the quality of subsequent dialogues.
The system manages historical conversations by receiving user actions through an interactive client, retaining or discarding historical information, and generating responses using a large language model. It also optimizes conversation content generation by combining recommendation and summarization models.
It improves the quality of multi-turn dialogues, reduces reasoning costs, and enhances user experience and the accuracy of dialogue content.
Smart Images

Figure CN121636641A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence, and more specifically, to a method and apparatus for dialogue processing. Background Technology
[0002] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.
[0003] Natural Language Processing (NLP) is an important branch of artificial intelligence. Dialogue systems are one application of NLP. In multi-turn dialogues, historical dialogues can help the model better understand the context of the current dialogue. However, as the number of historical dialogues increases, especially when there are many topics covered, the difficulty for the model to understand the context also increases, thus affecting the quality of subsequent dialogues.
[0004] Therefore, how to improve the quality of multi-round dialogues has become an urgent problem to be solved. Summary of the Invention
[0005] This application provides a method and apparatus for dialogue processing, which helps to improve the quality of multi-turn dialogues and thus enhance the user experience.
[0006] Firstly, a dialogue processing method is provided, applicable to multi-turn dialogue interaction scenarios. The method includes: receiving a first statement to be responded to via an interactive client; generating a first response to the first statement via a large language model; outputting the first response to the first statement via the interactive client; receiving a first operation via the interactive client, wherein the first operation instructs the retention or discarding of a first historical dialogue, the first historical dialogue including the first statement and the first response; receiving a second statement to be responded to via the interactive client; constructing a first prompt word, wherein, if the first operation instructs the retention of the first historical dialogue, the first prompt word is constructed based on the first historical dialogue, or, if the first operation instructs the discard of the first historical dialogue, the first prompt word is unrelated to the first historical dialogue; inputting the first prompt word into a large language model to generate a second response to the second statement; and outputting the second response to the second statement via the interactive client.
[0007] In the embodiments of this application, an interactive method related to the management of historical dialogues is provided. Historical dialogues can be managed according to user needs, which is beneficial for retaining important historical information and removing irrelevant historical information. The retained historical information can be used to generate subsequent dialogue content, thereby improving the quality of subsequent dialogues.
[0008] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: outputting the recommendation result of the first historical dialogue through an interactive client, wherein the recommendation result of the first historical dialogue indicates whether to retain the first historical dialogue or to discard the first historical dialogue, and a first operation is applied to the recommendation result of the first historical dialogue, the first operation being used to indicate whether to accept the recommendation result of the first historical dialogue or to reject the recommendation result of the first historical dialogue.
[0009] According to the solution in this application, a recommendation model can determine the importance of historical conversations to help users manage them without requiring users to decide whether to retain them, thus improving the user experience. Furthermore, displaying the recommendation results on the user interface lets users know which historical conversations will be used to generate subsequent conversation content, allowing them to make adjustments and improving the quality of subsequent conversations.
[0010] In conjunction with the first aspect, in some implementations of the first aspect, the first operation acts on the first historical dialogue.
[0011] The first action can be user input. The user can then use the first action to retain or discard the first conversation.
[0012] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: recording the labeling result of the first historical dialogue, wherein the labeling result of the first historical dialogue indicates whether the first historical dialogue is labeled as retained or discarded, the labeling result of the first historical dialogue is used for training the recommendation model, the recommendation model is used to determine the recommendation result of the historical dialogue, and the recommendation result of the historical dialogue is used to indicate whether to recommend retaining the historical dialogue or to recommend discarding the historical dialogue.
[0013] For example, the recommendation model is a classification model or an LLM.
[0014] In the solution of this application embodiment, by recording user behavior to construct a data flywheel, it is beneficial to improve the intent recognition capability of the recommendation model, continuously improve the accuracy of the recommendation results of the recommendation model, and thus improve the quality of subsequent dialogues.
[0015] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: summarizing at least one round of historical dialogue to obtain a first dialogue summary of at least one round of historical dialogue, wherein the at least one round of historical dialogue includes the first historical dialogue; and outputting the first dialogue summary through an interactive client.
[0016] In the solution of this application embodiment, a dialogue summary function is provided. During the process of multi-turn dialogue, the historical dialogue can be summarized so that users can understand the key information of the historical dialogue, thereby improving the user experience.
[0017] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: receiving a second operation via an interactive client, the second operation being used to trigger a summary of at least one round of historical dialogue.
[0018] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: receiving a third operation through an interactive client, the third operation indicating any of the following: accepting the first dialogue summary, rejecting the first dialogue summary, or the modified result of the first dialogue summary.
[0019] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: receiving a third statement to be replied to via an interactive client; constructing a second prompt word, wherein, if the third operation indicates acceptance of the first dialogue summary, the second prompt word is constructed based on the first dialogue summary, and if the third operation indicates rejection of the first dialogue summary, the second prompt word is unrelated to the first dialogue summary; or, if the third operation indicates a modification result of the first dialogue summary, the second prompt word is constructed based on the modification result of the first dialogue summary; inputting the second prompt word into a large language model to generate a third response to the third statement; and outputting the third response to the third statement via the interactive client.
[0020] In the solution of this application embodiment, historical dialogues can be summarized, and subsequent dialogue content can be generated based on user feedback on the summary, which helps to improve the quality of subsequent dialogues and thus improve user experience.
[0021] In conjunction with the first aspect, in some implementations of the first aspect, the first dialogue summary is generated by the summary model, and the method further includes: recording the marking result of the first dialogue summary, wherein the marking result of the first dialogue summary indicates any of the following: the first dialogue summary is marked as accepted, the first dialogue summary is marked as rejected, or the first dialogue summary is modified, and the marking result of the first dialogue summary is used for adjustment of the summary model.
[0022] In the solution of this application embodiment, a data flywheel is constructed by recording user behavior, which helps to continuously improve the intent recognition capability of the summary model, improve the accuracy of the generated summary, and thus help improve the quality of subsequent dialogues.
[0023] In conjunction with the first aspect, in some implementations of the first aspect, the method also includes: in response to the fourth operation, saving the first dialogue summary.
[0024] In the solution of this application embodiment, a saving function is provided so that users can save the dialogue summary, such as the dialogue summary generated by the summary model or the dialogue summary modified by the user, for later retrieval.
[0025] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: in response to the fifth operation, loading a saved second dialogue summary, which is associated with a summary of at least one round of historical dialogue.
[0026] In the solution of this application embodiment, it is supported to save and load the dialogue summary, so that users can load the required dialogue summary at any time. This is equivalent to synchronizing the past and summarized historical dialogues to any dialogue scenario and using them in any dialogue, thereby improving the quality of the dialogue.
[0027] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: receiving the fourth statement to be replied to through an interactive client; constructing a third prompt word based on the second dialogue summary; inputting the third prompt word into a large language model to generate a fourth response to the fourth statement; and outputting the fourth response to the fourth statement through the interactive client.
[0028] The fourth statement and the fourth response can be the first statement and the first response, or they can not be the first statement and the first response.
[0029] Secondly, a dialogue processing method is provided, which is applied to multi-turn dialogue interaction scenarios. The method includes: receiving a fifth statement to be responded to through an interactive client; generating a fifth response to the fifth statement through a large language model; outputting the fifth response to the fifth statement through the interactive client; summarizing at least one round of historical dialogue to obtain a third dialogue summary of at least one round of historical dialogue, wherein the at least one round of historical dialogue includes a second historical dialogue, and the second historical dialogue includes a fifth statement and a fifth response; and outputting the third dialogue summary through the interactive client.
[0030] In conjunction with the second aspect, in some implementations of the second aspect, the method also includes: receiving a sixth operation through an interactive client, the sixth operation being used to trigger a summary of at least one round of historical dialogue.
[0031] In conjunction with the second aspect, in some implementations of the second aspect, the method further includes: receiving a seventh operation through an interactive client, the seventh operation indicating any of the following: accepting the third dialogue summary, rejecting the third dialogue summary, or the modified result of the third dialogue summary.
[0032] In conjunction with the second aspect, in some implementations of the second aspect, the method further includes: receiving the sixth statement to be responded to via an interactive client; constructing a fourth prompt word, wherein, if the seventh operation indicates acceptance of the third dialogue summary, the fourth prompt word is constructed based on the third dialogue summary, and if the seventh operation indicates rejection of the third dialogue summary, the fourth prompt word is unrelated to the third dialogue summary; or, if the seventh operation indicates a modification result of the third dialogue summary, the fourth prompt word is constructed based on the modification result of the third dialogue summary; inputting the fourth prompt word into a large language model to generate a sixth response to the sixth statement; and outputting the sixth response to the sixth statement via the interactive client.
[0033] In conjunction with the second aspect, in some implementations of the second aspect, the third dialogue summary is generated by the summary model, and the method further includes: recording the labeling result of the third dialogue summary, wherein the labeling result of the third dialogue summary indicates any of the following: the third dialogue summary is labeled as accepted, the third dialogue summary is labeled as rejected, or the third dialogue summary is modified, and the labeling result of the third dialogue summary is used for adjustment of the summary model.
[0034] In conjunction with the second aspect, in some implementations of the second aspect, the method also includes: in response to the eighth operation, saving the eighth dialogue summary.
[0035] In conjunction with the second aspect, in some implementations of the second aspect, the method further includes: in response to the ninth operation, loading a saved fourth dialogue summary, which is associated with a summary of at least one round of historical dialogue.
[0036] Thirdly, a dialogue processing apparatus is provided, applicable to multi-turn dialogue interaction scenarios. The apparatus includes: a first receiving module for receiving a first statement to be responded to via an interactive client; a generating module for generating a first response to the first statement via a large language model; an output module for outputting the first response to the first statement via the interactive client; a second receiving module for receiving a first operation via the interactive client, wherein the first operation is used to instruct whether to retain or discard a first historical dialogue, the first historical dialogue including a first statement and a first response; the first receiving module is also used to receive a second statement to be responded to via the interactive client; the generating module is also used to construct a first prompt word, wherein, when the first operation instructs to retain the first historical dialogue, the first prompt word is constructed based on the first historical dialogue, or, when the first operation instructs to discard the first historical dialogue, the first prompt word is unrelated to the first historical dialogue; the generating module is also used to input the first prompt word into a large language model to generate a second response to the second statement; and the output module is also used to output the second response to the second statement via the interactive client.
[0037] In conjunction with the third aspect, in some implementations of the third aspect, the output module is further configured to: output the recommendation result of the first historical dialogue through the interactive client, wherein the recommendation result of the first historical dialogue indicates whether to retain the first historical dialogue or to discard the first historical dialogue, the first operation is applied to the recommendation result of the first historical dialogue, and the first operation is used to indicate whether to accept the recommendation result of the first historical dialogue or to reject the recommendation result of the first historical dialogue.
[0038] In conjunction with the third aspect, in some implementations of the third aspect, the first operation acts on the first historical dialogue.
[0039] In conjunction with the third aspect, in some implementations of the third aspect, the device further includes a recording module for: recording the labeling result of the first historical dialogue, wherein the labeling result of the first historical dialogue indicates that the first historical dialogue is labeled as retained or discarded, the labeling result of the first historical dialogue is used for training the recommendation model, the recommendation model is used to determine the recommendation result of the historical dialogue, and the recommendation result of the historical dialogue is used to indicate whether to recommend retaining the historical dialogue or to recommend discarding the historical dialogue.
[0040] In conjunction with the third aspect, in some implementations of the third aspect, the apparatus further includes: a summary module for summarizing at least one round of historical dialogue to obtain a first dialogue summary of at least one round of historical dialogue, wherein the at least one round of historical dialogue includes the first historical dialogue; and an output module for outputting the first dialogue summary through an interactive client.
[0041] In conjunction with the third aspect, in some implementations of the third aspect, the second receiving module is also used to: receive a second operation through an interactive client, the second operation being used to trigger a summary of at least one round of historical dialogue.
[0042] In conjunction with the third aspect, in some implementations of the third aspect, the second receiving module is also used to: receive a third operation through an interactive client, the third operation indicating any one of the following: accepting the first dialogue summary, rejecting the first dialogue summary, or the modification result of the first dialogue summary.
[0043] In conjunction with the third aspect, in some implementations of the third aspect, the first receiving module is further configured to: receive a third statement to be replied to via an interactive client; the generating module is further configured to: construct a second prompt word, wherein, if the third operation indicates acceptance of the first dialogue summary, the second prompt word is constructed based on the first dialogue summary, and if the third operation indicates rejection of the first dialogue summary, the second prompt word is unrelated to the first dialogue summary; or, if the third operation indicates modification of the first dialogue summary, the second prompt word is constructed based on the modification of the first dialogue summary; input the second prompt word into a large language model to generate a third response to the third statement; and the output module is further configured to: output the third response to the third statement via the interactive client.
[0044] In conjunction with the third aspect, in some implementations of the third aspect, the first dialogue summary is generated by the summary model, and the recording module is also used to: record the marking result of the first dialogue summary, wherein the marking result of the first dialogue summary indicates any of the following: the first dialogue summary is marked as accepted, the first dialogue summary is marked as rejected, or the modification result of the first dialogue summary, the marking result of the first dialogue summary is used for adjustment of the summary model.
[0045] In conjunction with the third aspect, in some implementations of the third aspect, the apparatus further includes: a storage module for: in response to the fourth operation, storing a summary of the first dialogue.
[0046] In conjunction with the third aspect, in some implementations of the third aspect, the apparatus further includes: a loading module for loading a saved second dialogue summary in response to the fifth operation, the second dialogue summary being associated with a summary of at least one round of historical dialogue.
[0047] Fourthly, a dialogue processing apparatus is provided, which is applied in a multi-turn dialogue interaction scenario. The apparatus includes: a third receiving module for receiving a fifth statement to be responded to through an interactive client; a generation module for generating a fifth response to the fifth statement through a large language model; an output module for outputting the fifth response to the fifth statement through the interactive client; a summarizing module for summarizing at least one round of historical dialogue to obtain a third dialogue summary of at least one round of historical dialogue, wherein the at least one round of historical dialogue includes a second historical dialogue, and the second historical dialogue includes a fifth statement and a fifth response; the output module is also used to output the third dialogue summary through the interactive client.
[0048] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the device further includes: a fourth receiving module for receiving a sixth operation via an interactive client, the sixth operation being used to trigger a summary of at least one round of historical dialogue.
[0049] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the fourth receiving module is also used to receive a seventh operation through an interactive client, the seventh operation indicating any of the following: accepting the third dialogue summary, rejecting the third dialogue summary, or the modification result of the third dialogue summary.
[0050] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the third receiving module is further configured to receive the sixth statement to be replied to via the interactive client; the generating module is further configured to: construct a fourth prompt word, wherein, if the seventh operation indicates acceptance of the third dialogue summary, the fourth prompt word is constructed based on the third dialogue summary, and if the seventh operation indicates rejection of the third dialogue summary, the fourth prompt word is unrelated to the third dialogue summary; or, if the seventh operation indicates a modification result of the third dialogue summary, the fourth prompt word is constructed based on the modification result of the third dialogue summary; input the fourth prompt word into the large language model to generate the sixth response of the sixth statement; and the output module is further configured to output the sixth response of the sixth statement via the interactive client.
[0051] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the third dialogue summary is generated by the summary model, and the apparatus further includes a recording module for recording the marking result of the third dialogue summary, wherein the marking result of the third dialogue summary indicates any of the following: the third dialogue summary is marked as accepted, the third dialogue summary is marked as rejected, or the third dialogue summary is modified, and the marking result of the third dialogue summary is used for adjustment of the summary model.
[0052] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the apparatus further includes a storage module for storing the eighth dialogue summary in response to the eighth operation.
[0053] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the apparatus further includes a loading module for loading a saved fourth dialogue summary in response to the ninth operation, the fourth dialogue summary being associated with a summary of at least one round of historical dialogue.
[0054] It should be understood that the extensions, limitations, interpretations and descriptions of the relevant content in the first aspect above also apply to the same content in the second to fourth aspects.
[0055] Fifthly, a computing device cluster is provided, comprising at least one computing device, each computing device including a processor and memory. The processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, such that the computing device cluster performs the method in any implementation of the first or second aspect.
[0056] In a sixth aspect, a computer-readable medium is provided, including computer program instructions that, when executed by a cluster of computing devices, perform the method in any implementation of the first or second aspect.
[0057] In a seventh aspect, a computer program product containing instructions is provided, which, when executed by a cluster of computing devices, cause the cluster of computing devices to perform the method in any one of the implementations of the first or second aspect described above. Attached Figure Description
[0058] Figure 1 This is a schematic flowchart illustrating a dialogue processing method according to an embodiment of this application.
[0059] Figure 2 This is a schematic diagram of a user interface according to an embodiment of this application.
[0060] Figure 3 This is a schematic flowchart illustrating a training method for a recommendation model according to an embodiment of this application.
[0061] Figure 4 This is a schematic flowchart illustrating another dialogue processing method according to an embodiment of this application.
[0062] Figure 5 This is a schematic diagram of a set of user interfaces according to an embodiment of this application.
[0063] Figure 6 This is a schematic diagram illustrating the processing steps of the training and inference phases of the recommendation model in an embodiment of this application.
[0064] Figure 7 This is a schematic flowchart illustrating another dialogue processing method according to an embodiment of this application.
[0065] Figure 8This is a schematic diagram of another user interface according to an embodiment of this application.
[0066] Figure 9 This is a schematic diagram of an interaction process according to an embodiment of this application.
[0067] Figure 10 This is a schematic diagram illustrating an example of a dialogue processing flow according to an embodiment of this application.
[0068] Figure 11 This is a schematic flowchart illustrating another dialogue processing method according to an embodiment of this application.
[0069] Figure 12 This is a schematic flowchart illustrating another dialogue processing method according to an embodiment of this application.
[0070] Figure 13 This is a schematic block diagram of a dialogue processing apparatus according to an embodiment of this application.
[0071] Figure 14 This is a schematic block diagram of a computing device according to an embodiment of this application.
[0072] Figure 15 This is a schematic block diagram of a computing device cluster according to an embodiment of this application.
[0073] Figure 16 This is a schematic block diagram of another computing device cluster according to an embodiment of this application. Detailed Implementation
[0074] The technical solutions in this application will now be described with reference to the accompanying drawings.
[0075] The terminology used in the following embodiments is for the purpose of describing specific embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” and “the” are intended to include expressions such as “one or more,” unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of this application, “at least one,” “at least one,” and “one or more” refer to one, two, or more than two. “First,” “second,” and various numerical designations are merely distinctions for descriptive convenience and are not intended to limit the scope of the embodiments of this application. “And / or” is used to describe the correspondence between corresponding objects, indicating that three relationships can exist. For example, “A and / or B” can represent: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character “ / ” generally indicates that the preceding and following related objects are in an “or” relationship. The order of the process numbers below does not imply the order of execution. The execution order of each process should be determined by its function and internal logic and should not constitute any limitation on the implementation process of the embodiments of this application. For example, in the embodiments of this application, the words "301", "401", "501" etc. are merely identifiers made for the convenience of description and do not limit the order of execution steps.
[0076] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. In this application, the words "exemplary" or "for example" are used to indicate that something is illustrative, exemplary, or descriptive. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner. The terms "comprising," "including," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized. In the embodiments of this application, descriptions such as "when," "in the case of," "if," and "if" all refer to the fact that the device will perform a corresponding processing under certain objective circumstances, and are not a limitation on time, nor do they require the device to perform a judgment action during implementation, nor do they imply any other limitations.
[0077] In this application, "for indicating" can include both direct and indirect indication. When describing an indication message as indicating A, it can include whether the indication message directly indicates A or indirectly indicates A, but does not necessarily mean that the indication message carries A.
[0078] Dialogue systems typically employ generative large models. Generative large models usually perform generation tasks based on given prompts. The prompts serve as input to the large language model, which can then complete relevant tasks based on the prompts. Prompts can be constructed based on historical dialogues to help the model understand the context of the current dialogue. However, as the number of historical dialogues increases, especially when the topics are numerous, the difficulty for the model to understand the context also increases, thus affecting the quality of subsequent dialogues.
[0079] Furthermore, some solutions employ a transformer architecture based on an attention mechanism, which references all tokens in the prompt during computation. As the amount of historical dialogue increases, the computational cost also rises, making it difficult to meet the needs of practical applications.
[0080] In view of this, embodiments of this application provide a dialogue processing method that can manage historical dialogues, which is beneficial to improving the quality of multi-turn dialogues and reducing the consumption of reasoning.
[0081] Figure 1 An embodiment of this application illustrates a method for dialogue processing. Figure 1 The method 100 shown can be applied to scenarios involving multi-turn dialogue interactions, or in other words, to large-scale model dialogue services involving multiple turns. Method 100 can be executed by a dialogue processing device.
[0082] In one possible implementation, Figure 1 The method shown can be applied to terminal devices. That is, the device for dialogue processing can be a terminal device, or a component of a terminal device. For example, a terminal device can be a mobile phone, personal computer, laptop, tablet computer, or workstation, etc.
[0083] In another possible implementation Figure 1 The method 100 shown can be applied to a cloud management platform. That is, the device for dialogue processing can be a cloud management platform, or a component of a cloud management platform. The cloud management platform is used to manage infrastructure, which includes at least one cloud data center. Each of the at least one cloud data center has multiple servers.
[0084] In method 100, the dialogue processing apparatus can provide a history dialogue management function, allowing the user to manage history dialogues. For example, the user can mark history dialogues to retain or discard them.
[0085] like Figure 1 As shown, method 100 may include the following steps.
[0086] 110, receiving the pending reply to statement #11.
[0087] 120, output the response #11 for statement #11.
[0088] 130, Retrieve feedback data for historical conversation #11. The feedback data for historical conversation #11 indicates whether to retain or discard it. Historical conversation #11 includes statements #11 and responses #11.
[0089] 140. Manage historical dialogue #11 based on feedback data from historical dialogue #11.
[0090] For example, in method 100, a statement to be replied to, such as statement #11, can be received through an interactive client. In method 100, a response to the statement, such as response #11, can be output through the interactive client.
[0091] As previously mentioned, method 100 can be applied to multi-turn dialogue interaction scenarios, where statement #11 and its response #11 (i.e., historical dialogue #11) can be any round of dialogue within the multi-turn dialogue interaction scenario. A complete round of dialogue can include a statement to be responded to and its response. Multi-turn dialogue can be implemented through a language model; in other words, multi-turn dialogue can be understood as an interaction between the user and a language model. That is, the response can be determined based on the output of the language model. For example, the response to the statement to be responded to can be generated by the language model. For instance, this language model can be a large language model (LLM).
[0092] In the embodiments of this application, "statement to be replied to" can also be replaced with other descriptions such as "question" or "request", and "response" can also be replaced with other descriptions such as "reply" or "answer".
[0093] Feedback data from historical dialogues can be determined in a variety of ways.
[0094] As one possible implementation, step 130 may include: receiving operation #11. Operation #11 instructs to retain historical conversation #11 or discard historical conversation #11.
[0095] In this case, step 140 can be replaced by: managing historical dialogue #11 according to operation #11.
[0096] For example, in method 100, an operation, such as operation #11, can be received through an interactive client.
[0097] Action #11 applies to historical dialogue #1. Or, in other words, action #11 is related to historical dialogue #11.
[0098] For example, operation #11 can be a click operation or a long press operation, etc.
[0099] Alternatively, the above scheme can also be understood as follows: step 130 may include: receiving the marking result of historical conversation #11. The marking result of historical conversation #11 indicates whether historical conversation #11 is marked as retained or discarded.
[0100] Historical dialogue #11 is the tagged historical dialogue.
[0101] In this implementation, the feedback data of historical dialogues may include the user's marking results of historical dialogues, or in other words, the feedback data of historical dialogues may be determined based on the user's operations on historical dialogues.
[0102] This implementation provides interactive functionality related to dialogue tagging, allowing users to tag historical dialogues and perform tagging-related operations.
[0103] For example, users can mark historical conversations as "keep" or "discard". Accordingly, the user's marking of historical conversations can include "keep" or "discard".
[0104] For example, operations related to historical dialogues can be operations specific to a single turn of historical dialogue. That is, a user can mark a single turn of historical dialogue.
[0105] Figure 2 This diagram illustrates a set of user interfaces (UI). For example, as shown... Figure 2 As shown, each round of historical dialogue corresponds to a "keep" control 201 and a "discard" control 202. The user's action on the "keep" control 201 or "discard" control 202 is operation #11, such as a click or long press. For ease of description, only the click action is used as an example here. For example, if the user clicks the "keep" control 201 corresponding to the first round of historical dialogue, in response to this action, that round of historical dialogue is marked as "keep". Similarly, if the user clicks the "discard" control 202 corresponding to the second round of historical dialogue, in response to this action, that round of historical dialogue is marked as "discard".
[0106] For example, operations related to historical dialogues can be operations for multi-turn historical dialogues, including historical dialogue #11, which provides users with batch management functionality, allowing users to batch mark multi-turn historical dialogues.
[0107] This application does not limit the specific implementation of operation #11. For ease of description, this application mainly uses the operation for a single round of historical dialogue as an example.
[0108] For each conversation, the user can choose to mark it or not. If the user chooses to mark a conversation, that is, to mark it as "keep" or "discard," then that conversation is marked. As mentioned above, the feedback data for marked conversations can be determined based on their marking results. If the user chooses not to mark a conversation, that is, not to perform a marking operation on a conversation, then that conversation is unmarked.
[0109] Furthermore, in the absence of a historical dialogue being marked, the feedback data from that historical dialogue can indicate that the historical dialogue should be retained.
[0110] Alternatively, in the absence of a tagging operation related to a historical dialogue, feedback data from that historical dialogue can indicate that the historical dialogue should be retained.
[0111] In other words, if a user does not mark a certain historical conversation, the unmarked historical conversations will be retained by default.
[0112] For example, historical dialogue #11 can be an untagged historical dialogue, that is, no operation #11 related to historical dialogue #11 has been received, and feedback data of historical dialogue #11 can indicate that historical dialogue #11 is retained.
[0113] It should be understood that the above is only an example. In other possible implementations, if the user does not mark the historical conversation, it can also be set to discard the historical conversation by default.
[0114] In the embodiments of this application, an interaction method related to the management of historical conversations is provided, which can help users manage historical conversations.
[0115] The following explains the management methods for historical dialogues.
[0116] In one possible implementation, managing the historical conversation #11 in step 140 may include either retaining the historical conversation #11 or discarding the historical conversation #11.
[0117] Retaining a historical dialogue can be understood as allowing it to be used for generating subsequent dialogue content, or enabling the language model to pay attention to that historical dialogue in later interactions. Discarding a historical dialogue can be understood as not using it for generating subsequent dialogue content, meaning the language model ignores it in later interactions, rather than simply deleting it. Generating subsequent dialogue content is equivalent to generating subsequent dialogue tasks.
[0118] You can retain the history dialogue, or replace it with other descriptions such as anchoring the history dialogue or highlighting the history dialogue.
[0119] Discarding history dialogue can also be replaced with other descriptions such as hiding (stash) history dialogue or ignoring history dialogue.
[0120] For example, preserving the history conversation #11 may include: highlighting the history conversation #11 on the user interface.
[0121] For example, discarding history conversation #11 may include: hiding history conversation #11 on the user interface.
[0122] Feedback data from historical conversations can be used to determine the content of subsequent conversations.
[0123] Further, optionally, method 100 may also include steps 150 and 160 (not shown in the figure).
[0124] 150, Receive the pending reply to statement #12.
[0125] 160. Output the response #12 corresponding to statement #12. Response #12 is generated based on the feedback data of the historical dialogue #11.
[0126] Specifically, if the feedback data for historical dialogue #11 indicates that historical dialogue #11 should be retained, then response #12 is generated based on historical dialogue #11. If the feedback data for historical dialogue #11 indicates that historical dialogue #11 should be discarded, then response #12 is unrelated to historical dialogue #11.
[0127] For example, if the feedback data for historical dialogue #11 indicates that historical dialogue #11 should be retained, historical dialogue #11 can be used to construct prompt #11. This prompt #11 can then be input into the language model, which generates response #12. If the feedback data for historical dialogue #11 indicates that historical dialogue #11 should be discarded, it can be determined that historical dialogue #11 is not used to construct prompt #11, meaning prompt #11 is unrelated to historical dialogue #11. This prompt #11 can then be input into the language model, which generates response #12, meaning historical dialogue #11 is unrelated to response #12.
[0128] Response #12 may be generated based on feedback data from one or more historical dialogues, including historical dialogue #11.
[0129] The labels in statement #11, response #11, historical dialogue #11, operation #11, statement #12, and response #12 are for descriptive convenience only and do not constitute a limitation on the scheme of the embodiments of this application. Statement #11 and response #11 (historical dialogue #11) can be any round of dialogue in a multi-turn dialogue scenario, and statement #12 and response #12 can be any round of dialogue that occurs after historical dialogue #11 in the same scenario. The embodiments of this application do not limit this.
[0130] It should be understood that the step numbers in the embodiments of this application are for ease of description only and do not constitute a limitation on the execution order of the steps. For example, step 150 may be executed after step 130, or step 150 may be executed before step 130.
[0131] In the solution of this application embodiment, historical dialogues can be managed according to user needs, which is beneficial to retain important historical information and remove irrelevant historical information, thereby improving the quality of subsequent dialogues.
[0132] In one possible implementation, managing the historical dialogue #11 in step 140 may include recording the marking results of the historical dialogue #11. The marking results of the historical dialogue #11 indicate whether the historical dialogue #11 is marked as retained or discarded.
[0133] The labeled results of historical dialogue #11 can be used to train the recommendation model. The recommendation model is used to determine the recommendation outcome for the historical dialogue. The recommendation outcome of the historical dialogue is used to indicate whether to retain or discard the historical dialogue.
[0134] In other words, recommendation models can be used to determine whether to recommend keeping historical conversations or whether to recommend discarding them.
[0135] Record the tagging results of historical conversations, that is, record the user's behavior in the historical conversation, or record the user's preferences in the historical conversation, or save the tagging results of the historical conversation.
[0136] In method 100, the user's tagging results of historical dialogues, or in other words, the user-tagged historical dialogues, can be persisted in a background database and used to construct training data for the recommendation model. In other words, users can tag historical dialogues. User-tagged historical dialogues include those marked as "keep" and those marked as "discard".
[0137] The following explains the training samples and labels. Training samples and labels can be collectively referred to as training data.
[0138] The number of training data used to train the recommendation model can be one or more.
[0139] A training sample may include one round of historical dialogue or multiple rounds of historical dialogue. This application's embodiments primarily use the example of each training sample including one round of historical dialogue for illustration, and do not constitute a limitation on the scheme of this application's embodiments.
[0140] Reference data may include one or more rounds of dialogue.
[0141] For example, if the reference data in a training sample is a round of dialogue, the historical dialogue in the training sample can be a dialogue that occurred before this round of dialogue.
[0142] For example, if the reference data in a training dataset is a multi-turn dialogue, the multi-turn dialogue may or may not include historical dialogues in the training samples.
[0143] If the reference data is a single-turn dialogue, then that dialogue can be a complete dialogue or it can only include the statements to be responded to in that dialogue, i.e., the questions raised by the user. If the reference data includes multiple-turn dialogues, then those multiple-turn dialogues can be multiple complete dialogues, or some of the dialogues in those multiple-turn dialogues can be complete dialogues, while others can only include the statements to be responded to in that particular dialogue.
[0144] The following example uses a dialogue (i.e., the following 5 rounds of dialogue) to illustrate this.
[0145] Round 1 Dialogue:
[0146] User: "I would like to know the flights from Beijing to Shanghai tomorrow."
[0147] System: "Which time slot of tomorrow would you like to know about? Morning or afternoon?"
[0148] Round 2 Dialogue:
[0149] User: "This afternoon."
[0150] System: "Okay, please wait a moment, I will check the afternoon flights for you. Would you prefer economy class or business class?"
[0151] Round 3 Dialogue:
[0152] User: "Economy class".
[0153] System: "Okay, here are a few economy class options. The first is departing from Beijing at 14:00 and arriving in Shanghai at 16:40; the second is departing from Beijing at 15:30 and arriving in Shanghai at 18:10."
[0154] Round 4 Dialogue:
[0155] User: "What will the weather be like in Nanjing tomorrow?"
[0156] System: "Nanjing's weather forecast for tomorrow is as follows: showers are expected, with temperatures ranging from 24℃ to 29℃."
[0157] Round 5 Dialogue:
[0158] User: "What's the price of the flight?"
[0159] The system states: "Flight prices vary due to various factors, including season, holidays, advance booking time, and airline promotions. Based on the above information, the current price range for a flight from Beijing to Shanghai is estimated to be between 775 and 1500 yuan. For accurate pricing information, we recommend visiting the airline's official website or using a third-party online booking platform."
[0160] Taking a single round of dialogue as the reference data in the training sample as an example, for instance, the historical dialogue in the training sample might be the first round of dialogue in the example above. The reference data in this training sample could be any round of dialogue from the second to the fifth round. Assuming the reference data in the training sample is the second round of dialogue, the label of this training sample is used to indicate whether the first round of dialogue is retained or discarded relative to the second round. The dialogue in the reference data could be a complete dialogue, or it could be a question within the dialogue. For example, the reference data could be the complete second round of dialogue, or it could be a question asked by the user in the second round of dialogue, such as "afternoon."
[0161] Taking multi-turn dialogues as reference data in the training samples as an example, for instance, the historical dialogue in the training samples might be the second round of dialogue in the example above. The reference data in this training sample could be any number of rounds from the first to the fifth round, or any number of rounds from the third to the fifth round. Assuming the reference data in the training samples includes the third to fifth rounds of dialogue, the label of the training sample is used to indicate whether the second round of dialogue is retained or discarded relative to the third to fifth rounds. The multi-turn dialogues in the reference data above can be complete dialogues, or they can include incomplete dialogues. For example, the reference data could include the complete third and fourth rounds of dialogue, as well as the user's question in the fifth round, namely, "the price of the flight."
[0162] The above are merely examples, and the specific construction method of the training samples in this application embodiment is not limited. Furthermore, the training samples may also include other content, such as user characteristics.
[0163] The labels for training samples can be obtained based on the user's labeling of historical dialogues. In other words, the labels for training samples are related to the user's labeling of historical dialogues within that training sample.
[0164] The results of users marking historical conversations can be found in the description of method 100, which will not be repeated here.
[0165] Users who marked their saved historical conversations as positive samples, and users who marked their discarded historical conversations as negative samples.
[0166] The recommendation model will be explained below.
[0167] For example, the recommendation model can be a classification model. The training task of this classification model can be viewed as training a binary classification task.
[0168] For example, the classification model can be a support vector machine (SVM), logistic regression, or a neural network model.
[0169] For example, the recommendation model can be an LLM (Limited Least Metric). In this case, training the recommendation model with training samples and labels can also be understood as fine-tuning the LLM by constructing classification judgment instructions based on the training samples and labels.
[0170] As mentioned earlier, the language model used for dialogue content generation in multi-turn dialogues (i.e., for performing dialogue tasks) can be an LLM. In this case, the LLM used for dialogue content generation in multi-turn dialogues and the LLM used as a recommendation model can be the same model or different models.
[0171] The following example, using multi-turn dialogues as reference data, illustrates the prompt template in the classification judgment instruction.
[0172] For example, the prompt template is as follows:
[0173] question:
[0174] This is a judgment task to determine whether to retain historical dialogues in a multi-turn conversation. You need to judge whether the historical dialogue should be retained for generating subsequent dialogue content based on the quality of the historical dialogue and the relevance of the historical dialogue to the dialogue topic.
[0175] The multi-round dialogue is as follows:
[0176] {{Multi-turn dialogue}}
[0177] The following historical dialogues need to be judged:
[0178] {{Historical Dialogue}}
[0179] answer:
[0180] Based on the quality of the historical dialogue and its relevance to the topic, this historical dialogue should / should not be retained.
[0181] Figure 6 The diagram illustrates the processing steps of the training and inference phases of the recommendation model.
[0182] Users can annotate historical conversations, and the historical conversations that are kept or discarded by users can be used to train the recommendation model. Figure 3 The training process shown can be regarded as Figure 6 The image shows the training state of the recommendation model. A detailed description of the training process can be found in [reference needed]. Figure 3 The relevant description is provided. A trained recommendation model can be used to determine whether historical dialogues are retained or discarded during the interaction between the language model and the user. For a detailed description, please refer to [link / reference needed]. Figure 4 The relevant description. In Figure 4 The dialogue processing shown can retrieve recommendation results from historical dialogues, which are indicated by the recommendation model. For example, as... Figure 6 As shown, when a round of historical dialogue is input into the recommendation model, the model outputs a 72% probability of retaining the dialogue and a 28% probability of discarding it. In this case, the model's output can be considered as an indication to retain the historical dialogue. The process of generating the recommendation result can be viewed as... Figure 6 The inferring state of the recommendation model is shown.
[0183] Figure 4 An embodiment of this application illustrates a method for dialogue processing. Figure 4 The method 400 shown can be applied to multi-turn dialogue interaction scenarios.
[0184] Method 400 can be executed by a dialog processing apparatus. A description of the dialog processing apparatus can be found in method 100, and will not be repeated here.
[0185] like Figure 4 As shown, method 400 may include the following steps.
[0186] 410, Receive the pending reply statement #41.
[0187] 420, Output the response #41 to statement #41.
[0188] 430, Receive the pending reply to statement #42.
[0189] 440. Output response #42 for statement #42 based on the recommendation result of historical dialogue #41. Historical dialogue #41 includes statement #41 and response #41. The recommendation result indicates whether to retain historical dialogue #41 or discard historical dialogue #41.
[0190] If the recommendation indicates that historical dialogue #41 should be retained, the content of response #42 can be generated based on historical dialogue #41. If the recommendation indicates that historical dialogue #41 should be discarded, the content of response #42 is unrelated to historical dialogue #41.
[0191] For example, in method 400, a statement to be replied to, such as statement #41 or statement #42, can be received through an interactive client. In method 400, a response to the statement, such as response #41 or response #42, can be output through the interactive client.
[0192] The labels in statement #41, response #41, statement #42, response #42, and historical dialogue #41 are for descriptive convenience only and do not constitute a limitation on the solutions of the embodiments of this application. Statement #41 and response #41 (historical dialogue #41) can be any round of dialogue in a multi-turn dialogue interaction scenario, and statement #42 and response #42 can be any round of dialogue after historical dialogue #41.
[0193] As an example scenario, statement #42 and response #42 can be from the current round of dialogue, while statement #41 and response #41 can be from any round of dialogue prior to the current round. After receiving the user's input of a statement to be replied to, the system can determine whether to generate a response for the current statement based on recommendations from historical dialogues.
[0194] For example, the recommendation result can be a recommendation result based on a single round of historical dialogue. Alternatively, the recommendation result can also be a recommendation result based on multiple rounds of historical dialogue. That is, the recommendation result can indicate whether to retain multiple rounds of historical dialogue or to discard multiple rounds of historical dialogue. The recommendation result for historical dialogue #41 can be a recommendation result for multiple rounds of historical dialogue including historical dialogue #41.
[0195] For ease of description, the recommendations in this application are described in units of a single round of historical dialogue, and this does not constitute a limitation on the solution of this application.
[0196] The recommendations from historical dialogues can be determined based on the output of the recommendation model. For example, the recommendations from historical dialogues can be generated by the recommendation model.
[0197] Recommendation models can be used to determine whether to recommend keeping historical conversations. If the model determines to keep a historical conversation, the recommendation result indicates that it should be kept; if it determines to discard a historical conversation, the recommendation result indicates that it should be discarded. For example, the output of the recommendation model could be the probability of keeping the historical conversation and / or the probability of discarding it. Figure 6 As shown, the recommendation model outputs a 72% probability of recommending to retain the dialogue and a 28% probability of recommending to discard the dialogue. In this case, the output of the recommendation model can be regarded as an indication to recommend retaining the historical dialogue.
[0198] For example, the input to the recommendation model may include the historical dialogue to be judged, and the output of the recommendation model is the recommendation result of that historical dialogue. The input to the recommendation model may also include reference data. In this case, the output of the recommendation model may indicate whether to retain the historical dialogue relative to the reference data. The reference data may include one or more rounds of dialogue. A description of the reference data can be found in method 300, and will not be repeated here to avoid repetition.
[0199] Taking historical dialogue #41 as an example, the input to the recommendation model could include historical dialogue #41, and the output of the recommendation model could indicate whether to recommend keeping historical dialogue #41. Furthermore, the input to the recommendation model could also include statement #42.
[0200] Taking the five-round dialogue example from the previous text, suppose the current user input statement #42 is the question for the fifth round, namely "Flight price?", and the historical dialogue #41 is any one of the previous four rounds. Taking historical dialogue #41 as the fourth round as an example, the reference data could include the previous four rounds of dialogue, or it could include the previous four rounds of dialogue and the question for the fifth round. The recommendation model can then determine whether each historical dialogue (e.g., each round from the first to the fourth round) should be retained.
[0201] For example, the recommendation model can be through Figure 3 The method shown is used to train 300.
[0202] Furthermore, method 400 may also include step 450.
[0203] 450, Output the recommended results for historical dialogue #41.
[0204] For example, in step 450, the recommendation results of historical conversation #41 can be output through the interactive client.
[0205] It should be understood that the step numbers in the embodiments of this application are for ease of description only and do not constitute a limitation on the execution order of the steps. For example, step 450 may be executed before step 440, or step 450 may be executed after step 440.
[0206] For example, step 450 may include: displaying the recommendation results of historical conversation #41 on the user interface.
[0207] The recommendations from historical dialogues can be presented in various forms.
[0208] For example, the recommendation results can be displayed on the user interface using text labels, such as "Recommend Keep" or "Recommend Discard". Figure 5 As shown in (a), taking the first and fourth rounds of dialogue as examples, the corresponding labels for the first and fourth rounds of dialogue in the figure indicate that it is recommended to keep the first round of dialogue and to discard the fourth round of dialogue.
[0209] For example, the two recommendation results can be displayed on the user interface using different icons. Figure 5 As shown in (b), taking the first and fourth rounds of dialogue as examples, the corresponding labels for the first and fourth rounds of dialogue in the figure indicate that it is recommended to keep the first round of dialogue and to discard the fourth round of dialogue.
[0210] The recommendation results can also be displayed in other ways, and this application embodiment does not limit this, as long as the two recommendation results can be distinguished. For example, the recommended historical conversations can be highlighted.
[0211] In the solution of this application embodiment, a recommendation model can be used to determine the importance of historical conversations, helping users manage them without requiring them to decide whether to retain them, thus improving the user experience. Furthermore, displaying the recommendation results of each historical conversation on the user interface allows users to know which historical conversations will be used to generate subsequent conversation content, facilitating adjustments and improving the quality of subsequent conversations.
[0212] As mentioned earlier, if the recommendation result indicates that historical dialogue #41 should be retained, the content of response #42 can be generated based on historical dialogue #41. The content of response #42 can be generated based on historical dialogue #41, specifically, a single-turn historical dialogue where the dialogue is historical dialogue #41. Alternatively, the content of response #42 can be generated based on historical dialogue #41, or it can be generated based on multiple turns of historical dialogue, including historical dialogue #41.
[0213] For example, the response can be generated by an LLM. If the recommendation result indicates that the historical dialogue #41 should be retained, the historical dialogue #41 can be used to construct prompt #41. Prompt #41, constructed based on the historical dialogue #41, can be input into the LLM, which generates a response #42 for statement #42. If the recommendation result indicates that the historical dialogue #41 should be discarded, the response #42 is unrelated to the historical dialogue #41. For example, prompt #41 can be input into the LLM, which is unrelated to the historical dialogue #41, and the LLM generates a response #42 for statement #42.
[0214] If the recommendation model uses an LLM (Limited Module Model), then the LLM used for recommendation and the LLM used for generating responses can be the same model or different models.
[0215] Furthermore, if the recommendation process of historical dialogues is triggered, step 440 is executed.
[0216] The recommendation process for historical conversations is triggered, meaning the recommendation model is activated.
[0217] In this case, if the recommendation process for the historical dialogue is not triggered, the recommendation result of response #42 is irrelevant to that of historical dialogue #41.
[0218] The recommendation process for historical conversations can be triggered in various ways. The following is an example of how to trigger the recommendation process for historical conversations.
[0219] As one possible implementation, method 400 may include: receiving operation #41, which triggers step 440.
[0220] Alternatively, action #41 can be used to trigger the retrieval of recommended results from historical conversation #41.
[0221] Alternatively, action #41 can be used to trigger the output of the recommended results from the historical dialogue #41.
[0222] In other words, the recommendation process for historical conversations can be triggered by the user.
[0223] For example, in method 400, an operation, such as operation #41, can be received through an interactive client.
[0224] For example, operation #41 can be an operation applied to a recommendation control. This recommendation control can be used to control the enabling or disabling of the recommendation function for historical conversations. For example, operation #41 can be a click operation or a long press operation. Here, only a click operation is used as an example. For example, a recommendation control is provided on the user interface. When the user clicks the recommendation control, operation #41 is applied to the recommendation control to enable or disable the recommendation function for historical conversations, thereby triggering the start or deactivation of the recommendation model.
[0225] For example, operation #41 can be a keyboard operation. For instance, the first operation can be a pre-set shortcut key operation.
[0226] For example, users can press a pre-set shortcut key to turn the recommendation feature of historical conversations on or off.
[0227] As another possible implementation, the recommendation process for historical conversations can be automatically triggered.
[0228] For example, in a multi-turn dialogue interaction scenario, when the current dialogue turn is greater than or equal to a set threshold, a recommendation process for historical dialogues is triggered.
[0229] Furthermore, method 400 may also include step 460 ( Figure 4 (Not shown in the image).
[0230] 460, retrieve feedback data on the recommendation result of historical conversation #41, the feedback data indicating whether to accept or reject the recommendation result.
[0231] Recommendations from past conversations can be displayed on the user interface. In this case, the user can provide feedback on the recommendations; for example, the user can accept or reject the recommendations.
[0232] Feedback data for recommendation results can be determined in a variety of ways.
[0233] As one possible implementation, step 460 may include: receiving operation #42, which indicates whether to accept or reject the recommendation result.
[0234] Operation #42 applies to the recommendation results of historical dialogue #41. In other words, operation #42 is related to the recommendation results of historical dialogue #41.
[0235] For example, operation #42 may include a click operation or a long press operation, etc.
[0236] Alternatively, the above scheme can also be understood as follows: step 460 may include receiving the tagging result of the recommendation result of historical dialogue #41. The tagging result of the recommendation result of historical dialogue #41 indicates whether the recommendation result is marked as accepted or rejected.
[0237] The recommendation result of historical dialogue #41 is the tagged recommendation result.
[0238] In this implementation, the feedback data of the recommendation results of historical dialogues may include the user's marking of the recommendation results, or in other words, the feedback data of the recommendation results of historical dialogues is determined based on the user's operation on the recommendation results.
[0239] Users can tag recommendations from past conversations, essentially performing tagging-related actions. In other words, the feedback data for the recommendations can be determined based on the user's actions towards those recommendations.
[0240] This implementation provides interactive functionality related to tagging recommendation results, allowing users to tag the recommendation results from historical conversations, i.e., perform tagging-related operations.
[0241] For example, users can mark the recommendation results of historical conversations as "accept" or "reject", and correspondingly, the user's labeling results for the recommendation results include "accept" or "reject".
[0242] For example, the recommendation process for each round of historical dialogue displayed on the user interface can be triggered by the user or automatically by the system. If the recommendation process is triggered, the recommendation model can determine whether to retain or discard the recommendation for that round of historical dialogue. For each recommendation result displayed on the user interface, the user can choose to mark it or not. If the user chooses to mark a recommendation result, that is, to mark a recommendation result as "retain" or "discard", then that recommendation result is a marked recommendation result. As mentioned above, the feedback data for marked recommendation results can be determined based on the marking result. If the user chooses not to mark a recommendation result, that is, not to perform a marking operation on a recommendation result, then that recommendation result is an unmarked recommendation result.
[0243] Furthermore, if the recommendation results of a historical dialogue are not tagged, the feedback data of the recommendation results of that historical dialogue can indicate whether the recommendation results of that historical dialogue are accepted.
[0244] Alternatively, in the absence of a tagging operation related to the recommendation result from a historical conversation, the feedback data of the recommendation result can indicate that the recommendation result should be accepted.
[0245] In other words, if a user does not mark the recommended results of a past conversation, the user is assumed to accept the recommended results of that past conversation.
[0246] For example, the recommendation result of historical dialogue #41 can be an unlabeled recommendation result, that is, no operation #42 related to the recommendation result of historical dialogue #41 has been received. The feedback data of the recommendation result of historical dialogue #41 can indicate that the recommendation result of historical dialogue #41 is accepted.
[0247] It should be understood that the above is only an example. In other possible implementations, if the user does not mark the recommended results of the historical conversation, the default setting can be to reject the recommended results of that historical conversation.
[0248] Feedback data on the recommendation results of a historical dialogue can be interpreted as indicating whether to accept or reject the recommendation result. Alternatively, it can be understood as indicating whether to retain or discard the historical dialogue. For example, if a historical dialogue's recommendation result indicates that it should be retained, and the feedback data indicates that it should be accepted, this can be understood as retaining the historical dialogue; if it indicates that it should be rejected, this can be understood as discarding the historical dialogue. Conversely, if a historical dialogue's recommendation result indicates that it should be discarded, and the feedback data indicates that it should be accepted, this can be understood as discarding the historical dialogue; if it indicates that it should be rejected, this can be understood as retaining the historical dialogue.
[0249] Furthermore, if method 400 includes step 460, step 440 may include: if the feedback data indicates acceptance of the recommendation result of historical dialogue #41, outputting the response #42 of statement #42 based on the recommendation result of historical dialogue #41.
[0250] If the feedback data indicates that the recommendation result of historical dialogue #41 is not accepted, and the recommendation result indicates that historical dialogue #41 should be retained, the content of response #42 is unrelated to historical dialogue #41. If the recommendation result indicates that historical dialogue #41 should be discarded, the content of response #42 can be generated based on historical dialogue #41.
[0251] In other words, for a given historical conversation, if the user agrees with the recommendations from that conversation, a response for the subsequent conversation can be generated based on those recommendations. If the user does not agree with the recommendations from that conversation, it can be determined whether to use that historical conversation to generate a response for the subsequent conversation based on the user's intent.
[0252] Furthermore, method 400 may also include: recording the labeled results of the recommendation results of historical dialogue #41.
[0253] The labeled results of the recommendation results in historical dialogue #41 can be used to train the recommendation model, or in other words, to adjust the recommendation model.
[0254] The tagging result of the recommendation result is recorded, which means recording the user's behavior on the recommendation result, or recording the user's preference on the historical dialogue, or saving the tagging result of the recommendation result.
[0255] In method 400, the user's labeled recommendations from historical dialogues, or in other words, the user-labeled recommendations, can be used to construct training data for the recommendation model. In other words, users can label the recommendations from historical dialogues, thus effectively tagging them. For example, the user's labeled historical dialogues can be added to... Figure 5 The training data shown in the training phase is used for the recommendation model to continue training and iteration.
[0256] For a detailed description of the training process of the recommendation model, please refer to the description in Method 300, which will not be repeated here.
[0257] In the solution of this application embodiment, by recording user behavior to construct a data flywheel, it is beneficial to improve the intent recognition capability of the recommendation model, continuously improve the accuracy of the recommendation results of the recommendation model, and thus improve the quality of subsequent dialogues.
[0258] Alternatively, in other implementations, the tagging results of the recommendation results of historical dialogue #41 can be replaced with feedback data of the recommendation results of historical dialogue #41.
[0259] Furthermore, methods 100 and 400 can be used in combination. For example, if the recommendation model in method 400 is not triggered, method 100 can be executed, allowing the user to determine whether to retain the historical dialogue. If the recommendation model in method 400 is triggered, the recommendation model can determine whether to retain the historical dialogue, i.e., provide the recommendation results for the historical dialogue.
[0260] Figure 7 An embodiment of this application illustrates a method for dialogue processing. Figure 7 The method 600 shown can be applied to multi-turn dialogue interaction scenarios. Method 600 can be executed by a dialogue processing device. A description of the dialogue processing device can be found in method 100, and will not be repeated here.
[0261] like Figure 7 As shown, method 600 includes the following steps.
[0262] 610, Receive the pending reply to statement #61.
[0263] 620, output the response #61 to statement #61.
[0264] 630. Summarize at least one round of historical dialogue to obtain a dialogue summary #1 of that at least one round of historical dialogue. The at least one round of historical dialogue includes historical dialogue #61. Historical dialogue #61 may include statements #61 and responses #61.
[0265] 640, Output dialogue summary #1.
[0266] For example, in method 600, a statement to be responded to, such as statement #61, can be received through an interactive client. In method 600, a response to the statement, such as response #61, can be output through the interactive client. In method 600, a dialogue summary, such as dialogue summary #1, can be output through the interactive client.
[0267] For example, step 640 may include: displaying a summary of the dialogue of the at least one round of historical dialogue #1 on the user interface.
[0268] In the solutions of this application embodiment, a dialogue summary function can be provided. During multi-turn dialogues, historical dialogues can be summarized so that users can understand the key information of historical dialogues, thereby improving the user experience.
[0269] If the summary process of historical dialogue is triggered, proceed with steps 630 and 640.
[0270] The historical dialogue summary process is triggered, i.e., the summary model is activated. The summary model is used to summarize at least one round of historical dialogue. Dialogue summary #1 can be output by the summary model.
[0271] The process of summarizing historical dialogues can be triggered in various ways. The following is an example of how to trigger the process of summarizing historical dialogues.
[0272] As one possible implementation, step 610 may include step 650.
[0273] 650, receive operation #61, operation #61 is used to trigger step 630, that is, to trigger the summary of at least one round of historical dialogue to obtain dialogue summary #1.
[0274] For example, in method 600, an operation, such as operation #61, can be received through an interactive client.
[0275] In other words, the process of summarizing historical conversations can be triggered by the user. The implementation provides an interactive method related to summarizing, which helps users summarize historical conversations.
[0276] For example, operation #61 can be an operation applied to a summary control. This summary control can be used to control the enabling or disabling of the summary function for historical conversations. For example, operation #61 can include a click operation or a long press operation. Here, only a click operation is used as an example. For example, a summary control is provided on the user interface. When the user clicks the summary control, operation #61 is applied to the summary control to enable or disable the summary function for historical conversations.
[0277] In another possible implementation, the process of summarizing historical conversations can be automatically triggered.
[0278] For example, in a multi-turn dialogue interaction scenario, when the current dialogue turn is greater than or equal to a set threshold, a summary process of historical dialogues is triggered.
[0279] The scope of the summarized dialogue, i.e., the at least one round of historical dialogue, can be set in a variety of ways.
[0280] As an example, the at least one round of historical dialogue can be determined by the user. The user can select the dialogue to be summarized from the historical dialogues displayed in the user interface, and the dialogue selected by the user constitutes the at least one round of historical dialogue.
[0281] For example, method 600 can also be used in conjunction with method 100. For instance, the at least one round of historical dialogue can be determined based on user marking of historical dialogues. The at least one round of historical dialogue includes historical dialogues marked as "reserved" by the user. Alternatively, the at least one round of historical dialogue can be determined based on feedback data from historical dialogues. The at least one round of historical dialogue includes historical dialogues whose feedback data indicates they are reserved.
[0282] For example, method 600 can also be used in conjunction with method 400. For instance, the at least one round of historical dialogue can be determined based on the user's tagging results of the recommendations from the historical dialogue. Alternatively, the at least one round of historical dialogue can be determined based on feedback data from the recommendations from the historical dialogue.
[0283] As another example, the at least one round of historical dialogue can be pre-set.
[0284] For example, the at least one round of historical dialogue can be k rounds of historical dialogue in the user interface. k is a positive integer. k can be preset.
[0285] For example, the n rounds of historical dialogue can be the last k rounds of historical dialogue that occurred in the user interface. Taking the 5 rounds of historical dialogue mentioned earlier as an example, assuming k is 3, then the at least one round of historical dialogue can be the 3rd to the 5th rounds of dialogue. Alternatively, the at least one round of historical dialogue can be k rounds of historical dialogue randomly determined from the user interface. Furthermore, the k rounds of historical dialogue can be all the historical dialogues in the user interface, where the value of k is the total number of rounds in the total historical dialogues.
[0286] For example, the summary model can be an LLM, or it can be another model. As mentioned earlier, the language model used for multi-turn dialogue content generation can also be an LLM. In this case, the LLM used for multi-turn dialogue content generation and the LLM used as the summary model can be the same model or different models.
[0287] The following example uses LLM (Local Management Model) as a case study to illustrate this point.
[0288] Here is an example of an LLM prompt template:
[0289] Please help me summarize the user's historical conversations so that I can better communicate with the user in the future.
[0290] The historical dialogue is as follows:
[0291] {{One or more rounds of dialogue}}
[0292] You need to summarize from the following five dimensions:
[0293] 1. User Group. You need to make a preliminary judgment about the user's group, for example, the user is a Python developer.
[0294] 2. Subject of the conversation. You need to summarize the current topic of the conversation, such as "PyTorch deep learning development".
[0295] 3. Expected Style. You need to determine the style that users expect, such as "accurate and detailed".
[0296] 4. Core QA. You need to summarize the core questions you are currently addressing when communicating with users.
[0297] 5. Dialogue Development Prediction. You need to predict the follow-up questions that users might ask.
[0298] Replace {{one or more rounds of dialogue}} in the template with at least one round of historical dialogue that needs to be summarized to obtain a prompt. Input the prompt into LLM to obtain a dialogue summary of the at least one round of historical dialogue.
[0299] By using the templated answers above, we can summarize the key points of the historical dialogue.
[0300] It should be understood that the above are merely examples, and other forms of templates can also be used to construct the prompt. This application does not limit this approach.
[0301] Furthermore, method 600 may also include steps 660 and 670 (not shown in the figure).
[0302] 660, receive the input statement #62 awaiting reply.
[0303] 670, Output the response to statement #62 that is pending reply #62.
[0304] Optionally, the content of response #62 may be generated based on the dialogue summary #1 of the at least one round of historical dialogue.
[0305] After obtaining a summary of the historical dialogues, the content of the response can be generated based on this summary. In other words, in method 600, the summary of the historical dialogues can be used to generate subsequent dialogue content.
[0306] As an example scenario, the statement to be replied to, #62, and its response, #62, can be the dialogue of the current round. After obtaining a summary of the historical dialogues, a response to the user's current input can be generated based on this summary.
[0307] The response to the statement to be replied to can be generated by a language model. For example, the response can be generated by an LLM. For instance, a dialogue summary #1 can be used to construct prompt #61. Prompt #61, constructed based on dialogue summary #1, can be input into an LLM, which generates a response #62 to statement #62.
[0308] In the solution of this application embodiment, historical dialogues can be summarized, and subsequent dialogue content can be generated based on the summary, which is beneficial to improving the quality of subsequent dialogues.
[0309] Further, optionally, method 600 may also include step 680 (not shown in the figure).
[0310] 680, retrieve feedback data for dialogue summary #1.
[0311] Optionally, the feedback data for Dialogue Summary #1 can indicate either: accepting Dialogue Summary #1, rejecting Dialogue Summary #1, or the modification result of Dialogue Summary #1.
[0312] Users can provide feedback on the conversation summary. For example, users can accept the conversation summary, reject the conversation summary, or modify the conversation summary.
[0313] Feedback data from the dialogue summary can be determined in a variety of ways.
[0314] As one possible implementation, step 680 may include: receiving operation #62, which indicates accepting dialogue summary #1, rejecting dialogue summary #1, or the modification result of dialogue summary #1.
[0315] Operation #62 applies to Dialogue Summary #1. Or, in other words, operation #62 is related to Dialogue Summary #1.
[0316] In this implementation, the feedback data of the dialogue summary may include the user's operation results on the dialogue summary, or in other words, the feedback data of the dialogue summary is determined based on the user's operation on the dialogue summary.
[0317] This implementation provides interactive functionality related to the tagging of conversation summaries, allowing users to tag conversation summaries.
[0318] For example, users can mark the conversation summary as "accept" or "reject", or users can modify the conversation summary.
[0319] User acceptance of the dialogue summary can be expressed in various forms.
[0320] As an example, a conversation summary acceptance control is displayed on the user interface, and action #62 can be applied to the conversation summary acceptance control. In this case, the feedback data from conversation summary #1 can indicate acceptance of conversation summary #1.
[0321] For example, actions performed on the dialog summary acceptance control can include clicks or long presses. This explanation will focus on clicks only. Figure 8 A schematic diagram of a user interface is shown. (For example...) Figure 8 As shown, users can click the conversation summary acceptance control 701 to indicate acceptance of conversation summary #1.
[0322] Furthermore, in the absence of any action related to the dialogue summary, the feedback data of the dialogue summary can indicate acceptance of the dialogue summary.
[0323] In other words, if the user does not perform any action on a conversation summary, it can be assumed that the user accepts the conversation summary.
[0324] For example, dialogue summary #1 can be an untagged dialogue summary, i.e. no operation #62 related to dialogue summary #1 has been received, and the feedback data of dialogue summary #1 can indicate acceptance of dialogue summary #1.
[0325] As another example, method 600 may also include step 690 (not shown in the figure).
[0326] 690, in response to action #63, save conversation summary #1.
[0327] For example, a save control can be displayed on the user interface, and operation #63 can be applied to the save control. For instance, operation #63 may include a click operation or a long press operation. This application embodiment does not limit the specific implementation of operation #63.
[0328] If a user saves a conversation summary (such as conversation summary #1), it can also be considered that the user has accepted the conversation summary. In this case, operation #63 can also be seen as an implementation of operation #62.
[0329] A user's refusal to engage in a conversation can be summarized in several ways.
[0330] For example, a dialog summary rejection control is displayed on the user interface, and operation #62 can be applied to the dialog summary rejection control. In this case, the feedback data of dialog summary #1 indicates rejection of dialog summary #1.
[0331] For example, actions applied to the dialog summary rejection control can include clicking or long-pressing. This example will only illustrate the clicking action. Figure 8 As shown, users can click the conversation summary rejection control 702 to indicate that they are rejecting conversation summary #1.
[0332] Furthermore, if no action related to the dialogue summary is received, the feedback data of the dialogue summary can indicate that the dialogue summary should be rejected.
[0333] If a user does not perform any action on a conversation summary (such as conversation summary #1), the user can be assumed to have rejected the conversation summary.
[0334] Furthermore, if method 600 includes step 680, the generation of subsequent dialogue content can also be related to the feedback data of the dialogue summary. Specifically, the content of the subsequent dialogue can be generated based on the dialogue summary received by the user.
[0335] Optionally, if the feedback data of dialogue summary #1 indicates acceptance of dialogue summary #1, the content of response #62 may be generated based on the dialogue summary #1 of the at least one round of historical dialogue.
[0336] The feedback data from the dialogue summary indicates acceptance of the dialogue summary, meaning the user approves of the summary or determines that the summary can be used to generate subsequent dialogue content.
[0337] Alternatively, if the feedback data of dialogue summary #1 indicates the modification result of dialogue summary #1, the content of response #62 may be generated based on the modification result of dialogue summary #1.
[0338] After the user modifies the dialogue summary, the content of subsequent dialogues can be generated based on the modified dialogue summary.
[0339] Alternatively, if the feedback data of Dialogue Summary #1 indicates a rejection of Dialogue Summary #1, the content of Response #62 is unrelated to Dialogue Summary #1.
[0340] The feedback data from the dialogue summary indicates rejection of the summary, meaning the user does not approve of it, or the user has decided not to use the summary to generate subsequent dialogue content.
[0341] If the user refuses to provide a conversation summary, the summary will not be used to generate subsequent conversation content, meaning it will not affect the subsequent conversation content.
[0342] For example, the response can be generated by the LLM. Once the generated dialogue summary is accepted or modified, it can be used to construct a prompt, which is then input into the LLM to enhance the accuracy of subsequent dialogue content. A rejected dialogue summary is not used to construct the LLM's prompt; that is, the prompt is unrelated to the rejected dialogue summary. For instance, the prompt can be generated based on historical dialogues, so the rejected dialogue summary will not affect the content of subsequent dialogues. Taking dialogue summary #1 as an example, if dialogue summary #1 is accepted, prompt #61 can be constructed based on dialogue summary #1 and input into the LLM to generate response #62 for statement #62. If dialogue summary #1 is modified, prompt #61 can be constructed based on the modification result of dialogue summary #1 and input into the LLM to generate response #62 for statement #62. If the dialogue summary #1 is rejected, it can be determined that the dialogue summary #1 is not used to construct prompt #61, that is, the dialogue summary #1 is unrelated to prompt #61. Prompt #61 is then input into the LLM to generate the response #62 for statement #62.
[0343] In addition, as mentioned earlier, users can modify the conversation summary, and in this case, users can also save the modified conversation summary #1.
[0344] Alternatively, step 690 can be replaced with: In response to operation #63, save the modified dialogue summary #1.
[0345] In the solution of this application embodiment, a saving function is provided so that users can save the generated dialogue summary (such as dialogue summary #1) or the user-modified dialogue summary (such as modified dialogue summary #1) for later use.
[0346] Optionally, method 600 may include step 691 (not shown in the figure).
[0347] 691, in response to action #64, load the saved dialogue summary #2. Dialogue summary #2 is related to a summary of at least one round of historical dialogue.
[0348] For example, Dialogue Summary #2 can be a summary of at least one round of historical dialogue by the summary model, or Dialogue Summary #2 can be a summary obtained by modifying the output of the summary model.
[0349] For example, a loading control can be displayed on the user interface. Action #64 can be applied to the loading control. In response to action #64 applied to the loading control, a saved dialog summary is loaded.
[0350] For example, a user can load a previously saved conversation summary when creating a new conversation scene. Alternatively, a user can load a previously saved conversation summary during the conversation.
[0351] Further, optionally, method 600 may include steps 692 and 693 (not shown in the figure).
[0352] 692, Receive the input statement #63 awaiting reply.
[0353] 693, outputs the response #63 to statement #63. The content of response #63 is generated based on the dialogue summary #2.
[0354] For example, prompt #62 is constructed based on the dialogue summary #2, and this prompt #62 is input into the LLM to generate response #63 for statement #63.
[0355] Statement #63 and statement #61 can be the same statement or different statements.
[0356] Response #61 and Response #63 can be the same response or different responses.
[0357] Steps 610 to 640 and steps 691 to 693 can be steps executed in the same dialogue scenario or steps executed in different dialogue scenarios.
[0358] For example, a user can create a dialogue scenario for multiple rounds of conversation. During the conversation, the device's summary function can be used to summarize the historical conversations and save the summary. After the conversation ends, the dialogue scenario can be closed. Later, if the user needs to conduct multiple rounds of conversation on a similar topic, they can create another dialogue scenario and load the previously saved summary of the relevant topic. This is equivalent to synchronizing past, summarized historical conversations into the current dialogue scenario. In this way, the model can generate subsequent conversation content based on the summary, without requiring the user to restart the conversation with the model, thus improving the quality of the dialogue.
[0359] In the solution of this application embodiment, it is supported to save and load the dialogue summary, so that users can load the required dialogue summary at any time. This is equivalent to synchronizing the past and summarized historical dialogues to any dialogue scenario and using them in any dialogue, thereby improving the quality of the dialogue.
[0360] The labels #61, #61, #62, #62, #63, #63, #1, and #2 are for ease of description only and do not constitute a limitation on the solutions of the embodiments of this application.
[0361] Optionally, method 600 may further include: recording the labeling result of dialogue summary #1. The labeling result of dialogue summary #1 indicates any of the following: dialogue summary #1 is labeled as accepted, dialogue summary #1 is labeled as rejected, or, the modification result of dialogue summary #1, the labeling result of dialogue summary #1 is used to summarize the training of the model, or in other words, it can be used to summarize the adjustment of the model.
[0362] The summary model can be used to summarize one or more rounds of historical dialogue.
[0363] Record the tagging results of the dialogue summary, that is, record the user's behavior on the dialogue summary, or record the user's preference for the dialogue summary, or save the tagging results of the dialogue summary.
[0364] In method 600, the user's labeled dialogue summaries, or in other words, the user-labeled dialogue summaries, can be used to construct training data for the summary model in order to train the summary model.
[0365] Summary of conversations accepted by users can be used to construct positive samples. Summary of conversations rejected by users can be used to construct negative samples.
[0366] A dialogue summary accepted by the user can include the dialogue summary output by the summary model and / or the dialogue summary modified by the user. A dialogue summary rejected by the user can include the dialogue summary output by the summary model rejected by the user and / or the dialogue summary before modification by the user.
[0367] The following example, using Dialogue Summary #1, illustrates how the training data is constructed.
[0368] For example, if the tagging result of dialogue summary #1 indicates acceptance of dialogue summary #1, the at least one round of historical dialogue and dialogue summary #1 can be used as positive samples. If the tagging result of dialogue summary #1 indicates a modified result of dialogue summary #1, the at least one round of historical dialogue and the modified dialogue summary #1 can be used as positive samples. If the tagging data of dialogue summary #1 indicates a modified result of dialogue summary #1, the at least one round of target dialogue and the original dialogue summary #1 can be used as negative samples. If the tagging result of dialogue summary #1 indicates rejection of dialogue summary #1, the at least one round of historical dialogue and dialogue summary #1 can be used as negative samples.
[0369] Feedback data from other dialogue summaries can also be used to construct training data in a similar way.
[0370] As mentioned earlier, this summary model can be an LLM (Language Modeling Model). In this case, training the language model using training data can also be understood as fine-tuning the LLM based on the training data. Alternatively, it can be described as fine-tuning based on user preferences, i.e., achieving preference alignment.
[0371] Fine-tuning can be achieved through various algorithms. For example, reinforcement learning from human feedback (RLHF) and direct preference optimization (DPO) algorithms can be used to fine-tune LLM.
[0372] In the solution of this application embodiment, a data flywheel is constructed by recording user behavior, which helps to continuously improve the intent recognition capability of the summary model, improve the accuracy of the generated summary, and thus help improve the quality of subsequent dialogues.
[0373] Alternatively, in other implementations, the marked results of recording dialogue summary #1 can be replaced with the feedback data of recording dialogue summary #1.
[0374] Figure 9 A schematic flowchart illustrating an interactive process is shown. (For example...) Figure 9As shown, users can interact with the LLM by inputting a statement to be responded to, which the LLM then generates. After obtaining one or more rounds of historical dialogue, the LLM can summarize the dialogue history, for example, summarizing at least one round of historical dialogue. The LLM outputs the generated chat summary. Users can modify the generated chat summary to obtain a modified chat summary. The modified chat summary can be used for user preference alignment, that is, to fine-tune the LLM based on user preferences.
[0375] It should be understood that Figure 9 The solutions shown are merely examples and do not constitute a limitation on the solutions implemented in this application. For example, in Figure 9 In this implementation, the LLM used to generate the response and the LLM used to generate the dialogue summary are the same model. However, in other possible implementations, the LLM used to generate the response and the LLM used to generate the dialogue summary can be different models. For example, Figure 9 This example only illustrates the form of user feedback for modifying the generated dialogue summary. In other possible implementations, users can also provide other forms of feedback on the generated dialogue summary. For detailed descriptions, please refer to the solutions described above; to avoid repetition, they will not be repeated here.
[0376] Furthermore, methods 600 and 100 can be used in combination. Methods 600 and 400 can also be used in combination. Figure 10 A schematic diagram of one possible combination method is shown.
[0377] like Figure 10 As shown, the user interface displays n rounds of dialogue. The recommendation model determines whether to retain each round of dialogue within these n rounds, resulting in k retained rounds. k is a positive integer less than or equal to n. These k rounds of dialogue are then summarized to obtain a dialogue summary. Users can mark the dialogue summary, for example, accepting, rejecting, or modifying it. This summary can be used to construct a prompt for generating subsequent dialogue content. Alternatively, the summary can be saved, for example, in a dialogue history database, so that it can be loaded in real-time and used in any subsequent dialogue.
[0378] It should be understood that Figure 10 The methods shown are merely examples and do not constitute a limitation on the solutions implemented in this application. For example, the aforementioned k-round dialogues can also be selected by the user, who can mark the n-round dialogues, i.e., mark them "keep" or "discard," to obtain the k-round dialogues that are kept. Furthermore, the summarized dialogue scope can also be a portion of the dialogues within those k-round dialogues.
[0379] Figure 11 This is a schematic flowchart of a dialogue processing method provided in an embodiment of this application. Figure 11 The method 1100 shown can be applied to multi-turn dialogue interaction scenarios. Method 1100 can be implemented using the methods 100, 400, and / or 600 mentioned above.
[0380] Figure 11 For related descriptions, please refer to Method 100, Method 400 and / or Method 600 mentioned above. To avoid repetition, some descriptions of Method 1100 have been omitted.
[0381] like Figure 11 As shown, method 1100 may include the following steps.
[0382] 1110, Receive the first statement to be replied to through the interactive client.
[0383] 1120, Generate the first response of the first statement through the large language model.
[0384] At 11:30, the first response is output through the interactive client.
[0385] 1140, Receive a first operation through the interactive client, wherein the first operation is used to indicate whether to retain the first historical dialogue or discard the first historical dialogue, the first historical dialogue including the first statement and the first response.
[0386] 1150, Receive the second statement to be replied to through the interactive client.
[0387] 1160, Construct a first prompt word. Wherein, if the first operation instruction retains the first historical dialogue, the first prompt word is constructed based on the first historical dialogue; or, if the first operation instruction discards the first historical dialogue, the first prompt word is unrelated to the first historical dialogue.
[0388] 1170. Input the first prompt word into the large language model to generate the second response for the second statement.
[0389] 1180, output the second response through the interactive client.
[0390] In the embodiments of this application, an interactive method related to the management of historical dialogues is provided. This method can manage historical dialogues according to user needs, which is beneficial for retaining important historical information and removing irrelevant historical information, thereby improving the quality of subsequent dialogues.
[0391] For example, the first statement, the first response, the first history dialogue, the first operation, the second statement, the second response, and the first prompt word can be statement #11, response #11, history dialogue #11, operation #11, statement #12, response #12, and prompt #11 in method 100.
[0392] Alternatively, the first statement, first response, first history dialogue, first operation, second statement, second response, and first prompt word can be statement #41, response #41, history dialogue #41, operation #42, statement #42, response #42, and prompt #41 in method 400.
[0393] Optionally, method 1100 further includes: outputting the recommendation result of the first historical dialogue through an interactive client, wherein the recommendation result of the first historical dialogue indicates whether to retain the first historical dialogue or to discard the first historical dialogue, a first operation is applied to the recommendation result of the first historical dialogue, and the first operation is used to indicate whether to accept the recommendation result of the first historical dialogue or to reject the recommendation result of the first historical dialogue.
[0394] For example, this step can be implemented by step 450 in method 400.
[0395] Optionally, the first operation applies to the first historical dialogue.
[0396] For example, the first operation can be operation #11 in method 100.
[0397] Optionally, method 1100 may further include: recording the labeling result of the first historical dialogue, wherein the labeling result of the first historical dialogue indicates whether the first historical dialogue is labeled as retained or discarded, the labeling result of the first historical dialogue is used for training the recommendation model, the recommendation model is used to determine the recommendation result of the historical dialogue, and the recommendation result of the historical dialogue is used to indicate whether to recommend retaining the historical dialogue or to recommend discarding the historical dialogue.
[0398] Optionally, method 1100 further includes: summarizing at least one round of historical dialogue to obtain a first dialogue summary of at least one round of historical dialogue, wherein the at least one round of historical dialogue includes the first historical dialogue; and outputting the first dialogue summary through an interactive client.
[0399] For example, this step can be implemented by steps 630 and 640 in method 600. Accordingly, the first dialogue summary, the first historical dialogue, the first statement, and the first response can be the dialogue summary #1, the historical dialogue #61, the statement #61, and the response #61 in method 600.
[0400] Optionally, method 1100 further includes: receiving a second operation via an interactive client, the second operation being used to trigger a summary of at least one round of historical dialogue.
[0401] For example, this step can be implemented by step 650 in method 600. Accordingly, the second operation can be operation #61 in method 600.
[0402] Optionally, method 1100 further includes: receiving a third operation via an interactive client, the third operation indicating any of the following: accepting the first dialogue summary, rejecting the first dialogue summary, or a modified result of the first dialogue summary.
[0403] For example, this step can be implemented by step 680 in method 600. Accordingly, the third operation can be operation #62.
[0404] Optionally, method 1100 further includes: receiving a third statement to be replied to via an interactive client; constructing a second prompt word, wherein, if the third operation indicates acceptance of the first dialogue summary, the second prompt word is constructed based on the first dialogue summary, and if the third operation indicates rejection of the first dialogue summary, the second prompt word is unrelated to the first dialogue summary; or, if the third operation indicates a modification result of the first dialogue summary, the second prompt word is constructed based on the modification result of the first dialogue summary; inputting the second prompt word into a large language model to generate a third response to the third statement; and outputting the third response via the interactive client.
[0405] For example, the above steps can be implemented by steps 660 and 670 in method 600. Accordingly, the third statement and the third response can be statement #62 and response #62 in method 600. The second prompt word can be prompt #61 in method 600.
[0406] Optionally, the first dialogue summary is generated by the summary model, and method 1100 further includes: recording the labeling result of the first dialogue summary, wherein the labeling result of the first dialogue summary indicates any of the following: the first dialogue summary is labeled as accepted, the first dialogue summary is labeled as rejected, or the first dialogue summary is modified, and the labeling result of the first dialogue summary is used for adjustment of the summary model.
[0407] Optionally, method 1100 further includes: in response to the fourth operation, saving the first dialogue summary.
[0408] For example, this step can be implemented by step 690 in method 600. Accordingly, the fourth operation can be operation #63 in method 600.
[0409] Optionally, method 1100 further includes: in response to the fifth operation, loading a saved second dialogue summary, the second dialogue summary being associated with a summary of at least one round of historical dialogue.
[0410] For example, this step can be implemented by step 691 in method 600. Accordingly, the fifth operation and the second dialogue summary can be operation #64 and dialogue summary #2 in method 600.
[0411] Optionally, method 1100 further includes: receiving a fourth statement to be responded to via an interactive client; constructing a third prompt word based on the second dialogue summary; inputting the third prompt word into a large language model to generate a fourth response to the fourth statement; and outputting the fourth response to the fourth statement via the interactive client.
[0412] For example, this step can be implemented by steps 692 and 693 in method 600. Accordingly, the fourth statement and the fourth response can be statement #63 and response #63 in method 600. The third prompt word can be prompt #62 in method 600.
[0413] Figure 12 An embodiment of this application illustrates a method for dialogue processing. Figure 12 The method 1200 shown can be applied to multi-turn dialogue interaction scenarios. For example, method 1200 can be implemented by method 600. Figure 12 For a related description, please refer to Method 600 above. To avoid repetition, some descriptions of Method 1200 have been omitted.
[0414] like Figure 12 As shown, method 1200 may include the following steps.
[0415] 1210, Receive the fifth statement awaiting reply through the interactive client.
[0416] 1220, Generate the fifth response of the fifth statement through a large language model.
[0417] At 1230, the fifth response was output through the interactive client.
[0418] 1240. Summarize at least one round of historical dialogue to obtain a third dialogue summary of at least one round of historical dialogue, where the at least one round of historical dialogue includes the second historical dialogue, and the second historical dialogue includes the fifth statement and the fifth response.
[0419] 1250, Output the third dialogue summary through the interactive client.
[0420] The fifth statement. The fifth response, the third dialogue summary, and the second historical dialogue can be statement #61, response #61, dialogue summary #1, and historical dialogue #61 in method 600.
[0421] Optionally, method 1200 further includes: receiving a sixth action via an interactive client, the sixth action being used to trigger a summary of at least one round of historical dialogue.
[0422] For example, the sixth operation can be operation #61 in method 600.
[0423] Optionally, method 1200 further includes: receiving a seventh operation via an interactive client, the seventh operation indicating any of the following: accepting the third dialogue summary, rejecting the third dialogue summary, or a modified result of the third dialogue summary.
[0424] For example, the seventh operation can be operation #62 in method 600.
[0425] Optionally, method 1200 further includes: receiving a sixth statement to be responded to via an interactive client; constructing a fourth prompt word, wherein, if the seventh operation indicates acceptance of the third dialogue summary, the fourth prompt word is constructed based on the third dialogue summary, and if the seventh operation indicates rejection of the third dialogue summary, the fourth prompt word is unrelated to the third dialogue summary; or, if the seventh operation indicates a modification result of the third dialogue summary, the fourth prompt word is constructed based on the modification result of the third dialogue summary; inputting the fourth prompt word into a large language model to generate a sixth response to the sixth statement; and outputting the sixth response to the sixth statement via the interactive client.
[0426] For example, the sixth statement, the sixth response, and the fourth prompt can be statement #62, response #62, and prompt #61 in method 600.
[0427] Optionally, the third dialogue summary is generated by the summary model, and method 1200 further includes: recording the labeling result of the third dialogue summary, wherein the labeling result of the third dialogue summary indicates any of the following: the third dialogue summary is labeled as accepted, the third dialogue summary is labeled as rejected, or the third dialogue summary is modified, and the labeling result of the third dialogue summary is used for adjustment of the summary model.
[0428] Optionally, method 1200 further includes: in response to the eighth operation, saving the third dialogue summary.
[0429] For example, the eighth operation can be operation #63 in method 600.
[0430] Optionally, method 1200 further includes: in response to the ninth operation, loading a saved fourth dialogue summary, the fourth dialogue summary being associated with a summary of at least one round of historical dialogue. For example, the ninth operation and the fourth dialogue summary can be operation #64 and dialogue summary #2 in method 600.
[0431] The following is combined Figures 13 to 16The apparatus of the embodiments of this application will be described below. It should be understood that the apparatus described below is capable of performing the methods of the foregoing embodiments of this application. To avoid unnecessary repetition, repeated descriptions will be appropriately omitted when describing the apparatus of the embodiments of this application below.
[0432] Figure 13 This is a schematic block diagram of a dialogue processing apparatus according to an embodiment of this application. Figure 13 The device 2000 shown can be used to perform Figure 11 The method is shown. The apparatus 2000 includes a first receiving module 2010, an output module 2020, a second receiving module 2030, and a generating module 2040.
[0433] The first receiving module 2010 is used to receive the first statement to be replied to through the interactive client.
[0434] Module 2040 is used to generate the first response of the first statement through a large language model.
[0435] Output module 2020 is used to output the first response of the first statement through the interactive client.
[0436] The second receiving module 2030 is used to receive a first operation through an interactive client, wherein the first operation is used to instruct whether to retain the first historical dialogue or discard the first historical dialogue, and the first historical dialogue includes a first statement and a first response.
[0437] The first receiving module 2010 is also used to receive a second statement to be replied to via an interactive client.
[0438] The generation module 2040 is also used to construct a first prompt word, wherein, if the first operation instruction retains the first historical dialogue, the first prompt word is generated based on the first historical dialogue, or, if the first operation instruction discards the first historical dialogue, the first prompt word is unrelated to the first historical dialogue.
[0439] The generation module 2040 is also used to input the first prompt word into the large language model to generate a second response for the second statement.
[0440] The output module 2020 is also used to output a second response via an interactive client.
[0441] Optionally, the output module 2020 is further configured to: output the recommendation result of the first historical dialogue through the interactive client, wherein the recommendation result of the first historical dialogue indicates whether to retain the first historical dialogue or to discard the first historical dialogue, the first operation is applied to the recommendation result of the first historical dialogue, and the first operation is used to indicate whether to accept the recommendation result of the first historical dialogue or to reject the recommendation result of the first historical dialogue.
[0442] Optionally, the first operation applies to the first historical dialogue.
[0443] Optionally, the apparatus 2000 may further include: a recording module, configured to: record the labeling result of a first historical dialogue, wherein the labeling result of the first historical dialogue indicates whether the first historical dialogue is labeled as retained or discarded, the labeling result of the first historical dialogue is used for training a recommendation model, the recommendation model is used to determine the recommendation result of the historical dialogue, and the recommendation result of the historical dialogue is used to indicate whether to recommend retaining the historical dialogue or to recommend discarding the historical dialogue.
[0444] Optionally, the device 2000 further includes: a summary module for summarizing at least one round of historical dialogue to obtain a first dialogue summary of at least one round of historical dialogue, wherein the at least one round of historical dialogue includes the first historical dialogue; and an output module 2020 for: outputting the first dialogue summary through an interactive client.
[0445] Optionally, the second receiving module 2030 is further configured to: receive a second operation via an interactive client, the second operation being used to trigger a summary of at least one round of historical dialogue.
[0446] Optionally, the second receiving module 2030 is further configured to: receive a third operation through an interactive client, the third operation indicating any of the following: accepting the first dialogue summary, rejecting the first dialogue summary, or the modification result of the first dialogue summary.
[0447] Optionally, the first receiving module 2010 is further configured to: receive a third statement to be replied to via an interactive client; the generating module 2040 is further configured to: construct a second prompt word, wherein, if the third operation indicates acceptance of the first dialogue summary, the second prompt word is constructed based on the first dialogue summary; if the third operation indicates rejection of the first dialogue summary, the second prompt word is unrelated to the first dialogue summary; or, if the third operation indicates a modification result of the first dialogue summary, the second prompt word is constructed based on the modification result of the first dialogue summary; and input the second prompt word into a large language model to generate a third response to the third statement. The output module 2020 is further configured to: output the third response via the interactive client.
[0448] Optionally, the first dialogue summary is generated by the summary model, and the recording module is also used to: record the marking result of the first dialogue summary, wherein the marking result of the first dialogue summary indicates any of the following: the first dialogue summary is marked as accepted, the first dialogue summary is marked as rejected, or the modification result of the first dialogue summary, the marking result of the first dialogue summary is used for the adjustment of the summary model.
[0449] Optionally, the device 2000 further includes a storage module for: in response to a fourth operation, storing a summary of the first dialogue.
[0450] Optionally, the device 2000 further includes a loading module for loading a saved second dialogue summary in response to the fifth operation, the second dialogue summary being associated with a summary of at least one round of historical dialogue.
[0451] Each module in device 2000 can be implemented in software or hardware. For example, the implementation of generation module 2040 will be described below. Similarly, the implementation of other modules can refer to the implementation of generation module 2040.
[0452] As an example of a software functional unit, the generation module 2040 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, or a container. Further, the aforementioned computing instance may be one or more. For example, the generation module 2040 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed within the same region or in different regions. Further, the multiple hosts / virtual machines / containers used to run the code may be distributed within the same availability zone (AZ) or in different AZs, each AZ including one or more geographically proximate data centers. Typically, a region may include multiple AZs.
[0453] Similarly, multiple hosts / virtual machines / containers used to run this code can be distributed within the same Virtual Private Cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Communication between two VPCs within the same region, as well as between VPCs in different regions, requires a communication gateway to be set up within each VPC to enable interconnection between VPCs.
[0454] As an example of a hardware functional unit, the generation module 2040 may include at least one computing device, such as a server. Alternatively, the generation module 2040 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof.
[0455] The multiple computing devices included in the generation module 2040 can be distributed in the same region or in different regions. Similarly, the multiple computing devices included in the generation module 2040 can be distributed in the same Virtual Private Cloud (VPC) or in multiple VPCs. These multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0456] It should be noted that, in other embodiments, the generation module 2040 can be used to execute any step in the dialogue processing method, the first receiving module 2010 can be used to execute any step in the dialogue processing method, the output module 2020 can be used to execute any step in the dialogue processing method, and the second receiving module 2030 can be used to execute any step in the dialogue processing method. The steps that each module is responsible for implementing can be specified as needed. By implementing different steps in the dialogue processing method through each module, all functions of the device 2000 can be realized.
[0457] This application also provides a computing device 1000. For example... Figure 14 As shown, the computing device 1000 includes a bus 1002, a processor 1004, a memory 1006, and a communication interface 1008. The processor 1004, the memory 1006, and the communication interface 1008 communicate with each other via the bus 1002. The computing device 1000 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in the computing device 1000.
[0458] Bus 1002 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 14 The bus 1002 may be represented by a single line, but this does not mean that there is only one bus or one type of bus. The bus 1002 may include a path for transmitting information between various components of the computing device 1000 (e.g., memory 1006, processor 1004, communication interface 1008).
[0459] The processor 1004 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0460] The memory 1006 may include volatile memory, such as random access memory (RAM). The processor 1004 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0461] The memory 1006 stores executable program code, which the processor 1004 executes to implement the functions of the aforementioned first receiving module 2010, output module 2020, second receiving module 2030, and generation module 2040, thereby realizing the dialogue processing method. That is, the memory 1006 stores instructions for executing the dialogue processing method.
[0462] The communication interface 1008 uses transceiver modules such as, but not limited to, network interface cards and transceivers to enable communication between the computing device 1000 and other devices or communication networks.
[0463] This application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.
[0464] like Figure 15 As shown, the computing device cluster includes at least one computing device 1000. The memory 1006 of one or more computing devices 1000 in the computing device cluster may store the same instructions for performing dialogue processing methods.
[0465] In some possible implementations, the memory 1006 of one or more computing devices 1000 in the computing device cluster may also store partial instructions for performing the dialogue processing method. In other words, a combination of one or more computing devices 1000 can jointly execute the instructions for performing the dialogue processing method.
[0466] It should be noted that the memory 1006 in different computing devices 1000 within the computing device cluster can store different instructions, each used to execute a portion of the functions of the dialogue processing device. That is, the instructions stored in the memory 1006 of different computing devices 1000 can implement the functions of one or more modules among the first receiving module 2010, the output module 2020, the second receiving module 2030, and the generation module 2040.
[0467] In some possible implementations, one or more computing devices in a computing device cluster can be connected via a network. This network can be a wide area network (WAN) or a local area network (LAN), etc. Figure 16 One possible implementation is shown. For example... Figure 16 As shown, two computing devices 1000A and 1000B are connected via a network. Specifically, they are connected to the network through communication interfaces in each computing device. In this possible implementation, the memory 1006 in computing device 1000A stores instructions for executing the functions of the first receiving module 2010, the output module 2020, and the second receiving module 2030. Simultaneously, the memory 1006 in computing device 1000B stores instructions for executing the functions of the generation module 2040.
[0468] Figure 16 The connection method between the computing device clusters shown can be such that, considering the dialogue processing method provided in this application may require data storage, the functions implemented by the generation module 2040 are delegated to the computing device 1000B for execution.
[0469] It should be understood that Figure 16The functions of computing device 1000A shown can also be performed by multiple computing devices 1000. Similarly, the functions of computing device 1000B can also be performed by multiple computing devices 1000.
[0470] This application also provides a computer program product containing instructions. The computer program product may be a software or program product containing instructions, capable of running on a computing device or stored on any usable medium. When the computer program product is run on at least one computing device, it causes the at least one computing device to perform a method of dialogue processing.
[0471] This application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that a computing device can store, or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to perform a method of dialogue processing.
[0472] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of this application.
[0473] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0474] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0475] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0476] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0477] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0478] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0479] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method of conversational processing, characterized by, The method is applied to a scene of multi-round dialogue interaction, and the method comprises: receiving, by an interactive client, a first statement to be replied to; generating, by a large language model, a first response to the first statement; outputting, by the interactive client, the first response; receiving, by the interactive client, a first operation, wherein the first operation is used to indicate to retain a first historical dialogue or discard the first historical dialogue, and the first historical dialogue comprises the first statement and the first response; receiving, by the interactive client, a second statement to be replied to; constructing a first prompt word, wherein, in a case where the first operation indicates to retain the first historical dialogue, the first prompt word is constructed according to the first historical dialogue, or, in a case where the first operation indicates to discard the first historical dialogue, the first prompt word is irrelevant to the first historical dialogue; inputting the first prompt word into the large language model to generate a second response to the second statement; outputting, by the interactive client, the second response.
2. The method of claim 1, wherein, The method further comprises: outputting, by the interactive client, a recommendation result of the first historical dialogue, wherein the recommendation result of the first historical dialogue indicates to recommend to retain the first historical dialogue or recommend to discard the first historical dialogue, and the first operation acts on the recommendation result of the first historical dialogue, and the first operation is used to indicate to accept the recommendation result of the first historical dialogue or reject the recommendation result of the first historical dialogue.
3. The method of claim 1, wherein, The first operation acts on the first historical dialogue.
4. The method according to any one of claims 1 to 3, characterized in that, The method further comprises: summarizing at least one round of historical dialogue to obtain a first dialogue summary of the at least one round of historical dialogue, wherein the at least one round of historical dialogue comprises the first historical dialogue; outputting, by the interactive client, the first dialogue summary.
5. The method of claim 4, wherein, The method further comprises: receiving, by the interactive client, a second operation, wherein the second operation is used to trigger summarizing the at least one round of historical dialogue.
6. The method according to claim 4 or 5, characterized in that, The method further comprises: receiving, by the interactive client, a third operation, wherein the third operation indicates any one of the following: accepting the first dialogue summary, rejecting the first dialogue summary, or a modification result of the first dialogue summary.
7. The method of claim 6, wherein, The method further comprises: receiving, by the interactive client, a third statement to be replied to; constructing a second prompt word, wherein, in a case where the third operation indicates to accept the first dialogue summary, the second prompt word is constructed according to the first dialogue summary, in a case where the third operation indicates to reject the first dialogue summary, the second prompt word is irrelevant to the first dialogue summary; or in a case where the third operation indicates the modification result of the first dialogue summary, the second prompt word is constructed according to the modification result of the first dialogue summary; inputting the second prompt word into the large language model to generate a third response to the third statement; outputting, by the interactive client, the third response.
8. The method according to any one of claims 4 to 7, characterized in that, The method further comprises: in response to a fourth operation, saving the first dialogue summary.
9. The method according to any one of claims 1 to 8, characterized in that, The method further comprises: In response to the fifth operation, a saved second conversation summary is loaded, the second conversation summary being related to a summary of at least one round of historical conversations.
10. An apparatus for dialog processing, characterized by The device is applied to a scenario of multi-round conversation interaction, and the device comprises: The first receiving module is configured to receive, by an interactive client, a first sentence to be replied to; The generating module is configured to generate, by a large language model, a first response to the first sentence; The output module is configured to output, by the interactive client, the first response; The second receiving module is configured to receive, by the interactive client, a first operation, wherein the first operation is used to indicate whether to retain a first historical conversation or discard the first historical conversation, and the first historical conversation comprises the first sentence and the first response; The first receiving module is further configured to receive, by the interactive client, a second sentence to be replied to; The generating module is further configured to construct a first prompt word, wherein, in a case where the first operation indicates to retain the first historical conversation, the first prompt word is constructed according to the first historical conversation, or in a case where the first operation indicates to discard the first historical conversation, the first prompt word is irrelevant to the first historical conversation; The generating module is further configured to input the first prompt word into the large language model to generate a second response to the second sentence; The output module is further configured to output, by the interactive client, the second response.
11. The apparatus of claim 10, wherein, The output module is further configured to: output, by the interactive client, a recommendation result of the first historical conversation, wherein the recommendation result of the first historical conversation indicates whether to recommend retaining the first historical conversation or recommending discarding the first historical conversation, the first operation acts on the recommendation result of the first historical conversation, and the first operation is used to indicate whether to accept the recommendation result of the first historical conversation or reject the recommendation result of the first historical conversation.
12. The apparatus of claim 10, wherein, The first operation acts on the first historical conversation.
13. The apparatus of any one of claims 10-12, wherein, The device further comprises: a summarizing module configured to summarize at least one round of historical conversations to obtain a first conversation summary of the at least one round of historical conversations, wherein the at least one round of historical conversations comprises the first historical conversation; and the output module is further configured to: output, by the interactive client, the first conversation summary.
14. The apparatus of claim 13, wherein, The second receiving module is further configured to: receive, by the interactive client, a second operation, the second operation being used to trigger summarizing the at least one round of historical conversations.
15. The apparatus of claim 13 or 14, wherein, The second receiving module is further configured to: receive, by the interactive client, a third operation, the third operation indicating any one of the following: accepting the first conversation summary, rejecting the first conversation summary, or a modified result of the first conversation summary.
16. The apparatus of claim 15, wherein, The first receiving module is further configured to: receive, by the interactive client, a third sentence to be replied to; the generating module is further configured to: construct a second prompt word, wherein, in a case where the third operation indicates to accept the first conversation summary, the second prompt word is constructed according to the first conversation summary, in a case where the third operation indicates to reject the first conversation summary, the second prompt word is irrelevant to the first conversation summary; or, In a case where the third operation indicates a modification result of the first summary of the conversation, the second prompt word is constructed according to the modification result of the first summary of the conversation; inputting the second prompt word into the large language model to generate a third response of the third sentence; and the output module is further configured to: output the third response through the interaction client.
17. The apparatus of any one of claims 13-16, wherein, The apparatus further includes: a saving module configured to save the first summary of the conversation in response to a fourth operation.
18. The apparatus of any one of claims 10-17, wherein, The apparatus further includes: a loading module configured to load a saved second summary of the conversation in response to a fifth operation, the second summary of the conversation being related to a summary of at least one round of historical conversation.
19. A cluster of computing devices, characterized in that, comprise at least one computing device, each computing device comprising a processor and a memory; the processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device to cause the cluster of computing devices to perform the method of any one of claims 1-9.
20. A computer-readable storage medium, characterized in that, comprise computer program instructions that, when executed by a cluster of computing devices, cause the cluster of computing devices to perform the method of any one of claims 1-9.
21. A computer program product comprising instructions, wherein: the instructions, when executed by a cluster of computing devices, cause the cluster of computing devices to perform the method of any one of claims 1-9.