Conversation abstract method and system based on fact consistency comparison

The conversation summarization method addresses the challenge of generating summaries with high factual consistency by employing a deep learning network model for fact consistency comparison, resulting in improved summary accuracy and generalization.

CN119166906AActive Publication Date: 2024-12-20FUZHOU UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411213851.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-31
Publication Date
2024-12-20
Estimated Expiration
2044-08-31

AI Technical Summary

Technical Problem

Existing conversation summarization technologies face challenges in generating summaries with high factual consistency due to unique characteristics of conversation data, such as diverse language styles and unclear topic boundaries, leading to summaries that lack fluency and diversity.

Method used

A conversation summarization method based on fact consistency comparison using a deep learning network model that incorporates a fact-enhancement and disruption strategies to construct positive and negative examples for contrastive learning, minimizing the distance between the initial dialogue summary and the enhanced or disrupted dialogue facts to improve factual consistency.

Benefits of technology

The method significantly enhances the factual consistency of generated summaries, improving generalization ability and outperforming state-of-the-art models on benchmark datasets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166906A_ABST
    Figure CN119166906A_ABST
Patent Text Reader

Abstract

The invention relates to a dialogue abstracting method and system based on fact consistency comparison. The method comprises the steps that user dialogues and user dialogue abstracts are extracted and labeled, and a training set DS is constructed; a deep learning network model M based on fact consistency comparison is constructed, and the model M forms a comparison triple for comparison learning by obtaining the abstract representation of an initial dialogue, the abstract representation of dialogue fact enhancement and the abstract representation of dialogue fact disturbance; minimizing the distance between the digest representation of the initial dialogue and the digest representation of the dialogue fact enhancement in the training process, while maximizing the distance between the digest representation of the initial dialogue and the digest representation of the dialogue fact disruption; using the training set DS to train a model M, and learning a semantic relationship between the user dialogue and the user dialogue abstract through the model M; and inputting a user dialogue into the trained model M, and outputting an abstract of the user dialogue. The method and the system are favorable for improving the accuracy of the dialogue abstract.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of natural language processing, and in particular to a conversation summarization method and system based on fact consistency comparison. Background Art

[0002] Conversation is one of the most common ways of communication in social networks. It has become an important task to organize the content of conversations into relevant summaries or abstracts. The purpose of conversation summarization is to summarize the important information that a third party considers in the discourse of two or more interlocutors. This task not only helps to provide a quick context for new participants in the conversation, but also helps people grasp the central idea or search for key content in the conversation, thereby improving efficiency and productivity. In recent years, social networks have become increasingly closely related to people. People use social networks to communicate, make friends, work, study and entertain. With the increasing number of users, the communication data generated by social networks is also increasing day by day. People can use conversation summarization technology to extract the main information in the conversation and form a summary so as to grasp the relevant information quickly and efficiently. However, unlike news or articles in traditional document summarization, conversation data has its own unique characteristics, including different language styles, scattered information, flexible discourse structure, unclear topic boundaries, etc., which brings many challenges to conversation summarization.

[0003] The earliest work on dialogue summarization solved this problem by converting the dialogue into a word graph and selecting appropriate paths in the graph as summary sentences based on complex rules. Template-based methods have also been used, which collect templates from summaries written by humans and generate abstract summaries by selecting appropriate words from the dialogue to fill in the blanks. However, the summaries they generate lack fluency and diversity, and are therefore far from practical use. With the emergence of neural encoder-decoder models, it is possible to project the input into a dense semantic representation and generate a summary with new words by gradually sampling from the vocabulary until a special token indicating the end is output. Based on these models, generative text summarization has made significant progress, from non-pre-trained PGN, Fast-Abs, and HRED, to pre-trained models BART and Pegasus, which have promoted the development of abstract text summarization.

[0004] Kim et al. designed a new common sense supervised auxiliary task, using common sense knowledge generated from golden summaries as additional supervision, and the goal of the task is to generate target common sense. In a multi-task learning environment, the dialogue summary and common sense generation tasks are jointly learned to effectively inject common sense knowledge into the shared encoder. Zou et al. use the original dialogue as output to train a denoising autoencoder that can perform content compression on unsupervised dialogue summaries. Noise reduction operations are performed on each sample, including fragment insertion, discourse replacement, and content retention. Lin et al. designed three topic-related auxiliary tasks to enhance the summary model, including predicting the topics present in the dialogue, constraining the attention distribution of the decoder, and distinguishing summaries of different topics in the same dialogue.

[0005] In order to collect or construct more dialogue summary data without the need for manual annotation, data augmentation methods are often used in the dialogue summarization field. Chen and Yang augmented dialogue data by swapping, deleting, inserting, and replacing at the discourse level, and used the corresponding summaries as output to make the dialogue input more diverse for training dialogue summarization models. Liu and Chen and Khalifa et al. augmented data by simultaneously replacing names in dialogues and reference summaries. Asi et al. collected pseudo summaries using large language models such as GPT-3 by inputting dialogues with predefined question prompts. Fang et al. augmented and improved the original training pairs with a discourse rewriting model and a coreference resolution model to produce highly understandable dialogue data. In addition, the work of Zhu et al. also considered using relatively large-scale extracted dialogue summary data as pre-training datasets, such as MediaSum, for other low-resource dialogue summarization scenarios. Summary of the invention

[0006] The object of the present invention is to provide a conversation summarization method and system based on fact consistency comparison, which is conducive to improving the accuracy of conversation summaries.

[0007] In order to achieve the above object, the technical solution adopted by the present invention is: a conversation summarization method based on fact consistency comparison, characterized in that it includes the following steps:

