Dialogue abstract generation method and device, equipment and storage medium
By inputting the current conversation to a pre-trained language model to generate candidate summary and using the self-attention model score to determine the target summary, the problem of low accuracy of dialogue summary in the existing technology is solved, and the accuracy of the dialogue system is improved.
Patent Information
- Application Number
- CN202410910883.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-11-01
AI Technical Summary
In the prior art, the summary determined by reading and summarizing the conversation is not accurate, resulting in inaccurate dialogue state extracted from the summary.
A pretrained language model of the current conversation input pretrained sequence to sequence generates multiple candidate digests, and a pretrained self-attention model scoring model determines the target digest based on the similarity between the conversation and the candidate digest.
The dialogue summary is achieved with high accuracy and provides accurate summary for DST model training, thereby improving the accuracy and user experience of the dialogue system.
Smart Images

Figure CN118885607A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technology, and in particular to a conversation summary generation method, apparatus, device and storage medium. Background Art
[0002] A dialogue system is a system that enables machines to understand human language intentions and perform specific tasks or respond through human-computer interaction. The key component of a dialogue system is the Dialog State Tracking (DST) model, which can determine the current dialogue state based on historical dialogues. The training of the DST model requires training sample dialogues and labeled dialogue states corresponding to the training sample dialogues. However, the direct acquisition cost of labeled dialogue states is high.
[0003] In the prior art, a conversation can usually be read and summarized to determine a summary corresponding to the conversation, and then a label conversation state corresponding to the training sample conversation can be determined based on the summary corresponding to the training sample conversation.
[0004] In the process of implementing the present invention, the inventors found that there are at least the following technical problems in the prior art:
[0005] The summary determined by reading and summarizing the conversation is not very accurate. Summary of the invention
[0006] The present invention provides a conversation summary generation method, device, equipment and storage medium to achieve a highly accurate summary corresponding to a conversation.
[0007] In a first aspect, an embodiment of the present invention provides a method for generating a conversation summary, comprising:
[0008] Inputting the current conversation into a pre-trained summary generation model, so that the summary generation model generates a plurality of candidate summaries corresponding to the current conversation, wherein the summary generation model is trained by a sequence-to-sequence pre-trained language model;
[0009] The current conversation and multiple candidate summaries corresponding to the current conversation are input into a candidate scoring model, so that the candidate scoring model determines a target summary corresponding to the current conversation according to the similarity between the current conversation and each of the candidate summaries, wherein the candidate scoring model is trained by a pre-trained self-attention model.
[0010] In a second aspect, an embodiment of the present invention further provides a conversation summary generating device, comprising:
[0011] A generation module, configured to input the current conversation into a pre-trained summary generation model, so that the summary generation model generates a plurality of candidate summaries corresponding to the current conversation, wherein the summary generation model is trained by a sequence-to-sequence pre-trained language model;
[0012] An execution module is used to input the current dialogue and multiple candidate summaries corresponding to the current dialogue into a candidate scoring model, so that the candidate scoring model determines a target summary corresponding to the current dialogue according to the similarity between the current dialogue and each of the candidate summaries, wherein the candidate scoring model is trained by a pre-trained self-attention model.
[0013] In a third aspect, an embodiment of the present invention further provides a server, the server comprising:
[0014] one or more processors;
[0015] a storage device for storing one or more programs,
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the conversation summary generating method as described in any one of the first aspects.
[0017] In a fourth aspect, an embodiment of the present invention further provides a storage medium comprising computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are used to execute a conversation summary generation method as described in any one of the first aspects.
[0018] The embodiments of the above invention have the following advantages or beneficial effects:
[0019] The embodiment of the present invention provides a method for generating a conversation summary, comprising: inputting a current conversation into a pre-trained summary generation model, so that the summary generation model generates a plurality of candidate summaries corresponding to the current conversation, wherein the summary generation model is trained by a sequence-to-sequence pre-trained language model; inputting the current conversation and the plurality of candidate summaries corresponding to the current conversation into a candidate scoring model, so that the candidate scoring model determines a target summary corresponding to the current conversation according to the similarity between the current conversation and each of the candidate summaries, wherein the candidate scoring model is trained by a pre-trained self-attention model. In the above technical solution, by inputting the current conversation into a pre-trained summary generation model, the summary generation model can generate a plurality of candidate summaries corresponding to the current conversation, thereby realizing the generation of a plurality of candidate summaries corresponding to the current conversation; by inputting the current conversation and the plurality of candidate summaries corresponding to the current conversation into the candidate scoring model, the candidate scoring model can determine the target summary corresponding to the current conversation according to the similarity between the current conversation and each of the candidate summaries, thereby realizing the determination of the target summary corresponding to the current conversation, that is, realizing the determination of a summary with a higher accuracy corresponding to the current conversation. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A flowchart of a method for generating a conversation summary provided by an embodiment of the present invention;
[0021] Figure 2 A flowchart of another method for generating a conversation summary provided by an embodiment of the present invention;
[0022] Figure 3 A schematic diagram of a conversation summary generation system provided by an embodiment of the present invention;
[0023] Figure 4 A schematic diagram of the structure of a conversation summary generating device provided by an embodiment of the present invention;
[0024] Figure 5 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0025] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0026] It should be mentioned before discussing exemplary embodiments in more detail that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe various operations (or steps) as sequential processes, many operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of various operations can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to methods, functions, procedures, subroutines, subprograms, etc. In addition, the embodiments in the present invention and the features in the embodiments can be combined with each other without conflict.
[0027] The DST model plays a vital role in the dialogue system. The direct acquisition cost of the labeled dialogue state required for DST model training is high, which makes it difficult for the DST model to perform well in unknown fields.
[0028] In the prior art, the above problem can be solved based on the method of domain transfer. Specifically, the model can be pre-trained in a domain with sufficiently rich labeled dialogue states, and the pre-trained model can be applied to a domain with limited labeled dialogue states or no labeled dialogue states. However, this method often relies on the similarity between domains and cannot be generalized well to various domains. Furthermore, the above problem can be solved based on the method of task transfer. On the one hand, the model can be pre-trained by using the labeled dialogue states of other tasks (such as reading comprehension tasks), which usually requires a large number of labeled dialogue states from other tasks. On the other hand, the training of the model can be expressed as a summary problem, that is, the text-to-text pre-trained language model (such as T5 and BART) can be fine-tuned according to the summary corresponding to the dialogue to obtain a DST model. The model can read and summarize the dialogue, determine the summary corresponding to the dialogue, and then extract the dialogue state from the summary. However, this method has limitations, such as the low accuracy of the summary corresponding to the generated dialogue, resulting in inaccurate dialogue states extracted from the summary.
[0029] Therefore, the present application provides a method for generating a conversation summary, which can achieve a high-accuracy summary corresponding to the conversation and provide a basis for the training of the DST model.
[0030] The conversation summary generation method provided by the present application will be described in detail below with reference to diagrams and embodiments.
[0031] Figure 1 This is a flow chart of a method for generating a conversation summary provided by an embodiment of the present invention. The embodiment of the present invention can be applied to situations where a highly accurate summary corresponding to a conversation needs to be determined. The method can be executed by a conversation summary generating device, which can be implemented by software and / or hardware. Figure 1 The method specifically comprises the following steps:
[0032] Step 110: input the current conversation into a pre-trained summary generation model, so that the summary generation model generates a plurality of candidate summaries corresponding to the current conversation.
[0033] The current conversation consists of the current conversation context.
[0034] The summary generation model is trained by a sequence-to-sequence pre-trained language model and is used to determine the summary corresponding to the conversation context. The summary corresponding to the conversation context can be understood as a description of the conversation context based on natural language.
[0035] Specifically, during the advancement of the dialogue system, the current dialogue context corresponding to the current moment is input as input information into a pre-trained summary generation model. The summary generation model can determine multiple candidate summaries corresponding to the current dialogue context. Specifically, the summary generation model can generate multiple candidate summaries corresponding to the current dialogue context based on a beam search strategy.
[0036] In the embodiment of the present invention, by inputting the current conversation into a pre-trained summary generation model, the summary generation model can generate multiple candidate summaries corresponding to the current conversation, thereby realizing the generation of multiple candidate summaries corresponding to the current conversation.
[0037] Step 120: Input the current conversation and multiple candidate summaries corresponding to the current conversation into a candidate scoring model, so that the candidate scoring model determines a target summary corresponding to the current conversation according to the similarity between the current conversation and each of the candidate summaries.
[0038] The candidate scoring model is trained by the pre-trained self-attention model and is used to determine the target summary among multiple candidate summaries corresponding to the dialogue context. The target summary corresponding to the dialogue context can be understood as the summary with the highest similarity to the dialogue context among the multiple candidate summaries corresponding to the dialogue context.
[0039] Specifically, after determining multiple candidate summaries corresponding to the current conversation, the current conversation and multiple candidate summaries corresponding to the current conversation can be input into the candidate scoring model, and the candidate scoring model can determine the similarity between the current conversation and each candidate summary, and determine the candidate summary corresponding to the maximum similarity as the target summary corresponding to the current conversation. Specifically, the candidate scoring model can determine the cosine similarity between the current conversation and each candidate summary, and determine the candidate summary with the maximum cosine similarity as the target summary corresponding to the current conversation.
[0040] In an embodiment of the present invention, by inputting the current conversation and multiple candidate summaries corresponding to the current conversation into a candidate scoring model, the candidate scoring model can determine the target summary corresponding to the current conversation based on the similarity between the current conversation and each candidate summary, thereby determining the target summary corresponding to the current conversation, that is, determining a summary with higher accuracy corresponding to the current conversation.
[0041] The method for generating a conversation summary provided by an embodiment of the present invention includes: inputting the current conversation into a pre-trained summary generation model, so that the summary generation model generates multiple candidate summaries corresponding to the current conversation; inputting the current conversation and the multiple candidate summaries corresponding to the current conversation into a candidate scoring model, so that the candidate scoring model determines the target summary corresponding to the current conversation according to the similarity between the current conversation and each of the candidate summaries. In the above technical solution, by inputting the current conversation into a pre-trained summary generation model, the summary generation model can generate multiple candidate summaries corresponding to the current conversation, thereby realizing the generation of multiple candidate summaries corresponding to the current conversation; by inputting the current conversation and the multiple candidate summaries corresponding to the current conversation into the candidate scoring model, the candidate scoring model can determine the target summary corresponding to the current conversation according to the similarity between the current conversation and each of the candidate summaries, thereby realizing the determination of the target summary corresponding to the current conversation, that is, realizing the determination of a summary with higher accuracy corresponding to the current conversation.
[0042] Figure 2 A flowchart of another method for generating a conversation summary provided by an embodiment of the present invention. The embodiment of the present invention is applicable to situations where it is necessary to determine a highly accurate summary corresponding to the conversation. Based on the above embodiment, before inputting each candidate summary corresponding to the current conversation into the candidate scoring model, the embodiment of the present invention adds "reversely determining the candidate state corresponding to each candidate summary based on heuristic rules; splicing each candidate summary and the corresponding candidate state to obtain multiple spliced summaries corresponding to the current conversation.", and also adds a training process for the summary generation model and the candidate scoring model, wherein the explanations of the terms that are the same or corresponding to the above embodiments are not repeated here. See Figure 2 , the conversation summary generation method provided by the embodiment of the present invention includes:
[0043] Step 210: Input the current conversation into a pre-trained summary generation model, so that the summary generation model generates a plurality of candidate summaries corresponding to the current conversation based on a beam search strategy.
[0044] The current dialogue is composed of the current dialogue context, including the dialogue context of T rounds, which can be expressed as D = {(R1, U1), ..., (R n , U n ),…,(R T , U T)}, where R T and U T They represent the system's output utterance and the user's input utterance in the T-th round of dialogue respectively.
[0045] In one implementation, the training process of the summary generation model includes: obtaining training sample conversations and determining a label summary corresponding to each of the training sample conversations; inputting the training sample conversations and the label summary corresponding to each of the training sample conversations as training data sets into a sequence-to-sequence pre-trained language model, performing model training on the sequence-to-sequence pre-trained language model, and calculating a first loss function value; and performing model optimization based on a back-propagation algorithm until the first loss function value converges to obtain the summary generation model.
[0046] Further, determining a label summary corresponding to each of the training sample conversations includes:
[0047] Each of the training sample dialogues is converted into natural language based on heuristic rules to obtain the label summary corresponding to each of the training sample dialogues.
[0048] Specifically, a training sample dialogue is obtained, and each training sample dialogue is converted into natural language based on a heuristic rule to obtain a label summary corresponding to each training sample dialogue. In practical applications, by converting the dialogue state corresponding to each training sample dialogue into natural language, a label summary corresponding to each training sample dialogue can be obtained. For example, when the dialogue state corresponding to the training sample dialogue is {(taxi-departure, lan hong house), (taxi-destination, leicester train station)}, it is converted into natural language, and it can be determined that the label summary corresponding to the training sample dialogue is "The user is looking for a taxi from lan hong house to leicester train station".
[0049] The first loss function may be a cross entropy loss. The training sample dialogues and the label summaries corresponding to the training sample dialogues are input into the sequence-to-sequence pre-trained language model as the training data set. The sequence-to-sequence pre-trained language model may determine the predicted summaries corresponding to the training sample dialogues. The first loss function value is calculated based on the training sample dialogues, the predicted summaries corresponding to the training sample dialogues, and the label summaries. Among them, L sum represents the cross entropy loss, S t represents the forecast summary, Represents the label summary, X represents the training sample dialogue, and the model is optimized based on the back propagation algorithm until the first loss function value converges to obtain the summary generation model.
[0050] During the advancement of the dialogue system, the current dialogue corresponding to the current moment is input into the summary generation model as input information. The summary generation model can generate multiple candidate summaries c1, c2, ..., c corresponding to the current dialogue based on the beam search strategy. n , …, c N Of course, the number of candidate summaries generated by the summary generation model can be determined according to the beam search strategy.
[0051] When the summary generation model generates multiple candidate summaries corresponding to the current dialogue context based on the beam search strategy, it first generates multiple summaries corresponding to the current dialogue context, then sorts the multiple summaries according to probability, and determines the top N summaries as candidate summaries corresponding to the current dialogue context.
[0052] In the embodiment of the present invention, by inputting the current conversation into a pre-trained summary generation model, the summary generation model can generate multiple candidate summaries corresponding to the current conversation, thereby realizing the generation of multiple candidate summaries corresponding to the current conversation.
[0053] Step 220: reversely determine the candidate state corresponding to each of the candidate summaries based on the heuristic rule; and concatenate each of the candidate summaries and the corresponding candidate state to obtain a plurality of concatenated summaries corresponding to the current conversation.
[0054] Specifically, the candidate state corresponding to each candidate summary can be determined inversely based on the heuristic rule used to determine the label summary corresponding to the training sample dialogue according to the dialogue state corresponding to the training sample dialogue. For each candidate summary, the candidate summary and its corresponding candidate state can be spliced to obtain the spliced summary corresponding to the current dialogue. Among them, c n represents the candidate summary, b n Indicates a candidate state. In practical applications, prefixes can be added to candidate summaries and candidate states respectively to distinguish between candidate summaries and candidate states, that is, to determine the concatenated summary. [summary] is the prefix of the candidate summary, and [state] is the prefix of the candidate state.
[0055] In the embodiment of the present invention, by determining the candidate state corresponding to each candidate summary and concatenating each candidate summary and the corresponding candidate state, a plurality of concatenated summaries corresponding to the current conversation can be obtained.
[0056] Step 230: Input each of the concatenated summaries corresponding to the current conversation into a candidate scoring model, so that the candidate scoring model determines the target summary corresponding to the current conversation from each of the candidate summaries according to the similarity between the current conversation and each of the concatenated summaries.
[0057] In one implementation, the training process of the candidate scoring model includes:
[0058] Obtain candidate summaries and label summaries corresponding to each training sample conversation; input the candidate summaries and label summaries corresponding to each training sample conversation as training data sets into a pre-trained self-attention model, perform model training on the pre-trained self-attention model, and calculate a second loss function value; perform model optimization based on a back-propagation algorithm until the second loss function value converges to obtain the candidate scoring model.
[0059] Specifically, after obtaining the candidate summaries and label summaries corresponding to the training sample dialogues, the training sample dialogues D' and their corresponding candidate summaries c1, c2, ..., c m , …, c M After getting the training data, you can also summarize the labels corresponding to the training sample dialogue D' As the labels of the training data, c1, c2, ..., c m , …, c M Yes For c1, c2, ..., c n , …, c N Determined by sorting in descending order, To calculate c m and ROUGE (a commonly used NLP evaluation metric used to measure the degree of match between generated results and standard results) between.
[0060] The second loss function may be a ranking loss.
[0061] On the one hand, the ranking loss can be expressed as Formula 1: On the other hand, the ranking loss can be expressed as Formula 2: in, Represents training sample dialogue X and candidate summary The cosine similarity of Represents training sample dialogue X and label summary The cosine similarity of Represents training sample dialogue X and candidate summary The cosine similarity of , and the candidate summary The probability of being determined as the target summary is greater than that of the candidate summary The probability of being determined as the target summary, where margin is a preset parameter and its value can be set according to actual needs, is used to increase the distance between candidate summary representations to make them more distinguishable and improve the accuracy of the candidate scoring model.
[0062] In addition, after obtaining the concatenated summary and the labeled summary corresponding to the training sample conversation, the training sample conversation D' and its corresponding concatenated summaries C1, C2, …, C m , …, C M can be associated to obtain the training data. The labeled summary corresponding to the training sample conversation D' can also be used as the label of the training data. The labeled summary corresponding to the training sample conversation D' can also be used as the label of the training data, where C1, C2, …, C m , …, C M is sorted in descending order according to C1, C, …, C n , …, C N to determine, which is used to calculate the ROUGE between C m and .
[0063] On the other hand, the ranking loss can be Equation 3: On the other hand, the ranking loss can be Equation 4: where represents the cosine similarity between the training sample conversation X and the concatenated summary , represents the cosine similarity between the training sample conversation X and the labeled summary , represents the cosine similarity between the training sample conversation X and the concatenated summary , and the candidate summary corresponding to the concatenated summary has a probability of being determined as the target summary greater than that of the candidate summary corresponding to the concatenated summary The margin is a preset parameter and its value can be set according to actual needs, which is used to increase the distance between candidate summary representations to make them more distinguishable and improve the accuracy of the candidate scoring model.
[0064] In practical applications, a hyperparameter a (0 < a < 1) can also be added to update Equation 1 to:
[0065] Update formula 2 to: Update formula 3 to:
[0066] Update formula 4 to:
[0067] This increases the distance between candidate summary representations and further improves the accuracy of the candidate scoring model.
[0068] After determining the multiple concatenated summaries corresponding to the current conversation, the current conversation and the multiple concatenated summaries corresponding to the current conversation may be input into the candidate scoring model, and the candidate scoring model may determine the similarity between the current conversation and each concatenated summary, and determine the candidate summary corresponding to the concatenated summary corresponding to the maximum similarity as the target summary corresponding to the current conversation. Specifically, the candidate scoring model may determine the cosine similarity between the current conversation and each concatenated summary, and determine the candidate summary corresponding to the concatenated summary with the maximum cosine similarity as the target summary corresponding to the current conversation.
[0069] In an embodiment of the present invention, by inputting the current conversation and multiple concatenated summaries corresponding to the current conversation into a candidate scoring model, the candidate scoring model can determine the target summary corresponding to the current conversation based on the similarity between the current conversation and each concatenated summary, thereby determining the target summary corresponding to the current conversation, that is, determining a summary with higher accuracy corresponding to the current conversation.
[0070] The highly accurate summary corresponding to the current conversation determined by the embodiment of the present invention can be used to train the DST model, so that the trained DST model can be applied to the business field corresponding to the current conversation, thereby improving the accuracy of the DST model, further improving the smoothness of the conversation system, and improving the user experience.
[0071] The conversation summary generation method provided by the embodiment of the present invention includes: inputting the current conversation into a pre-trained summary generation model, so that the summary generation model generates multiple candidate summaries corresponding to the current conversation based on a beam search strategy; reversely determining the candidate state corresponding to each of the candidate summaries based on a heuristic rule; splicing each of the candidate summaries and the corresponding candidate state to obtain multiple spliced summaries corresponding to the current conversation; inputting each of the spliced summaries corresponding to the current conversation into a candidate scoring model, so that the candidate scoring model determines the target summary corresponding to the current conversation from each of the candidate summaries according to the similarity between the current conversation and each of the spliced summaries. The above technical solution, by inputting the current conversation into a pre-trained summary generation model, the summary generation model can generate multiple candidate summaries corresponding to the current conversation, realize the generation of multiple candidate summaries corresponding to the current conversation, determine the candidate state corresponding to each candidate summary, and splice each candidate summary and the corresponding candidate state, so as to obtain multiple spliced summaries corresponding to the current conversation. By inputting the current conversation and the multiple spliced summaries corresponding to the current conversation into the candidate scoring model, the candidate scoring model can determine the target summary corresponding to the current conversation according to the similarity between the current conversation and each spliced summary, so as to realize the determination of the target summary corresponding to the current conversation, that is, to realize the determination of a summary with higher accuracy corresponding to the current conversation.
[0072] Figure 3 A schematic diagram of a conversation summary generation system provided by an embodiment of the present invention is shown in FIG. Figure 3 As shown, the conversation summary generation system includes a summary generation device and a candidate scoring device, wherein the summary generation device has a built-in summary generation model, and the candidate scoring device has a built-in candidate scoring model. After the current conversation is input into the conversation summary generation system, firstly, a plurality of candidate summaries corresponding to the current conversation can be generated based on the summary generation model built in the summary generation device, and the summary generation device can send the current conversation and the plurality of candidate summaries corresponding to the current conversation to the candidate scoring device, and then the similarity between the current conversation and each candidate summary can be determined based on the candidate scoring model built in the candidate scoring device, and the candidate summary with the highest similarity can be determined as the target summary corresponding to the current conversation, so as to achieve the determination of a highly accurate summary corresponding to the current conversation.
[0073] Figure 4 This is a schematic diagram of the structure of a conversation summary generation device provided in an embodiment of the present invention. The device and the conversation summary generation method of the above embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the conversation summary generation device, reference can be made to the embodiment of the above conversation summary generation method.
[0074] The specific structure of the conversation summary generating device is as follows: Figure 4 As shown, including:
[0075] A generation module 410 is used to input the current conversation into a pre-trained summary generation model, so that the summary generation model generates multiple candidate summaries corresponding to the current conversation, wherein the summary generation model is trained by a sequence-to-sequence pre-trained language model;
[0076] An execution module 420 is used to input the current dialogue and multiple candidate summaries corresponding to the current dialogue into a candidate scoring model, so that the candidate scoring model determines a target summary corresponding to the current dialogue according to the similarity between the current dialogue and each of the candidate summaries, wherein the candidate scoring model is trained by a pre-trained self-attention model.
[0077] Based on the above embodiment, the generating module 410 is specifically used for:
[0078] The current conversation is input into a pre-trained summary generation model, so that the summary generation model generates a plurality of candidate summaries corresponding to the current conversation based on a beam search strategy.
[0079] Based on the above embodiment, the device further includes:
[0080] The first training module is used to obtain training sample conversations and determine the label summary corresponding to each of the training sample conversations; input the training sample conversations and the label summary corresponding to each of the training sample conversations as training data sets into a sequence-to-sequence pre-trained language model, perform model training on the sequence-to-sequence pre-trained language model, and calculate a first loss function value; perform model optimization based on a back-propagation algorithm until the first loss function value converges to obtain the summary generation model.
[0081] In one implementation, determining a label summary corresponding to each of the training sample conversations includes:
[0082] Each of the training sample dialogues is converted into natural language based on heuristic rules to obtain the label summary corresponding to each of the training sample dialogues.
[0083] Based on the above embodiment, the device further includes:
[0084] A splicing module is used to reversely determine the candidate state corresponding to each candidate summary based on a heuristic rule before inputting the current conversation and multiple candidate summaries corresponding to the current conversation into a candidate scoring model; and splice each candidate summary and the corresponding candidate state to obtain multiple spliced summaries corresponding to the current conversation.
[0085] Based on the above embodiment, the execution module 420 is specifically used for:
[0086] The concatenated summaries corresponding to the current conversation are input into a candidate scoring model, so that the candidate scoring model determines the target summary corresponding to the current conversation from among the candidate summaries according to the similarity between the current conversation and the concatenated summaries.
[0087] Based on the above embodiment, the device further includes:
[0088] The second training module is used to obtain the candidate summary and label summary corresponding to each training sample conversation; input the candidate summary and label summary corresponding to each training sample conversation as a training data set into the pre-trained self-attention model, perform model training on the pre-trained self-attention model, and calculate the second loss function value; perform model optimization based on the back propagation algorithm until the second loss function value converges to obtain the candidate scoring model.
[0089] The conversation summary generating device provided in the embodiment of the present invention can execute the conversation summary generating method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the conversation summary generating method.
[0090] It is worth noting that in the embodiment of the above-mentioned conversation summary generation device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0091] Figure 5 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Figure 5 A block diagram of an exemplary computer device 5 suitable for use in implementing embodiments of the present invention is shown. Figure 5 The computer device 5 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0092] like Figure 5 As shown, the computer device 5 is in the form of a general-purpose computing electronic device. The components of the computer device 5 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 connecting different system components (including the system memory 28 and the processing unit 16).
[0093] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0094] The computer device 5 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 5, including volatile and non-volatile media, removable and non-removable media.
[0095] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 5 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 not shown, usually called a "hard drive"). Although Figure 5 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0096] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0097] The computer device 5 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the computer device 5, and / or any device that enables the computer device 5 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed through an input / output (I / O) interface 22. Furthermore, the computer device 5 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 20. Figure 5 As shown, the network adapter 20 communicates with other modules of the computer device 5 via the bus 18. It should be understood that although Figure 5 Not shown, other hardware and / or software modules may be used in conjunction with computer device 5, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0098] The processing unit 16 executes various functional applications and page displays by running the program stored in the system memory 28, for example, implementing the conversation summary generation method provided in the embodiment of the present invention, which includes:
[0099] Inputting the current conversation into a pre-trained summary generation model, so that the summary generation model generates a plurality of candidate summaries corresponding to the current conversation, wherein the summary generation model is trained by a sequence-to-sequence pre-trained language model;
[0100] The current conversation and multiple candidate summaries corresponding to the current conversation are input into a candidate scoring model, so that the candidate scoring model determines a target summary corresponding to the current conversation according to the similarity between the current conversation and each of the candidate summaries, wherein the candidate scoring model is trained by a pre-trained self-attention model.
[0101] Of course, those skilled in the art can understand that the processor can also implement the technical solution of the conversation summary generation method provided by any embodiment of the present invention.
[0102] An embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method for generating a conversation summary provided by an embodiment of the present invention is implemented. The method includes:
[0103] Inputting the current conversation into a pre-trained summary generation model, so that the summary generation model generates a plurality of candidate summaries corresponding to the current conversation, wherein the summary generation model is trained by a sequence-to-sequence pre-trained language model;
[0104] The current conversation and multiple candidate summaries corresponding to the current conversation are input into a candidate scoring model, so that the candidate scoring model determines a target summary corresponding to the current conversation according to the similarity between the current conversation and each of the candidate summaries, wherein the candidate scoring model is trained by a pre-trained self-attention model.
[0105] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can 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 (non-exhaustive list) of computer-readable storage media include: 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. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0106] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media 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.
[0107] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0108] Computer program code for performing the operations 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" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and 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 through 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., via the Internet using an Internet service provider).
[0109] It should be understood by those skilled in the art that the modules or steps of the present invention described above can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented by a program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0110] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for generating a conversation summary, characterized in that: include: Inputting the current conversation into a pre-trained summary generation model, so that the summary generation model generates a plurality of candidate summaries corresponding to the current conversation, wherein the summary generation model is trained by a sequence-to-sequence pre-trained language model; The current conversation and multiple candidate summaries corresponding to the current conversation are input into a candidate scoring model, so that the candidate scoring model determines a target summary corresponding to the current conversation according to the similarity between the current conversation and each of the candidate summaries, wherein the candidate scoring model is trained by a pre-trained self-attention model.
2. The method for generating a conversation summary according to claim 1, characterized in that: Inputting the current conversation into a pre-trained summary generation model so that the summary generation model generates a plurality of candidate summaries corresponding to the current conversation, including: The current conversation is input into a pre-trained summary generation model, so that the summary generation model generates a plurality of candidate summaries corresponding to the current conversation based on a beam search strategy.
3. The method for generating a conversation summary according to claim 1, characterized in that: The training process of the summary generation model includes: Obtaining training sample conversations, and determining a label summary corresponding to each of the training sample conversations; Inputting the training sample dialogue and the label summary corresponding to each training sample dialogue as a training data set into a sequence-to-sequence pre-trained language model, performing model training on the sequence-to-sequence pre-trained language model, and calculating a first loss function value; The model is optimized based on a back propagation algorithm until the first loss function value converges to obtain the summary generation model.
4. The method for generating a conversation summary according to claim 3, characterized in that: Determine a label summary corresponding to each of the training sample dialogues, including: Each of the training sample dialogues is converted into natural language based on heuristic rules to obtain the label summary corresponding to each of the training sample dialogues.
5. The method for generating a conversation summary according to claim 4, characterized in that: Before inputting the current conversation and a plurality of candidate summaries corresponding to the current conversation into a candidate scoring model, the method further includes: Reversely determining the candidate state corresponding to each of the candidate summaries based on the heuristic rules; Each of the candidate summaries and the corresponding candidate states are concatenated to obtain a plurality of concatenated summaries corresponding to the current conversation.
6. The method for generating a conversation summary according to claim 5, characterized in that: Inputting the current conversation and a plurality of candidate summaries corresponding to the current conversation into a candidate scoring model, so that the candidate scoring model determines a target summary corresponding to the current conversation according to the similarity between the current conversation and each of the candidate summaries, including: The current dialogue and the concatenated summaries corresponding to the current dialogue are input into a candidate scoring model, so that the candidate scoring model determines the target summary corresponding to the current dialogue according to the similarity between the current dialogue and the concatenated summaries.
7. The method for generating a conversation summary according to claim 5, characterized in that: The training process of the candidate scoring model includes: Obtaining candidate summaries and label summaries corresponding to each of the training sample conversations; Input the training sample dialogue, the candidate summary corresponding to each of the training sample dialogues, and the label summary as a training data set into a pre-trained self-attention model, perform model training on the pre-trained self-attention model, and calculate a second loss function value; The model is optimized based on a back-propagation algorithm until the second loss function value converges to obtain the candidate scoring model.
8. A conversation summary generating device, characterized in that: include: A generation module, configured to input the current conversation into a pre-trained summary generation model, so that the summary generation model generates a plurality of candidate summaries corresponding to the current conversation, wherein the summary generation model is trained by a sequence-to-sequence pre-trained language model; An execution module is used to input the current dialogue and multiple candidate summaries corresponding to the current dialogue into a candidate scoring model, so that the candidate scoring model determines a target summary corresponding to the current dialogue according to the similarity between the current dialogue and each of the candidate summaries, wherein the candidate scoring model is trained by a pre-trained self-attention model.
9. A computer device, characterized in that: The computer device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the conversation summary generating method as described in any one of claims 1-7.
10. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions are used to execute the conversation summary generation method as described in any one of claims 1-7 when executed by a computer processor.
