Method for synthesizing multi-round dialogue data in specific field

Through the methods of data set embedding, adversarial learning and rule cleaning, the problems of high data repetition and insufficient diversity in data synthesis are solved. The generated multi-round dialogue data sets show high consistency and professionalism in specific fields, and are suitable for Intelligent customer service system.

CN119311796APending Publication Date: 2025-01-14SOUTHEAST INST OF INFORMATION TECH BEIJING UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411264439.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

When generating high-quality multi-round dialogue data in specific fields, existing data synthesis technology has problems such as high data repetition, insufficient diversity and large dependence on real data, and it is difficult to ensure the appropriate similarity and consistency between synthetic data and real data.

Method used

Through data set embedding and dimensionality reduction, a training data set for dialogue synthesizer is constructed, a dialogue data synthesizer is trained using adversarial learning, and cleaned and filtered based on rules. Semantic nearest neighbor data is used as output labels, and the anchor points are gradually moved to generate data. Data generated by the big model evaluation.

Benefits of technology

It significantly improves the quality and consistency of generated data, reduces dependence on large amounts of real data, improves the professionalism and adaptability of the model in specific fields, and the generated data sets meet the requirements in terms of quantity and quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119311796A_ABST
    Figure CN119311796A_ABST
Patent Text Reader

Abstract

The invention provides a method for synthesizing multi-round dialogue data in a specific field. The method comprises the steps of 1, performing data set embedding and dimension reduction; the data set in the text form is converted into a high-dimensional feature vector form, dimensionality reduction is carried out, and the data set is converted into a two-dimensional vector form; 2, constructing a training data set of the dialogue synthesizer; 3, training a dialogue data synthesizer by using adversarial learning; 4, synthesizing a data set of a specific field by using a dialogue synthesizer; and 5, cleaning and screening the synthesized data based on rules. The method provided by the invention fills the gap of dialogue data in a specific field, enhances the professional ability of the model in the specific field, and reduces the cost of data synthesis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data synthesis, and in particular to a method for synthesizing multi-round conversation data in a specific domain. Background Art

[0002] With the rapid development of artificial intelligence and natural language processing technologies, intelligent customer service systems have been widely applied in an increasing number of fields. However, conversational data in certain specific domains is relatively scarce. This is especially true for conversations involving specialized knowledge. This lack of data often makes it difficult to train highly specialized customer service systems. Collecting and annotating conversational data in these domains not only consumes significant resources and time, but also presents challenges in protecting data privacy. These factors mean that existing intelligent customer service systems still need to improve their response capabilities and accuracy when handling specialized inquiries in specific domains. Therefore, efficiently generating high-quality conversational datasets in specific domains through data synthesis technology has become a pressing issue.

[0003] Data synthesis technology aims to compensate for data shortages by using advanced models to generate datasets that closely resemble real conversations. With the continuous improvement of large-scale model capabilities, using prompts to guide models to generate high-quality conversation datasets has become a mainstream approach and has gained widespread acceptance. Data synthesis technology not only improves the efficiency and cost-effectiveness of data generation but also provides strong support for the expertise and coverage of intelligent customer service systems in specific areas. This process not only significantly reduces the cost of manual annotation but also enables the rapid generation of high-quality datasets, meeting the expertise and diversity requirements of intelligent customer service systems.

[0004] However, while current data synthesis techniques excel in many areas, they still have many limitations. First, the quality of generated data is sometimes difficult to control stably. Especially when dealing with highly specialized conversations, the generative model may not be able to accurately understand and simulate the complex semantics and background knowledge within the domain. Second, the generated datasets may lack consistency and contextual coherence, affecting the performance of intelligent customer service systems in practical applications. At the same time, the contextual learning technology (ICL) widely used in the synthesis process requires a large amount of real data as examples. Therefore, it is necessary to construct a seed dataset composed of real data in advance. However, in practical applications, it is difficult to construct such a seed dataset.

[0005] Therefore, the following problems need to be solved during the synthesis process:

[0006] 1. How can we reduce the amount of data in the seed dataset for data synthesis? ICL technology uses one or more target examples as input to allow the model to create based on the characteristics of the examples. The quality and diversity of these examples will directly affect the quality of the synthesized dataset. Therefore, it is necessary to continuously change the input examples to improve the diversity of the data synthesized each time. This requires preparing a seed dataset consisting of a sufficient number of examples before synthesis. The seed dataset is much smaller than the complete dataset, usually only a few hundred items are needed. However, in some specific fields, even collecting a few hundred items of data is very difficult, so this is a key issue facing data synthesis in practical applications.

[0007] 2. How to ensure the diversity of data synthesis? Currently, controlling the diversity of data synthesis often involves adjusting the generation parameters to make the data generated by the model more creative. However, this approach also has strong limitations. For example, in order to achieve better results, it is necessary to use a closed-source commercial large model for synthesis. Even so, the synthetic data will still be very similar to the example data in terms of scenarios. Especially as the scale of synthetic data increases, the differences between data will become smaller and smaller. Therefore, in these cases, maintaining diversity while maintaining data scale is a difficult task.

[0008] 3. How to ensure the appropriate similarity between synthetic data and real data? The purpose of data synthesis is to synthesize data that is similar to real data, that is, similar in core semantics or core language features, but different in overall semantics or language vocabulary. The balance between similarity and dissimilarity is difficult to quantify. If the similarity is too great, the synthetic data will not be distinguishable from the example data (for example, only a few words have been changed). If the dissimilarity is too great, the effect of the synthetic data will not meet expectations (for example, if the example data is about the financial field, it represents the data of the corresponding field, but the synthetic data is about the catering field). Therefore, how to balance the similarity between synthetic data and example data during the synthesis process is a very big challenge that needs to be faced. Summary of the Invention

[0009] This application provides a method for synthesizing multi-round conversation data in a specific field, which can be used to solve the technical problem of high repetitiveness of synthesized data in the existing technology.

[0010] The present application provides a method for synthesizing multi-round dialogue data in a specific domain, the method comprising:

[0011] Step 1: Embed the data set and perform dimensionality reduction; convert the text data set into a high-dimensional feature vector form, and perform dimensionality reduction to convert it into a two-dimensional vector form;

[0012] Step 2: Build a training dataset for the dialogue synthesizer;

[0013] Step 3: Use adversarial learning to train the dialogue data synthesizer;

[0014] Step 4: Use a dialogue synthesizer to synthesize domain-specific datasets;

[0015] Step 5: Clean and filter the synthetic data based on rules.

[0016] Furthermore, step 1, embedding the dataset and performing dimensionality reduction, includes:

[0017] Step 1.1: Use the BERT pre-trained model to embed the dataset. Each text segment is used as the input of BERT. Then, the high-dimensional feature vector output from the last layer of BERT is used to construct a new vector dataset.

[0018] Step 1.2: Use the t-SNE algorithm to convert the high-dimensional features of the vector dataset into a two-dimensional vector distribution;

[0019] Furthermore, in step 2, a training dataset for the dialogue synthesizer is constructed, including:

[0020] Step 2.1: Define the prompt template for the dialogue synthesizer. The prompt template is designed as follows:

[0021] You are a professional conversation data synthesis expert who can imitate the characteristics of a given example conversation and create new similar conversations. The example is as follows:

[0022] Example: [Example]

[0023] Number: [number]

[0024] The "[]" represents a placeholder. The role of the number is to increase the variation of the input string under the condition of fixed examples, so that the model can realize that different numbers correspond to different target synthetic data. The number is a string, and the characters in the string are not repeated;

[0025] Step 2.2, use a point on the edge of the two-dimensional vector distribution space as the initial synthesis anchor point;

[0026] Step 2.3: The 300 data points closest to the initialized synthetic anchor point are selected as the corresponding cluster members;

[0027] In step 2.4, the initial synthetic anchor point is used as the input example, and a cluster member is randomly selected as the target output data, which is filled into the prompt template to form a training data into the training dataset;

[0028] In step 2.5, after all corresponding cluster members have been used as output data, the initial synthetic anchor point is moved forward, and the cluster member with the farthest distance is used as the new synthetic anchor point. Steps 2.3 to 2.5 are repeated until all data points have been used to obtain a complete training data set.

[0029] Furthermore, step three uses adversarial learning to train a dialogue data synthesizer, including:

[0030] Step 3.1, initialize the conversation synthesizer weights using Llama38B;