[0008] Step A: Extract user conversations and user conversation summaries, and annotate user conversation and user conversation summary labels. Each complete user conversation corresponds to a user conversation summary, and construct a training set DS.

[0009] Step B: construct a deep learning network model M based on fact consistency comparison, wherein the deep learning network model M constructs a fact consistency comparison task as an auxiliary task of the dialogue summary main task, and obtains a summary representation of the initial dialogue, a summary representation enhanced by dialogue facts, and a summary representation disturbed by dialogue facts to form a comparison triplet for comparative learning; during the training process, the distance between the summary representation of the initial dialogue and the summary representation enhanced by dialogue facts is minimized, and the distance between the summary representation of the initial dialogue and the summary representation disturbed by dialogue facts is maximized, so as to improve the fact consistency of the summary generated by the model; the deep learning network model M is trained using the training set DS, and the semantic relationship between the user dialogue and the user dialogue summary is learned through the deep learning network model M;

[0010] Step C: Input the user conversation into the trained deep learning network model M and output the summary of the user conversation.

[0011] Furthermore, the step B specifically includes the following steps:

[0012] Step B1: Perform initial processing on all training samples in the training data set DS to obtain the initial sequence D of the dialogue init ;

[0013] Step B2: The initial sequence D of the dialogue obtained in step B1 init , through the encoder and decoder of the BART model, the initial dialogue summary representation S is obtained init , normalized by the softmax function, and the cross entropy is used as the loss function to calculate the loss value, and the loss of the main task of the dialogue summary is calculated. main ;

[0014] Step B3: The initial sequence D of the conversation obtained in step B1 init Segmentation is performed to divide the speaker-discourse pairs su , define a dynamic size window based on the number of speaker-utterance pairs The window contains a sequence of k consecutive speaker-utterance pairs in the conversation. The coreference relationship of the sequence in the window is parsed, and the entity coreference list L obtained by parsing is coref Perform dialogue fact enhancement to obtain the dialogue sequence D with fact enhancement fe , the summary representation S enhanced by the dialogue facts is obtained through the BART model fe ;

[0015] Step B4: Use the dynamically sized window obtained in step B3 The NlpAug data enhancement tool is used to enhance the text data of the dialogue in the window. The words in each sentence in the window are randomly replaced with semantic inversion, and the fact-disturbed dialogue sequence D is obtained by splicing.fp , the summary representation S of the dialogue fact disturbance is obtained through the BART model fp ;

[0016] Step B5: The initial conversation summary obtained in steps B2, B3 and B4 is represented by S init , summary representation enhanced by dialogue facts S fe and the summary representation S of the dialogue facts perturbation fp Construct contrast triplets and use contrastive learning to calculate the loss of the fact consistency contrast auxiliary task fc ;

[0017] Step B6: Substitute the conversation summary main task loss obtained in step B2 main Compare the loss of the auxiliary task with the fact consistency obtained in step B5 fc The final loss of the model is obtained by weighting, the gradient of each parameter in the deep learning network model is calculated by the back propagation method, and the parameters are updated using the stochastic gradient descent method;

[0018] Step B7: When the loss value change generated by each iteration of the deep learning network model is less than a given threshold, or the maximum number of iterations is reached, the training process of the deep learning network model is terminated.

[0019] Furthermore, the step B1 specifically includes the following steps:

[0020] Step B11: traverse the training set DS, perform word segmentation and stop word removal on the dialogue texts therein, and each training sample in DS is represented as ds = (D, S), where D is the text content of the dialogue and S is the summary text content corresponding to the dialogue;

[0021] Dialogue D is represented as:

[0022] D={t1,t2,…,t n}

[0023] Among them, t i is the i-th speaker-utterance pair in dialogue D, i = 1, 2, ..., n, and n is the number of speaker-utterance pairs contained in dialogue D;

[0024] speaker-utterance dialogue i It is expressed as:

[0025] t i =(s i ,u i )

[0026]

[0027] Among them, si is the i-th speaker, u i is the utterance of the i-th speaker, is the jth word in the i-th sentence, i = 1, 2, ..., n, j = 1, 2, ..., m, m is the utterance u i Length of text;

[0028] Step B12: The dialogue D obtained in step B11 is converted into {t1, t2, ..., t n}, insert [CLS] tag in front and [SEP] tag between each sentence, construct the initial sequence D of the dialogue init ; Dialogue initial sequence D init It is expressed as:

[0029] D init =[CLS]+t1+[SEP]+t2+[SEP]+…+t n

[0030] Here, n represents the number of speaker-utterance pairs contained in the conversation.

[0031] Furthermore, the step B2 specifically includes the following steps:

[0032] Step B21: D init The tokenizer of the BART model performs padding and length truncation to obtain the conversation token sequence N as the BART model encoder input;

[0033] The conversation token sequence N is calculated as follows:

[0034] N=BART tokenizer (D init )

[0035] Among them, BART tokenizer () represents the tokenizer of the BART model;

[0036] The encoder output is calculated as follows:

[0037]

[0038]

[0039] Among them, BART enc () represents the BART model encoder, is the i-th word in the u-th sentence The corresponding word vector, l is the text length of the nth sentence, and d is the dimension of the feature vector;

[0040] Step B22: The encoder output H obtained in step B21 is init As the input of the BART model decoder, it is decoded through the self-attention mechanism, layer normalization, cross attention, and feedforward neural network to obtain the initial dialogue summary representation S init ;

[0041] H'=SelfAttention(LayNorm(H init ))

