Dialogue processing method and device based on large model, dialogue method and device and electronic equipment

By acquiring and associating memory contents and categories in stored dialogue records, it solves the problem of large models lacking memory capabilities in dialogues, and improves the efficiency of dialogue generation and reduces the amount of calculations.

CN118708688APending Publication Date: 2024-09-27BEIJING BAIDU NETCOM SCI & TECH CO LTD

Patent Information

Application Number
CN202410804803.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

Large models lack memory capabilities when talking to users, resulting in large calculations and low efficiency. Existing technologies introduce too much context by splicing historical conversations as memory references.

Method used

By obtaining dialogue records, the memory content and content category of the dialogue subject are determined, and associated storage is performed to form memory data, which can be used for dialogue generation, extract effective information, and reduce the amount of calculation.

Benefits of technology

Effectively extract information from conversation records, avoid introducing too much context when generating conversations, and improve computing efficiency and user interaction efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118708688A
    Figure CN118708688A
Patent Text Reader

Abstract

The invention provides a dialogue processing method and device based on a large model, a dialogue method and device and electronic equipment, relates to the technical field of artificial intelligence, in particular to the fields of natural language processing, the large model, deep learning and the like, and can be applied to scenes such as intelligent customer service, vehicle-mounted interaction and agents. According to the specific implementation scheme, at least one round of dialogue record in a target dialogue scene is obtained; based on the at least one round of dialogue record, determining memory content corresponding to any dialogue subject and a content category of the memory content; the target dialogue scene, the memory content corresponding to each dialogue body and the content category of the memory content are stored in an associated mode to obtain memory data, and the memory data are used for dialogue generation in the target dialogue scene. The memory content and the content category thereof are determined based on the dialogue record, effective information in the dialogue record is extracted, excessive context is prevented from being introduced during dialogue generation, and the calculation amount is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, specifically to the fields of natural language processing, big models, deep learning, etc., and can be applied to scenarios such as intelligent customer service, in-vehicle interaction, and intelligent agents, and in particular to a dialogue processing method, dialogue method, device, and electronic device based on a big model. Background Art

[0002] Understanding, generation, logic, and memory are the four important pieces of the big model's capabilities. Memory is an essential function for the big model to be intelligent. Currently, the big model itself does not have memory capabilities. In related technologies, when the big model is talking to a user, it usually splices the historical conversations between the user and the big model in chronological order, and uses this as the historical information of the current conversation, which is then input into the big model as a memory reference, and then a reply is generated in combination with the memory reference. This method introduces too much context and requires a lot of calculations. Summary of the invention

[0003] The present disclosure provides a dialogue processing method, a dialogue method, a device and an electronic device based on a large model.

[0004] According to a first aspect of the present disclosure, a dialog processing method based on a large model is provided, comprising:

[0005] Obtain at least one round of dialogue records in the target dialogue scenario;

[0006] Based on at least one round of the conversation record, determining the memory content corresponding to any conversation subject and the content category of the memory content;

[0007] The target dialogue scenario, the memory content corresponding to each dialogue subject, and the content category of the memory content are associated and stored to obtain memory data, wherein the memory data is used for dialogue generation in the target dialogue scenario.

[0008] According to a second aspect of the present disclosure, a large model-based dialogue method is provided, comprising:

[0009] Get the questions in the target dialogue scenario;

[0010] Based on the target dialogue scenario and the question, determining the memory content and content category corresponding to each dialogue subject associated with the question from the memory data;

[0011] A response to the question is generated based on the content category and the corresponding memory content.

[0012] According to a third aspect of the present disclosure, a large model-based dialog processing device is provided, comprising:

[0013] A record acquisition module, used to acquire at least one round of dialogue records in a target dialogue scenario;

[0014] A first determination module, configured to determine the memory content corresponding to any conversation subject and the content category of the memory content based on at least one round of the conversation record;

[0015] The first storage module is used to associate and store the target dialogue scene, the memory content corresponding to each dialogue subject, and the content category of the memory content to obtain memory data, wherein the memory data is used for dialogue generation in the target dialogue scene.

[0016] According to a fourth aspect of the present disclosure, a large model-based dialogue device is provided, comprising:

[0017] The question acquisition module is used to obtain questions in the target dialogue scenario;

[0018] A first determination module is used to determine, based on the target dialogue scenario and the question, from the memory data the memory content and content category corresponding to each dialogue subject associated with the question;

[0019] The first reply module is used to generate a reply to the question according to the content category and the corresponding memory content.

[0020] According to a fifth aspect of the present disclosure, there is provided an electronic device, including:

[0021] at least one processor; and

[0022] a memory communicatively connected to the at least one processor; wherein,

[0023] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the large model-based dialogue processing method described in the first aspect or the large model-based dialogue method described in the second aspect.

