Method and system for generating multi-round dialogue based on information enhancement
By introducing a multi-information embedding mechanism and an information-enhanced hierarchical self-attention network into multi-turn dialogue generation, combined with syntax and local information, the problem of the inability of existing technologies to comprehensively capture context information is solved, and more relevant dialogue reply generation is achieved.
Patent Information
- Application Number
- CN202210032590.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-12
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-01-12
AI Technical Summary
Existing multi-turn dialogue generation methods cannot fully capture contextual information, resulting in less coherent responses.
Adopting a multi-turn dialogue generation method based on information enhancement, through a pre-built multi-turn dialogue model, including a multi-dimensional word level encoder, utterance level encoder and decoder, using a multi-information embedding mechanism, combining syntactic feature embedding and local feature embedding, Update contextual representation through multi-head attention mechanism and forward feedback network to generate more relevant replies.
Effectively captures local information and global long-term dependencies in sequences, generates more relevant contextual information, and improves the coherence of dialogue responses.
Smart Images

Figure CN114357976B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of multi-round dialogue generation, and in particular to a multi-round dialogue generation method, system, storage medium and electronic device based on information enhancement. Background Art
[0002] Most of the existing multi-round dialogue generation methods are implemented based on the hierarchical sequence-to-sequence model framework, which can be specifically summarized as RNN-based hierarchical models and Transformer-based hierarchical models. RNN-based hierarchical models usually filter context information through attention mechanisms or similarity, but RNN has a position bias problem and usually pays more attention to the close context. It cannot better learn the long-term dependency relationship between context information in the dialogue, and the generated dialogue lacks coherence. The Transformer-based hierarchical model can capture the long-term dependency information of context information in the dialogue well due to the introduction of the multi-head attention mechanism. However, studies have shown that the Transformer structure cannot efficiently capture the local structure in the sequence, and it relies too much on the position embedding mechanism, which will ignore the local information contained in the sentence.
[0003] From the above description, we can see that the existing multi-round dialogue generation method cannot fully capture context information, resulting in poor coherence of the generated responses. Summary of the invention
[0004] 1. Technical issues to be solved
[0005] In view of the deficiencies in the prior art, the present invention provides a method, system, storage medium and electronic device for generating multi-round dialogues based on information enhancement, which solves the technical problem that the existing multi-round dialogue generation methods cannot fully capture context information.
[0006] (II) Technical solution
[0007] To achieve the above objectives, the present invention is implemented through the following technical solutions:
[0008] In a first aspect, the present invention provides a method for generating a multi-round dialogue based on information enhancement, wherein the method generates a response through a pre-built multi-round dialogue model, wherein the multi-round dialogue model includes a multi-dimensional word-level encoder, an utterance-level encoder, and a decoder, and the process of generating a response includes:
[0009] S1. Acquire multi-round dialogue history information and pre-process the multi-round dialogue history information;
[0010] S2: The preprocessed multi-round dialogue history information is passed through a multi-dimensional word-level encoder based on a multi-information embedding mechanism to obtain a sentence vector;
[0011] S3, inputting the sentence vector into a discourse level encoder to obtain a discourse level encoding vector;
[0012] S4. Decode the speech-level encoding vector through a decoder to generate a response.
[0013] Preferably, the multidimensional word level encoder comprises:
[0014] The multi-dimensional word-level encoder consists of a multi-head attention mechanism and a feed-forward network.
[0015] Preferably, the multi-information embedding mechanism includes a multi-information embedding mechanism including syntactic feature embedding and local feature embedding.
[0016] Preferably, the syntactic feature embedding includes:
[0017] After the word sequence is analyzed by the dependency syntax provided by StanfordNlp, it is organized into a dependency syntax list containing syntactic information. The last hidden state is selected as the feature vector of the dependency syntactic sequence independently and identically by a parameter-sharing recurrent neural network, and the formula is as follows:
[0018]
[0019] Among them, x i,m is the mth word in the ith sentence, listx i,m For word x i,m The dependency syntactic sequence of x i,j is the jth word in the i-th sentence, listx i,j For word x i,j The dependency syntactic sequence of .
[0020] Preferably, the local feature embedding includes:
[0021] Set the window size of local feature embedding to M;
[0022] The original sentence sequence is processed into a large number of short sequences containing local position information. The short sequences encode the local dependencies of each word through another parameter-shared recurrent neural network, generate M hidden state representations, and select the last hidden state as the feature representation of the local sequence. The formula is as follows:
[0023]
[0024] Preferably, the S3 specifically includes:
[0025] After being encoded by a word-level encoder, multiple sentence vectors of the conversation history are obtained, and multiple sentence vectors form a vector sequence The position embedding of the sentence vector is as follows:
[0026]
[0027] Where: t refers to the tth sentence vector in the vector sequence of the dialogue history, and its value range is [0, n), d model refers to the dimension of the sentence vector, i refers to the dimension number of the sentence vector, and its value range is
[0028] All sentence vectors contained in the dialogue history are positionally embedded. Position embedding is represented by P utt express;
[0029] After adding the sentence vector and the corresponding position embedding, they are input into the multi-head attention mechanism and the forward feedback network to update the context representation and obtain the discourse-level encoding vector. The formula is as follows:
[0030] H con =FNN(MultiHead(H utt +P utt ,H utt +P utt ,H utt +P utt )).
[0031] Preferably, the pre-built multi-round dialogue model is learned by minimizing the negative maximum likelihood probability between the generated response and the reference response during the training process.
[0032]
[0033] Among them: Y is the generated response, and C is the reference response.
[0034] In a second aspect, the present invention provides a multi-round dialogue generation system based on information enhancement, wherein the system generates responses through a pre-built multi-round dialogue model, wherein the multi-round dialogue model includes a multi-dimensional word-level encoder, an utterance-level encoder, and a decoder, and the system includes:
[0035] An acquisition module, used to acquire multi-round dialogue history information and pre-process the multi-round dialogue history information;
[0036] The word-level encoding module is used to obtain sentence vectors from the preprocessed multi-round dialogue history information through a multi-dimensional word-level encoder based on a multi-information embedding mechanism;
[0037] A discourse level encoding module, used for inputting the sentence vector into a discourse level encoder to obtain a discourse level encoding vector;
[0038] A decoding module is used to decode the utterance-level encoding vector through a decoder to generate a reply.
[0039] In a third aspect, the present invention provides a computer-readable storage medium, characterized in that it stores a computer program for generating multi-round dialogues based on information enhancement, wherein the computer program enables a computer to execute the method for generating multi-round dialogues based on information enhancement as described above.
[0040] In a fourth aspect, the present invention provides an electronic device, comprising:
[0041] one or more processors;
[0042] Memory; and
[0043] One or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the programs include programs for executing the multi-round dialogue generation method based on information enhancement as described above.
[0044] (III) Beneficial effects
[0045] The present invention provides a method, system, storage medium and electronic device for generating multi-round dialogues based on information enhancement. Compared with the prior art, the present invention has the following beneficial effects:
[0046] The present invention generates a reply through a pre-built multi-round dialogue model, the multi-round dialogue model includes a multi-dimensional word-level encoder, a discourse-level encoder and a decoder, and the process of generating a reply includes: obtaining multi-round dialogue history information and pre-processing the multi-round dialogue history information; the pre-processed multi-round dialogue history information is passed through a multi-dimensional word-level encoder based on a multi-information embedding mechanism to obtain a sentence vector; the sentence vector is input into the discourse-level encoder to obtain a discourse-level encoding vector; the discourse-level encoding vector is decoded by a decoder to generate a reply. The present invention captures context information comprehensively through a multi-information embedding mechanism, generates more relevant context information to generate a reply. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 A block diagram of a method for generating multi-round dialogues based on information enhancement according to an embodiment of the present invention;
[0049] Figure 2 The structure of the word level encoder in the embodiment of the present invention;
[0050] Figure 3 Schematic diagram of syntactic feature embedding in an embodiment of the present invention;
[0051] Figure 4 A schematic diagram of local information embedding in an embodiment of the present invention;
[0052] Figure 5 is the architecture of the speech level encoder in an embodiment of the present invention;
[0053] Figure 6 This is the architecture of the decoder in the embodiment of the present invention. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention are clearly and completely described. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] The embodiments of the present application provide a method and system for generating multi-round dialogues based on information enhancement, thereby solving the technical problem that the existing multi-round dialogue generation methods cannot fully capture context information, and effectively capturing local information in the sequence and global long-term dependencies, thereby generating responses with more relevant context information.
[0056] The technical solution in the embodiment of the present application is to solve the above technical problems, and the overall idea is as follows:
[0057] The embodiment of the present invention proposes a new multi-information embedding mechanism, constructs an information-enhanced hierarchical self-attention network, and is used in a multi-round dialogue generation system. The multi-information embedding mechanism includes syntactic information embedding and local information embedding. The sentence is subjected to dependency syntactic analysis, and a syntactic information linked list is constructed for each position word based on the idea of an adjacency list, and the syntactic information embedding is obtained through recurrent neural network encoding. For each word in the sentence, a short sequence of words of a certain length is intercepted from its position according to the window size, and local information embedding is obtained through recurrent neural network encoding. The syntactic information embedding and the local information embedding are fused to obtain multi-information embedding. On the word-level encoder, the multi-information-embedded words are sent to the Transformer encoder structure to update the word representation, and the discourse representation is obtained through recurrent neural network encoding; the discourse-level encoder is constructed based on the Transformer encoder structure, and the context representation is updated; finally, it is sent to the decoder constructed based on the Transformer decoder structure. Through the multi-information embedding mechanism, the context information is fully captured, and more relevant context information is generated to generate a reply.
[0058] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0059] The embodiment of the present invention provides a multi-round dialogue generation method based on information enhancement. The method generates a reply through a pre-built multi-round dialogue model. The model includes a multi-dimensional word-level encoder, an utterance-level encoder and a decoder. The process of generating a reply includes S1 to S4. Figure 1 As shown:
[0060] S1. Acquire multi-round dialogue history information and pre-process the multi-round dialogue history information;
[0061] S2: The preprocessed multi-round dialogue history information is passed through a multi-dimensional word-level encoder based on a multi-information embedding mechanism to obtain a sentence vector;
[0062] S3, inputting the sentence vector into a discourse level encoder to obtain a discourse level encoding vector;
[0063] S4. Decode the speech-level encoding vector to generate a response.
[0064] The embodiment of the present invention captures context information comprehensively through a multi-information embedding mechanism, and generates a response with more relevant context information.
[0065] The following is a detailed description of each step:
[0066] It should be noted that the multi-round dialogue in the embodiment of the present invention is open-domain, which is defined as: in the context of historical dialogue information, using discourse without domain restrictions as model input and outputting reply sentences.
[0067] The multi-round dialogue history contains more than two rounds of dialogue. The multi-round dialogue model input is the dialogue history, which includes n sentences. Each sentence is defined as where x i,m is the mth word in the ith sentence, is the length of the ith sentence, and n>2. Based on the input conversation history, generate a reply Y={y1,y2,…,y |Y|}, where y i To generate the i-th word of the response, the length of the generated response is |Y|.
[0068] The multi-round dialogue model in the embodiment of the present invention is pre-built and trained, and the model mainly includes: a multi-dimensional word-level encoder, an utterance-level encoder, and a decoder.
[0069] In step S1, multiple rounds of dialogue history information is obtained and preprocessed. The specific implementation process is as follows:
[0070] Preprocess the multi-round dialogue history information. The preprocessing mainly includes:
[0071] Build a stop word dictionary and delete the stop words in the corpus.
[0072] Change all English letters in the corpus to lowercase. Delete the dialogue corpus with less than 2 dialogue turns.
[0073] Filter out words with a frequency greater than 2 and build a dictionary.
[0074] The preprocessed multi-round dialogue history information includes a sentence sequence of n sentences Each sentence is defined as a sequence of words where x i,m is the mth word in the ith sentence, is the length of the ith sentence, and n>2, |X i | represents the length of the i-th sentence.
[0075] In step S2, the preprocessed multi-round dialogue history information is passed through a multi-dimensional word-level encoder based on a multi-information embedding mechanism to obtain a sentence vector. The specific implementation process is as follows:
[0076] In the embodiment of the present invention, Figure 2 As shown in Figure 1, the multi-dimensional word-level encoder structure consists of two sub-layers: a multi-head attention mechanism and a forward feedback network. At the same time, before the multi-head attention mechanism, a multi-information embedding mechanism is added to enhance information. The multi-information embedding mechanism includes syntactic feature embedding and local feature embedding.
[0077] like Figure 3 As shown, syntactic feature embedding includes:
[0078] After the word sequence is analyzed by the dependency syntax provided by StanfordNlp, it is organized into a dependency syntax list containing syntactic information. They are processed independently and identically by a parameter-sharing recurrent neural network (named ParsingRNN), and the last hidden state is selected as the feature vector of the dependency syntactic sequence.
[0079] Among them, listx i,m For word x i,mThe dependency syntactic sequence of the sentence is used to perform dependency parsing (dependency_parse) on the sentence using the StanfordNlp toolkit, and a list of triples is obtained. The triple contains three attributes, namely the dependency type, the index position of the subordinate word in the sentence, and the index position of the dominant word in the sentence. The number of triple lists is the number of words in the entire sentence, that is, it analyzes the dependency for each word in the sentence, and each word is given (dependency type, index position of the subordinate word in the sentence, index position of the dominant word in the sentence). Based on the triple list, a "dependency syntactic linked list of syntactic information" is constructed. Specifically, each dominant word may have multiple subordinate words. For a word x in a sentence i,n , whose dependents form listx i,n For words without subordinate words, add filler words <pad>, as its dependency syntactic sequence.
[0080] Using parameter-sharing ParsingRNN to model syntactic information representation for the jth word in the i-th sentence The formula is as follows:
[0081]
[0082] While embedding syntactic features, local information is embedded, such as Figure 4 As shown, take the window size M=3 as an example.
[0083] The original long sequence (sentence sequence) is processed into a large number of short sequences containing local position information. The short sequence encodes the local dependency of each word through another parameter-sharing recurrent neural network (named LocalRNN), generates M hidden state representations, and selects the last hidden state as the feature representation of the local sequence. That is, the local temporal feature extraction module constructs a local window of size M for each word, which contains M consecutive positions and ends at the word position.
[0084] Using parameter-sharing LocalRNN to model local position feature representation for the jth word in the i-th sentence The formula is as follows:
[0085]
[0086] The local position feature is represented and syntactic information feature representation Concatenate to obtain feature representations that contain both local position and dependency syntactic information. The formula is as follows:
[0087]
[0088] in: The dependency vector representation and the local dependency vector representation of each position are concatenated in dimension.
[0089] Each token in the sentence is embedded with multi-dimensional features to obtain a feature representation that contains both syntactic information and local information.
[0090] Input the multi-head attention mechanism and the forward feedback network in turn to obtain the updated token feature representation:
[0091]
[0092] Feed the output into the recurrent neural network encoder to obtain the initial sentence vector for each context:
[0093]
[0094] It should be noted that residual connection and normalization are performed after each sublayer, that is, LayerNorm(x+Sublayer(x)), where Sublayer(x) is the function implemented by the sublayer itself and x is the input of the sublayer.
[0095] In step S3, the sentence vector is input into the utterance level encoder to obtain the utterance level encoding vector. The specific implementation process is as follows:
[0096] In an embodiment of the present invention, the speech level encoder is as follows: Figure 5 shown.
[0097] After being encoded by a word-level encoder, multiple sentence vectors of the conversation history are obtained, and multiple sentence vectors form a vector sequence The position embedding of the sentence vector is as follows:
[0098]
[0099] Where: t refers to the tth sentence vector in the vector sequence of the dialogue history, and its value range is [0, n), d model refers to the dimension of the sentence vector, i refers to the dimension number of the sentence vector, and its value range is
[0100] All sentence vectors contained in the dialogue history are positionally embedded. Position embedding is represented by P utt express.
[0101] After adding the sentence vector and the corresponding position embedding, they are input into the multi-head attention mechanism and the forward feedback network to update the context representation and obtain the discourse-level encoding vector. The formula is as follows:
[0102] H con =FNN(MultiHead(H utt +P utt ,H utt +P utt ,H utt +P utt )).
[0103] In step S4, the utterance-level encoding vector is decoded to generate a reply. The specific implementation process is as follows:
[0104] like Figure 6 As shown in Figure 2, the decoder uses a single-layer decoder structure in the Transformer to generate a predicted word sequence (i.e., generate a response) based on the utterance-level encoding vector output by the utterance-level encoder. Given a reference response Y = {y1, y2, …, y |Y| }, define the sum of the original word embedding and the position embedding as the token y i The distribution of e(y i ).
[0105] e(y i )=embed(y i )+PE(y i )
[0106] Here, embed(·) represents the random word embedding function, and PE(·) represents the position embedding function, which is the same as the position embedding in the above utterance-level encoder.
[0107] It should be noted that in the training phase, the multi-round dialogue model in the embodiment of the present invention uses a mask operation on the reply to block out future words in the decoder. In the inference phase, a loop function is used on the generated reply. Afterwards, it is sent to the spanning attention mechanism and the forward feedback network in turn. The difference between the spanning multi-head attention mechanism and the self-attention mechanism is that the key K and query Q of the spanning attention mechanism can be different. The context vector is used as the key K and the value V, and the reply is used as the query Q, and is sent to the spanning multi-head attention mechanism to obtain context information related to the reply:
[0108] H dec =MultiHead(e(Y),e(Y),e(Y))
[0109] Y′=FNN(MultiHead(H dec ,H con ,H con ))
[0110] Where: e(.) represents the distribution of tokens in the sentence, H dec represents the reply encoding vector generated according to the reply, H con Represents the utterance-level encoding vector generated by the utterance-level encoder.
[0111] In the embodiment of the present invention, the multi-head attention mechanism enables the model to simultaneously focus on information in different representation subspaces at different positions and effectively retrieve dependencies in the input sequence. It divides the model into multiple heads to form representation subspaces. Multiple heads allow it to capture different aspects of information, and multiple value vectors can be trained in parallel and then spliced together. Given an input query Q, key K, value V. This can be formalized as:
[0112] MultiHead(Q,K,V)=Concat(head1,…,head h )W O
[0113] where head i =Attention(QW i Q ,KW i K ,VW i V )
[0114]
[0115] in: and are all trainable parameters, d k and d v are the dimensions of the key K and value V respectively.
[0116] The output is fed into a feed-forward network which consists of two linear transformations with a ReLU function in between as the activation function.
[0117] FFN(x)=max(0,xW1+b1)W2+b2
[0118] Among them, W1, b1, W2 and b2 are all trainable parameters.
[0119] Finally, it is sent to the softmax layer to obtain the probability of the word in the generation process, and the word with the largest sampling probability is used as the currently generated word.
[0120] P(y i |C,y1,...,y i-1 ; θ) = softmax(W o Y′)
[0121] Where: W o are learnable parameters, and θ represents all trainable parameters in the model.
[0122] Learning is performed during training by minimizing the negative maximum likelihood between the generated responses and the reference responses.
[0123]
[0124] The embodiment of the present invention further provides a multi-round dialogue generation system based on information enhancement, wherein the system generates responses through a pre-built multi-round dialogue model, wherein the multi-round dialogue model includes a multi-dimensional word-level encoder, an utterance-level encoder, and a decoder, and the system includes:
[0125] An acquisition module, used to acquire multi-round dialogue history information and pre-process the multi-round dialogue history information;
[0126] The word-level encoding module is used to obtain sentence vectors from the preprocessed multi-round dialogue history information through a multi-dimensional word-level encoder based on a multi-information embedding mechanism;
[0127] A discourse level encoding module, used for inputting the sentence vector into a discourse level encoder to obtain a discourse level encoding vector;
[0128] A decoding module is used to decode the utterance-level encoding vector through a decoder to generate a reply.
[0129] It is understood that the multi-round dialogue generation system based on information enhancement provided in an embodiment of the present invention corresponds to the multi-round dialogue generation method based on information enhancement mentioned above, and the explanations, examples, beneficial effects and other parts of the relevant contents can refer to the corresponding contents in the multi-round dialogue generation method based on information enhancement, which will not be repeated here.
[0130] An embodiment of the present invention provides a computer-readable storage medium storing a computer program for generating multi-round dialogues based on information enhancement, wherein the computer program enables a computer to execute the method for generating multi-round dialogues based on information enhancement as described above.
[0131] An electronic device according to an embodiment of the present invention includes:
[0132] one or more processors;
[0133] Memory; and
[0134] One or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the programs include programs for executing the multi-round dialogue generation method based on information enhancement as described above.
[0135] In summary, compared with the prior art, the present invention has the following beneficial effects:
[0136] The embodiment of the present invention captures context information comprehensively through a multi-information embedding mechanism, and generates responses with more relevant context information. It is specifically proposed to enhance syntax and local area information at the word level, and comprehensively consider the local syntactic information and structural information in the sentence. The sentence can be effectively analyzed through dependency syntax, which can effectively improve the performance of natural language processing tasks. By capturing subordinate words for dominant words, the syntactic information of words can be effectively captured, and word embedding containing syntactic information can be obtained through recurrent neural network encoding. The local sequence captured by the moving window can well make up for the shortcomings of position embedding in the original Transformer mechanism.
[0137] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0138] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.< / pad>
Claims
1. A multi-round dialogue generation method based on information enhancement, characterized in that: The method generates a response through a pre-built multi-turn dialogue model, wherein the multi-turn dialogue model includes a multi-dimensional word-level encoder, an utterance-level encoder, and a decoder. The process of generating a response includes: S1. Acquire multi-round dialogue history information and pre-process the multi-round dialogue history information; S2: The preprocessed multi-round dialogue history information is passed through a multi-dimensional word-level encoder based on a multi-information embedding mechanism to obtain a sentence vector; S3, inputting the sentence vector into a discourse level encoder to obtain a discourse level encoding vector; S4, decoding the utterance-level encoding vector through a decoder to generate a response; Wherein, the multidimensional word level encoder comprises: the multidimensional word level encoder comprises a multi-head attention mechanism and a forward feedback network; The multi-information embedding mechanism includes a syntactic feature embedding and a local feature embedding; The S3 specifically includes: After being encoded by a word-level encoder, multiple sentence vectors of the conversation history are obtained, and multiple sentence vectors form a vector sequence The position embedding of the sentence vector is as follows: Where: t refers to the tth sentence vector in the vector sequence of the dialogue history, and its value range is [0, n), d model refers to the dimension of the sentence vector, i refers to the dimension number of the sentence vector, and its value range is All sentence vectors contained in the dialogue history are positionally embedded. Position embedding is represented by P utt express; After adding the sentence vector and the corresponding position embedding, they are input into the multi-head attention mechanism and the forward feedback network to update the context representation and obtain the discourse-level encoding vector. The formula is as follows: H con =FNN(MultiHead(H utt +P utt ,H utt +P utt ,H utt +P utt ))。 2. The method for generating multi-round dialogues based on information enhancement according to claim 1, characterized in that: The syntactic feature embedding includes: After the word sequence is analyzed by the dependency syntax provided by StanfordNlp, it is organized into a dependency syntax list containing syntactic information. The last hidden state is selected as the feature vector of the dependency syntactic sequence independently and identically by a parameter-sharing recurrent neural network, and the formula is as follows: Among them, x i,m is the mth word in the ith sentence, listx i,m For word x i,m The dependency syntactic sequence of x i,j is the jth word in the i-th sentence, listx i,j For word x i,j The dependency syntactic sequence of .
3. The method for generating multi-round dialogues based on information enhancement as claimed in claim 1, characterized in that: The local feature embedding includes: Set the window size of local feature embedding to M; The original sentence sequence is processed into a large number of short sequences containing local position information. The short sequences encode the local dependencies of each word through another parameter-shared recurrent neural network, generate M hidden state representations, and select the last hidden state as the feature representation of the local sequence. The formula is as follows:
4. The method for generating multi-round dialogues based on information enhancement according to any one of claims 1 to 3, characterized in that: The pre-built multi-turn dialogue model is learned during the training process by minimizing the negative maximum likelihood probability between the generated response and the reference response. Among them: Y is the generated response, and C is the reference response.
5. A multi-round dialogue generation system based on information enhancement, characterized in that: The system generates a response through a pre-built multi-turn dialogue model, wherein the multi-turn dialogue model includes a multi-dimensional word-level encoder, an utterance-level encoder, and a decoder, and the system includes: An acquisition module, used to acquire multi-round dialogue history information and pre-process the multi-round dialogue history information; The word-level encoding module is used to obtain sentence vectors from the preprocessed multi-round dialogue history information through a multi-dimensional word-level encoder based on a multi-information embedding mechanism; A discourse level encoding module, used for inputting the sentence vector into a discourse level encoder to obtain a discourse level encoding vector; A decoding module, configured to decode the utterance-level encoding vector through a decoder to generate a response; Wherein, the multidimensional word level encoder comprises: the multidimensional word level encoder comprises a multi-head attention mechanism and a forward feedback network; The multi-information embedding mechanism includes a syntactic feature embedding and a local feature embedding; The step of inputting the sentence vector into a discourse-level encoder to obtain a discourse-level encoding vector specifically includes: After being encoded by a word-level encoder, multiple sentence vectors of the conversation history are obtained, and multiple sentence vectors form a vector sequence The position embedding of the sentence vector is as follows: Where: t refers to the tth sentence vector in the vector sequence of the dialogue history, and its value range is [0, n), d model refers to the dimension of the sentence vector, i refers to the dimension number of the sentence vector, and its value range is All sentence vectors contained in the dialogue history are positionally embedded. Position embedding is represented by P utt express; After adding the sentence vector and the corresponding position embedding, they are input into the multi-head attention mechanism and the forward feedback network to update the context representation and obtain the discourse-level encoding vector. The formula is as follows: H con =FNN(MultiHead(H utt +P utt ,H utt +P utt ,H utt +P utt ))。 6. A computer-readable storage medium, characterized in that: It stores a computer program for generating multi-round dialogues based on information enhancement, wherein the computer program enables a computer to execute the method for generating multi-round dialogues based on information enhancement as claimed in any one of claims 1 to 4.
7. An electronic device, characterized in that: include: one or more processors; Memory; as well as One or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the programs include programs for executing the multi-round dialogue generation method based on information enhancement as described in any one of claims 1 to 4.