[0042] H"=CrossAttention(LayNorm(H'+H init ))

[0043] S init =FFN(LayNorm(H'+H'))

[0044] Among them, LayNorm(·) represents layer normalization, SelfAttention(·) represents self-attention mechanism, CrossAttention(·) represents cross attention, and FFN(·) represents feedforward neural network;

[0045] Step B23: The initial conversation summary obtained in step B22 is represented as S init , normalized by the softmax function, obtain the score distribution P of the next word generated, use cross entropy as the loss function to calculate the loss value, and calculate the loss of the main task of the dialogue summary main ;

[0046] The calculation formula of score distribution P is as follows:

[0047] P = softmax(WS init +b)

[0048] Among them, P∈[0,1], W is the trainable parameter matrix, and b is the bias vector;

[0049] Conversation summary main task loss main The calculation formula is as follows:

[0050]

[0051] Among them, P(y t |y <t ,D;θ) represents the corresponding word y taken from P t The probability value of | represents the conditional part of the conditional probability, that is, given y <t , dialogue text D and model parameters θ, generate the target word y t The probability of y <t=(y1,y2,…,y t-1 ) represents the first t-1 words of the output sequence, S y Represents a target summary.

[0052] Furthermore, the step B3 specifically includes the following steps:

[0053] Step B31: The initial sequence D of the dialogue obtained in step B12 is init Segmentation is performed based on the [SEP] tag to divide the speaker-utterance pairs su , a dynamic window size is defined according to the number of speaker-utterance pairs n The window size is k, k = 1, 2, ..., n, the window contains a sequence of k consecutive speaker-utterance pairs in the conversation, and the speaker-utterance pairs outside the window are denoted as t other ;

[0054] speaker-utterance dialogue su It is expressed as follows:

[0055] t su ={t1,t2,…,t n}

[0056] Dynamically sized windows It is expressed as follows:

[0057]

[0058] After the window is divided, the dialog D is expressed as follows:

[0059]

[0060] in, for A randomly selected window in , i = 1, 2, …, k, concat(·) represents the concatenation operation;

[0061] Step B32: For each D init Calculation Window Random Selection Use FastCoref coreference resolution tool to resolve coreference relationship of the dialog in the window and obtain entity coreference list L coref , if the length of the coreference group in the coreference list is 2, the entity replacement coreference pronoun operation is directly performed; if the length of the coreference group in the coreference list is greater than 2, a non-first element is randomly selected to perform the entity replacement coreference pronoun operation, and the fact-enhanced dialogue sequence D is obtained by concatenating fe ;

[0062] Coreference list of dialog windows The calculation is as follows:

[0063]

[0064]

[0065] Among them, FCoref(·) represents the coreference resolution operation, e i and p i For Window The entity and pronoun information contained in the speaker-utterance pair;

[0066] Fact-enhanced dialogue sequence D fe The calculation is as follows:

[0067]

[0068]

[0069] in, is a coreference list In the j-th coreference group, func1(·) represents a direct replacement operation, and func2(·) represents a random non-first element replacement operation;

[0070] Step B33: Enhance the dialogue sequence D obtained by step B32 with the facts fe Input to the encoder and decoder of the BART model to obtain the summary representation S enhanced by the dialogue facts fe ;

[0071] Dialogue Fact Enhanced Summary Representation S fe The calculation is as follows:

[0072] S fe =BART enc-dec (D fe )

[0073] Among them, BART enc-dec Represents the encoder and decoder of the BART model.

[0074] Furthermore, the step B4 specifically includes the following steps:

[0075] Step B41: Use the dynamically sized window obtained in step B31 The window contains a sequence of k consecutive speaker-utterance pairs in the conversation, and the speaker-utterance pairs outside the window are denoted as t other ;

[0076] speaker-utterance dialogue su It is expressed as follows:

[0077] t su ={t1,t2,…,t n}

[0078] Dynamically sized windows It is expressed as follows:

[0079]

[0080] After the window is divided, the dialog D is expressed as follows:

[0081]

[0082] Step B42: According to the initial sequence D of the dialogue init Random Selection The NlpAug data enhancement tool is used to enhance the text data of the dialogue in the window. The words in each sentence in the window are randomly replaced with semantic inversion, and the fact-disturbed dialogue sequence D is obtained by splicing. fp ;

[0083]

[0084]

[0085]

[0086] Among them, aug(·) represents the antonym replacement operation;

[0087] Step B43: Conversation sequence D disrupting the facts obtained in step B42 fp Input to the encoder and decoder of the BART model to obtain the summary representation S of the dialogue fact disturbance fp ;

[0088] Summary representation of dialogue fact perturbation S fp The calculation is as follows:

[0089] S fp =BART enc-dec (D fp )

[0090] Among them, BART enc-dec Represents the encoder and decoder of the BART model.

[0091] Furthermore, the step B5 specifically includes the following steps:

[0092] Step B51: The initial conversation summary obtained in steps B2, B3 and B4 is represented by S init , summary representation enhanced by dialogue facts S fe and the summary representation S of the dialogue facts perturbation fp Constitute contrasting triads;

[0093] Comparison triple S cl It is expressed as follows:

[0094] S cl ={S init ,S fe ,S fp}

[0095] Step B52: Compare the triplet S obtained in step B51 cl Use contrastive learning to calculate the contrastive loss of fact consistency fc ;

[0096] Contrastive loss for fact consistency fc The calculation is as follows:

[0097]

[0098]

