CN-115481227-B - Man-machine interaction dialogue method, device and equipment
Abstract
The disclosure provides a man-machine interaction dialogue method, a man-machine interaction dialogue device and man-machine interaction dialogue equipment, relates to the technical field of artificial intelligence, and particularly relates to the technical fields of natural language processing, deep learning and the like, and can be applied to smart city scenes. The method comprises the steps of obtaining a dialogue context of human-computer interaction, generating search conditions according to the dialogue context, inputting the search conditions into a pre-trained dialogue model to search for knowledge, and generating replies according to the dialogue context and the knowledge. The embodiment designs a unified framework capable of fusing multiple types of dialogues, and the framework fuses the multiple types of dialogues and can uniformly develop and deploy.
Inventors
- BAO SIQI
- HE HUANG
- TIAN XIN
- LIN YINGZHAN
- WANG FAN
- WU HUA
- HUANG SHIWEI
- HE JINGZHOU
Assignees
- 北京百度网讯科技有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20220920
Claims (13)
- 1. A human-machine interaction dialogue method comprising: acquiring a dialogue context of man-machine interaction; generating search conditions according to the dialogue context; Inputting the search conditions into a pre-trained dialogue model for searching to obtain knowledge; generating a reply according to the dialog context and the knowledge; The step of inputting the search conditions into a dialogue model for searching, obtaining knowledge, comprises the following steps: if the token of the first preset position of the search condition indicates that the dialogue is a knowledge dialogue and the token of the second preset position of the search condition indicates that the knowledge dialogue is a static knowledge dialogue, searching in a database to obtain the knowledge; and if the token at the first preset position of the search condition indicates that the dialogue is a knowledge dialogue and the token at the second preset position of the search condition indicates that the knowledge dialogue is a dynamic knowledge dialogue, searching in a search engine to obtain the knowledge.
- 2. The method of claim 1, wherein the dialog model is trained by: acquiring multiple rounds of comment information on social software; Training the initial model by taking the multi-round comment information as a first sample to obtain an intermediate model; Acquiring dialogue information of man-machine interaction; And training the intermediate model by taking the dialogue information of the man-machine interaction as a second sample to obtain a dialogue model.
- 3. The method of claim 1, wherein the inputting the search condition into a dialogue model for searching, obtaining knowledge, comprises: if the search condition is a preset symbol, the knowledge is null, and Said generating a reply from said dialog context and said knowledge, comprising: and inputting the dialogue context into the dialogue model to obtain the reply.
- 4. The method of claim 1, wherein the inputting the search condition into a dialogue model for searching, obtaining knowledge, comprises: And if the token at the first preset position of the search condition indicates that the dialogue is a task dialogue, inquiring in a structured database according to the user condition in the dialogue context to obtain the knowledge.
- 5. The method of claim 4, wherein the querying in a structured database according to user conditions in the dialog context, to obtain the knowledge, comprises: converting the user condition into a structured query language; querying in the structured database according to the structured query language to obtain the knowledge, and Said generating a reply from said dialog context and said knowledge, comprising: And converting the knowledge into natural language to obtain the reply.
- 6. A human-machine interaction dialog device, comprising: The acquisition module is configured to acquire a dialogue context of man-machine interaction; A first generation module configured to generate a search condition according to the dialog context; the retrieval module is configured to input the retrieval conditions into a pre-trained dialogue model for retrieval to obtain knowledge; a second generation module configured to generate a reply based on the dialog context and the knowledge; the retrieval module comprises: A third retrieval sub-module configured to search in a database to obtain the knowledge if the token of the first preset position of the retrieval condition indicates that the dialogue is a knowledge dialogue and the token of the second preset position of the retrieval condition indicates that the knowledge dialogue is a static knowledge dialogue; And the fourth retrieval sub-module is configured to search in a search engine to obtain the knowledge if the token of the first preset position of the retrieval condition indicates that the dialogue is a knowledge dialogue and the token of the second preset position of the retrieval condition indicates that the knowledge dialogue is a dynamic knowledge dialogue.
- 7. The apparatus of claim 6, wherein the apparatus further comprises a training module configured to: acquiring multiple rounds of comment information on social software; Training the initial model by taking the multi-round comment information as a first sample to obtain an intermediate model; Acquiring dialogue information of man-machine interaction; And training the intermediate model by taking the dialogue information of the man-machine interaction as a second sample to obtain a dialogue model.
- 8. The apparatus of claim 6, wherein the retrieval module comprises: A first retrieval sub-module configured to empty the knowledge if the retrieval condition is a preset symbol, and The second generation module is further configured to: and inputting the dialogue context into the dialogue model to obtain the reply.
- 9. The apparatus of claim 6, wherein the retrieval module comprises: and a fifth retrieval sub-module configured to query in a structured database according to user conditions in the dialog context if the token of the first preset position of the retrieval condition indicates that the dialog is a task-type dialog, and obtain the knowledge.
- 10. The apparatus of claim 9, wherein the fifth retrieval submodule is further configured to: converting the user condition into a structured query language; querying in the structured database according to the structured query language to obtain the knowledge, and The second generation module is further configured to: And converting the knowledge into natural language to obtain the reply.
- 11. An electronic device, comprising: at least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
- 12. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-5.
- 13. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-5.
Description
Man-machine interaction dialogue method, device and equipment Technical Field The disclosure relates to the technical field of artificial intelligence, in particular to the technical fields of natural language processing, deep learning and the like, and can be applied to smart city scenes. Background With the continued development of machine learning technology, intelligent conversations have begun to be applied. In the customer service consultation dialogue, the agent automatically acquires the reply sentence through the intelligent dialogue so as to improve the working efficiency. For example, in the financial field, an agent can answer a customer question more quickly through automatically acquired reply sentences in face of the customer's consultation or assistance needs. However, the types of conversations are diverse, and it is currently necessary to design a conversation system separately for different types of conversations. After the upper layer decision module judges the dialogue type, the dialogue context is distributed to the dialogue system of the corresponding type. Disclosure of Invention The embodiment of the disclosure provides a man-machine interaction dialogue method, a man-machine interaction dialogue device, man-machine interaction equipment, a storage medium and a program product. In a first aspect, an embodiment of the present disclosure provides a human-computer interaction dialogue method, including obtaining a dialogue context of human-computer interaction, generating a search condition according to the dialogue context, inputting the search condition to a pre-trained dialogue model for searching to obtain knowledge, and generating a reply according to the dialogue context and the knowledge. In a second aspect, an embodiment of the disclosure provides a human-computer interaction dialogue device, which comprises an acquisition module configured to acquire a dialogue context of human-computer interaction, a first generation module configured to generate search conditions according to the dialogue context, a search module configured to input the search conditions to a pre-trained dialogue model for searching to obtain knowledge, and a second generation module configured to generate replies according to the dialogue context and the knowledge. In a third aspect, an embodiment of the present disclosure proposes an electronic device comprising at least two processors, and a memory communicatively coupled to the at least two processors, wherein the memory stores instructions executable by the at least two processors, the instructions being executable by the at least two processors to enable the at least two processors to perform a method as described in any one of the implementations of the first aspect. In a fourth aspect, embodiments of the present disclosure provide a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform a method as described in any one of the implementations of the first aspect. In a fifth aspect, embodiments of the present disclosure propose a computer program product comprising a computer program which, when executed by a processor, implements a method as described in any of the implementations of the first aspect. The man-machine interaction dialogue method provided by the embodiment of the disclosure designs a unified framework capable of fusing multiple types of dialogues, and the framework fuses the multiple types of dialogues and can be developed and deployed uniformly. It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification. Drawings Other features, objects and advantages of the present disclosure will become more apparent upon reading of the detailed description of non-limiting embodiments made with reference to the following drawings. The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein: FIG. 1 is a flow chart of one embodiment of a human-machine interaction dialog method according to the present disclosure; FIG. 2 is a flow chart of yet another embodiment of a human-machine interaction dialog method according to the present disclosure; FIG. 3 is a flow chart of one embodiment of a dialog model training method according to the present disclosure; FIG. 4 is a generic framework diagram of a human-machine interaction dialog method; FIG. 5 is a schematic diagram of an embodiment of a human-machine interaction dialog device according to the present disclosure; fig. 6 is a block diagram of an electronic device for implementing a human-machine interaction dialog method of an embodiment of the disclosure. Detailed Description Exemplary embodiments of the present disclos