[0031] Step 3.2, use Llama38B to initialize the discriminator weights;

[0032] Step 3.3: Freeze the discriminator weights and train the dialogue synthesizer using the dataset obtained in step 2.

[0033] Step 3.4: Freeze the dialogue synthesizer weights and train the discriminator.

[0034] Step 3.5: Repeat steps 3.3 to 3.4 until convergence.

[0035] Furthermore, in step 4, a domain-specific dataset is synthesized using a dialogue synthesizer, including:

[0036] Step 4.1: Collect 10 real multi-round dialogue data in the target domain as seed data; the number of dialogue rounds ranges from 5 to 20;

[0037] Step 4.2: Given the synthesized instruction template, we sequentially fill the seed data into the template examples. Each seed data corresponds to 1000 identical inputs.

[0038] In step 4.3, these 10,000 inputs are fed into the dialogue synthesizer for synthesis, generating a total of 10,000 synthetic data.

[0039] Furthermore, step five is to clean and filter the synthetic data based on rules, including:

[0040] Step 5.1: Filter out duplicate data: Determine whether the last reply in the data has appeared in the previous text. If so, it is duplicate data and is filtered out.

[0041] Step 5.2: Filter out duplicate or similar data in the dataset by determining whether each piece of data appears uniquely in the dataset. If not, filter it out.

[0042] Step 5.3: Use a large model such as GPT-4 to evaluate each piece of data and retain the data with high evaluation;

[0043] In step 5.4, the retained data is used to form the final synthetic dataset.

[0044] This application has the following effects:

[0045] The innovative use of semantically neighboring data as output labels enhances the potential of anchor synthesis and extrapolation. This approach makes the synthesized data semantically closer to the target domain, ensuring that the generated dataset not only meets the requirements in terms of quantity but also has high consistency and stability in terms of quality.

[0046] Innovative data synthesis technology empowers the model with specialized application capabilities. This innovation enables the model to demonstrate strong expertise in specific fields, significantly reducing its reliance on large amounts of real-world data and improving its effectiveness and adaptability in practical applications.

[0047] We innovatively propose a process of simulating data synthesis by using the flow extrapolation of anchor points. By gradually moving the anchor points and generating corresponding data at each step, this method effectively optimizes the data synthesis process, making the synthesis process more flexible and accurate, and capable of generating high-quality dialogue datasets in a variety of scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 A flowchart provided for an embodiment of the present application. DETAILED DESCRIPTION

[0049] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0050] Before describing the method of this application in detail, the following are the implications of this application:

[0051] Definition 1: A dataset is a collection of data in various forms, such as text data, image data, and vector data.

[0052] Definition 2: A pretrained model refers to a machine learning model that has been pretrained on a large dataset. These models can capture complex patterns and features in the data by learning the underlying structure and semantic information of the data. Pretrained models typically use unsupervised or self-supervised learning methods to build general representations by training on large amounts of unlabeled data. These general representations can be used as initial weights for downstream tasks, making the model perform better on specific tasks.

[0053] Definition 3: BERT is a pre-trained language model based on the Transformer architecture. It uses a bidirectional encoder to learn the meaning of words in context. That is, when encoding each word, BERT considers not only the context before the word but also the context after it. This is different from traditional unidirectional language models and makes BERT excellent at understanding complex semantic relationships. In this application, it is used to obtain high-dimensional feature vectors of text.

[0054] Definition 4: t-SNE algorithm, a nonlinear algorithm for dimensionality reduction of high-dimensional data, is usually used to embed high-dimensional data into two-dimensional or three-dimensional space for easy visualization and analysis;

[0055] Definition 5: In the field of natural language processing, a prompt is a piece of text or sentence input to a language model, intended to guide the model to generate output related to the input or complete a specific task. Prompts are typically used as an interface for interacting with pre-trained language models. By designing appropriate prompts, users can control the model's behavior and achieve desired results.

[0056] Definition 6: A synthesis anchor point refers to a key reference point or central point selected during the data synthesis process, which guides the entire data generation process. The synthesis anchor point usually serves as the starting point or core of data generation. The surrounding data points are generated or adjusted based on the characteristics of the anchor point to ensure that the generated data maintains semantic or feature consistency with the anchor point.

