Conversation processing method, device and equipment
By extracting and managing memory summaries from historical dialogues, the problem of unnatural responses from virtual humans has been solved, achieving more efficient and accurate memory retrieval and improving the user experience.
Patent Information
- Application Number
- CN202511803363.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-02
- Publication Date
- 2026-03-03
AI Technical Summary
The dialogue content generated by virtual humans suffers from unnatural responses and a lack of human touch, failing to meet users' emotional needs. Furthermore, existing technologies are inefficient and inaccurate in recalling memories, making it difficult to naturally integrate into the dialogue scenario.
By extracting and generating memory summaries from historical dialogues, hierarchical management of memories is achieved. Machine learning models are used to automatically extract and merge memory summaries, store them in a memory bank, and recall memory content associated with the current dialogue to generate responses when needed.
It improves the efficiency and accuracy of memory retrieval, enabling virtual humans to respond more naturally, enhancing the interactive experience with users, and meeting users' emotional needs.
Smart Images

Figure CN121597894A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more specifically, to a dialogue processing method, apparatus, and device. Background Technology
[0002] With increasingly rich cultural life and rapid development of computer technology, the demand for human-computer dialogue is also growing. Human-computer dialogue builds a bridge for seamless communication between humans and the digital world, allowing users to gain emotional value by conversing with virtual humans.
[0003] However, the dialogue generated by virtual humans may suffer from unnatural responses and a lack of human touch, failing to meet users' emotional needs. Summary of the Invention
[0004] A brief overview of this disclosure is given below to provide a basic understanding of some aspects of it. However, it should be understood that this overview is not an exhaustive summary of this disclosure. It is not intended to identify key or essential parts of this disclosure, nor is it intended to limit the scope of this disclosure. Its purpose is merely to present certain concepts of this disclosure in a simplified form as a prelude to the more detailed description that follows.
[0005] One of the purposes of this disclosure is to provide a dialogue processing method, apparatus, and device.
[0006] According to a first aspect of this disclosure, a dialogue processing method is provided, comprising: acquiring historical dialogues; extracting content belonging to the memory category from the historical dialogues based on a preset memory category to generate a first memory summary of the historical dialogues; and storing the first memory summary in a memory bank.
[0007] In some embodiments, the dialogue processing method further includes: obtaining a current dialogue; reading a second memory summary associated with the current dialogue from the memory bank; and generating a response dialogue for the current dialogue based on the second memory summary.
[0008] In some embodiments, extracting content belonging to the memory category from the historical dialogue based on a preset memory category to generate a first memory summary of the historical dialogue includes: generating a first prompt message in response to obtaining the historical dialogue, wherein the first prompt message indicates that content belonging to the memory category in the historical dialogue should be extracted; and generating the first memory summary based on the first prompt message and a pre-trained memory extraction model.
[0009] In some embodiments, storing the first memory summary in a memory bank includes: merging the first memory summary with a third memory summary belonging to the memory category in the memory bank to generate a fourth memory summary; and storing the fourth memory summary in the memory bank.
[0010] In some embodiments, merging the first memory summary with a third memory summary belonging to the memory category in the memory bank to generate a fourth memory summary includes: generating a second prompt message in response to the generation of the first memory summary, wherein the second prompt message indicates that the first memory summary is merged with a third memory summary belonging to the memory category in the memory bank; and generating the fourth memory summary based on the second prompt message and a pre-trained memory merging model.
[0011] In some embodiments, reading a second memory summary associated with the current dialogue from the memory bank includes: generating a third prompt in response to obtaining the current dialogue, wherein the third prompt instructs the reading of a second memory summary associated with the current dialogue from the memory bank; and reading the second memory summary from the memory bank based on the third prompt and a pre-trained memory retrieval model.
[0012] In some embodiments, reading a second memory summary associated with the current conversation from the memory bank includes at least one of the following: reading a second memory summary from the memory bank that matches the topic of the current conversation; reading a second memory summary from the memory bank that meets the semantic requirements of the current conversation; and reading a second memory summary from the memory bank that is associated with the word segmentation in the current conversation.
[0013] In some embodiments, generating a response dialogue for the current dialogue based on the second memory summary includes generating the response dialogue based on the second memory summary, the current dialogue, and a pre-trained dialogue model.
[0014] In some embodiments, the dialogue processing method further includes: obtaining a training sample set before generating the response dialogue based on the second memory summary, the current dialogue, and a pre-trained dialogue model, wherein the training samples include dialogue data and corresponding memory summary labels; and training the dialogue model based on the training sample set using a supervised fine-tuning method.
[0015] In some embodiments, the dialogue processing method further includes: generating an initial dialogue based on the historical dialogues before acquiring the current dialogue, wherein the current dialogue is a response to the initial dialogue.
[0016] According to a second aspect of this disclosure, a dialogue processing apparatus is provided, comprising: an acquisition module configured to acquire historical dialogues; an extraction module configured to extract content belonging to a preset memory category from the historical dialogues to generate a first memory summary of the historical dialogues; and a storage module configured to store the first memory summary in a memory bank.
[0017] According to a third aspect of this disclosure, a dialogue processing apparatus is provided, including a memory and a processor, wherein the memory stores instructions that, when executed by the processor, implement the dialogue processing method as described above.
[0018] According to a fourth aspect of this disclosure, a non-transitory computer-readable storage medium is provided, wherein instructions are stored on the non-transitory computer-readable storage medium, and when the instructions are executed by a processor, the operation of the dialogue processing method described above is implemented.
[0019] According to a fifth aspect of this disclosure, a computer program product is provided, the computer program product including instructions that, when executed by a processor, implement the operation of the dialogue processing method as described above.
[0020] Other features and advantages of this disclosure will become clearer from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description
[0021] The accompanying drawings, which form part of this specification, illustrate embodiments of this disclosure and, together with the specification, serve to explain the principles of this disclosure.
[0022] This disclosure will become clearer with reference to the accompanying drawings and the following detailed description, wherein:
[0023] Figure 1 A flowchart illustrating a dialogue processing method according to some embodiments of the present disclosure is shown;
[0024] Figure 2 A flowchart illustrating a dialogue processing method according to other embodiments of the present disclosure is shown;
[0025] Figure 3 A schematic diagram illustrating a processing dialogue according to some embodiments of the present disclosure is shown;
[0026] Figure 4 A schematic diagram of a dialogue processing apparatus according to some embodiments of the present disclosure is shown;
[0027] Figure 5 A schematic diagram of a dialogue processing device according to some embodiments of the present disclosure is shown;
[0028] Figure 6 A schematic block diagram of a computer system on which embodiments of the present disclosure may be implemented is shown.
[0029] Note that in the embodiments described below, the same reference numerals are sometimes used across different figures to denote the same parts or parts having the same function, and repeated descriptions are omitted. In this specification, similar reference numerals and letters are used to denote similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.
[0030] For ease of understanding, the positions, dimensions, and extents of the structures shown in the accompanying drawings and other materials may not represent actual positions, dimensions, and extents. Therefore, the disclosed invention is not limited to the positions, dimensions, and extents disclosed in the accompanying drawings and other materials. Furthermore, the drawings are not necessarily drawn to scale, and some features may be enlarged to show details of specific components. Detailed Implementation
[0031] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of the present disclosure.
[0032] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the scope of this disclosure or its application or use. That is, the structures and methods herein are shown in an exemplary manner to illustrate different embodiments of the structures and methods in this disclosure. However, those skilled in the art will understand that they merely illustrate exemplary ways that can be used to implement this disclosure, and not exhaustive ways. Furthermore, the drawings are not necessarily drawn to scale, and some features may be enlarged to show details of specific components.
[0033] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.
[0034] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.
[0035] With the enrichment of cultural life and the rapid development of computer technology, many functional services based on human-computer dialogue have emerged. The core value of these services is to simulate real-person conversational interaction. Users can gain emotional value by conversing with virtual avatars. However, the dialogue generated by virtual avatars may suffer from unnatural responses and a lack of human warmth, making the virtual avatar appear as a "rigid dialogue machine" that fails to meet users' emotional needs. Furthermore, virtual avatar responses are usually only based on the current content of the other party's conversation, essentially starting the conversation and response from scratch each time, resulting in a degraded user experience.
[0036] In some examples, historical dialogue slices between the virtual human and the user can be vectorized and saved to a vector library. During the dialogue, relevant historical fragments can be retrieved from the vector library in real time based on the current dialogue content. This is then combined with the capabilities of a large language model, such as using ultra-long text reasoning techniques like length extrapolation, to generate responses. However, in the examples above, all historical dialogues need to be saved for subsequent memory retrieval, which places high demands on the capabilities of the large language model. With a large amount of historical dialogues, the limited capabilities of the large language model will lead to reduced output efficiency or even ineffective output. Furthermore, the above examples suffer from inaccurate memory retrieval. Specifically, these examples often overemphasize short-term memory. Excessive short-term memory can lead to memory overload, and the recalled memories may contain conflicting, fragmented, and unfocused information, resulting in inaccurate memory retrieval. Furthermore, unlike traditional Q&A and customer service services, in some business scenarios, the memorized content needs to be integrated more naturally into the appropriate dialogue context to better meet the user's needs. That is, while ensuring the smooth flow of the response context, the memorized content needs to be integrated more naturally into the response. However, the above example still has the problem that the response cannot be integrated naturally into the current dialogue context and the memorized content cannot be integrated naturally into the response.
[0037] To address at least one of the aforementioned problems, this disclosure proposes a dialogue processing method, apparatus, and device. By extracting historical dialogues to generate a first memory summary, it achieves hierarchical management of memories, effectively solving the problem of fragmented content to be remembered in dialogues, improving memory retrieval efficiency and accuracy, and enabling subsequent responses to be generated by reading a second memory summary associated with the current dialogue. This achieves resonance and linkage with past memories, making responses more humane and natural, thereby meeting users' emotional needs and enhancing user experience.
[0038] In some embodiments of this disclosure, such as Figure 1 As shown, dialogue processing methods may include:
[0039] Step S110: Obtain historical conversations.
[0040] In this disclosure, historical conversations can be in electronic text form, or they can be in the form of voice, video, etc., without any limitation. In addition, historical conversations can include conversation content entered by the user within a certain period of time, and historical conversations can be conversation content authorized and provided by the user.
[0041] In some embodiments, historical dialogues can be segmented into one or more dialogue fragments using a sliding window, so that subsequent extraction can be performed based on one or more dialogue fragments.
[0042] Continue to refer to Figure 1 In some embodiments of this disclosure, the dialogue processing method may further include:
[0043] Step S120: Based on preset memory categories, extract content belonging to the memory categories from historical dialogues to generate a first memory summary of the historical dialogues.
[0044] In some embodiments, a memory category may include one or more first categories, and each first category may include one or more second categories. This enables multi-level, refined management of memories, facilitating subsequent preservation and retrieval. For example, a first category may include an interactive information category, under which one or more second categories may be included. Second categories may include, for example, agreement categories, interaction categories, relationship categories, etc. An agreement category may be information about agreements reached between two parties in a conversation, such as agreed-upon goals, agreed-upon times, agreed-upon behaviors, etc., representing an interactive memory of consensus reached by both parties on a specific topic. An interaction category may be interactive messages between two parties on a social media platform, such as follow information, post comments, anniversary interactions, etc. A relationship category may be specific content about the relationship between two parties in a conversation, such as content about conflicts or changes in the relationship. Furthermore, a first category may also include other information categories, under which one or more corresponding second categories may be included. For example, a first category may also include a social information category, under which a life status category may be included, without limitation.
[0045] It should be understood that each second category may also include one or more third categories, each third category may also include one or more fourth categories, and so on, thereby enabling more refined management at multiple levels, without limitation.
[0046] By pre-setting memory categories, a corresponding memory summary system can be formed to facilitate refined memory management, reduce memory burden, and enable the extraction and preservation of more important personalized information in historical dialogues. This filters out trivial and less important information, avoiding the degradation of memory retrieval accuracy and efficiency caused by storing too much unimportant information, and effectively improving the accuracy and efficiency of subsequent memory retrieval.
[0047] In some embodiments, extracting content belonging to the memory category from historical dialogues to generate a first memory summary of the historical dialogues can be done automatically, for example, by relying on one or more machine learning models. In some embodiments, machine learning models such as large language models or basic models can be used to extract the content of historical dialogues and generate a first memory summary. Alternatively, in some embodiments, extracting the content of historical dialogues and generating a first memory summary can also be implemented directly by an intelligent agent. Here, the intelligent agent can also be referred to as a robot, a digital human, or a virtual agent of a machine learning model. The intelligent agent can be implemented based on one or more machine learning models, such as those based on large language models or basic models.
[0048] In some embodiments, extracting content belonging to a preset memory category from historical dialogues to generate a first memory summary of the historical dialogues may include: generating a first prompt message in response to acquiring the historical dialogues; and generating the first memory summary based on the first prompt message and a pre-trained memory retrieval model. The first prompt message may instruct the extraction of content belonging to the memory category from the historical dialogues. Thus, upon acquiring historical dialogues, a corresponding first prompt message can be automatically generated, and a corresponding memory retrieval model can be invoked, thereby automatically extracting content belonging to the memory category from the historical dialogues to generate the first memory summary.
[0049] In this disclosure, the first prompt information can be a comprehensive set of instructions that can guide the memory retrieval model to extract content from historical dialogues and generate a first memory summary, and the first prompt information can be represented in text form; the memory retrieval model can be implemented, for example, based on a large language model.
[0050] In some embodiments, the first prompt information can be generated based on a preset memory category and historical dialogue to guide the memory retrieval model to extract content belonging to the corresponding memory category in the historical dialogue, thereby generating a structured first memory summary.
[0051] Continue to refer to Figure 1 In some embodiments of this disclosure, the dialogue processing method may further include:
[0052] Step S130: Save the first memory summary in the memory bank.
[0053] According to some embodiments of this disclosure, by saving a first memory summary to the memory bank instead of saving all dialogue content to the memory bank, the storage pressure on the memory bank is reduced, the storage resources of the memory bank are freed up, and thus more content with a longer time span can be saved.
[0054] In this disclosure, the memory may be located on a remote server, or it may be located on a local server; there is no restriction on the location of the memory.
[0055] In some embodiments, the first memory summary can be saved to a memory bank in a format of a pair of attributes and content values, wherein the attributes can indicate the memory category to which the first memory summary belongs, and the content values can indicate the specific content of the first memory summary. This allows for structured storage of the first memory summary, facilitating subsequent retrieval.
[0056] Considering that the content already stored in the memory bank may conflict with the content to be saved, in some embodiments, storing the first memory summary in the memory bank may include: merging the first memory summary with a third memory summary belonging to the same memory category in the memory bank to generate a fourth memory summary, and then storing the fourth memory summary in the memory bank. In this way, the most recently extracted first memory summary from the historical dialogue can be merged with a third memory summary belonging to the same memory category in the memory bank, which can prevent memory redundancy or errors as the dialogue progresses, thereby improving the accuracy of subsequent memory retrieval.
[0057] In some embodiments, merging the first memory summary with a third memory summary belonging to a memory category in the memory bank to generate a fourth memory summary, and storing the fourth memory summary in the memory bank, may include: in response to a conflict between the third memory summary and the first memory summary, using the first memory summary as the fourth memory summary, and replacing the third memory summary in the memory bank with the fourth memory summary. Thus, if a third memory summary already stored in the memory bank belonging to the corresponding memory category changes or conflicts with the currently retrieved first memory summary, the content belonging to the corresponding memory category in the memory bank can be updated based on the currently retrieved first memory summary, thereby enabling real-time updates to the memory bank and improving the accuracy of subsequent memory retrieval.
[0058] Alternatively, in some embodiments, merging the first memory summary with a third memory summary belonging to a memory category in the memory bank to generate a fourth memory summary, and storing the fourth memory summary in the memory bank, may include: in response to the third memory summary and the first memory summary not conflicting, adding the first memory summary as the fourth memory summary to the content belonging to the corresponding memory category in the memory bank. Thus, when the third memory summary already stored in the memory bank belonging to the corresponding memory category does not conflict with the currently retrieved first memory summary, the content belonging to the corresponding memory category in the memory bank can be added to or supplemented to ensure that the relevant memories can be recalled relatively completely in the future.
[0059] Alternatively, in some embodiments, merging the first memory summary with a third memory summary belonging to the memory category in the memory bank to generate a fourth memory summary, and storing the fourth memory summary in the memory bank, may include: summarizing the third and first memory summaries to generate the fourth memory summary, and replacing the third memory summary in the memory bank with the fourth memory summary. For example, under the life status category in the memory bank, memory summaries such as "ran last weekend" and "went to the gym after get off work today" are stored. If the currently extracted memory summary is "preparing to exercise and check in," the above memory summaries "ran last weekend," "went to the gym after get off work today," and "preparing to exercise and check in" can be summarized as "daily fitness running loves sports," and the "ran last weekend" and "went to the gym after get off work today" in the memory bank can be replaced with "daily fitness running loves sports." In this way, the content already stored in the memory bank and the currently extracted first memory summary can be summarized, which can effectively release the storage resources of the memory bank and can concisely and comprehensively store the memory summary content under the corresponding memory category.
[0060] In some embodiments, merging the first memory summary with a third memory summary belonging to the memory category in the memory bank can be performed automatically, for example, by relying on one or more machine learning models. In some embodiments, machine learning models such as large language models or basic models can be used to merge the first memory summary with the third memory summary belonging to the memory category in the memory bank. Alternatively, in some embodiments, merging the first memory summary with the third memory summary belonging to the memory category in the memory bank can also be implemented directly by an intelligent agent. Here, the intelligent agent can also be referred to as a robot, a digital human, or a virtual agent of a machine learning model. The intelligent agent can be implemented based on one or more machine learning models, such as based on a large language model or a basic model.
[0061] In some embodiments, merging a first memory summary with a third memory summary belonging to a memory category in a memory bank to generate a fourth memory summary may include: generating a second prompt in response to the generation of the first memory summary; and generating the fourth memory summary based on the second prompt and a pre-trained memory merging model. The second prompt may instruct the merging of the first memory summary with the third memory summary belonging to a memory category in the memory bank. Thus, after extracting historical dialogue to generate the first memory summary, the corresponding second prompt can be automatically generated, and the corresponding memory merging model can be invoked, thereby automatically merging the first memory summary with the third memory summary belonging to a memory category in the memory bank.
[0062] In this disclosure, the second prompt information can be a comprehensive set of instructions that guides the memory merging model to merge the currently extracted first memory summary with the corresponding third memory summary in the memory bank, and the second prompt information can be represented in text form; the memory merging model can be implemented, for example, based on a large language model.
[0063] In some embodiments, the second prompt may instruct the first memory summary to be summarized together with the third memory summary belonging to the corresponding memory category in the memory bank, so as to guide the memory merging model to generate a summarized fourth memory summary.
[0064] After saving the first memory summary generated from the historical dialogue to the memory bank, the associated second memory summary can be read from the memory bank based on the current dialogue, i.e., memory retrieval. In order to generate a response for the current dialogue by combining the read second memory summary, the generated response can correspond to the historical memory content, so that the response can be naturally integrated into the current dialogue scenario, improve user satisfaction and enhance user experience.
[0065] Specifically, such as Figure 2 As shown, in some embodiments of this disclosure, the dialogue processing method may further include:
[0066] Step S210: Obtain the current conversation.
[0067] In this disclosure, the current conversation can be in electronic text form, or it can be in the form of voice, video, etc., without limitation. Furthermore, the current conversation can be user-authorized and user-provided content. In some embodiments, the current conversation can be the content of current multi-turn conversations, such as the content of the latest two rounds of conversation, so that relevant memories can be more comprehensively retrieved or recalled in conjunction with the current multi-turn conversation content.
[0068] In some embodiments, an initial dialogue can be generated based on historical dialogues before the current dialogue is obtained. The current dialogue, obtained after the initial dialogue is generated, can be a response to the initial dialogue. This allows for the generation of an initial dialogue by combining historical dialogue content before the user initiates a conversation, resulting in a more personalized opening that better meets the user's emotional needs and improves the user response rate.
[0069] like Figure 2 As shown, in some embodiments of this disclosure, the dialogue processing method may further include:
[0070] Step S220: Read the second memory summary associated with the current conversation from the memory bank.
[0071] In some embodiments, retrieving a second memory summary associated with the current conversation from the memory bank may include: retrieving a second memory summary that matches the topic of the current conversation from the memory bank. Thus, memory retrieval can be performed by determining whether the conversation topic matches a topic corresponding to a memory category in the memory bank. For example, if the topic of the current conversation is determined to be "sleep," second memory summaries related to "sleep schedule," "insomnia experience," etc., can be retrieved from the memory bank. Furthermore, if the current conversation has multiple topics, relevant second memory summaries can be retrieved comprehensively based on these multiple topics.
[0072] Alternatively, in some embodiments, retrieving a second memory summary associated with the current dialogue from the memory bank may include: retrieving a second memory summary that meets the semantic requirements of the current dialogue. In this way, the implicit semantic requirements of the dialogue can be determined, and a second memory summary with an indirect or extended semantic connection can be retrieved. For example, if the semantic requirement of the current dialogue is determined to be "want to relax," a second memory summary related to "going on a beach vacation" can be retrieved from the memory bank.
[0073] Alternatively, in some embodiments, reading a second memory summary associated with the current dialogue from the memory bank may include: reading a second memory summary associated with a word segment from the memory bank based on the word segmentation in the current dialogue. Thus, the second memory summary associated with the word segmentation can be read by combining the word segmentation in the current dialogue; for example, common sense can be used to make reasonable associations or inferences about the word segmentation to read relevant second memory summaries. For example, "Northeasterners" may be associated with "sauerkraut stew with vermicelli" and "indoor heating," thus these memory summaries associated with "Northeasterners" can be read. Word segmentation of the current dialogue and reasonable associations or inferences about the word segmentation can be performed automatically, for example, by relying on one or more machine learning models (such as large language models).
[0074] In some embodiments, a second memory summary matching the topic of the current dialogue can be preferentially retrieved from the memory bank. If the number of retrieved second memory summaries is less than a preset threshold, at least one of the following can be performed: retrieving a second memory summary that meets the semantic requirements of the current dialogue; or retrieving a second memory summary associated with a word segment from the memory bank based on the word segmentation in the current dialogue. This not only effectively retrieves the required memory content but also significantly improves memory retrieval efficiency.
[0075] In some embodiments, retrieving a second memory summary associated with the current dialogue from the memory bank can be automatic, for example, by relying on one or more machine learning models. In some embodiments, machine learning models such as large language models or base models can be used to retrieve the second memory summary associated with the current dialogue from the memory bank. Alternatively, in some embodiments, retrieving the second memory summary associated with the current dialogue from the memory bank can also be achieved directly by an intelligent agent. This intelligent agent can also be referred to as a robot, a digital human, or a virtual agent of a machine learning model. The intelligent agent can be implemented based on one or more machine learning models, such as large language models or base models.
[0076] In some embodiments, retrieving a second memory summary associated with the current dialogue from a memory bank may include: generating a third prompt in response to acquiring the current dialogue; and retrieving the second memory summary based on the third prompt and a pre-trained memory retrieval model. The third prompt may instruct the retrieval of the second memory summary associated with the current dialogue from the memory bank.
[0077] In this disclosure, the third prompt information can be a comprehensive set of instructions that can guide the memory retrieval model to retrieve a second memory summary associated with the current dialogue from the memory bank, and the third prompt information can be represented in text form; the memory retrieval model, also known as the memory recall model, can be implemented, for example, based on a large language model.
[0078] In some embodiments, the third prompt information can be generated based on a memory retrieval strategy to be adopted, wherein the memory retrieval strategy can include at least one of the following: retrieving a second memory summary from the memory bank that matches the topic of the current dialogue; retrieving a second memory summary from the memory bank that meets the semantic requirements of the current dialogue; and retrieving a second memory summary associated with word segmentation from the memory bank based on word segmentation in the current dialogue. Thus, the third prompt information can guide the memory retrieval model to retrieve the second memory summary based on the corresponding memory retrieval strategy.
[0079] like Figure 2As shown, in some embodiments of this disclosure, the dialogue processing method may further include:
[0080] Step S230: Generate a response dialogue for the current dialogue based on the second memory summary.
[0081] In some embodiments, generating a response dialogue for the current conversation based on the second memory digest can be automated, for example, by relying on one or more machine learning models. In some embodiments, machine learning models such as large language models or basic models can be used to generate a response dialogue for the current conversation based on the second memory digest. Alternatively, in some embodiments, generating a response dialogue for the current conversation based on the second memory digest can also be directly implemented by an intelligent agent. Here, the intelligent agent can also be referred to as a robot, a digital human, or a virtual agent of a machine learning model. The intelligent agent can be implemented based on one or more machine learning models, such as large language models or basic models.
[0082] In some embodiments, generating a response dialogue for the current dialogue based on a second memory summary may include generating the response dialogue based on the second memory summary, the current dialogue, and a pre-trained dialogue model. Thus, the corresponding response dialogue can be automatically generated by invoking the pre-trained dialogue model. In this disclosure, the dialogue model may, for example, be implemented based on a large language model.
[0083] In some embodiments, generating a response dialogue based on a second memory summary, the current dialogue, and a pre-trained dialogue model may include: inputting the second memory summary and the current dialogue into a pre-trained dialogue model to generate a response dialogue.
[0084] Alternatively, in other embodiments, generating a response dialogue based on the second memory summary, the current dialogue, and a pre-trained dialogue model may include: generating a fourth prompt message in response to reading the second memory summary from the memory bank; and generating a response dialogue based on the fourth prompt message and the pre-trained dialogue model. The fourth prompt message may instruct the generation of a response dialogue for the current dialogue based on the second memory summary; in some embodiments, the fourth prompt message may be generated based on both the second memory summary and the current dialogue.
[0085] In this disclosure, the fourth prompt information can be a comprehensive set of instructions that can guide the dialogue model to generate a response dialogue for the current dialogue based on the second memory summary, and the fourth prompt information can be represented in text form.
[0086] In order to enable the generated response dialogue to effectively link with the second memory summary, that is, to ensure that the response dialogue can be accurately and naturally aligned with the read second memory summary, in some embodiments, supervised fine-tuning (SFT) can be performed on the pre-trained dialogue model to give the dialogue model better memory alignment capabilities.
[0087] Specifically, before generating a response dialogue based on the second memory summary, the current dialogue, and a pre-trained dialogue model, a training sample set can be obtained. A supervised fine-tuning method can then be used to train the dialogue model based on this training sample set. The training samples include dialogue data and corresponding memory summary labels. In this way, the model parameters of the pre-trained dialogue model can be updated using the training sample set, enabling the dialogue model to generate corresponding dialogue content based on the second memory summary, thus giving the dialogue model better memory alignment capabilities.
[0088] In this disclosure, the dialogue data in the training samples may come from one or more users and have been authorized for use by those users; the memory summary labels of the dialogue data may be manually annotated or automatically generated based on one or more machine learning models (such as large language models), without limitation.
[0089] Figure 3 A schematic diagram illustrating a processing dialogue according to some embodiments of this disclosure is shown. Figure 3 As shown, after retrieving memories from historical dialogues based on a large language model to generate a first memory summary, the first memory summary can be merged with a third memory summary belonging to the memory category in the memory bank based on the large language model, and the merged memory summary can be written into the memory bank. Then, when the current dialogue is obtained, the relevant second memory summary can be read from the memory bank based on the current dialogue based on the large language model, that is, memory retrieval based on the large language model. The read second memory summary and the current dialogue can be input into the dialogue model in an input format that is compatible with the dialogue model, so that the dialogue model can output a response dialogue for the current dialogue.
[0090] According to the scheme disclosed herein, by extracting historical dialogues to generate memory summaries, memory content can be extracted in a focused manner, improving the efficiency and accuracy of memory retrieval. This allows subsequent responses generated based on the retrieved memories to resonate and interact with past memories, thereby transforming the virtual human from a "rigid dialogue machine" into a "remembering, associative, and warm interactive partner." Furthermore, the virtual human can remember the user's preferences, habits, and past experiences, just like a "real partner," to generate more humane dialogue content, thereby meeting the user's value needs and companionship needs, and enhancing the user experience.
[0091] According to another aspect of this disclosure, a dialogue processing apparatus is also provided, which can be configured to perform the dialogue processing method as described above. Figure 4 As shown, in some exemplary embodiments of this disclosure, the dialogue processing apparatus 400 may include an acquisition module 410, an extraction module 420, and a storage module 430.
[0092] The acquisition module 410 can be configured to acquire historical dialogues. The extraction module 420 can be configured to extract content belonging to a preset memory category from the historical dialogues to generate a first memory summary of the historical dialogues. The storage module 430 can be configured to store the first memory summary in a memory bank.
[0093] In some embodiments, the acquisition module 410 may also be configured to acquire the current dialogue; the dialogue processing device 400 may further include a reading module 440 and a generation module 450, wherein the reading module 440 may be configured to read a second memory summary associated with the current dialogue from a memory bank, and the generation module 450 may be configured to generate a response dialogue for the current dialogue based on the second memory summary.
[0094] The specific operation of the various modules in the dialogue processing device 400 can be found in the detailed explanation of the dialogue processing method above, and will not be repeated here.
[0095] According to another aspect of this disclosure, a dialogue processing device is also provided. For example... Figure 5 As shown, in some exemplary embodiments of this disclosure, the dialogue processing device 500 may include a memory 510 and a processor 520. Instructions may be stored in the memory 510, and when executed by the processor 520, the dialogue processing method described above can be implemented.
[0096] Specifically, processor 520 can perform various actions and processes according to instructions stored in memory 510. Processor 520 can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor can be a microprocessor or any conventional processor, and can be an x86 architecture or an ARM architecture, etc.
[0097] Memory 510 stores executable instructions that, when executed by processor 520, implement the dialogue processing method described above. Memory 510 may be volatile memory or non-volatile memory, or may include both. Non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct memory bus random access memory (DR RAM). It should be noted that the memory of the methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0098] This disclosure also proposes a non-transitory computer-readable storage medium storing instructions that, when executed by a processor, can implement the dialogue processing method described above.
[0099] Similarly, the non-transitory computer-readable storage media in the embodiments of this disclosure are intended to include, but are not limited to, the above and any other suitable types of memory.
[0100] This disclosure also proposes a computer program product that may include instructions that, when executed by a processor, can implement the operation of the dialogue processing method described above.
[0101] Instructions can be any set of instructions that will be executed directly by one or more processors, such as machine code, or any set of instructions that will be executed indirectly, such as scripts. The terms “instruction,” “application,” “procedure,” “step,” and “program” used herein are used interchangeably. Instructions can be stored in object code format for direct processing by one or more processors, or stored in any other computer language, including scripts or sets of independent source code modules that are interpreted on demand or compiled ahead of time. The function, methods, and routines of instructions are explained in more detail in other parts of this document.
[0102] Figure 6A schematic block diagram of a computer system 600 on which embodiments of the present disclosure may be implemented is shown. The computer system 600 includes a bus 610 or other communication mechanism for transmitting information, and a processing means 620 coupled to the bus 610 for processing information. The computer system 600 also includes a memory coupled to the bus 610 for storing instructions to be executed by the processing means 620; the memory may be random access memory (RAM) or other dynamic storage device. The memory (such as RAM 630) may also be used to store temporary variables or other intermediate information during the execution of instructions to be executed by the processing means 620. The computer system 600 may also include a read-only memory (ROM) 640 or other static storage device coupled to the bus 610 for storing static information and instructions for the processing means 620. A storage device 650, such as a magnetic disk or optical disk, is provided and coupled to the bus 610 for storing information and instructions. Computer system 600 may be coupled via bus 610 to output device 660 for providing output to a user, such as, but not limited to, a display (such as a cathode ray tube (CRT) or liquid crystal display (LCD)), speakers, etc. Input device 670, such as a keyboard, mouse, microphone, etc., is coupled to bus 610 for transmitting information and command selection to processing device 620. Computer system 600 may perform embodiments of this disclosure. Consistent with certain implementations of this disclosure, computer system 600 provides results by executing one or more sequences of one or more instructions contained in memory (such as RAM 630) in response to processing device 620. Such instructions may be read into memory (such as RAM 630) from another computer-readable medium, such as storage device 650. Execution of the sequence of instructions contained in memory (such as RAM 630) causes processing device 620 to perform the methods described herein. Alternatively, hard-wired circuitry may be used in place of or in combination with software instructions to implement the teachings. Therefore, implementations of this disclosure are not limited to any particular combination of hardware circuitry and software. In various embodiments, computer system 600 can be connected across a network to one or more other computer systems, such as computer system 600, to form a networked system via network interface 680. This network may include a private network or a public network such as the Internet. In a networked system, one or more computer systems can store data and supply data to other computer systems. As used herein, the term "computer-readable medium" refers to any medium that participates in providing instructions to processing device 620 for execution. Such media can take many forms, including but not limited to non-volatile media, volatile media, and transmission media. Non-volatile media include, for example, optical discs or magnetic disks such as storage device 650. Volatile media include dynamic memory such as memory (e.g., RAM 630).Transmission media include coaxial cable, copper wire, and optical fiber, including cabling containing bus 610. Common forms of computer-readable media or computer program products include, for example, floppy disks, flexible disks, hard disks, magnetic tape, or any other magnetic media, CD-ROMs, digital video discs (DVDs), Blu-ray discs, any other optical media, thumb drives, memory cards, RAM, PROMs and EPROMs, fast EPROMs, any other memory chips or cartridges, or any other tangible media from which a computer can read. Various forms of computer-readable media may be involved when carrying one or more sequences of one or more instructions to processing device 620 for execution. For example, instructions may initially be carried on a disk of a remote computer. The remote computer may load the instructions into its dynamic memory and transmit the instructions over a telephone line using a modem. A modem local to computer system 600 may receive data over the telephone line and convert the data into an infrared signal using an infrared transmitter. An infrared detector coupled to bus 610 may receive the data carried in the infrared signal and place the data on bus 610. Bus 610 carries data to memory (such as RAM 630), and processing device 620 retrieves instructions from memory (such as RAM 630) and executes the instructions. Optionally, instructions received from memory (such as RAM 630) may be stored on storage device 650 before or after execution by processing device 620.
[0103] According to various embodiments, instructions configured to be executed by processing device 620 to perform a method are stored on a computer-readable medium. The computer-readable medium may be a device for storing digital information. For example, the computer-readable medium includes a compact disc read-only memory (CD-ROM) as known in the art for storing software. The computer-readable medium is accessed by a processor adapted to execute the instructions configured to be executed.
[0104] It should be noted that the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0105] In general, the various exemplary embodiments of this disclosure can be implemented in hardware or dedicated circuitry, software, firmware, logic, or any combination thereof. Some aspects can be implemented in hardware, while others can be implemented in firmware or software that can be executed by a controller, microprocessor, or other computing device. When aspects of embodiments of this disclosure are illustrated or described as block diagrams, flowcharts, or using some other graphical representation, it will be understood that the blocks, apparatuses, systems, techniques, or methods described herein can be implemented as non-limiting examples in hardware, software, firmware, dedicated circuitry or logic, general-purpose hardware or controllers or other computing devices, or some combination thereof.
[0106] The terms “left,” “right,” “front,” “back,” “top,” “bottom,” “upper,” “lower,” “high,” “lower,” etc., used in the specification and claims, if present, are for descriptive purposes and are not necessarily used to describe unchanging relative positions. It should be understood that such terms are interchangeable where appropriate, so that embodiments of this disclosure described herein can, for example, operate on orientations different from those shown or otherwise described herein.
[0107] As used herein, the term “exemplary” means “serving as an example, instance, or illustration” and not as a “model” to be precisely copied. Any implementation described herein by example is not necessarily to be construed as preferred or advantageous over other implementations. Moreover, this disclosure is not limited to any theory expressed or implied as given in the field of art, background art, summary of invention, or detailed description.
[0108] As used herein, the term "substantially" means any minor variation resulting from design or manufacturing defects, device or component tolerances, environmental influences, and / or other factors. The term "substantially" also allows for differences from the perfect or ideal situation due to parasitic effects, noise, and other practical considerations that may exist in the actual implementation.
[0109] Furthermore, terms such as “first,” “second,” etc., may be used in this document for reference purposes only and are not intended to be limiting. For example, unless the context clearly indicates otherwise, the words “first,” “second,” and other such numerical terms relating to structures or elements do not imply order or sequence.
[0110] It should also be understood that when the term “including / contains” is used herein, it indicates the presence of the indicated feature, whole, step, operation, unit and / or component, but does not preclude the presence or addition of one or more other features, wholes, steps, operations, units and / or components and / or combinations thereof.
[0111] In this disclosure, the term “provide” is used broadly to cover all ways of obtaining an object, and therefore “provide an object” includes, but is not limited to, “purchasing,” “preparing / manufacturing,” “arranging / setting up,” “installing / assembling,” and / or “ordering” an object.
[0112] As used herein, the term “and / or” includes any and all combinations of one or more of the listed items in association. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of this disclosure. As used herein, the singular forms “a,” “an,” and “the” are also intended to include the plural forms unless the context clearly indicates otherwise.
[0113] Those skilled in the art will recognize that the boundaries between the above operations are merely illustrative. Multiple operations may be combined into a single operation, a single operation may be distributed among additional operations, and operations may be performed with at least partial overlap in time. Moreover, alternative embodiments may include multiple instances of a particular operation, and the order of operations may be changed in various other embodiments. However, other modifications, variations, and substitutions are equally possible. Aspects and elements of all the embodiments disclosed above may be combined in any way and / or in combination with aspects or elements of other embodiments to provide multiple additional embodiments. Therefore, this specification and the accompanying drawings should be considered illustrative rather than restrictive.
[0114] While specific embodiments of this disclosure have been described in detail by way of example, those skilled in the art should understand that the examples are for illustrative purposes only and not intended to limit the scope of this disclosure. The various embodiments disclosed herein can be combined in any way without departing from the spirit and scope of this disclosure. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of this disclosure. The scope of this disclosure is defined by the appended claims.
Claims
1. A dialogue processing method, comprising: Retrieve historical conversations; Based on preset memory categories, content belonging to the memory categories is extracted from the historical dialogues to generate a first memory summary of the historical dialogues; as well as The first memory summary is stored in the memory bank.
2. The dialogue processing method according to claim 1 further includes: Get the current conversation; Read the second memory summary associated with the current conversation from the memory bank; as well as A response dialogue is generated based on the second memory summary for the current dialogue.
3. The dialogue processing method according to claim 1, wherein, Extracting content belonging to a preset memory category from the historical dialogue to generate a first memory summary of the historical dialogue, based on a preset memory category, includes: generating a first prompt message in response to acquiring the historical dialogue; and generating the first memory summary based on the first prompt message and a pre-trained memory retrieval model, wherein the first prompt message indicates that content belonging to the memory category in the historical dialogue should be extracted; and / or Storing the first memory summary in the memory bank includes: merging the first memory summary with a third memory summary belonging to the memory category in the memory bank to generate a fourth memory summary, and storing the fourth memory summary in the memory bank.
4. The dialogue processing method according to claim 3, wherein, Merging the first memory summary with the third memory summary belonging to the memory category in the memory bank to generate the fourth memory summary includes: In response to the generation of the first memory summary, a second prompt message is generated, wherein the second prompt message indicates that the first memory summary be merged with a third memory summary belonging to the memory category in the memory bank; and The fourth memory summary is generated based on the second prompt information and the pre-trained memory merging model.
5. The dialogue processing method according to claim 2, wherein, Retrieving a second memory summary associated with the current dialogue from the memory bank includes: generating a third prompt in response to acquiring the current dialogue; and retrieving the second memory summary from the memory bank based on the third prompt and a pre-trained memory retrieval model, wherein the third prompt indicates retrieving the second memory summary associated with the current dialogue from the memory bank; and / or Retrieving a second memory summary associated with the current dialogue from the memory bank includes at least one of the following: retrieving a second memory summary from the memory bank that matches the topic of the current dialogue; retrieving a second memory summary from the memory bank that meets the semantic requirements of the current dialogue; retrieving a second memory summary from the memory bank that is associated with word segmentation in the current dialogue; and / or Generating a response dialogue for the current dialogue based on the second memory summary includes: generating the response dialogue based on the second memory summary, the current dialogue, and a pre-trained dialogue model; and / or The dialogue processing method further includes: generating an initial dialogue based on the historical dialogues before acquiring the current dialogue, wherein the current dialogue is a response to the initial dialogue.
6. The dialogue processing method according to claim 5, further comprising: Before generating the response dialogue based on the second memory summary, the current dialogue, and the pre-trained dialogue model, a training sample set is obtained, wherein the training samples include dialogue data and corresponding memory summary labels; and The dialogue model is trained using a supervised fine-tuning method based on the training sample set.
7. A dialogue processing apparatus, comprising: The acquisition module is configured to acquire historical conversations. The extraction module is configured to extract content belonging to a preset memory category from the historical dialogue to generate a first memory summary of the historical dialogue. as well as The storage module is configured to store the first memory summary in a memory bank.
8. A dialogue processing device, comprising a memory and a processor, wherein the memory stores instructions that, when executed by the processor, perform the dialogue processing method according to any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium, wherein, The non-transitory computer-readable storage medium stores instructions that, when executed by a processor, perform the dialogue processing method according to any one of claims 1 to 6.
10. A computer program product, wherein, The computer program product includes instructions that, when executed, perform the dialogue processing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Dialogue data processing method and device, electronic equipment and readable storage medium
CN117473066A
Content interaction method and device and computer readable storage medium
CN117560338A
Man-machine conversation method and device, electronic equipment and storage medium
CN119066157A
Memory active recall method and device based on decision center and related medium
CN119669452A
Personalized memory auxiliary interaction method based on mental cognition mechanism
CN119848217A