Human-computer interaction dialogue method, device and equipment
By designing a human-computer interaction dialogue method, using the dialogue context to generate retrieval conditions and using a pre-trained dialogue model to generate responses, the problem of unified development of multi-type dialogue systems is solved, and efficient multi-type dialogue processing and information flow are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING BAIDU NETCOM SCI & TECH CO LTD
- Filing Date
- 2022-09-20
- Publication Date
- 2026-05-12
AI Technical Summary
Existing technologies require the design of separate dialogue systems for different types of dialogues, which leads to complex development and deployment, and lacks a unified framework to handle multiple types of dialogues.
A human-computer interaction dialogue method is designed. It generates retrieval conditions by obtaining the dialogue context, performs retrieval using a pre-trained dialogue model, generates a response, and integrates a unified framework of multiple dialogue types to directly generate end-to-end dialogue without the need for an upper-level decision module.
It enables unified development and deployment of multiple dialogue types, simplifies the development process, improves the efficiency and flexibility of dialogue generation, and supports information flow across dialogue types.
Smart Images

Figure CN115481227B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, specifically to the fields of natural language processing and deep learning, and can be applied to smart city scenarios. Background Technology
[0002] With the continuous development of machine learning technology, intelligent dialogue has begun to be applied. In customer service consultation dialogues, agents can automatically obtain response statements through intelligent dialogue to improve work efficiency. For example, in the financial sector, when faced with customer inquiries or assistance requests, agents can answer customer questions more quickly through automatically obtained response statements.
[0003] However, dialogue types are diverse, and currently, separate dialogue systems need to be designed for different types of dialogues. After the upper-level decision module determines the dialogue type, it distributes the dialogue context to the corresponding dialogue system. Summary of the Invention
[0004] This disclosure provides a human-computer interaction dialogue method, apparatus, device, storage medium, and program product.
[0005] In a first aspect, embodiments of this disclosure propose a human-computer interaction dialogue method, comprising: obtaining the dialogue context of the human-computer interaction; generating retrieval conditions based on the dialogue context; inputting the retrieval conditions into a pre-trained dialogue model for retrieval to obtain knowledge; and generating a response based on the dialogue context and the knowledge.
[0006] Secondly, embodiments of this disclosure propose a human-computer interaction dialogue device, comprising: an acquisition module configured to acquire a dialogue context of human-computer interaction; a first generation module configured to generate search conditions based on the dialogue context; a retrieval module configured to input the search conditions into a pre-trained dialogue model for retrieval to obtain knowledge; and a second generation module configured to generate a response based on the dialogue context and the knowledge.
[0007] Thirdly, embodiments of this disclosure provide an electronic device comprising: at least two processors; and a memory communicatively connected to the at least two processors; wherein the memory stores instructions executable by the at least two processors, the instructions being executed by the at least two processors to enable the at least two processors to perform a method as described in any implementation of the first aspect.
[0008] Fourthly, embodiments of this disclosure provide a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform a method as described in any implementation of the first aspect.
[0009] Fifthly, embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the method as described in any of the implementations of the first aspect.
[0010] The human-computer interaction dialogue method provided in this disclosure has designed a unified framework that can integrate multiple types of dialogue. The framework integrates multiple types of dialogue and can be developed and deployed in a unified manner.
[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0012] Other features, objects, and advantages of this disclosure will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings. The drawings are provided for a better understanding of the invention and are not intended to limit the scope of this disclosure. Wherein:
[0013] Figure 1 This is a flowchart of an embodiment of the human-computer interaction dialogue method according to the present disclosure;
[0014] Figure 2 This is a flowchart of yet another embodiment of the human-computer interaction dialogue method according to the present disclosure;
[0015] Figure 3 This is a flowchart of an embodiment of the dialogue model training method according to the present disclosure;
[0016] Figure 4 This is a general framework diagram of human-computer interaction dialogue methods;
[0017] Figure 5 This is a schematic diagram of the structure of an embodiment of the human-computer interaction dialogue device according to the present disclosure;
[0018] Figure 6 This is a block diagram of an electronic device used to implement the human-computer interaction dialogue method of the embodiments of this disclosure. Detailed Implementation
[0019] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0020] It should be noted that, unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other. This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0021] Figure 1 A flowchart 100 is shown as an embodiment of a human-computer interaction dialogue method according to the present disclosure. The human-computer interaction dialogue method includes the following steps:
[0022] Step 101: Obtain the dialogue context of human-computer interaction.
[0023] In this embodiment, the executing entity of the human-computer interaction dialogue method can obtain the dialogue context of the human-computer interaction.
[0024] Typically, in addition to obtaining the current question posed by the person in the human-computer interaction, it is also necessary to obtain the dialogue information of the preceding human-computer interactions, that is, the dialogue context of the human-computer interaction.
[0025] Step 102: Generate search criteria based on the dialogue context.
[0026] In this embodiment, the aforementioned executing entity can generate search criteria based on the dialogue context. These search criteria can be key information within the dialogue context.
[0027] Step 103: Input the search criteria into the pre-trained dialogue model to retrieve the knowledge.
[0028] In this embodiment, the aforementioned execution entity can input search criteria into a pre-trained dialogue model to retrieve knowledge.
[0029] Typically, dialogue models can retrieve knowledge related to search criteria based on those criteria. These dialogue models can be trained in a supervised manner using a large number of training samples, and are used to retrieve relevant knowledge based on search criteria.
[0030] Step 104: Generate a response based on the dialogue context and knowledge.
[0031] In this embodiment, the aforementioned executing entity can generate a response based on the dialogue context and knowledge.
[0032] Typically, a response can be obtained by organizing knowledge into natural language based on the context of the conversation.
[0033] The human-computer interaction dialogue method provided in this disclosure presents a unified framework that can integrate multiple types of dialogue. For multiple types of dialogue, retrieval conditions are first generated based on the dialogue context, then knowledge is retrieved based on the retrieval conditions, and finally, a response is generated based on the dialogue context and the knowledge. The framework integrates multiple types of dialogue, enabling unified development and deployment. Furthermore, this framework does not require an upper-layer decision distribution module, directly performing end-to-end dialogue generation, facilitating information flow between multiple types of dialogue, and providing good support for cross-type dialogue.
[0034] Continue to refer to Figure 2 This illustrates a flow 200 of yet another embodiment of the human-computer interaction dialogue method according to the present disclosure. The human-computer interaction dialogue method includes the following steps:
[0035] Step 201: Obtain the dialogue context of human-computer interaction.
[0036] Step 202: Generate search criteria based on the dialogue context.
[0037] In this embodiment, the specific operations of steps 201-202 have been described. Figure 1 The steps 101-102 in the illustrated embodiments are described in detail and will not be repeated here.
[0038] Step 203: If the search criteria are preset symbols, then the knowledge is empty.
[0039] In this embodiment, the executing entity of the human-computer interaction dialogue method can generate search conditions based on the dialogue context. If the search condition is a preset symbol (such as _not_used_), it indicates open-domain casual conversation. Since the search conditions only include preset symbols, the knowledge retrieved based on the search conditions is empty.
[0040] Step 204: Input the dialogue context into the dialogue model to obtain a response.
[0041] In this embodiment, for open-domain chat, the aforementioned executing entity can input the dialogue context into the dialogue model and obtain a response.
[0042] Typically, for open-domain casual conversation, responses can be generated directly based on the dialogue context without requiring retrieval. Therefore, by inputting the dialogue context into the dialogue model, and relying on the model's own capabilities (such as general dialogue capabilities and common-sense knowledge), responses can be generated directly without needing to access external information.
[0043] Step 205: If the token at the first preset position of the search criteria indicates that the dialogue is a knowledge dialogue, then a search is performed simultaneously in the database and the search engine to obtain the knowledge.
[0044] In this embodiment, the aforementioned executing entity can generate search criteria based on the dialogue context. If the token at the first preset position of the search criteria (such as the first token) indicates that the dialogue is a knowledge dialogue, then a search is performed simultaneously in the database and the search engine to obtain the knowledge.
[0045] Typically, the token at the first preset position of the search criteria can be used to indicate the type of dialogue. For knowledge-based dialogues, it is necessary to retrieve the corresponding knowledge based on the dialogue context, and then generate a response based on that knowledge. Therefore, searches can be performed simultaneously in databases and search engines. For static information, knowledge can be retrieved from databases; for dynamic information, knowledge can be retrieved from search engines.
[0046] Here, for relatively static information within a certain time frame (such as encyclopedias, books, and documents), periodic database creation is convenient. Given search criteria, a fast database query can be performed using ANN (approximate nearest neighbor) or ES (elastic search) algorithms to return suitable knowledge.
[0047] For dynamically changing information (such as weather and news), real-time queries through search engines are convenient. Given search criteria, search engines can return suitable web pages or card information as knowledge.
[0048] In some embodiments, to reduce retrieval workload and improve retrieval efficiency, the token at the second preset position of the retrieval criteria (such as a second token) can indicate whether the knowledge dialogue is static or dynamic. If the token at the second preset position of the retrieval criteria indicates that the knowledge dialogue is static, then the knowledge can be obtained by searching only the database. If the token at the second preset position of the retrieval criteria indicates that the knowledge dialogue is dynamic, then the knowledge can be obtained by searching only the search engine.
[0049] Step 206: If the token at the first preset position of the search criteria indicates that the dialogue is a task-oriented dialogue, query the structured database according to the user conditions in the dialogue context to obtain knowledge.
[0050] In this embodiment, the aforementioned execution entity can generate search conditions based on the dialogue context. If the token at the first preset position of the search conditions indicates that the dialogue is a task-oriented dialogue, then a query is performed in the structured database based on the user conditions in the dialogue context to obtain knowledge. The user conditions can be user-input conditions that limit the user's requirements.
[0051] For task-oriented dialogues, it's typically necessary to query external structured databases or tables based on user criteria. Querying structured information can be done using SQL (Structured Query Language) statements. Since the dialogue context is in natural language, it's necessary to extract user criteria from the context and translate them into SQL statements. Then, querying the structured database using these SQL statements will yield the relevant knowledge.
[0052] It should be understood that the knowledge retrieved from a structured database using SQL statements is also structured data, which needs to be converted into natural language to obtain a response.
[0053] Step 207: Generate a response based on the dialogue context and knowledge.
[0054] In this embodiment, the specific operation of step 207 has been described. Figure 1 Step 104 in the illustrated embodiment is described in detail and will not be repeated here.
[0055] from Figure 2 It can be seen from this that, with Figure 1 Compared to the corresponding embodiments, the flow 200 of the human-computer interaction dialogue method in this embodiment emphasizes the retrieval step. Therefore, the solution described in this embodiment integrates three types of dialogue—open-domain casual conversation, knowledge-based dialogue, and task-oriented dialogue—into a unified framework.
[0056] Further reference Figure 3 The diagram illustrates a flow 300 of an embodiment of a dialogue model training method according to the present disclosure. The dialogue model training method includes the following steps:
[0057] Step 301: Obtain multi-round comment information from social media platforms.
[0058] In this embodiment, the entity executing the dialogue model training method can obtain multi-round comment information from social media software.
[0059] Typically, the comment sections of works posted on social media platforms (such as videos and articles) receive a large number of comments. When two or more users reply to a comment multiple times, it generates multiple rounds of comment information.
[0060] Step 302: Use the multi-round comment information as the first sample to train the initial model and obtain the intermediate model.
[0061] In this embodiment, the aforementioned execution entity can use multi-round comment information as the first sample to train the initial model and obtain an intermediate model.
[0062] Social media platforms typically contain a large amount of multi-turn comment information, which is easier to obtain than multi-turn dialogues in human-computer interaction. Therefore, multi-turn comment information can be used to mimic multi-turn dialogues in human-computer interaction, serving as the first sample for model training. For example, by using all comments except the last one from the multi-turn comment information as input and the last comment as output, supervised training can be performed on the initial model to obtain an intermediate model. The initial model can be an untrained model, and the intermediate model can be an incompletely trained model.
[0063] Step 303: Obtain dialogue information from human-computer interaction.
[0064] In this embodiment, the aforementioned execution entity can obtain dialogue information of human-computer interaction, including but not limited to: dialogue information of open domain chat, knowledge dialogue and task-based dialogue.
[0065] Step 304: Use the dialogue information from human-computer interaction as the second sample to train the intermediate model and obtain the dialogue model.
[0066] In this embodiment, the aforementioned execution entity can use the dialogue information from human-computer interaction as a second sample to train the intermediate model and obtain the dialogue model.
[0067] Typically, the number of second samples is much smaller than the number of first samples. By fine-tuning the intermediate model using the second samples, a dialogue model can be obtained. For example, by taking all dialogue information from human-computer interaction except for the last reply as input and the last reply as output, and then performing supervised training on the intermediate model, a dialogue model can be obtained.
[0068] The human-computer interaction dialogue method provided in this disclosure utilizes a large amount of multi-turn comment information and a small amount of human-computer interaction dialogue information on social software to train a dialogue model. The trained dialogue model is able to respond to multiple types of dialogues.
[0069] For ease of understanding, Figure 4 A general framework diagram of human-computer interaction dialogue methods is shown. For example... Figure 4 As shown, the process generates search criteria based on the dialogue context, retrieves knowledge based on these criteria, and finally generates a response based on the dialogue context and the knowledge. Specifically, for open-domain casual conversations with the search criterion "_not_used_", the response is generated using the dialogue model's own capabilities. For static knowledge dialogues, knowledge is searched in a database. For dynamic knowledge dialogues, knowledge is searched in a search engine. For task-oriented dialogues, knowledge is queried from a structured database.
[0070] Further reference Figure 5As an implementation of the methods shown in the above figures, this disclosure provides an embodiment of a human-computer interaction dialogue device, which is similar to... Figure 1 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0071] like Figure 5 As shown, the human-computer interaction dialogue device 500 of this embodiment may include: an acquisition module 501, a first generation module 502, a retrieval module 503, and a second generation module 504. The acquisition module 501 is configured to acquire the dialogue context of the human-computer interaction; the first generation module 502 is configured to generate retrieval conditions based on the dialogue context; the retrieval module 503 is configured to input the retrieval conditions into a pre-trained dialogue model for retrieval to obtain knowledge; and the second generation module 504 is configured to generate a response based on the dialogue context and the knowledge.
[0072] In this embodiment, the specific processing of the acquisition module 501, the first generation module 502, the retrieval module 503, and the second generation module 504 in the human-computer interaction dialogue device 500, and the resulting technical effects, can be found in reference to [reference needed]. Figure 1 The relevant descriptions of steps 101-104 in the corresponding embodiments will not be repeated here.
[0073] In some optional implementations of this embodiment, the retrieval module 503 includes: a first retrieval submodule, configured to have empty knowledge if the retrieval condition is a preset symbol; and a second generation module 504 is further configured to: input the dialogue context into the dialogue model to obtain a response.
[0074] In some optional implementations of this embodiment, the retrieval module 503 includes: a second retrieval submodule, configured to simultaneously search in the database and the search engine to obtain knowledge if the token at the first preset position of the retrieval condition indicates that the dialogue is a knowledge dialogue.
[0075] In some optional implementations of this embodiment, the retrieval module 503 includes a third retrieval submodule, configured to perform a search in the database to obtain knowledge if the token at the first preset position of the retrieval condition indicates that the dialogue is a knowledge dialogue and the token at the second preset position of the retrieval condition indicates that the knowledge dialogue is a static knowledge dialogue.
[0076] In some optional implementations of this embodiment, the retrieval module 503 includes: a fourth retrieval submodule, configured to perform a search in the search engine to obtain knowledge if the token at the first preset position of the retrieval condition indicates that the dialogue is a knowledge dialogue and the token at the second preset position of the retrieval condition indicates that the knowledge dialogue is a dynamic knowledge dialogue.
[0077] In some optional implementations of this embodiment, the retrieval module 503 includes: a fifth retrieval submodule, configured to, if the token at the first preset position of the retrieval condition indicates that the dialogue is a task-oriented dialogue, perform a query in the structured database based on the user conditions in the dialogue context to obtain knowledge.
[0078] In some optional implementations of this embodiment, the fifth retrieval submodule is further configured to: convert user conditions into structured query language; perform a query in a structured database according to the structured query language to obtain knowledge; and the second generation module is further configured to: convert the knowledge into natural language to obtain a response.
[0079] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0080] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0081] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0082] like Figure 6 As shown, device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 602 or a computer program loaded from storage unit 608 into random access memory (RAM) 603. RAM 603 may also store various programs and data required for the operation of device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.
[0083] Multiple components in device 600 are connected to I / O interface 605, including: input unit 606, such as keyboard, mouse, etc.; output unit 607, such as various types of monitors, speakers, etc.; storage unit 608, such as disk, optical disk, etc.; and communication unit 609, such as network card, modem, wireless transceiver, etc. Communication unit 609 allows device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0084] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as human-computer interaction dialogue methods. For example, in some embodiments, the human-computer interaction dialogue method can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed on device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the human-computer interaction dialogue method described above can be performed. Alternatively, in other embodiments, the computing unit 601 can be configured to perform the human-computer interaction dialogue method by any other suitable means (e.g., by means of firmware).
[0085] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system comprising at least two programmable processors, which may be dedicated or general-purpose programmable processors, capable of receiving data and instructions from a storage system, at least two input devices, and at least two output devices, and transmitting data and instructions to the storage system, the at least two input devices, and the at least two output devices.
[0086] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0087] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0088] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0089] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0090] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, distributed system servers, or servers incorporating blockchain technology.
[0091] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution provided in this disclosure can be achieved, and this is not limited herein.
[0092] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A human-computer interaction dialogue method, comprising: Obtain the dialogue context of human-computer interaction; Generate search criteria based on the dialogue context; The search criteria are input into a pre-trained dialogue model to retrieve knowledge. Generate a response based on the dialogue context and the knowledge provided; The step of inputting the search criteria into the dialogue model for retrieval to obtain knowledge includes: If the token at the first preset position of the search criteria indicates that the dialogue is a knowledge dialogue, and the token at the second preset position of the search criteria indicates that the knowledge dialogue is a static knowledge dialogue, then a search is performed in the database to obtain the knowledge. If the token at the first preset position of the search criteria indicates that the dialogue is a knowledge dialogue, and the token at the second preset position of the search criteria indicates that the knowledge dialogue is a dynamic knowledge dialogue, then a search is performed in the search engine to obtain the knowledge.
2. The method according to claim 1, wherein, The dialogue model was trained through the following steps: Obtain multi-round comment information from social media platforms; The multi-round comment information is used as the first sample to train the initial model, thus obtaining an intermediate model; Obtain dialogue information from human-computer interaction; The dialogue information from the human-computer interaction is used as a second sample to train the intermediate model, thereby obtaining the dialogue model.
3. The method according to claim 1, wherein, The step of inputting the search criteria into the dialogue model for retrieval to obtain knowledge includes: If the search criteria are preset symbols, then the knowledge is empty; and The step of generating a response based on the dialogue context and the knowledge includes: The dialogue context is input into the dialogue model to obtain the response.
4. The method according to claim 1, wherein, The step of inputting the search criteria into the dialogue model for retrieval to obtain knowledge includes: If the token at the first preset position of the search criteria indicates that the dialogue is a task-oriented dialogue, the knowledge is obtained by querying the structured database based on the user conditions in the dialogue context.
5. The method according to claim 4, wherein, The step of querying a structured database based on user conditions in the dialogue context to obtain the knowledge includes: Transform the user conditions into a structured query language; The knowledge is obtained by querying the structured database using the structured query language; and The step of generating a response based on the dialogue context and the knowledge includes: The knowledge is converted into natural language to obtain the response.
6. A human-computer interactive dialogue device, comprising: The acquisition module is configured to acquire the dialogue context of human-computer interaction; The first generation module is configured to generate search conditions based on the dialogue context; The retrieval module is configured to input the retrieval criteria into a pre-trained dialogue model to retrieve knowledge. The second generation module is configured to generate a response based on the dialogue context and the knowledge. The retrieval module includes: The third retrieval submodule is configured to search the database to obtain the knowledge if the token at the first preset position of the retrieval condition indicates that the dialogue is a knowledge dialogue and the token at the second preset position of the retrieval condition indicates that the knowledge dialogue is a static knowledge dialogue. The fourth retrieval submodule is configured to perform a search in the search engine to obtain the knowledge if the token at the first preset position of the retrieval condition indicates that the dialogue is a knowledge dialogue and the token at the second preset position of the retrieval condition indicates that the knowledge dialogue is a dynamic knowledge dialogue.
7. The apparatus according to claim 6, wherein, The device also includes a training module configured to: Obtain multi-round comment information from social media platforms; The multi-round comment information is used as the first sample to train the initial model, thus obtaining an intermediate model; Obtain dialogue information from human-computer interaction; The dialogue information from the human-computer interaction is used as a second sample to train the intermediate model, thereby obtaining the dialogue model.
8. The apparatus according to claim 6, wherein, The retrieval module includes: The first retrieval submodule is configured such that if the retrieval condition is a preset symbol, then the knowledge is empty; and The second generation module is further configured to: The dialogue context is input into the dialogue model to obtain the response.
9. The apparatus according to claim 6, wherein, The retrieval module includes: The fifth retrieval submodule is configured to, if the token at the first preset position of the retrieval condition indicates that the dialogue is a task-oriented dialogue, perform a query in the structured database based on the user conditions in the dialogue context to obtain the knowledge.
10. The apparatus according to claim 9, wherein, The fifth retrieval submodule is further configured to: Transform the user conditions into a structured query language; The knowledge is obtained by querying the structured database using the structured query language; and The second generation module is further configured to: The knowledge is converted into natural language to obtain the response.
11. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed 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 that, when executed by a processor, implements the method according to any one of claims 1-5.