[0024] According to the sixth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the large model-based dialogue processing method as described in the first aspect or the large model-based dialogue method as described in the second aspect.

[0025] According to a seventh aspect of the present disclosure, a computer program product is provided, comprising computer instructions, which, when executed by a processor, implement the steps of the large model-based dialogue processing method described in the first aspect or the large model-based dialogue method described in the second aspect.

[0026] The present disclosure provides a large model-based dialogue processing method, dialogue method, device and electronic device, which have the following beneficial effects:

[0027] At least one round of dialogue records in the target dialogue scenario is obtained; based on at least one round of dialogue records, the memory content corresponding to any dialogue subject and the content category of the memory content are determined; the target dialogue scenario, the memory content corresponding to each dialogue subject and the content category of the memory content are associated and stored to obtain memory data, wherein the memory data is used for dialogue generation in the target dialogue scenario. The present disclosure determines the memory content and its content category based on the dialogue record, extracts the effective information in the dialogue record, avoids introducing too much context when generating the dialogue, and reduces the amount of calculation.

[0028] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0030] Figure 1 It is a flowchart of a conversation processing method based on a large model provided according to an embodiment of the present disclosure;

[0031] Figure 2 is a flowchart of a conversation processing method based on a large model provided according to another embodiment of the present disclosure;

[0032] Figure 3 is a flowchart of a large model-based dialogue method provided according to an embodiment of the present disclosure;

[0033] Figure 4 is a flowchart of a large model-based dialogue method provided according to another embodiment of the present disclosure;

[0034] Figure 5 A schematic diagram of the structure of a dialog processing device based on a large model provided according to an embodiment of the present disclosure;

[0035] Figure 6 A schematic diagram of the structure of a dialogue device based on a large model according to an embodiment of the present disclosure;

[0036] Figure 7 It is a block diagram of an electronic device used to implement the big model-based dialogue processing method or the big model-based dialogue method of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0037] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0038] The following describes a large model-based dialog processing method, a dialog method, an apparatus, and an electronic device according to an embodiment of the present disclosure with reference to the accompanying drawings.

[0039] It should be noted that the execution subject of the big model-based dialogue processing method of this embodiment is a big model-based dialogue processing device, and the execution subject of the big model-based dialogue method of this embodiment is a big model-based dialogue device. The big model-based dialogue processing device and the big model-based dialogue device can be implemented by software and / or hardware and can be configured in an electronic device.

[0040] Figure 1 It is a flowchart of a dialogue processing method based on a large model provided according to an embodiment of the present disclosure.

[0041] like Figure 1 As shown, the dialogue processing method based on the large model includes:

[0042] Step 101, obtaining at least one round of dialogue records in a target dialogue scenario.

[0043] The target dialogue scene may refer to any scene in which a person or a computer conducts a dialogue interaction. As an example and not a limitation, the target dialogue scene may refer to any dialogue scene such as a copywriting scene, a food recommendation scene, and a small talk scene.

[0044] The at least one round of conversation record may refer to at least one round of real-time conversation record obtained online, or may refer to at least one round of historical conversation record obtained offline.

[0045] The conversation record may include the conversation subject and the conversation content. As an example but not limitation, the conversation record may be "User: How is the weather today? Large model: It is sunny today, the lowest temperature is 23°C, and the highest temperature is 33°C." It should be noted that the conversation record may include text, images, audio and other information.

[0046] Step 102, based on at least one round of conversation records, determining the memory content and content category of the memory content corresponding to any conversation subject.

[0047] The target dialogue scenario corresponds to at least two dialogue subjects, such as a user and at least one large model, or a user and at least one agent model.

[0048] When the conversation subject is a user, the memory content can be understood as the user's interests, behavior habits, conversation style, etc. When the conversation subject is a large model or an intelligent agent model, the memory content can be understood as the user's specific requirements for the large model or the intelligent agent model.

[0049] The content category of the memory content can be understood as a classification label obtained by classifying the memory content. As an example but not limitation, if the memory content is "I like playing basketball", its content category is sports hobbies; if the memory content is "I am a programmer", its content category is occupation.

[0050] In an optional embodiment, at least one round of conversation records may be analyzed to extract effective information therein, that is, memory content and its content category associated with any conversation subject.

[0051] It should be noted that the memory content can be text, images, audio and other information.

[0052] Step 103, the target dialogue scene, the memory content corresponding to each dialogue subject, and the content category of the memory content are associated and stored to obtain memory data, wherein the memory data is used for dialogue generation in the target dialogue scene.

[0053] Since the memory content can be information such as text, images, audio, etc., the present disclosure needs to support cross-modal storage to integrate multimodal information.

[0054] In an optional embodiment, when performing associated storage, the memory data may be stored separately according to the acquisition method of at least one round of conversation records. As an example but not a limitation, if at least one round of conversation records is at least one round of real-time conversation records acquired online, the corresponding memory data may be stored as online memory data; if at least one round of conversation records is at least one round of historical conversation records acquired offline, the corresponding memory data may be stored as offline memory data.