[0057] Definition 7: In cluster analysis, cluster members refer to data points or objects that are classified as belonging to the same cluster based on a similarity metric. These cluster members typically have high similarity within a specific feature space, that is, they exhibit similar characteristics or attributes in a specific dimension or multiple dimensions, thereby being recognized by the clustering algorithm and classified as the same group.

[0058] Definition 8: Input examples refer to data used as reference examples in contextual learning. These input examples usually consist of raw data in a specific format. The model learns features based on these examples and outputs content with the same characteristics as the examples.

[0059] Definition 9: Adversarial learning uses two models: a generator and a discriminator, as adversaries, to improve data generation and classification capabilities through adversarial training. In adversarial learning, the generator's task is to generate fake data that looks real, while the discriminator's task is to distinguish between this fake data and real data. The generator attempts to deceive the discriminator, making it unable to distinguish between generated data and real data, while the discriminator continuously improves its discriminative ability. Through this adversarial training, the generator gradually generates more and more realistic data, while the discriminator becomes more sensitive and accurate.

[0060] Definition 10: Llama3, an advanced pre-trained model weights, uses an extended Transformer architecture and is widely used in natural language processing tasks such as text generation, question answering systems, and conversational agents;

[0061] Definition 11: Seed data refers to a small amount of high-quality data used as a foundation or starting point in the initial stages of data generation or model training. This data is typically rigorously screened and labeled to ensure high representativeness and reliability. Seed data plays a crucial role in data augmentation, generating synthetic data, or guiding model learning.

[0062] Step 1: Embed the dataset and perform dimensionality reduction. Convert the text dataset into a high-dimensional feature vector, perform dimensionality reduction to retain the main features, and convert it into a two-dimensional vector. The specific steps are as follows:

[0063] Step 1.1: Use the BERT pre-trained model to embed the dataset. Each text segment is used as the input of BERT. Then, the high-dimensional feature vector output from the last layer of BERT is used to construct a new vector dataset.

[0064] The dataset is as described in Definition 1; BERT is as described in Definition 3; the pre-trained model is as described in Definition 2;

[0065] Step 1.2: Use the t-SNE algorithm to convert the high-dimensional features of the vector dataset into a two-dimensional vector distribution;

[0066] The t-SNE algorithm is as described in Definition 4;

[0067] Step 2: Build a training dataset for the dialogue synthesizer. The specific steps are as follows:

[0068] Step 2.1: Define the prompt template for the dialogue synthesizer. The prompt template is designed as follows:

[0069] You are a professional conversation data synthesis expert who can imitate the characteristics of a given example conversation and create new similar conversations. The example is as follows:

[0070] Example: [Example]

[0071] Number: [number]

[0072] The "[]" represents a placeholder. The role of the number is to increase the variation of the input string under the condition of fixed examples, so that the model can realize that different numbers correspond to different target synthetic data. The number is a string, and the characters in the string are not repeated;

[0073] Wherein, the prompt is as described in Definition 5;

[0074] Step 2.2, use a point on the edge of the two-dimensional vector distribution space as the initial synthesis anchor point;

[0075] Wherein, the synthetic anchor point is as described in Definition 6;

[0076] Step 2.3: The 300 data points closest to the initialized synthetic anchor point are selected as the corresponding cluster members;

[0077] Wherein, cluster members are as described in Definition 7;

[0078] In step 2.4, the initial synthetic anchor point is used as the input example, and a cluster member is randomly selected as the target output data, which is filled into the prompt template to form a training data into the training dataset;

[0079] Wherein, the input example is as described in Definition 8;

[0080] In step 2.5, after all corresponding cluster members have been used as output data, the initial synthetic anchor point is moved forward, and the cluster member with the farthest distance is used as the new synthetic anchor point. Steps 2.3 to 2.5 are repeated until all data points have been used, and a complete training dataset is obtained.

[0081] Step 3: Use adversarial learning to train the dialogue data synthesizer;

[0082] Wherein, adversarial learning is as described in Definition 9;

[0083] Step 3.1, initialize the conversation synthesizer weights using Llama38B;

[0084] Wherein, Llama3 is as described in Definition 10;

[0085] Step 3.2, use Llama38B to initialize the discriminator weights;

