Conversation data generation method and device, electronic equipment and storage medium
By segmenting and summarizing text in the financial field, and utilizing dialogue generation models and data augmentation techniques, the problem of insufficient data in the training of chatbot models was solved, achieving automated generation and quality improvement of dialogue data.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- PING AN TECH (SHENZHEN) CO LTD
- Filing Date
- 2024-08-06
- Publication Date
- 2026-07-21
AI Technical Summary
In existing technologies, the training of chatbot models in the financial business field relies on a limited amount of high-quality labeled data, resulting in low generation efficiency.
By acquiring target text containing financial knowledge, text segmentation and summarization are performed. Questions are generated using a dialogue generation model, and preliminary dialogue data is constructed using data augmentation techniques to expand the volume of dialogue data.
It enables efficient and rapid expansion of dialogue data, reduces construction and development costs, and improves dialogue quality and model training effectiveness.
Smart Images

Figure CN119066168B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of financial technology, and in particular to a method and apparatus for generating dialogue data, an electronic device, and a storage medium. Background Technology
[0002] Currently, chatbots are often introduced in various financial business areas to achieve human-computer interaction. The interactive operation of chatbots often relies on trained interactive dialogue models.
[0003] To improve dialogue quality, a large amount of high-quality labeled data is often needed to train the aforementioned interactive dialogue models. However, the availability of high-quality labeled data in reality is relatively limited, which affects the training effect of the model. To address this, related technologies often employ manually constructed labeled data. While this method can alleviate the shortage of dialogue data for training models to some extent, it still suffers from low efficiency in generating dialogue data. Summary of the Invention
[0004] The main objective of this application is to propose a dialogue data generation method, apparatus, electronic device, and storage medium, which aims to efficiently and quickly expand the amount of dialogue data used to train interactive dialogue models.
[0005] To achieve the above objectives, a first aspect of this application proposes a dialogue data generation method, the method comprising:
[0006] Obtain target texts containing knowledge of the financial field;
[0007] The target text is segmented to obtain multiple text paragraphs;
[0008] For each of the text segments, a summary is generated to obtain the target summary of the text segment, and the target summary is determined as the dialogue response;
[0009] The dialogue response is generated using a preset dialogue generation model to obtain the target question corresponding to the dialogue response;
[0010] Based on the dialogue responses and the target question, preliminary dialogue data is constructed;
[0011] The initial dialogue data is augmented to obtain target dialogue data, which is used as sample data to train a preset interactive dialogue model.
[0012] In some embodiments, the text segmentation of the target text to obtain multiple text segments includes:
[0013] The target text is segmented into sentences to obtain multiple target text sentences;
[0014] The target text sentence is encoded based on a preset text encoder to obtain the sentence encoding features of the target text sentence;
[0015] The sentence encoding features are pooled to obtain the sentence representation vector of the target text sentence;
[0016] Based on the sentence representation vector, the target text sentence is predicted to obtain a sentence prediction result, wherein the sentence prediction result is used to indicate whether the target text sentence is a topic initiation sentence or not.
[0017] Based on the sentence position of the target text sentence in the target text and the sentence prediction result, the multiple target text sentences are aggregated to obtain the multiple text paragraphs.
[0018] In some embodiments, the step of generating a summary for each text segment to obtain a target summary of the text segment includes:
[0019] The text paragraph is subjected to self-attention calculation by a preset summary generation model to obtain the first attention calculation result. The summary generation model includes a cross-attention layer, a feedforward neural network, and a linear layer.
[0020] Based on the cross-attention layer, the first attention calculation result is used to perform attention calculation to obtain the second attention calculation result;
[0021] Based on the feedforward neural network, the second attention calculation result is processed by feedforward to obtain the text attention latent features;
[0022] Based on the linear layer, feature mapping is performed on the text attention latent features to obtain text mapping features;
[0023] The text mapping features are decoded to obtain the target summary.
[0024] In some embodiments, generating a question from the dialogue response using a preset dialogue generation model to obtain the target question corresponding to the dialogue response includes:
[0025] Based on the dialogue generation model, questions are generated for the dialogue response to obtain preliminary questions corresponding to the dialogue response.
[0026] The initial problem is repaired to obtain the target problem.
[0027] In some embodiments, the step of data augmentation of the preliminary dialogue data to obtain target dialogue data includes:
[0028] The initial dialogue data is subjected to noise processing to obtain noisy dialogue data;
[0029] The preliminary dialogue data is paraphrased to obtain paraphrased dialogue data;
[0030] The noisy dialogue data and the paraphrased dialogue data are integrated to obtain the target dialogue data.
[0031] In some embodiments, the step of data augmentation of the preliminary dialogue data to obtain target dialogue data includes:
[0032] Target words are identified in the preliminary dialogue data, and synonym replacements are performed on the target words in the preliminary dialogue data to obtain replaced dialogue data.
[0033] The word order of the dialogue sentences in the preliminary dialogue data is adjusted to obtain the adjusted dialogue data.
[0034] The replacement dialogue data and the adjusted dialogue data are integrated to obtain the target dialogue data.
[0035] In some embodiments, the step of data augmentation of the preliminary dialogue data to obtain target dialogue data includes:
[0036] Multiple dialogue fragments in the preliminary dialogue data are synthesized to obtain synthesized dialogue data.
[0037] Multiple dialogue segments in the preliminary dialogue data are reassembled to obtain reassembled dialogue data.
[0038] The synthesized dialogue data and the reconstructed dialogue data are integrated to obtain the target dialogue data.
[0039] To achieve the above objectives, a second aspect of this application provides a dialogue data generation apparatus, the apparatus comprising:
[0040] The acquisition unit is used to acquire target text containing knowledge in the financial field.
[0041] A segmentation unit is used to segment the target text into multiple text paragraphs.
[0042] The summary generation unit is used to generate a summary for each of the text segments, obtain a target summary for the text segment, and determine the target summary as a dialogue response;
[0043] The question generation unit is used to generate questions from the dialogue response using a preset dialogue generation model, thereby obtaining the target question corresponding to the dialogue response.
[0044] A construction unit is used to construct preliminary dialogue data based on the dialogue responses and the target question;
[0045] A data augmentation unit is used to augment the preliminary dialogue data to obtain target dialogue data, wherein the dialogue data is used as sample data to train a preset interactive dialogue model.
[0046] To achieve the above objectives, a third aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the dialogue data generation method described in the first aspect.
[0047] To achieve the above objectives, a fourth aspect of the present application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the dialogue data generation method described in the first aspect.
[0048] The dialogue data generation method, apparatus, electronic device, and storage medium proposed in this application acquire target text containing financial domain knowledge and perform text segmentation on the target text to obtain multiple text segments. This enables fine-grained dialogue data generation based on text segments and achieves full utilization of the target text. Furthermore, for each text segment, a summary is generated to obtain a target summary of the text segment, which is then used as the dialogue response. This allows for a concise description of the segment information of each text segment, making the dialogue response more refined. Next, a question is generated from the dialogue response using a preset dialogue generation model to obtain the target question corresponding to the dialogue response. In dialogue data generation, a strategy based on answer-based question generation is used, achieving the effect of constructing dialogue data using question-answer pairs. Finally, based on the dialogue responses and target questions, preliminary dialogue data is constructed, and data augmentation is performed on the preliminary dialogue data to obtain target dialogue data. This dialogue data is then used as sample data to train the pre-defined interactive dialogue model. After generating preliminary dialogue data in the form of question-answer pairs based on the target text, data augmentation can be used to effectively expand the amount of target dialogue data. This method achieves automated generation of dialogue data for a fixed domain (financial domain), reduces the construction and development costs of dialogue data, and facilitates the efficient and rapid expansion of the amount of dialogue data used to train the interactive dialogue model, thereby improving the dialogue quality of the interactive dialogue model. Attached Figure Description
[0049] Figure 1 This is a flowchart of the dialogue data generation method provided in the embodiments of this application;
[0050] Figure 2 yes Figure 1 The flowchart of step S102 in the document;
[0051] Figure 3 yes Figure 1 The flowchart of step S103 in the process;
[0052] Figure 4 yes Figure 1 The flowchart of step S104 in the process;
[0053] Figure 5 yes Figure 1 The flowchart of step S106 in the process;
[0054] Figure 6 yes Figure 1 Another flowchart of step S106 in the process;
[0055] Figure 7 yes Figure 1 Another flowchart of step S106 in the process;
[0056] Figure 8 This is a schematic diagram of the structure of the dialogue data generation device provided in the embodiments of this application;
[0057] Figure 9 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0058] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0059] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0061] Currently, chatbots are often introduced in various financial business areas to achieve human-computer interaction. The interactive operation of chatbots often relies on trained interactive dialogue models.
[0062] To improve dialogue quality, a large amount of high-quality labeled data is often needed to train the aforementioned interactive dialogue models. However, the availability of high-quality labeled data in reality is relatively limited, which affects the training effect of the model. To address this, related technologies often employ manually constructed labeled data. While this method can alleviate the shortage of dialogue data for training models to some extent, it still suffers from low efficiency in generating dialogue data.
[0063] Based on this, embodiments of this application provide a dialogue data generation method, a dialogue data generation device, an electronic device, and a storage medium, aiming to efficiently and quickly expand the amount of dialogue data used to train interactive dialogue models.
[0064] The dialogue data generation method, apparatus, electronic device, and storage medium provided in this application are specifically described through the following embodiments. First, the dialogue data generation method in this application is described.
[0065] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0066] The dialogue data generation method provided in this application relates to the field of financial technology. This method can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application implementing the dialogue data generation method, but is not limited to the above forms.
[0067] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0068] It should be noted that in various specific embodiments of this application, when processing data related to the identity or characteristics of an object, such as object information, object behavior data, object historical data, and object location information, the object's permission or consent will be obtained first. Furthermore, the collection, use, and processing of this data will comply with relevant laws, regulations, and standards. In addition, when embodiments of this application require obtaining the object's personal information, separate permission or consent from the object will be obtained through pop-ups or redirection to a confirmation page. Only after obtaining the object's separate permission or consent will the necessary object-related data for the proper functioning of the embodiments of this application be obtained.
[0069] Figure 1 This is an optional flowchart of the dialogue data generation method provided in the embodiments of this application. Figure 1 The method may include, but is not limited to, steps S101 to S106.
[0070] Step S101: Obtain target text containing financial knowledge;
[0071] Step S102: Perform text segmentation on the target text to obtain multiple text segments;
[0072] Step S103: For each text segment, generate a summary of the text segment to obtain the target summary of the text segment, and determine the target summary as the dialogue response;
[0073] Step S104: Generate questions for the dialogue response using a preset dialogue generation model to obtain the target question corresponding to the dialogue response;
[0074] Step S105: Construct preliminary dialogue data based on dialogue responses and target questions;
[0075] Step S106: Perform data augmentation on the preliminary dialogue data to obtain the target dialogue data.
[0076] The dialogue data is used as sample data to train a pre-defined interactive dialogue model.
[0077] Steps S101 to S106, as illustrated in this embodiment, involve acquiring target text with financial domain knowledge and performing text segmentation to obtain multiple text segments. This enables fine-grained dialogue data generation based on text segments and achieves full utilization of the target text. Further, for each text segment, a summary is generated to obtain a target summary of the text segment, which is then used as the dialogue response. This allows for a concise description of the segment information of each text segment, making the dialogue response more refined. Next, a preset dialogue generation model is used to generate questions for the dialogue response, resulting in the target question corresponding to the dialogue response. In dialogue data generation, a strategy based on answer-based question generation is employed, achieving the effect of constructing dialogue data using question-answer pairs. Finally, based on the dialogue responses and target questions, preliminary dialogue data is constructed, and data augmentation is performed on the preliminary dialogue data to obtain target dialogue data. This dialogue data is then used as sample data to train the pre-defined interactive dialogue model. After generating preliminary dialogue data in the form of question-answer pairs based on the target text, data augmentation can be used to effectively expand the amount of target dialogue data. This method achieves automated generation of dialogue data for a fixed domain (financial domain), reduces the construction and development costs of dialogue data, and facilitates the efficient and rapid expansion of the amount of dialogue data used to train the interactive dialogue model, thereby improving the dialogue quality of the interactive dialogue model.
[0078] In step S101 of some embodiments, target text with knowledge of the financial field is obtained.
[0079] Financial knowledge refers to professional knowledge in the financial field, such as explanations of technical terms in finance, basic types of financial transactions, and so on.
[0080] The target text refers to natural language text containing knowledge in the financial field.
[0081] In a specific implementation of this embodiment, with authorization, encyclopedia articles and web pages containing financial knowledge are obtained from various publicly available websites on the Internet, and the target text is extracted from the obtained encyclopedia articles and web pages.
[0082] Please see Figure 2 In some embodiments, step S102 may include, but is not limited to, steps S201 to S205:
[0083] Step S201: Segment the target text to obtain multiple target text sentences;
[0084] Step S202: Encode the target text sentence based on a preset text encoder to obtain the sentence encoding features of the target text sentence;
[0085] Step S203: Pool the sentence encoding features to obtain the sentence representation vector of the target text sentence;
[0086] Step S204: Based on the sentence representation vector, perform prediction processing on the target text sentence to obtain the sentence prediction result;
[0087] Step S205: Based on the sentence position of the target text sentence in the target text and the sentence prediction result, multiple target text sentences are aggregated to obtain multiple text paragraphs.
[0088] Steps S201 to S205 are described in detail below.
[0089] In step S201 of some embodiments, firstly, a preset regular expression is obtained, wherein the regular expression is used to indicate the specific pattern for segmenting the text. Next, the target text is segmented into sentences using the preset regular expression. Sentence boundaries are identified based on the punctuation marks (such as periods, question marks, exclamation marks, etc.) at the end of each sentence in the target text and the subsequent spaces or paragraph marks, thereby dividing the target text into multiple target text sentences and realizing the transformation of text-level dialogue data generation into sentence-level dialogue data generation.
[0090] In step S202 of some embodiments, for each target text sentence, the target text sentence is input to a preset text encoder, which encodes the target text sentence, transforming it from a data space to a vector space, thereby obtaining the sentence encoding features of the target text sentence. These sentence encoding features indicate the semantic content representation of the target text sentence in the vector space. The sentence encoding features of a target text sentence include the word encoding features of each word in the target text sentence. Text encoders include, but are not limited to, BERT encoders.
[0091] In step S203 of some embodiments, firstly, the Word2Vec model is invoked, and the Word2Vec model is used to perform pooling processing on each word encoding feature in the sentence encoding features to obtain the word pooling features corresponding to each word encoding feature. Next, all word pooling features are concatenated to obtain the sentence representation vector of the target text sentence. Here, the sentence representation vector is a fixed-length feature vector that can represent the sentence information of the target text sentence.
[0092] In step S204 of some embodiments, the sentence prediction result is used to indicate whether the target text sentence is a topic-starting sentence or not.
[0093] Specifically, first, a binary classification function is invoked, which includes, but is not limited to, the Sigmoid function. Next, for each target text sentence, the sentence is input into the binary classification function, which outputs a first probability value indicating that the target text sentence is a topic initiation sentence, and a second probability value indicating that the target text sentence is not a topic initiation sentence. Further, if the first probability value is greater than the second probability value, the sentence prediction result is determined to be a topic initiation sentence; if the first probability value is less than the second probability value, the sentence prediction result is determined to be that the target text sentence is not a topic initiation sentence.
[0094] The Sigmoid function is a mathematical function widely used in machine learning and deep learning, especially in binary classification problems. It maps any real number to a value in the interval (0,1).
[0095] In step S205 of some embodiments, when aggregating multiple target text sentences based on their sentence positions in the target text and sentence prediction results, the target text sentences are first sorted according to their sentence positions in the target text. Then, based on the sentence prediction results of each sorted target text sentence, for two consecutive text sentences in the sorting where the predicted sentence is the topic initiation sentence, the sequence segment consisting of the text sentence predicting the previous sentence as the topic initiation sentence and the text sentence preceding the next sentence predicting the next sentence as the topic initiation sentence is a set, and the multiple text sentences in the set are concatenated into a single text paragraph.
[0096] For example, if the order of multiple target text sentences is [sentence 1, sentence 2, sentence 3, sentence 4, sentence 5, sentence 6], and the sentence prediction result for sentences 1 and 4 is that these sentences are topic initiation sentences, then sentences 1, 2, and 3 are grouped into a sequence segment [sentence 1, sentence 2, sentence 3] as a set, and sentences 1, 2, and 3 are concatenated into a single text paragraph. Similarly, sentences 4, 5, and 6 are grouped into a sequence segment [sentence 4, sentence 5, and sentence 6] as a set, and sentences 4, 5, and 6 are concatenated into a single text paragraph.
[0097] The advantage of this embodiment is that it splits the target text into multiple target text sentences, encodes and pools each target text sentence to obtain its sentence representation, and performs binary classification labeling on the target text sentences based on their sentence representations to determine which target text sentences are topic initiation sentences. Then, based on the position of each target text sentence in the target text and according to the adjacency relationship of each topic initiation sentence, all target text sentences from one topic initiation sentence to the next topic initiation sentence are concatenated into a text paragraph describing the same topic. This can achieve accurate topic segmentation of the target text, and when generating dialogue data, it can effectively expand the number of generated dialogue data based on text paragraphs.
[0098] Please see Figure 3 In some embodiments, step S103 may include, but is not limited to, steps S301 to S305:
[0099] Step S301: Perform self-attention calculation on the text paragraph using a preset summary generation model to obtain the first attention calculation result;
[0100] Step S302: Perform attention calculation on the first attention calculation result based on the cross-attention layer to obtain the second attention calculation result;
[0101] Step S303: Perform feedforward processing on the second attention calculation result based on the feedforward neural network to obtain the text attention latent features;
[0102] Step S304: Based on the linear layer, perform feature mapping on the text attention latent features to obtain the text mapping features;
[0103] Step S305: Decode the text mapping features to obtain the target summary.
[0104] Steps S301 to S305 are described in detail below.
[0105] In step S301 of some embodiments, the summary generation model includes a self-attention layer, a cross-attention layer, a feedforward neural network, and a linear layer.
[0106] In this specific implementation, a text paragraph is input as text data into the summarization model, and the self-attention layer of the summarization model performs self-attention calculation on the text paragraph. Specifically, for each text element in the text paragraph, the self-attention layer first performs linear projection of the text element onto the query channel, key channel, and value channel respectively, obtaining a first query vector output by the query channel, a first key vector output by the key channel, and a first value vector output by the value channel. Next, a dot product operation is performed on the first key vector and the first query vector to obtain a first attention score. The square root of the feature dimension of the first key vector is used as a first scaling factor, and the first attention score is divided by the first scaling factor to achieve a scaling operation on the first attention score, resulting in a scaled first attention score. Further, the scaled first attention score is normalized using the softmax function to obtain a first attention weight, and the first value vector is weighted using the first attention weight to obtain a first weighted value vector. The first weighted value vector can be used to represent the degree of attention of other text elements to the current text element. Finally, the first weighted value vectors of all text elements are aggregated into a vector sequence to obtain the first attention calculation result, where the first weighted value vector of each text element is used as an attention element in the first attention calculation result.
[0107] In step S302 of some embodiments, when performing attention calculation on the first attention calculation result based on the cross-attention layer, for each text element in the text segment, the cross-attention layer first linearly projects the text element onto the query channel to obtain a second query vector output by the query channel; the cross-attention layer then linearly projects the attention elements of the text element in the first attention calculation result onto the key channel and value channel respectively to obtain a second key vector output by the key channel and a second value vector output by the value channel. Next, a dot product operation is performed on the second key vector and the second query vector to obtain a second attention score. The square root of the feature dimension of the second key vector is used as a second scaling factor, and the second attention score is divided by the second scaling factor to achieve a scaling operation on the second attention score, resulting in a scaled second attention score. Further, the scaled second attention score is normalized using the softmax function to obtain a second attention weight, and the second attention weight is used to weight the second value vector to obtain a second weighted value vector. The second weighted value vector can be used to represent the degree of attention of other text elements to the current text element. Finally, the second weighted value vectors of all text elements are aggregated into a vector sequence to obtain the second attention calculation result, where the second weighted value vector of each text element is used as an attention element in the second attention calculation result.
[0108] In step S303 of some embodiments, the second attention calculation result is input into a feedforward neural network. First, the first linear layer of the feedforward neural network performs a first linear transformation on the second attention calculation result, mapping it from a narrow-dimensional vector space to a wide-dimensional vector space, thus obtaining variable-dimensional attention features. Next, the activation function of the feedforward neural network performs non-linear activation on the variable-dimensional attention features, obtaining activated attention features. Finally, the second linear layer of the feedforward neural network performs a second linear transformation on the activated attention features, mapping them from a wide-dimensional vector space back to the original narrow-dimensional vector space, thus obtaining text attention latent features. The text attention latent features and the feature dimension of the second attention calculation result are the same.
[0109] In step S304 of some embodiments, the text attention latent features are input into a linear layer, and the linear layer performs feature mapping on the text attention latent features, mapping the text attention latent features from a high-dimensional space to a low-dimensional space to obtain text mapping features.
[0110] In step S305 of some embodiments, the text mapping features are input to the decoding layer of the summary generation model. The decoding layer converts the semantic features in the text mapping features into a sequence form to obtain the target summary corresponding to the text paragraph. The target summary is used to indicate the general content of the text paragraph.
[0111] The advantage of this embodiment is that by using the self-attention layer, cross-attention layer, and feedforward neural network of the summary generation model to capture the semantic information of the text paragraphs, the semantic information of the text paragraphs can be mined in depth layer by layer, so that the final generated target summary has more complete paragraph content information, which is conducive to improving the accuracy of text paragraph summary generation.
[0112] Please see Figure 4 In some embodiments, step S104 may include, but is not limited to, steps S401 to S402:
[0113] Step S401: Generate questions for the dialogue response based on the dialogue generation model to obtain preliminary questions corresponding to the dialogue response;
[0114] Step S402: Repair the content of the initial problem to obtain the target problem.
[0115] Steps S401 to S402 are described in detail below.
[0116] In step S401 of some embodiments, the dialogue generation model is a neural network model based on a transformer structure. Specifically, firstly, the dialogue response is input into the dialogue generation model, and the encoder of the dialogue generation model encodes the dialogue response, capturing the contextual information in the dialogue response to obtain the dialogue response encoded features. Next, the dialogue response encoded features and the dialogue response are input into the decoder of the dialogue generation model, and the decoder performs attention calculation, feedforward processing, and decoding processing on the dialogue response encoded features and the dialogue response to obtain the preliminary question corresponding to the dialogue response. The specific process of the decoder performing attention calculation, feedforward processing, and decoding processing on the dialogue response encoded features and the dialogue response to obtain the preliminary question corresponding to the dialogue response is similar to steps S302 to S305 above. During cross-attention calculation, the projection of the embedded features corresponding to the dialogue response onto the query channel is used as the query vector, the projection of the dialogue response encoded features onto the key channel is used as the key vector, and the projection of the dialogue response encoded features onto the value channel is used as the value vector. For the sake of brevity, it will not be described in detail.
[0117] Furthermore, the specific process of encoding the dialogue response using the encoder of the dialogue generation model is similar to steps S302 to S305 above, except that the cross-attention calculation needs to be modified to self-attention calculation. That is, during attention calculation, the projection of the embedded features corresponding to the dialogue response onto the query channel is used as the query vector, the projection of the embedded features corresponding to the dialogue response onto the key channel is used as the key vector, and the projection of the embedded features corresponding to the dialogue response onto the value channel is used as the value vector. For the sake of brevity, this will not be elaborated further.
[0118] In step S402 of some embodiments, when repairing the content of the preliminary problem, the preliminary problem is first checked for grammatical or spelling errors, and then corrected to obtain the corrected problem. Next, the wording of the corrected problem is optimized, and the structure and content of the word-optimized corrected problem are improved based on preset grammatical rules to obtain the target problem.
[0119] The advantage of this embodiment is that it transforms the dialogue-generated question into an answer-based question generation format. Using a dialogue generation model, the target summary is input as the dialogue response, and the dialogue generation model generates preliminary questions based on the semantic information in the dialogue response. This improves the accuracy and flexibility of question generation. At the same time, it also introduces methods such as grammar checking, word optimization, and structural and content improvement to repair the content of the preliminary questions, thereby improving the content completeness and grammatical standardization of the final generated target questions.
[0120] In step S105 of some embodiments, preliminary dialogue data is constructed based on dialogue responses and target questions.
[0121] In this specific implementation, for each dialogue response, the dialogue response and its corresponding target question are treated as a dialogue segment. Then, multiple dialogue segments are integrated into a set, and all data in this set is used as preliminary dialogue data.
[0122] Please see Figure 5 In some embodiments, step S106 may include, but is not limited to, steps S501 to S503:
[0123] Step S501: Add noise to the initial dialogue data to obtain noisy dialogue data;
[0124] Step S502: Paraphrase the preliminary dialogue data to obtain paraphrased dialogue data;
[0125] Step S503: Integrate the noisy dialogue data and the paraphrased dialogue data to obtain the target dialogue data.
[0126] Steps S501 to S503 are described in detail below.
[0127] In step S501 of some embodiments, when adding noise to the preliminary dialogue data, random errors such as spelling errors, grammatical errors or word errors are introduced into each dialogue segment in the preliminary dialogue data. Dialogue segments containing at least one random error are identified as noisy dialogue segments, and all noisy dialogue segments are integrated into noisy dialogue data.
[0128] In step S502 of some embodiments, when paraphrasing the preliminary dialogue data, firstly, semantic information is extracted from each dialogue segment in the preliminary dialogue data to obtain dialogue semantic information. Next, the meaning of the dialogue is paraphrased based on the dialogue semantic information to generate paraphrased dialogue segments. These paraphrased dialogue segments have the same meaning as the dialogue segments in the preliminary dialogue data, but are expressed differently. Finally, all paraphrased dialogue segments are integrated into paraphrased dialogue data.
[0129] In step S503 of some embodiments, noisy dialogue data and paraphrased dialogue data are integrated into the same set, and all dialogue data in the set are used as target dialogue data.
[0130] The advantage of this embodiment is that it uses data augmentation to enrich the dialogue data used for training. Specifically, noise is added to the initial dialogue data to generate noisy dialogue data, and the initial dialogue data is paraphrased to generate new dialogue data (paraphrased dialogue data). This effectively expands the target dialogue data, increasing the amount of dialogue data used to train the interactive dialogue model, which is beneficial for training a high-quality interactive dialogue model.
[0131] Please see Figure 6 In some embodiments, step S106 may include, but is not limited to, steps S601 to S603:
[0132] Step S601: Determine the target words in the preliminary dialogue data and replace the target words in the preliminary dialogue data with synonyms to obtain the replaced dialogue data.
[0133] Step S602: Adjust the word order of the dialogue sentences in the preliminary dialogue data to obtain the adjusted dialogue data;
[0134] Step S603: Integrate the replaced dialogue data and the adjusted dialogue data to obtain the target dialogue data.
[0135] Steps S601 to S603 are described in detail below.
[0136] In step S601 of some embodiments, firstly, for each dialogue segment in the preliminary dialogue data, a certain number of words are randomly selected as target words from each dialogue sentence of the dialogue segment. Next, synonyms for each target word are searched using a preset dictionary or an online thesaurus, and the found synonyms are used to replace each target word, resulting in replaced dialogue segments. Finally, multiple replaced dialogue segments are integrated into replaced dialogue data.
[0137] In step S602 of some embodiments, firstly, for each dialogue segment in the preliminary dialogue data, the sentence order of each dialogue sentence in the dialogue segment is determined; then, based on the sentence order, the order of each dialogue sentence is shuffled to adjust the word order of the dialogue sentences, resulting in a disordered dialogue segment. Finally, multiple disordered dialogue segments are integrated into the adjusted dialogue data.
[0138] In step S603 of some embodiments, the replacement dialogue data and the adjusted dialogue data are integrated into the same set, and all the dialogue data in the set are used as the target dialogue data.
[0139] The advantage of this embodiment is that it employs data transformation to enrich the dialogue data used for training. Specifically, by performing synonym replacement or sentence order adjustment on the initial dialogue data, flexible transformation of the target dialogue data can be achieved, increasing the amount of dialogue data used to train the interactive dialogue model and thus improving the quality of the trained interactive dialogue model.
[0140] Please see Figure 7 In some embodiments, step S106 may also include, but is not limited to, steps S701 to S703:
[0141] Step S701: Combine multiple dialogue segments in the preliminary dialogue data to obtain synthesized dialogue data;
[0142] Step S702: Reassemble multiple dialogue segments in the initial dialogue data to obtain reassembled dialogue data;
[0143] Step S703: Integrate the synthesized dialogue data and the reconstructed dialogue data to obtain the target dialogue data.
[0144] Steps S701 to S703 are described in detail below.
[0145] In step S701 of some embodiments, for multiple dialogue segments in the preliminary dialogue data, firstly, the multiple dialogue segments are grouped to obtain multiple dialogue segment groups. Next, within each dialogue segment group, operations such as sentence swapping and partial sentence deletion are performed on the dialogue segments within the group to obtain processed dialogue segment groups. Finally, the dialogue segments of the processed dialogue segment groups are synthesized to obtain a synthesized dialogue segment, and multiple synthesized dialogue segments are integrated into synthesized dialogue data.
[0146] In step S702 of some embodiments, firstly, for each dialogue segment in the preliminary dialogue data, the positions of some sentences in the dialogue segment are swapped and deleted to realize the question-and-answer reorganization of the dialogue segment, resulting in a reorganized dialogue segment. Then, multiple reorganized dialogue segments are integrated into reorganized dialogue data.
[0147] In step S703 of some embodiments, the synthesized dialogue data and the reconstructed dialogue data are integrated into the same set, and all the dialogue data in the set are used as the target dialogue data.
[0148] The advantage of this embodiment is that it uses data synthesis to enrich the dialogue data used for training. Specifically, multiple dialogue segments in the initial dialogue data are recombined or synthesized to generate new dialogue data. This enables the synthesis of new dialogue data based on the target dialogue data, increasing the amount of dialogue data used to train the interactive dialogue model and thus improving the training of a high-quality interactive dialogue model.
[0149] The dialogue data generation method of this application embodiment acquires target text with financial domain knowledge and performs text segmentation on the target text to obtain multiple text segments. This enables fine-grained dialogue data generation based on text segments and achieves full utilization of the target text. Further, for each text segment, a summary generation model is used to generate a target summary of the text segment, which is then used as the dialogue response. This target summary provides a concise description of the paragraph information of each text segment, making the dialogue response more refined. Because the self-attention layer, cross-attention layer, and feedforward neural network of the summary generation model are used to capture the semantic information of the text segments, the semantic information of the text segments can be mined in depth layer by layer, resulting in a more complete paragraph content information in the final generated target summary, which helps improve the accuracy of text segment summary generation. Next, a preset dialogue generation model is used to generate questions for the dialogue response, obtaining the target questions corresponding to the dialogue response. In dialogue data generation, a strategy of generating questions based on answers is used, achieving the effect of constructing dialogue data using question-answer pairs. Finally, based on the dialogue responses and target questions, preliminary dialogue data is constructed, and data augmentation is performed on the preliminary dialogue data to obtain target dialogue data. This dialogue data is then used as sample data to train a pre-defined interactive dialogue model. After generating preliminary dialogue data in the form of question-and-answer pairs based on the target text, the amount of target dialogue data can be effectively expanded using data augmentation methods such as data expansion, data transformation, and data synthesis. This approach enables the automated generation of dialogue data for a fixed domain (financial domain), reduces the construction and development costs of dialogue data, and facilitates the efficient and rapid expansion of the amount of dialogue data used to train the interactive dialogue model, thereby improving the dialogue quality of the interactive dialogue model.
[0150] Please see Figure 8 This application also provides a dialogue data generation apparatus that can implement the above-described dialogue data generation method. The apparatus includes:
[0151] Acquisition unit 801 is used to acquire target text containing knowledge in the financial field;
[0152] The segmentation unit 802 is used to segment the target text into multiple text segments;
[0153] The summary generation unit 803 is used to generate a summary for each text paragraph, obtain the target summary of the text paragraph, and determine the target summary as the dialogue response;
[0154] The question generation unit 804 is used to generate questions from the dialogue response using a preset dialogue generation model, so as to obtain the target question corresponding to the dialogue response.
[0155] Construction unit 805 is used to construct preliminary dialogue data based on dialogue responses and target questions;
[0156] The data augmentation unit 806 is used to augment the preliminary dialogue data to obtain the target dialogue data, wherein the dialogue data is used as sample data to train the preset interactive dialogue model.
[0157] In some embodiments, the segmentation unit 802 is used for:
[0158] The target text is segmented into sentences to obtain multiple target text sentences;
[0159] The target text sentence is encoded based on a pre-defined text encoder to obtain the sentence encoding features of the target text sentence;
[0160] The sentence encoding features are pooled to obtain the sentence representation vector of the target text sentence;
[0161] The sentence prediction process is performed on the target text sentence based on the sentence representation vector to obtain the sentence prediction result. The sentence prediction result is used to indicate whether the target text sentence is a topic initiation sentence or not.
[0162] Based on the sentence position of the target text sentence in the target text and the sentence prediction results, multiple target text sentences are aggregated to obtain multiple text paragraphs.
[0163] In some embodiments, the summary generation unit 803 is used for:
[0164] The text paragraphs are self-attentioned through a pre-defined summary generation model to obtain the first attention calculation result. The summary generation model includes a cross-attention layer, a feedforward neural network, and a linear layer.
[0165] The second attention calculation result is obtained by performing attention calculation on the first attention calculation result based on the cross attention layer;
[0166] The text attention latent features are obtained by performing feedforward processing on the second attention calculation results based on the feedforward neural network.
[0167] Based on the linear layer, feature mapping is performed on the latent attention features of the text to obtain the text mapping features;
[0168] The text mapping features are decoded to obtain the target summary.
[0169] In some embodiments, the problem generation unit 804 is used for:
[0170] Based on the dialogue generation model, questions are generated for the dialogue response to obtain the preliminary questions corresponding to the dialogue response.
[0171] The initial problem was repaired to identify the target problem.
[0172] In some embodiments, the data enhancement unit 806 is used for:
[0173] The initial dialogue data is noise-added to obtain noisy dialogue data.
[0174] The initial dialogue data is paraphrased to obtain paraphrased dialogue data.
[0175] The noisy dialogue data and the paraphrased dialogue data are integrated to obtain the target dialogue data.
[0176] In some embodiments, the data enhancement unit 806 is used for:
[0177] The target words are identified in the initial dialogue data, and synonyms are used to replace the target words in the initial dialogue data to obtain the replaced dialogue data.
[0178] The word order of the dialogue sentences in the initial dialogue data is adjusted to obtain the adjusted dialogue data.
[0179] The replacement dialogue data and the adjusted dialogue data are integrated to obtain the target dialogue data.
[0180] In some embodiments, the data enhancement unit 806 is used for:
[0181] Multiple dialogue fragments in the initial dialogue data are synthesized to obtain synthesized dialogue data.
[0182] Multiple dialogue fragments in the initial dialogue data are reassembled to obtain reassembled dialogue data.
[0183] The synthesized dialogue data and the reconstructed dialogue data are integrated to obtain the target dialogue data.
[0184] The specific implementation of this dialogue data generation device is basically the same as the specific embodiment of the dialogue data generation method described above, and will not be repeated here.
[0185] This application also provides an electronic device, which includes: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for communication between the processor and the memory. When the program is executed by the processor, it implements the aforementioned dialogue data generation method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0186] Please see Figure 9 , Figure 9 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:
[0187] The processor 901 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.
[0188] The memory 902 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902 and is called and executed by the processor 901 using the dialogue data generation method of the embodiments of this application.
[0189] The input / output interface 903 is used to implement information input and output;
[0190] The communication interface 904 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0191] Bus 905 transmits information between various components of the device (e.g., processor 901, memory 902, input / output interface 903, and communication interface 904);
[0192] The processor 901, memory 902, input / output interface 903, and communication interface 904 are connected to each other within the device via bus 905.
[0193] This application also provides a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the above-described dialogue data generation method.
[0194] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0195] The dialogue data generation method, device, electronic device, and computer-readable storage medium provided in this application acquire target text with financial domain knowledge and perform text segmentation on the target text to obtain multiple text segments. This enables fine-grained dialogue data generation based on text segments and achieves full utilization of the target text. Furthermore, for each text segment, a summary generation model is used to generate a target summary of the text segment, which is then used as the dialogue response. This allows for a concise description of the paragraph information of each text segment, making the dialogue response more refined. By utilizing the self-attention layer, cross-attention layer, and feedforward neural network of the summary generation model to capture the semantic information of the text segments, the semantic information of the text segments can be mined layer by layer, resulting in a more complete paragraph content information in the final generated target summary, thus improving the accuracy of text segment summary generation. Next, a preset dialogue generation model is used to generate questions for the dialogue response, obtaining the target questions corresponding to the dialogue response. In dialogue data generation, a strategy based on answer-based question generation is used, achieving the effect of constructing dialogue data using question-answer pairs. Finally, based on the dialogue responses and target questions, preliminary dialogue data is constructed, and data augmentation is performed on the preliminary dialogue data to obtain target dialogue data. This dialogue data is then used as sample data to train a pre-defined interactive dialogue model. After generating preliminary dialogue data in the form of question-and-answer pairs based on the target text, the amount of target dialogue data can be effectively expanded using data augmentation methods such as data expansion, data transformation, and data synthesis. This approach enables the automated generation of dialogue data for a fixed domain (financial domain), reduces the construction and development costs of dialogue data, and facilitates the efficient and rapid expansion of the amount of dialogue data used to train the interactive dialogue model, thereby improving the dialogue quality of the interactive dialogue model.
[0196] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0197] It will be understood by those skilled in the art that Figure 1-7 The technical solutions shown do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0198] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0199] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0200] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0201] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0202] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0203] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0204] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0205] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0206] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A method for generating dialogue data, characterized in that, The dialogue data generation method includes: Obtain target texts containing knowledge of the financial field; The target text is segmented to obtain multiple text paragraphs; For each of the text segments, a summary is generated to obtain the target summary of the text segment, and the target summary is determined as the dialogue response; The dialogue response is generated using a preset dialogue generation model to obtain the target question corresponding to the dialogue response; Based on the dialogue responses and the target question, preliminary dialogue data is constructed; The initial dialogue data is augmented to obtain target dialogue data, wherein the dialogue data is used as sample data to train a preset interactive dialogue model. The step of generating a summary for each text segment to obtain a target summary of the text segment includes: The text paragraph is subjected to self-attention calculation using a preset summary generation model to obtain a first attention calculation result. The summary generation model includes a cross-attention layer, a feedforward neural network, and a linear layer. Attention calculation is then performed on the first attention calculation result based on the cross-attention layer to obtain a second attention calculation result. Feedforward processing is then applied to the second attention calculation result based on the feedforward neural network to obtain text attention latent features. Feature mapping is then performed on the text attention latent features based on the linear layer to obtain text mapping features. Finally, feature decoding is performed on the text mapping features to obtain the target summary. The step of data augmentation of the preliminary dialogue data to obtain the target dialogue data includes: The target words are identified in the preliminary dialogue data, and synonym replacement is performed on the target words in the preliminary dialogue data to obtain replaced dialogue data; the word order of the dialogue sentences in the preliminary dialogue data is adjusted to obtain adjusted dialogue data; the replaced dialogue data and the adjusted dialogue data are integrated to obtain the target dialogue data.
2. The method according to claim 1, characterized in that, The target text is segmented to obtain multiple text segments, including: The target text is segmented into sentences to obtain multiple target text sentences; The target text sentence is encoded based on a preset text encoder to obtain the sentence encoding features of the target text sentence; The sentence encoding features are pooled to obtain the sentence representation vector of the target text sentence; Based on the sentence representation vector, the target text sentence is predicted to obtain a sentence prediction result, wherein the sentence prediction result is used to indicate whether the target text sentence is a topic initiation sentence or not. Based on the sentence position of the target text sentence in the target text and the sentence prediction result, the multiple target text sentences are aggregated to obtain the multiple text paragraphs.
3. The method according to claim 1, characterized in that, The step of generating a question from the dialogue response using a preset dialogue generation model to obtain the target question corresponding to the dialogue response includes: Based on the dialogue generation model, questions are generated for the dialogue response to obtain preliminary questions corresponding to the dialogue response. The initial problem is repaired to obtain the target problem.
4. The method according to claim 1, characterized in that, The step of data augmentation of the preliminary dialogue data to obtain the target dialogue data includes: The initial dialogue data is subjected to noise processing to obtain noisy dialogue data; The preliminary dialogue data is paraphrased to obtain paraphrased dialogue data; The noisy dialogue data and the paraphrased dialogue data are integrated to obtain the target dialogue data.
5. The method according to any one of claims 1 to 4, characterized in that, The step of data augmentation of the preliminary dialogue data to obtain the target dialogue data includes: Multiple dialogue fragments in the preliminary dialogue data are synthesized to obtain synthesized dialogue data. Multiple dialogue segments in the preliminary dialogue data are reassembled to obtain reassembled dialogue data. The synthesized dialogue data and the reconstructed dialogue data are integrated to obtain the target dialogue data.
6. A dialogue data generation device, characterized in that, The dialogue data generation device includes: The acquisition unit is used to acquire target text containing knowledge in the financial field. A segmentation unit is used to segment the target text into multiple text paragraphs. The summary generation unit is used to generate a summary for each of the text segments, obtain a target summary for the text segment, and determine the target summary as a dialogue response; The question generation unit is used to generate questions from the dialogue response using a preset dialogue generation model, thereby obtaining the target question corresponding to the dialogue response. A construction unit is used to construct preliminary dialogue data based on the dialogue responses and the target question; A data augmentation unit is used to augment the preliminary dialogue data to obtain target dialogue data, wherein the dialogue data is used as sample data to train a preset interactive dialogue model. The step of generating a summary for each text segment to obtain a target summary of the text segment includes: The text paragraph is subjected to self-attention calculation using a preset summary generation model to obtain a first attention calculation result. The summary generation model includes a cross-attention layer, a feedforward neural network, and a linear layer. Attention calculation is then performed on the first attention calculation result based on the cross-attention layer to obtain a second attention calculation result. Feedforward processing is then applied to the second attention calculation result based on the feedforward neural network to obtain text attention latent features. Feature mapping is then performed on the text attention latent features based on the linear layer to obtain text mapping features. Finally, feature decoding is performed on the text mapping features to obtain the target summary. The step of data augmentation of the preliminary dialogue data to obtain the target dialogue data includes: The target words are identified in the preliminary dialogue data, and synonym replacement is performed on the target words in the preliminary dialogue data to obtain replaced dialogue data; the word order of the dialogue sentences in the preliminary dialogue data is adjusted to obtain adjusted dialogue data; the replaced dialogue data and the adjusted dialogue data are integrated to obtain the target dialogue data.
7. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the dialogue data generation method according to any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the dialogue data generation method according to any one of claims 1 to 5.