[0055] The online memory data and the offline memory data can be stored in the same database or in different databases.

[0056] In an optional embodiment, when performing associated storage, the memory data may be stored separately according to the dialogue subject corresponding to the memory content. As an example but not a limitation, if the dialogue subject corresponding to the memory content is a user, the corresponding memory data may be stored as user memory data; if the dialogue subject corresponding to the memory content is a reply subject, such as a large model or an intelligent model, the corresponding memory data may be stored as reply subject memory data, such as large model memory data or intelligent model memory data.

[0057] The memory data corresponding to each dialogue subject can be stored in the same database or in different databases.

[0058] In an optional embodiment, a structured or unstructured storage method may be used to associate and store the target dialogue scene, the memory content corresponding to each dialogue subject, and the content category of the memory content.

[0059] In an optional embodiment, the target dialogue scene, the memory content corresponding to each dialogue subject, and the content category of the memory content may be vectorized and then stored in association.

[0060] In an embodiment of the present disclosure, at least one round of dialogue records in a target dialogue scenario is obtained; based on at least one round of dialogue records, the memory content corresponding to any dialogue subject and the content category of the memory content are determined; the target dialogue scenario, the memory content corresponding to each dialogue subject and the content category of the memory content are associated and stored to obtain memory data, wherein the memory data is used for dialogue generation in the target dialogue scenario. The present disclosure determines the memory content and its content category based on the dialogue record, extracts the effective information in the dialogue record, avoids introducing too much context when generating the dialogue, and reduces the amount of calculation.

[0061] Figure 2 It is a flowchart of a large model-based dialogue processing method provided according to another embodiment of the present disclosure.

[0062] like Figure 2 As shown, the dialogue processing method based on the large model includes:

[0063] Step 201, obtaining at least one round of dialogue records in a target dialogue scenario.

[0064] For the relevant contents in step 201, please refer to the relevant description in step 101, which will not be repeated here.

[0065] Step 202, for any round of dialogue records obtained online, obtain the dialogue subjects participating in the dialogue; call the memory content extraction model to extract the memory content corresponding to each dialogue subject from any round of dialogue records, and classify and determine the content category of the memory content.

[0066] The conversation record includes the conversation subject and the conversation content. Therefore, the content of the set position can be directly extracted from any round of conversation record to obtain the conversation subject participating in the conversation.

[0067] In an optional embodiment, any round of conversation records can be used as input to the memory content extraction model. The memory content extraction model is used to extract the memory content corresponding to each conversation subject from the conversation record, and the memory content is classified to obtain the content category of the memory content.

[0068] The memory content obtained in this step is relatively simple, and is shallow information extracted directly from the conversation record. As an example and not a limitation, assume that the user's question in the conversation record is "I like to eat spicy hot pot, please recommend a nearby restaurant to me, and your reply cannot exceed 50 words each time", then the memory content extracted by the memory content extraction model includes the user's memory content "I like to eat spicy hot pot", and the memory content of the large model or intelligent model includes "Your reply cannot exceed 50 words each time".

[0069] Extracting shallow memory content from any round of conversation records can, on the one hand, extract meaningful information from any round of conversation records and avoid useless conversation records taking up storage space; on the other hand, it helps large models or intelligent models to quickly understand the context of the conversation, quickly capture user intentions, reduce misunderstandings and redundant communication, and improve the efficiency of human-computer interaction.

[0070] Step 202 can be understood as a step of extracting memory content based on the online real-time conversation record.

[0071] Step 203, when multiple rounds of dialogue have been performed in the target dialogue scenario, the dialogue records of the multiple rounds of dialogue are obtained; the memory content extraction model is called to extract the memory content corresponding to each dialogue subject based on the dialogue records of the multiple rounds of dialogue, and the content category of the memory content is determined by classification.

[0072] Optionally, the conversation records of multiple rounds of conversations in the target conversation scenario can be obtained regularly from the conversation record library, wherein the conversation record library is used to store the conversation records of each user in each conversation scenario.

[0073] In an optional embodiment, the conversation records of multiple rounds of conversations can be used as input to a memory content extraction model. The memory content extraction model is used to extract the memory content corresponding to each conversation subject from the conversation records of multiple rounds of conversations, and the memory content is classified to obtain the content category of the memory content.

[0074] Extracting memory content based on conversation records of multiple rounds of conversations can be understood as extracting high-dimensional information based on conversation records of multiple rounds of conversations, making inferences and summarizing, and finding out the patterns and implicit information therein.

[0075] By mining deep patterns and implicit information, large models or intelligent models can better understand user preferences, emotions, and needs, thereby generating more personalized responses and improving user experience.

