Voice dialogue processing method and apparatus
The present application discloses a voice dialogue processing method and apparatus. The voice dialogue processing method includes: determining a voice semantics corresponding to a user voice to be processed; determining a reply sentence for the voice semantics based on a dialogue management engine, a training sample set of which is constructed from a dialogue business customization file including at least one dialogue flow, and the dialogue flow includes a plurality of dialogue nodes in a set order; and generating a customer service voice for replying to the user voice according to the determined reply sentence.
1 . A computer-implemented voice dialogue processing method involving at least a voice customer service server and a dialogue flow design server, wherein the voice customer service server comprises at least an Automatic Speech Recognition (ASR) module, a Natural Language Understanding (NLU) module, a Natural Language Generation (NLG) module, a Text To Speech (TTS) module, and a dialogue management engine, the method comprising:
obtaining, by the dialogue flow design server, a dialogue flow design request from a dialogue flow design client, and determining at least one dialogue flow corresponding to the dialogue flow design request, wherein the dialogue flow comprises a plurality of dialogue nodes having a set order, the dialogue nodes further includes a phrase that the dialogue node replies to the user, a list of intents used to parse the user voice, and a jump logic; and wherein the dialogue flow design request is generated by drawing a plurality of dialogue flows for one dialogue project on the dialogue flow design client by a voice business personnel of the provider;
generating, by the dialogue flow design server, a dialogue business customization file by parsing the at least one dialogue flow to automatically identify a node content and node type of each ordered node in the at least one dialogue flow, the dialogue business customization file being a JSON file;
sending, by the dialogue flow design server, the dialogue business customization file to a voice customer service server,
loading the dialogue business customization file by the dialogue management engine of the voice customer service server;
generating a training sample set for the dialogue management engine based on the dialogue business customization file and then training the dialogue management engine using the training sample set, by the voice customer service server;
performing speech recognition and semantic understanding on a user voice to be processed, by the ASR module and the NLU module of the voice customer service server, to determine corresponding voice semantics;
determining a reply sentence for the voice semantics, by the voice customer service server, based on the trained dialogue management engine of the voice customer service server; and
performing natural language generation and speech synthesis on the determined reply sentence, by the NLG module and the TTS module of the voice customer service server, to generate a customer service voice for replying to the user voice.
2 . The method of claim 1 , wherein the dialogue flow design client is configured to have a graphical interface for a user to drag and drop a dialogue node box, wherein the dialogue flow design client is used to receive a corresponding dialogue flow design request generated with respect to a user operation of the graphical interface.
3 . An electronic device, including: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform steps of the method claim 1 .
4 . A non-transitory computer-readable storage medium storing a computer program, wherein the computer program implements steps of the method of claim 1 when executed by a processor.
5 . The electronic device of claim 3 , wherein the dialogue management engine comprises a general dialogue management model and a business dialogue management model,
wherein, determining the reply sentence for the voice semantics based on the dialogue management engine includes:
determining a user intent indicated by the voice semantics; and
using the general dialogue management model to perform a general dialogue operation for the user intent when the user intent belongs to a general intent set, wherein the general dialogue operation includes any one of the following: transferring to manual operation, repeating broadcast operation, exiting dialogue operation, and interjection processing operation.
6 . The electronic device of claim 5 , wherein the method further comprises:
using the business dialogue management model to perform a business operation including the following to determine the reply sentence, when the user intent does not belong to the general intent set:
determining a target dialogue flow corresponding to the user intent;
determining the reply sentence according to dialogue nodes in the determined target dialogue flow.
7 . The electronic device of claim 3 , wherein the dialogue business customization file is obtained from a dialogue flow design server, and the dialogue flow design server is configured to interact with the dialogue flow design client to construct the dialogue business customization file.
8 . The electronic device of claim 3 , wherein the dialogue nodes include a dialogue start node, a user communication node, a user information identification node, and a slot filling node.
9 . The electronic device of claim 5 , wherein the dialogue nodes include a dialogue start node, a user communication node, a user information identification node, and a slot filling node.
10 . The electronic device of claim 6 , wherein the dialogue nodes include a dialogue start node, a user communication node, a user information identification node, and a slot filling node.
11 . The electronic device of claim 7 , wherein the dialogue nodes include a dialogue start node, a user communication node, a user information identification node, and a slot filling node.
12 . The method of claim 1 , wherein the dialogue management engine comprises a general dialogue management model and a business dialogue management model,
wherein, determining the reply sentence for the voice semantics based on the dialogue management engine includes:
determining a user intent indicated by the voice semantics; and
using the general dialogue management model to perform a general dialogue operation for the user intent when the user intent belongs to a general intent set, wherein the general dialogue operation includes any one of the following: transferring to manual operation, repeating broadcast operation, exiting dialogue operation, and interjection processing operation.
13 . The method of claim 12 , further comprising:
using the business dialogue management model to perform a business operation including the following to determine the reply sentence, when the user intent does not belong to the general intent set;
determining a target dialogue flow corresponding to the user intent;
determining the reply sentence according to dialogue nodes in the determined target dialogue flow.
14 . The method of claim 1 , wherein the dialogue business customization file is obtained from a dialogue flow design server, and the dialogue flow design server is configured to interact with the dialogue flow design client to construct the dialogue business customization file.
15 . The method of claim 1 , wherein the dialogue nodes include a dialogue start node, a user communication node, a user information identification node, and a slot filling node.
16 . The method of claim 12 , wherein the dialogue nodes include a dialogue start node, a user communication node, a user information identification node, and a slot filling node.
17 . The method of claim 13 , wherein the dialogue nodes include a dialogue start node, a user communication node, a user information identification node, and a slot filling node.
18 . The method of claim 14 , wherein the dialogue nodes include a dialogue start node, a user communication node, a user information identification node, and a slot filling node.