CN118153687A - Memory enhancement replying method and device for dialogue system and electronic equipment - Google Patents

Memory enhancement replying method and device for dialogue system and electronic equipment Download PDF

Info

Publication number
CN118153687A
CN118153687A CN202410170236.3A CN202410170236A CN118153687A CN 118153687 A CN118153687 A CN 118153687A CN 202410170236 A CN202410170236 A CN 202410170236A CN 118153687 A CN118153687 A CN 118153687A
Authority
CN
China
Prior art keywords
dialogue
memory
user
content
training
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410170236.3A
Other languages
Chinese (zh)
Inventor
李宏广
王宝元
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Hongmian Xiaoice Technology Co Ltd
Original Assignee
Beijing Hongmian Xiaoice Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Hongmian Xiaoice Technology Co Ltd filed Critical Beijing Hongmian Xiaoice Technology Co Ltd
Priority to CN202410170236.3A priority Critical patent/CN118153687A/en
Publication of CN118153687A publication Critical patent/CN118153687A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/04Inference or reasoning models
    • G06N5/041Abduction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/335Filtering based on additional data, e.g. user or group profiles
    • G06F16/337Profile generation, learning or modification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • Computing Systems (AREA)
  • Human Computer Interaction (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Medical Informatics (AREA)
  • Machine Translation (AREA)

Abstract

The invention provides a memory enhancement replying method and device of a dialogue system and electronic equipment, which are applied to the dialogue system, wherein the dialogue system carries out interactive dialogue with a user, and the method comprises the following steps: obtaining user compression memory corresponding to a plurality of groups of historical dialogue contents based on the plurality of groups of historical dialogue contents of the user, wherein the user compression memory comprises user description, relationship description and event description; acquiring first dialogue content initiated by a user; and inputting the first dialogue content and the user compression memory into the compression memory dialogue model which is trained in advance, and obtaining the interactive reply content of the first dialogue content which is output by the compression memory dialogue model. The obtained interactive reply content covers the long-term memory perception information related to the user, and the problem that the conventional interactive reply content cannot embody the long-term memory perception information of the user, so that the dialogue service scene of the system is limited is solved.

Description

Memory enhancement replying method and device for dialogue system and electronic equipment
Technical Field
The present invention relates to the field of artificial intelligence technologies, and in particular, to a memory enhancement recovery method and apparatus for a dialogue system, and an electronic device.
Background
With the continuous development and popularization of artificial intelligence technology, man-machine intelligent dialogue systems have been applied in various business scenarios.
As known from the related art, the current man-machine conversation system often cannot sense the user image information at the user side, that is, the interactive reply content cannot embody the long-term memory sensing information of the user, so that the conversation service scene of the system is limited.
In view of the above problems, no corresponding solution is currently proposed in the industry.
Disclosure of Invention
The invention provides a memory enhancement replying method, a memory enhancement replying device and electronic equipment of a dialogue system, which realize that the obtained interactive replying content covers long-term memory perception information related to a user, and solve the problem that the conventional interactive replying content cannot embody the long-term memory perception information of the user, so that dialogue service scenes of the system are limited.
The invention provides a memory enhancement replying method of a dialogue system, which is applied to the dialogue system, wherein the dialogue system carries out interactive dialogue with a user, and the method comprises the following steps: obtaining user compression memory corresponding to a plurality of groups of historical dialogue contents based on the plurality of groups of historical dialogue contents of the user, wherein the user compression memory comprises user description, relationship description and event description, and the user description is used for representing user role characteristics of the corresponding roles of the user learned according to the plurality of groups of historical dialogue contents; the relation description is used for representing character relation characteristics between the user corresponding characters learned according to a plurality of groups of historical dialogue contents and the dialogue system corresponding characters; the event description is used for representing event characteristics of interaction events formed between the corresponding roles of the user and the corresponding roles of the dialogue system according to the learning of the plurality of groups of historical dialogue contents; acquiring first dialogue content initiated by a user; inputting the first dialogue content and the user compression memory into a compression memory dialogue model which is obtained by training in advance, and obtaining the interactive reply content of the first dialogue content which is output by the compression memory dialogue model, wherein the compression memory dialogue model is obtained by training in a combined mode based on a second dialogue content sample and a second user compression memory sample, and the interactive reply content is obtained based on the first dialogue content and the user compression memory.
According to the memory enhancement replying method of the dialogue system provided by the invention, before inputting the first dialogue content and the user compression memory into the compression memory dialogue model obtained by pre-training, the method further comprises the following steps: acquiring a first training sample set, wherein the first training sample set comprises a plurality of first training samples, user preference dialogue interactive reply content labels corresponding to the first training samples, and user non-preference dialogue interactive reply content labels corresponding to the first training samples, wherein the first training samples comprise first dialogue content samples and first user compression memory samples, and the first user compression memory samples are determined according to first historical dialogue content samples of users; constructing a first optimization target in the process of training a compressed memory dialogue model for user preference learning based on the first training sample set, the compressed memory dialogue model, the user preference dialogue interactive reply content labels corresponding to the first training samples and the user non-preference dialogue interactive reply content labels corresponding to the first training samples; training the compression memory dialogue model for user preference learning according to the first optimization target to obtain a trained compression memory dialogue model for user preference learning, and taking the trained compression memory dialogue model for user preference learning as a final compression memory dialogue model; inputting the first dialogue content and the user compression memory into a compression memory dialogue model which is trained in advance to obtain the interactive reply content of the first dialogue content which is output by the compression memory dialogue model, wherein the interactive reply content comprises the following specific steps: and inputting the first dialogue content and the user compression memory into a trained user preference learning compression memory dialogue model to obtain the interactive reply content of the first dialogue content output by the user preference learning compression memory dialogue model.
According to the memory enhancement recovery method of the dialogue system provided by the invention, the compressed memory dialogue model is trained by adopting the following modes: obtaining a second training sample set, wherein the second training sample set comprises a plurality of second training samples, wherein the second training samples comprise second dialogue content samples and second user compression memory samples, and the second user compression memory samples are determined according to second historical dialogue content samples of users; constructing a second optimization target in the process of training the compressed memory dialogue model based on the second training sample set; and training the compressed memory dialogue model according to the second optimization target to obtain a trained compressed memory dialogue model.
According to the memory enhancement reply method of the dialogue system provided by the invention, based on a plurality of groups of history dialogue contents of the user, the user compression memory corresponding to the plurality of groups of history dialogue contents is obtained, and the method concretely comprises the following steps: acquiring a pre-trained fine granularity memory generator; inputting a plurality of groups of history dialogue contents of the user into the fine-granularity memory generator to obtain fine-granularity memory data corresponding to the history dialogue contents output by the fine-granularity memory generator, wherein the fine-granularity memory data is used for representing core content information of the history dialogue contents; invoking a pre-trained compressed memory generator, and inputting a plurality of fine-grained memory data into the compressed memory generator to obtain user compressed memories corresponding to a plurality of groups of historical dialogue contents output by the compressed memory generator.
According to the memory enhancement recovery method of the dialogue system provided by the invention, the fine-grained memory generator is trained by adopting the following modes: obtaining a third training sample set, wherein the third training sample set comprises a plurality of third training samples and fine-grained memory tags corresponding to the third training samples, and the third training samples comprise third historical dialogue content samples; constructing a third optimization objective in training the fine granularity memory generator based on the third training sample set; and training the fine-granularity memory generator according to the third optimization target to obtain a trained fine-granularity memory generator.
According to the memory enhancement recovery method of the dialogue system provided by the invention, the compressed memory generator is trained by adopting the following modes: acquiring a fourth training sample set, wherein the fourth training sample set comprises a plurality of fourth training samples and compressed memory data labels corresponding to the fourth training samples, and the fourth training samples comprise fourth fine-granularity memory samples; constructing a fourth optimization objective in training the compressed memory generator based on the fourth training sample set; and training the compressed memory generator according to the fourth optimization target to obtain a trained compressed memory generator.
The invention also provides a memory-enhanced reply device of a dialogue system, which is applied to the dialogue system, wherein the dialogue system carries out interactive dialogue with a user, and the device comprises: the processing module is used for obtaining user compression memory corresponding to a plurality of groups of historical dialogue contents based on the plurality of groups of historical dialogue contents of the user, wherein the user compression memory comprises user description, relationship description and event description, and the user description is used for representing user role characteristics of the corresponding roles of the user learned according to the plurality of groups of historical dialogue contents; the relation description is used for representing character relation characteristics between the user corresponding characters learned according to a plurality of groups of historical dialogue contents and the dialogue system corresponding characters; the event description is used for representing event characteristics of interaction events formed between the corresponding roles of the user and the corresponding roles of the dialogue system according to the learning of the plurality of groups of historical dialogue contents; the acquisition module is used for acquiring first dialogue content initiated by a user; the generation module is used for inputting the first dialogue content and the user compression memory into a compression memory dialogue model which is obtained by training in advance, and obtaining the interactive reply content of the first dialogue content which is output by the compression memory dialogue model, wherein the compression memory dialogue model is obtained by training in a combined mode based on a second dialogue content sample and a second user compression memory sample, and the interactive reply content is obtained based on the first dialogue content and the user compression memory.
According to the memory enhancement replying device of the dialogue system provided by the invention, the generating module is further used for: acquiring a first training sample set, wherein the first training sample set comprises a plurality of first training samples, user preference dialogue interactive reply content labels corresponding to the first training samples, and user non-preference dialogue interactive reply content labels corresponding to the first training samples, wherein the first training samples comprise first dialogue content samples and first user compression memory samples, and the first user compression memory samples are determined according to first historical dialogue content samples of users; constructing a first optimization target in the process of training a compressed memory dialogue model for user preference learning based on the first training sample set, the compressed memory dialogue model, the user preference dialogue interactive reply content labels corresponding to the first training samples and the user non-preference dialogue interactive reply content labels corresponding to the first training samples; training the compression memory dialogue model for user preference learning according to the first optimization target to obtain a trained compression memory dialogue model for user preference learning, and taking the trained compression memory dialogue model for user preference learning as a final compression memory dialogue model; the generation module inputs the first dialogue content and the user compression memory into a compression memory dialogue model obtained by training in advance in the following way to obtain the interactive reply content of the first dialogue content output by the compression memory dialogue model: and inputting the first dialogue content and the user compression memory into a trained user preference learning compression memory dialogue model to obtain the interactive reply content of the first dialogue content output by the user preference learning compression memory dialogue model.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the memory enhancement recovery method of the dialogue system according to any one of the above when executing the program.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a memory enhanced reply method of a dialog system as described in any of the above.
The invention also provides a computer program product comprising a computer program which when executed by a processor implements a memory enhanced reply method of a dialog system as described in any of the above.
The invention provides a memory enhancement replying method, a device, electronic equipment and a storage medium of a dialogue system, which are applied to the dialogue system, wherein the dialogue system carries out interactive dialogue with a user, and the method comprises the following steps: obtaining user compression memory corresponding to the plurality of groups of historical dialogue contents based on the plurality of groups of historical dialogue contents of the user, wherein the user compression memory comprises user description, relationship description and event description, and the user description is used for representing user character characteristics of corresponding characters of the user learned according to the plurality of groups of historical dialogue contents; the relationship description is used for representing character relationship characteristics between the user corresponding characters learned according to the multiple groups of historical dialogue contents and the dialogue system corresponding characters; the event description is used for representing event characteristics of interaction events formed between the user corresponding roles learned according to the multiple groups of historical dialogue contents and the dialogue system corresponding roles; acquiring first dialogue content initiated by a user; and inputting the first dialogue content and the user compression memory into the compression memory dialogue model which is trained in advance, and obtaining the interactive reply content of the first dialogue content which is output by the compression memory dialogue model. The interactive reply content is obtained according to the user compression memory, and the user compression memory comprises user description, relationship description and event description, so that the obtained interactive reply content can be ensured to cover long-term memory perception information related to the user, and further the problem that the conventional interactive reply content cannot embody the long-term memory perception information of the user, so that a dialogue service scene of a system is limited is solved.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for enhancing memory of a dialogue system according to the present invention;
FIG. 2 is a schematic flow chart of the interactive reply content of the first dialogue content output by the compressed memory dialogue model, which is provided by the invention, by inputting the first dialogue content and the user compressed memory into the pre-trained compressed memory dialogue model;
FIG. 3 is a flow chart of obtaining user compression memory corresponding to a plurality of groups of historical dialogue contents based on the plurality of groups of historical dialogue contents of a user;
FIG. 4 is a schematic diagram of a memory-enhanced recovery device of a dialogue system according to the present invention;
Fig. 5 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The invention provides a memory enhancement replying method of a dialogue system, which can be applied to the dialogue system, wherein the dialogue system can carry out interactive dialogue with a user. The memory enhancement replying method of the dialogue system can well combine dialogue context and user compression memory information to perform active interaction and complete user active dialogue memory experience, thereby solving the problems of low memory retrieval precision, high memory storage cost, incapability of performing active dialogue and the like in the prior art,
The active interactive dialogue can be understood as that in addition to the interactive reply content for passively replying to the dialogue content or the question of the user, other newly introduced topics can be included in the content replied to the user by the dialogue system, wherein the newly introduced topics are obtained according to the combination dialogue context (which can correspond to the first dialogue content) and the user compression memory information (which corresponds to the user compression memory).
FIG. 1 is a flow chart of a memory enhanced recovery method of a dialogue system according to the present invention.
The following will describe the procedure of the memory enhancement recovery method of the dialogue system according to the present invention with reference to fig. 1.
In an exemplary embodiment of the present invention, as can be seen in fig. 1, the memory-enhanced recovery method of the dialogue system may include steps 110 to 130, and each step will be described below.
In step 110, based on the plurality of sets of historical dialog content for the user, a user compressed memory corresponding to the plurality of sets of historical dialog content is obtained.
In one embodiment, a plurality of sets of historical dialog contents of the user and dialog system may be obtained, and corresponding user compression memories may be extracted based on the plurality of sets of historical dialog contents. The user compression memory may include, among other things, user descriptions, relationship descriptions, and event descriptions. The user description may be used to characterize user role features for corresponding roles of the user learned from sets of historical dialog content; the relationship description may be used to characterize character relationship features between the user's corresponding characters learned from the sets of historical dialog content and the dialog system's corresponding characters; the event description may be used to characterize event features that form interaction events between user-corresponding roles learned from sets of historical dialog content and dialog system-corresponding roles.
In one example, the historical dialog content is illustrated as Context1, where Context1 may be:
he Mobai: a men's life has recently been disfavored because his belongings are not very popular
Liu Yichen: who will be out of the way, i am also very frightening in recent times, together with the animation
He Mobai: not only is the time spent
Liu Yichen good bar, happy point
He Mobai: kappy person
Liu Yichen As if talking about love, love is not proper
He Mobai: points of tolerance
Liu Yichen good bar
In the above dialog He Mobai characterizes the user's corresponding role; liu Yichen characterize the corresponding roles of the dialog system.
Correspondingly, the user compression memory that can be extracted can be expressed as follows:
User description: user greeting Mo Bai is a unique person who she dislikes a person, perhaps because she believes that person's personality is problematic. She likes to watch movies, especially the name scout Ke Na theatre version, she also likes to collide with CP, matching lovers. She had a profound look at love, but the frustration in reality had put her in dilemma. She sometimes feels waiting for the decoction, but she does not choose to sit waiting for death, she can actively create the wonder. She liked to see others crying, probably because she is pursuing a stimulating pleasure. She refuses others' help, perhaps because she believes that she can handle the problem independently.
Relationship description He Mobai and Liu Yichen are friends who see the cartoon together and discuss the emotion problem. Liu Yichen once help greetings Mo Bai arrange for appointments.
Event description He Mobai once the help of Liu Yichen was refused, she thought that she could independently deal with the problem.
In this embodiment, through multiple groups of history dialogue contents of the user, the user compression memory of the user can be effectively extracted, so as to lay a foundation for combining dialogue context and user compression memory to perform active interaction and complete user active dialogue memory experience.
In step 120, user-initiated first dialog content is obtained.
In step 130, the first dialogue content and the user compression memory are input into the compression memory dialogue model trained in advance, so as to obtain the interactive reply content of the first dialogue content output by the compression memory dialogue model.
The compressed memory dialogue model is obtained through joint training based on a second dialogue content sample and a second user compressed memory sample. The interactive reply content is derived based on the first dialog content and the user compressed memory.
In one embodiment, the first dialogue content initiated by the user may also be obtained, where the first dialogue content may be considered as content that requires the dialogue system to perform an interactive reply.
In yet another embodiment, a compressed memory session model may be pre-trained. Further, the first dialogue content and the user compression memory can be input into the compression memory dialogue model which is obtained through training in advance, so that the interactive reply content of the first dialogue content which is output by the compression memory dialogue model can be obtained. The interactive reply content is obtained based on the first dialogue content and the user compression memory. The interactive reply content is obtained according to the user compression memory, and the user compression memory comprises user description, relationship description and event description, so that the obtained interactive reply content can be ensured to cover long-term memory perception information related to the user, and further the problem that the conventional interactive reply content cannot embody the long-term memory perception information of the user, so that a dialogue service scene of a system is limited is solved.
The invention provides a memory enhancement replying method of a dialogue system, which is applied to the dialogue system, wherein the dialogue system carries out interactive dialogue with a user, and the method comprises the following steps: obtaining user compression memory corresponding to the plurality of groups of historical dialogue contents based on the plurality of groups of historical dialogue contents of the user, wherein the user compression memory comprises user description, relationship description and event description, and the user description is used for representing user character characteristics of corresponding characters of the user learned according to the plurality of groups of historical dialogue contents; the relationship description is used for representing character relationship characteristics between the user corresponding characters learned according to the multiple groups of historical dialogue contents and the dialogue system corresponding characters; the event description is used for representing event characteristics of interaction events formed between the user corresponding roles learned according to the multiple groups of historical dialogue contents and the dialogue system corresponding roles; acquiring first dialogue content initiated by a user; and inputting the first dialogue content and the user compression memory into the compression memory dialogue model which is trained in advance, and obtaining the interactive reply content of the first dialogue content which is output by the compression memory dialogue model. The interactive reply content is obtained according to the user compression memory, and the user compression memory comprises user description, relationship description and event description, so that the obtained interactive reply content can be ensured to cover long-term memory perception information related to the user, and further the problem that the conventional interactive reply content cannot embody the long-term memory perception information of the user, so that a dialogue service scene of a system is limited is solved.
It should be noted that, in the process of outputting the interactive reply content of the first dialogue content based on the compressed memory dialogue model, because the output result of the model has a certain instability, the interactive reply content of the first dialogue content is not necessarily preferred by the user, in order to further ensure that the interactive reply content of the first dialogue content can be better matched with the preference of the user, the compressed memory dialogue model can be re-optimized, and an optimized model, namely, the compressed memory dialogue model with the user preference learning is obtained, and the interactive reply content of the first dialogue content is output based on the compressed memory dialogue model with the user preference learning.
FIG. 2 is a flow chart of the interactive reply content of the first dialogue content output by the compressed memory dialogue model, which is provided by the invention, by inputting the first dialogue content and the user compressed memory into the pre-trained compressed memory dialogue model.
The process of outputting the interactive reply content of the first dialog content based on the compressed memory dialog model for user preference learning will be described with reference to fig. 2.
In an exemplary embodiment of the present invention, as can be seen in fig. 2, inputting the first dialogue content and the user compression memory into the compression memory dialogue model obtained by training in advance, obtaining the interactive reply content of the first dialogue content output by the compression memory dialogue model may include steps 210 to 240, and each step will be described below.
In step 210, a first set of training samples is acquired.
In an embodiment, the first training sample set may include a plurality of first training samples, and a user preference dialogue interactive reply content tag corresponding to each first training sample, and a user non-preference dialogue interactive reply content tag corresponding to each first training sample, wherein the first training samples include a first dialogue content sample and a first user compression memory sample, and the first user compression memory sample is determined according to a first historical dialogue content sample of the user.
It should be noted that, the user preference dialogue interactive reply content labels corresponding to the first training samples and the user non-preference dialogue interactive reply content labels corresponding to the first training samples are preset labels. The first dialogue content sample is the same as or similar to the first dialogue content, the first user compression memory sample and the user compression memory, and the first history dialogue content sample and the first history dialogue content have the same meaning or similar meaning, and are different from each other in application scenarios, wherein the first dialogue content sample is used for performing a model training process, and the first dialogue content is used for performing an actual prediction processing process based on a model.
In step 220, a first optimization objective in training a compressed memory session model for user preference learning is constructed based on the first training sample set, the compressed memory session model, the user preference session interaction reply content tags corresponding to each first training sample, and the user non-preference session interaction reply content tags corresponding to each first training sample.
In step 230, training the compression memory dialogue model according to the first optimization objective to obtain a trained compression memory dialogue model for user preference learning, and taking the trained compression memory dialogue model for user preference learning as a final compression memory dialogue model.
In one embodiment, the first optimization objective may be represented by equation (1):
Wherein, H phi represents the dialogue context of the user and system interaction content corresponding to the phi-th training sample, namely a first dialogue content sample; cphi represents the user compressed memory corresponding to the phi-th training sample, namely the first user compressed memory sample; y w represents the user-preferred dialogue interactive response content of the phi-th training sample, namely the user-preferred dialogue interactive response content labels corresponding to the first training samples; y l represents dialog interaction reply content which is not preferred by the user of the phi-th training sample, namely a dialog interaction reply content label which is not preferred by the user corresponding to each first training sample; p θ represents the output probability of the compressed memory session reply model of the user preference; pref represents the output probability of the original compressed memory session reply model (corresponding to the compressed memory session model) that has been trained.
Where log represents the log operation performed on the probability distribution P. Beta represents a fixed parameter weight. Σ represents the summation operation over m training samples. Argmax denotes that the optimization objective is to maximize the conditional maximum likelihood estimate. θdpo represents an overall optimization target, that is, a first optimization target.
In the application process, the corresponding loss function can be determined based on the first optimization target, and then training of the compression memory dialogue model for user preference learning is completed based on the loss function. Because the user preference learning compression memory dialogue model is based on the original model (compression memory dialogue model), the dialogue interaction reply content preferred by the user and the dialogue interaction reply content not preferred by the user are comprehensively considered, so that the interaction reply content of the first dialogue content output by the user preference learning compression memory dialogue model can be better matched with the preference of the user.
In yet another embodiment, the compressed memory dialogue model for user preference learning is exemplified as follows:
Cphi represents a first user compressed memory sample including a user description, a relationship description, and an event description, in this embodiment, to facilitate explanation of the borrowing of the user compressed memory previously described with respect to the first user compressed memory sample embodiment, it will be appreciated that the first user compressed memory sample may also be derived using a first historical dialog content sample.
User description in C #: user greeting Mo Bai is a unique person who she dislikes a person, perhaps because she believes that person's personality is problematic. She likes to watch movies, especially the name scout Ke Na theatre version, she also likes to collide with CP, matching lovers. She had a profound look at love, but the frustration in reality had put her in dilemma. She sometimes feels waiting for the decoction, but she does not choose to sit waiting for death, she can actively create the wonder. She liked to see others crying, probably because she is pursuing a stimulating pleasure. She refuses others' help, perhaps because she believes that she can handle the problem independently.
The relationship in C phi describes He Mobai and Liu Yichen are friends who see the cartoon together and discuss the emotion problem. Liu Yichen once help greetings Mo Bai arrange for appointments.
Description of the event in C He Mobai once the help of Liu Yichen was refused, she thought that she could handle the problem independently.
HΦ may be: he Mobai the present TV play cp is more than o
Y w may be: liu Yichen at present, I like cracking cp cheers
Y l may be: liu Yichen what cp looks nice, boring, i like to watch the scenario
In step 240, the first dialog content and the user compression memory are input to the trained user preference learning compression memory dialog model, and the interactive reply content of the first dialog content output by the user preference learning compression memory dialog model is obtained.
In one embodiment, the first dialog content and the user compression memory may be input to a trained user preference learning compression memory dialog model, so that the interactive reply content of the first dialog content output by the user preference learning compression memory dialog model may be obtained. The interactive reply content of the first dialogue content comprehensively considers dialogue interactive reply content preferred by the user and dialogue interactive reply content not preferred by the user, so that the interactive reply content of the first dialogue content can be better matched with the preference of the user, and the preference of thousands of people and thousands of sides of the user can be better attached.
In yet another embodiment, after the user-preferred compressed memory dialogue reply model is obtained, the current dialogue reply can be obtained according to the real world current dialogue, that is, the first dialogue content and the user compressed memory input to the trained user-preferred compressed memory dialogue model, that is, the interactive reply content of the first dialogue content output by the user-preferred compressed memory dialogue model is obtained.
Wherein, can be according to the following formula (2):
R=ξ(H, C) (2)
Where h= { H1, r1, H2, r2, … hn, rn } represents the real world current dialog content; the xi function represents a compressed memory dialogue reply model of user preference; c= { userPersona, RELATHINSHIP, events } represents compressed memory content, i.e. user compressed memory, including user image UserPersona, relationship description Relathonzhip and event summary Events; r represents the current dialog reply, i.e. the interactive reply content of the first dialog content.
Examples may be as follows:
H is
He Mobai: today weather is good
Liu Yichen: yes, but boring today
C = user description: user greeting Mo Bai is a unique person who she dislikes a person, perhaps because she believes that person's personality is problematic. She likes to watch movies, especially the name scout Ke Na theatre version, she also likes to collide with CP, matching lovers. She had a profound look at love, but the frustration in reality had put her in dilemma. She sometimes feels waiting for the decoction, but she does not choose to sit waiting for death, she can actively create the wonder. She liked to see others crying, probably because she is pursuing a stimulating pleasure. She refuses others' help, perhaps because she believes that she can handle the problem independently.
Relationship description He Mobai and Liu Yichen are friends who see the cartoon together and discuss the emotion problem. Liu Yichen once help greetings Mo Bai arrange for appointments.
Event description He Mobai once the help of Liu Yichen was refused, she thought that she could independently deal with the problem.
R is
He Mobai: not we watch a movie at home, ke Na theatre versions, you have a special preference before.
In yet another exemplary embodiment of the present invention, the compressed memory session model may be trained in the following manner:
Acquiring a second training sample set, wherein the second training sample set comprises a plurality of second training samples, the second training samples comprise second dialogue content samples and second user compression memory samples, and the second user compression memory samples are determined according to the second historical dialogue content samples of the users;
constructing a second optimization target in the process of training the compressed memory dialogue model based on the second training sample set;
And training the compressed memory dialogue model according to the second optimization target to obtain a trained compressed memory dialogue model.
In one embodiment, the first dialog content sample and the second dialog 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 dialog content sample and the second historical dialog content sample may be the same or different. In the present embodiment, the content of each sample is not particularly limited, and each sample is used for performing the model training process.
In yet another embodiment, the second optimization objective may be represented by equation (3):
Wherein, Represents the/>Dialog contexts of user and system interaction content corresponding to the training samples, namely a second dialog content sample; /(I)Represents the/>The user corresponding to the training samples compresses the memory, namely the second user compresses the memory samples. P represents the corresponding probability distribution. log represents the log operation performed on the probability distribution P. /(I)Represents the/>The target dialogue interactive reply content of each training sample, namely, the target dialogue interactive reply content is matched with the/>And the dialogue interaction reply content labels corresponding to the training samples. Σ represents the summation operation over m training samples. Argmax denotes that the optimization objective is to maximize the conditional maximum likelihood estimate. Θ represents the overall optimization objective, i.e. the second optimization objective.
In the application process, the corresponding loss function can be determined based on the second optimization target, and then training of the compressed memory dialogue model is completed based on the loss function.
In yet another embodiment, the compressed memory session model is exemplified by the following:
A second user compressed memory sample is shown, including a user description, a relationship description, and an event description, in this embodiment, to facilitate explanation of the borrowing of the foregoing user compressed memory with respect to the embodiment of the second user compressed memory sample, it will be appreciated that the second user compressed memory sample may also be derived using a second historical dialog content sample.
User description of (a): user greeting Mo Bai is a unique person who she dislikes a person, perhaps because she believes that person's personality is problematic. She likes to watch movies, especially the name scout Ke Na theatre version, she also likes to collide with CP, matching lovers. She had a profound look at love, but the frustration in reality had put her in dilemma. She sometimes feels waiting for the decoction, but she does not choose to sit waiting for death, she can actively create the wonder. She liked to see others crying, probably because she is pursuing a stimulating pleasure. She refuses others' help, perhaps because she believes that she can handle the problem independently.
He Mobai and Liu Yichen are friends who see the cartoon together and discuss the emotion problem. Liu Yichen once help greetings Mo Bai arrange for appointments.
He Mobai once denied Liu Yichen of help, she believes that she can independently deal with the problem.
The method can be as follows: he Mobai: the cartoon is not seen for a long time, and people want to be aware of the cartoon.
The method can be as follows: liu Yichen we have seen for a long time before that we do now have something long, and we have not yet lived with you chatting about some emotions.
In the application process, the related dialogue interaction reply content can be output according to different user dialogue histories and user compression memories based on the compression memory dialogue model.
FIG. 3 is a flow chart of obtaining user compression memory corresponding to a plurality of groups of historical dialogue contents based on the plurality of groups of historical dialogue contents of a user.
The following describes a memory-enhanced reply method of the dialog system according to the present invention with reference to fig. 3.
In an exemplary embodiment of the present invention, as can be seen in connection with fig. 3, based on the multiple sets of historical dialog contents of the user, obtaining the user compression memory corresponding to the multiple sets of historical dialog contents may include steps 310 to 330, and each step will be described separately.
In step 310, a pre-trained fine grain memory generator is obtained.
In an exemplary embodiment of the present invention, the fine granularity memory generator may be trained in the following manner:
acquiring a third training sample set, wherein the third training sample set comprises a plurality of third training samples and fine-grained memory tags corresponding to the third training samples, and the third training samples comprise third historical dialogue content samples;
constructing a third optimization target in the process of training the fine granularity memory generator based on the third training sample set;
and training the fine granularity memory generator according to the third optimization target to obtain a trained fine granularity memory generator.
In one embodiment, the fine-grained memory generator may be derived from a training model of historical dialog data (corresponding to third historical dialog content samples) and target fine-grained memory data (corresponding to fine-grained memory tags corresponding to respective third training samples), which model may output associated fine-grained memories based on different user dialog history content.
Wherein the fine granularity memory generator training phase optimization objective (corresponding to the third optimization objective) is a conditional maximum likelihood estimate. In one example, the third optimization objective may be represented by equation (4):
Wherein, Represents the/>The historical dialog content (corresponding to the third historical dialog content sample) corresponding to the training samples, log representing the log operation performed on the probability distribution P. /(I)Represents the/>The target fine granularity memory corresponding to each training sample (the fine granularity memory label corresponding to each third training sample). Σ represents the summation operation over m training samples. Argmax denotes that the optimization objective is to maximize the conditional maximum likelihood estimate. Θm represents the overall optimization objective, i.e. the third optimization objective.
In the application process, the corresponding loss function can be determined based on the third optimization target, and training of the fine-granularity memory generator can be completed based on the loss function.
In step 320, a plurality of groups of historical dialog contents of the user are input to the fine granularity memory generator, so as to obtain fine granularity memory data corresponding to the historical dialog contents output by the fine granularity memory generator.
It should be noted that, the historical dialog content and the fine-grained memory data may be in one-to-one correspondence, for example, the historical dialog content 1 may correspond to the fine-grained memory data 1; historical dialog content 2 may correspond to fine-grained memory data 2 … … and historical dialog content n may correspond to fine-grained memory data n.
In yet another embodiment, the historical dialog content and fine-grained memory data may also be one-to-many, for example, the historical dialog content 1 may correspond to fine-grained memory data 1 and fine-grained memory data 2. The historical dialog content and fine-grained memory data may also be many-to-one, for example, the historical dialog content 1 and the historical dialog content 2 may correspond to fine-grained memory data 1.
Wherein the fine-grained memory data is used to characterize core content information of historical dialog content.
In one embodiment, for the historical dialog content 1 through the historical dialog content n (corresponding to multiple sets of historical dialog content) a summary of the dialog content is required, and the corresponding fine-grained memory data may be obtained by a fine-grained memory generator.
In one example, context 1= { q11, r11, q12, r12, … q1m, r1m } in the history dialog content 1 is input, and the output is fine-grained memory content, extracted according to the following formula (5):
Wherein Context 1= { q11, r11, q12, r12, … q1m, r1m }, q1i and r1i represent the user session and the system reply in the ith round of session in history session 1, i e m, respectively. The _ function represents a fine-grained memory extractor based on a large language model, m1= { M11, M12, … M1k } represents that the history dialog content 1 has k pieces of fine-grained memory data M1j, where M1j represents the j-th piece of memory content extracted in the history dialog 1, j e k.
If the historical dialog content 2 is, the following formula (6) is given:
Where Context 2= { q21, r21, q22, r22, … q2M, r2M }, the ∈function represents a large language model based fine-grained memory extractor, m2= { M21, M22, … M2k } represents that there are k pieces of fine-grained memory data M2j of the history dialog content 2, where M2j represents the j-th piece of memory content extracted in the history dialog 2, j∈k.
If the history dialogue content n is the following formula (7):
where Context n= { qn1, rn1, qn2, rn2, … qnm, rnm }, the ∈function represents a large language model based fine-grained memory extractor, and mn= { Mn1, mn2, … mnk } represents that there are k pieces of fine-grained memory data mnj of the history dialog content n. Wherein mnj represents the j-th memory content extracted from the history dialog n, j ε k.
In yet another example, the application process of the fine grain memory generator is exemplified as follows:
context1 is
He Mobai: a men's life has recently been disfavored because his belongings are not very popular
Liu Yichen: who will be out of the way, i am also very frightening in recent times, together with the animation
He Mobai: not only is the time spent
Liu Yichen good bar, happy point
He Mobai: kappy person
Liu Yichen As if talking about love, love is not proper
He Mobai: points of tolerance
Liu Yichen good bar
M1 is
1 Greeting Mo Bai dislike a male reason is that people's products
2 Liu Yichen invite greeting Mo Bai to see animation together
3 Liu Yichen is not happy Liu Yichen and is annoyed
4 Liu Yichen want to talk about love but not find the proper person
In step 330, a pre-trained compressed memory generator is invoked, and a plurality of fine-grained memory data is input into the compressed memory generator, so as to obtain user compressed memories corresponding to a plurality of groups of historical dialog contents output by the compressed memory generator.
In yet another exemplary embodiment of the present invention, the compressed memory generator may be trained in the following manner:
Acquiring a fourth training sample set, wherein the fourth training sample set comprises a plurality of fourth training samples and compressed memory data labels corresponding to the fourth training samples, and the fourth training samples comprise fourth fine-granularity memory samples;
Constructing a fourth optimization target in the process of training the compressed memory generator based on the fourth training sample set;
And training the compressed memory generator according to the fourth optimization target to obtain a trained compressed memory generator.
In one embodiment, the compressed memory generator may be derived from a training model of a plurality of fine grain memory data (corresponding to fourth fine grain memory samples) and target user compressed memory data (corresponding to compressed memory data tags corresponding to respective fourth training samples), which model may output unified user compressed memory data from a collection of different fine grain memories.
Wherein the compressed memory generator training phase optimization objective (corresponding to the fourth optimization objective) is a conditional maximum likelihood estimate. In one example, the fourth optimization objective may be represented by equation (8):
Wherein, Represents the/>1 St fine granularity memory corresponding to each training sample,/>Represents the/>The nth fine granularity memory corresponding to the training samples, and log represents the logarithmic operation performed on the probability distribution P.Represents the/>The target user compressed memory corresponding to each training sample corresponds to the compressed memory data tag corresponding to each fourth training sample), including user portrayal UserPersona, relationship description Relathonzhip, and event summary Events. Σ represents the summation operation over m training samples. Argmax denotes that the optimization objective is to maximize the conditional maximum likelihood estimate. Θc represents the overall optimization objective, i.e. the fourth optimization objective.
In one embodiment, for a plurality of fine-grained memory contents (corresponding to a plurality of fine-grained memory data) M1, M2, … Mn, a corresponding user compressed memory C is obtained by a compressed memory generator and is represented as formula (9):
C=δ(M1, M2, …Mn) (9)
Where m1= { M11, M12, … M1k } represents that there are k pieces of fine-grained memory M1j in the history dialog content 1. M2= { M21, M22, … M2k } means that there are k pieces of fine-grained memory M2j of the historical dialog content 2. Mn= { Mn1, mn2, … mnk } represents that there are k pieces of fine-grained memory mnj of the history dialog content n. Delta functions represent compressed memory generators based on large language models, c= { userPersona, RELATHINSHIP, events } represent compressed memory content, including user representation UserPersona, relationship description Relathonzhip and event summary Events.
In yet another example, the application process of the compressed memory generator is exemplified as follows:
C = user description: user greeting Mo Bai is a unique person who she dislikes a person, perhaps because she believes that person's personality is problematic. She likes to watch movies, especially the name scout Ke Na theatre version, she also likes to collide with CP, matching lovers. She had a profound look at love, but the frustration in reality had put her in dilemma. She sometimes feels waiting for the decoction, but she does not choose to sit waiting for death, she can actively create the wonder. She liked to see others crying, probably because she is pursuing a stimulating pleasure. She refuses others' help, perhaps because she believes that she can handle the problem independently.
Relationship description He Mobai and Liu Yichen are friends who see the cartoon together and discuss the emotion problem. Liu Yichen once help greetings Mo Bai arrange for appointments.
Event description He Mobai once the help of Liu Yichen was refused, she thought that she could independently deal with the problem.
The invention provides a memory enhancement replying method of a dialogue system, which enhances the long-term memory perception capability of a real-world user and completes dialogue relation display modeling and active event interaction.
As can be seen from the above description, the memory-enhanced reply method of a dialogue system provided by the present invention is applied to a dialogue system, wherein the dialogue system performs an interactive dialogue with a user, and the method includes: obtaining user compression memory corresponding to the plurality of groups of historical dialogue contents based on the plurality of groups of historical dialogue contents of the user, wherein the user compression memory comprises user description, relationship description and event description, and the user description is used for representing user character characteristics of corresponding characters of the user learned according to the plurality of groups of historical dialogue contents; the relationship description is used for representing character relationship characteristics between the user corresponding characters learned according to the multiple groups of historical dialogue contents and the dialogue system corresponding characters; the event description is used for representing event characteristics of interaction events formed between the user corresponding roles learned according to the multiple groups of historical dialogue contents and the dialogue system corresponding roles; acquiring first dialogue content initiated by a user; and inputting the first dialogue content and the user compression memory into the compression memory dialogue model which is trained in advance, and obtaining the interactive reply content of the first dialogue content which is output by the compression memory dialogue model. The interactive reply content is obtained according to the user compression memory, and the user compression memory comprises user description, relationship description and event description, so that the obtained interactive reply content can be ensured to cover long-term memory perception information related to the user, and further the problem that the conventional interactive reply content cannot embody the long-term memory perception information of the user, so that a dialogue service scene of a system is limited is solved.
Based on the same conception, the invention also provides a memory-enhanced replying device of the dialogue system.
Fig. 4 is a schematic structural diagram of a memory-enhanced recovery device of a dialogue system according to the present invention.
The memory-enhanced recovery device of the dialog system provided by the present invention will be described with reference to fig. 4, and the memory-enhanced recovery device of the dialog system described below and the memory-enhanced recovery method of the dialog system described above may be referred to correspondingly.
In an exemplary embodiment of the present invention, the memory-enhanced reply device of the dialog system may be applied to the dialog system, where the dialog system performs an interactive dialog with a user, and as can be understood from fig. 4, the memory-enhanced reply device of the dialog system may include a processing module 410, an obtaining module 420, and a generating module 430, and each module will be described below.
A processing module 410 may be configured to obtain, based on a plurality of sets of historical dialog content for the user, user compressed memory corresponding to the plurality of sets of historical dialog content, wherein the user compressed memory includes user descriptions, relationship descriptions, and event descriptions, the user descriptions being used to characterize user role features for the user corresponding roles learned from the plurality of sets of historical dialog content; the relation description is used for representing character relation characteristics between the user corresponding characters learned according to a plurality of groups of historical dialogue contents and the dialogue system corresponding characters; the event description is used for representing event characteristics of interaction events formed between the corresponding roles of the user and the corresponding roles of the dialogue system according to the learning of the plurality of groups of historical dialogue contents;
an acquisition module 420, which may be configured to acquire user-initiated first dialog content;
The generating module 430 may be configured to input the first dialogue content and the user compression memory into a pre-trained compression memory dialogue model, so as to obtain an interactive reply content of the first dialogue content output by the compression memory dialogue model, where the compression memory dialogue model is obtained by joint training based on a second dialogue content sample and a second user compression memory sample, and the interactive reply content is obtained based on the first dialogue content and the user compression memory.
In an exemplary embodiment of the present invention, the generation module 430 may be further configured to:
Acquiring a first training sample set, wherein the first training sample set comprises a plurality of first training samples, user preference dialogue interactive reply content labels corresponding to the first training samples, and user non-preference dialogue interactive reply content labels corresponding to the first training samples, wherein the first training samples comprise first dialogue content samples and first user compression memory samples, and the first user compression memory samples are determined according to first historical dialogue content samples of users;
Constructing a first optimization target in the process of training a compressed memory dialogue model for user preference learning based on the first training sample set, the compressed memory dialogue model, the user preference dialogue interactive reply content labels corresponding to the first training samples and the user non-preference dialogue interactive reply content labels corresponding to the first training samples;
training the compression memory dialogue model for user preference learning according to the first optimization target to obtain a trained compression memory dialogue model for user preference learning, and taking the trained compression memory dialogue model for user preference learning as a final compression memory dialogue model;
The generating module 430 may input the first dialog content and the user compression memory into a compression memory dialog model obtained by training in advance, so as to obtain an interactive reply content of the first dialog content output by the compression memory dialog model:
And inputting the first dialogue content and the user compression memory into a trained user preference learning compression memory dialogue model to obtain the interactive reply content of the first dialogue content output by the user preference learning compression memory dialogue model.
In an exemplary embodiment of the present invention, the generating module 430 may implement training to obtain the compressed memory session model in the following manner:
Obtaining a second training sample set, wherein the second training sample set comprises a plurality of second training samples, wherein the second training samples comprise second dialogue content samples and second user compression memory samples, and the second user compression memory samples are determined according to second historical dialogue content samples of users;
constructing a second optimization target in the process of training the compressed memory dialogue model based on the second training sample set;
And training the compressed memory dialogue model according to the second optimization target to obtain a trained compressed memory dialogue model.
In an exemplary embodiment of the present invention, the processing module 410 may implement obtaining a user compression memory corresponding to a plurality of sets of historical dialog contents based on the plurality of sets of historical dialog contents of the user in the following manner:
Acquiring a pre-trained fine granularity memory generator;
Inputting a plurality of groups of history dialogue contents of the user into the fine-granularity memory generator to obtain fine-granularity memory data corresponding to the history dialogue contents output by the fine-granularity memory generator, wherein the fine-granularity memory data is used for representing core content information of the history dialogue contents;
invoking a pre-trained compressed memory generator, and inputting a plurality of fine-grained memory data into the compressed memory generator to obtain user compressed memories corresponding to a plurality of groups of historical dialogue contents output by the compressed memory generator.
In an exemplary embodiment of the present invention, the processing module 410 may implement training to obtain the fine granularity memory generator in the following manner:
Obtaining a third training sample set, wherein the third training sample set comprises a plurality of third training samples and fine-grained memory tags corresponding to the third training samples, and the third training samples comprise third historical dialogue content samples;
constructing a third optimization objective in training the fine granularity memory generator based on the third training sample set;
And training the fine-granularity memory generator according to the third optimization target to obtain a trained fine-granularity memory generator.
In an exemplary embodiment of the present invention, the processing module 410 may train to obtain the compressed memory generator in the following manner:
Acquiring a fourth training sample set, wherein the fourth training sample set comprises a plurality of fourth training samples and compressed memory data labels corresponding to the fourth training samples, and the fourth training samples comprise fourth fine-granularity memory samples;
Constructing a fourth optimization objective in training the compressed memory generator based on the fourth training sample set;
And training the compressed memory generator according to the fourth optimization target to obtain a trained compressed memory generator.
Fig. 5 illustrates a physical schematic diagram of an electronic device, as shown in fig. 5, which may include: processor 510, communication interface (Communications Interface) 520, memory 530, and communication bus 540, wherein processor 510, communication interface 520, memory 530 complete communication with each other through communication bus 540. Processor 510 may invoke logic instructions in memory 530 to perform a memory enhanced reply method of the dialog system.
Further, the logic instructions in the memory 530 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, where the computer program product includes a computer program, where the computer program can be stored on a non-transitory computer readable storage medium, and when the computer program is executed by a processor, the computer can execute a memory enhancing recovery method of a dialog system provided by the above methods.
In yet another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform a memory-enhanced reply method of a dialog system provided by the methods described above.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
It will further be appreciated that although operations are depicted in the drawings in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In certain circumstances, multitasking and parallel processing may be advantageous.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A memory-enhanced reply method for a dialog system, applied to a dialog system, the dialog system performing an interactive dialog with a user, the method comprising:
Obtaining user compression memory corresponding to a plurality of groups of historical dialogue contents based on the plurality of groups of historical dialogue contents of the user, wherein the user compression memory comprises user description, relationship description and event description, and the user description is used for representing user role characteristics of the corresponding roles of the user learned according to the plurality of groups of historical dialogue contents; the relation description is used for representing character relation characteristics between the user corresponding characters learned according to a plurality of groups of historical dialogue contents and the dialogue system corresponding characters; the event description is used for representing event characteristics of interaction events formed between the corresponding roles of the user and the corresponding roles of the dialogue system according to the learning of the plurality of groups of historical dialogue contents;
Acquiring first dialogue content initiated by a user;
Inputting the first dialogue content and the user compression memory into a compression memory dialogue model which is obtained by training in advance, and obtaining the interactive reply content of the first dialogue content which is output by the compression memory dialogue model, wherein the compression memory dialogue model is obtained by training in a combined mode based on a second dialogue content sample and a second user compression memory sample, and the interactive reply content is obtained based on the first dialogue content and the user compression memory.
2. The memory enhanced recovery method of a dialog system of claim 1, wherein before inputting the first dialog content and the user compressed memory into a pre-trained compressed memory dialog model, the method further comprises:
Acquiring a first training sample set, wherein the first training sample set comprises a plurality of first training samples, user preference dialogue interactive reply content labels corresponding to the first training samples, and user non-preference dialogue interactive reply content labels corresponding to the first training samples, wherein the first training samples comprise first dialogue content samples and first user compression memory samples, and the first user compression memory samples are determined according to first historical dialogue content samples of users;
Constructing a first optimization target in the process of training a compressed memory dialogue model for user preference learning based on the first training sample set, the compressed memory dialogue model, the user preference dialogue interactive reply content labels corresponding to the first training samples and the user non-preference dialogue interactive reply content labels corresponding to the first training samples;
training the compression memory dialogue model for user preference learning according to the first optimization target to obtain a trained compression memory dialogue model for user preference learning, and taking the trained compression memory dialogue model for user preference learning as a final compression memory dialogue model;
inputting the first dialogue content and the user compression memory into a compression memory dialogue model which is trained in advance to obtain the interactive reply content of the first dialogue content which is output by the compression memory dialogue model, wherein the interactive reply content comprises the following specific steps:
And inputting the first dialogue content and the user compression memory into a trained user preference learning compression memory dialogue model to obtain the interactive reply content of the first dialogue content output by the user preference learning compression memory dialogue model.
3. The memory enhanced recovery method of a dialog system according to claim 1 or 2, wherein the compressed memory dialog model is trained by:
Obtaining a second training sample set, wherein the second training sample set comprises a plurality of second training samples, wherein the second training samples comprise second dialogue content samples and second user compression memory samples, and the second user compression memory samples are determined according to second historical dialogue content samples of users;
constructing a second optimization target in the process of training the compressed memory dialogue model based on the second training sample set;
And training the compressed memory dialogue model according to the second optimization target to obtain a trained compressed memory dialogue model.
4. The memory-enhanced reply method of claim 1, wherein the obtaining a user compression memory corresponding to a plurality of sets of historical dialog contents based on the plurality of sets of historical dialog contents of the user, comprises:
Acquiring a pre-trained fine granularity memory generator;
Inputting a plurality of groups of history dialogue contents of the user into the fine-granularity memory generator to obtain fine-granularity memory data corresponding to the history dialogue contents output by the fine-granularity memory generator, wherein the fine-granularity memory data is used for representing core content information of the history dialogue contents;
invoking a pre-trained compressed memory generator, and inputting a plurality of fine-grained memory data into the compressed memory generator to obtain user compressed memories corresponding to a plurality of groups of historical dialogue contents output by the compressed memory generator.
5. The method for memory enhanced recovery of a dialog system of claim 4, wherein the fine-grained memory generator is trained by:
Obtaining a third training sample set, wherein the third training sample set comprises a plurality of third training samples and fine-grained memory tags corresponding to the third training samples, and the third training samples comprise third historical dialogue content samples;
constructing a third optimization objective in training the fine granularity memory generator based on the third training sample set;
And training the fine-granularity memory generator according to the third optimization target to obtain a trained fine-granularity memory generator.
6. The method for memory enhanced recovery of a dialog system of claim 4 wherein the compressed memory generator is trained by:
Acquiring a fourth training sample set, wherein the fourth training sample set comprises a plurality of fourth training samples and compressed memory data labels corresponding to the fourth training samples, and the fourth training samples comprise fourth fine-granularity memory samples;
Constructing a fourth optimization objective in training the compressed memory generator based on the fourth training sample set;
And training the compressed memory generator according to the fourth optimization target to obtain a trained compressed memory generator.
7. A memory-enhanced reply device for a dialog system, for use in a dialog system for interactive dialog with a user, the device comprising:
The processing module is used for obtaining user compression memory corresponding to a plurality of groups of historical dialogue contents based on the plurality of groups of historical dialogue contents of the user, wherein the user compression memory comprises user description, relationship description and event description, and the user description is used for representing user role characteristics of the corresponding roles of the user learned according to the plurality of groups of historical dialogue contents; the relation description is used for representing character relation characteristics between the user corresponding characters learned according to a plurality of groups of historical dialogue contents and the dialogue system corresponding characters; the event description is used for representing event characteristics of interaction events formed between the corresponding roles of the user and the corresponding roles of the dialogue system according to the learning of the plurality of groups of historical dialogue contents;
the acquisition module is used for acquiring first dialogue content initiated by a user;
The generation module is used for inputting the first dialogue content and the user compression memory into a compression memory dialogue model which is obtained by training in advance, and obtaining the interactive reply content of the first dialogue content which is output by the compression memory dialogue model, wherein the compression memory dialogue model is obtained by training in a combined mode based on a second dialogue content sample and a second user compression memory sample, and the interactive reply content is obtained based on the first dialogue content and the user compression memory.
8. The memory enhanced recovery device of claim 7, wherein the generation module is further configured to:
Acquiring a first training sample set, wherein the first training sample set comprises a plurality of first training samples, user preference dialogue interactive reply content labels corresponding to the first training samples, and user non-preference dialogue interactive reply content labels corresponding to the first training samples, wherein the first training samples comprise first dialogue content samples and first user compression memory samples, and the first user compression memory samples are determined according to first historical dialogue content samples of users;
Constructing a first optimization target in the process of training a compressed memory dialogue model for user preference learning based on the first training sample set, the compressed memory dialogue model, the user preference dialogue interactive reply content labels corresponding to the first training samples and the user non-preference dialogue interactive reply content labels corresponding to the first training samples;
training the compression memory dialogue model for user preference learning according to the first optimization target to obtain a trained compression memory dialogue model for user preference learning, and taking the trained compression memory dialogue model for user preference learning as a final compression memory dialogue model;
The generation module inputs the first dialogue content and the user compression memory into a compression memory dialogue model obtained by training in advance in the following way to obtain the interactive reply content of the first dialogue content output by the compression memory dialogue model:
And inputting the first dialogue content and the user compression memory into a trained user preference learning compression memory dialogue model to obtain the interactive reply content of the first dialogue content output by the user preference learning compression memory dialogue model.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements a memory enhanced recovery method of a dialog system as claimed in any of claims 1 to 6 when the program is executed by the processor.
10. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor implements a memory enhanced reply method of a dialog system according to any of claims 1 to 6.
CN202410170236.3A 2024-02-06 2024-02-06 Memory enhancement replying method and device for dialogue system and electronic equipment Pending CN118153687A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410170236.3A CN118153687A (en) 2024-02-06 2024-02-06 Memory enhancement replying method and device for dialogue system and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410170236.3A CN118153687A (en) 2024-02-06 2024-02-06 Memory enhancement replying method and device for dialogue system and electronic equipment