[0076] As an example but not limitation, assuming that the user often uses emoticons during a conversation, the user's memory content extracted based on the conversation records of multiple rounds of conversations may be "the user likes to use emoticons"; assuming that multiple rounds of conversations are all asking about college entrance examination applications, the user's memory content extracted based on the conversation records of multiple rounds of conversations may be "the user may be a high school student."

[0077] When extracting memory content, the memory content extraction model in step 202 and step 203 can extract memory content based on word slots, or extract memory content based on grammatical rules, or extract memory content based on large model summary.

[0078] The model structures and parameters of the memory content extraction models in step 202 and step 203 may be the same or different.

[0079] Step 203 can be understood as a step of extracting memory content based on offline historical conversation records. It should be noted that step 202 and step 203 can be two independent steps.

[0080] Step 204 , the target dialogue scene, the memory content corresponding to each dialogue subject, and the content category of the memory content are associated and stored to obtain memory data.

[0081] For the relevant contents in step 204, reference may be made to the relevant description in step 103, which will not be repeated here.

[0082] The reference value of the conversation subject's memory content is not static, and the memory content may lose its original reference value over time.

[0083] In an optional embodiment, the method further includes: for the memory content corresponding to each dialogue subject, counting the number of occurrences of the memory content within a set time period; and determining the memory duration of the memory content based on the number of occurrences.

[0084] The set period may refer to a set historical period, such as the past ten days.

[0085] There is a positive correlation between the number of occurrences and the length of memory. The more times an item appears, the longer it is remembered. Conversely, the fewer times it appears, the shorter it is remembered.

[0086] Memory duration can be used to indicate the reference value of the memory content, and the importance of the memory content can be clarified based on the memory duration.

[0087] In an optional embodiment, the method further includes: for the memory content corresponding to each dialogue subject, in response to the storage duration of the memory content being equal to the corresponding memory duration, deleting the memory data corresponding to the memory content.

[0088] Forgetting memory content based on memory duration can, on the one hand, retain relatively important memory content with reference value, and on the other hand, free up storage space for new memory content.

[0089] In an optional embodiment, the dialogue subject includes a reply subject, and the reply subject is set as a target role. The method also includes: obtaining a preset question and answer pair associated with the target role, the preset question and answer pair including a reference question and reply reference information of the reference question; and associating and storing the reference question, the reply reference information of the reference question and the target role to obtain memory data.

[0090] The answer subject refers to a large model or an intelligent agent model. The user can assign roles to the answer subject. For example, the answer subject can be set as a poet, a painter, or a character with a certain personality trait.

[0091] Assuming that the answer subject is set to the poet role, specifically poet A, multiple question-answer pairs preset based on the relevant character information of poet A can be obtained; the reference questions and reply reference information in the question-answer pairs are associated with poet A and stored.

[0092] As an example and not limitation, a question-answer pair may be “Question: What is your name? Answer: My name is A.”

[0093] By presetting question and answer pairs, the role of the respondent can be set efficiently and at low cost, so that the respondent can make personalized responses based on the set role.

[0094] In the embodiment of the present disclosure, at least one round of dialogue records in the target dialogue scenario is obtained; for any round of dialogue records obtained online, the dialogue subjects participating in the dialogue are obtained; the memory content extraction model is called to extract the memory content corresponding to each dialogue subject from any round of dialogue records, and the content category of the memory content is determined by classification; in the case where multiple rounds of dialogue have been performed in the target dialogue scenario, the dialogue records of multiple rounds of dialogue are obtained; the memory content extraction model is called, and based on the dialogue records of multiple rounds of dialogue, the memory content corresponding to each dialogue subject is extracted, and the content category of the memory content is determined by classification; the target dialogue scenario, the memory content corresponding to each dialogue subject, and the content category of the memory content are associated and stored to obtain memory data. The present disclosure extracts shallow information in the dialogue record and deep rules and implicit information in the dialogue record respectively to form memory data, which helps large models or intelligent models to quickly understand the context of the dialogue, quickly capture user intentions, and generate more personalized responses.

[0095] Figure 3 It is a flowchart of a large model-based dialogue method provided according to an embodiment of the present disclosure.

[0096] like Figure 3 As shown, the large model-based dialogue method includes:

[0097] Step 301, obtaining questions in a target dialogue scenario.

[0098] The question in the target dialogue scenario may refer to the question input by the user through the client.

[0099] Step 302, based on the target dialogue scene and question, determine the memory content and content category corresponding to each dialogue subject associated with the question from the memory data.

[0100] Memory data may refer to online memory data and offline memory data, or may refer to user memory data and reply subject memory data.

[0101] In an optional embodiment, the memory content and its content categories corresponding to each dialogue subject corresponding to the target dialogue scene can be searched based on the association between the dialogue scene, memory content and its content categories; and then the memory content and its content categories corresponding to each dialogue subject associated with the question can be searched based on the similarity between the question and the memory content and content categories.

