Dialogue data generation method and device, electronic equipment and storage medium
Through the dialogue data generation method, the target text segmentation, summary generation and data enhancement are used in the financial field knowledge, which solves the problem of insufficient dialogue data in the financial business field and improves the training efficiency and quality of the interactive dialogue model.
Patent Information
- Application Number
- CN202411079549.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-08-06
AI Technical Summary
In the prior art, the interactive dialogue model training that depends on dialogue robot interaction operation in the financial business field requires a large amount of high-quality labeling data, but the high-quality labeling data obtained in reality is limited, resulting in limited model training effect and manual construction of labeling data. Inefficient.
A dialogue data generation method is proposed, by obtaining target text with knowledge of the financial field for text segmentation, summary generation, problem generation and data enhancement, construct preliminary dialogue data, and use preset interactive dialogue models for training to improve dialogue data generation efficiency and quality.
It realizes efficient and quick expansion of the amount of dialogue data used to train interactive dialogue models, reduces the cost of dialogue data construction and development, and improves the dialogue quality of interaction dialogue models.
Smart Images

Figure CN119066168A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of financial technology, and in particular to a method and device for generating conversation data, an electronic device, and a storage medium. Background Art
[0002] At present, in various financial business fields, conversational robots are often introduced to realize human-computer interactive dialogue, wherein the interactive operation of the conversational robots often relies on a trained interactive dialogue model.
[0003] In order to improve the quality of dialogue, a large amount of high-quality annotated data is often needed to train the above interactive dialogue model. However, the high-quality annotated data that can be obtained in reality is relatively limited, which will affect the training effect of the model. In this regard, the relevant technology often uses artificial construction to produce annotated data. Although this method can alleviate the shortage of dialogue data for training models to a certain extent, it still has the problem of low efficiency in generating dialogue data. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to propose a method and device for generating dialogue data, an electronic device and a storage medium, aiming to efficiently and quickly expand the amount of dialogue data used to train an interactive dialogue model.
[0005] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a method for generating conversation data, the method comprising:
[0006] Acquire target text with financial domain knowledge;
[0007] Performing text segmentation on the target text to obtain multiple text paragraphs;
[0008] For each of the text paragraphs, a summary is generated for the text paragraph to obtain a target summary of the text paragraph, and the target summary is determined as a dialogue response;
[0009] Generate a question for the dialogue response using a preset dialogue generation model to obtain a target question corresponding to the dialogue response;
[0010] constructing preliminary dialogue data based on the dialogue responses and the target question;
[0011] The preliminary dialogue data is data enhanced to obtain target dialogue data, wherein the dialogue data 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 paragraphs includes:
[0013] Segmenting the target text to obtain a plurality of target text sentences;
[0014] Encoding the target text sentence based on a preset text encoder to obtain a sentence encoding feature of the target text sentence;
[0015] Performing pooling processing on the sentence encoding features to obtain a sentence representation vector of the target text sentence;
[0016] Performing prediction processing on the target text sentence based on the sentence representation vector to obtain a sentence prediction result, wherein the sentence prediction result is used to indicate that the target text sentence is a topic starting sentence, or is used to indicate that the target text sentence is not a topic starting sentence;
[0017] Based on the sentence positions of the target text sentences in the target text and the sentence prediction results, the multiple target text sentences are aggregated to obtain the multiple text paragraphs.
[0018] In some embodiments, for each of the text paragraphs, generating a summary of the text paragraph to obtain a target summary of the text paragraph includes:
[0019] Performing self-attention calculation on the text paragraph through a preset summary generation model to obtain a first attention calculation result, wherein the summary generation model includes a cross attention layer, a feedforward neural network, and a linear layer;
[0020] Performing attention calculation on the first attention calculation result based on the cross attention layer to obtain a second attention calculation result;
[0021] Performing feedforward processing on the second attention calculation result based on the feedforward neural network to obtain text attention latent features;
[0022] Performing feature mapping on the text attention latent feature based on the linear layer to obtain a text mapping feature;
[0023] Feature decoding is performed on the text mapping feature to obtain the target summary.
[0024] In some embodiments, generating a question for the dialogue response by using a preset dialogue generation model to obtain a target question corresponding to the dialogue response includes:
[0025] Generating questions for the dialogue responses based on the dialogue generation model to obtain preliminary questions corresponding to the dialogue responses;
[0026] The preliminary question is repaired to obtain the target question.
[0027] In some embodiments, performing data enhancement on the preliminary conversation data to obtain target conversation data includes:
[0028] Performing noise processing on the preliminary dialogue data to obtain noise dialogue data;
[0029] Performing a paraphrase process on the preliminary dialogue data to obtain paraphrase dialogue data;
[0030] The noise conversation data and the reported conversation data are integrated to obtain the target conversation data.
[0031] In some embodiments, performing data enhancement on the preliminary conversation data to obtain target conversation data includes:
[0032] Determining a target word in the preliminary dialogue data, and performing synonym replacement on the target word in the preliminary dialogue data to obtain replacement dialogue data;
[0033] Adjusting the word order of the dialogue sentences in the preliminary dialogue data to obtain adjusted dialogue data;
[0034] The replacement conversation data and the adjusted conversation data are integrated to obtain the target conversation data.
[0035] In some embodiments, performing data enhancement on the preliminary conversation data to obtain target conversation data includes:
[0036] synthesizing the multiple dialogue segments in the preliminary dialogue data to obtain synthesized dialogue data;
[0037] Reorganizing the multiple dialogue segments in the preliminary dialogue data to obtain reorganized dialogue data;
[0038] The synthesized dialogue data and the reorganized dialogue data are integrated to obtain the target dialogue data.
[0039] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a conversation data generating device, the device comprising:
[0040] An acquisition unit, used for acquiring a target text having financial domain knowledge;
[0041] A segmentation unit, used to segment the target text to obtain multiple text paragraphs;
[0042] A summary generating unit, configured to generate a summary for each of the text paragraphs, obtain a target summary for the text paragraph, and determine the target summary as a dialogue reply;
[0043] A question generation unit, configured to generate a question for the dialogue response by using a preset dialogue generation model to obtain a target question corresponding to the dialogue response;
[0044] A construction unit, configured to construct preliminary dialogue data based on the dialogue response and the target question;
[0045] A data enhancement unit is used to perform data enhancement on 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-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the conversation data generation method described in the first aspect is implemented.
[0047] To achieve the above objectives, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for generating conversation data described in the first aspect is implemented.
[0048] The method and device for generating dialogue data, the electronic device and the storage medium proposed in the present application obtain a target text with financial field knowledge, and perform text segmentation on the target text to obtain multiple text paragraphs. This enables dialogue data generation based on text paragraphs at a fine granularity, and full utilization of the target text. Furthermore, for each text paragraph, a summary is generated for the text paragraph to obtain a target summary of the text paragraph, and the target summary is determined as a dialogue response. The target summary can be used to summarize the paragraph information of each text paragraph, making the dialogue response more refined. Then, questions are generated for the dialogue response through a preset dialogue generation model to obtain the target question corresponding to the dialogue response. In the generation of dialogue data, a strategy based on generating questions based on answers is used, which can achieve 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 enhancement is performed on the preliminary dialogue data to obtain target dialogue data. The dialogue data is used as sample data to train the preset interactive dialogue model. After generating preliminary dialogue data in the form of question-answer pairs based on the target text, the number of target dialogue data can be effectively expanded by using data enhancement. This method realizes the automatic generation of dialogue data for a fixed field (financial field), can reduce the construction and development costs of dialogue data, and is conducive to efficiently and quickly expanding the amount of dialogue data used to train the interactive dialogue model, thereby improving the dialogue quality of the interactive dialogue model. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 is a flowchart of a method for generating conversation data provided by an embodiment of the present application;
[0050] Figure 2 yes Figure 1 Flow chart of step S102 in FIG.
[0051] Figure 3 yes Figure 1 Flow chart of step S103 in FIG.
[0052] Figure 4 yes Figure 1 Flow chart of step S104 in FIG.
[0053] Figure 5 yes Figure 1 Flow chart of step S106 in FIG.
[0054] Figure 6 yes Figure 1 Another flow chart of step S106 in FIG. 1 ;
[0055] Figure 7 yes Figure 1 Another flow chart of step S106 in FIG. 1 ;
[0056] Figure 8 is a structural diagram of a conversation data generating device provided in an embodiment of the present application;
[0057] Fig. 9 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0059] It should be noted that, although the functional modules are divided in the device schematic diagram and the 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 above 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 those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0061] At present, in various financial business fields, conversational robots are often introduced to realize human-computer interactive dialogue, wherein the interactive operation of the conversational robots often relies on a trained interactive dialogue model.
[0062] In order to improve the quality of dialogue, a large amount of high-quality annotated data is often needed to train the above interactive dialogue model. However, the high-quality annotated data that can be obtained in reality is relatively limited, which will affect the training effect of the model. In this regard, the relevant technology often uses artificial construction to produce annotated data. Although this method can alleviate the shortage of dialogue data for training models to a certain extent, it still has the problem of low efficiency in generating dialogue data.
[0063] Based on this, the embodiments of the present application provide a conversation data generation method, a conversation data generation device, an electronic device and a storage medium, which aim to efficiently and quickly expand the amount of conversation data used to train an interactive conversation model.
[0064] The conversation data generation method and device, electronic device and storage medium provided in the embodiments of the present application are specifically described through the following embodiments. First, the conversation data generation method in the embodiments of the present application is described.
[0065] The embodiments of the present 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 knowledge to obtain the best results.
[0066] The conversation data generation method provided in the embodiment of the present application relates to the field of financial technology. The conversation data generation method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the conversation data generation method, etc., but is not limited to the above forms.
[0067] The present application can be used in many general or special computer system environments or configurations. For example: 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, distributed computing environments including any of the above systems or devices, etc. The present 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. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0068] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to the identity or characteristics of the object, such as object information, object behavior data, object historical data, and object location information, the permission or consent of the object will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the personal information of the object, the separate permission or separate consent of the object will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the separate permission or separate consent of the object, the necessary object-related data for the normal operation of the embodiment of the present application will be obtained.
[0069] Figure 1 is an optional flowchart of the method for generating conversation data provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S106.
[0070] Step S101, obtaining a target text with financial domain knowledge;
[0071] Step S102, performing text segmentation on the target text to obtain multiple text paragraphs;
[0072] Step S103, for each text paragraph, generating a summary of the text paragraph to obtain a target summary of the text paragraph, and determining the target summary as a dialogue response;
[0073] Step S104, generating questions for the dialogue responses using a preset dialogue generation model to obtain target questions corresponding to the dialogue responses;
[0074] Step S105, constructing preliminary dialogue data based on the dialogue responses and the target question;
[0075] Step S106, performing data enhancement on the preliminary dialogue data to obtain target dialogue data.
[0076] The dialogue data is used as sample data to train a preset interactive dialogue model.
[0077] Steps S101 to S106 shown in the embodiment of the present application are to obtain a target text with financial field knowledge and perform text segmentation on the target text to obtain multiple text paragraphs. This enables fine-grained dialogue data generation based on text paragraphs and full utilization of the target text. Furthermore, for each text paragraph, a summary is generated for the text paragraph to obtain a target summary of the text paragraph, and the target summary is determined as a dialogue reply. The target summary can be used to summarize the paragraph information of each text paragraph, making the dialogue reply more refined. Then, questions are generated for the dialogue reply through a preset dialogue generation model to obtain the target question corresponding to the dialogue reply. In the generation of dialogue data, a strategy based on answer generation questions is used, which can achieve 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 enhancement is performed on the preliminary dialogue data to obtain target dialogue data. The dialogue data is used as sample data to train the preset interactive dialogue model. After generating preliminary dialogue data in the form of question-answer pairs based on the target text, the number of target dialogue data can be effectively expanded by using data enhancement. This method realizes the automatic generation of dialogue data for a fixed field (financial field), can reduce the construction and development costs of dialogue data, and is conducive to efficiently and quickly expanding 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, a target text containing financial domain knowledge is obtained.
[0079] Financial domain knowledge refers to some professional knowledge in the financial field, such as technical terminology in the financial field, basic financial business types, etc.
[0080] The target text refers to the natural language text containing financial domain knowledge.
[0081] In the specific implementation of this embodiment, with authorization and permission, encyclopedia articles and web pages containing financial field knowledge are obtained from various public websites on the Internet, and the target text is extracted from the obtained encyclopedia articles and web pages.
[0082] See also Figure 2 In some embodiments, step S102 may include but is not limited to steps S201 to S205:
[0083] Step S201, performing sentence processing on the target text to obtain a plurality of target text sentences;
[0084] Step S202, encoding the target text sentence based on a preset text encoder to obtain a sentence encoding feature of the target text sentence;
[0085] Step S203, performing pooling processing on the sentence encoding features to obtain a sentence representation vector of the target text sentence;
[0086] Step S204, performing prediction processing on the target text sentence based on the sentence representation vector to obtain a sentence prediction result;
[0087] Step S205 , based on the sentence positions of the target text sentences in the target text and the sentence prediction results, a plurality of target text sentences are aggregated to obtain a plurality of text paragraphs.
[0088] Steps S201 to S205 are described in detail below.
[0089] In step S201 of some embodiments, first, a preset regular expression is obtained, wherein the regular expression is used to indicate a specific mode for segmenting text. Then, the target text is segmented using the preset regular expression, and sentence boundaries are identified based on punctuation marks (such as periods, question marks, exclamation marks, etc.) at the end of each sentence in the target text and subsequent spaces or paragraph marks, thereby dividing the target text into multiple target text sentences, thereby converting 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 into a preset text encoder, and the text encoder encodes the target text sentence, converts the target text sentence from the data space to the vector space, and obtains the sentence encoding features of the target text sentence, wherein the sentence encoding features are used to indicate the semantic content representation of the target text sentence in the vector space, and the sentence encoding features of a target text sentence include the word encoding features of each word in the target text sentence. The text encoder includes but is not limited to BERT encoder and the like.
[0091] In step S203 of some embodiments, first, the Word2Vec model is called, and each word encoding feature in the sentence encoding feature is pooled using the Word2Vec model to obtain the word pooling feature corresponding to each word encoding feature. Then, all word pooling features are feature concatenated to obtain the sentence representation vector of the target text sentence. Among them, the sentence representation vector is a feature vector of a fixed length 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 that the target text sentence is a topic-starting sentence, or is used to indicate that the target text sentence is not a topic-starting sentence.
[0093] Specifically, first, a binary classification function is called, wherein the binary classification function includes but is not limited to a Sigmad function. Then, for each target text sentence, the target text sentence is input into the binary classification function, and the binary classification function outputs a first probability value that the target text sentence is a topic-starting sentence, and a second probability value that the target text sentence is not a topic-starting sentence. Further, if the first probability value is greater than the second probability value, the sentence prediction result is determined as the target text sentence is a topic-starting sentence; if the first probability value is less than the second probability value, the sentence prediction result is determined as the target text sentence is not a topic-starting sentence.
[0094] Among them, the Sigma 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 the sentence positions of the target text sentences in the target text and the sentence prediction results, first, the target text sentences are sorted according to the sentence positions of the target text sentences in the target text. Then, according to the sentence prediction results of each target text sentence in the sorting, for two text sentences whose consecutive sentence prediction results are that the target text sentence is the topic starting sentence in the sorting, the sequence segment consisting of the text sentence whose first sentence prediction result is that the target text sentence is the topic starting sentence and the text sentence whose second sentence prediction result is that the target text sentence is the topic starting sentence is taken as a set, and the multiple text sentences in the set are spliced into a text paragraph.
[0096] For example, the target text has multiple target text sentences arranged as [sentence 1, sentence 2, sentence 3, sentence 4, sentence 5, sentence 6], where the sentence prediction results of sentence 1 and sentence 4 are text sentences that are topic start sentences, then sentence 1, sentence 2 and sentence 3 constitute a sequence segment [sentence 1, sentence 2, sentence 3] as a set, and sentence 1, sentence 2 and sentence 3 are concatenated into a text paragraph. Similarly, sentence 4, sentence 5 and sentence 6 constitute a sequence segment [sentence 4, sentence 5 and sentence 6] as a set, and sentence 4, sentence 5 and sentence 6 are concatenated into a text paragraph.
[0097] The benefit of this embodiment is that the target text is split into multiple target text sentences, each target text sentence is encoded and pooled, the sentence representation of the target text sentence is obtained, and the target text sentences are binary-classified and labeled according to the sentence representation of the target text sentence to determine which target text sentences are topic starting sentences, so as to splice all target text sentences from one topic starting sentence to the next topic starting sentence into a text paragraph for describing the same topic according to the position of each target text sentence in the target text and the adjacent relationship of each topic starting sentence, so as to achieve the accuracy of the subject segmentation of the target text, so that when generating dialogue data, the number of generated dialogue data can be effectively expanded based on the text paragraphs.
[0098] See also Figure 3 In some embodiments, step S103 may include but is not limited to steps S301 to S305:
[0099] Step S301, performing self-attention calculation on the text paragraph through a preset summary generation model to obtain a first attention calculation result;
[0100] Step S302, performing attention calculation on the first attention calculation result based on the cross attention layer to obtain a second attention calculation result;
[0101] Step S303, performing feedforward processing on the second attention calculation result based on a feedforward neural network to obtain text attention latent features;
[0102] Step S304, performing feature mapping on the text attention latent features based on the linear layer to obtain text mapping features;
[0103] Step S305: Decode the text mapping features to obtain a 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 the specific implementation of this embodiment, the text paragraph is input as a text data into the summary generation model, and the self-attention layer of the summary generation model performs self-attention calculation on the text paragraph. Specifically, for each text element in the text paragraph, the self-attention layer first linearly projects the text element in the query channel, the key channel and the value channel respectively, and obtains the first query vector output by the query channel, the first key vector output by the key channel, and the first value vector output by the value channel. Then, the first key vector and the first query vector are dot-producted to obtain a first attention score, and the square root of the feature dimension of the first key vector is used as the first scaling factor, and the first attention score is divided by the first scaling factor to achieve the scaling operation of the first attention score, and the scaled first attention score is obtained. 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, which 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 a first attention calculation result, wherein the first weighted value vector of each text element serves as an attention element in the first attention calculation result.
[0107] In step S302 of some embodiments, when the attention calculation is performed on the first attention calculation result based on the cross attention layer, for each text element in the text paragraph, the cross attention layer first linearly projects the text element on the query channel to obtain a second query vector output by the query channel; the attention element of the text element in the first attention calculation result is linearly projected on the key channel and the value channel by the cross attention layer, respectively, to obtain a second key vector output by the key channel and a second value vector output by the value channel. Then, a dot product operation is performed on the second key vector and the second query vector to obtain a second attention score, and 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 to obtain a scaled second attention score. Further, the scaled second attention score is normalized using a 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, which 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 a second attention calculation result, wherein the second weighted value vector of each text element serves 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, and the first linear layer of the feedforward neural network first performs a first linear transformation on the second attention calculation result, mapping the second attention calculation result from a narrow dimensional vector space to a wide dimensional vector space to obtain a variable dimensional attention feature. Next, the activation function of the feedforward neural network performs a nonlinear activation on the variable dimensional attention feature to obtain an activated attention feature. Finally, the second linear layer of the feedforward neural network performs a second linear transformation on the activated attention feature, mapping the activated attention feature from a wide dimensional vector space to the original narrow dimensional vector space to obtain a text attention latent feature. Among them, the text attention latent feature has the same feature dimension as the second attention calculation result.
[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 into the decoding layer of the summary generation model, and the decoding layer converts the semantic features in the text mapping features into a sequence form to obtain a target summary corresponding to the text paragraph, wherein the target summary is used to indicate the general content of the text paragraph.
[0111] The advantage of this embodiment is that the semantic information of the text paragraph is captured by using the self-attention layer, cross-attention layer and feedforward neural network of the summary generation model, and the semantic information of the text paragraph can be deeply mined layer by layer, so that the final generated target summary has more complete paragraph content information, which is conducive to improving the accuracy of summary generation of text paragraphs.
[0112] See also Figure 4 In some embodiments, step S104 may include but is not limited to steps S401 to S402:
[0113] Step S401, generating questions for the dialogue responses based on the dialogue generation model to obtain preliminary questions corresponding to the dialogue responses;
[0114] Step S402, repair the content of the preliminary question to obtain the target question.
[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, first, the dialogue reply is input into the dialogue generation model, and the dialogue reply is encoded by the encoder of the dialogue generation model to capture the context information in the dialogue reply, and obtain the dialogue reply encoding feature. Then, the dialogue reply encoding feature and the dialogue reply are input into the decoder of the dialogue generation model, and the decoder is used to perform attention calculation, feedforward processing and decoding processing on the dialogue reply encoding feature and the dialogue reply to obtain the preliminary question corresponding to the dialogue reply. Among them, the specific process of the decoder performing attention calculation, feedforward processing and decoding processing on the dialogue reply encoding feature and the dialogue reply to obtain the preliminary question corresponding to the dialogue reply is similar to the above steps S302 to S305. In the cross-attention calculation, the projection of the embedded feature corresponding to the dialogue reply in the query channel is used as the query vector, the projection of the dialogue reply encoding feature in the key channel is used as the key vector, and the projection of the dialogue reply encoding feature in the value channel is used as the value vector. To save space, it is not repeated here.
[0117] In addition, the specific process of encoding the dialogue response using the encoder of the dialogue generation model is similar to the above steps S302 to S305, except that the cross attention calculation needs to be modified into the self-attention calculation, that is, when calculating the attention, the projection of the embedded features corresponding to the dialogue response in the query channel is used as the query vector, the projection of the embedded features corresponding to the dialogue response in the key channel is used as the key vector, and the projection of the embedded features corresponding to the dialogue response in the value channel is used as the value vector. To save space, it will not be repeated.
[0118] In step S402 of some embodiments, when the content of the preliminary question is repaired, the preliminary question is first checked for grammatical errors or spelling errors, and then corrected to obtain a corrected question. Then, the wording of the corrected question is optimized, and the structure and content of the corrected question after wording optimization are improved based on preset grammatical rules to obtain a target question.
[0119] The benefit of this embodiment is that it converts the dialogue generation question into the form of answer generation question, uses the dialogue generation model, inputs the target summary as the dialogue response into the dialogue generation model, and generates the preliminary question according to the semantic information in the dialogue response, which can improve the accuracy and flexibility of question generation. At the same time, it also introduces grammar checking, wording optimization, structure and content improvement to repair the content of the preliminary question, which can improve the content integrity and grammatical standardization of the target question finally generated.
[0120] In step S105 of some embodiments, preliminary dialogue data is constructed based on the dialogue replies and the target question.
[0121] In the specific implementation of this embodiment, for each dialogue response, the dialogue response and the target question corresponding to the dialogue response are regarded as a dialogue segment. Then, multiple dialogue segments are integrated into a set, and all data of the set are regarded as preliminary dialogue data.
[0122] See also Figure 5 In some embodiments, step S106 may include but is not limited to steps S501 to S503:
[0123] Step S501, performing noise processing on the preliminary dialogue data to obtain noise dialogue data;
[0124] Step S502, performing paraphrase processing on the preliminary dialogue data to obtain paraphrase dialogue data;
[0125] Step S503: Integrate the noise dialogue data and the reported dialogue data to obtain target dialogue data.
[0126] Steps S501 to S503 are described in detail below.
[0127] In step S501 of some embodiments, when noise processing is performed on the preliminary conversation data, random errors such as spelling errors, grammatical errors, or word usage errors are introduced into the conversation segments in the preliminary conversation data, and the conversation segments containing at least one random error are determined as noisy conversation segments, and all noisy conversation segments are integrated into noisy conversation data.
[0128] In step S502 of some embodiments, when the preliminary dialogue data is paraphrased, first, for each dialogue segment in the preliminary dialogue data, the semantic information in the dialogue segment is extracted to obtain dialogue semantic information. Then, the dialogue meaning is paraphrased according to the dialogue semantic information to generate paraphrased dialogue segments, wherein the paraphrased dialogue segments have the same meaning as the dialogue segments in the preliminary dialogue data, but are expressed in different ways. Finally, all paraphrased dialogue segments are integrated into paraphrased dialogue data.
[0129] In step S503 of some embodiments, the noise conversation data and the reported conversation data are integrated into the same set, and all the conversation data in the set are used as target conversation data.
[0130] The advantage of this embodiment is that it uses data expansion to enrich the dialogue data used for training. Specifically, the preliminary dialogue data is denoised to generate noise dialogue data, and the preliminary dialogue data is paraphrased to generate new dialogue data (paraphrased dialogue data), which can effectively expand the target dialogue data, increase the amount of dialogue data used for training the interactive dialogue model, and help improve the training of high-quality interactive dialogue models.
[0131] See also Figure 6 In some embodiments, step S106 further includes but is not limited to steps S601 to S603:
[0132] Step S601, determining a target word in the preliminary dialogue data, and performing synonym replacement on the target word in the preliminary dialogue data to obtain replacement dialogue data;
[0133] Step S602, adjusting the word order of the dialogue sentences in the preliminary dialogue data to obtain adjusted dialogue data;
[0134] Step S603: Integrate the replaced conversation data and the adjusted conversation data to obtain target conversation data.
[0135] Steps S601 to S603 are described in detail below.
[0136] In step S601 of some embodiments, first, for each dialogue segment in the preliminary dialogue data, a certain number of words are randomly selected from each dialogue sentence in the dialogue segment as target words. Then, a preset dictionary or an online synonym database is used to search for synonyms of each target word, and the searched synonyms are used to replace each target word with a synonym to obtain a replacement dialogue segment. Finally, multiple replacement dialogue segments are integrated into replacement dialogue data.
[0137] In step S602 of some embodiments, first, 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 sentence and obtain a disordered dialogue segment. Finally, multiple disordered dialogue segments are integrated into adjusted dialogue data.
[0138] In step S603 of some embodiments, the replaced conversation data and the adjusted conversation data are integrated into the same set, and all conversation data in the set are used as target conversation data.
[0139] The advantage of this embodiment is that it uses data transformation to enrich the dialogue data used for training. Specifically, by performing synonym replacement on the preliminary dialogue data or adjusting the sentence order of the preliminary dialogue data, the target dialogue data can be flexibly transformed, so that the amount of dialogue data used for training the interactive dialogue model can be increased, which is conducive to improving the training of a high-quality interactive dialogue model.
[0140] See also Figure 7 In some embodiments, step S106 may also include but is not limited to steps S701 to S703:
[0141] Step S701, synthesizing multiple dialogue segments in the preliminary dialogue data to obtain synthesized dialogue data;
[0142] Step S702, reorganizing the multiple dialogue segments in the preliminary dialogue data to obtain reorganized dialogue data;
[0143] Step S703, integrating the synthesized dialogue data and the reorganized dialogue data to obtain 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, first, the multiple dialogue segments are grouped to obtain multiple dialogue segment groups. Then, in each dialogue segment group, each dialogue segment in the dialogue segment group is subjected to operations such as sentence exchange and partial sentence deletion to obtain a processed dialogue segment group. Finally, the dialogue segments in the processed dialogue segment group are synthesized to obtain a synthesized dialogue segment, and the multiple synthesized dialogue segments are integrated into the synthesized dialogue data.
[0146] In step S702 of some embodiments, first, for each dialogue segment in the preliminary dialogue data, a portion of sentences in the dialogue segment are swapped and deleted to achieve question-answer reorganization of the dialogue segment and obtain a reorganized dialogue segment. Then, multiple reorganized dialogue segments are integrated into reorganized dialogue data.
[0147] In step S703 of some embodiments, the synthesized conversation data and the reorganized conversation data are integrated into the same set, and all conversation data in the set are used as target conversation 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 preliminary dialogue data are reorganized or synthesized to generate new dialogue data, which can achieve the synthesis of new dialogue data based on the target dialogue data, so that the amount of dialogue data used for training the interactive dialogue model is increased, which is conducive to improving the training of high-quality interactive dialogue models.
[0149] The method for generating dialogue data in the embodiment of the present application obtains a target text with financial field knowledge and performs text segmentation on the target text to obtain multiple text paragraphs. This enables dialogue data generation based on text paragraphs to be realized at a fine granularity and to make full use of the target text. Furthermore, for each text paragraph, a summary generation model is used to generate a summary of the text paragraph to obtain a target summary of the text paragraph, and the target summary is determined as a dialogue reply. The target summary can be used to summarize the paragraph information of each text paragraph, making the dialogue reply more refined. Since the semantic information of the text paragraph is captured by the self-attention layer, the cross-attention layer and the feedforward neural network of the summary generation model, the semantic information of the text paragraph can be deeply mined layer by layer, so that the target summary finally generated has relatively complete paragraph content information, which is conducive to improving the accuracy of summary generation of the text paragraph; then, the dialogue reply is generated by the preset dialogue generation model to generate questions, and the target question corresponding to the dialogue reply is obtained. In the generation of dialogue data, a strategy based on answer generation questions is used, which can achieve 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 enhancement is performed on the preliminary dialogue data to obtain target dialogue data. The dialogue data is used as sample data to train the preset interactive dialogue model. After generating preliminary dialogue data in the form of question-answer pairs based on the target text, the number of target dialogue data can be effectively expanded by using data enhancement methods such as data expansion, data transformation, and data synthesis. This method realizes the automatic generation of dialogue data for a fixed field (financial field), can reduce the construction and development costs of dialogue data, and is conducive to efficiently and quickly expanding the amount of dialogue data used to train the interactive dialogue model, thereby improving the dialogue quality of the interactive dialogue model.
[0150] See also Figure 8 The embodiment of the present application also provides a conversation data generation device, which can implement the above-mentioned conversation data generation method, and the device includes:
[0151] An acquisition unit 801 is used to acquire a target text having financial domain knowledge;
[0152] The segmentation unit 802 is used to segment the target text to obtain multiple text paragraphs;
[0153] A summary generating unit 803 is used to generate a summary for each text paragraph, obtain a target summary of the text paragraph, and determine the target summary as a dialogue reply;
[0154] A question generation unit 804 is used to generate a question for the dialogue response by using a preset dialogue generation model to obtain a target question corresponding to the dialogue response;
[0155] A construction unit 805, configured to construct preliminary dialogue data based on the dialogue responses and the target question;
[0156] The data enhancement unit 806 is used to perform data enhancement on 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.
[0157] In some embodiments, the segmentation unit 802 is used to:
[0158] Sentence processing is performed on the target text to obtain multiple target text sentences;
[0159] Encoding the target text sentence based on a preset text encoder to obtain the sentence encoding features of the target text sentence;
[0160] Pooling is performed on the sentence encoding features to obtain the sentence representation vector of the target text sentence;
[0161] Predicting the target text sentence based on the sentence representation vector to obtain a sentence prediction result, wherein the sentence prediction result is used to indicate that the target text sentence is a topic starting sentence, or is used to indicate that the target text sentence is not a topic starting sentence;
[0162] Based on the sentence positions of the target text sentences 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 to:
[0164] Performing self-attention calculation on the text paragraph through a preset summary generation model to obtain a first attention calculation result, wherein the summary generation model includes a cross attention layer, a feedforward neural network, and a linear layer;
[0165] Performing attention calculation on the first attention calculation result based on the cross attention layer to obtain a second attention calculation result;
[0166] Based on the feedforward neural network, the second attention calculation result is processed forward to obtain the text attention hidden features;
[0167] Perform feature mapping on the text attention latent features based on the linear layer to obtain text mapping features;
[0168] Feature decoding is performed on the text mapping features to obtain the target summary.
[0169] In some embodiments, the question generation unit 804 is used to:
[0170] Generate questions for dialogue replies based on the dialogue generation model to obtain preliminary questions corresponding to the dialogue replies;
[0171] Perform content repair on the preliminary question to obtain the target question.
[0172] In some embodiments, the data enhancement unit 806 is used to:
[0173] Performing noise processing on the preliminary conversation data to obtain noisy conversation data;
[0174] Performing paraphrase processing on the preliminary dialogue data to obtain paraphrase dialogue data;
[0175] The noise conversation data and the transcribed conversation data are integrated to obtain the target conversation data.
[0176] In some embodiments, the data enhancement unit 806 is used to:
[0177] Determine a target word in the preliminary conversation data, and replace the target word in the preliminary conversation data with a synonym to obtain replacement conversation data;
[0178] Adjusting the word order of the dialogue sentences in the preliminary dialogue data to obtain adjusted dialogue data;
[0179] The replacement conversation data and the adjusted conversation data are integrated to obtain the target conversation data.
[0180] In some embodiments, the data enhancement unit 806 is used to:
[0181] synthesizing the multiple dialogue segments in the preliminary dialogue data to obtain synthesized dialogue data;
[0182] Reorganizing the multiple dialogue segments in the preliminary dialogue data to obtain reorganized dialogue data;
[0183] The synthesized dialogue data and the reorganized dialogue data are integrated to obtain the target dialogue data.
[0184] The specific implementation of the conversation data generating device is substantially the same as the specific implementation of the conversation data generating method described above, and will not be described in detail herein.
[0185] The embodiment of the present application also provides an electronic device, the electronic device comprising: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, and the program is executed by the processor to realize the above-mentioned method for generating conversation data. The electronic device can be any intelligent terminal including a tablet computer, a vehicle-mounted computer, etc.
[0186] See also Fig. 9 , Fig. 9 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0187] The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an 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 the present application;
[0188] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the method for generating conversation data in the embodiment of this application;
[0189] Input / output interface 903, used to implement information input and output;
[0190] Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WI FI, Bluetooth, etc.);
[0191] A bus 905 that transmits information between the various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904);
[0192] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .
[0193] The embodiment of the present application also provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the above-mentioned conversation data generation method.
[0194] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0195] The dialogue data generation method, dialogue data generation device, electronic device and computer-readable storage medium provided by the embodiment of the present application obtain a target text with financial field knowledge and perform text segmentation on the target text to obtain multiple text paragraphs. It enables fine-grained dialogue data generation based on text paragraphs and makes full use of the target text. Further, for each text paragraph, a summary generation model is used to generate a summary of the text paragraph to obtain a target summary of the text paragraph, and the target summary is determined as a dialogue reply. The target summary can be used to summarize the paragraph information of each text paragraph, making the dialogue reply more refined. Since the semantic information of the text paragraph is captured by the self-attention layer, the cross-attention layer and the feedforward neural network of the summary generation model, the semantic information of the text paragraph can be deeply mined layer by layer, so that the target summary finally generated has relatively complete paragraph content information, which is conducive to improving the accuracy of summary generation of the text paragraph; then, the dialogue reply is generated by the preset dialogue generation model to generate questions, and the target question corresponding to the dialogue reply is obtained. In the generation of dialogue data, a strategy based on answer generation questions is used, which can achieve 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 enhancement is performed on the preliminary dialogue data to obtain target dialogue data. The dialogue data is used as sample data to train the preset interactive dialogue model. After generating preliminary dialogue data in the form of question-answer pairs based on the target text, the number of target dialogue data can be effectively expanded by using data enhancement methods such as data expansion, data transformation, and data synthesis. This method realizes the automatic generation of dialogue data for a fixed field (financial field), can reduce the construction and development costs of dialogue data, and is conducive to efficiently and quickly expanding 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 the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0197] It can be understood by those skilled in the art that Figure 1-7 The technical solutions shown in the figure do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than those shown in the figure, or a combination of certain steps, or different steps.
[0198] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0199] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0200] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0201] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0202] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0203] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0204] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0205] If the integrated unit is implemented in the form of 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 the present application is essentially 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, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0206] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A method for generating conversation data, characterized in that: The dialogue data generating method comprises: Acquire target text with financial domain knowledge; Performing text segmentation on the target text to obtain multiple text paragraphs; For each of the text paragraphs, a summary is generated for the text paragraph to obtain a target summary of the text paragraph, and the target summary is determined as a dialogue response; Generate a question for the dialogue response using a preset dialogue generation model to obtain a target question corresponding to the dialogue response; constructing preliminary dialogue data based on the dialogue responses and the target question; The preliminary dialogue data is data enhanced to obtain target dialogue data, wherein the dialogue data is used as sample data to train a preset interactive dialogue model.
2. The method according to claim 1, characterized in that The target text is segmented to obtain a plurality of text paragraphs, including: Segmenting the target text to obtain a plurality of target text sentences; Encoding the target text sentence based on a preset text encoder to obtain a sentence encoding feature of the target text sentence; Performing pooling processing on the sentence encoding features to obtain a sentence representation vector of the target text sentence; Performing prediction processing on the target text sentence based on the sentence representation vector to obtain a sentence prediction result, wherein the sentence prediction result is used to indicate that the target text sentence is a topic starting sentence, or is used to indicate that the target text sentence is not a topic starting sentence; Based on the sentence positions of the target text sentences in the target text and the sentence prediction results, the multiple target text sentences are aggregated to obtain the multiple text paragraphs.
3. The method according to claim 1, characterized in that: For each of the text paragraphs, generating a summary of the text paragraph to obtain a target summary of the text paragraph includes: Performing self-attention calculation on the text paragraph through a preset summary generation model to obtain a first attention calculation result, wherein the summary generation model includes a cross attention layer, a feedforward neural network, and a linear layer; Performing attention calculation on the first attention calculation result based on the cross attention layer to obtain a second attention calculation result; Performing feedforward processing on the second attention calculation result based on the feedforward neural network to obtain text attention latent features; Performing feature mapping on the text attention latent feature based on the linear layer to obtain a text mapping feature; Feature decoding is performed on the text mapping feature to obtain the target summary.
4. The method according to claim 1, characterized in that: The step of generating a question for the dialogue response by using a preset dialogue generation model to obtain a target question corresponding to the dialogue response includes: Generating questions for the dialogue responses based on the dialogue generation model to obtain preliminary questions corresponding to the dialogue responses; The preliminary question is repaired to obtain the target question.
5. The method according to claim 1, characterized in that The performing data enhancement on the preliminary dialogue data to obtain target dialogue data includes: Performing noise processing on the preliminary dialogue data to obtain noise dialogue data; Performing a paraphrase process on the preliminary dialogue data to obtain paraphrase dialogue data; The noise conversation data and the reported conversation data are integrated to obtain the target conversation data.
6. The method according to claim 1, characterized in that The performing data enhancement on the preliminary dialogue data to obtain target dialogue data includes: Determining a target word in the preliminary dialogue data, and performing synonym replacement on the target word in the preliminary dialogue data to obtain replacement dialogue data; Adjusting the word order of the dialogue sentences in the preliminary dialogue data to obtain adjusted dialogue data; The replacement conversation data and the adjusted conversation data are integrated to obtain the target conversation data.
7. The method according to any one of claims 1 to 6, characterized in that: The performing data enhancement on the preliminary dialogue data to obtain target dialogue data includes: Performing synthesis processing on the multiple dialogue segments in the preliminary dialogue data to obtain synthesized dialogue data; Reorganizing the multiple dialogue segments in the preliminary dialogue data to obtain reorganized dialogue data; The synthesized dialogue data and the reorganized dialogue data are integrated to obtain the target dialogue data.
8. A conversation data generating device, characterized in that: The dialogue data generating device comprises: An acquisition unit, used for acquiring a target text having financial domain knowledge; A segmentation unit, used to segment the target text to obtain multiple text paragraphs; A summary generating unit, configured to generate a summary for each of the text paragraphs, obtain a target summary for the text paragraph, and determine the target summary as a dialogue reply; A question generation unit, configured to generate a question for the dialogue response by using a preset dialogue generation model to obtain a target question corresponding to the dialogue response; A construction unit, configured to construct preliminary dialogue data based on the dialogue response and the target question; A data enhancement unit is used to perform data enhancement on 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.
9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the conversation data generation method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for generating conversation data according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Dialogue text generation method and device, electronic equipment and storage medium
CN114091475A
Man-machine conversation generation method and system based on mixed attention and medium
CN114996431A
Intelligent question and answer method and device, word list creating method and device, equipment and medium
CN118035412A
Cited By
Dialogue reply method and device based on multiple modes, electronic equipment and medium
CN120596658A
Multimodal-based dialogue reply method and device, electronic device and medium
CN120596658B