[0086] Step 3.3: Freeze the discriminator weights and train the dialogue synthesizer using the dataset obtained in step 2.

[0087] Step 3.4: Freeze the dialogue synthesizer weights and train the discriminator.

[0088] Step 3.5: Repeat steps 3.3 to 3.4 until convergence;

[0089] Step 4: Use the dialogue synthesizer to synthesize domain-specific datasets. Specifically:

[0090] In step 4.1, collect 10 real multi-turn conversations in the target domain as seed data. This data should demonstrate the domain expertise and contrast with everyday conversations. For example, conversations in the financial sector should include a large amount of finance-specific vocabulary and communication techniques. Also, select conversations with a moderate number of turns, ranging from 5 to 20.

[0091] Wherein, the seed data is as described in Definition 11;

[0092] Step 4.2: Given the synthesized instruction template, we sequentially fill the seed data into the template examples. Each seed data corresponds to 1000 identical inputs.

[0093] In step 4.3, these 10,000 inputs are fed into the dialogue synthesizer for synthesis, generating a total of 10,000 synthetic data.

[0094] Step 5: Clean and filter the synthetic data based on rules, specifically:

[0095] Step 5.1: Filter out duplicate data: The data generated by the model may contain some repetitive sentences, such as the same reply. This is done by determining whether the last reply in the data has appeared in the previous text. If so, it is considered duplicate data and is filtered out.

[0096] Step 5.2: Filter out duplicate or similar data in the dataset to ensure the uniqueness of each piece of data in the synthetic dataset. This is done by determining whether each piece of data appears only once in the dataset. If it is not unique, it is filtered out.

[0097] Step 5.3: Use a large model such as GPT-4 to evaluate each piece of data and retain the data with high evaluation;

[0098] In step 5.4, the retained data is used to form the final synthetic dataset.

[0099] The method provided by this application is further described below with reference to specific embodiments:

[0100] We selected the financial field as the target field and synthesized a multi-round dialogue dataset for training bank intelligent customer service:

[0101] Dataset preparation: We selected the public conversation dataset CPED, filtered out conversations with less than 5 rounds, and randomly selected 3,000 data points as training data.

[0102] Dataset embedding and dimensionality reduction. The collected conversation data is embedded using the BERT pre-trained model and converted into high-dimensional feature vectors. The t-SNE algorithm is used to reduce the dimensionality of these high-dimensional feature vectors and convert them into two-dimensional vector distributions for easier processing.

[0103] Construct a training dataset. Select edge points from a two-dimensional vector distribution as synthetic anchor points, which serve as training data input examples. Determine the cluster members surrounding the synthetic anchor points, which serve as training data output. Continue to flow through the anchor points until all data points have been used at least once. A total of 10 anchor points were selected, with an average of 297 cluster member data points per anchor point. Fill the prompt template with the synthetic anchor points and cluster members, generating a training dataset with a total of 4473 data points.

[0104] Adversarial learning training. Use the Llama38B pre-trained model to initialize the weights of the dialogue synthesizer and discriminator. Using adversarial learning, alternately train the dialogue synthesizer and discriminator for 10 rounds until the model converges.

[0105] Synthesize a financial dataset. We selected ten most frequently asked questions from bank customer service inquiries and collected 10 conversations, each with an average duration of 10 rounds, as seed data through interactions with existing bank intelligent customer service agents. This seed data was then used to populate examples in the synthesis instruction template, with each example corresponding to 1,000 unique numbers, for a total of 10,000 model input texts. Using the trained dialogue synthesizer, we synthesized 10,000 multi-round conversations from the bank intelligent customer service domain based on this input data.

[0106] Data cleaning and filtering. Filter out duplicates in the synthesized data to ensure data uniqueness. Use rules to filter data to ensure the quality of the synthesized data and remove low-quality data. The following are examples of duplicates within a conversation:

[0107] User: Hello, I would like to know how to activate advanced trading permissions in my account?

[0108] Customer Service: Hello, to activate advanced trading privileges, you must meet certain account balance requirements and pass identity verification. Please confirm that your account balance meets the requirements, and then we will guide you through the identity verification process.

[0109] User: I have completed identity verification, what should I do next?

[0110] Customer Service: Your identity verification has been submitted for review. The review usually takes 1-2 working days. Please be patient.