[0102] Step 303, generating a response to the question based on the content category and the corresponding memory content.

[0103] In an optional embodiment, the content category and the corresponding memory content may be used as prompt information so that the answering subject, that is, the large model or the intelligent agent model, generates a reply to the question in combination with the prompt information.

[0104] In the embodiment of the present disclosure, the question in the target dialogue scenario is obtained; based on the target dialogue scenario and the question, the memory content and content category corresponding to each dialogue subject associated with the question are determined from the memory data; and the answer to the question is generated according to the content category and the corresponding memory content. The memory data is refined data. Compared with the solution of splicing historical dialogues, the present disclosure does not introduce too much context, has a small amount of calculation, and does not cause too much delay increase to the original dialogue link.

[0105] Figure 4 It is a flowchart of a large model-based dialogue method provided according to another embodiment of the present disclosure.

[0106] like Figure 4 As shown, the large model-based dialogue method includes:

[0107] Step 401, obtaining questions in the target dialogue scenario.

[0108] The target dialogue scenario can be determined by combining historical dialogue records associated with the question.

[0109] The relevant contents in step 401 can refer to the relevant description in step 301, which will not be repeated here.

[0110] Step 402, calling the content category prediction model, based on the target dialogue scene and question, predicts the content category of the memory content corresponding to each dialogue subject associated with the question; based on the content category, searches the memory content corresponding to each dialogue subject associated with the question from the memory data.

[0111] The target dialogue scene and question can be used as inputs of the content category prediction model, and the content category prediction model is used to predict the content category of the memory content corresponding to each dialogue subject associated with the question.

[0112] There is an association relationship between memory content and content category. Based on the association relationship, the memory content corresponding to each dialogue subject associated with the question can be found.

[0113] As an example but not limitation, assuming that the target conversation scenario is a casual chat scenario, the content category corresponding to the user predicted by the content category prediction model may be "conversation style", and the content category corresponding to the user may be "number of reply words"; the memory content corresponding to the user found based on "conversation style" may be "the user likes to use emoticons", and the memory content corresponding to the reply subject found based on "number of reply words" may be "each reply cannot exceed 50 words".

[0114] Step 402 is the process of recalling memory content through association. The memory content recalled in this step is mostly personalized memory content.

[0115] In the process of associating memory content, the content category prediction model can determine the content category of the memory content required for the problem based on the association mechanism. Content category helps to efficiently locate the content related to the current problem from a large amount of memory content, thereby improving the accuracy and efficiency of memory recall.

[0116] Step 403, determine the similarity between the question and each memory content; based on the similarity, search for memory content that matches the question.

[0117] Determining the similarity between the question and each memory content includes: obtaining a first vector corresponding to the question; obtaining a second vector corresponding to each memory content; and calculating the similarity between the first vector and each second vector.

[0118] Based on the similarity, memory content matching the question is searched, including: memory content with a similarity greater than a set similarity threshold can be determined as memory content matching the question.

[0119] Step 403 is the process of recalling memory content through vector retrieval. The memory content recalled in this step is relatively basic memory content related to the question, which is used to enable the respondent to correctly understand the intention of the question and give a correct reply.

[0120] The memory content recalled in step 402 and the memory content recalled in step 403 complement each other.

[0121] Step 404, generating a response to the question based on the memory content corresponding to the content category and the memory content matching the question.

[0122] Combining the memory content corresponding to the content category with the memory content that matches the question can not only enable the respondent to correctly understand the intention of the question and give a correct response, but also combine personalized memory content to make a personalized response.

[0123] In an optional embodiment, a response to a question is generated based on memory content corresponding to the content category and memory content matching the question, including: generating prompt information based on memory content corresponding to the content category and memory content matching the question; and invoking a dialogue model based on the prompt information to generate a response to the question.

[0124] The memory content corresponding to the content category and the memory content matching the question can be spliced ​​together to obtain prompt information.

[0125] The dialogue model is one of the dialogue subjects participating in the dialogue, that is, the reply subject. As an example and not limitation, the dialogue model can refer to a large model or an intelligent agent model.

[0126] The prompt information generated based on the memory content corresponding to the content category and the memory content matching the question can serve as supplementary information to help the dialogue model correctly understand the intention of the question and provide personalized responses.

[0127] In an optional embodiment, the question is asked to a responding subject set as a target role, and the method also includes: determining a reference question associated with the target role from memory data, the reference question corresponding to reply reference information; determining the similarity between the question and the reference question of the target role; based on the similarity, determining a target reference question that matches the question; and generating a reply to the question based on the reply reference information corresponding to the target reference question.

[0128] When the reply subject is set with a role, the target reference question matching the question is first determined, and then the reply reference information corresponding to the target reference question is combined to generate a reply to the question. This process does not involve complex calculations and has a small amount of calculation. It can enable the reply subject to quickly match the reply reference information related to the question based on the set role, thereby improving the efficiency of generating the reply to the question.