[0099] Among them, N represents the number of data in the training set DS, max(a,b) means returning the larger value of a and b, marigin is the boundary value constant, and cos_similarity(x1,x2) means calculating the cosine similarity between x1 and x2.

[0100] Furthermore, the step B6 specifically includes the following steps:

[0101] Step B61: The dialogue summary main task loss obtained in step B23 is main Compare the loss of the auxiliary task with the fact consistency obtained in step B52 fc The final loss function of the model is obtained by weighting;

[0102] The final loss function of the model is calculated as follows:

[0103] loss=loss main +αloss fc

[0104] Among them, α is a hyperparameter used to balance the impact of auxiliary tasks on the model;

[0105] Step B62: Calculate the gradient of each parameter in the deep learning network model by the back propagation method, and update each parameter by the stochastic gradient descent method.

[0106] The present invention also provides a conversation summary system based on fact consistency comparison, including a memory, a processor, and computer program instructions stored in the memory and capable of being executed by the processor. When the processor executes the computer program instructions, the above-mentioned method steps can be implemented.

[0107] Compared with the prior art, the present invention has the following beneficial effects: In order to effectively improve the factual consistency between the generated summary and the dialogue, the present invention designs a novel factual consistency comparison task. The task proposes a dialogue fact enhancement strategy and a dialogue fact disruption strategy to construct positive and negative dialogue examples respectively, and the model outputs the summary representation of the initial dialogue, the summary representation enhanced by the dialogue facts, and the summary representation disrupted by the dialogue facts respectively, forming a comparison triplet for contrastive learning. As an auxiliary task of the dialogue summary main task, the factual consistency task considers factual consistency issues such as the difference in person and entity co-reference between the input dialogue and the output summary. During the training process, the distance between the summary representation of the initial dialogue and the summary representation enhanced by the dialogue facts is minimized, and the distance between the summary representation of the initial dialogue and the summary representation disrupted by the dialogue facts is maximized, so as to improve the factual consistency of the summary generated by the model. The task encourages the model to retain the semantic information of the original dialogue when generating the summary by introducing contrastive learning, so as to improve the generalization ability of the model. Experimental results on two public benchmark datasets show that the model of the present invention has achieved significant performance improvement over other state-of-the-art baseline models. BRIEF DESCRIPTION OF THE DRAWINGS

[0108] Figure 1 is a flow chart of a method implementation of an embodiment of the present invention;

[0109] Figure 2 4 is an architecture diagram of a deep learning network model M based on fact consistency comparison in an embodiment of the present invention. DETAILED DESCRIPTION

[0110] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0111] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.

[0112] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0113] like Figure 1 As shown, this embodiment provides a conversation summarization method based on fact consistency comparison, including the following steps:

[0114] Step A: Extract user conversations and user conversation summaries, and annotate user conversation and user conversation summary labels. Each complete user conversation corresponds to a user conversation summary, and construct a training set DS.

[0115] Step B: Construct a deep learning network model M based on fact consistency comparison. The deep learning network model M constructs a novel fact consistency comparison task, which is an auxiliary task of the dialogue summary main task. A dialogue fact enhancement strategy and a dialogue fact disruption strategy are proposed to construct positive and negative examples for comparative learning. The summary representation of the initial dialogue (step B2), the summary representation of the dialogue fact enhancement (step B3) and the summary representation of the dialogue fact disruption (step B4) are respectively obtained through the BART model to form a comparison triplet for comparative learning; during the training process, the distance between the summary representation of the initial dialogue and the summary representation enhanced by the dialogue facts is minimized, and the distance between the summary representation of the initial dialogue and the summary representation disrupted by the dialogue facts is maximized (step B5), so as to improve the fact consistency of the summary generated by the model; the deep learning network model M is trained using the training set DS (steps B6 and B7), and the semantic relationship between the user dialogue and the user dialogue summary is learned through the deep learning network model M;

[0116] Step C: Input the user conversation into the trained deep learning network model M and output the summary of the user conversation.

[0117] The model structure of the deep learning network model M based on fact consistency comparison in this embodiment is as follows: Figure 2 In this embodiment, the specific implementation steps of step B are as follows.

[0118] Step B1: Perform initial processing on all training samples in the training data set DS to obtain the initial sequence D of the dialogue init .

[0119] In this embodiment, step B1 specifically includes the following steps:

[0120] Step B11: traverse the training set DS, perform word segmentation and stop word removal on the dialogue texts therein, and each training sample in DS is represented as ds=(D,D), where D is the text content of the dialogue and D is the summary text content corresponding to the dialogue.

[0121] Dialogue D is represented as:

[0122] D={t1,t2,…,t n}

[0123] Among them, t i is the i-th speaker-utterance pair in dialogue D, i = 1, 2, …, n, and n is the number of speaker-utterance pairs contained in dialogue D.

[0124] speaker-utterance dialogue i It is expressed as:

[0125] t i =(s i ,u i )

[0126]

[0127] Among them, s i is the i-th speaker, u i is the utterance of the i-th speaker, is the jth word in the i-th sentence, i = 1, 2, ..., n, j = 1, 2, ..., m, m is the utterance u i The length of the text.

[0128] Step B12: The dialogue D obtained in step B11 is converted into {t1, t2, ..., t n}, insert [CLS] tag in front and [SEP] tag between each sentence, construct the initial sequence D of the dialogue init ; Dialogue initial sequence D init It is expressed as:

[0129] D init =[CLS]+t1+[SEP]+t2+[SEP]+…+t n

[0130] Here, n represents the number of speaker-utterance pairs contained in the conversation.