Publications (1)

Publication Number Publication Date
CN118153687A true CN118153687A (en) 2024-06-07

Family

ID=91284416

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410170236.3A Pending CN118153687A (en) 2024-02-06 2024-02-06 Memory enhancement replying method and device for dialogue system and electronic equipment

Country Status (1)

Country Link
CN (1) CN118153687A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111428127A (en) * 2020-01-21 2020-07-17 江西财经大学 Personalized event recommendation method and system integrating topic matching and two-way preference
CN111984770A (en) * 2020-07-17 2020-11-24 深思考人工智能科技(上海)有限公司 Man-machine conversation method and device
CN113268609A (en) * 2021-06-22 2021-08-17 中国平安人寿保险股份有限公司 Dialog content recommendation method, device, equipment and medium based on knowledge graph
CN113268675A (en) * 2021-05-19 2021-08-17 湖南大学 Social media rumor detection method and system based on graph attention network
CN114912020A (en) * 2022-04-21 2022-08-16 华东师范大学 Multi-sub-target dialogue recommendation method based on user preference graph
CN116468048A (en) * 2023-04-25 2023-07-21 重庆邮电大学 Internet electronic commerce complaint intelligent processing method based on big data knowledge graph
CN117493702A (en) * 2023-11-17 2024-02-02 中国人民解放军国防科技大学 Propagation prediction method and device of social network labels based on heterogeneous attention network

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111428127A (en) * 2020-01-21 2020-07-17 江西财经大学 Personalized event recommendation method and system integrating topic matching and two-way preference
CN111984770A (en) * 2020-07-17 2020-11-24 深思考人工智能科技(上海)有限公司 Man-machine conversation method and device
CN113268675A (en) * 2021-05-19 2021-08-17 湖南大学 Social media rumor detection method and system based on graph attention network
CN113268609A (en) * 2021-06-22 2021-08-17 中国平安人寿保险股份有限公司 Dialog content recommendation method, device, equipment and medium based on knowledge graph
CN114912020A (en) * 2022-04-21 2022-08-16 华东师范大学 Multi-sub-target dialogue recommendation method based on user preference graph
CN116468048A (en) * 2023-04-25 2023-07-21 重庆邮电大学 Internet electronic commerce complaint intelligent processing method based on big data knowledge graph
CN117493702A (en) * 2023-11-17 2024-02-02 中国人民解放军国防科技大学 Propagation prediction method and device of social network labels based on heterogeneous attention network