[0129] In the disclosed embodiment, the content category prediction model is called to predict the content category of the memory content corresponding to each dialogue subject associated with the question based on the target dialogue scene and the question; based on the content category, the memory content corresponding to each dialogue subject associated with the question is searched from the memory data; the similarity between the question and each memory content is determined; based on the similarity, the memory content matching the question is searched; and the answer to the question is generated based on the memory content corresponding to the content category and the memory content matching the question. The disclosed embodiment uses two methods to recall the memory content, combining the memory content corresponding to the recalled content category and the memory content matching the question, so that the answering subject can correctly understand the intention of the question and give a correct answer, and can also combine personalized memory content for personalized answers.

[0130] Figure 5 It is a structural diagram of a dialogue processing device based on a large model provided according to an embodiment of the present disclosure.

[0131] like Figure 5 As shown, the dialogue processing device based on the large model includes:

[0132] A record acquisition module 501 is used to acquire at least one round of conversation records in a target conversation scenario;

[0133] A first determination module 502, configured to determine the memory content and the content category of the memory content corresponding to any conversation subject based on at least one round of conversation records;

[0134] The first storage module 503 is used to associate and store the target dialogue scene, the memory content corresponding to each dialogue subject, and the content category of the memory content to obtain memory data, wherein the memory data is used for dialogue generation in the target dialogue scene.

[0135] Optionally, the first determining module 502 is configured to:

[0136] For any round of conversation records obtained online, obtain the conversation subjects participating in the conversation;

[0137] The memory content extraction model is called to extract the memory content corresponding to each dialogue subject from any round of dialogue records, and classify and determine the content category of the memory content.

[0138] Optionally, the first determining module 502 is configured to:

[0139] When multiple rounds of dialogue have been performed in the target dialogue scenario, obtaining dialogue records of the multiple rounds of dialogue;

[0140] The memory content extraction model is called to extract the memory content corresponding to each dialogue subject based on the conversation records of multiple rounds of conversations, and classify and determine the content category of the memory content.

[0141] Optionally, the device further comprises:

[0142] A statistics module is used to count the number of occurrences of the memory content corresponding to each conversation subject within a set time period;

[0143] The second determination module is used to determine the memory duration of the memory content based on the number of occurrences.

[0144] Optionally, the device further comprises:

[0145] The deletion module is used to delete the memory data corresponding to the memory content corresponding to each dialogue subject in response to the storage duration of the memory content being equal to the corresponding memory duration.

[0146] Optionally, the dialogue subject includes a reply subject, the reply subject is set as the target role, and the device further includes:

[0147] A question-answer pair acquisition module is used to acquire a preset question-answer pair associated with a target role, wherein the preset question-answer pair includes a reference question and reference information of a response to the reference question;

[0148] The second storage module is used to associate and store the reference question, the reference information of the answer to the reference question and the target role to obtain memory data.

[0149] It should be noted that the aforementioned explanation of the large model-based dialogue processing method is also applicable to the large model-based dialogue processing device of this embodiment, and will not be repeated here.

[0150] Figure 6 It is a structural diagram of a dialogue device based on a large model provided according to an embodiment of the present disclosure.

[0151] like Figure 6 As shown, the large model-based dialogue device includes:

[0152] A question acquisition module 601 is used to acquire questions in a target dialogue scenario;

[0153] A first determination module 602 is used to determine the memory content and content category corresponding to each dialogue subject associated with the question from the memory data based on the target dialogue scene and the question;

[0154] The first reply module 603 is used to generate a reply to the question according to the content category and the corresponding memory content.

[0155] Optionally, the first determining module 602 is configured to:

[0156] Calling the content category prediction model to predict the content category of the memory content corresponding to each dialogue subject associated with the question based on the target dialogue scene and question;

[0157] Based on the content category, the memory content corresponding to each dialogue subject associated with the question is searched from the memory data.

[0158] Optionally, the first reply module 603 is used to:

[0159] Determine the similarity between the question and each memory content;

[0160] Based on the similarity, find the memory content that matches the question;

[0161] Generate responses to questions based on the memory content corresponding to the content category and the memory content that matches the question.

[0162] Optionally, the first reply module 603 is used to:

[0163] Generate prompt information based on the memory content corresponding to the content category and the memory content matching the question;

[0164] Based on the prompt information, the dialogue model is called to generate a response to the question.

[0165] Optionally, the question is asked to a responding subject set as a target role, and the device further includes:

[0166] A second determination module is used to determine a reference question associated with the target role from the memory data, the reference question corresponding to the reference information for reply;

[0167] A third determination module is used to determine the similarity between the question and the reference question of the target role;

[0168] A fourth determination module is used to determine a target reference question that matches the question based on the similarity;

