Dialogue management method and device
The dialogue management method uses a natural language understanding model and neural network algorithm to process user inputs, addressing the inefficiencies of traditional scripting methods by improving accuracy and adaptability in human-computer interactions.
Patent Information
- Application Number
- CN201810893032.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-08-07
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2038-08-07
AI Technical Summary
Existing dialogue management methods require extensive manual scripting and reconstruction of programs for every user input variation, leading to inflexible project management and incomplete sentence matching, resulting in inefficient human-computer interactions.
A dialogue management method utilizing a natural language understanding model to process user input data, determine historical record information, and generate responses based on a neural network algorithm, incorporating features like slot value information and scene classification to enhance context relevance prediction.
This approach reduces the need for extensive scripting, improves user input data accuracy, and enhances user experience by dynamically adapting to user interactions, thus optimizing human-computer dialogue efficiency.
Smart Images

Figure CN110858226B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a dialogue management method and device. Background Art
[0002] In recent years, with the continuous innovation and progress of artificial intelligence, the way users buy and sell goods, provide or receive services, and engage in other business activities has gradually changed to human-computer interaction. In the interaction process, it is necessary to use dialogue management methods to determine the user's intention based on the user's request, and then feed back the corresponding response results to the user. Therefore, the dialogue management method plays a vital role in the human-computer interaction process, and its quality directly affects the efficiency of human-computer interaction and the user experience.
[0003] The prior art dialogue management method is a dialogue management method based on speech template matching, which is specifically explained as follows: pre-writing program code for matching sentences, using the pre-written program code to match the user's input request, and then obtaining the sentence that the robot needs to reply from the background database based on the matching result. For example, if the user says "I want to buy a mobile phone", the machine will ask in return "What brand of mobile phone do you want?"
[0004] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art: First, in the prior art dialogue management method, programmers need to develop more regular scripts to match the user's possible input information. Every time the user adds a new script, the background server needs to reconstruct the program, and the project management is not flexible enough; Second, in the prior art dialogue management method, since it is impossible for the program to match all the sentences that the user wants to say in advance, it will cause the real online business to not be matched. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a dialog management method and device, which can reduce the design and maintenance costs of a large number of regular programs, improve the accuracy of identifying user input data, and enhance user experience.
[0006] To achieve the above objective, according to one aspect of an embodiment of the present invention, a dialog management method is provided.
[0007] A dialogue management method according to an embodiment of the present invention includes: processing user input data to be processed according to a natural language understanding model to obtain feature information of the user input data to be processed; determining historical record information corresponding to the user input data to be processed, and determining a current dialogue state according to the feature information and the historical record information; and generating response data corresponding to the user input data to be processed based on a neural network algorithm according to the current dialogue state.
[0008] Optionally, before analyzing the user input data to be processed according to the natural language understanding model, the method also includes: obtaining a first sample set, the first sample set containing at least one user input sample data; annotating the user input sample data to obtain feature information of the user input sample data to generate a second sample set, the second sample set containing the feature information of the user input sample data; constructing a training sample set using the first sample set and the second sample set; training the training sample set to obtain the natural language understanding model, the natural language understanding model taking the user input data as input and outputting the feature information of the user input data.
[0009] Optionally, the history record information includes: user historical input data, feature information of the user historical input data, and dialog status of the user historical input data, wherein the user historical input data is user input data of preset n rounds before the user input data to be processed, where n is an integer not less than zero.
[0010] Optionally, determining the current dialogue state according to the feature information and the historical record information includes: judging whether the user input data to be processed and the user historical input data are related according to an overlap principle, a scene classification principle or a model correlation principle; when the user input data to be processed and the user historical input data are related, updating the current dialogue state according to the dialogue state of the user historical input data and the user input data to be processed; when the user input data to be processed and the user historical input data are not related, generating a new dialogue state according to the user input data to be processed, and determining the new dialogue state as the current dialogue state.
[0011] Optionally, the feature information includes slot value information; and judging whether the user input data to be processed and the user historical input data are related according to the principle of overlap includes: calculating the overlap between the slot value information of the user input data to be processed and the slot value information of the user historical input data, and judging whether the overlap is greater than a preset overlap, and if so, confirming that the user input data to be processed and the user historical input data are related.
[0012] Optionally, the feature information includes scene information; and judging whether the user input data to be processed and the user historical input data are related according to the scene classification principle includes: judging whether the scene information of the user input data to be processed and the scene information of the user historical input data are the same; if so, it is considered that the scene of the user input data to be processed and the scene of the user historical input data are the same, and confirming that the user input data to be processed and the user historical input data are related.
[0013] Optionally, judging whether the user input data to be processed and the user historical input data are related according to the model correlation principle includes: performing a correlation analysis on the user input data to be processed and the user historical input data according to a pre-built context correlation model; if the correlation analysis result is related, confirming that the user input data to be processed and the user historical input data are related.
[0014] Optionally, before performing correlation analysis on the to-be-processed user input data and the user historical input data according to the pre-constructed context-related model, the method further comprises: constructing a context-related model based on a dynamic memory network algorithm.
[0015] Optionally, after determining whether the user input data to be processed and the user historical input data are related according to the overlap principle, the scene classification principle or the model correlation principle, the method further includes: calculating the gate weight of the user input data to be processed using a neural network gate function; calculating the correlation value between the user input data to be processed and the user historical input data according to the gate weight; if the correlation value is greater than a preset correlation threshold, confirming that the user input data to be processed and the user historical input data are related.
[0016] To achieve the above objective, according to another aspect of an embodiment of the present invention, an object management device is provided.
[0017] A dialogue management device according to an embodiment of the present invention includes: an acquisition module, which is used to process user input data to be processed according to a natural language understanding model to obtain feature information of the user input data to be processed; a determination module, which is used to determine historical record information corresponding to the user input data to be processed, and determine a current dialogue state according to the feature information and the historical record information; and a generation module, which is used to generate response data corresponding to the user input data to be processed based on a neural network algorithm according to the current dialogue state.
[0018] Optionally, the acquisition module is also used to: acquire a first sample set, the first sample set containing at least one user input sample data; perform annotation processing on the user input sample data to acquire feature information of the user input sample data to generate a second sample set, the second sample set containing feature information of the user input sample data; construct a training sample set using the first sample set and the second sample set; train the training sample set to obtain the natural language understanding model, the natural language understanding model inputting the user input data and outputting the feature information of the user input data.
[0019] Optionally, the history record information includes: user historical input data, feature information of the user historical input data, and dialog status of the user historical input data, wherein the user historical input data is user input data of preset n rounds before the user input data to be processed, where n is an integer not less than zero.
[0020] Optionally, the determination module is also used to: determine whether the user input data to be processed and the user historical input data are related based on an overlap principle, a scene classification principle or a model relevance principle; when the user input data to be processed and the user historical input data are related, update the current dialogue state based on the dialogue state of the user historical input data and the user input data to be processed; when the user input data to be processed and the user historical input data are not related, generate a new dialogue state based on the user input data to be processed, and determine the new dialogue state as the current dialogue state.
[0021] Optionally, the feature information includes slot value information; and the determination module is also used to: calculate the overlap between the slot value information of the user input data to be processed and the slot value information of the user's historical input data, and determine whether the overlap is greater than a preset overlap, and if so, confirm that the user input data to be processed is related to the user's historical input data.
[0022] Optionally, the feature information includes scene information; and the determination module is also used to: determine whether the scene information of the user input data to be processed is the same as the scene information of the user historical input data; if so, it is considered that the scene of the user input data to be processed is the same as the scene of the user historical input data, and confirm that the user input data to be processed is related to the user historical input data.
[0023] Optionally, the determination module is further used to: perform a correlation analysis on the user input data to be processed and the user historical input data according to a pre-built context-related model, and if the correlation analysis result is related, confirm that the user input data to be processed and the user historical input data are related.
[0024] Optionally, the determination module is further used to: construct a context-related model based on a dynamic memory network algorithm.
[0025] Optionally, the determination module is also used to: calculate the gate weight of the user input data to be processed using a neural network gate function; calculate the correlation value between the user input data to be processed and the user historical input data based on the gate weight; if the correlation value is greater than a preset correlation threshold, confirm that the user input data to be processed is related to the user historical input data.
[0026] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device is provided.
[0027] An electronic device according to an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the dialogue management method according to the embodiment of the present invention.
[0028] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer readable medium is provided.
[0029] A computer-readable medium according to an embodiment of the present invention stores a computer program, and when the program is executed by a processor, the dialog management method according to the embodiment of the present invention is implemented.
[0030] An embodiment of the above invention has the following advantages or beneficial effects: it can use the natural language understanding model to obtain feature information of user input data, and then determine the current dialogue state based on the historical record information, and then generate response data, thereby reducing the design and maintenance costs of a large number of regular programs, improving the accuracy of identifying user input data, and enhancing user experience; in the embodiment of the present invention, the training sample set composed of the first sample set and the second sample set is trained to obtain a natural language understanding model, so that a natural language understanding model can be constructed using massive sample set data, thereby improving the accuracy of identifying user input data; in the embodiment of the present invention, the correlation between the user input data to be processed and the user's historical input data is judged from multiple perspectives such as the overlap principle, the scene classification principle, or the model correlation principle, thereby improving the accuracy of predicting contextual relationships. Accuracy is further improved, and user experience is further enhanced; in an embodiment of the present invention, the overlap between the user input data to be processed and the user's historical input data is determined based on the slot value information, so that the relevance of the context can be predicted from the perspective of the keywords of the input data; in an embodiment of the present invention, the relevance between the user input data to be processed and the user's historical input data is determined based on the scene information, so that the relevance of the context can be predicted based on the scene of the input data; in an embodiment of the present invention, the relevance between the user input data to be processed and the user's historical input data is determined based on the pre-constructed context-related model, so that the relevance of the context can be predicted with the help of a model generated by massive data; in an embodiment of the present invention, the relevance value of the user input data to be processed and the user's historical input data is calculated based on the neural network gate function, so that the accuracy of predicting the context relevance can be improved.
[0031] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0033] Figure 1 is a schematic diagram of the main steps of the dialogue management method according to an embodiment of the present invention;
[0034] Figure 2 is a schematic diagram of slot value information under the mobile phone category according to an embodiment of the present invention;
[0035] Figure 3 is a schematic diagram of the format of the annotation slot value information according to an embodiment of the present invention;
[0036] Figure 4 is a schematic diagram of the main process of a dialogue management method according to a reference embodiment of the present invention;
[0037] Figure 5 It is an overall architecture diagram for implementing the dialogue management method of the present invention;
[0038] Figure 6 is a schematic diagram of main modules of a dialog management device according to an embodiment of the present invention;
[0039] Figure 7 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0040] Figure 8 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0041] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0042] Figure 1 Schematic diagram of the main steps of the dialogue management method according to an embodiment of the present invention. As an embodiment of the present invention, Figure 1 As shown, the main steps of the dialogue management method of the embodiment of the present invention may include:
[0043] Step S101: Process the user input data to be processed according to the natural language understanding model to obtain feature information of the user input data to be processed.
[0044] During the human-computer interaction process, a sentence of user input data and a sentence of machine response data appear alternately. Among them, the user input data can be text data directly input by the user, or it can be voice data input by the user. When the user input data is voice data, it is necessary to first use voice recognition software to recognize the voice data to obtain its corresponding text data. Response data refers to the data corresponding to the user input data fed back by the machine to the user, which can be response text data or response voice data. The machine in the present invention can be an intelligent robot, or it can be an intelligent navigation customer service on a shopping application, or it can be an intelligent customer service software on a computer, and the present invention is not limited to this.
[0045] One sentence of user input data and its corresponding one sentence of response data constitute one round of dialogue data. In the process of human-computer interaction, single or multiple rounds of dialogue data may be included. In the present invention, the user input data in each round of dialogue data may be used as the user input data to be processed. This step is to use the user input data to be processed as the input of the pre-built natural language understanding model, and then obtain the feature information of the user input data to be processed. For example, the user inputs "I want to buy a computer", and the feature information obtained is "buy" and "computer".
[0046] As another embodiment of the present invention, before analyzing the to-be-processed user input data according to the natural language understanding model in step S101, the dialog management method may further include: pre-building a natural language understanding model. Specifically, building a natural language understanding model may include:
[0047] Step S1011: obtaining a first sample set, wherein the first sample set may include at least one user input sample data;
[0048] Step S1012: performing labeling processing on the sample data input by the user, obtaining feature information of the sample data input by the user, so as to generate a second sample set, wherein the second sample set may include the feature information of the sample data input by the user;
[0049] Step S1013: construct a training sample set using the first sample set and the second sample set;
[0050] Step S1014: training the training sample set to obtain a natural language understanding model. The natural language understanding model takes user input data as input and outputs feature information of the user input data.
[0051] The user input data in the first sample set can be real online user data. Of course, in the present invention, after obtaining the real user data, it is necessary to clean the real data and remove words without information content in the real data, such as "haha" and "hehe", and also clean the blacklist data, such as "network prohibited voice" and "dirty words". The present invention performs simple and manual labeling on the cleaned real user data, and then obtains the feature information of the real user data. After a long period of statistics and accumulation, the online real user data belongs to massive data, thus improving the accuracy of the model.
[0052] In an embodiment of the present invention, feature information may include scenario information and slot value information. Scenario information refers to determining the user's intention based on user data. For example, if a user inputs "I want to buy a computer" through intelligent customer service, it can be determined that the user's purpose is to buy, and pre-sales consultation is conducted through intelligent customer service; if a user inputs "I want to return the goods I ordered before" through intelligent customer service, it can be determined that the user's purpose is to return the goods, and after-sales return consultation is conducted through intelligent customer service. Slot value information refers to keyword information in the data, and slot value information is divided into slot value information inform_slot in the user input data and slot value information request_slot that the machine wants. For example, if a user inputs "I want to buy a Xiaomi mobile phone with a larger screen", it is necessary to mark "Xiaomi" as the brand word in inform_slot and "mobile phone" as the product word in inform_slot. The machine only knows that Xiaomi mobile phones cannot make recommendations immediately. The machine needs to know other slot value information request_slot such as price, color, and memory to make better product recommendations. Figure 2 It is a schematic diagram of slot value information under the mobile phone category according to an embodiment of the present invention, wherein the slot value information may be in the form of a key-value pair, for example, the key of the slot value information is a brand word, and the value is Huawei.
[0053] The above-mentioned simple labeling of the cleaned real user data refers to the program's preliminary labeling of the real user data according to the rules established in advance. Optimized labeling refers to sending the simply labeled data to the labeling personnel, who perform manual labeling, modify the errors, retain the correct ones, and generate feature information of the real user data. Considering that the present invention involves multiple rounds of conversations, the slot value information that needs to be labeled includes not only product words, brand words, modifiers, inquiry scope, channel number and other information, but also attribute slot values, such as the size, color, and purpose of the product. It may also be necessary to label dynamic slot values, that is, slot values that may change, such as the memory size under the mobile phone category and the size under the clothing category. Figure 3 It is a schematic diagram of the format of the annotation slot value information according to an embodiment of the present invention.
[0054] Step S102: Determine the historical record information corresponding to the input data to be processed by the user, and determine the current dialogue state according to the feature information and the historical record data information. The dialogue state is the dialogue state obtained by the machine according to the user input data feedback during the entire multi-round conversation process. For example, the user's first round of input data is "I want to buy a computer", and the machine obtains the dialogue state of "the user needs to buy a computer" based on the user's first round of input data, and the response data is "What brand of computer do you need", and then the user's second round of input data is "Brand A", and then the machine obtains the current dialogue state of "the user needs to buy a computer of brand A" based on the user's second round of input data and the previous dialogue state.
[0055] In an embodiment of the present invention, the historical record information may include: user historical input data, feature information of the user historical input data, and the dialogue state of the user historical input data. The user historical input data is the user input data of the preset n rounds before the user input data to be processed, and n is an integer not less than zero. If n is zero, the historical record information is set to empty. The historical record information is used to allow the machine to have memory knowledge. For example, in the above example, the user's second round of input data is the user input data to be processed, and the machine needs to remember what the user's first round of input data is. In this way, in the subsequent human-computer interaction, the machine remembers that the user's purpose is to buy a computer, and will consult the user for the specific information of the computer required, such as brand, price and size. The purpose of recording the feature information of the first round of input data is to use the feature information to determine the relevance of the context, which will be explained in detail below and will not be explained in detail here. The purpose of recording the dialogue state of the user's historical input data is to determine whether the dialogue state of the user input data to be processed has changed, which will be explained in detail below and will not be explained in detail here.
[0056] As another embodiment of the present invention, determining the current dialog state according to the feature information and the historical record information in step S102 may include:
[0057] S1021: judging whether the user input data to be processed is related to the user historical input data according to the overlap principle, the scene classification principle or the model relevance principle;
[0058] S1022: When the user input data to be processed is related to the user historical input data, the current dialog state is updated according to the dialog state of the user historical input data and the user input data to be processed;
[0059] S1023: When the to-be-processed user input data and the user historical input data are not related, a new dialog state is generated according to the to-be-processed user input data, and the new dialog state is determined as the current dialog state.
[0060] In the present invention, firstly, at least one of the three options of the overlap principle, the scene classification principle or the model relevance principle is used to determine whether the user's historical input data and the to-be-processed user input data are related. If they are related, the previous dialog state is updated, otherwise, a new dialog state is started. For example, the user's first round input data is "I want to buy a computer", and the machine determines the dialog state as "the user needs to buy a computer" based on the first round input data, and then sends the user a response data of "what brand of computer do you need", and then the user's second round input data is "I want to buy a mobile phone", and the machine determines that the user's first round input data and the second round input data are not related, therefore, the dialog state is generated as "the user needs to buy a mobile phone", and sends the user a response data of "what brand of mobile phone do you need", and then the user's third round input data is "Brand B", and the machine determines the dialog state as "the user needs to buy a computer" based on the first round input data, and the machine determines that the user's second round input data and the third round input data are related, and updates the dialog state to "the user needs to buy a mobile phone of brand B".
[0061] It should be noted that the user historical input data in the present invention is the user input data of the preset n rounds before the user input data to be processed, and n is an integer not less than 0. Therefore, if the user input data to be processed is the user input data of the fifth round, and the value of n is 3, the method for determining whether the user input data of the fifth round is related to the user historical input data is specifically explained as follows:
[0062] First, determine whether the fifth round of user input data is related to the fourth round of user input data. If so, update the current dialogue state according to the dialogue state corresponding to the fourth round of user input data and the fifth round of user input data.
[0063] When the fifth-round user input data is not related to the fourth-round user input data, determine whether the fifth-round user input data is related to the third-round user input data. If so, update the current dialogue state according to the dialogue state corresponding to the third-round user input data and the fifth-round user input data.
[0064] When the fifth-round user input data is not related to the third-round user input data, determine whether the fifth-round user input data is related to the second-round user input data. If so, update the current dialogue state according to the dialogue state corresponding to the third-round user input data and the fifth-round user input data.
[0065] When the fifth round of user input data is unrelated to the second round of user input data, the current dialog state is directly generated according to the fifth round of user input data.
[0066] In an embodiment of the present invention, after determining whether the user input data to be processed and the user historical input data are related in the above step S1021, the dialogue management method may further include: calculating the gate weight of the user input data to be processed using a neural network gate function; calculating the correlation value of the user input data to be processed and the user historical input data according to the gate weight; if the correlation value is greater than a preset correlation threshold, confirming that the user input data to be processed and the user historical input data are related. In the present invention, after determining that the user input data to be processed and the user historical input data are related, the correlation value of the user input data to be processed and the user historical input data can be calculated, and the specific correlation degree can be obtained according to the correlation value. When the correlation degree reaches a certain value, it is considered that the user input data to be processed and the user historical input data are related, which can further ensure the accuracy of the context correlation prediction.
[0067] As another embodiment of the present invention, the characteristic information may include: slot value information. Therefore, judging whether the to-be-processed user input data and the user's historical input data are related according to the principle of overlap in the above step S1021 may include: calculating the overlap between the slot value information of the to-be-processed user input data and the slot value information of the user's historical input data, and judging whether the overlap is greater than a preset overlap, and if so, confirming that the to-be-processed user input data and the user's historical input data are related. For example, if the user's first round input data is "I want to buy a computer", then the slot value information of the first round input data is "computer", and the user's second round input data is "I want to buy a computer of brand A", then the slot value information of the second round input data is "computer" and "brand A", and it is determined that the slot value information of the user's first round input data and the slot value information of the user's second round input data have a high overlap, so it is considered that the user's first round input data and the user's second round input data are related.
[0068] As another embodiment of the present invention, the characteristic information may include: scene information. Therefore, judging whether the to-be-processed user input data and the user's historical input data are related according to the scene classification principle in the above step S1021 may include: judging whether the scene information of the to-be-processed user input data and the scene information of the user's historical input data are the same, and if so, it is considered that the scene of the to-be-processed user input data and the scene of the user's historical input data are the same, and confirming that the to-be-processed user input data and the user's historical input data are related. For example, if the user's first round input data is "I want to buy a computer", then the scene information of the first round input data is "buy a computer", and the user's second round input data is "I want to buy a mobile phone", then the scene information of the second round input data is "buy a mobile phone", then it is considered that the scene information of the user's first round input data and the scene information of the user's second round input data are different, and therefore it is considered that the user's first round input data and the user's second round input data are unrelated.
[0069] As another embodiment of the present invention, judging whether the user input data to be processed and the user historical input data are related according to the model correlation principle in the above-mentioned step S1021 may include: performing a correlation analysis on the user input data to be processed and the user historical input data according to a pre-built context correlation model; if the correlation analysis result is related, it is confirmed that the user input data to be processed and the user historical input data are related.
[0070] In an embodiment of the present invention, before performing correlation analysis on the user input data to be processed and the user's historical input data according to the pre-constructed context-related model, the dialogue management method may also include: constructing a context-related model based on a dynamic memory network algorithm. The dynamic memory network algorithm in the present invention includes four submodules, namely: an input text submodule, a question submodule, a scenario memory network submodule and an answer generation submodule. The question submodule in the present invention is the user input data to be processed, the scenario memory network submodule constructs the relationship between the user input data to be processed and the user's historical input data in a deep learning neural network manner, and the answer generation submodule predicts the relationship between the user input data to be processed and the user's historical input data, and outputs yes if there is a relationship, and outputs no if there is no relationship.
[0071] The input text submodule converts Chinese character phrases into distributed vector numbers that can be recognized by the computer. The input information can be voice data or text data. If it is voice data, it is necessary to first convert the voice data into text data with the help of a voice recognition model, and then use natural language processing technology. In the present invention, the input sequence T1 is composed of characters w1, w2, ..., w T The input sequence of the present invention is encoded by a recurrent neural network (RNN) (which can be but not limited to RNN encoding, or other encoding forms, which are not limited in the present invention). At each time t, the RNN network updates the hidden state h t =RNN(L[w t ],h t-1 ), where L is the encoding matrix, w t is the character index of the tth Chinese character in the input sequence. If the user input text is a single short sentence, it directly enters the RNN network and outputs the hidden state; if the user input text is a relatively long sequence, the present invention will extract the slot value and then store the slot value in a list, and the vector of the hidden state is used as the output. The present invention can also use GRU (Gated Recurrent Unit, which is a variant of recurrent neural network with a relatively simple structure, consisting of input gate, forget gate, and output gate function) with lower computational complexity for encoding. Assume that at time t, the input text sequence is x t , the hidden state is h t, then the structure of GRU is defined as follows:
[0072] z t =σ(W (z) x t +U (z) h t-1 +b (z) )
[0073] r t =σ(W (r) x t +U (r) h t-1 +b (r) )
[0074]
[0075]
[0076] in is a custom operator, W is the weight of the neural network input layer, U is the weight of the hidden layer, b is a constant, W (z) , W (r) , U (z) , U (r) , These 7 are all hyperparameters, which can be summarized as h t =GRU(x t ,h t-1 ).
[0077] The question submodule is the same as the input text sequence, which is also input into the model in the form of characters and encoded by the recurrent neural network RNN. Q It consists of a sequence of strings, encoded as mathematical vectors, Where L represents the character phrase encoding matrix, Represents the index of the t-th character or word in the question.
[0078] The episodic memory network submodule is used to update the episodic memory inside the input text submodule. The core component is to iterate the memory through the attention mechanism. In each iteration, the comprehensive vector c of the attention mechanism takes into account the current question q and the previous memory m i-1 , generating the current scenario e i , then the scenario vector e i and memory vector m i Will be used, the formula for updating the contextual memory network is m i =GRU(e i ,m i-1 ), the initial vector of GRU is the problem itself m 0=q. As the network is built, multiple scenarios may be needed. For example, in the intelligent assistant, the user's first sentence is "I browsed brand B mobile phones yesterday", and the second sentence is "But I want to buy brand C mobile phones today". These two sentences can be regarded as multiple scenarios. The user's current input information "I want to buy a brand C mobile phone with a larger screen" is equivalent to the question. The dynamic memory network needs to identify whether the current information is related to the previous input based on the user's first two inputs. The present invention uses the gate function as the attention mechanism, and the calculation formula is where c t is the input text, m i-1 is a memory network, q is a question, which in the present invention refers to the current user input information. When the gate function reaches a preset threshold or satisfies the maximum number of iterations, the network converges and stops iterating.
[0079] The answer generation submodule is used to generate answers through vector calculation. The present invention can build another GRU network to generate answers. The last state m of the memory network TM As the input of the GRU network, at each moment, the input also includes the question vector q, the hidden state a of the previous layer t-1 and the previous prediction output y t-1 , the calculation formula is y t =soft max(W (a) a t ), a t =GRU([y t-1 ,q],a t-1 ), the loss function of the present invention is cross entropy, which makes a binary prediction of "yes" or "no", indicating that the context is "relevant" or "irrelevant".
[0080] In the present invention, the parameters of the context-dependent model constructed based on the dynamic memory network algorithm are set as follows:
[0081] (1) The number of cells in the recurrent neural network, expressed in English as recurrent_cell_size, can be set to 128 in the present invention;
[0082] (2) The vector dimension of the in-depth text characters is expressed as D in English, which can be set to 50 in the present invention;
[0083] (3) The learning rate of the optimization algorithm in deep learning, expressed in English as Learning_rate, can be set to 0.005 in the present invention;
[0084] (4) The random neuron loss rate of the input layer, denoted as Input_p in English, can be set to 0.5 in the present invention;
[0085] (5) The random neuron loss rate of the output layer, denoted as Output_p in English, can be set to 0.5 in the present invention;
[0086] (6) The amount of data for each training batch is expressed as Batch_size in English, which can be set to 128 in the present invention;
[0087] (7) Memory fragments in the episodic memory network, expressed in English as Passes, can be set to 4 in the present invention;
[0088] (8) The hidden layer network size of the forward propagation is expressed as Ff_hidden_size in English, which can be set to 256 in the present invention;
[0089] (9) Weight automatic decay rate, expressed in English as Weight_decay, which can be set to 0.00000001 in the present invention;
[0090] (10) The number of problems that the network can train each time, expressed in English as Training_iterations_count, which can be set to 400000 in the present invention;
[0091] (11) The number of iterations in the validation set that the display is performed once, which is expressed in English as Display_step. The present invention can set it to 100;
[0092] (12) Conversation context, expressed in English as Context;
[0093] (13) Sentence ending marker, expressed in English as Input_sentence_endings;
[0094] (14) The gate function of the neural network is expressed in English as Input_gru.
[0095] Step S103: According to the current dialogue state, generate response data corresponding to the user input data to be processed based on the neural network algorithm. For example, if the user input data is "I want to buy a mobile phone of brand A", the brand slot value is "A" and the product slot value is "mobile phone". After the machine obtains the slot value information inform_slot of the user input data, it cannot make a recommendation immediately. It needs to know other slot values such as price, color, memory, etc. Therefore, the machine will generate response data "How much is the price of the mobile phone you want", and the user will continue to input "I want to buy a mobile phone with a price range of 1,000 yuan to 2,000 yuan" after obtaining the machine's response data. Then the machine will obtain the dialogue state of "the user wants to buy a mobile phone with a brand A and a price range of 1,000 yuan to 2,000 yuan", and will then ask for other slot value information, and then recommend mobile phones to the user. If the machine finds that there is no mobile phone suitable for the user, it will recommend other similar mobile phones to the user.
[0096] Figure 4 FIG. 1 is a schematic diagram of the main process of a dialog management method according to a reference embodiment of the present invention. Figure 4 As shown, the main process of the dialogue management method may include:
[0097] Step S401: construct a natural language understanding model, the constructed natural language understanding model inputs user input data and outputs scenario information and slot value information of the user input data;
[0098] Step S402: Process the user input data to be processed according to the natural language understanding model to obtain scene information and slot value information of the user input data to be processed;
[0099] Step S403: determining the historical record information corresponding to the user input data to be processed, where the determined historical record information may include: user historical input data, feature information of the user historical input data, and dialog status of the user historical input data, where the user historical input data is user input data of a preset n rounds before the user input data to be processed, where n is an integer not less than zero;
[0100] Step S404: Calculate the overlap between the slot value information of the user input data to be processed and the slot value information of the user's historical input data;
[0101] Step S405: determine whether the overlap degree is greater than a preset overlap degree, if so, execute step S409, otherwise, execute step S411;
[0102] Step S406: Determine whether the scene information of the to-be-processed user input data is the same as the scene information of the user's historical input data. If so, execute step S409; otherwise, execute step S411.
[0103] Step S407: constructing a context-related model based on a dynamic memory network algorithm, and performing correlation analysis on the to-be-processed user input data and the user's historical input data according to the pre-constructed context-related model;
[0104] Step S408: according to the correlation analysis result, determine whether the scene information of the to-be-processed user input data is related to the user's historical input data, if so, execute step S409, otherwise, execute step S411;
[0105] Step S409: Calculate the correlation value between the user input data to be processed and the user historical input data, and determine whether the calculated correlation value is greater than a preset correlation threshold. If so, execute step S410; otherwise, execute step S411;
[0106] Step S410: updating the current dialogue state according to the dialogue state of the user's historical input data and the user input data to be processed;
[0107] Step S411: generating a new dialogue state according to the user input data to be processed, and determining the new dialogue state as the current dialogue state;
[0108] Step S412: Generate response data corresponding to the user input data to be processed based on the neural network algorithm according to the current dialogue state.
[0109] It should be noted that the construction of the natural language understanding model in the above step S401 is specifically explained in the above text (steps S1011 to S1014), and will not be repeated here. In addition, the above text also explains in detail how to calculate the relevance value of the user input data to be processed and the user's historical input data, so it will not be repeated in step S409. It should also be noted that the above steps are as long as the user input data to be processed and the user's historical input data meet the requirements in terms of slot value overlap, scene information, or correlation analysis results, then it can be confirmed that the user input data to be processed and the user's historical input data are related, and then step S409 is executed. In practical applications, it can be set that all three aspects meet the requirements before it can be confirmed that the user input data to be processed and the user's historical input data are related, or a method of setting weights for these three aspects is used. When the weight value meets a certain condition (for example, greater than a certain value), it can be confirmed that the user input data to be processed and the user's historical input data are related. Of course, other methods can also be used, and the present invention does not limit this.
[0110] For ease of understanding, taking the “machine” as an “intelligent assistant” as an example, the overall framework of the dialogue management method of the present invention is described in detail. Figure 5 The overall architecture diagram of the dialogue management method of the present invention is shown in FIG. Figure 5As shown, the overall framework for implementing the dialogue management method of the present invention may include: an intelligent assistant multi-round dialogue annotation module, an intelligent assistant multi-round dialogue framework module, a dialogue management context relationship extraction module, a dynamic memory network algorithm module, a multi-round dialogue effect module and an online test flow cutting module.
[0111] Among them, the intelligent assistant multi-round dialogue annotation module includes three units: voice assistant log table, dialogue cleaning and annotation slot value design. The voice assistant log table unit is used to extract real online user data, let the annotators annotate, obtain the annotated corpus, input the real data and the annotated prediction into the model training, and generate a natural speech understanding model. The dialogue cleaning user cleans the user's input data and the intelligent assistant's response data. The annotation slot value design is used to define which slot value information needs to be obtained.
[0112] The multi-round dialogue framework module of the intelligent assistant is the overall framework logic abstraction of the multi-round conversation, including: natural language understanding module, dialogue management submodule and natural language generation submodule. Among them, the natural speech understanding module is used to identify the user's intention (that is, to identify the user's scenario information) and extract slot value information such as product words, brand words and modifiers. The natural speech understanding module can be subdivided into a scenario intention classification model and a user natural language understanding model. The role of the scenario intention classification model is to classify the user's input sentence in the intelligent assistant and determine which business scenario it is; the role of the user natural language understanding model is to analyze the user's input sentence in the intelligent assistant and identify slot value information such as brand words, product words and modifiers. The dialogue management submodule is used to identify the user's current dialogue state and determine whether the dialogue state needs to be switched. The dialogue management submodule can be subdivided into a multi-round dialogue unit, a knowledge graph unit and a dialogue state maintenance unit. The multi-round dialogue unit is a multiple interaction between the intelligent assistant and the user; the knowledge graph unit is to enable the intelligent assistant to have memory knowledge, such as when the user says "the capital of China", the intelligent assistant knows that it is Beijing; the dialogue state maintenance unit is a unit that enables the dialogue to run normally during the entire multi-round dialogue process. The natural language generation module is used by the intelligent assistant to generate response data.
[0113] The dialogue management contextual relationship extraction module is used to manage context, identify whether the user's current input still belongs to the previous round of dialogue, and determine which extracted product words and brand words need to be remembered and which can be forgotten. The dialogue management contextual relationship extraction module is divided into three levels, namely slot value overlap, intent overlap, and dynamic memory network algorithm. These three levels predict the relationship of context from three different angles.
[0114] The dynamic memory network algorithm module is used to manage the context of multiple rounds of dialogue. The words entered by the user in the intelligent assistant will be matched with the previous sentence in the dynamic memory network. If the network features match, it will be predicted that the context is relevant, and the current dialogue will not be closed. If the network features do not match, it will be predicted that the context is irrelevant, and the current dialogue will be closed and the next dialogue state will be carried out. In this module, the user's input previous information and the user's input current information are input into the dynamic network with contextual memory to obtain the prediction result, so as to determine whether the context is related.
[0115] The multi-round dialogue effect module includes two parts: algorithm evaluation indicators and business evaluation indicators, which are used to evaluate the accuracy of the dialogue management algorithm. The online test traffic cutting module is used to test the intelligent assistant before it goes online, test various user input data, and obtain online model test results. This can verify the effect of the dialogue management method, find problems and make improvements based on the test results, thereby ensuring the efficiency and reliability of the online test.
[0116] It can be seen from the technical solution of dialogue management according to the embodiment of the present invention that the natural language understanding model can be used to obtain the feature information of the user input data, and then the current dialogue state can be determined according to the historical record information to generate the response data, thereby reducing the design and maintenance costs of a large number of regular programs, improving the accuracy of identifying the user input data, and enhancing the user experience; in the embodiment of the present invention, the training sample set composed of the first sample set and the second sample set is trained to obtain the natural language understanding model, so that the natural language understanding model can be constructed using a large amount of sample set data, thereby improving the accuracy of identifying the user input data; in the embodiment of the present invention, the correlation between the user input data to be processed and the user's historical input data is judged from multiple perspectives such as the overlap principle, the scene classification principle or the model correlation principle, thereby improving the accuracy of predicting the contextual relationship. Accuracy is further improved, and user experience is further enhanced; in an embodiment of the present invention, the overlap between the user input data to be processed and the user's historical input data is determined based on the slot value information, so that the relevance of the context can be predicted from the perspective of the keywords of the input data; in an embodiment of the present invention, the relevance between the user input data to be processed and the user's historical input data is determined based on the scene information, so that the relevance of the context can be predicted based on the scene of the input data; in an embodiment of the present invention, the relevance between the user input data to be processed and the user's historical input data is determined based on the pre-constructed context-related model, so that the relevance of the context can be predicted with the help of a model generated by massive data; in an embodiment of the present invention, the relevance value of the user input data to be processed and the user's historical input data is calculated based on the neural network gate function, so that the accuracy of predicting the context relevance can be improved.
[0117] Figure 6Schematic diagram of the main modules of the dialog management device according to an embodiment of the present invention. Figure 6 As shown, the dialogue management device 600 of the embodiment of the present invention mainly includes the following modules: an acquisition module 601, a determination module 602 and a generation module 603.
[0118] Among them, the acquisition module 601 can be used to process the user input data to be processed according to the natural language understanding model to obtain the feature information of the user input data to be processed. The determination module 602 can be used to determine the historical record information corresponding to the user input data to be processed, and determine the current dialogue state according to the feature information and the historical record information. The generation module 603 can be used to generate response data corresponding to the user input data to be processed based on the neural network algorithm according to the current dialogue state.
[0119] In an embodiment of the present invention, the acquisition module 601 can also be used to: acquire a first sample set, the first sample set includes at least one user input sample data; perform labeling processing on the user input sample data to acquire feature information of the user input sample data to generate a second sample set, the second sample set includes feature information of the user input sample data; construct a training sample set using the first sample set and the second sample set; train the training sample set to obtain a natural language understanding model, the natural language understanding model inputs the user input data and outputs the feature information of the user input data.
[0120] In an embodiment of the present invention, the history record information may include: user history input data, feature information of user history input data, and dialog status of user history input data. The user history input data is the user input data of preset n rounds before the user input data to be processed, where n is an integer not less than zero.
[0121] In an embodiment of the present invention, the determination module 602 can also be used to: determine whether the user input data to be processed and the user historical input data are related based on the overlap principle, the scene classification principle or the model correlation principle; when the user input data to be processed and the user historical input data are related, update the current dialogue state based on the dialogue state of the user historical input data and the user input data to be processed; when the user input data to be processed and the user historical input data are not related, generate a new dialogue state based on the user input data to be processed, and determine the new dialogue state as the current dialogue state.
[0122] In an embodiment of the present invention, the feature information may include slot value information. The determination module 602 may also be used to calculate the overlap between the slot value information of the to-be-processed user input data and the slot value information of the user's historical input data, and determine whether the overlap is greater than a preset overlap, and if so, confirm that the to-be-processed user input data is related to the user's historical input data.
[0123] In an embodiment of the present invention, the feature information may further include: scene information. The determination module 602 may also be used to: determine whether the scene information of the to-be-processed user input data is the same as the scene information of the user's historical input data, and if so, consider that the scene of the to-be-processed user input data is the same as the scene of the user's historical input data, and confirm that the to-be-processed user input data is related to the user's historical input data.
[0124] In an embodiment of the present invention, the determination module 602 can also be used to: perform correlation analysis on the user input data to be processed and the user historical input data according to a pre-built context-related model, and if the correlation analysis result is related, it is confirmed that the user input data to be processed and the user historical input data are related.
[0125] In the embodiment of the present invention, the determination module 602 may also be used to: construct a context-related model based on a dynamic memory network algorithm.
[0126] In the embodiment of the present invention, the determination module 602 can also be used to: calculate the gate weight of the user input data to be processed by using the neural network gate function; calculate the correlation value between the user input data to be processed and the user's historical input data according to the gate weight; if the correlation value is greater than a preset correlation threshold, confirm that the user input data to be processed is correlated with the user's historical input data.
[0127] From the above description, it can be seen that the natural language understanding model can be used to obtain feature information of user input data, and then the current dialogue state can be determined according to the historical record information, and then the response data can be generated, thereby reducing the design and maintenance costs of a large number of regular programs, improving the accuracy of identifying user input data, and enhancing user experience; in the embodiment of the present invention, the training sample set composed of the first sample set and the second sample set is trained to obtain a natural language understanding model, so that a natural language understanding model can be constructed using a large amount of sample set data, thereby improving the accuracy of identifying user input data; in the embodiment of the present invention, the correlation between the user input data to be processed and the user's historical input data is judged from multiple perspectives such as the overlap principle, the scene classification principle, or the model correlation principle, thereby improving the accuracy of predicting contextual relationships, and further The user experience is improved step by step; in the embodiment of the present invention, the overlap between the user input data to be processed and the user's historical input data is determined according to the slot value information, so that the relevance of the context can be predicted from the perspective of the keywords of the input data; in the embodiment of the present invention, the relevance between the user input data to be processed and the user's historical input data is determined according to the scene information, so that the relevance of the context can be predicted according to the scene of the input data; in the embodiment of the present invention, the relevance between the user input data to be processed and the user's historical input data is determined according to the pre-constructed context-related model, so that the relevance of the context can be predicted with the help of a model generated by massive data; in the embodiment of the present invention, the relevance value of the user input data to be processed and the user's historical input data is calculated according to the neural network gate function, so as to improve the accuracy of predicting the context relevance.
[0128] Figure 7 An exemplary system architecture 700 is shown to which the dialog management method or dialog management apparatus according to the embodiment of the present invention can be applied.
[0129] like Figure 7 As shown, system architecture 700 may include terminal devices 701, 702, 703, network 704 and server 705. Network 704 is used to provide a medium for communication links between terminal devices 701, 702, 703 and server 705. Network 704 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0130] Users can use terminal devices 701, 702, and 703 to interact with server 705 through network 704 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 701, 702, and 703, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).
[0131] The terminal devices 701 , 702 , and 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0132] The server 705 may be a server that provides various services, such as a backend management server (only for example) that supports shopping websites browsed by users using the terminal devices 701, 702, and 703. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only for example) to the terminal device.
[0133] It should be noted that the dialogue management method provided in the embodiment of the present invention is generally executed by the server 705 , and accordingly, the dialogue management device is generally arranged in the server 705 .
[0134] It should be understood that Figure 7 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.
[0135] Reference below Figure 8 , which shows a schematic diagram of the structure of a computer system 800 of a terminal device suitable for implementing an embodiment of the present invention. Figure 8 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0136] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The CPU 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0137] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.
[0138] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processing unit (CPU) 801, the above-mentioned functions defined in the system of the present invention are executed.
[0139] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0140] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0141] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be set in a processor, for example, they may be described as: a processor includes an acquisition module, a determination module, and a generation module. The names of these modules do not constitute a limitation on the modules themselves in some cases. For example, the acquisition unit may also be described as "a module that processes the user input data to be processed according to the natural language understanding model and obtains feature information of the user input data to be processed".
[0142] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: processing the user input data to be processed according to the natural language understanding model, obtaining the feature information of the user input data to be processed; determining the historical record information corresponding to the user input data to be processed, and determining the current dialogue state according to the feature information and the historical record information; and generating response data corresponding to the user input data to be processed based on the neural network algorithm according to the current dialogue state.
[0143] According to the technical solution of the embodiment of the present invention, it is possible to use a natural language understanding model to obtain feature information of user input data, and then determine the current dialogue state based on historical record information, and then generate response data, thereby reducing the design and maintenance costs of a large number of regular programs, improving the accuracy of identifying user input data, and enhancing user experience; in the embodiment of the present invention, the training sample set composed of the first sample set and the second sample set is trained to obtain a natural language understanding model, so that a natural language understanding model can be constructed using massive sample set data, thereby improving the accuracy of identifying user input data; in the embodiment of the present invention, the correlation between the user input data to be processed and the user's historical input data is judged from multiple perspectives such as the overlap principle, the scene classification principle, or the model correlation principle, thereby improving the accuracy of predicting contextual relationships, Further improve user experience; in the embodiment of the present invention, the overlap between the user input data to be processed and the user's historical input data is determined based on the slot value information, so that the relevance of the context can be predicted from the perspective of the keywords of the input data; in the embodiment of the present invention, the relevance between the user input data to be processed and the user's historical input data is determined based on the scene information, so that the relevance of the context can be predicted based on the scene of the input data; in the embodiment of the present invention, the relevance between the user input data to be processed and the user's historical input data is determined based on the pre-constructed context-related model, so that the relevance of the context can be predicted with the help of a model generated by massive data; in the embodiment of the present invention, the relevance value of the user input data to be processed and the user's historical input data is calculated based on the neural network gate function, so that the accuracy of predicting the context relevance can be improved.
[0144] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A dialogue management method, It is characterized in that include: Processing the user input data to be processed according to the natural language understanding model to obtain feature information of the user input data to be processed; The natural language understanding model inputs user input data and outputs feature information of the user input data; The feature information includes scene information and slot value information; Determine the historical record information corresponding to the to-be-processed user input data, and determine the current dialog state according to the feature information and the historical record information; The historical record information includes: user historical input data, feature information of the user historical input data, and the dialog state of the user historical input data, wherein the user historical input data is the user input data of the preset n rounds before the user input data to be processed, where n is an integer not less than zero; specifically including: judging whether the user input data to be processed and the user historical input data are related according to the overlap principle, the scene classification principle, or the model relevance principle using a pre-built context-related model; after judging that the user input data to be processed and the user historical input data are related according to the overlap principle, the scene classification principle, or the model relevance principle using the pre-built context-related model, using a neural network gate The function calculates the gate weight of the user input data to be processed; calculates the correlation value of the user input data to be processed and the user historical input data according to the gate weight; if the correlation value is greater than a preset correlation threshold, confirms that the user input data to be processed is correlated with the user historical input data; when the user input data to be processed is correlated with the user historical input data, updates the current dialog state according to the dialog state of the user historical input data in the historical record information and the user input data to be processed; when the user input data to be processed is not correlated with the user historical input data, generates a new dialog state according to the user input data to be processed, and determines the new dialog state as the current dialog state; According to the current dialog state, response data corresponding to the user input data to be processed is generated based on a neural network algorithm.
2. The method according to claim 1, It is characterized in that Before analyzing the user input data to be processed according to the natural language understanding model, the method further includes: Acquire a first sample set, wherein the first sample set includes at least one user input sample data; Performing labeling processing on the user input sample data to obtain feature information of the user input sample data to generate a second sample set, wherein the second sample set includes the feature information of the user input sample data; constructing a training sample set using the first sample set and the second sample set; The training sample set is trained to obtain the natural language understanding model.
3. The method according to claim 1, It is characterized in that The feature information includes slot value information; and judging whether the to-be-processed user input data and the user historical input data are related according to the overlap principle includes: The overlap between the slot value information of the to-be-processed user input data and the slot value information of the user's historical input data is calculated, and it is determined whether the overlap is greater than a preset overlap. If so, it is confirmed that the to-be-processed user input data is related to the user's historical input data.
4. The method according to claim 1, It is characterized in that The feature information includes scene information; And judging whether the to-be-processed user input data and the user historical input data are related according to the scene classification principle includes: Determine whether the scenario information of the user input data to be processed is the same as the scenario information of the user historical input data. If so, it is considered that the scenario of the user input data to be processed is the same as the scenario of the user historical input data, and confirm that the user input data to be processed is related to the user historical input data.
5. The method according to claim 1, It is characterized in that Judging whether the to-be-processed user input data and the user historical input data are related according to the model relevance principle includes: A correlation analysis is performed on the user input data to be processed and the user historical input data according to the context-related model. If the correlation analysis result is related, it is confirmed that the user input data to be processed and the user historical input data are related.
6. The method according to claim 5, It is characterized in that Before performing correlation analysis on the to-be-processed user input data and the user historical input data according to the pre-constructed context-related model, the method further comprises: constructing a context-related model based on a dynamic memory network algorithm.
7. A dialogue management device, It is characterized in that include: An acquisition module, used to process the user input data to be processed according to the natural language understanding model, and obtain feature information of the user input data to be processed; The natural language understanding model inputs user input data and outputs feature information of the user input data; The feature information includes scene information and slot value information; A determination module, used to determine the historical record information corresponding to the to-be-processed user input data, and determine the current dialog state according to the feature information and the historical record information; The historical record information includes: user historical input data, feature information of the user historical input data, and the dialog state of the user historical input data, wherein the user historical input data is the user input data of the preset n rounds before the user input data to be processed, where n is an integer not less than zero; specifically used to: determine whether the user input data to be processed and the user historical input data are related according to the overlap principle, the scene classification principle, or the model relevance principle using a pre-built context-related model; after determining that the user input data to be processed and the user historical input data are related according to the overlap principle, the scene classification principle, or the model relevance principle using the pre-built context-related model, using a neural network gate The function calculates the gate weight of the user input data to be processed; calculates the correlation value of the user input data to be processed and the user historical input data according to the gate weight; if the correlation value is greater than a preset correlation threshold, confirms that the user input data to be processed is correlated with the user historical input data; when the user input data to be processed is correlated with the user historical input data, updates the current dialog state according to the dialog state of the user historical input data in the historical record information and the user input data to be processed; when the user input data to be processed is not correlated with the user historical input data, generates a new dialog state according to the user input data to be processed, and determines the new dialog state as the current dialog state; A generation module is used to generate response data corresponding to the user input data to be processed based on a neural network algorithm according to the current dialogue state.
8. The device according to claim 7, It is characterized in that The acquisition module is also used for: Acquire a first sample set, wherein the first sample set includes at least one user input sample data; Performing labeling processing on the user input sample data to obtain feature information of the user input sample data to generate a second sample set, wherein the second sample set includes the feature information of the user input sample data; constructing a training sample set using the first sample set and the second sample set; The training sample set is trained to obtain the natural language understanding model.
9. The device according to claim 7, It is characterized in that The characteristic information includes slot value information; and the determination module is further used to: The overlap between the slot value information of the to-be-processed user input data and the slot value information of the user's historical input data is calculated, and it is determined whether the overlap is greater than a preset overlap. If so, it is confirmed that the to-be-processed user input data is related to the user's historical input data.
10. The device according to claim 7, It is characterized in that The feature information includes scene information; and the determination module is further used to: Determine whether the scenario information of the user input data to be processed is the same as the scenario information of the user historical input data. If so, it is considered that the scenario of the user input data to be processed is the same as the scenario of the user historical input data, and confirm that the user input data to be processed is related to the user historical input data.
11. The device according to claim 7, It is characterized in that The determining module is also used for: A correlation analysis is performed on the user input data to be processed and the user historical input data according to the context-related model. If the correlation analysis result is related, it is confirmed that the user input data to be processed and the user historical input data are related.
12. The device according to claim 11, It is characterized in that The determination module is also used to: construct a context-related model based on a dynamic memory network algorithm.
13. An electronic device, It is characterized in that include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
14. A computer readable medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
