Dialogue generation method, device, equipment and computer readable medium
By using search behavior data to expand information in dialogue generation and inputting it into a recurrent neural network model to generate replies, the problem of no information replies in dialogue generation in the existing technology is solved, the generation accuracy and calculation efficiency are improved, and the calculation time consumption is reduced.
Patent Information
- Application Number
- CN201810694537.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-06-29
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2038-06-29
AI Technical Summary
The existing technology has problems in generating dialogues with no information content and irrelevant replies. It is difficult to extract keywords and the maximum interactive information method is computationally intensive, which leads to excessive calculation time consumption and cannot meet the needs of practical applications.
By obtaining the input original sentence information, query in the search behavior data, obtain the extended information, and input the original sentence information and extended information into the dialogue generation model based on the recurrent neural network to generate reply sentences, reducing the reliance on filtering the generated results. , reducing the amount of calculation.
It improves the accuracy and calculation efficiency of reply generation, reduces the calculation time consumption, and solves the problem of generating uninformative replies.
Smart Images

Figure CN109002500B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular to a method and device for generating a dialogue based on a retrieval diary, equipment, and a computer-readable medium. Background Art
[0002] As an important scenario of artificial intelligence, general dialogue systems have received more and more attention. Typical industrial applications include chatbots, mobile assistants, etc. In general dialogue systems, dialogue generation is an important environment. Currently, there are two mainstream methods: search-based and natural language generation. The search-based method is to search the corpus through the sentences input by the user to find some relevant replies. The effect is very limited by the corpus. If there are no relevant sentences in the corresponding corpus, the user cannot be replied. Therefore, the method based on natural language generation is increasingly valued, using an end-to-end (end2end) framework, and the most commonly used is sequence to sequence (seq2seq). However, the use of natural language generation faces the important problem of generating safe replies, and will generate some general replies that have no information content and are not related to the previous context, such as: "I don't know" and "Not bad". Generating these replies in actual applications will seriously affect the user experience.
[0003] In order to solve the problem of generating responses without information content and irrelevant responses, the prior art proposes adding keywords to assist in the generation process, or using the Maximum Mutual Information (MMI) method to filter the generated results.
[0004] However, the prior art still has the following problems:
[0005] 1. The main difficulty of the method of introducing keywords lies in extracting keywords from the conversation. This is a very difficult problem. At present, there is no better way to obtain keywords in the conversation.
[0006] 2. Using MMI to filter the results greatly increases the amount of calculation in the entire process. It may take thousands of times longer to obtain the effect that satisfies the application, so it is not suitable for practical applications. Summary of the invention
[0007] Embodiments of the present invention provide a dialogue generation method, apparatus, device, and computer-readable medium to solve or alleviate one or more technical problems in the prior art.
[0008] In a first aspect, an embodiment of the present invention provides a method for generating a dialogue, comprising:
[0009] Get the original sentence information of the input;
[0010] Searching the search behavior data according to the original sentence information to obtain extended information of the original sentence information;
[0011] The original sentence information and the extended information are input into a dialogue generation model, and a reply sentence is output through the dialogue generation model.
[0012] In combination with the first aspect, in a first implementation of the first aspect of the embodiment of the present invention, the dialogue generation model includes an encoder and a decoder, the original sentence information and the extended information are input into the dialogue generation model, and a reply sentence is output through the dialogue generation model, including:
[0013] Inputting the original sentence information and the extended information into an encoder, and respectively generating an original sentence vector and an extended sentence vector through the encoder;
[0014] The original sentence vector and the expanded sentence vector are input into a decoder, and a reply sentence is generated by the decoder.
[0015] In combination with the first implementation manner of the first aspect, in a second implementation manner of the first aspect of the embodiment of the present invention, the original sentence vector and the extended sentence vector are input into a decoder, and a reply sentence is generated by the decoder, including:
[0016] Combining the original sentence vector and the extended sentence vector as an initial vector of the decoder;
[0017] The initial vector is used as the initial input of the decoder to generate each word of the reply sentence one by one.
[0018] In combination with the first implementation manner of the first aspect, in a third implementation manner of the first aspect of the embodiment of the present invention, the original sentence vector and the extended sentence vector are input into a decoder, and a reply sentence is generated by the decoder, including:
[0019] Combining the original sentence vector and the extended sentence vector as an initial vector of the decoder;
[0020] The first word of the reply sentence is generated according to the initial vector, and the previous word and the extended vector are used as the initial vector of the next word in turn to generate each word of the reply sentence one by one.
[0021] In combination with the first aspect or any one of the implementation modes of the first aspect, further comprising:
[0022] The dialogue generation model is generated using training data, and the dialogue generation model is constructed based on a recurrent neural network.
[0023] In a second aspect, an embodiment of the present invention further provides a dialogue generation device, including:
[0024] An acquisition module is used to obtain the input original sentence information;
[0025] An extension module, used to query the search behavior data according to the original sentence information to obtain extended information of the original sentence information;
[0026] A generation module is used to input the original sentence information and the extended information into a dialogue generation model, and output a reply sentence through the dialogue generation model.
[0027] In combination with the second aspect, in a first implementation of the second aspect of the embodiment of the present invention, the dialogue generation model includes an encoder and a decoder, and the generation module includes:
[0028] An information input submodule, used for inputting the original sentence information and the extended information into an encoder, and generating an original sentence vector and an extended sentence vector respectively through the encoder;
[0029] The sentence generation submodule is used to input the original sentence vector and the extended sentence vector into a decoder, and generate a reply sentence through the decoder.
[0030] In combination with the first implementation of the second aspect, in a second implementation of the second aspect of the embodiment of the present invention, the statement generation submodule includes:
[0031] A first combining unit, configured to combine the original sentence vector and the extended sentence vector as an initial vector of the decoder;
[0032] The first generating unit is used to use the initial vector as the initial input of the decoder to generate each word of the reply sentence one by one.
[0033] In combination with the first implementation of the second aspect, in a third implementation of the second aspect of the embodiment of the present invention, the statement generation submodule includes:
[0034] A second combining unit, configured to combine the original sentence vector and the extended sentence vector as an initial vector of the decoder;
[0035] The second generating unit is used to generate a reply sentence according to the initial vector to output the first word, and sequentially use the previous word and the extended vector as the initial vector of the next word to generate each word of the reply sentence one by one.
[0036] In combination with the second aspect or any one of the implementation modes of the second aspect, the embodiment of the present invention, in a fourth implementation mode of the second aspect, further includes:
[0037] The model training module is used to generate the dialogue generation model using training data, and the dialogue generation model is constructed based on a recurrent neural network.
[0038] The functions of the device can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
[0039] In a third aspect, in a possible design, the structure of the dialogue generation device includes a processor and a memory, the memory is used to store a program that supports the dialogue generation device to execute the dialogue generation method in the first aspect, and the processor is configured to execute the program stored in the memory. The dialogue generation device may also include a communication interface for the dialogue generation device to communicate with other devices or communication networks.
[0040] In a fourth aspect, an embodiment of the present invention provides a computer-readable medium for storing computer software instructions used by a dialog generation device, which includes a program for executing the dialog generation method of the first aspect.
[0041] The embodiments of the present invention can improve computing efficiency and reduce computing time consumption. In addition, by expanding input sentence information, the accuracy of reply generation can be increased.
[0042] The above summary is for illustrative purposes only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments and features described above, further aspects, embodiments and features of the present invention will be readily apparent by reference to the accompanying drawings and the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments disclosed in the present invention and should not be regarded as limiting the scope of the present invention.
[0044] Figure 1 is a flow chart of a method for generating a dialogue according to an embodiment of the present invention;
[0045] Figure 2 A schematic diagram of a dialogue generation model according to an embodiment of the present invention;
[0046] Figure 3 is a specific step flow chart of step S300 of an embodiment of the present invention;
[0047] Figure 4 This is a flowchart of the specific steps of step S320 of an embodiment of the present invention;
[0048] Figure 5 A schematic diagram of a decoder according to an embodiment of the present invention;
[0049] Figure 6 This is a flowchart of the specific steps of step S320 of another embodiment of the present invention;
[0050] Figure 7 A schematic diagram of a decoder according to another embodiment of the present invention;
[0051] Figure 8 is an overall architecture diagram of an embodiment of the present invention;
[0052] Fig. 9 A block diagram of a dialog generation device according to an embodiment of the present invention;
[0053] Fig.10 A module block diagram of a dialog generation device according to another embodiment of the present invention;
[0054] Fig.11 is a block diagram of a generation module according to an embodiment of the present invention;
[0055] Fig.12 A block diagram of a statement generation submodule according to an embodiment of the present invention;
[0056] Fig.13 A block diagram of a statement generation submodule according to another embodiment of the present invention;
[0057] Fig.14 A block diagram of a conversation generating device according to another embodiment of the present invention. DETAILED DESCRIPTION
[0058] In the following, only some exemplary embodiments are briefly described. As can be appreciated by those skilled in the art, the described embodiments may be modified in various ways without departing from the spirit or scope of the present invention. Therefore, the drawings and descriptions are considered to be illustrative and non-restrictive in nature. The embodiments of the present invention mainly provide a method and apparatus for generating a communication dialogue, and the following technical solutions are described in detail through the following embodiments.
[0059] The present invention provides a method and device for generating a dialogue. The specific processing flow and principle of the method and device for generating a dialogue according to an embodiment of the present invention are described in detail below.
[0060] like Figure 1 As shown, it is a flow chart of the dialogue generation method of an embodiment of the present invention. The dialogue generation method of the embodiment of the present invention may include the following steps:
[0061] S100: Obtaining input original sentence information.
[0062] For example, the original sentence information input by the user may be: "I don't eat breakfast."
[0063] S200: querying the search behavior data according to the original sentence information to obtain extended information of the original sentence information.
[0064] In one embodiment, the original sentence information can be expanded by constructing a search query model. The search query model can be trained by using the search log as a corpus. For example, the logs of all users searching on the Baidu engine are used as the original prediction, and the search query model can be constructed based on a deep neural network, a convolutional neural network, and the like.
[0065] According to the corpus in the search query model, matching expansion can be performed to obtain multiple extended information. For example, if "I don't eat breakfast" is input into the search query model, "Will I get fat if I don't eat breakfast?", "Gallstones if I don't eat breakfast?", "The harm of not eating breakfast?", "The disadvantages of not eating breakfast" and so on can be obtained. Then, according to the frequency of queries in the search log, the most frequent extended information can be obtained. Assuming that the query "The harm of not eating breakfast" appears most frequently, the extended information that can be obtained is "harm".
[0066] S300: Inputting the original sentence information and the extended information into a dialogue generation model, and outputting a reply sentence through the dialogue generation model.
[0067] In one embodiment, the method further comprises step S400: using training data to generate the dialogue generation model, wherein the dialogue generation model is constructed based on a recurrent neural network. Figure 2 As shown, in one embodiment, the dialogue generation model includes an encoder and a decoder. Both the encoder and the decoder are recurrent neural networks (RNN). The encoder is used to input original sentence information and extended information, and the decoder is used to output a reply sentence. For example, Figure 2 As shown, the encoder inputs text<A,B,C> , and encode it into a vector, input the vector into the decoder, use the vector as the output device of the decoder, and generate the reply<W,X,Y,Z> .in <eos>Indicates the end of the encoder. <eos>Indicates the end of the decoder.
[0068] like Figure 3 As shown, in one embodiment, step S300 includes:
[0069] S310: Input the original sentence information and the extended information into an encoder, and generate an original sentence vector and an extended sentence vector respectively through the encoder.
[0070] After obtaining the extended information, the original sentence information and the extended information are jointly input into the encoder. For example, the original sentence "I don't eat breakfast" and the extended information "harm" are input into the encoder together, and the original sentence vector and the extended sentence vector are output respectively.
[0071] S320: Input the original sentence vector and the extended sentence vector into a decoder, and generate a reply sentence through the decoder.
[0072] like Figure 4 As shown, in one implementation, step S320 includes:
[0073] S321: Combine the original sentence vector and the extended sentence vector as an initial vector of the decoder.
[0074] S322: Using the initial vector as the initial input of the decoder, generating each word of the reply sentence one by one.
[0075] For example, Figure 5 As shown, the decoder is divided into multiple decoder modules h1~h t , and then through the multiple decoder modules h1~h t Generate each word of the reply sentence one by one, for example: y1~y t In the decoding process, the revelation word y0, the original sentence vector and the extended sentence vector are first input into the first decoder module h1, and h1 outputs the first word y1. Then the first word y1 of h1 is input into h2, and h2 outputs the second word y2, and so on.
[0076] like Figure 6 As shown, in one implementation, step S320 includes:
[0077] S323: Combine the original sentence vector and the extended sentence vector as an initial vector of the decoder.
[0078] S324: Generate a reply sentence according to the initial vector and output the first word, and use the previous word and the extended vector as the initial vector of the next word in turn, and generate each word of the reply sentence one by one.
[0079] like Figure 7 As shown, the decoder is divided into multiple decoder modules h1~h t , and then through the multiple decoder modules h1~h t Generate each word of the reply sentence one by one, for example: y1~y t In the decoding process, the revelation word y0, the original sentence vector and the extended sentence vector are first input into the first decoder module h1, and h1 outputs the first word y1. Then the extended sentence vector and the first word y1 are input into h2, and h2 outputs the second word y2. And so on. t-1 Enter h t In the output, y t .
[0080] In one embodiment, Figure 8 As shown, it is a schematic diagram of the overall architecture of the dialogue generation method of this embodiment.
[0081] First, the original sentence information is input into the search query model, and the search query model obtains the extended information result list.
[0082] Then, the most frequently used extended information is selected from the extended information result list, and its extended information is converted into an extended information vector.
[0083] Finally, the extended information vector is input into the decoder for decoding.
[0084] Compared with the prior art, the embodiment of the present invention does not need to rearrange the generated results by Maximum Mutual Information (MMI), which greatly reduces the computing time consumption. In addition, by using the search diary, additional relevant information can be greatly expanded.
[0085] Second, as Fig. 9 As shown, the embodiment of the present invention further provides a dialogue generation device, including:
[0086] The acquisition module 100 is used to acquire input original sentence information.
[0087] The expansion module 200 is used to query the search behavior data according to the original sentence information to obtain the expansion information of the original sentence information.
[0088] The generation module 300 is used to input the original sentence information and the extended information into a dialogue generation model, and output a reply sentence through the dialogue generation model.
[0089] In one embodiment, if Fig.10 As shown, the dialogue generation device also includes: a model training module 400, which is used to generate the dialogue generation model using training data, and the dialogue generation model is constructed based on a recurrent neural network.
[0090] The dialogue generation model includes an encoder and a decoder. Fig.11 As shown, the generating module 300 includes:
[0091] An information input submodule 310, configured to input the original sentence information and the extended information into an encoder, and generate an original sentence vector and an extended sentence vector respectively through the encoder;
[0092] The sentence generation submodule 320 is used to input the original sentence vector and the extended sentence vector into a decoder, and generate a reply sentence through the decoder.
[0093] like Fig.12 As shown, in one embodiment, the statement generation submodule 320 includes:
[0094] The first combining unit 321 is used to combine the original sentence vector and the extended sentence vector as an initial vector of the decoder.
[0095] The first generating unit 322 is used to use the initial vector as the initial input of the decoder to generate each word of the reply sentence one by one.
[0096] like Fig.13 As shown, in one embodiment, the statement generation submodule includes:
[0097] The second combining unit 323 is used to combine the original sentence vector and the extended sentence vector as the initial vector of the decoder.
[0098] The second generating unit 324 is used to generate a reply sentence according to the initial vector and output the first word, and sequentially use the previous word and the extended vector as the initial vector of the next word to generate each word of the reply sentence one by one.
[0099] The functions of the device can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
[0100] The functions of the various modules of the dialogue generation device of this embodiment are similar to the principles of the dialogue generation method of the above embodiment, so they will not be described in detail.
[0101] In another embodiment, the present invention also provides a dialogue generating device, such as Fig.14 As shown, the device includes: a memory 510 and a processor 520. The memory 510 stores a computer program that can be run on the processor 520. When the processor 520 executes the computer program, the dialog generation method in the above embodiment is implemented. The number of the memory 510 and the processor 520 can be one or more.
[0102] The device also includes:
[0103] The communication interface 530 is used to communicate with external devices and perform data exchange transmission.
[0104] The memory 510 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0105] If the memory 510, the processor 520 and the communication interface 530 are implemented independently, the memory 510, the processor 520 and the communication interface 530 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Component (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.14 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0106] Optionally, in a specific implementation, if the memory 510, the processor 520 and the communication interface 530 are integrated on a chip, the memory 510, the processor 520 and the communication interface 530 can communicate with each other through an internal interface.
[0107] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.
[0108] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, "plurality" means two or more, unless otherwise clearly and specifically defined.
[0109] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.
[0110] The logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be embodied in any computer-readable medium for use by an instruction execution system, apparatus or device (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, apparatus or device and execute the instructions), or in conjunction with such instruction execution system, apparatus or device. For purposes of this specification, "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, apparatus or device, or in conjunction with such instruction execution system, apparatus or device.
[0111] The computer-readable medium described in the embodiment of the present invention can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. More specific examples of computer-readable storage media include at least (non-exhaustive list) the following: an electrical connection portion (electronic device) with one or more wirings, a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable read-only memory (CDROM). In addition, the computer-readable storage medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpreting or processing in other suitable ways as necessary, and then stored in a computer memory.
[0112] In an embodiment of the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, input method, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, radio frequency (RF), etc., or any suitable combination of the above.
[0113] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0114] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0115] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The storage medium may be a read-only memory, a disk or an optical disk, etc.
[0116] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of various changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.< / eos> < / eos>
Claims
1. A method for generating a dialogue, characterized in that: include: Get the original sentence information of the input; The original sentence information is input into a search query model, and the search query model obtains extended information of the original sentence information; wherein the search query model is trained using the search log as a corpus, the extended information of the original sentence information is determined by the query frequency of the extended information output by the search query model in the search log, and the extended information is used to be spliced with the original sentence information to improve the semantics expressed by the original sentence information; Inputting the original sentence information and the extended information into an encoder of a dialogue generation model, and respectively generating an original sentence vector and an extended sentence vector through the encoder; The original sentence vector and the expanded sentence vector are input into a decoder of the dialogue generation model, and a reply sentence is generated by the decoder.
2. The method for generating a dialogue according to claim 1, characterized in that: Inputting the original sentence vector and the expanded sentence vector into a decoder of the dialogue generation model, and generating a reply sentence through the decoder, comprising: Combining the original sentence vector and the extended sentence vector as an initial vector of the decoder; The initial vector is used as the initial input of the decoder to generate each word of the reply sentence one by one.
3. The method for generating a dialogue according to claim 1, characterized in that: Inputting the original sentence vector and the expanded sentence vector into a decoder of the dialogue generation model, and generating a reply sentence through the decoder, comprising: Combining the original sentence vector and the extended sentence vector as an initial vector of the decoder; The first word of the reply sentence is generated according to the initial vector, and the previous word and the extended vector are used as the initial vector of the next word in turn to generate each word of the reply sentence one by one.
4. The method for generating a dialogue according to any one of claims 1 to 3, characterized in that: Also includes: The dialogue generation model is generated using training data, and the dialogue generation model is constructed based on a recurrent neural network.
5. A dialogue generation device, characterized in that: include: An acquisition module is used to obtain the input original sentence information; An extension module, used to input the original sentence information into a search query model, and obtain extended information of the original sentence information from the search query model; wherein the search query model is trained using the search log as a corpus, the extended information of the original sentence information is determined by the query frequency of the extended information output by the search query model in the search log, and the extended information is used to be spliced with the original sentence information to improve the semantics expressed by the original sentence information; A generation module, used for inputting the original sentence information and the extended information into a dialogue generation model, and outputting a reply sentence through the dialogue generation model; The dialogue generation model includes an encoder and a decoder, and the generation module includes: An information input submodule, used for inputting the original sentence information and the extended information into an encoder, and generating an original sentence vector and an extended sentence vector respectively through the encoder; The sentence generation submodule is used to input the original sentence vector and the extended sentence vector into a decoder, and generate a reply sentence through the decoder.
6. The dialog generation device according to claim 5, characterized in that: The statement generation submodule includes: A first combining unit, configured to combine the original sentence vector and the extended sentence vector as an initial vector of the decoder; The first generating unit is used to use the initial vector as the initial input of the decoder to generate each word of the reply sentence one by one.
7. The dialog generation device according to claim 5, characterized in that: The statement generation submodule includes: A second combining unit, configured to combine the original sentence vector and the extended sentence vector as an initial vector of the decoder; The second generating unit is used to generate a reply sentence according to the initial vector to output the first word, and sequentially use the previous word and the extended vector as the initial vector of the next word to generate each word of the reply sentence one by one.
8. The dialog generation device according to any one of claims 5 to 7, characterized in that: Also includes: The model training module is used to generate the dialogue generation model using training data, and the dialogue generation model is constructed based on a recurrent neural network.
9. A dialogue generation device, characterized in that: The device comprises: 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 dialog generation method as described in any one of claims 1-4.
10. A computer readable medium storing a computer program, characterized in that: When the program is executed by a processor, the dialog generation method as described in any one of claims 1 to 4 is implemented.