[0111] User: I have completed identity verification, what should I do next?

[0112] Customer Service: Your identity verification has been submitted for review. The review usually takes 1-2 working days. Please be patient.

[0113] User: I have completed identity verification, what should I do next?

[0114] Customer Service: Your identity verification has been submitted for review. The review usually takes 1-2 working days. Please be patient.

[0115] Finally, a total of 7,239 multi-round conversation data were generated.

[0116] Verification and evaluation. We performed a quality assessment on the synthetic dataset, using GPT-4 to perform a multi-dimensional evaluation of each piece of data. The following prompts were used:

[0117] You are a professional data evaluator tasked with evaluating the quality of a given synthetic data set. Please conduct a comprehensive evaluation of the synthetic data based on the following four dimensions and assign a score to each dimension.

[0118] 1. Coherence:

[0119] Description: Evaluate the coherence and logic of the synthesized data. Coherence refers to whether the data is logical, semantically and structurally consistent, and free of irrelevant or contradictory information.

[0120] Scoring criteria:

[0121] 10 points: The data is completely coherent in content and logic, without any unreasonable jumps or contradictions.

[0122] 7-9 points: The data is mostly coherent, but there are a few logical jumps or minor inconsistencies.

[0123] 4-6 points: The data is not coherent enough, with multiple logical inconsistencies or content jumps.

[0124] 1-3 points: The data is highly incoherent, the logic is confusing, and it is impossible to form a reasonable semantic structure.

[0125] Please rate the coherence of the synthesized data and explain your rating.

[0126] 2. Fluency:

[0127] Description: Evaluate the fluency of the language expression of the synthesized data. Fluency refers to whether the language of the data is natural, the expression is smooth, and whether it conforms to common language usage habits.

[0128] Scoring criteria:

[0129] 10 points: The language is very fluent and natural, without any awkwardness or unreasonableness.

[0130] 7-9 points: The language expression is mostly fluent and natural, with only a few awkward or awkward parts.

[0131] 4-6 points: There are many unnatural or awkward parts in the language expression, and the fluency is average.

[0132] 1-3 points: The language expression is very stiff, lacks fluency, and the overall language quality is low.

[0133] Please rate the fluency of the synthesized data and explain your rating.

[0134] Diversity:

[0135] Description: Evaluate the diversity of content and expression of synthetic data. Diversity refers to whether the data covers a variety of different content, topics, or expressions, rather than repetitive or single content.

[0136] Scoring criteria:

[0137] 10 points: The data content and expression are very rich and diverse.

[0138] 7-9 points: Most of the data has some diversity in content and expression, but there are some repeated or single parts.

[0139] 4-6 points: The diversity of data content and expression is low, with a lot of repetitive or single content.

[0140] 1-3 points: The data content and expression are very simple and lack diversity.

[0141] Please rate the diversity of the synthetic data and explain your rating.

[0142] Accuracy:

[0143] Description: Evaluate the accuracy of the information or content expressed in the synthesized data. Accuracy refers to whether the data content meets expectations, is consistent with the synthesis objectives, and does not contain erroneous or misleading information.

[0144] Scoring criteria:

[0145] 10 points: The data content is completely accurate and consistent with expectations, without any errors or misleading information.

[0146] 7-9 points: The data is mostly accurate, but there are a few minor errors or inconsistencies.

[0147] 4-6 points: The data contains multiple errors or inconsistencies, indicating low accuracy.

[0148] 1-3 points: The data content is seriously erroneous or misleading, and seriously inconsistent with expectations.

[0149] Please rate the accuracy of the synthesized data and explain your rating.

[0150] The following is the synthetic data you need to evaluate:

[0151] Synthesized data text

[0152] This application improves data generation quality and contextual consistency: By utilizing semantic neighbor data as output labels, the innovative method significantly improves the quality of data synthesis. The generated data exhibits greater consistency in semantics and context, reducing bias and errors in the generation process, making the synthesized data more credible and valuable for practical applications.

[0153] Enhanced model adaptability in specialized domains: This application enables the model to demonstrate stronger specialized capabilities in specific domains, enabling it to generate high-quality, specialized conversational data even with minimal real-world data. This enhanced adaptability enables the model to be effectively applied in more complex real-world scenarios, expanding the scope and effectiveness of intelligent systems.