[0169] The second reply module is used to generate a reply to the question based on the reply reference information corresponding to the target reference question.

[0170] It should be noted that the aforementioned explanation of the dialogue method based on the large model is also applicable to the dialogue device based on the large model of this embodiment, and will not be repeated here.

[0171] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0172] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement an embodiment of the present disclosure is shown. The electronic device 700 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0173] like Figure 7 As shown, the electronic device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 702 or a computer program loaded from a storage unit 708 to a RAM (Random Access Memory) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An I / O (Input / Output) interface 705 is also connected to the bus 704.

[0174] Multiple components in the electronic device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the electronic device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0175] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a CPU (Central Processing Unit), a GPU (Graphic Processing Units), various dedicated AI (Artificial Intelligence) computing chips, various computing units that run machine learning model algorithms, a DSP (Digital Signal Processor), and any appropriate processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as a large model-based dialogue processing method or a large model-based dialogue method. For example, in some embodiments, a large model-based dialogue processing method or a large model-based dialogue method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the large model-based dialogue processing method or the large model-based dialogue method described above may be executed. Alternatively, in other embodiments, the computing unit 701 may be configured to execute the large model-based dialogue processing method or the large model-based dialogue method in any other appropriate manner (e.g., by means of firmware).

[0176] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application Specific Standard Products), SOCs (System On Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor that may be a dedicated or general-purpose programmable processor that may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0177] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0178] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, RAM, ROM, EPROM (Electrically Programmable Read-Only-Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0179] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0180] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.

[0181] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.

[0182] It should be noted that artificial intelligence is a discipline that studies how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), and includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.

[0183] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0184] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A conversation processing method based on a large model, comprising: Obtain at least one round of dialogue records in the target dialogue scenario; Based on at least one round of the conversation record, determining the memory content corresponding to any conversation subject and the content category of the memory content; The target dialogue scenario, the memory content corresponding to each dialogue subject, and the content category of the memory content are associated and stored to obtain memory data, wherein the memory data is used for dialogue generation in the target dialogue scenario.

2. The method according to claim 1, wherein: The determining, based on at least one round of the conversation record, the memory content corresponding to each conversation subject and the content category of the memory content includes: For any round of the conversation record obtained online, obtain the conversation subjects participating in the conversation; The memory content extraction model is called to extract the memory content corresponding to each dialogue subject from any round of the dialogue record, and classify and determine the content category of the memory content.

3. The method according to claim 1, wherein: The determining, based on at least one round of the conversation record, the memory content corresponding to each conversation subject and the content category of the memory content includes: If multiple rounds of dialogue have been performed in the target dialogue scenario, obtaining dialogue records of the multiple rounds of dialogue; The memory content extraction model is called to extract the memory content corresponding to each dialogue subject based on the dialogue records of the multiple rounds of dialogue, and the content category of the memory content is determined by classification.

4. The method according to any one of claims 1 to 3, wherein: The method further comprises: For each memory content corresponding to each conversation subject, count the number of occurrences of the memory content within a set time period; Based on the number of occurrences, the memory duration of the memory content is determined.

5. The method according to claim 4, wherein: The method further comprises: For the memory content corresponding to each dialogue subject, in response to the storage duration of the memory content being equal to the corresponding memory duration, the memory data corresponding to the memory content is deleted.

6. The method according to claim 1, wherein: The dialogue subject includes a reply subject, and the reply subject is set as a target role. The method further includes: Acquire a preset question-answer pair associated with the target role, wherein the preset question-answer pair includes a reference question and reference information of a response to the reference question; The reference question, the reference information for answering the reference question, and the target role are stored in association to obtain memory data.

7. A dialogue method based on a large model, comprising: Get the questions in the target dialogue scenario; Based on the target dialogue scenario and the question, determining the memory content and content category corresponding to each dialogue subject associated with the question from the memory data; A response to the question is generated based on the content category and the corresponding memory content.

8. The method according to claim 7, wherein: The step of determining, based on the target dialogue scenario and the question, the memory content and content category corresponding to each dialogue subject associated with the question from the memory data includes: Calling a content category prediction model to predict, based on the target dialogue scenario and the question, a content category of memory content corresponding to each dialogue subject associated with the question; Based on the content category, the memory content corresponding to each dialogue subject associated with the question is searched from the memory data.

9. The method according to claim 7, wherein: Generating a response to the question according to the content category and the corresponding memory content includes: determining the similarity between the question and each of the memory contents; Based on the similarity, searching for memory content matching the question; A response to the question is generated based on the memory content corresponding to the content category and the memory content matching the question.

10. The method according to claim 9, wherein: The step of generating a reply to the question according to the memory content corresponding to the content category and the memory content matching the question includes: Generate prompt information based on the memory content corresponding to the content category and the memory content matching the question; Based on the prompt information, the dialogue model is called to generate a response to the question.