[0131] Step B2: The initial sequence D of the dialogue obtained in step B1 init , through the encoder and decoder of the BART model, the initial dialogue summary representation S is obtained init , normalized by the softmax function, and the cross entropy is used as the loss function to calculate the loss value, and the loss of the main task of the dialogue summary is calculated. main .

[0132] In this embodiment, step B2 specifically includes the following steps:

[0133] Step B21: D init The tokenizer of the BART model performs padding and length truncation to obtain the token sequence N of the conversation as the input of the BART model encoder.

[0134] The conversation token sequence N is calculated as follows:

[0135] N=BARTtokenizer (D init )

[0136] Among them, BART tokenizer () represents the tokenizer of the BART model.

[0137] The encoder output is calculated as follows:

[0138]

[0139]

[0140] Among them, BART enc () represents the BART model encoder, is the i-th word in the u-th sentence The corresponding word vector, l is the text length of the nth sentence, and d is the dimension of the feature vector.

[0141] Step B22: The encoder output H obtained in step B21 init As the input of the BART model decoder, it is decoded through the self-attention mechanism, layer normalization, cross attention, and feedforward neural network to obtain the initial dialogue summary representation S init ;

[0142] H'=SelfAttention(LayNorm(H init ))

[0143] H"=CrossAttention(LayNorm(H'+H init ))

[0144] S init =FFN(LayNorm(H'+H'))

[0145] Among them, LayNorm(·) represents layer normalization, SelfAttention(·) represents self-attention mechanism, CrossAttention(·) represents cross attention, and FFN(·) represents feedforward neural network.

[0146] Step B23: The initial conversation summary obtained in step B22 is represented as S init , normalized by the softmax function, the score distribution P of the next word generated is obtained, and the loss value is calculated using cross entropy as the loss function to obtain the main task loss of the dialogue summary main .

[0147] The calculation formula of score distribution P is as follows:

[0148] P = softmax(WS init +b)

[0149] Among them, P∈[0,1], W is the trainable parameter matrix, and b is the bias vector.

[0150] Conversation summary main task loss main The calculation formula is as follows:

[0151]

[0152] Among them, P(y t |y <t ,D;θ) represents the corresponding word y taken from P t The probability value of | represents the conditional part of the conditional probability, that is, given y <t , dialogue text D and model parameters θ, generate the target word y t The probability of y <t =(y1,y2,…,y t-1 ) represents the first t-1 words of the output sequence, S y Represents a target summary.

[0153] Step B3: The initial sequence D of the conversation obtained in step B1 init Segmentation to divide the speaker-discourse pairs su , define a dynamic size window based on the number of speaker-utterance pairs The window contains a sequence of k consecutive speaker-utterance pairs in the conversation. The coreference relationship of the sequence in the window is parsed, and the entity coreference list L obtained by parsing is coref Perform dialogue fact enhancement to obtain the dialogue sequence D with fact enhancement fe , the summary representation S enhanced by the dialogue facts is obtained through the BART model fe .

[0154] In this embodiment, step B3 specifically includes the following steps:

[0155] Step B31: The initial sequence D of the dialogue obtained in step B12 is init Segmentation is performed based on the [SEP] tag to divide the speaker-utterance pairs su , a dynamic window size is defined according to the number of speaker-utterance pairs n The window size is k, k = 1, 2, ..., n, the window contains a sequence of k consecutive speaker-utterance pairs in the conversation, and the speaker-utterance pairs outside the window are denoted as t other .

[0156] speaker-utterance dialogue su It is expressed as follows:

[0157] t su ={t1,t2,…,t n}

[0158] Dynamically sized windows It is expressed as follows:

[0159]

[0160] After the window is divided, the dialog D is expressed as follows:

[0161]

[0162] in, for A randomly selected window in , i = 1, 2, ..., k, and concat(·) represents a concatenation operation.

[0163] Step B32: For each D init Calculation Window Random Selection Use FastCoref coreference resolution tool to resolve coreference relationship of the dialog in the window and obtain entity coreference list L coref , if the length of the coreference group in the coreference list is 2, the entity replacement coreference pronoun operation is directly performed; if the length of the coreference group in the coreference list is greater than 2, a non-first element is randomly selected to perform the entity replacement coreference pronoun operation, and the fact-enhanced dialogue sequence D is obtained by concatenating fe .

[0164] Coreference list of dialog windows The calculation is as follows:

[0165]

[0166]

[0167] Among them, FCoref(·) represents the coreference resolution operation, e i and p i For Window The entity and pronoun information contained in the speaker-utterance pair.

[0168] Fact-enhanced dialogue sequence D fe The calculation is as follows:

[0169]

[0170]

[0171] in, is a coreference list For the j-th coreference group in , func1(·) represents a direct replacement operation, and func2(·) represents a random non-first element replacement operation.

[0172] Step B33: Enhance the dialogue sequence D obtained by step B32 with the facts fe Input to the encoder and decoder of the BART model to obtain the summary representation S enhanced by the dialogue facts fe .

[0173] Dialogue Fact Enhanced Summary Representation S fe The calculation is as follows:

[0174] S fe =BART enc-dec (D fe )

[0175] Among them, BART enc-dec Represents the encoder and decoder of the BART model.

[0176] Step B4: Use the dynamically sized window obtained in step B3 The NlpAug data enhancement tool is used to enhance the text data of the dialogue in the window. The words in each sentence in the window are randomly replaced with semantic inversion, and the fact-disturbed dialogue sequence D is obtained by splicing. fp , the summary representation S of the dialogue fact disturbance is obtained through the BART model fp .

[0177] In this embodiment, step B4 specifically includes the following steps:

