Memory enhancement reply method, device and electronic device for dialogue system
By extracting the user's compressed memory from the user's historical dialogue content and inputting it into the dialogue model to generate interactive reply content, it solves the problem of the human-computer dialogue system being unable to perceive the user's long-term memory, and realizes the richness and active interaction of dialogue services.
Patent Information
- Application Number
- CN202410170236.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-06
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-02-06
AI Technical Summary
Existing human-computer dialogue systems are unable to perceive users' long-term memory information, resulting in limited dialogue service scenarios and a lack of effective solutions.
By extracting the user's compressed memory based on the user's historical conversation content, including user description, relationship description and event description, and inputting it into the pre-trained compressed memory conversation model, interactive reply content is generated to ensure that the reply content covers the user's long-term memory perception information.
It realizes that the dialogue system can actively interact, completes the user's active dialogue memory experience, overcomes the problems of low accuracy of traditional memory retrieval and high memory storage cost, and provides richer dialogue services.
Smart Images

Figure CN118153687B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a memory enhancement reply method, device and electronic equipment for a dialogue system. Background Art
[0002] With the continuous development and popularization of artificial intelligence technology, human-computer intelligent dialogue systems have been applied in various business scenarios.
[0003] From relevant technologies, it is known that current human-computer dialogue systems are often unable to perceive user portrait information on the user side, that is, the interactive response content cannot reflect the user's long-term memory perception information, which leads to limited dialogue service scenarios of the system.
[0004] The industry has not yet proposed a corresponding solution to the above problems. Summary of the invention
[0005] The present invention provides a memory enhancement reply method, device and electronic device for a dialogue system, which realizes that the obtained interactive reply content covers the user's relevant long-term memory perception information, overcomes the problem that the existing interactive reply content cannot reflect the user's long-term memory perception information, thereby limiting the dialogue service scenarios of the system.
[0006] The present invention provides a memory enhancement reply method for a dialogue system, which is applied to a dialogue system, wherein the dialogue system conducts an interactive dialogue with a user, and the method comprises: obtaining user compressed memories corresponding to the multiple groups of historical dialogue contents based on the user, wherein the user compressed memories comprise user descriptions, relationship descriptions and event descriptions, wherein the user descriptions are used to characterize user role characteristics of the user corresponding roles learned based on the multiple groups of historical dialogue contents; the relationship descriptions are used to characterize role relationship characteristics between the user corresponding roles and the dialogue system corresponding roles learned based on the multiple groups of historical dialogue contents; the event descriptions are used to characterize event characteristics of interactive events formed between the user corresponding roles and the dialogue system corresponding roles learned based on the multiple groups of historical dialogue contents; obtaining first dialogue content initiated by a user; inputting the first dialogue content and the user compressed memories into a pre-trained compressed memory dialogue model, and obtaining interactive reply content of the first dialogue content output by the compressed memory dialogue model, wherein the compressed memory dialogue model is obtained by joint training based on a second dialogue content sample and a second user compressed memory sample, and the interactive reply content is obtained based on the first dialogue content and the user compressed memory.
[0007] According to a memory enhancement reply method for a dialogue system provided by the present invention, before the first dialogue content and the user compressed memory are input into a pre-trained compressed memory dialogue model, the method further includes: obtaining a first training sample set, wherein the first training sample set includes a plurality of first training samples, and a user preferred dialogue interaction reply content label corresponding to each of the first training samples, and a user non-preferred dialogue interaction reply content label corresponding to each of the first training samples, wherein the first training sample includes a first dialogue content sample and a first user compressed memory sample, and the first user compressed memory sample is determined according to the user's first historical dialogue content sample; based on the first training sample set, the compressed memory dialogue model, the user preferred dialogue interaction reply content label corresponding to each of the first training samples, and the user non-preferred dialogue interaction reply content label corresponding to each of the first training samples The corresponding user non-preferential dialogue interactive reply content label is constructed as a first optimization goal in the process of training the compressed memory dialogue model of user preference learning; the compressed memory dialogue model of user preference learning is trained according to the first optimization goal to obtain a trained compressed memory dialogue model of user preference learning, and the trained compressed memory dialogue model of user preference learning is used as the final compressed memory dialogue model; the first dialogue content and the user compressed memory are input into the pre-trained compressed memory dialogue model to obtain the interactive reply content of the first dialogue content output by the compressed memory dialogue model, specifically including: the first dialogue content and the user compressed memory are input into the trained compressed memory dialogue model of user preference learning to obtain the interactive reply content of the first dialogue content output by the compressed memory dialogue model of user preference learning.
[0008] According to a memory enhancement reply method for a dialogue system provided by the present invention, the compressed memory dialogue model is trained in the following manner: obtaining a second training sample set, wherein the second training sample set includes multiple second training samples, wherein the second training samples include second dialogue content samples and second user compressed memory samples, and the second user compressed memory samples are determined according to the user's second historical dialogue content samples; constructing a second optimization goal in the process of training the compressed memory dialogue model based on the second training sample set; training the compressed memory dialogue model according to the second optimization goal to obtain a trained compressed memory dialogue model.
[0009] According to a memory-enhanced reply method for a dialogue system provided by the present invention, the method obtains user compressed memories corresponding to the multiple groups of historical dialogue contents based on the multiple groups of historical dialogue contents, specifically comprising: obtaining a pre-trained fine-grained memory generator; inputting the multiple groups of historical dialogue contents of the user into the fine-grained memory generator, and obtaining fine-grained memory data corresponding to the historical dialogue contents output by the fine-grained memory generator, wherein the fine-grained memory data is used to characterize the core content information of the historical dialogue contents; calling a pre-trained compressed memory generator, and inputting multiple groups of the fine-grained memory data into the compressed memory generator, and obtaining user compressed memories corresponding to the multiple groups of historical dialogue contents output by the compressed memory generator.
[0010] According to a memory-enhanced reply method for a dialogue system provided by the present invention, the fine-grained memory generator is trained in the following manner: obtaining a third training sample set, wherein the third training sample set includes multiple third training samples, and fine-grained memory tags corresponding to each of the third training samples, wherein the third training samples include third historical dialogue content samples; based on the third training sample set, constructing a third optimization goal in the process of training the fine-grained memory generator; training the fine-grained memory generator according to the third optimization goal to obtain a trained fine-grained memory generator.
[0011] According to a memory-enhanced reply method for a dialogue system provided by the present invention, the compressed memory generator is trained in the following manner: obtaining a fourth training sample set, wherein the fourth training sample set includes multiple fourth training samples and compressed memory data labels corresponding to each of the fourth training samples, wherein the fourth training samples include fourth fine-grained memory samples; constructing a fourth optimization goal in the process of training the compressed memory generator based on the fourth training sample set; training the compressed memory generator according to the fourth optimization goal to obtain a trained compressed memory generator.
[0012] The present invention also provides a memory enhancement reply device for a dialogue system, which is applied to a dialogue system, wherein the dialogue system conducts an interactive dialogue with a user, and the device comprises: a processing module, which is used to obtain user compressed memories corresponding to the multiple groups of historical dialogue contents based on the multiple groups of historical dialogue contents of the user, wherein the user compressed memories include user descriptions, relationship descriptions and event descriptions, wherein the user descriptions are used to characterize the user role characteristics of the user corresponding roles learned based on the multiple groups of historical dialogue contents; the relationship descriptions are used to characterize the role relationship characteristics between the user corresponding roles and the dialogue system corresponding roles learned based on the multiple groups of historical dialogue contents; the event descriptions are used to characterize the event characteristics of the interactive events formed between the user corresponding roles and the dialogue system corresponding roles learned based on the multiple groups of historical dialogue contents; an acquisition module, which is used to obtain a first dialogue content initiated by a user; and a generation module, which is used to input the first dialogue content and the user compressed memory into a pre-trained compressed memory dialogue model to obtain interactive reply content of the first dialogue content output by the compressed memory dialogue model, wherein the compressed memory dialogue model is obtained by joint training based on a second dialogue content sample and a second user compressed memory sample, and the interactive reply content is obtained based on the first dialogue content and the user compressed memory.
[0013] According to a memory enhancement reply device for a dialogue system provided by the present invention, the generation module is also used to: obtain a first training sample set, wherein the first training sample set includes multiple first training samples, and a user preferred dialogue interaction reply content label corresponding to each of the first training samples, and a user non-preferred dialogue interaction reply content label corresponding to each of the first training samples, wherein the first training sample includes a first dialogue content sample and a first user compressed memory sample, and the first user compressed memory sample is determined according to the user's first historical dialogue content sample; based on the first training sample set, the compressed memory dialogue model, the user preferred dialogue interaction reply content label corresponding to each of the first training samples, and the user non-preferred dialogue interaction reply content label corresponding to each of the first training samples, a generation module is constructed in the training set. The first optimization goal in the process of the compressed memory dialogue model of user preference learning; the compressed memory dialogue model of user preference learning is trained according to the first optimization goal to obtain a trained compressed memory dialogue model of user preference learning, and the trained compressed memory dialogue model of user preference learning is used as the final compressed memory dialogue model; the generation module adopts the following method to input the first dialogue content and the user compressed memory into the pre-trained compressed memory dialogue model to obtain the interactive response content of the first dialogue content output by the compressed memory dialogue model: input the first dialogue content and the user compressed memory into the trained compressed memory dialogue model of user preference learning to obtain the interactive response content of the first dialogue content output by the compressed memory dialogue model of user preference learning.
[0014] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the memory enhancement reply method of the dialogue system as described in any one of the above is implemented.
[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the memory-enhanced reply method of the dialogue system as described in any one of the above.
[0016] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the memory enhancement reply method of the dialogue system as described in any one of the above is implemented.
[0017] The memory enhancement reply method, device, electronic device and storage medium of the dialogue system provided by the present invention are applied to the dialogue system, wherein the dialogue system and the user have an interactive dialogue, and the method comprises: based on multiple groups of historical dialogue contents of the user, obtaining user compressed memory corresponding to the multiple groups of historical dialogue contents, wherein the user compressed memory comprises user description, relationship description and event description, the user description is used to characterize the user role characteristics of the user corresponding role learned according to the multiple groups of historical dialogue contents; the relationship description is used to characterize the role relationship characteristics between the user corresponding role and the dialogue system corresponding role learned according to the multiple groups of historical dialogue contents; the event description is used to characterize the event characteristics of the interactive event formed between the user corresponding role and the dialogue system corresponding role learned according to the multiple groups of historical dialogue contents; obtain the first dialogue content initiated by the user; input the first dialogue content and the user compressed memory into the compressed memory dialogue model obtained by pre-training, and obtain the interactive reply content of the first dialogue content output by the compressed memory dialogue model. Since the interactive reply content is obtained according to the user compressed memory, and the user compressed memory contains the user description, relationship description and event description, it can be ensured that the obtained interactive reply content covers the user-related long-term memory perception information, thereby overcoming the problem that the existing interactive reply content cannot reflect the user's long-term memory perception information, thereby resulting in the problem that the dialogue service scenario of the system is limited. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 It is a flowchart of the memory enhancement reply method of the dialogue system provided by the present invention;
[0020] Figure 2 It is a flowchart of the present invention for inputting the first conversation content and the user's compressed memory into a pre-trained compressed memory conversation model to obtain the interactive reply content of the first conversation content output by the compressed memory conversation model;
[0021] Figure 3 It is a flow chart of obtaining user compression memory corresponding to multiple groups of historical conversation contents based on multiple groups of historical conversation contents provided by the present invention;
[0022] Figure 4 It is a structural schematic diagram of a memory enhancement reply device of a dialogue system provided by the present invention;
[0023] Figure 5It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0025] The present invention provides a memory enhancement reply method for a dialogue system, which can be applied to a dialogue system, wherein the dialogue system can have an interactive dialogue with a user. The memory enhancement reply method for a dialogue system provided by the present invention can well combine the dialogue context and the user's compressed memory information, perform active interaction, and complete the user's active dialogue memory experience, thereby solving the problems of low accuracy of traditional memory retrieval, high memory storage cost, and inability to conduct active memory dialogue.
[0026] Among them, active interactive dialogue can be understood as the content in which the dialogue system replies to the user may include, in addition to the interactive response content used to passively reply to the user's dialogue content or questions, other newly introduced topics, wherein the newly introduced topics are obtained by combining the dialogue context (which may correspond to the first dialogue content) and the user's compressed memory information (corresponding to the user's compressed memory).
[0027] Figure 1 It is a flow chart of the memory enhancement reply method of the dialogue system provided by the present invention.
[0028] The following will be combined Figure 1 The process of the memory enhancement reply method of the dialogue system provided by the present invention is described.
[0029] In an exemplary embodiment of the present invention, Figure 1 It can be seen that the memory enhancement reply method of the dialogue system may include steps 110 to 130, and each step will be introduced below.
[0030] In step 110, based on the multiple groups of historical conversation contents of the user, the user compressed memory corresponding to the multiple groups of historical conversation contents is obtained.
[0031] In one embodiment, multiple groups of historical conversation contents between the user and the dialogue system may be obtained, and corresponding user compressed memories may be extracted based on the multiple groups of historical conversation contents. The user compressed memory may include user description, relationship description, and event description. The user description may be used to characterize the user role characteristics of the user's corresponding role learned based on multiple groups of historical conversation contents; the relationship description may be used to characterize the role relationship characteristics between the user's corresponding role and the dialogue system's corresponding role learned based on multiple groups of historical conversation contents; and the event description may be used to characterize the event characteristics of the interactive events formed between the user's corresponding role and the dialogue system's corresponding role learned based on multiple groups of historical conversation contents.
[0032] In one example, the historical conversation content is taken as Context1 for illustration, where Context1 can be:
[0033] He Mobai: I don’t like a boy recently because his character is not very good
[0034] Lu Yichen: Who is it? I'm also feeling irritable lately. Do you want to watch anime together?
[0035] He Mobai: It's okay, it will be fine after a while
[0036] Lu Yichen: Okay, be happy.
[0037] He Mobai: Yeah
[0038] Lu Yichen: Why can't I find someone suitable when it comes to dating?
[0039] He Mobai: Be patient.
[0040] Lu Yichen: Okay
[0041] In the above dialogue, He Mobai represents the role corresponding to the user; Lu Yichen represents the role corresponding to the dialogue system.
[0042] Correspondingly, the extracted user compressed memory can be expressed as follows:
[0043] User description: User He Mobai is a maverick. She doesn't like a person because she thinks that person has a problem with his character. She likes watching movies, especially the Detective Conan movie. She also likes to pair up couples. She has a deep yearning for love, but the setbacks in reality put her in a dilemma. She sometimes feels the torment of waiting, but she will not choose to sit and wait for death. She will take the initiative to create miracles. She likes to see others cry because she is pursuing a thrill. She refuses help from others because she believes that she can handle the problem independently.
[0044] Relationship description: He Mobai and Lu Yichen are friends. They have watched cartoons together and discussed relationship issues. Lu Yichen once helped He Mobai arrange a date.
[0045] Event description: He Mobai once refused Lu Yichen's help, she believed that she could handle the problem independently.
[0046] In this embodiment, the user's compressed memory can be effectively extracted through multiple groups of historical conversation contents of the user, thereby laying a foundation for active interaction by combining the conversation context and the user's compressed memory to complete the user's active conversation memory experience.
[0047] In step 120, the first conversation content initiated by the user is obtained.
[0048] In step 130, the first conversation content and the user's compressed memory are input into a pre-trained compressed memory conversation model to obtain interactive reply content of the first conversation content output by the compressed memory conversation model.
[0049] The compressed memory dialogue model is obtained through joint training based on the second dialogue content sample and the second user compressed memory sample. The interactive reply content is obtained based on the first dialogue content and the user compressed memory.
[0050] In one embodiment, the first conversation content initiated by the user may also be obtained, wherein the first conversation content may be considered as content that requires an interactive response from the conversation system.
[0051] In another embodiment, a compressed memory dialogue model can be pre-trained. Furthermore, the first dialogue content and the user's compressed memory can be input into the pre-trained compressed memory dialogue model, so that the interactive reply content of the first dialogue content output by the compressed memory dialogue model can be obtained. Among them, the interactive reply content is obtained based on the first dialogue content and the user's compressed memory. Since the interactive reply content is obtained based on the user's compressed memory, and the user's compressed memory includes the user description, the relationship description, and the event description, it can be ensured that the obtained interactive reply content covers the user's related long-term memory perception information, thereby overcoming the problem that the existing interactive reply content cannot reflect the user's long-term memory perception information, thereby limiting the system's dialogue service scenarios.
[0052] The memory enhancement reply method of the dialogue system provided by the present invention is applied to the dialogue system, wherein the dialogue system and the user have an interactive dialogue, and the method comprises: based on multiple groups of historical dialogue contents of the user, obtaining user compressed memories corresponding to the multiple groups of historical dialogue contents, wherein the user compressed memories include user descriptions, relationship descriptions and event descriptions, the user descriptions are used to characterize the user role characteristics of the user corresponding roles learned according to the multiple groups of historical dialogue contents; the relationship descriptions are used to characterize the role relationship characteristics between the user corresponding roles learned according to the multiple groups of historical dialogue contents and the dialogue system corresponding roles; the event descriptions are used to characterize the event characteristics of the interactive events formed between the user corresponding roles learned according to the multiple groups of historical dialogue contents and the dialogue system corresponding roles; obtaining the first dialogue content initiated by the user; inputting the first dialogue content and the user compressed memory into the compressed memory dialogue model obtained by pre-training, and obtaining the interactive reply content of the first dialogue content output by the compressed memory dialogue model. Since the interactive reply content is obtained according to the user compressed memory, and the user compressed memory contains the user description, relationship description and event description, it can be ensured that the obtained interactive reply content covers the user-related long-term memory perception information, thereby overcoming the problem that the existing interactive reply content cannot reflect the user's long-term memory perception information, thereby resulting in the problem that the dialogue service scenario of the system is limited.
[0053] It should be noted that in the process of interactive reply content of the first conversation content based on the compressed memory conversation model output, due to certain instability in the output results of the model, it may not be what the user prefers. In order to further ensure that the interactive reply content of the first conversation content can better match the user's preferences, the compressed memory conversation model can also be re-optimized to obtain an optimized model, that is, the compressed memory conversation model learned based on user preferences, and the interactive reply content of the first conversation content is output based on the compressed memory conversation model learned based on user preferences.
[0054] Figure 2 It is a flowchart provided by the present invention of inputting the first conversation content and the user's compressed memory into a pre-trained compressed memory conversation model to obtain the interactive reply content of the first conversation content output by the compressed memory conversation model.
[0055] The surface will be combined Figure 2 The process of outputting interactive reply content of the first conversation content by a compressed memory conversation model based on user preference learning is described.
[0056] In an exemplary embodiment of the present invention, Figure 2 It can be seen that inputting the first conversation content and the user's compressed memory into a pre-trained compressed memory conversation model to obtain the interactive reply content of the first conversation content output by the compressed memory conversation model may include steps 210 to 240, and each step will be introduced below.
[0057] In step 210, a first training sample set is obtained.
[0058] In one embodiment, the first training sample set may include multiple first training samples, and a user-preferred conversation interaction reply content label corresponding to each first training sample, and a user-non-preferred conversation interaction reply content label corresponding to each first training sample, wherein the first training sample includes a first conversation content sample and a first user compressed memory sample, and the first user compressed memory sample is determined based on the user's first historical conversation content sample.
[0059] It should be noted that the user preferred conversation interaction reply content label corresponding to each first training sample and the user non-preferred conversation interaction reply content label corresponding to each first training sample are pre-set labels. The first conversation content sample and the first conversation content in the previous text, the first user compressed memory sample and the user compressed memory, the first historical conversation content sample and the first historical conversation content are the same or similar in meaning, and the difference lies in the different application scenarios, among which the first conversation content sample is used for the model training process, and the first conversation content is used for the actual prediction processing process based on the model.
[0060] In step 220, based on the first training sample set, the compressed memory dialogue model, the user preferred dialogue interaction reply content label corresponding to each first training sample, and the user non-preferred dialogue interaction reply content label corresponding to each first training sample, a first optimization goal in the process of training the compressed memory dialogue model for user preference learning is constructed.
[0061] In step 230, the compressed memory dialogue model of user preference learning is trained according to the first optimization objective to obtain a trained compressed memory dialogue model of user preference learning, and the trained compressed memory dialogue model of user preference learning is used as the final compressed memory dialogue model.
[0062] In one embodiment, the first optimization objective may be expressed as follows:
[0063]
[0064] Where Hφ represents the conversation context of the interaction content between the user and the system corresponding to the φth training sample, that is, the first conversation content sample; Cφ represents the user compressed memory corresponding to the φth training sample, that is, the first user compressed memory sample; y w represents the dialogue interaction reply content preferred by the user of the φth training sample, that is, the user preferred dialogue interaction reply content label corresponding to each first training sample; y lrepresents the dialogue interaction reply content that the user of the φth training sample does not prefer, that is, the dialogue interaction reply content label that the user does not prefer corresponding to each first training sample; P θ Represents the output probability of the compressed memory dialogue reply model preferred by the user; Pref represents the output probability of the original compressed memory dialogue reply model (corresponding to the compressed memory dialogue model) that has been trained.
[0065] Where log represents the logarithmic operation on the probability distribution P. β represents the fixed parameter weight. ∑ represents the summation operation on m training samples. Argmax represents the optimization goal is to maximize the conditional maximum likelihood estimate. θdpo represents the overall optimization goal, which is also the first optimization goal.
[0066] In the application process, the corresponding loss function can be determined based on the first optimization objective, and then the training of the compressed memory dialogue model for user preference learning can be completed based on the loss function. Since the compressed memory dialogue model for user preference learning comprehensively considers the dialogue interaction reply content preferred by the user and the dialogue interaction reply content not preferred by the user on the basis of the original model (compressed memory dialogue model), it can ensure that the interactive reply content of the first dialogue content output by the compressed memory dialogue model for user preference learning can better match the user's preference.
[0067] In yet another embodiment, an example of a compressed memory dialogue model for user preference learning is as follows:
[0068] Cφ represents the first user compressed memory sample, including user description, relationship description and event description. In this embodiment, in order to facilitate the explanation of the embodiment of the first user compressed memory sample, the user compressed memory in the previous text is borrowed. It can be understood that the first user compressed memory sample can also be obtained using the first historical conversation content sample.
[0069] User description in Cφ: User He Mobai is a maverick. She doesn't like a person because she thinks that person has a problem with his character. She likes watching movies, especially the Detective Conan movie. She also likes to pair up couples. She has a deep yearning for love, but the setbacks in reality put her in a dilemma. She sometimes feels the torment of waiting, but she will not choose to sit and wait for death. She will take the initiative to create miracles. She likes to see others cry because she is pursuing a thrill. She refuses help from others because she believes that she can handle the problem independently.
[0070] Relationship description in Cφ: He Mobai and Lu Yichen are friends. They have watched cartoons together and discussed relationship issues. Lu Yichen once helped He Mobai arrange a date.
[0071] Description of events in Cφ: He Mobai once refused Lu Yichen's help, she believed that she could handle the problem independently.
[0072] Hφ can be: He Mobai: There are so many CPs in TV dramas nowadays
[0073] y w It can be: Lu Yichen: At the moment, I really like CP.
[0074] y l It can be: Lu Yichen: What's so good about CP? It's boring. I like to watch the plot.
[0075] In step 240, the first conversation content and the user's compressed memory are input into a trained compressed memory conversation model for user preference learning to obtain interactive reply content of the first conversation content output by the compressed memory conversation model for user preference learning.
[0076] In one embodiment, the first conversation content and the user's compressed memory can be input into a trained compressed memory conversation model for user preference learning, so as to obtain the interactive reply content of the first conversation content output by the compressed memory conversation model for user preference learning. Among them, since the interactive reply content of the first conversation content comprehensively considers the interactive reply content of the conversation preferred by the user and the interactive reply content of the conversation not preferred by the user, it can ensure that the interactive reply content of the first conversation content can better match the user's preference and can better fit the preferences of thousands of users.
[0077] In another embodiment, after obtaining the compressed memory dialogue response model of user preference, the current dialogue in the real world, that is, the first dialogue content and the user's compressed memory input can be input into the trained compressed memory dialogue model of user preference learning to obtain the current dialogue response, that is, the interactive response content of the first dialogue content output by the compressed memory dialogue model of user preference learning.
[0078] The following formula (2) can be used:
[0079] R=ξ(H, C) (2)
[0080] Among them, H = {h1, r1, h2, r2, … hn, rn} represents the current conversation content in the real world; ξ function represents the compressed memory conversation response model preferred by the user; C = {userPersona, Relathinship, Events} represents the compressed memory content, that is, the user compressed memory, including the user portrait UserPersona, the relationship description Relathonzhip and the event summary Events; R represents the current conversation response, that is, the interactive response content of the first conversation content.
[0081] An example could be:
[0082] H is
[0083] He Mobai: The weather is nice today
[0084] Lu Yichen: Yes, but it’s so boring today.
[0085] C = User description: User He Mobai is a maverick. She doesn't like a person because she thinks that person has a problem with his character. She likes watching movies, especially the Detective Conan movie. She also likes to pair up couples. She has a deep yearning for love, but the setbacks in reality put her in a dilemma. She sometimes feels the torment of waiting, but she will not choose to sit and wait for death. She will take the initiative to create miracles. She likes to see others cry because she is pursuing a thrill. She refuses help from others because she believes that she can handle the problem independently.
[0086] Relationship description: He Mobai and Lu Yichen are friends. They have watched cartoons together and discussed relationship issues. Lu Yichen once helped He Mobai arrange a date.
[0087] Event description: He Mobai once refused Lu Yichen's help, she believed that she could handle the problem independently.
[0088] R is
[0089] He Mobai: How about we watch a movie at home, the Conan movie, which you really liked before.
[0090] In another exemplary embodiment of the present invention, the compressed memory dialogue model can be trained in the following manner:
[0091] Acquire a second training sample set, wherein the second training sample set includes a plurality of second training samples, wherein the second training samples include a second conversation content sample and a second user compressed memory sample, and the second user compressed memory sample is determined according to the user's second historical conversation content sample;
[0092] Based on the second training sample set, constructing a second optimization goal in the process of training the compressed memory dialogue model;
[0093] The compressed memory dialogue model is trained according to the second optimization objective to obtain a trained compressed memory dialogue model.
[0094] In one embodiment, the first conversation content sample and the second conversation content sample may be the same or different; the first user compressed memory sample and the second user compressed memory sample may be the same or different; the first historical conversation content sample and the second historical conversation content sample may be the same or different. In this embodiment, the content of each sample is not specifically limited, and it should be noted that each sample is used for the model training process.
[0095] In yet another embodiment, the second optimization objective can be expressed using formula (3):
[0096]
[0097] in, Indicates The conversation context of the user and system interaction content corresponding to the training sample, that is, the second conversation content sample; Indicates The user compression memory corresponding to the training sample is the second user compression memory sample. P represents the corresponding probability distribution. log represents the logarithmic operation performed on the probability distribution P. Indicates The target dialogue response content of the training sample, that is, the interactive response content with the The conversation interaction reply content label corresponding to the training samples. ∑ represents the summation operation on m training samples. Argmax represents the optimization goal is to maximize the conditional maximum likelihood estimate. Θ represents the overall optimization goal, which is also the second optimization goal.
[0098] During the application process, the corresponding loss function can also be determined based on the second optimization objective, and then the training of the compressed memory dialogue model can be completed based on the loss function.
[0099] In yet another embodiment, the compressed memory dialogue model is exemplified as follows:
[0100] Represents the second user compressed memory sample, including user description, relationship description and event description. In this embodiment, in order to facilitate the explanation of the embodiment of the second user compressed memory sample, the user compressed memory in the previous text is borrowed. It can be understood that the second user compressed memory sample can also be obtained using the second historical conversation content sample.
[0101] User description in: User He Mobai is a maverick. She doesn't like a person because she thinks that person has a problem with his character. She likes watching movies, especially the Detective Conan movie. She also likes to pair up couples. She has a deep yearning for love, but the setbacks in reality put her in a dilemma. She sometimes feels the torment of waiting, but she will not choose to sit and wait for death. She will take the initiative to create miracles. She likes to see others cry, probably because she is pursuing a thrill. She refuses help from others, probably because she believes that she can handle the problem independently.
[0102] Relationship description: He Mobai and Lu Yichen are friends. They have watched cartoons together and discussed relationship issues. Lu Yichen once helped He Mobai arrange a date.
[0103] Description of the event: He Mobai once refused Lu Yichen's help, she believed that she could handle the problem independently.
[0104] It could be: He Mobai: I haven’t watched cartoons for a long time and I miss it a little.
[0105] It could be: Lu Yichen: We saw it a long time ago. It’s been a while now, and I haven’t talked to you about your love life for a long time.
[0106] During the application process, the compressed memory dialogue model can be used to output relevant dialogue interaction response content based on different user dialogue histories and user compressed memories.
[0107] Figure 3 It is a flow chart of obtaining user compression memory corresponding to multiple groups of historical conversation contents based on multiple groups of historical conversation contents provided by the present invention.
[0108] The following will be combined Figure 3 The memory enhancement reply method of the dialogue system provided by the present invention is described.
[0109] In an exemplary embodiment of the present invention, Figure 3 It can be seen that, based on multiple groups of historical conversation contents of the user, obtaining the user compressed memory corresponding to the multiple groups of historical conversation contents may include steps 310 to 330, and each step will be introduced below.
[0110] In step 310, a pre-trained fine-grained memory generator is obtained.
[0111] In an exemplary embodiment of the present invention, the fine-grained memory generator can be trained in the following manner:
[0112] Acquire a third training sample set, wherein the third training sample set includes a plurality of third training samples and a fine-grained memory label corresponding to each third training sample, wherein the third training sample includes a third historical conversation content sample;
[0113] Based on the third training sample set, constructing a third optimization objective in the process of training the fine-grained memory generator;
[0114] The fine-grained memory generator is trained according to the third optimization objective to obtain a trained fine-grained memory generator.
[0115] In one embodiment, a fine-grained memory generator can be obtained by training a model based on historical conversation data (corresponding to the third historical conversation content samples) and target fine-grained memory data (corresponding to the fine-grained memory labels corresponding to each third training sample). The model can output relevant fine-grained memories based on different user conversation history contents.
[0116] Among them, the optimization target of the fine-grained memory generator training phase (corresponding to the third optimization target) is the conditional maximum likelihood estimation. In one example, the third optimization target can be expressed by formula (4):
[0117]
[0118] in, Indicates The historical conversation content corresponding to the training sample (corresponding to the third historical conversation content sample), log represents the logarithmic operation performed on the probability distribution P. Indicates The target fine-grained memory corresponding to the training samples (corresponding to the fine-grained memory labels corresponding to the third training samples). ∑ represents the summation operation on the m training samples. Argmax represents the optimization goal is to maximize the conditional maximum likelihood estimate. Θm represents the overall optimization goal, which is also the third optimization goal.
[0119] During the application process, the corresponding loss function can be determined based on the third optimization objective, and then the training of the fine-grained memory generator can be completed based on the loss function.
[0120] In step 320, multiple groups of historical conversation contents of the user are input into a fine-grained memory generator, and fine-grained memory data corresponding to the historical conversation contents output by the fine-grained memory generator is obtained.
[0121] It should be noted that historical conversation content and fine-grained memory data can be one-to-one corresponding, for example, historical conversation content 1 can correspond to fine-grained memory data 1; historical conversation content 2 can correspond to fine-grained memory data 2... historical conversation content n can correspond to fine-grained memory data n.
[0122] In another embodiment, the historical conversation content and the fine-grained memory data may also be one-to-many, for example, the historical conversation content 1 may correspond to the fine-grained memory data 1 and the fine-grained memory data 2. The historical conversation content and the fine-grained memory data may also be many-to-one, for example, the historical conversation content 1 and the historical conversation content 2 may correspond to the fine-grained memory data 1.
[0123] Among them, fine-grained memory data is used to represent the core content information of historical conversations.
[0124] In one embodiment, it is necessary to summarize the conversation contents of historical conversation contents 1 to historical conversation contents n (corresponding to multiple groups of historical conversation contents), and the corresponding fine-grained memory data can be obtained through a fine-grained memory generator.
[0125] In one example, Context1={q11, r11, q12, r12, ... q1m, r1m} in the historical conversation content 1 is input, and the output is the fine-grained memory content, which is extracted according to the following formula (5):
[0126]
[0127] Among them, Context1 = {q11, r11, q12, r12, ... q1m, r1m}, q1i and r1i represent the user dialogue and system response in the i-th round of dialogue in historical dialogue 1, respectively, i∈m. The £ function represents a fine-grained memory extractor based on a large language model, M1 = {m11, m12, ... m1k} indicates that there are k fine-grained memory data m1j in historical dialogue content 1, where m1j represents the j-th memory content extracted from historical dialogue 1, j∈k.
[0128] If it is historical conversation content 2, then the formula (6) is as follows:
[0129]
[0130] Where Context2 = {q21, r21, q22, r22, … q2m, r2m}, the £ function represents the fine-grained memory extractor based on the large language model, M2 = {m21, m22, … m2k} indicates that there are k fine-grained memory data m2j in the historical conversation content 2, where m2j represents the j-th memory content extracted from the historical conversation 2, j∈k.
[0131] If it is the historical conversation content n, then it is the following formula (7):
[0132]
[0133] Among them, Context n={qn1,rn1,qn2,rn2,…qnm,rnm}, the £ function represents a fine-grained memory extractor based on a large language model, and Mn={mn1,mn2,…mnk} indicates that there are k fine-grained memory data mnj in the historical conversation content n. Among them, mnj represents the jth memory content extracted from the historical conversation n, j∈k.
[0134] In yet another example, the application process of the fine-grained memory generator is as follows:
[0135] Context1 is
[0136] He Mobai: I don’t like a boy recently because his character is not very good
[0137] Lu Yichen: Who is it? I'm also feeling irritable lately. Do you want to watch anime together?
[0138] He Mobai: It's okay, it will be fine after a while
[0139] Lu Yichen: Okay, be happy.
[0140] He Mobai: Yeah
[0141] Lu Yichen: Why can't I find someone suitable when it comes to dating?
[0142] He Mobai: Be patient.
[0143] Lu Yichen: Okay
[0144] M1 is
[0145] 1He Mobai doesn't like a boy because of his character
[0146] 2 Lu Yichen invites He Mobai to watch animation together
[0147] 3 Lu Yichen is unhappy Lu Yichen has troubles
[0148] 4 Lu Yichen wants to fall in love but can't find the right person
[0149] In step 330, a pre-trained compressed memory generator is called, and a plurality of fine-grained memory data are input into the compressed memory generator to obtain user compressed memories corresponding to a plurality of groups of historical conversation contents output by the compressed memory generator.
[0150] In another exemplary embodiment of the present invention, the compressed memory generator can be trained in the following manner:
[0151] Acquire a fourth training sample set, wherein the fourth training sample set includes a plurality of fourth training samples and a compressed memory data label corresponding to each fourth training sample, wherein the fourth training sample includes a fourth fine-grained memory sample;
[0152] Based on the fourth training sample set, constructing a fourth optimization objective in the process of training the compressed memory generator;
[0153] The compressed memory generator is trained according to the fourth optimization objective to obtain a trained compressed memory generator.
[0154] In one embodiment, a compressed memory generator can be obtained by training a model based on multiple fine-grained memory data (corresponding to the fourth fine-grained memory samples) and target user compressed memory data (corresponding to the compressed memory data labels corresponding to each fourth training sample). The model can output unified user compressed memory data based on a set of different fine-grained memories.
[0155] Among them, the optimization target of the compressed memory generator training phase (corresponding to the fourth optimization target) is the conditional maximum likelihood estimation. In one example, the fourth optimization target can be expressed by formula (8):
[0156]
[0157] in, Indicates The first fine-grained memory corresponding to the training samples, Indicates The nth fine-grained memory corresponding to the training sample, log represents the logarithmic operation on the probability distribution P. Indicates The compressed memory of the target user corresponding to each training sample corresponds to the compressed memory data label corresponding to each fourth training sample, including the user portrait UserPersona, the relationship description Relathonzhip and the event summary Events. ∑ represents the summation operation on m training samples. Argmax represents the optimization goal is to maximize the conditional maximum likelihood estimate. Θc represents the overall optimization goal, which is also the fourth optimization goal.
[0158] In one embodiment, for multiple fine-grained memory contents (corresponding to multiple fine-grained memory data) M1, M2, ...Mn, a corresponding user compressed memory C is obtained by a compressed memory generator, and is expressed as formula (9):
[0159] C=δ(M1, M2, …Mn) (9)
[0160] Among them, M1 = {m11, m12, ... m1k} indicates that there are k fine-grained memories m1j for historical conversation content 1. M2 = {m21, m22, ... m2k} indicates that there are k fine-grained memories m2j for historical conversation content 2. Mn = {mn1, mn2, ... mnk} indicates that there are k fine-grained memories mnj for historical conversation content n. The δ function represents a compressed memory generator based on a large language model, and C = {userPersona, Relathinship, Events} represents the compressed memory content, including the user portrait UserPersona, the relationship description Relathonzhip and the event summary Events.
[0161] In yet another example, the application process of the compressed memory generator is as follows:
[0162] C = User description: User He Mobai is a maverick. She doesn't like a person because she thinks that person has a problem with his character. She likes watching movies, especially the Detective Conan movie. She also likes to pair up couples. She has a deep yearning for love, but the setbacks in reality put her in a dilemma. She sometimes feels the torment of waiting, but she will not choose to sit and wait for death. She will take the initiative to create miracles. She likes to see others cry because she is pursuing a thrill. She refuses help from others because she believes that she can handle the problem independently.
[0163] Relationship description: He Mobai and Lu Yichen are friends. They have watched cartoons together and discussed relationship issues. Lu Yichen once helped He Mobai arrange a date.
[0164] Event description: He Mobai once refused Lu Yichen's help, she believed that she could handle the problem independently.
[0165] The present invention proposes a memory-enhanced reply method for a dialogue system, which enhances the long-term memory perception ability of real-world users and completes dialogue relationship display modeling and active event interaction.
[0166] According to the above description, the memory enhancement reply method of the dialogue system provided by the present invention is applied to the dialogue system, wherein the dialogue system and the user have an interactive dialogue, and the method includes: based on multiple groups of historical dialogue contents of the user, obtaining user compressed memories corresponding to the multiple groups of historical dialogue contents, wherein the user compressed memories include user descriptions, relationship descriptions and event descriptions, the user descriptions are used to characterize the user role characteristics of the user corresponding roles learned according to the multiple groups of historical dialogue contents; the relationship descriptions are used to characterize the role relationship characteristics between the user corresponding roles and the dialogue system corresponding roles learned according to the multiple groups of historical dialogue contents; the event descriptions are used to characterize the event characteristics of the interactive events formed between the user corresponding roles and the dialogue system corresponding roles learned according to the multiple groups of historical dialogue contents; obtaining the first dialogue content initiated by the user; inputting the first dialogue content and the user compressed memory into the pre-trained compressed memory dialogue model, and obtaining the interactive reply content of the first dialogue content output by the compressed memory dialogue model. Since the interactive reply content is obtained according to the user compressed memory, and the user compressed memory contains the user description, relationship description and event description, it can be ensured that the obtained interactive reply content covers the user-related long-term memory perception information, thereby overcoming the problem that the existing interactive reply content cannot reflect the user's long-term memory perception information, thereby resulting in the problem that the dialogue service scenario of the system is limited.
[0167] Based on the same concept, the present invention also provides a memory enhancement reply device for a dialogue system.
[0168] Figure 4 It is a structural schematic diagram of the memory enhancement reply device of the dialogue system provided by the present invention.
[0169] The following will be combined Figure 4 The memory enhancement reply device of the dialogue system provided by the present invention is described. The memory enhancement reply device of the dialogue system described below and the memory enhancement reply method of the dialogue system described above can be referred to each other.
[0170] In an exemplary embodiment of the present invention, the memory enhancement reply device of the dialogue system can be applied to the dialogue system, wherein the dialogue system conducts an interactive dialogue with the user, combined with Figure 4 It can be seen that the memory enhancement reply device of the dialogue system can include a processing module 410, an acquisition module 420, and a generation module 430, and each module will be introduced below.
[0171] The processing module 410 may be configured to obtain user compressed memories corresponding to the multiple groups of historical conversation contents based on the multiple groups of historical conversation contents of the user, wherein the user compressed memories include user descriptions, relationship descriptions, and event descriptions, wherein the user descriptions are used to characterize the user role characteristics of the user's corresponding roles learned based on the multiple groups of historical conversation contents; the relationship descriptions are used to characterize the role relationship characteristics between the user's corresponding roles and the dialogue system's corresponding roles learned based on the multiple groups of historical conversation contents; and the event descriptions are used to characterize the event characteristics of the interactive events formed between the user's corresponding roles and the dialogue system's corresponding roles learned based on the multiple groups of historical conversation contents.
[0172] The acquisition module 420 may be configured to acquire the first conversation content initiated by the user;
[0173] Generation module 430 may be configured to input the first conversation content and the user compressed memory into a pre-trained compressed memory conversation model to obtain interactive response content of the first conversation content output by the compressed memory conversation model, wherein the compressed memory conversation model is obtained through joint training based on a second conversation content sample and a second user compressed memory sample, and the interactive response content is obtained based on the first conversation content and the user compressed memory.
[0174] In an exemplary embodiment of the present invention, the generating module 430 may also be configured to:
[0175] Obtaining a first training sample set, wherein the first training sample set includes a plurality of first training samples, and a user-preferred conversation interaction reply content label corresponding to each of the first training samples, and a user-unpreferred conversation interaction reply content label corresponding to each of the first training samples, wherein the first training sample includes a first conversation content sample and a first user compressed memory sample, and the first user compressed memory sample is determined according to a first historical conversation content sample of the user;
[0176] Based on the first training sample set, the compressed memory dialogue model, the user preferred dialogue interaction reply content label corresponding to each of the first training samples, and the user non-preferred dialogue interaction reply content label corresponding to each of the first training samples, constructing a first optimization goal in the process of training the compressed memory dialogue model for user preference learning;
[0177] Training the compressed memory dialogue model for user preference learning according to the first optimization objective to obtain a trained compressed memory dialogue model for user preference learning, and using the trained compressed memory dialogue model for user preference learning as a final compressed memory dialogue model;
[0178] The generating module 430 may input the first conversation content and the user compressed memory into a pre-trained compressed memory conversation model to obtain the interactive reply content of the first conversation content output by the compressed memory conversation model in the following manner:
[0179] The first conversation content and the user compressed memory are input into a trained compressed memory conversation model for user preference learning to obtain interactive reply content of the first conversation content output by the compressed memory conversation model for user preference learning.
[0180] In an exemplary embodiment of the present invention, the generation module 430 may implement the training to obtain the compressed memory dialogue model in the following manner:
[0181] Acquire a second training sample set, wherein the second training sample set includes a plurality of second training samples, wherein the second training samples include a second conversation content sample and a second user compressed memory sample, and the second user compressed memory sample is determined according to a second historical conversation content sample of the user;
[0182] Based on the second training sample set, constructing a second optimization goal in the process of training the compressed memory dialogue model;
[0183] The compressed memory dialogue model is trained according to the second optimization objective to obtain a trained compressed memory dialogue model.
[0184] In an exemplary embodiment of the present invention, the processing module 410 may obtain user compressed memories corresponding to the multiple groups of historical conversation contents based on the multiple groups of historical conversation contents of the user in the following manner:
[0185] Get a pre-trained fine-grained memory generator;
[0186] Inputting the multiple groups of historical conversation contents of the user into the fine-grained memory generator, obtaining fine-grained memory data corresponding to the historical conversation contents output by the fine-grained memory generator, wherein the fine-grained memory data is used to represent the core content information of the historical conversation contents;
[0187] A pre-trained compressed memory generator is called, and a plurality of the fine-grained memory data are input into the compressed memory generator, so as to obtain user compressed memories corresponding to the plurality of groups of historical conversation contents output by the compressed memory generator.
[0188] In an exemplary embodiment of the present invention, the processing module 410 may implement the training to obtain the fine-grained memory generator in the following manner:
[0189] Acquire a third training sample set, wherein the third training sample set includes a plurality of third training samples and a fine-grained memory label corresponding to each of the third training samples, wherein the third training sample includes a third historical conversation content sample;
[0190] Based on the third training sample set, constructing a third optimization objective in the process of training the fine-grained memory generator;
[0191] The fine-grained memory generator is trained according to the third optimization objective to obtain a trained fine-grained memory generator.
[0192] In an exemplary embodiment of the present invention, the processing module 410 may implement the training to obtain the compressed memory generator in the following manner:
[0193] Acquire a fourth training sample set, wherein the fourth training sample set includes a plurality of fourth training samples and a compressed memory data label corresponding to each of the fourth training samples, wherein the fourth training samples include fourth fine-grained memory samples;
[0194] Based on the fourth training sample set, constructing a fourth optimization objective in the process of training the compressed memory generator;
[0195] The compressed memory generator is trained according to the fourth optimization objective to obtain a trained compressed memory generator.
[0196] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other via the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the memory enhancement reply method of the dialogue system.
[0197] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0198] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the memory-enhanced reply method of the dialogue system provided by the above-mentioned methods.
[0199] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the memory-enhanced reply method of the dialogue system provided by the above-mentioned methods.
[0200] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0201] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0202] It is further understood that, although the operations are described in a specific order in the accompanying drawings in the embodiments of the present invention, it should not be understood as requiring the operations to be performed in the specific order or serial order shown, or requiring the execution of all the operations shown to obtain the desired results. In certain environments, multitasking and parallel processing may be advantageous.
[0203] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A memory enhancement reply method for a dialogue system, characterized in that: Applied to a dialogue system, the dialogue system performs an interactive dialogue with a user, the method comprising: Based on the multiple groups of historical conversation contents of the user, a user compressed memory corresponding to the multiple groups of historical conversation contents is obtained, wherein the user compressed memory includes a user description, a relationship description and an event description, the user description is used to characterize the user role characteristics of the user's corresponding role learned based on the multiple groups of historical conversation contents; the relationship description is used to characterize the role relationship characteristics between the user's corresponding role and the dialogue system's corresponding role learned based on the multiple groups of historical conversation contents; the event description is used to characterize the event characteristics of the interactive event formed between the user's corresponding role and the dialogue system's corresponding role learned based on the multiple groups of historical conversation contents; Get the first conversation content initiated by the user; Inputting the first conversation content and the user compressed memory into a pre-trained compressed memory conversation model, obtaining interactive reply content of the first conversation content output by the compressed memory conversation model, wherein the compressed memory conversation model is obtained by joint training based on a second conversation content sample and a second user compressed memory sample, and the interactive reply content is obtained based on the first conversation content and the user compressed memory, wherein the interactive reply content includes, in addition to the interactive reply content for passively replying to the user's conversation content or question, a newly introduced topic, wherein the newly introduced topic is obtained based on the first conversation content and the user compressed memory; Before inputting the first conversation content and the user compressed memory into the pre-trained compressed memory conversation model, the method further includes: Obtaining a first training sample set, wherein the first training sample set includes a plurality of first training samples, and a user-preferred conversation interaction reply content label corresponding to each of the first training samples, and a user-unpreferred conversation interaction reply content label corresponding to each of the first training samples, wherein the first training sample includes a first conversation content sample and a first user compressed memory sample, and the first user compressed memory sample is determined according to a first historical conversation content sample of the user; Based on the first training sample set, the compressed memory dialogue model, the user preferred dialogue interaction reply content label corresponding to each of the first training samples, and the user non-preferred dialogue interaction reply content label corresponding to each of the first training samples, constructing a first optimization goal in the process of training the compressed memory dialogue model for user preference learning; Training the compressed memory dialogue model for user preference learning according to the first optimization objective to obtain a trained compressed memory dialogue model for user preference learning, and using the trained compressed memory dialogue model for user preference learning as a final compressed memory dialogue model; The step of inputting the first conversation content and the user compressed memory into a pre-trained compressed memory conversation model to obtain interactive reply content of the first conversation content output by the compressed memory conversation model specifically includes: The first conversation content and the user compressed memory are input into a trained compressed memory conversation model for user preference learning to obtain interactive reply content of the first conversation content output by the compressed memory conversation model for user preference learning.
2. The memory enhancement reply method of the dialogue system according to claim 1, characterized in that: The compressed memory dialogue model is trained in the following way: Acquire a second training sample set, wherein the second training sample set includes a plurality of second training samples, wherein the second training samples include a second conversation content sample and a second user compressed memory sample, and the second user compressed memory sample is determined according to a second historical conversation content sample of the user; Based on the second training sample set, constructing a second optimization goal in the process of training the compressed memory dialogue model; The compressed memory dialogue model is trained according to the second optimization objective to obtain a trained compressed memory dialogue model.
3. The memory enhancement reply method of the dialogue system according to claim 1, characterized in that: The obtaining of user compressed memories corresponding to the multiple groups of historical conversation contents based on the multiple groups of historical conversation contents specifically includes: Get a pre-trained fine-grained memory generator; Inputting the multiple groups of historical conversation contents of the user into the fine-grained memory generator, obtaining fine-grained memory data corresponding to the historical conversation contents output by the fine-grained memory generator, wherein the fine-grained memory data is used to represent the core content information of the historical conversation contents; A pre-trained compressed memory generator is called, and a plurality of the fine-grained memory data are input into the compressed memory generator, so as to obtain user compressed memories corresponding to the plurality of groups of historical conversation contents output by the compressed memory generator.
4. The memory enhancement reply method of the dialogue system according to claim 3, characterized in that: The fine-grained memory generator is trained in the following way: Acquire a third training sample set, wherein the third training sample set includes a plurality of third training samples and a fine-grained memory label corresponding to each of the third training samples, wherein the third training sample includes a third historical conversation content sample; Based on the third training sample set, constructing a third optimization objective in the process of training the fine-grained memory generator; The fine-grained memory generator is trained according to the third optimization objective to obtain a trained fine-grained memory generator.
5. The memory enhancement reply method of the dialogue system according to claim 3, characterized in that: The compressed memory generator is trained in the following way: Acquire a fourth training sample set, wherein the fourth training sample set includes a plurality of fourth training samples and a compressed memory data label corresponding to each of the fourth training samples, wherein the fourth training samples include fourth fine-grained memory samples; Based on the fourth training sample set, constructing a fourth optimization objective in the process of training the compressed memory generator; The compressed memory generator is trained according to the fourth optimization objective to obtain a trained compressed memory generator.
6. A memory enhancement recovery device for a dialogue system, characterized in that: Applied to a dialogue system, the dialogue system performs interactive dialogue with a user, the device comprising: A processing module, configured to obtain user compressed memories corresponding to the multiple groups of historical conversation contents based on the multiple groups of historical conversation contents of the user, wherein the user compressed memories include user descriptions, relationship descriptions and event descriptions, wherein the user descriptions are used to characterize user role characteristics of the user's corresponding roles learned based on the multiple groups of historical conversation contents; the relationship descriptions are used to characterize role relationship characteristics between the user's corresponding roles and the dialogue system's corresponding roles learned based on the multiple groups of historical conversation contents; and the event descriptions are used to characterize event characteristics of interactive events formed between the user's corresponding roles and the dialogue system's corresponding roles learned based on the multiple groups of historical conversation contents; An acquisition module, used to acquire the content of the first conversation initiated by the user; A generation module, configured to input the first conversation content and the user compressed memory into a pre-trained compressed memory conversation model, and obtain interactive reply content of the first conversation content output by the compressed memory conversation model, wherein the compressed memory conversation model is obtained by joint training based on a second conversation content sample and a second user compressed memory sample, and the interactive reply content is obtained based on the first conversation content and the user compressed memory, wherein the interactive reply content includes, in addition to the interactive reply content for passively replying to the user's conversation content or question, a newly introduced topic, wherein the newly introduced topic is obtained based on the first conversation content and the user compressed memory; Among them, the generation module is also used to: Obtaining a first training sample set, wherein the first training sample set includes a plurality of first training samples, and a user-preferred conversation interaction reply content label corresponding to each of the first training samples, and a user-unpreferred conversation interaction reply content label corresponding to each of the first training samples, wherein the first training sample includes a first conversation content sample and a first user compressed memory sample, and the first user compressed memory sample is determined according to a first historical conversation content sample of the user; Based on the first training sample set, the compressed memory dialogue model, the user preferred dialogue interaction reply content label corresponding to each of the first training samples, and the user non-preferred dialogue interaction reply content label corresponding to each of the first training samples, constructing a first optimization goal in the process of training the compressed memory dialogue model for user preference learning; Training the compressed memory dialogue model for user preference learning according to the first optimization objective to obtain a trained compressed memory dialogue model for user preference learning, and using the trained compressed memory dialogue model for user preference learning as a final compressed memory dialogue model; The generation module uses the following method to input the first conversation content and the user compressed memory into a pre-trained compressed memory conversation model to obtain the interactive reply content of the first conversation content output by the compressed memory conversation model: The first conversation content and the user compressed memory are input into a trained compressed memory conversation model for user preference learning to obtain interactive reply content of the first conversation content output by the compressed memory conversation model for user preference learning.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the memory enhancement reply method of the dialogue system as described in any one of claims 1 to 5 is implemented.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the memory enhancement reply method of the dialogue system as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Social media rumor detection method and system based on graph attention network
CN113268675A
Internet e-commerce complaint intelligent processing method based on big data knowledge graph
CN116468048A