11. The method according to any one of claims 7 to 10, wherein: The question is asked to a responding subject set as a target role, and the method further includes: Determining a reference question associated with the target role from the memory data, wherein the reference question corresponds to response reference information; determining a similarity between the question and a reference question of the target persona; Based on the similarity, determining a target reference question that matches the question; A reply to the question is generated based on the reply reference information corresponding to the target reference question.

12. A dialogue processing device based on a large model, comprising: A record acquisition module, used to acquire at least one round of conversation records in a target conversation scenario; A first determination module, configured to determine the memory content corresponding to any conversation subject and the content category of the memory content based on at least one round of the conversation record; The first storage module is used to associate and store the target dialogue scene, the memory content corresponding to each dialogue subject, and the content category of the memory content to obtain memory data, wherein the memory data is used for dialogue generation in the target dialogue scene.

13. The device according to claim 12, wherein: The first determining module is used to: For any round of the conversation record obtained online, obtain the conversation subjects participating in the conversation; The memory content extraction model is called to extract the memory content corresponding to each dialogue subject from any round of the dialogue record, and classify and determine the content category of the memory content.

14. The device according to claim 12, wherein: The first determining module is used to: If multiple rounds of dialogue have been performed in the target dialogue scenario, obtaining dialogue records of the multiple rounds of dialogue; The memory content extraction model is called to extract the memory content corresponding to each dialogue subject based on the dialogue records of the multiple rounds of dialogue, and the content category of the memory content is determined by classification.

15. The device according to any one of claims 12 to 14, wherein: The device also includes: A statistics module, for counting the number of occurrences of the memory content corresponding to each conversation subject within a set time period; The second determination module is used to determine the memory duration of the memory content based on the number of occurrences.

16. The device according to claim 15, wherein: The device also includes: The deletion module is used to delete the memory data corresponding to the memory content corresponding to each dialogue subject in response to the storage duration of the memory content being equal to the corresponding memory duration.

17. The device according to claim 12, wherein: The dialogue subject includes a reply subject, and the reply subject is set as a target role. The device also includes: A question-answer pair acquisition module, used to acquire a preset question-answer pair associated with the target role, wherein the preset question-answer pair includes a reference question and reference information of a response to the reference question; The second storage module is used to associate and store the reference question, the reference information of the answer to the reference question and the target role to obtain memory data.

18. A dialogue device based on a large model, comprising: The question acquisition module is used to obtain questions in the target dialogue scenario; A first determination module is used to determine, based on the target dialogue scenario and the question, from the memory data the memory content and content category corresponding to each dialogue subject associated with the question; The first reply module is used to generate a reply to the question according to the content category and the corresponding memory content.

19. The device according to claim 18, wherein: The first determining module is used to: Calling a content category prediction model to predict, based on the target dialogue scenario and the question, a content category of memory content corresponding to each dialogue subject associated with the question; Based on the content category, the memory content corresponding to each dialogue subject associated with the question is searched from the memory data.

20. The device according to claim 18, wherein The first reply module is used to: determining the similarity between the question and each of the memory contents; Based on the similarity, searching for memory content matching the question; A response to the question is generated based on the memory content corresponding to the content category and the memory content matching the question.

21. The device according to claim 20, wherein: The first reply module is used to: Generate prompt information based on the memory content corresponding to the content category and the memory content matching the question; Based on the prompt information, the dialogue model is called to generate a response to the question.

22. The device according to any one of claims 18 to 21, wherein: The question is asked to a responding subject set as a target role, and the device further includes: A second determination module is used to determine a reference question associated with the target role from the memory data, wherein the reference question corresponds to response reference information; A third determination module is used to determine the similarity between the question and the reference question of the target role; A fourth determination module, configured to determine a target reference question matching the question based on the similarity; The second reply module is used to generate a reply to the question based on the reply reference information corresponding to the target reference question.

23. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6 or 7-11.

24. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-6 or 7-11.

25. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1-6 or 7-11.

Citation Information

Patent Citations

  • Data processing method for chat and related device

    CN114003702A

  • Man-machine conversation generation method and device, electronic equipment and storage medium

    CN114969250A

  • Memory storage and memory extraction method based on artificial intelligence and related equipment

    CN117033556A

  • AI Agent long-time continuous service method based on external memory system

    CN117195955A

  • Structured abstract dialogue method and system for background information enhancement, electronic equipment and storage medium

    CN117453890A

Cited By

  • Universal memory management method and system based on language model

    CN119962574A

  • Chat content processing method based on multilevel classification and relevance memory

    CN120470126A

  • A Chat Content Processing Method Based on Multi-level Classification and Associative Memory

    CN120470126B

  • Memory management method, memory management device and computer storage medium

    CN121029932A

  • A memory management method, a memory management device, and a computer storage medium.

    CN121029932B