[0178] Step B41: Use the dynamically sized window obtained in step B31 The window contains a sequence of k consecutive speaker-utterance pairs in the conversation, and the speaker-utterance pairs outside the window are denoted as t other .

[0179] speaker-utterance dialogue su It is expressed as follows:

[0180] t su ={t1,t2,…,t n}

[0181] Dynamically sized windows It is expressed as follows:

[0182]

[0183] After the window is divided, the dialog D is expressed as follows:

[0184]

[0185] Step B42: According to the initial sequence D of the dialogue init Random Selection The NlpAug data enhancement tool is used to enhance the text data of the dialogue in the window. The words in each sentence in the window are randomly replaced with semantic inversion, and the fact-disturbed dialogue sequence D is obtained by splicing. fp ;

[0186]

[0187]

[0188]

[0189] Where aug(·) represents an antonym replacement operation.

[0190] Step B43: Conversation sequence D disrupting the facts obtained in step B42 fp Input to the encoder and decoder of the BART model to obtain the summary representation S of the dialogue fact disturbance fp .

[0191] Summary representation of the perturbed dialogue facts S fp The calculation is as follows:

[0192] S fp =BART enc-dec (D fp )

[0193] Among them, BART enc-dec Represents the encoder and decoder of the BART model.

[0194] Step B5: The initial conversation summary obtained in steps B2, B3 and B4 is represented by S init , summary representation enhanced by dialogue facts S fe and the summary representation S of the dialogue facts perturbation fp Construct contrast triplets and use contrastive learning to calculate the loss of the fact consistency contrast auxiliary task fc .

[0195] In this embodiment, step B5 specifically includes the following steps:

[0196] Step B51: The initial conversation summary obtained in steps B2, B3 and B4 is represented by S init , summary representation enhanced by dialogue facts S fe and the summary representation S of the dialogue facts perturbation fp Constitute contrasting triads.

[0197] Comparison triple S cl It is expressed as follows:

[0198] S cl ={S init ,S fe ,S fp}

[0199] Step B52: Compare the triplet S obtained in step B51 cl Use contrastive learning to calculate the contrastive loss of fact consistency fc .

[0200] Contrastive loss for fact consistency fc The calculation is as follows:

[0201]

[0202]

[0203] Among them, N represents the number of data in the training set DS, max(a,b) means returning the larger value of a and b, marigin is the boundary value constant, and cos_similarity(x1,x2) means calculating the cosine similarity between x1 and x2.

[0204] Step B6: Substitute the conversation summary main task loss obtained in step B2 main Compare the loss of the auxiliary task with the fact consistency obtained in step B5 fc The final loss of the model is obtained by weighting, the gradient of each parameter in the deep learning network model is calculated by the back propagation method, and the parameters are updated using the stochastic gradient descent method.

[0205] In this embodiment, step B6 specifically includes the following steps:

[0206] Step B61: Substitute the conversation summary obtained in step B23 for the main task loss Loss main Compare the loss of the auxiliary task with the fact consistency obtained in step B52 fc The final loss function of the model is obtained by weighting.

[0207] The final loss function of the model is calculated as follows:

[0208] loss=loss main +αloss fc

[0209] Among them, α is a hyperparameter used to balance the impact of auxiliary tasks on the model.

[0210] Step B62: Calculate the gradient of each parameter in the deep learning network model by the back propagation method, and update each parameter by the stochastic gradient descent method.

[0211] Step B7: When the loss value change generated by each iteration of the deep learning network model is less than a given threshold, or the maximum number of iterations is reached, the training process of the deep learning network model is terminated.

[0212] This embodiment also provides a conversation summary system based on fact consistency comparison, including a memory, a processor, and computer program instructions stored in the memory and capable of being executed by the processor. When the processor executes the computer program instructions, the above-mentioned method steps can be implemented.

[0213] The model of this method is compared with other dialogue summarization baseline models, and the evaluation experimental results are shown in Table 1. On the SAMSum benchmark dataset, the ROUGE-1, ROUGE-2, and ROUGE-L indicators of the model of this method are improved by 0.11%, 0.72%, and 0.19% respectively compared with the SDDS model. On the DialogSum benchmark dataset, the ROUGE-1, ROUGE-2, and ROUGE-L indicators of the model of this method are improved by 0.43%, 0.7%, and 0.17% respectively compared with the SDDS model. On these two benchmark datasets, the performance of the model of this method is significantly better than other baseline models including the most advanced model SDDS.

[0214] Table 1 Evaluation results on SAMsum and DialogSum datasets

[0215]

[0216] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0217] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0218] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0219] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0220] The above is only a preferred embodiment of the present invention, and does not limit the present invention in other forms. Any technician familiar with the profession may use the above disclosed technical content to change or modify it into an equivalent embodiment with equivalent changes. However, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the technical solution of the present invention still belongs to the protection scope of the technical solution of the present invention.

Claims

1. A conversation summarization method based on fact consistency comparison, characterized in that: The following steps are involved: Step A: Extract user conversations and user conversation summaries, and annotate user conversation and user conversation summary labels. Each complete user conversation corresponds to a user conversation summary, and construct a training set DS. Step B: construct a deep learning network model M based on fact consistency comparison, wherein the deep learning network model M constructs a fact consistency comparison task as an auxiliary task of the dialogue summary main task, and obtains a summary representation of the initial dialogue, a summary representation enhanced by dialogue facts, and a summary representation disturbed by dialogue facts to form a comparison triplet for comparative learning; during the training process, the distance between the summary representation of the initial dialogue and the summary representation enhanced by dialogue facts is minimized, and the distance between the summary representation of the initial dialogue and the summary representation disturbed by dialogue facts is maximized, so as to improve the fact consistency of the summary generated by the model; the deep learning network model M is trained using the training set DS, and the semantic relationship between the user dialogue and the user dialogue summary is learned through the deep learning network model M; Step C: Input the user conversation into the trained deep learning network model M and output the summary of the user conversation.

