CN-122019692-A - Dialogue management method and related device
Abstract
The application relates to the technical field of intelligent customer service, and discloses a dialogue management method and a related device, wherein dialogue contents are acquired, a first dialogue content is mapped to a first random event based on a pre-trained mapping model, a first standard dialogue is output based on a Bayesian network and the first random event mapped by the first dialogue content, a second dialogue content is continuously acquired, the second dialogue content is mapped to a second random event, and the second dialogue content is mapped to the second random event according to the Bayesian network, based on a second random event and a second standard conversation, the application can map conversation content to the random event to track the conversation state of the current conversation, and based on a Bayesian network, the mapping relation of the conversation content and the random event, the standard conversation is output, so that gradual propulsion of multiple rounds of conversations is realized, the consistency of the output standard conversation and the conversation content is ensured, the logic of the conversation content is improved, and the conversation quality is improved.
Inventors
- WU JIAQI
- WANG PENG
- QIU WENBO
Assignees
- 广州视源电子科技股份有限公司
- 广州视源人工智能创新研究院有限公司
- 广州视嵘信息技术有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20241111
Claims (14)
- 1. A method of dialog management, the method comprising: A Bayesian network is constructed, wherein the Bayesian network is used for constructing a plurality of random variables and a standard conversation set corresponding to each random variable, the standard conversation set comprises a plurality of standard conversation, each random variable corresponds to a plurality of random events, and the random events are values of the random variables; Acquiring first dialogue content, wherein the first dialogue content comprises dialogue content input by a user and dialogue content replied by a virtual seat; mapping the first dialogue content to a first random event based on the first dialogue content according to a pre-trained mapping model, wherein the mapping model is used for mapping dialogue content to the random event, and the first random event is one random event in a plurality of random events; Outputting a first standard conversation based on the first random event according to the Bayesian network, continuously acquiring second conversation content, mapping the second conversation content to a second random event, and outputting a second standard conversation based on the second random event according to the Bayesian network, wherein the second conversation content is the next conversation content of the first conversation content, and the second random event is one random event in a plurality of random events.
- 2. The method of claim 1, wherein the constructing a bayesian network comprises: Constructing a plurality of random variables, wherein the random variables comprise at least one of plugging a power line, resetting a television and restoring a system; And constructing a Bayesian network probability graph and a conditional probability table to obtain the Bayesian network, wherein the Bayesian network comprises a Bayesian network probability graph and the conditional probability table, nodes of the Bayesian network probability graph are the random variables, the Bayesian network probability graph is used for representing the dependency relationship among the random variables, and the conditional probability table is used for giving complete probability distribution of each random variable in a given state of a father node.
- 3. The method according to claim 2, wherein the method further comprises: Training the Bayesian network specifically comprises the following steps: constructing a plurality of directed graphs, wherein nodes of the directed graphs are the random events; Performing graph searching on the directed graph to generate a plurality of pieces of training data; And training the Bayesian network based on the training data to obtain a trained Bayesian network.
- 4. The method of claim 3, wherein said constructing a standard session set for each of said random variables comprises: Acquiring a vector set corresponding to a random variable and a vector set corresponding to historical dialogue data, wherein the historical dialogue data comprises historical dialogue contents replied by a virtual seat; Generating a first conversation set corresponding to each random variable based on the vector set corresponding to each random variable and the vector set corresponding to the historical conversation content replied by the virtual seat; And traversing the history dialogue content replied by the virtual seat based on the first conversation set to obtain a second conversation set corresponding to each random variable, wherein the second conversation set is the standard conversation set.
- 5. The method of claim 4, wherein the first conversation set includes a plurality of conversations, and traversing the historical dialog content of the virtual agent reply based on the first conversation set to obtain a second conversation set corresponding to each random variable includes: calculating the Jaccard distance between each conversation in the first conversation set corresponding to the random variables and each conversation in the historical conversation content replied by the virtual seat; According to the Jaccard distance, determining a conversation similar to each conversation, and obtaining a similar conversation set corresponding to each random variable; Filtering the conversation which is not associated with the random variable in the similar conversation set corresponding to the random variable to obtain a second conversation set corresponding to the random variable.
- 6. The method of claim 5, wherein the method further comprises: Training the mapping model to obtain the pre-trained mapping model, which specifically comprises the following steps: acquiring historical dialogue data and dividing the historical dialogue data into a plurality of minimum dialogue fragments, wherein the historical dialogue data comprises historical dialogue contents input by a user and historical dialogue contents replied by a virtual seat; constructing a mapping relation between each minimum dialogue fragment and a random event; And training the mapping model by taking the mapping relation between all the minimum dialogue fragments and the random event as training data to obtain a pre-trained mapping model.
- 7. The method of claim 6, wherein said constructing a mapping relationship between each of said minimum dialog segments and random events comprises: calculating a first cosine similarity of each dialogue in the minimum dialogue fragments and each random event; Adding random events with the first cosine similarity being greater than a similarity threshold to a set of similar random events, wherein each dialog in each minimum dialog segment corresponds to one set of similar random events; Combining the similar random event sets corresponding to each dialogue in the same minimum dialogue segment to obtain a similar random event set corresponding to the minimum dialogue segment; Acquiring a plurality of random events with highest similarity from a similar random event set corresponding to the minimum dialogue fragment as a candidate random event set corresponding to the minimum dialogue fragment; and selecting a random event from the candidate random event set, and taking the random event as a label of a minimum dialogue segment corresponding to the candidate random event set, so that the minimum dialogue segment is mapped to one random event.
- 8. The method of claim 7, wherein the method further comprises: And when the first cosine similarity is smaller than or equal to the similarity threshold, merging the current minimum dialogue fragment with the next minimum dialogue fragment, and continuing to execute the step of constructing the mapping relation between each minimum dialogue fragment and the random event.
- 9. The method of claim 8, wherein the random event comprises a transfer of a person, and wherein after mapping the dialog content to the random event, the method further comprises: Based on the trained Bayesian network, determining the probability that the random event is a transfer person; when the probability of the random event being the conversion of the manual is greater than or equal to a probability threshold, converting the current dialogue into manual processing; And when the probability of the random event being the conversion person is smaller than a probability threshold value, continuing to acquire the next dialogue content, and continuing to map the dialogue to the random event.
- 10. The method of claim 1, wherein the outputting a first standard conversation based on the first random event according to the bayesian network comprises: outputting a next random variable based on the random variable corresponding to the first random event; calculating the second cosine similarity between each standard conversation in the standard conversation set corresponding to the next random variable and the first conversation content; And taking the standard conversation with the highest second cosine similarity as a first standard conversation corresponding to the first random event.
- 11. The method of claim 1, wherein the mapping the second dialog content to a second random event, outputting a second standard dialog based on the second random event according to the bayesian network, comprises: mapping the second dialog content to a second random event according to a pre-trained mapping model; outputting a next random variable based on the random variable corresponding to the second random event; calculating the third cosine similarity between each standard conversation in the standard conversation set corresponding to the next random variable and the second conversation content; And taking the standard conversation with highest third cosine similarity as a second standard conversation corresponding to the second random event.
- 12. A dialog management device, the device comprising: The system comprises a construction module, a Bayesian network, a judgment module and a judgment module, wherein the Bayesian network is used for constructing a plurality of random variables and a standard conversation set corresponding to each random variable, the standard conversation set comprises a plurality of standard conversations, each random variable corresponds to a plurality of random events, and the random events are values of the random variables; The system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring first dialogue content, wherein the first dialogue content comprises dialogue content input by a user and dialogue content replied by a virtual seat; A mapping module, configured to map, based on the first dialog content, the first dialog content to a first random event according to a pre-trained mapping model, where the mapping model is configured to map dialog content to a random event, and the first random event is one random event of a plurality of random events; And the conversation output module is used for outputting a first standard conversation based on the first random event according to the Bayesian network, continuously acquiring second conversation content, mapping the second conversation content to a second random event, and outputting a second standard conversation based on the second random event according to the Bayesian network, wherein the second conversation content is the next conversation content of the first conversation content, and the second random event is one random event in a plurality of random events.
- 13. An electronic device, comprising: a processor and a memory, the processor being configured to execute executable program code in the memory, which when executed, performs instructions of the dialog management method as claimed in any of claims 1 to 11.
- 14. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed, implements the dialog management method of any of claims 1 to 11.
Description
Dialogue management method and related device Technical Field The embodiment of the application relates to the technical field of intelligent customer service, in particular to a dialogue management method and a related device. Background The intelligent customer service system is taken as a medium of remote customer service and becomes an indispensable tool in the daily working process. At present, an intelligent customer service system generally realizes generation of dialogue contents through a large model-based question-and-answer generation scheme, wherein the large model-based question-and-answer generation scheme mainly adopts a discriminant generation method to generate replies, when a dialogue needing to be understood is encountered, the contents of the replies are quite hard, the scheme lacks dialogue state tracking and dialogue strategies, and when the scheme faces a dialogue scene requiring strict logic and expertise, the contents of the replies generally lack logic and consistency, so that the experience of a user is poor. Disclosure of Invention In order to solve the above technical problems, embodiments of the present application provide a session management method and related device, which solve the problem that the session content output by an intelligent session system lacks logic, and can improve the logic and the professional of the session content, so as to improve the session quality. In order to solve the technical problems, the embodiment of the application provides the following technical scheme: in a first aspect, an embodiment of the present application provides a session management method, where the method includes: A Bayesian network is constructed, wherein the Bayesian network is used for constructing a plurality of random variables and a standard conversation set corresponding to each random variable, the standard conversation set comprises a plurality of standard conversation, each random variable corresponds to a plurality of random events, and the random events are values of the random variables; acquiring first dialogue content, wherein the first dialogue content comprises dialogue content input by a user and dialogue content replied by a virtual seat; Mapping the first dialogue content to a first random event based on the first dialogue content according to a pre-trained mapping model, wherein the mapping model is used for mapping the dialogue content to the random event, and the first random event is one random event in a plurality of random events; Outputting a first standard conversation based on the first random event according to the Bayesian network, continuously acquiring second conversation content, mapping the second conversation content to the second random event based on the second random event according to the Bayesian network, and outputting the second standard conversation, wherein the second conversation content is the next conversation content of the first conversation content, and the second random event is one random event in a plurality of random events. In some embodiments, constructing a bayesian network includes: constructing a plurality of random variables, wherein the random variables comprise at least one of plugging a power line, resetting a television and restoring a system; And constructing a Bayesian network probability graph and a conditional probability table to obtain a Bayesian network, wherein the Bayesian network comprises a Bayesian network probability graph and the conditional probability table, nodes of the Bayesian network probability graph are random variables, the Bayesian network probability graph is used for representing the dependency relationship among the random variables, and the conditional probability table is used for carrying out complete probability distribution on each random variable in a given state of a father node. In some embodiments, the method further comprises: training the Bayesian network specifically comprises the following steps: Constructing a plurality of directed graphs, wherein nodes of the directed graphs are random events; Performing graph searching on the directed graph to generate a plurality of pieces of training data; based on the training data, training the Bayesian network to obtain the trained Bayesian network. In some embodiments, constructing a standard session set for each random variable includes: Acquiring a vector set corresponding to a random variable and a vector set corresponding to historical dialogue data, wherein the historical dialogue data comprises historical dialogue contents replied by a virtual seat; Generating a first conversation set corresponding to each random variable based on the vector set corresponding to each random variable and the vector set corresponding to the historical conversation content replied by the virtual seat; and traversing the historical dialogue content of the virtual seat reply based on the first conversation set to obtain a second conversation set co