[0154] Improving the accuracy and professionalism of intelligent system responses: Thanks to high-quality synthetic datasets, intelligent customer service systems and other application models can provide more accurate and professional responses to specialized domain questions. This technical effect greatly enhances the user experience and makes the performance of intelligent systems more satisfactory in real-world scenarios.

[0155] The above-described embodiments of the present application do not constitute a limitation on the scope of protection of the present application.

Claims

1. A method for synthesizing multi-turn dialogue data in a specific domain, characterized in that: The method comprises: Step 1: embed the data set and reduce the dimension; convert the text data set into a high-dimensional feature vector form, and reduce the dimension to convert it into a two-dimensional vector form; Step 2: Build a training dataset for the dialogue synthesizer; Step 3: Use adversarial learning to train the dialogue data synthesizer; Step 4: Use a dialogue synthesizer to synthesize domain-specific datasets; Step 5: Clean and filter the synthetic data based on rules.

2. The method according to claim 1, characterized in that Step 1: Embed the data set and reduce the dimension, including: Step 1.1: Use the BERT pre-trained model to embed the dataset. Each text segment is used as the input of BERT. Then, the high-dimensional feature vector output from the last layer of BERT is used to form a new vector dataset. Step 1.2: Use the t-SNE algorithm to convert the high-dimensional features of the vector data set into a two-dimensional vector distribution;.

3. The method according to claim 1, characterized in that Step 2: Build a training dataset for the dialogue synthesizer, including: Step 2.1, define the prompt template of the dialogue synthesizer; the prompt template is designed as follows: You are a professional dialogue data synthesis expert who can imitate the characteristics of a given sample dialogue and create new similar dialogues. The examples are as follows: Example: [Example] Number: [number] "[]" represents a placeholder. The role of the number is to increase the variation of the input string in the case of a fixed example, so that the model can realize that different numbers correspond to different target synthetic data. The number is a string, and the characters in the string are not repeated; Step 2.2, using a certain point on the edge of the two-dimensional vector distribution space as an initial synthesis anchor point; Step 2.3, take the 300 data points closest to the initialized synthetic anchor point as the corresponding cluster members; Step 2.4: take the initial synthetic anchor point as the input example, randomly select a cluster member as the target output data, fill it into the prompt template, and form a training data into the training data set; In step 2.5, when all corresponding cluster members are used as output data, move the initial synthetic anchor point forward, use the cluster member with the farthest distance as the new synthetic anchor point, and repeat steps 2.3 to 2.5 until all data points have been used to obtain a complete training data set.

4. The method according to claim 1, characterized in that: Step 3: Use adversarial learning to train the dialogue data synthesizer, including: Step 3.1, initialize the dialogue synthesizer weights using Llama38B; Step 3.2, use Llama38B to initialize the discriminator weights; Step 3.3, freeze the discriminator weights and use the data set obtained in step 2 to train the dialogue synthesizer; Step 3.4, freeze the dialogue synthesizer weights and train the discriminator; Step 3.5: Repeat steps 3.3 to 3.4 until convergence.

5. The method according to claim 1, characterized in that Step 4: Use the dialogue synthesizer to synthesize domain-specific datasets, including: Step 4.1: Collect 10 real multi-round dialogue data in the target domain as seed data; the number of dialogue rounds ranges from 5 to 20; Step 4.2, given the synthesized instruction template, we fill the seed data into the template examples one by one, and each seed data corresponds to 1000 identical inputs; Step 4.3, send the total of 10,000 inputs to the dialogue synthesizer for synthesis, and generate a total of 10,000 synthetic data;.

6. The method according to claim 1, characterized in that Step 5: Clean and filter the synthetic data based on rules, including: Step 5.1, filter out duplicate data: determine whether the last reply in the data has appeared in the previous text. If it has appeared, it is duplicate data and is filtered out; Step 5.2, filter out duplicate or similar data in the data set by determining whether the number of times each piece of data appears in the data set is unique. If it is not unique, filter it out; Step 5.3: Use a large model such as GPT-4 to evaluate each piece of data and retain the data with high evaluation; In step 5.4, the retained data constitutes the final synthetic dataset.