2. The method for dialogue summarization based on fact consistency comparison according to claim 1, characterized in that: The step B specifically comprises the following steps: Step B1: Perform initial processing on all training samples in the training data set DS to obtain the initial sequence D of the dialogue init ; Step B2: The initial sequence D of the dialogue obtained in step B1 init , through the encoder and decoder of the BART model, the initial dialogue summary representation S is obtained init , normalized by the softmax function, and using cross entropy as the loss function to calculate the loss value, the loss of the main task of the dialogue summary is calculated main ; Step B3: The initial sequence D of the conversation obtained in step B1 init Segmentation to divide the speaker-discourse pairs su , define a dynamic size window based on the number of speaker-utterance pairs The window contains a sequence of k consecutive speaker-utterance pairs in the conversation. The coreference relationship of the sequence in the window is parsed, and the entity coreference list L obtained by parsing is coref Perform dialogue fact enhancement to obtain the dialogue sequence D with fact enhancement fe , the summary representation S enhanced by the dialogue facts is obtained through the BART model fe ; Step B4: Use the dynamically sized window obtained in step B3 The NlpAug data enhancement tool is used to enhance the text data of the dialogue in the window. The words in each sentence in the window are randomly replaced with semantic inversion, and the fact-disturbed dialogue sequence D is obtained by splicing. fp , the summary representation S of the dialogue fact disturbance is obtained through the BART model fp ; Step B5: The initial conversation summary obtained in steps B2, B3 and B4 is represented by S init , summary representation enhanced by dialogue facts S fe and the summary representation S of the dialogue facts perturbation fp Construct contrast triplets and use contrastive learning to calculate the loss of the fact consistency contrast auxiliary task fc ; Step B6: Substitute the conversation summary main task loss obtained in step B2 main Compare the loss of the auxiliary task with the fact consistency obtained in step B5 fc The final loss of the model is obtained by weighting, the gradient of each parameter in the deep learning network model is calculated by the back propagation method, and the parameters are updated using the stochastic gradient descent method; Step B7: When the loss value change generated by each iteration of the deep learning network model is less than a given threshold, or the maximum number of iterations is reached, the training process of the deep learning network model is terminated.

3. The method for dialogue summarization based on fact consistency comparison according to claim 2, characterized in that: The step B1 specifically comprises the following steps: Step B11: traverse the training set DS, perform word segmentation and stop word removal on the dialogue texts therein, and each training sample in DS is represented as ds = (D, S), where D is the text content of the dialogue and S is the summary text content corresponding to the dialogue; Dialogue D is represented as: D={t1,t2,…,t n } Among them, t i is the i-th speaker-utterance pair in dialogue D, i = 1, 2, ..., n, and n is the number of speaker-utterance pairs contained in dialogue D; speaker-utterance dialogue i It is expressed as: t i =(s i ,u i ) Among them, s i is the i-th speaker, u i is the utterance of the i-th speaker, is the jth word in the i-th sentence, i = 1, 2, ..., n, j = 1, 2, ..., m, m is the utterance u i Length of text; Step B12: The dialogue D obtained in step B11 is converted into {t1, t2, ..., t n }, insert [CLS] tag in front and [SEP] tag between each sentence, construct the initial sequence D of the dialogue init ; Dialogue initial sequence D init It is expressed as: D init =[CLS]+t1+[SEP]+t2+[SEP]+…+t n Here, n represents the number of speaker-utterance pairs contained in the conversation.

