Dialogue system construction method and device based on large model technology and dialogue system

By building a dialogue system with SFT, DPO and RAG knowledge base, the problem that RAG cannot support multiple rounds of dialogue and SFT aggravates hallucinations is solved, and multiple rounds of interaction and accurate response of the dialogue system are achieved.

CN119202210AInactive Publication Date: 2024-12-27BEIJING YUNXING ONLINE SOFTWARE DEV CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411718607.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2024-12-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing RAG technology cannot support multiple rounds of conversations, and supervised fine-tuning methods may exacerbate the model's hallucination problem, resulting in inaccurate responses.

Method used

By acquiring and cleaning business data, the SFT model, DPO model and BERT detection model are constructed, and the RAG knowledge base is built using the trained BERT detection model. The dialogue system is constructed in combination with SFT and DPO models, which solves the multiple rounds of dialogue limitations of RAG. and SFT-induced hallucination problems.

Benefits of technology

It realizes accurate matching and replying that supports multiple rounds of conversations, improving the interactivity of the dialogue system and the accuracy of the answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119202210A_ABST
    Figure CN119202210A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of automatic reply, in particular to a dialogue system construction method and device based on the large model technology and a dialogue system.The method comprises the steps that firstly, service data are obtained, then data cleaning is conducted on the service data, an SFT model, a DPO model and a BERT detection model are constructed, and a dialogue model is obtained; and training the SFT model, the DPO model and the BERT detection model according to the cleaned service data, and finally constructing an RAG knowledge base through the trained BERT detection model according to the service data to complete construction of the dialogue system. The dialogue system constructed by the application has the SFT model, the DPO model and the RAG knowledge base, and through the scheme of SFT training, DPO fine tuning and matching with RAG use, the dialogue interaction problem can be solved, and the related knowledge base can also be accurately matched, so that the problem of inaccurate reply caused by the illusion problem that the current RAG cannot support multiple rounds of dialogues and the SFT aggravates the model is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automatic reply technology, and in particular to a dialogue system construction method, device and dialogue system based on large model technology. Background Art

[0002] Since ChatGPT gained widespread public attention, various large language model (LLM) methods have emerged, which has also raised concerns about the model's hallucination effect, that is, the model may generate answers that seem reasonable but are actually false or inaccurate information. In order to meet this challenge, many companies have begun to consider adopting technologies such as Retrieval-Augmented Generation (RAG). However, RAG also faces its own limitations in practice. For example, RAG does not naturally support multi-round dialogues, which limits its effectiveness in interactive applications. On the other hand, although the supervised fine-tuning (SFT) method can assist the model in multi-round dialogues, SFT itself may exacerbate the model's hallucination problem, thereby affecting the accuracy of answering questions. Summary of the invention

[0003] In view of this, the purpose of the present invention is to provide a dialogue system construction method, device and dialogue system based on large model technology to overcome the problem that the current RAG cannot support multi-round dialogues, SFT aggravates the hallucination problem of the model, and leads to inaccurate responses.

[0004] To achieve the above objectives, the present invention adopts the following technical solutions: In a first aspect, the present application provides a method for constructing a dialogue system based on a large model technology, comprising: Get business data; Performing data cleaning on the business data; Build SFT model, DPO model and BERT detection model; Training the SFT model, the DPO model, and the BERT detection model according to the cleaned business data; A RAG knowledge base is constructed based on the business data through the trained BERT detection model to complete the construction of the dialogue system.

[0005] Furthermore, in the above method, the business data includes: The single-round conversation data set of online gold-medal customer service, the multi-round conversation data set of online gold-medal customer service, the business background information data set and the business background information multi-round online conversation data set.

[0006] Furthermore, in the above method, the step of cleaning the business data includes: Removing the conversation data irrelevant to the business from the single-round conversation data set of the online gold-medal customer service and the multi-round conversation data set of the online gold-medal customer service; Rewriting the incomplete conversation data in the single-round conversation data set of the online gold medal customer service and the multi-round conversation data set of the online gold medal customer service; The data in the multi-round dialogue data set of the online gold medal customer service is compressed.

[0007] Furthermore, in the above method, the training of the SFT model, the DPO model and the BERT detection model according to the cleaned business data includes: The SFT model, the DPO model and the BERT detection model are trained respectively through the single-round conversation data set of the online gold medal customer service and the multi-round conversation data set of the online gold medal customer service.

[0008] Furthermore, the method described above, wherein the RAG knowledge base is constructed according to the service data through the trained BERT detection model to complete the construction of the dialogue system, comprises: Detect the conversation intention of the business background data multi-round online conversation data set by using the trained BERT detection model to obtain the business background data multi-round online conversation intention set; Constructing a RAG knowledge base according to the business background information data set and the business background information multiple rounds of online conversation intention set; The dialogue system is constructed based on the trained SFT model, the DPO model, the BERT detection model and the RAG knowledge base.

[0009] In a second aspect, the present application provides a dialogue system, including: The BERT detection module is used to detect the conversational intent of the conversation data input by the driver; A RAG knowledge base module, used to match answer data according to the conversation intent and reply to the driver; The dialogue module is used to generate answer data according to the dialogue intention through the SFT model and the DPO model when the RAG knowledge base module cannot match the answer data, and reply to the driver.

[0010] In a third aspect, the present application provides a dialog system construction device based on a large model technology, including a processor and a memory, wherein the processor is connected to the memory: Wherein, the processor is used to call and execute the program stored in the memory; The memory is used to store the program, and the program is at least used to execute any of the above methods for constructing a dialogue system based on large model technology.

[0011] The beneficial effects of the present invention are: This application first obtains business data, then cleans the business data, builds an SFT model, a DPO model, and a BERT detection model, trains the SFT model, the DPO model, and the BERT detection model based on the cleaned business data, and finally builds a RAG knowledge base based on the business data through the trained BERT detection model to complete the construction of the dialogue system. The dialogue system constructed in this application has an SFT model, a DPO model, and a RAG knowledge base. Through SFT training, DPO fine-tuning, and the solution used with RAG, it can not only solve the dialogue interaction problem, but also accurately match the relevant knowledge base, thereby solving the current problem that RAG cannot support multiple rounds of dialogue, SFT aggravates the model's hallucination problem, and leads to inaccurate responses. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] 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.

[0013] Figure 1 It is a flow chart provided by an embodiment of a method for constructing a dialogue system based on a large model technology of the present invention; Figure 2 It is a structural diagram provided by an embodiment of a dialogue system of the present invention; Figure 3 It is a structural schematic diagram provided by an embodiment of a dialogue system construction device based on a large model technology of the present invention; Figure 4 This is a knowledge base sample diagram provided by an embodiment of a method for constructing a dialogue system based on a large model technology of the present invention; Figure 5 A dialogue diagram provided by an embodiment of a dialogue system of the present invention; Figure 6 It is a dialogue diagram provided by another embodiment of a dialogue system of the present invention. DETAILED DESCRIPTION

[0014] To make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described in detail below. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other implementation methods obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.

[0015] Figure 1 This is a flowchart provided by an embodiment of a method for constructing a dialogue system based on a large model technology of the present invention. Figure 1 , this embodiment may include the following steps: S1. Obtain business data.

[0016] S2. Clean the business data.

[0017] S3. Build SFT model, DPO model and BERT detection model.

[0018] S4. Train the SFT model, DPO model and BERT detection model based on the cleaned business data.

[0019] S5. Build the RAG knowledge base through the trained BERT detection model based on the business data to complete the construction of the dialogue system.

[0020] It can be understood that the present embodiment first obtains business data, then cleans the business data, constructs an SFT model, a DPO model, and a BERT detection model, trains the SFT model, the DPO model, and the BERT detection model according to the cleaned business data, and finally constructs a RAG knowledge base according to the business data through the trained BERT detection model to complete the construction of the dialogue system. The dialogue system constructed in the present embodiment has an SFT model, a DPO model, and a RAG knowledge base. Through SFT training, DPO fine-tuning, and the solution used with RAG, it can not only solve the dialogue interaction problem, but also accurately match the relevant knowledge base, thereby solving the problem that the current RAG cannot support multiple rounds of dialogue, and SFT aggravates the illusion problem of the model, resulting in inaccurate responses.

[0021] Preferably, the business data includes: The single-round conversation data set of online gold-medal customer service, the multi-round conversation data set of online gold-medal customer service, the business background information data set and the business background information multi-round online conversation data set.

[0022] It is understandable that by utilizing the service data of online gold medal customer service, virtual customer service can solve the current driver entry problem in the same way as gold medal customer service.

[0023] Preferably, step S2 comprises: Remove the conversation data that is not related to the business from the single-round conversation data set of the online gold-medal customer service and the multi-round conversation data set of the online gold-medal customer service; Rewrite the incomplete conversation data in the single-round conversation data set of the online gold-medal customer service and the multi-round conversation data set of the online gold-medal customer service; Compress the data in the multi-round conversation data set of online gold medal customer service.

[0024] It is understandable that the open source frameworks chatglm3 and baichuan2 are used as data sorting models. We use the above open source models to clean the data collected online. Step 1: Remove meaningless conversations and business-irrelevant conversations; Step 2: Rewrite incomplete sentences to facilitate subsequent training; Step 3: For multiple rounds of conversations, compress the conversations to three to five rounds and rewrite the incomplete sentences.

[0025] Preferably, step S4 comprises: The SFT model, DPO model and BERT detection model are trained respectively using the single-round conversation data set of online gold-medal customer service and the multi-round conversation data set of online gold-medal customer service.

[0026] It is understandable that the model training of SFT, also known as the driver-free label base model, uses chatglm3 as the base for fine-tuning SFT. Perform full-scale large-scale model fine-tuning. And use Firefly as the training framework. During training, for each sample, we concatenate the input and target into the following format, and then output them to the model for training.

[0027] The organization of the single-discussion dialogue is as follows: {"conversation_id":6,"conversations":[{"human":"How to check yesterday's cash flow","assistant":"Hello, you can click [Personal Center] in the upper right corner of the driver's terminal - click [My Cash Flow] in My Tools to check your income today."}]} The organization of multi-round dialogue is as follows: {"conversation_id":6,"conversations":[{"human":"How to check yesterday's cash flow","assistant":"Hello, you can click [Personal Center] in the upper right corner of the driver's terminal - click [My Cash Flow] in My Tools to check your income today."},{"human":"The minimum wage for the day before yesterday has not been credited","assistant":"The minimum subsidy generated by completing the order normally will be paid within 2 working days after the end of the shift. If the driver participates in this activity in any improper way (illegal tools, cheating software, fake orders, fake hours, favoritism and fraud, etc.), the platform will cancel the corresponding activity subsidy reward."}]} The model training of DPO, also known as driver label training, is organized in the form of a single conversation as shown in Table 1.

[0028] Table 1 DPO single discussion dialogue

[0029] The purpose of this data organization behavior is to enable the same conversation to generate different answers with different tags at runtime. For example, in the above question, the answer for drivers who are permanently offline is to be given after they are offline, rather than the answer of an ordinary driver.

[0030] The BERT detection model uses the M3E model for intent recognition training, with the main purpose of detecting the intent of drivers and customer service. The model can recognize 804 driver intents and 204 customer service intents. To achieve this goal, we used online data to organize the training set and used the M3E model as the infrastructure. By using the contrastive learning algorithm, we successfully improved the accuracy of the model to a level as high as 97%. This approach ensures the efficiency and accuracy of intent recognition.

[0031] Preferably, step S5 includes: Detect the conversation intention of the business background data multi-round online conversation data set through the trained BERT detection model to obtain the business background data multi-round online conversation intention set; Build a RAG knowledge base based on the business background data set and the business background data multi-round online conversation intention set; The dialogue system is constructed based on the trained SFT model, DPO model, BERT detection model and RAG knowledge base.

[0032] It is understandable that the background knowledge of a specific business field and high-quality multi-round dialogue data are integrated, and this valuable information is stored in the knowledge base in the form of text documents, such as Figure 4 The following is an example of a knowledge base.

[0033] When the data is stored in the database, we use the detection model BERT to identify the driver's customer service intention. With such intention judgment, it is convenient to accurately match the dialogue path when using the online model, so as to achieve the response of questions and answers.

[0034] The present invention also provides a dialogue system for implementing the above method embodiment. Figure 2 FIG. 1 is a schematic diagram of a structure provided by an embodiment of a dialogue system of the present invention. Figure 2 As shown, this embodiment includes: BERT detection module 1, used to detect the conversation intention of the conversation data input by the driver; RAG knowledge base module 2 is used to match answer data according to the conversation intent and reply to the driver; Dialogue module 3 is used to generate answer data according to the dialogue intention through the SFT model and the DPO model and reply to the driver when the RAG knowledge base module cannot match the answer data.

[0035] In specific practice, Figure 5 As shown, the driver inputs a question, the detection model determines the driver's intention, the SFT model answers the question input by the driver, the detection model determines the virtual customer service's intention, the driver answers the virtual customer service's reply, and the detection model determines the driver's intention. When three intentions overlap with the RAG knowledge base, the fourth answer is directly answered by finding the answer from the fourth item in the RAG knowledge base.

[0036] like Figure 6 As shown in the figure, in the first case, we use SFT as prior knowledge to answer. When the first three rounds of the reply intentions are matched with a certain RAG knowledge base, the answer is retrieved from the knowledge base for reply. In the second case, the second reply does not match the information of the relevant knowledge base. We still generate answers from the SFT model, using "driver's question + SFT generated answer" to use word vector similarity in the RAG library to recall the closest answer, RAG question and answer; "driver's question + RAG question and answer" is sent to the big model kimi for answer generation. In the second case, we use the open source big model service for answer generation. This method can maximize the driver's satisfaction with the answer.

[0037] The present invention also provides a dialogue system construction device based on large model technology, which is used to implement the above method embodiment. Figure 3 FIG. 1 is a schematic diagram of a structure of an embodiment of a dialog system construction device based on a large model technology according to the present invention. Figure 3As shown, a dialog system construction device based on large model technology in this embodiment includes a processor 21 and a memory 22, and the processor 21 is connected to the memory 22. The processor 21 is used to call and execute the program stored in the memory 22; the memory 22 is used to store the program, and the program is at least used to execute a dialog system construction method based on large model technology in the above embodiment.

[0038] The specific implementation scheme of a dialogue system construction device based on big model technology provided in an embodiment of the present application can refer to the implementation scheme of a dialogue system construction method based on big model technology in any of the above embodiments, which will not be repeated here.

[0039] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.

[0040] It should be noted that, in the description of the present invention, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, the meaning of "plurality" refers to at least two.

[0041] 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.

[0042] 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, multiple 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.

[0043] 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.

[0044] 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.

[0045] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0046] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", 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. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0047] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A method for constructing a dialogue system based on large model technology, characterized in that: include: Get business data; Performing data cleaning on the business data; Build SFT model, DPO model and BERT detection model; Training the SFT model, the DPO model and the BERT detection model according to the cleaned business data; A RAG knowledge base is constructed based on the business data through the trained BERT detection model to complete the construction of the dialogue system.

2. The method according to claim 1, characterized in that: The business data includes: The single-round conversation data set of online gold-medal customer service, the multi-round conversation data set of online gold-medal customer service, the business background information data set and the business background information multi-round online conversation data set.

3. The method according to claim 2, characterized in that The data cleaning of the business data includes: Remove the conversation data irrelevant to the business from the single-round conversation data set of the online gold-medal customer service and the multi-round conversation data set of the online gold-medal customer service; Rewriting the incomplete conversation data in the single-round conversation data set of the online gold medal customer service and the multi-round conversation data set of the online gold medal customer service; The data in the multi-round dialogue data set of the online gold medal customer service is compressed.

4. The method according to claim 3, characterized in that The training of the SFT model, the DPO model and the BERT detection model according to the cleaned business data includes: The SFT model, the DPO model and the BERT detection model are trained respectively through the single-round conversation data set of the online gold medal customer service and the multi-round conversation data set of the online gold medal customer service.

5. The method according to claim 4, characterized in that The step of building a RAG knowledge base through the trained BERT detection model according to the business data to complete the construction of the dialogue system includes: Detect the conversation intention of the business background data multi-round online conversation data set by using the trained BERT detection model to obtain the business background data multi-round online conversation intention set; Constructing a RAG knowledge base according to the business background information data set and the business background information multiple rounds of online conversation intention set; The dialogue system is constructed based on the trained SFT model, the DPO model, the BERT detection model and the RAG knowledge base.

6. A dialogue system, characterized in that: include: The BERT detection module is used to detect the conversational intent of the conversation data input by the driver; A RAG knowledge base module, used to match answer data according to the conversation intent and reply to the driver; The dialogue module is used to generate answer data according to the dialogue intention through the SFT model and the DPO model when the RAG knowledge base module cannot match the answer data, and reply to the driver.

7. A dialogue system construction device based on large model technology, characterized in that: The invention comprises a processor and a memory, wherein the processor is connected to the memory: Wherein, the processor is used to call and execute the program stored in the memory; The memory is used to store the program, and the program is at least used to execute the dialogue system construction method based on large model technology as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Intelligent customer service response method, device and equipment and readable storage medium

    CN117453895A

  • Multi-robot dialogue method and system for software-as-a-service platform

    CN117573834A

  • Financial intelligent analysis model training method and system oriented to multilevel tasks

    CN117892799A

  • Question and answer model training method, question and answer method and question and answer method under subject question and answer scene

    CN118312784A

  • Intelligent customer service question and answer method based on large language model technology

    CN118364084A