Sample data synthesis method and device, equipment and medium
By using preset large language models and generative adversarial networks to enhance the processing of sample data, the problem of insufficient quality and efficiency of sample data generation in the prior art is solved, and high-quality sample data synthesis is realized, which is suitable for artificial intelligence model training.
Patent Information
- Application Number
- CN202411828800.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-04-04
AI Technical Summary
The prior art is difficult to generate sample data with sufficient data volume and high quality, especially in artificial intelligence model training, resulting in high data collection costs, long time and legal risks.
By obtaining the original sample data of the target scenario and determining its topic type, the data is enhanced by using preset large language models and generative adversarial networks to generate high-quality synthetic samples.
Automatically synthesize high-quality synthetic samples that belong to the same topic as the original sample, avoiding the problem of deviation between the synthetic samples and the original sample, and improving the quality and efficiency of sample data generation.
Smart Images

Figure CN119761534A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of sample enhancement technology, and in particular to a sample data synthesis method, device, equipment and medium. Background Art
[0002] In the digital age, the training process of artificial intelligence models requires the use of massive amounts of data. Although the volume of Internet data has grown significantly, there are also some areas of data where there are serious problems in terms of the cost, time and feasibility of collecting sample data. Specifically, some sample data needs to be obtained through expensive sensors, which is both costly and time-consuming. Some sample data collection involves legal risks, such as data in the medical field.
[0003] Therefore, there is an urgent need for a method to generate sample data with sufficient volume and high quality to solve the problems of insufficient sample data volume and high collection cost for artificial intelligence models. Summary of the invention
[0004] In order to solve the above technical problems, the present disclosure provides a sample data synthesis method, device, equipment and medium.
[0005] In a first aspect, the present disclosure provides a sample data synthesis method, comprising:
[0006] Obtaining original sample data corresponding to a target scene, and determining a subject type of the target scene;
[0007] Using a preset large language model, performing data enhancement processing on the original sample data to generate first sample synthetic data;
[0008] Using a preset generative adversarial network, performing data enhancement processing on the first sample synthetic data according to the subject type to generate second sample synthetic data;
[0009] Based on the first sample synthesis data and the second sample synthesis data, a target synthesis sample corresponding to the target scene is obtained.
[0010] In a second aspect, the present disclosure provides a sample data synthesis device, comprising:
[0011] A sample acquisition module is used to acquire original sample data corresponding to a target scene and determine the subject type of the target scene;
[0012] A first generating module is used to perform data enhancement processing on the original sample data by using a preset large language model to generate first sample synthetic data;
[0013] A second generation module is used to use a preset generative adversarial network to perform data enhancement processing on the first sample synthetic data according to the topic type to generate second sample synthetic data;
[0014] The synthetic sample determination module is used to obtain a target synthetic sample corresponding to the target scene based on the first sample synthetic data and the second sample synthetic data.
[0015] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the device comprising:
[0016] one or more processors;
[0017] a storage device for storing one or more programs,
[0018] When one or more programs are executed by one or more processors, the one or more processors implement the method provided in the first aspect.
[0019] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, which implements the method provided in the first aspect when the computer program is executed by a processor.
[0020] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:
[0021] A sample data synthesis method, device, equipment and medium of the disclosed embodiment include: obtaining original sample data corresponding to a target scene and determining the theme type of the target scene; using a preset large language model to perform data enhancement processing on the original sample data to generate first sample synthetic data; using a preset generative adversarial network to perform data enhancement processing on the first sample synthetic data according to the theme type to generate second sample synthetic data; based on the first sample synthetic data and the second sample synthetic data, a target synthetic sample corresponding to the target scene is obtained. In this way, a preset large language model and a preset generative adversarial network are used to automatically synthesize a synthetic sample that belongs to the same theme type as the original sample, thereby avoiding the problem of deviation between the synthetic sample and the original sample and improving the quality and efficiency of synthetic sample generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0024] Figure 1 A schematic diagram of a flow chart of a sample data synthesis method provided in an embodiment of the present disclosure;
[0025] Figure 2 A flowchart of another sample data synthesis method provided by an embodiment of the present disclosure;
[0026] Figure 3 A schematic diagram of the structure of a generator provided in an embodiment of the present disclosure;
[0027] Figure 4 A schematic diagram of the structure of a sample data synthesis device provided by an embodiment of the present disclosure;
[0028] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0029] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0030] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0031] In the related art, the following methods are used to synthesize sample data. Different methods have their own problems of adaptability, which are specifically manifested as follows:
[0032] Method 1: Dictionary-based methods synthesize text, which uses a synonym dictionary to randomly increase the number of data points by inserting, replacing, deleting, and exchanging a word in a sentence. For example, the performance of the synonym dictionary method will degrade when the original data changes by more than 10%. For example, when synthesizing data for sentiment classification, such methods often show limitations in retaining sentiment information and even cause huge changes in the actual sentiment category.
[0033] Method 2: Synthesize text based on interpolation methods, usually example interpolation techniques, select two or more real examples, and then change the input and output labels, generate out-of-popular samples by linearly interpolating the input and corresponding labels of random sample pairs, or in the image field, replace small sub-regions to mix two selected example images, etc. However, this method constrains the possibility of sample combination, thereby limiting the diversity of synthetic samples.
[0034] Method 3: Context-based method, which translates based on the specified source language, intermediate language and target language, including translation methods from English to Chinese, and back translation methods from Chinese to English and then to Chinese, etc. However, this method still relies on existing data and it is difficult to obtain more diverse data.
[0035] Method 4: Synthesize text based on generative model technology, which can use early sequence to sequence (seq2seq) models and language models based on recurrent neural networks (RNNs). However, this method has problems such as repeated and circular generated text, and since each token generation step may make mistakes, it is easy to accumulate errors during the reasoning process, causing the model to gradually deviate from the training distribution.
[0036] It can be seen that the above methods have their own corresponding problems and are unable to generate sample data with sufficient volume and high quality.
[0037] In order to generate sample data with sufficient data volume and high quality, the following Figure 1-Figure 3 The sample data synthesis method provided in the embodiment of the present disclosure is described. In the embodiment of the present disclosure, the sample data synthesis method can be executed by an electronic device or a server. The electronic device may include a device with communication functions such as a tablet computer, a desktop computer, a laptop computer, etc., and may also include a device simulated by a virtual machine or a simulator. The server may be a cloud server or a server cluster. Below, the sample data synthesis method is specifically explained with the electronic device as the execution subject.
[0038] Figure 1 A flow chart of a sample data synthesis method provided by an embodiment of the present disclosure is shown.
[0039] like Figure 1 As shown, the sample data synthesis method may include the following steps.
[0040] S110: Acquire original sample data corresponding to the target scene, and determine the theme type of the target scene.
[0041] In this embodiment, when a large amount of sample data of a target scene needs to be synthesized, the electronic device first obtains original sample data with a small amount of data in the target scene, and at the same time, determines the theme type of the target scene, and enhances the original sample data with a small amount of data based on the theme type, thereby obtaining a large amount of sample data of the target scene.
[0042] The target scenario refers to the scenario to which the original sample data belongs, for example, medical scenario, financial scenario, construction scenario, etc.
[0043] The original sample data refers to data to be enhanced with a small amount of data. Optionally, the original sample data may be a discrete data set directly obtained from the target scene, or a clustered data set obtained by clustering the discrete data set directly obtained from the target scene.
[0044] For example, if the target scenario is a medical scenario, the original sample data is the patient's diagnosis case; if the target scenario is a financial scenario, the original sample data is the user's asset allocation case; if the target scenario is a construction scenario, the original sample data is the sales record of a real estate project.
[0045] The topic type refers to the description target of the original sample data in the target scenario. For example, if the target scenario is a medical scenario and the original sample data is the diagnosis case of the patient, these diagnosis cases include the case and the description of the case, the cause and the analysis of the cause, then the topic type can be the specific disease name.
[0046] S120: Using a preset large language model, perform data enhancement processing on the original sample data to generate first sample synthetic data.
[0047] In this embodiment, the electronic device pre-acquires an autoregressive language model as a preset large language model. When selecting the preset large language model, the electronic device configures appropriate evaluation indicators for it, and determines configuration parameters that achieve a better balance between the diversity and quality of the preset large language model based on these evaluation indicators, so that the preset large language model has a better sample synthesis capability.
[0048] Optionally, evaluation indicators of the preset large language model include terminology accuracy indicators (for comparison with professional dictionaries and knowledge bases), grammatical correctness indicators (using natural language processing spelling, punctuation and grammar checking tools), and continuity indicators (for manual evaluation).
[0049] Among them, the specific implementation method of S120 includes but is not limited to the following method: obtaining configuration parameters of a preset large language model; using the preset large language model, generating a synthetic text corresponding to the original sample data according to the configuration parameters as the first sample synthetic data.
[0050] In specific applications, when the original sample data is text, the configuration parameters include one or more of the following combinations: a temperature parameter for controlling the randomness of the generated text, a growth length parameter for defining the maximum length of the generated text, a sampling parameter for limiting the vocabulary selection in the generation process by truncating the distribution (also called top-p sampling), and a sampling parameter for retaining the k words with the highest probability for the next prediction (also called top-k sampling).
[0051] In this way, the original sample data is preliminarily enhanced using the preset large language model to obtain first sample synthetic data with a large data volume.
[0052] S130. Using a preset generative adversarial network, perform data enhancement processing on the first sample synthetic data according to the topic type to generate second sample synthetic data.
[0053] In order to retain the characteristics of the original sample data to a greater extent, the electronic device further performs enhancement processing on the first sample synthetic data in combination with the subject type to obtain second sample synthetic data that is consistent with the characteristics of the original sample data.
[0054] Specifically, the preset generative adversarial network consists of a generator and a discriminator, which compete with each other to achieve the purpose of generating high-quality simulation data. The generator can be further divided into an encoder and a decoder, which specifically generates synthetic data through encoding and decoding processes. The purpose of the discriminator is to distinguish between original data and synthetic data. Specifically, a BERT-based model can be used to maximize the distance between original data and synthetic data, and to determine the category of data by extracting and classifying features of the synthetic data generated by the generator and the original data.
[0055] Among them, in the training stage of the preset generative adversarial network, the loss functions adopted by the generator include reconstruction loss and category loss, and the generator and discriminator are iterated multiple times based on the loss function. In each iteration, the quality of the synthetic data generated by the generator gradually improves, and the discriminator's ability to distinguish between original data and synthetic data also gradually improves until an equilibrium state is reached, and the preset generative adversarial network is obtained.
[0056] S140: Obtain a target synthesis sample corresponding to the target scene based on the first sample synthesis data and the second sample synthesis data.
[0057] Specifically, the electronic device combines the generated first sample synthesis data and the second sample synthesis data to generate a target synthesis sample.
[0058] A sample data synthesis method of an embodiment of the present disclosure includes: obtaining original sample data corresponding to a target scene, and determining the theme type of the target scene; using a preset large language model, performing data enhancement processing on the original sample data to generate first sample synthetic data; using a preset generative adversarial network, performing data enhancement processing on the first sample synthetic data according to the theme type to generate second sample synthetic data; based on the first sample synthetic data and the second sample synthetic data, obtaining a target synthetic sample corresponding to the target scene. In this way, using the preset large language model and the preset generative adversarial network, a synthetic sample belonging to the same theme type as the original sample is automatically synthesized, avoiding the problem of deviation between the synthetic sample and the original sample, and improving the generation quality and efficiency of the synthetic sample.
[0059] In some embodiments, after executing S130, the method further includes: iteratively training the initial network of the target scene based on the target synthetic sample and the original sample data until the initial network meets the stop training condition, thereby obtaining a task processing model trained for the target scene.
[0060] After obtaining target synthetic samples with large data volume and high quality, the electronic device continues to use the target synthetic samples and original sample data to iteratively train the initial network of the target scene until the initial network meets the stop training condition under a certain number of training times, thereby obtaining a trained task processing model corresponding to the target scene.
[0061] In this way, target synthetic samples with large data volume and high quality are effectively applied to the corresponding scenarios for model training to improve the model accuracy of the task processing model of the scenario, thereby improving the task processing effect of the task processing model.
[0062] In order to verify the quality of the target synthetic samples, the original sample data and the target synthetic samples can be used to train the base classifier (such as the BERT model) respectively, and then the accuracy and robustness of the models trained with the two samples can be tested respectively to evaluate the quality of the target synthetic samples. In other cases, diversity evaluation methods (such as Self-BLEU) can also be used to evaluate the diversity of the target synthetic samples to ensure a balance between the diversity and fidelity of the target synthetic samples. In other cases, quality evaluation methods (such as BERTScore) can also be used to evaluate the quality of the target synthetic samples to ensure the similarity between the target synthetic samples and the original sample data.
[0063] In another embodiment of the present disclosure, a specific implementation process of the sample data synthesis method is explained in detail.
[0064] Figure 2 A schematic flow chart of another sample data synthesis method provided by an embodiment of the present disclosure is shown.
[0065] like Figure 2 As shown, the sample data synthesis method may include the following steps.
[0066] S210: Acquire original sample data corresponding to the target scene, and determine the theme type of the target scene.
[0067] The original sample data is clustered data of a theme type around the target scene, and the theme type includes multiple theme descriptors. Then, the specific implementation method of "obtaining the original sample data corresponding to the target scene" in S210 includes but is not limited to the following methods: obtaining a discrete data set of the target scene, wherein the discrete data set of the target scene includes note data corresponding to multiple theme descriptors respectively; clustering the note data corresponding to multiple theme descriptors respectively according to the theme type to obtain the original sample data corresponding to the target scene.
[0068] It is understandable that the same subject type in the target scene may include multiple subject descriptors, and the note data corresponding to different subject descriptors may be in a discrete distribution form. In order to increase the amount of original sample data, the electronic device may obtain note data corresponding to multiple subject descriptors in the same subject type, and then cluster these note data according to the subject type using methods such as unsupervised algorithms (e.g., t-SNE), and obtain clustered data of the subject type around the target scene as the original sample data.
[0069] Among them, the topic descriptor can be a subcategory of the topic type.
[0070] For example, the subject type is the name of the disease, and the subject descriptors include cases, descriptions, causes, and analysis. After clustering the note data corresponding to these subject descriptors, we can obtain cluster data around the name of the disease. The cluster data can be a diagnostic case, specifically including cases and case descriptions, causes, and analysis of the causes.
[0071] In this way, by clustering the note data corresponding to multiple topic description words under the same topic type, it is possible to integrate these note data, increase the data volume of the original sample data of the topic type, make the original sample data richer, and at the same time retain the characteristics of the original sample data.
[0072] S220: Using a preset large language model, perform data enhancement processing on the original sample data to generate first sample synthetic data.
[0073] Before executing S220, the method also includes: obtaining a prompt word template of the target scene; formatting the original sample data according to the prompt word template to generate an original template sample corresponding to the original sample data; and performing data enhancement processing on the original template sample using a preset large language model to generate first sample synthetic data.
[0074] Since the original sample data is obtained by clustering the note data corresponding to multiple topic descriptors under the same topic type, its expression method is not uniform, and this non-uniform expression method increases the difficulty of understanding by the preset large language model. In order to improve the understanding ability of the preset large language model, the electronic device can organize the format of the original sample data according to the prompt word template to obtain the original template sample, so that the preset large language model can better understand the original template sample to synthesize new sample data.
[0075] Among them, the prompt word template can be understood as a prompt word, which is used to provide a piece of input data to the preset large language model to guide the model to generate a specific type of output.
[0076] For example, the prompt word template is: You are a professional doctor. Based on the patient's {medical history} and {description} and your understanding of the {disease}, you provide a diagnosis of the patient to form a {medical note}. Please refer to the following example for the format: {Case 1}\n\n{Case 2}\n. The preset large language model generates the first sample synthetic data according to this prompt word template in the form of "{Case 1}\n\n{Case 2}\n".
[0077] In this way, using the prompt word template, the original sample data can be processed into a format that is easy for the model to understand, which is conducive to improving the model's processing ability for the original sample data, and further helps the model generate more balanced, more standardized, and larger data volume first sample synthetic data.
[0078] S230. Based on the generator of the preset generative adversarial network, data enhancement processing is performed on the preset topic type and the first sample synthetic data respectively to obtain the synthetic data to be selected.
[0079] Among them, the specific implementation method of S230 includes but is not limited to the following methods: based on the encoder in the generator, the preset topic type and the first sample synthetic data are encoded respectively to obtain encoding features that obey the preset prior distribution; based on the decoder in the generator, the encoding features that obey the preset prior distribution are decoded to obtain the synthetic data to be selected.
[0080] See also Figure 3The structural diagram of the generator shown in the figure, the encoder in the generator includes an encoding module, a category embedding module and a splicing module. Specifically, first, the electronic device inputs the first sample synthetic data into the encoding module to obtain the feature vector corresponding to the first sample synthetic data, and inputs the preset theme type into the category embedding module to obtain the feature vector corresponding to the preset theme type, and then uses the splicing module to splice the feature vector corresponding to the first sample synthetic data and the feature vector corresponding to the preset theme type according to the encoding features of the preset prior distribution to generate encoding features that obey the preset prior distribution; then, the electronic device inputs the encoding features that obey the preset prior distribution into the decoder to obtain the selected synthetic data.
[0081] Optionally, the generator can adopt a Transformer-based autoencoder structure, which can capture long-distance dependencies between data. The encoding module of the encoder in the generator can be a BERT encoder, and the decoder can be understood as a data generation module.
[0082] S240: Based on the discriminator of the preset generative adversarial network, perform category judgment on the selected synthetic data to obtain second sample synthetic data.
[0083] Among them, the specific implementation method of S240 includes but is not limited to the following methods: based on the feature extraction module in the discriminator, feature extraction is performed on the selected synthetic data to obtain the feature vector of the selected synthetic data; based on the classification module in the discriminator, classification processing is performed on the feature vector of the selected synthetic data to obtain the category corresponding to the selected synthetic data, and the selected synthetic data whose category is the synthetic category is used as the second sample synthetic data.
[0084] Optionally, the discriminator may adopt a BERT-based model, which determines the category of the candidate synthetic data by maximizing the distance between the original data and the synthetic data, and based on whether the category comes from the synthetic data or the original data.
[0085] In this way, the preset subject type and the first sample synthetic data are encoded, decoded, feature extracted and classified in sequence by using the generator and discriminator of the preset generative adversarial network, thereby improving the accuracy of the second sample synthetic data. At the same time, the purpose of low-cost and efficient batch generation of synthetic data is achieved.
[0086] S250: Obtain a target synthesis sample corresponding to the target scene based on the first sample synthesis data and the second sample synthesis data.
[0087] Among them, S250 is similar to S140 and will not be elaborated here.
[0088] The present disclosure also provides a sample data synthesis device for implementing the above-mentioned sample data synthesis method. Figure 4In the embodiment of the present disclosure, the sample data synthesis device may be an electronic device or a server. The electronic device may include a tablet computer, a desktop computer, a laptop computer, or other devices with communication functions, or may include a virtual machine or a device simulated by a simulator. The server may be a cloud server or a server cluster.
[0089] Figure 4 A schematic structural diagram of a sample data synthesis device provided by an embodiment of the present disclosure is shown.
[0090] like Figure 4 As shown, the sample data synthesis device 400 may include:
[0091] The sample acquisition module 410 is used to acquire original sample data corresponding to the target scene and determine the theme type of the target scene;
[0092] A first generating module 420 is used to perform data enhancement processing on the original sample data using a preset large language model to generate first sample synthetic data;
[0093] A second generation module 430 is used to use a preset generative adversarial network to perform data enhancement processing on the first sample synthetic data according to the topic type to generate second sample synthetic data;
[0094] The synthetic sample determination module 440 is configured to obtain a target synthetic sample corresponding to the target scene based on the first sample synthetic data and the second sample synthetic data.
[0095] A sample data synthesis device of an embodiment of the present disclosure includes: obtaining original sample data corresponding to a target scene, and determining the theme type of the target scene; using a preset large language model, performing data synthesis processing on the original sample data to generate first sample synthesis data; using a preset generative adversarial network, performing data synthesis processing on the first sample synthesis data according to the theme type to generate second sample synthesis data; based on the first sample synthesis data and the second sample synthesis data, obtaining a target synthesis sample corresponding to the target scene. In this way, using the preset large language model and the preset generative adversarial network, a synthesis sample belonging to the same theme type as the original sample is automatically synthesized, avoiding the problem of deviation between the synthesis sample and the original sample, and improving the quality and efficiency of the synthesis sample generation.
[0096] In some embodiments of the present disclosure, the original sample data is clustered data of a topic type surrounding the target scene, and the topic type includes a plurality of topic description words;
[0097] Accordingly, the sample acquisition module 410 includes:
[0098] A discrete data set acquisition unit, configured to acquire a discrete data set of a target scene, wherein the discrete data set of the target scene includes note data corresponding to the plurality of subject description words respectively;
[0099] The clustering unit is used to cluster the note data corresponding to the multiple topic description words according to the topic type to obtain the original sample data corresponding to the target scene.
[0100] In some embodiments of the present disclosure, the device further includes:
[0101] A prompt word template acquisition module is used to obtain the prompt word template of the target scene;
[0102] A format processing module, used to perform format processing on the original sample data according to the prompt word template, and generate an original template sample corresponding to the original sample data;
[0103] Accordingly, the first generating module 420 is specifically used for:
[0104] The preset large language model is used to perform data enhancement processing on the original template sample to generate the first sample synthetic data.
[0105] In some embodiments of the present disclosure, the first generating module 420 includes:
[0106] A configuration parameter acquisition unit, used to acquire configuration parameters of the preset large language model;
[0107] The first synthesis unit is used to use the preset large language model to generate a synthetic text corresponding to the original sample data according to the configuration parameters as the first sample synthetic data.
[0108] In some embodiments of the present disclosure, the original sample data is text; and the configuration parameters include one or more of the following combinations:
[0109] The temperature parameter is used to control the randomness of the generated text, the growth length parameter is used to define the maximum length of the generated text, the sampling parameter is used to limit the vocabulary selection during the generation process by truncating the distribution, and the sampling parameter is used to retain the k words with the highest probability for the next prediction.
[0110] In some embodiments of the present disclosure, the second generation module 430 includes:
[0111] A second synthesis unit is used to perform data enhancement processing on the preset topic type and the first sample synthetic data respectively based on the generator of the preset generative adversarial network to obtain the synthetic data to be selected;
[0112] A category judgment unit is used to perform category judgment on the candidate synthetic data based on the discriminator of the preset generative adversarial network to obtain the second sample synthetic data.
[0113] In some embodiments of the present disclosure, the second synthesis unit is specifically used for:
[0114] Based on the encoder in the generator, the preset topic type and the first sample synthetic data are respectively encoded to obtain encoding features that obey a preset prior distribution;
[0115] Based on the decoder in the generator, the coding features that obey the preset prior distribution are decoded to obtain the selected synthetic data.
[0116] In some embodiments of the present disclosure, the category determination unit is specifically used to:
[0117] Based on the feature extraction module in the discriminator, feature extraction is performed on the synthesized data to be selected to obtain a feature vector of the synthesized data to be selected;
[0118] Based on the classification module in the discriminator, the feature vector of the candidate synthetic data is classified to obtain the category corresponding to the candidate synthetic data, and the candidate synthetic data whose category is the synthetic category is used as the second sample synthetic data.
[0119] In some embodiments of the present disclosure, the device further includes:
[0120] The model training module is used to iteratively train the initial network of the target scene based on the target synthetic sample and the original sample data until the initial network meets the stop training condition, thereby obtaining a task processing model trained for the target scene.
[0121] It should be noted that Figure 4 The sample data synthesis apparatus 400 shown can execute Figure 1 to Figure 3 The various steps in the method embodiment shown in the figure are implemented Figure 1 to Figure 3 The various processes and effects in the method embodiment shown are not described in detail here.
[0122] Figure 5 A schematic structural diagram of an electronic device provided by an embodiment of the present disclosure is shown.
[0123] like Figure 5 As shown, the electronic device may include a processor 501 and a memory 502 storing computer program instructions.
[0124] Specifically, the processor 501 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0125] The memory 502 may include a large capacity memory for information or instructions. By way of example and not limitation, the memory 502 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory 502 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 502 may be inside or outside the integrated gateway device. In a particular embodiment, the memory 502 is a non-volatile solid-state memory. In a particular embodiment, the memory 502 includes a read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (Electrically Erasable Programmable ROM, EEPROM), an electrically rewritable ROM (EAROM) or a flash memory, or a combination of two or more of these.
[0126] The processor 501 reads and executes the computer program instructions stored in the memory 502 to perform the steps of the sample data synthesis method provided in the embodiment of the present disclosure.
[0127] In one example, the electronic device may further include a transceiver 503 and a bus 504. Figure 5 As shown, the processor 501, the memory 502 and the transceiver 503 are connected via a bus 504 and communicate with each other.
[0128] The bus 504 includes hardware, software, or both. For example, but not limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industrial Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, the bus 504 may include one or more buses. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.
[0129] The following is an embodiment of a computer-readable storage medium provided in an embodiment of the present disclosure. The computer-readable storage medium and the sample data synthesis method of the above-mentioned embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the computer-readable storage medium, reference can be made to the embodiment of the above-mentioned sample data synthesis method.
[0130] This embodiment provides a storage medium containing computer executable instructions. When the computer executable instructions are executed by a computer processor, they are used to perform a sample data synthesis method, including:
[0131] Obtaining original sample data corresponding to a target scene, and determining a subject type of the target scene;
[0132] Using a preset large language model, performing data enhancement processing on the original sample data to generate first sample synthetic data;
[0133] Using a preset generative adversarial network, performing data enhancement processing on the first sample synthetic data according to the subject type to generate second sample synthetic data;
[0134] Based on the first sample synthesis data and the second sample synthesis data, a target synthesis sample corresponding to the target scene is obtained.
[0135] Of course, the computer executable instructions of a storage medium containing computer executable instructions provided by an embodiment of the present disclosure are not limited to the above method operations, and can also execute related operations in the sample data synthesis method provided by any embodiment of the present disclosure.
[0136] Through the above description of the implementation methods, the technical personnel in the relevant field can clearly understand that the present disclosure can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer cloud platform (which can be a personal computer, a server, or a network cloud platform, etc.) to execute the sample data synthesis method provided by each embodiment of the present disclosure.
[0137] Note that the above are only preferred embodiments of the present disclosure and the technical principles used. Those skilled in the art will understand that the present disclosure is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present disclosure. Therefore, although the present disclosure is described in more detail through the above embodiments, the present disclosure is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present disclosure, and the scope of the present disclosure is determined by the scope of the appended claims.
Claims
1. A sample data synthesis method, comprising: Obtaining original sample data corresponding to a target scene, and determining a subject type of the target scene; Using a preset large language model, performing data enhancement processing on the original sample data to generate first sample synthetic data; Using a preset generative adversarial network, performing data enhancement processing on the first sample synthetic data according to the subject type to generate second sample synthetic data; Based on the first sample synthesis data and the second sample synthesis data, a target synthesis sample corresponding to the target scene is obtained.
2. The method according to claim 1, characterized in that The original sample data is clustered data of a topic type surrounding the target scene, and the topic type includes a plurality of topic description words; Accordingly, the obtaining of original sample data corresponding to the target scene includes: Acquire a discrete data set of a target scene, wherein the discrete data set of the target scene includes note data corresponding to the multiple subject description words respectively; According to the topic type, clustering processing is performed on the note data corresponding to the multiple topic description words to obtain original sample data corresponding to the target scene.
3. The method according to claim 1, characterized in that Before performing data enhancement processing on the original sample data using the preset large language model to generate the first sample synthetic data, the method further includes: Obtain the prompt word template of the target scene; According to the prompt word template, the original sample data is formatted to generate an original template sample corresponding to the original sample data; Accordingly, the method of using a preset large language model to perform data enhancement processing on the original sample data to generate first sample synthetic data includes: The preset large language model is used to perform data enhancement processing on the original template sample to generate the first sample synthetic data.
4. The method according to claim 1, characterized in that: The method of using a preset large language model to perform data enhancement processing on the original sample data to generate first sample synthetic data includes: Obtaining configuration parameters of the preset large language model; The preset large language model is used to generate synthetic text corresponding to the original sample data according to the configuration parameters as the first sample synthetic data.
5. The method according to claim 4, characterized in that The original sample data is text; the configuration parameters include one or more of the following combinations: The temperature parameter is used to control the randomness of the generated text, the growth length parameter is used to define the maximum length of the generated text, the sampling parameter is used to limit the vocabulary selection during the generation process by truncating the distribution, and the sampling parameter is used to retain the k words with the highest probability for the next prediction.
6. The method according to claim 1, characterized in that The using a preset generative adversarial network to perform data enhancement processing on the first sample synthetic data according to the topic type to generate second sample synthetic data includes: Based on the generator of the preset generative adversarial network, data enhancement processing is performed on the preset topic type and the first sample synthetic data respectively to obtain synthetic data to be selected; Based on the discriminator of the preset generative adversarial network, the category of the candidate synthetic data is judged to obtain the second sample synthetic data.
7. The method according to claim 6, characterized in that The generator based on the preset generative adversarial network performs data enhancement processing on the preset topic type and the first sample synthetic data respectively to obtain the synthetic data to be selected, including: Based on the encoder in the generator, the preset topic type and the first sample synthetic data are respectively encoded to obtain encoding features that obey a preset prior distribution; Based on the decoder in the generator, the coding features that obey the preset prior distribution are decoded to obtain the selected synthetic data.
8. The method according to claim 6, characterized in that The discriminator based on the preset generative adversarial network performs category judgment on the candidate synthetic data to obtain the second sample synthetic data, including: Based on the feature extraction module in the discriminator, feature extraction is performed on the synthesized data to be selected to obtain a feature vector of the synthesized data to be selected; Based on the classification module in the discriminator, the feature vector of the candidate synthetic data is classified to obtain the category corresponding to the candidate synthetic data, and the candidate synthetic data whose category is the synthetic category is used as the second sample synthetic data.
9. The method according to any one of claims 1 to 8, characterized in that: Also includes: Based on the target synthetic sample and the original sample data, the initial network of the target scene is iteratively trained until the initial network meets the stop training condition, thereby obtaining a task processing model trained for the target scene.
10. A sample data synthesis device, comprising: A sample acquisition module is used to acquire original sample data corresponding to a target scene and determine the subject type of the target scene; A first generating module is used to perform data enhancement processing on the original sample data by using a preset large language model to generate first sample synthetic data; A second generation module is used to use a preset generative adversarial network to perform data enhancement processing on the first sample synthetic data according to the topic type to generate second sample synthetic data; The synthetic sample determination module is used to obtain a target synthetic sample corresponding to the target scene based on the first sample synthetic data and the second sample synthetic data.
11. An electronic device, characterized in that: include: processor; A memory for storing executable instructions; The processor is used to read the executable instructions from the memory and execute the executable instructions to implement the method described in any one of claims 1 to 9.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Financial text data classification method and device, terminal equipment and medium
CN116662552A
Data processing method and device based on large language model
CN118552968A
Voice question answering method and device based on corpus, electronic equipment and storage medium
CN118861258A
Data processing method, model training method, electronic equipment and computer medium
CN119025515A