4. The method for dialogue summarization based on fact consistency comparison according to claim 3 is characterized in that: The step B2 specifically comprises the following steps: Step B21: D init The tokenizer of the BART model performs padding and length truncation to obtain the conversation token sequence N as the BART model encoder input; The conversation token sequence N is calculated as follows: N=BART tokenizer (D init ) Among them, BART tokenizer () represents the tokenizer of the BART model; The encoder output is calculated as follows: Among them, BART enc () represents the BART model encoder, is the i-th word in the u-th sentence The corresponding word vector, l is the text length of the nth sentence, and d is the dimension of the feature vector; Step B22: The encoder output H obtained in step B21 is init As the input of the BART model decoder, it is decoded through the self-attention mechanism, layer normalization, cross attention, and feedforward neural network to obtain the initial dialogue summary representation S init ; H'=SelfAttention(LayNorm(H init )) H”=CrossAttention(LayNorm(H'+H init )) S init =FFN(LayNorm(H'+H”)) Among them, LayNorm(·) represents layer normalization, SelfAttention(·) represents self-attention mechanism, CrossAttention(·) represents cross attention, and FFN(·) represents feedforward neural network; Step B23: The initial conversation summary obtained in step B22 is represented as S init , normalized by the softmax function, obtain the score distribution P of the next word generated, use cross entropy as the loss function to calculate the loss value, and calculate the loss of the main task of the dialogue summary main ; The calculation formula of score distribution P is as follows: P=softmax(WS init +b) Among them, P∈[0,1], W is the trainable parameter matrix, and b is the bias vector; Conversation summary main task loss main The calculation formula is as follows: Among them, P(y t |y <t ,D;θ) represents the corresponding word y taken from P t The probability value of | represents the conditional part of the conditional probability, that is, given y <t , dialogue text D and model parameters θ, generate the target word y t The probability of y <t =(y1,y2,…,y t-1 ) represents the first t-1 words of the output sequence, S y Represents a target summary.

5. The method for dialogue summarization based on fact consistency comparison according to claim 4, characterized in that: The step B3 specifically comprises the following steps: Step B31: The initial sequence D of the dialogue obtained in step B12 is init Segmentation is performed based on the [SEP] tag to divide the speaker-utterance pairs su , a dynamic window size is defined according to the number of speaker-utterance pairs n The window size is k, k = 1, 2, ..., n, the window contains a sequence of k consecutive speaker-utterance pairs in the conversation, and the speaker-utterance pairs outside the window are denoted as t other ; speaker-utterance dialogue su It is expressed as follows: t su ={t1,t2,…,t n } Dynamically sized windows It is expressed as follows: After the window is divided, the dialog D is expressed as follows: in, for A randomly selected window in , i = 1, 2, …, k, concat(·) represents the concatenation operation; Step B32: For each D init Calculation Window Random Selection Use FastCoref coreference resolution tool to resolve coreference relationship of the dialog in the window and obtain entity coreference list L coref , if the length of the coreference group in the coreference list is 2, the entity replacement coreference pronoun operation is directly performed; if the length of the coreference group in the coreference list is greater than 2, a non-first element is randomly selected to perform the entity replacement coreference pronoun operation, and the fact-enhanced dialogue sequence D is obtained by concatenating fe ; Coreference list of dialog windows The calculation is as follows: Among them, FCoref(·) represents the coreference resolution operation, e i and p i For Window The entity and pronoun information contained in the speaker-utterance pair; Fact-enhanced dialogue sequence D fe The calculation is as follows: in, is a coreference list In the j-th coreference group, func1(·) represents a direct replacement operation, and func2(·) represents a random non-first element replacement operation; Step B33: Enhance the dialogue sequence D obtained by step B32 with the facts fe Input to the encoder and decoder of the BART model to obtain the summary representation S enhanced by the dialogue facts fe ; Dialogue Fact Enhanced Summary Representation S fe The calculation is as follows: S fe =BART enc-dec (D fe ) Among them, BART enc-dec Represents the encoder and decoder of the BART model.

6. The method for dialogue summarization based on fact consistency comparison according to claim 5, characterized in that: The step B4 specifically comprises the following steps: Step B41: Use the dynamically sized window obtained in step B31 The window contains a sequence of k consecutive speaker-utterance pairs in the conversation, and the speaker-utterance pairs outside the window are denoted as t other ; speaker-utterance dialogue su It is expressed as follows: t su ={t1,t2,…,t n } Dynamically sized windows It is expressed as follows: After the window is divided, the dialog D is expressed as follows: Step B42: According to the initial sequence D of the dialogue init Random Selection The NlpAug data enhancement tool is used to enhance the text data of the dialogue in the window. The words in each sentence in the window are randomly replaced with semantic inversion, and the fact-disturbed dialogue sequence D is obtained by splicing. fp ; Among them, aug(·) represents the antonym replacement operation; Step B43: Conversation sequence D disrupting the facts obtained in step B42 fp Input to the encoder and decoder of the BART model to obtain the summary representation S of the dialogue fact disturbance fp ; Summary representation of the perturbed dialogue facts S fp The calculation is as follows: S fp =BART enc-dec (D fp ) Among them, BART enc-dec Represents the encoder and decoder of the BART model.

7. The method for dialogue summarization based on fact consistency comparison according to claim 6, characterized in that: The step B5 specifically comprises the following steps: Step B51: The initial conversation summary obtained in steps B2, B3 and B4 is represented by S init , summary representation enhanced by dialogue facts S fe and the summary representation S of the dialogue facts perturbation fp Constitute contrasting triads; Comparison triple S cl It is expressed as follows: S cl ={S init ,S fe ,S fp } Step B52: Compare the triplet S obtained in step B51 cl Use contrastive learning to calculate the contrastive loss of fact consistency fc ; Contrastive loss for fact consistency fc The calculation is as follows: Among them, N represents the number of data in the training set DS, max(a,b) means returning the larger value of a and b, marigin is the boundary value constant, and cos_similarity(x1,x2) means calculating the cosine similarity between x1 and x2.

8. The method for dialogue summarization based on fact consistency comparison according to claim 7, characterized in that: The step B6 specifically comprises the following steps: Step B61: The dialogue summary main task loss obtained in step B23 is main Compare the loss of the auxiliary task with the fact consistency obtained in step B52 fc The final loss function of the model is obtained by weighting; The final loss function of the model is calculated as follows: loss=loss main +αloss fc Among them, α is a hyperparameter used to balance the impact of auxiliary tasks on the model; Step B62: Calculate the gradient of each parameter in the deep learning network model by the back propagation method, and update each parameter by the stochastic gradient descent method.

9. A dialogue summarization system based on fact consistency comparison, characterized in that: The method comprises a memory, a processor, and computer program instructions stored in the memory and executable by the processor. When the processor executes the computer program instructions, the method steps as described in any one of claims 1 to 8 can be implemented.

Citation Information

Patent Citations

  • Online public opinion emergency automatic identification method based on emotion information extraction and analysis

    CN111950273A

  • Few-sample abstract dialogue abstract generation system based on prompt learning

    CN114942990A

  • Contrast learning-based dialogue abstract method for specific role

    CN118277548A

  • Database systems and methods of representing conversations

    US20230086668A1