Similar Documents

Publication Publication Date Title
Gu et al. A systematic survey of prompt engineering on vision-language foundation models
CN110457994B (en) Face image generation method and device, storage medium and computer equipment
US11741668B2 (en) Template based generation of 3D object meshes from 2D images
CN110178132B (en) Method and system for automatically suggesting content in a messaging application
US10504268B1 (en) Systems and methods for generating facial expressions in a user interface
CN112035714B (en) Man-machine conversation method based on role accompaniment
Goetschalckx et al. Generative adversarial networks unlock new methods for cognitive science
Minato et al. Design of a competition specifically for spoken dialogue with a humanoid robot
Du et al. User-centric interactive AI for distributed diffusion model-based AI-generated content
Won et al. Your money or your data: Avatar embodiment options in the identity economy
Sun et al. Fictional Worlds, Real Connections: Developing Community Storytelling Social Chatbots through LLMs
CN118153687A (en) Memory enhancement replying method and device for dialogue system and electronic equipment
Morie et al. Embodied conversational agent avatars in virtual worlds: Making today’s immersive environments more responsive to participants
Thakur et al. Artificially intelligent chatbot
CN113806620B (en) Content recommendation method, device, system and storage medium
Maithili et al. An open innovation business model based on collective intelligence
Durall et al. Local facial attribute transfer through inpainting
Traies Now you see me: the invisibility of older lesbians
Halvorsen Female empowerment through OnlyFans? A sociology of law analysis of tendencies and norms surrounding OnlyFans and the use of sex as a commodity in the digital realm.
Liapis et al. Modelling the quality of visual creations in iconoscope
Zhu Flattening of New Media Design Based on Deep Reinforcement Learning
Rupin et al. Office Management Chatbot Using Artificial Intelligence
Arianti Digital Literacy Campaign to Improve the Community's Economy
Saffar Mehrjardi Self-Attentional Models Application in Task-Oriented Dialogue Generation Systems
CN117520510A (en) Data processing method, storage medium and electronic device

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination