Method and device for constructing multi-round dialogue large model system
By constructing a semantic feature extraction model, an incomplete sentence rewriting model and a large single-turn dialogue model, a multi-turn dialogue large model system is formed, which solves the problem of poor semantic coherence of the single-turn dialogue model in multi-turn dialogues and achieves higher accuracy. Conversational accuracy and naturalness.
Patent Information
- Application Number
- CN202411069893.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-10-18
AI Technical Summary
The traditional single-turn dialogue model is difficult to maintain semantic coherence in multi-turn dialogues, is prone to misunderstandings or inappropriate responses, and cannot meet the needs of complex dialogues.
Construct a semantic feature extraction model, an incomplete sentence rewriting model and a single-turn dialogue large model. By extracting contextual features in multi-turn dialogues, rewriting incomplete sentences and generating more accurate response sentences, a multi-turn dialogue large model system is formed.
It improves the coherence and accuracy of conversations, provides a more natural and smooth user experience, and can better understand user intentions and generate responses that meet expectations.
Smart Images

Figure CN118797010A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to a method and device for building a large multi-round dialogue model. Background Art
[0002] In the field of artificial intelligence, the development of dialogue models has always attracted much attention. With the continuous advancement of technology, large-scale dialogue models (for example, generative pre-training (GPT) models, generalized linear models (GLM), etc.) have achieved remarkable results in understanding natural language and generating fluent dialogues. The emergence of these models provides strong technical support for the construction of dialogue systems, enabling dialogue systems to understand user intentions more accurately and generate responses that are closer to user needs. However, with the continuous expansion of application scenarios, traditional single-round dialogue models can no longer meet the needs of complex dialogues. In practical applications, users often need to conduct multiple rounds of dialogue to fully express their intentions, and single-round dialogue models are difficult to maintain semantic coherence in consecutive rounds of dialogue, and are prone to misunderstandings or inappropriate responses. Summary of the invention
[0003] A method for building a multi-round dialogue big model system according to an embodiment of the present invention includes: building a semantic feature extraction model, which is configured to extract context features of multiple user input sentences, wherein the multiple user input sentences are input by users in multiple rounds of dialogue, and the user inputs one or more of the multiple user input sentences in each round of dialogue; building an incomplete sentence rewriting model, which is configured to rewrite the incomplete sentences in the multiple user input sentences into a complete sentence based on the context features of the multiple user input sentences; building a single-round dialogue big model, which is configured to generate a response sentence for the incomplete sentences in the multiple user input sentences based on a complete sentence rewritten by the incomplete sentence rewriting model; and building a multi-round dialogue big model system based on the semantic feature extraction model, the incomplete sentence rewriting model, and the single-round dialogue big model.
[0004] According to an embodiment of the present invention, an apparatus for constructing a multi-round dialogue large model system includes: a processor; and a memory on which computer executable instructions are stored, wherein these computer executable instructions, when executed by the processor, prompt the processor to execute the above-mentioned method for constructing a multi-round dialogue large model system.
[0005] According to the computer-readable storage medium of an embodiment of the present invention, computer-executable instructions are stored thereon, wherein these computer-executable instructions, when executed by a processor, prompt the processor to execute the above-mentioned method for constructing a multi-round dialogue large model system.
[0006] The computer program product according to an embodiment of the present invention includes computer executable instructions, wherein when these computer executable instructions are executed by a processor, they prompt the processor to execute the above-mentioned method for constructing a multi-round dialogue large model system. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] The present invention can be better understood from the following description of specific embodiments of the present invention in conjunction with the accompanying drawings, in which:
[0008] Figure 1 A schematic block diagram of an apparatus for constructing a multi-round dialogue large model system according to an embodiment of the present invention is shown.
[0009] Figure 2 A schematic flow chart of a method for constructing a multi-round dialogue large model system according to an embodiment of the present invention is shown.
[0010] Figure 3 A schematic block diagram of a multi-round dialogue large model system according to an embodiment of the present invention is shown.
[0011] Figure 4 A schematic diagram of a computer system that can implement the apparatus and method for building a multi-round dialogue large model system according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0012] The features and exemplary embodiments of various aspects of the present invention will be described in detail below. In the detailed description below, many specific details are proposed to provide a comprehensive understanding of the present invention. However, it is obvious to those skilled in the art that the present invention can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present invention by illustrating examples of the present invention. The present invention is by no means limited to any specific configuration and algorithm proposed below, but covers any modification, replacement and improvement of elements, parts and algorithms without departing from the spirit of the present invention. In the accompanying drawings and the following description, known structures and technologies are not shown to avoid unnecessary ambiguity to the present invention.
[0013] Taking into account one or more problems existing in a single-round dialogue model, a method and apparatus for building a multi-round dialogue large model system according to an embodiment of the present invention are proposed, wherein the multi-round dialogue large model system can better handle semantic dependencies in continuous multi-round dialogues, make full use of historical dialogue information to understand the user's true intentions and generate responses that are more in line with the user's expectations, thereby improving the coherence and accuracy of the dialogue and providing the user with a more natural and smooth dialogue experience.
[0014] Figure 1 A schematic block diagram of an apparatus for constructing a multi-round dialogue large model system according to an embodiment of the present invention is shown. Figure 2 A schematic flow chart of a method for constructing a multi-round dialogue model system according to an embodiment of the present invention is shown. Figure 1 and Figure 2 , describes in detail the device and method for building a multi-round dialogue large model system according to an embodiment of the present invention.
[0015] like Figure 1 As shown, the device 100 for building a multi-round dialogue large model system according to an embodiment of the present invention includes a feature extraction model building unit 102, a sentence rewriting model building unit 104, a single-round dialogue model building unit 106, and a model system building unit 108, wherein: the feature extraction model building unit 102 is configured to build a semantic feature extraction model, and the semantic feature extraction model is configured to extract context features of multiple user input sentences, wherein the multiple user input sentences are input by the user in multiple rounds of dialogue, and the user inputs one or more of the multiple user input sentences in each round of dialogue (i.e., execute S202); the sentence rewriting model building unit 104 is configured to build an incomplete sentence The sentence rewriting model is configured to rewrite the incomplete sentences in multiple user input sentences into a complete sentence based on the context features of the multiple user input sentences (i.e., execute S204); the single-round dialogue model construction unit 106 is configured to construct a single-round dialogue big model, and the single-round dialogue big model is configured to generate a response sentence for the incomplete sentences in the multiple user input sentences based on a complete sentence rewritten by the incomplete sentence rewriting model (i.e., execute S206); and the model system construction unit 108 is configured to construct a multi-round dialogue big model system based on the semantic feature extraction model, the incomplete sentence rewriting model, and the single-round dialogue big model (i.e., execute S208).
[0016] Figure 3 FIG. 2 shows a schematic block diagram of a multi-round dialogue model system according to an embodiment of the present invention. Figure 3 As shown, in the multi-round dialogue big model system 300 according to an embodiment of the present invention: the semantic feature extraction model 302 receives multiple user input sentences, extracts context features of the multiple user input sentences, and outputs the extracted context features; the incomplete sentence rewriting model 304 receives the context features output by the semantic feature extraction model 302, rewrites the incomplete sentences in the multiple user input sentences into a complete sentence based on the received context features, and outputs the rewritten complete sentence; the single-round dialogue big model 306 receives a complete sentence output by the incomplete sentence rewriting model 304, generates a response sentence based on the received complete sentence, and outputs the generated response sentence. Table 1 below shows a specific example of the multi-round dialogue big model system 300 rewriting a complete sentence based on multiple user input sentences input by the user in a multi-round dialogue.
[0017] Table 1
[0018]
[0019] In some embodiments, the process S202 of constructing a semantic feature extraction model includes: training a transformer network model and using the trained transformer network model as a semantic feature extraction model. The transformer network model is a neural network structure based on a self-attention mechanism, which can fully extract the context information of the user input sentence through the self-attention mechanism and position encoding and generate context features of the user input sentence based on the context information.
[0020] In some embodiments, the process S202 of constructing a semantic feature extraction model further includes: optimizing the semantic feature extraction model in terms of keyword detection and semantic segmentation through contrastive learning. Through optimization in terms of keyword detection and semantic segmentation, the semantic feature extraction model can more accurately capture keywords in the user input sentence and provide these keywords to the incomplete sentence rewriting model, so that the complete sentence rewritten by the incomplete sentence rewriting model is semantically consistent with the user input sentence, thereby reducing the possibility of inconsistent intentions between them.
[0021] In some embodiments, the process S204 of constructing an incomplete sentence rewriting model includes: training a twin network model (e.g., a SimCSE network model) and using the trained twin network model as the incomplete sentence rewriting model. For example, the process of training the twin network model may include: calculating the similarity between the rewritten sentence samples generated by the twin network model based on the sample context features from the semantic feature extraction model and the sentence positive samples and sentence negative samples, respectively, wherein the sentence positive samples are sentence samples having the same semantics as the multiple user input samples used by the feature extraction model to generate the sample context features, and the sentence negative samples are sentence samples having different semantics from the multiple user input samples; based on the similarity between the rewritten sentence samples and the sentence positive samples and sentence negative samples, respectively, calculating the loss function of the twin network model; and optimizing the model parameters of the twin network model based on the loss function of the twin network model.
[0022] In some embodiments, the process S204 of constructing an incomplete sentence rewriting model also includes: optimizing the incomplete sentence rewriting model in terms of intent recognition through contrastive learning. For example, optimizing the incomplete sentence rewriting model in terms of intent recognition through contrastive learning includes: calculating the similarity between at least one of the position-confusion rewritten sentence samples and the wrong-intent rewritten sentence samples and the sentence positive sample and the sentence negative sample, respectively, wherein the sentence positive sample is a sentence sample having the same semantics as the position-confusion rewritten sentence sample and the wrong-intent rewritten sentence sample, and the sentence negative sample is a sentence sample having different semantics from the position-confusion rewritten sentence and the wrong-intent rewritten sentence sample; calculating the loss function of the incomplete sentence rewriting model based on the similarity between at least one of the position-confusion rewritten sentence samples and the wrong-intent rewritten sentence samples and the sentence positive sample and the sentence negative sample; and optimizing the model parameters of the incomplete sentence rewriting model based on the loss function of the incomplete sentence rewriting model.
[0023] Multi-task learning is a machine learning strategy that aims to improve the generalization ability and performance of the model by learning multiple related tasks simultaneously. Sharing relevant information between different tasks in a single model helps the model capture common features between tasks and improve the prediction accuracy of each task. Therefore, by using the position confusion rewriting sentence samples and the wrong intent rewriting sentence samples to optimize the incomplete sentence rewriting model in terms of intent recognition through comparative learning, the incomplete sentence rewriting model can understand various intents more accurately, thereby effectively solving the problem of possible inconsistency between the complete sentence rewritten by the incomplete sentence rewriting model and the user input sentence.
[0024] In some embodiments, the process S206 of constructing a single-round dialogue large model includes: training a generative pre-trained model or a generalized linear model and using the trained generative pre-trained model or the generalized linear model as the single-round dialogue large model.
[0025] Figure 4 FIG. 1 is a schematic diagram showing a computer system that can implement the speech recognition model training apparatus and method according to an embodiment of the present invention. It should be understood that Figure 4 The computer system 400 shown is only an example and should not bring any limitation to the functions and scope of use of the apparatus and method for building a multi-round dialogue large model system according to the embodiment of the present invention.
[0026] like Figure 4As shown, the computer system 400 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 to a random access memory (RAM) 403. Various programs and data required for the operation of the computer system 400 are also stored in the RAM 403. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0027] Typically, the following devices may be connected to the I / O interface 405: input devices 406 including, for example, a touch screen, a touch pad, a camera, an accelerometer, a gyroscope, a sensor, etc.; output devices 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, a motor, an electronic speed controller, etc.; storage devices 408 including, for example, a flash memory (FlashCard), etc.; and communication devices 409. The communication devices 409 may allow the computer system 400 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The computer system 400 is shown with various devices, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have instead. Figure 4 Each block shown in the figure may represent one device, or may represent multiple devices as required.
[0028] In particular, according to some embodiments of the present invention, the process described above with reference to the flowchart may be implemented as a computer program. For example, a computer readable medium is provided on which a computer program is stored, the computer program comprising a method for executing Figure 2 The program code of the method for constructing a multi-round dialogue large model system shown in FIG. 4 is shown. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 409, or installed from the storage device 408, or installed from the ROM 402. When the computer program is executed by the processing device 401, the above-mentioned functional units defined in the apparatus for constructing a multi-round dialogue large model system according to the embodiment of the present invention are implemented.
[0029] It should be noted that the computer-readable medium according to the embodiment of the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. The computer-readable storage medium according to the embodiment of the present invention may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device, or device. In addition, the computer-readable signal medium according to the embodiment of the present invention may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The 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, apparatus, or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0030] Computer program code for performing operations according to embodiments of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet).
[0031] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0032] The present invention can be implemented in other specific forms without departing from its spirit and essential features. For example, the algorithms described in the specific embodiments can be modified, and the system architecture does not depart from the basic spirit of the present invention. Therefore, the current embodiments are regarded as exemplary and non-restrictive in all aspects, and the scope of the present invention is defined by the appended claims rather than the above description, and all changes falling within the meaning and equivalent scope of the claims are thus included in the scope of the present invention.
Claims
1. A method for building a multi-round dialogue large model system, include: Constructing a semantic feature extraction model, wherein the semantic feature extraction model is configured to extract context features of a plurality of user input sentences, wherein the plurality of user input sentences are input by a user in a plurality of rounds of dialogue, and the user inputs one or more of the plurality of user input sentences in each round of dialogue; Building an incomplete sentence rewriting model, wherein the incomplete sentence rewriting model is configured to rewrite an incomplete sentence in the plurality of user input sentences into a complete sentence based on context features of the plurality of user input sentences; Constructing a single-turn dialogue large model, wherein the single-turn dialogue large model is configured to generate a response sentence for the incomplete sentence among the multiple user input sentences based on the one complete sentence rewritten by the incomplete sentence rewriting model; and The multi-round dialogue big model system is constructed based on the semantic feature extraction model, the incomplete sentence rewriting model, and the single-round dialogue big model.
2. The method for constructing a multi-round dialogue large model system according to claim 1, in, Constructing the semantic feature extraction model includes: training a transformer network model and using the trained transformer network model as the semantic feature extraction model.
3. The method for constructing a multi-round dialogue large model system according to claim 2, in, Constructing the semantic feature extraction model also includes: optimizing the semantic feature extraction model in terms of keyword detection and semantic segmentation through contrastive learning.
4. The method for constructing a multi-round dialogue large model system according to claim 1, in, Constructing the incomplete sentence rewriting model includes: training a twin network model and using the trained twin network model as the incomplete sentence rewriting model.
5. The method for constructing a multi-round dialogue large model system according to claim 4, in, Training the twin network model includes: Calculate the similarity between the rewritten sentence samples generated by the twin network model based on the sample context features from the semantic feature extraction model and the sentence positive samples and sentence negative samples, respectively, wherein the sentence positive samples are sentence samples having the same semantics as the multiple user input samples used by the feature extraction model to generate the sample context features, and the sentence negative samples are sentence samples having different semantics from the multiple user input samples; Calculating the loss function of the twin network model based on the similarities between the rewritten sentence sample and the sentence positive sample and the sentence negative sample respectively; and Based on the loss function of the twin network model, the model parameters of the twin network model are optimized.
6. The method for constructing a multi-round dialogue large model system according to claim 4, in, Constructing the incomplete sentence rewriting model also includes: optimizing the incomplete sentence rewriting model in terms of intent recognition through contrastive learning.
7. The method for constructing a multi-round dialogue large model system according to claim 6, in, The optimization of the incomplete sentence rewriting model in terms of intent recognition through contrastive learning includes: Calculate the similarity between at least one of the position-confused rewritten sentence sample and the wrong intention rewritten sentence sample and the sentence positive sample and the sentence negative sample, respectively, wherein the sentence positive sample is a sentence sample having the same semantics as the position-confused rewritten sentence sample and the wrong intention rewritten sentence sample, and the sentence negative sample is a sentence sample having different semantics from the position-confused rewritten sentence and the wrong intention rewritten sentence sample; Calculating the loss function of the incomplete sentence rewriting model based on the similarity between at least one of the position-confusion rewritten sentence sample and the wrong-intent rewritten sentence sample and the sentence positive sample and the sentence negative sample, respectively; and Based on the loss function of the incomplete sentence rewriting model, the model parameters of the incomplete sentence rewriting model are optimized.
8. The method for constructing a multi-round dialogue large model system according to claim 1, in, Constructing the single-round dialogue large model includes: training a generative pre-trained model or a generalized linear model and using the trained generative pre-trained model or the generalized linear model as the single-round dialogue large model.
9. A device for constructing a multi-round dialogue large model system, include: processor; as well as A memory having computer executable instructions stored thereon, wherein the computer executable instructions, when executed by the processor, cause the processor to execute the method for building a multi-round dialogue large model system as described in any one of claims 1 to 8.
10. A computer-readable storage medium having computer-executable instructions stored thereon, in, When the computer executable instructions are executed by a processor, the processor is prompted to execute the method for building a multi-round dialogue large model system as described in any one of claims 1 to 8.
11. A computer program product comprising computer executable instructions, in, When the computer executable instructions are executed by a processor, the processor is prompted to execute the method for building a multi-round dialogue large model system as described in any one of claims 1 to 8.
Citation Information
Cited By
AI intelligent toy multi-wheel automatic dialogue method based on large model
CN121071091A
A Multi-Turn Automatic Dialogue Method for AI-Powered Smart Toys Based on Large Models
CN121071091B
AI dialogue device and method for financial analysis
CN121413766A
Medical dialogue method and system based on intention jump recognition and semantic completion
CN122112211A
A medical conversation method and system based on intention jump recognition and semantic completion
CN122112211B
