Data generation method and device

By splitting and generating statement vector adjustment generation model, the problem of insufficient data volume of intelligent robots is solved, and more efficient data expansion and matching effects are achieved.

CN110110060BActive Publication Date: 2025-08-19BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN201910333272.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-04-24
Publication Date
2025-08-19
Estimated Expiration
2039-04-24

AI Technical Summary

Technical Problem

Due to the limited data volume of existing intelligent robots, the matching effect with user problems is not good.

Method used

Split the original data into multiple data units, and generate statement vectors through long and short-term memory networks and Monte Carlo algorithms, adjusting the generative model to generate more high-quality data.

Benefits of technology

By generating the model, more high-quality data can be generated based on a small amount of raw data, improving the matching effect with user problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110110060B_ABST
    Figure CN110110060B_ABST
Patent Text Reader

Abstract

The present invention provides a data generation method and device, the method comprising: splitting original data into multiple data units; using the multiple data units as input to a first generation model to train the first generation model to obtain a second generation model, wherein the output of the first generation model is a first sentence vector associated with each data unit and a second sentence vector associated with each data unit, the first sentence vector and the second sentence vector being used to adjust the first generation model; inputting the multiple data units into the second generation model to obtain target data, wherein the target data has a larger data volume than the original data. Embodiments of the present invention can generate a larger amount of high-quality data based on a smaller amount of original data, can achieve data expansion, and help improve the matching effect with the problem.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a data generation method and device. Background Art

[0002] Intelligent robots, such as intelligent customer service and voice assistants, are widely used to answer user questions and reduce labor costs. Due to differences in user expression habits, the specific expression of the same question may vary. For example, asking the time may be expressed in various ways, such as "What time?" or "What time is it now?"

[0003] Existing intelligent robots typically pre-load a certain amount of data containing multiple ways of expressing the same question. Upon receiving user input, they determine the likely question based on the degree of match between the input and the data, then retrieve and display the corresponding answer. Obviously, the greater the amount of high-quality data in this data, the more possible ways of expressing the question, and the higher the degree of match with the user's question. However, the actual amount of data available may be limited, affecting the matching effect. Summary of the Invention

[0004] The embodiments of the present invention provide a data generation method and apparatus to solve the problem that the amount of data that can actually be provided may be limited, which affects the matching effect with the question.

[0005] In order to solve the above-mentioned technical problems, the present invention is achieved as follows:

[0006] In a first aspect, an embodiment of the present invention provides a data generation method, comprising:

[0007] Split the original data into multiple data units;

[0008] Using the multiple data units as inputs of a first generative model to train the first generative model to obtain a second generative model, wherein the output of the first generative model is a first sentence vector associated with each of the data units and a second sentence vector associated with each of the data units, and the first sentence vector and the second sentence vector are used to adjust the first generative model;

[0009] The multiple data units are input into the second generation model to obtain target data, and the data volume of the target data is greater than the data volume of the original data.

[0010] Optionally, the training the first generative model using the multiple data units as inputs to obtain a second generative model includes:

[0011] Using an Nth data unit among the multiple data units as an input of a first generation model, performing model training, and obtaining a first sentence vector associated with the Nth data unit and a second sentence vector associated with the Nth data unit, wherein N is a positive integer;

[0012] When N is less than a preset value, the first generation model is adjusted according to the target vector, and the N+1th data unit among the multiple data units is used as the input of the adjusted first generation model, and model training is continued until N is equal to the number of the multiple data units, and the first generation model adjusted for the last time is used as the second generation model, wherein the target vector is the sentence vector between the first sentence vector associated with the Nth data unit and the second sentence vector associated with the Nth data unit, the sentence vector whose degree of association with the original data is greater than a preset threshold.

[0013] Optionally, when N is less than a preset value, adjusting the first generation model according to the target vector includes:

[0014] Scoring the first sentence vector associated with the Nth data unit and the second sentence vector associated with the Nth data unit according to the degree of relevance to the original data, wherein the score increases with the increase of the degree of relevance to the original data;

[0015] The first sentence vector and the second sentence vector whose scores are not lower than a preset score threshold are used as target vectors, and the parameters of the first generation model are adjusted according to the target vectors so that when the N+1th data unit is used as the input of the first generation model, the probability of generating the target vector is increased, wherein the preset score threshold is higher than the score corresponding to the original data.

[0016] Optionally, the using the Nth data unit among the multiple data units as the input of the first generation model to perform model training to obtain a first sentence vector associated with the Nth data unit and a second sentence vector associated with the Nth data unit includes:

[0017] Generate a first sentence vector corresponding to the Nth data unit using a long short-term memory network (LSTM) structure;

[0018] A second sentence vector corresponding to the Nth data unit is generated using a Monte Carlo algorithm.

[0019] Optionally, splitting the original data into multiple data units includes:

[0020] The original data is divided into multiple data units in word units.

[0021] In a second aspect, an embodiment of the present invention further provides a data generating device, including:

[0022] A splitting module, used to split the original data into multiple data units;

[0023] a training module, configured to use the plurality of data units as inputs of a first generative model to train the first generative model to obtain a second generative model, wherein the output of the first generative model is a first sentence vector associated with each of the data units and a second sentence vector associated with each of the data units, the first sentence vector and the second sentence vector being used to adjust the first generative model;

[0024] A data generation module is used to input the multiple data units into the second generation model to obtain target data, where the data volume of the target data is greater than the data volume of the original data.

[0025] Optionally, the training module includes:

[0026] a generation submodule, configured to use an Nth data unit among the multiple data units as an input of a first generation model, perform model training, and obtain a first sentence vector associated with the Nth data unit and a second sentence vector associated with the Nth data unit, wherein N is a positive integer;

[0027] A training submodule is used to adjust the first generation model according to the target vector when N is less than a preset value, and use the N+1th data unit among the multiple data units as the input of the adjusted first generation model, continue model training until N is equal to the number of the multiple data units, and use the first generation model adjusted for the last time as the second generation model, wherein the target vector is a sentence vector among the first sentence vector associated with the Nth data unit and the second sentence vector associated with the Nth data unit, the sentence vector whose degree of association with the original data is greater than a preset threshold.

[0028] Optionally, the training submodule includes:

[0029] a scoring unit, configured to score the first sentence vector associated with the Nth data unit and the second sentence vector associated with the Nth data unit according to a degree of relevance to the original data, wherein the score increases as the degree of relevance to the original data increases;

[0030] An adjustment unit is used to use the first sentence vector and the second sentence vector whose scores are not lower than a preset score threshold as target vectors, and adjust the parameters of the first generation model according to the target vectors so that when the N+1th data unit is used as the input of the first generation model, the probability of generating the target vector is increased, wherein the preset score threshold is higher than the score corresponding to the original data.

[0031] Optionally, the generating submodule includes:

[0032] A first generating unit is configured to generate a first sentence vector corresponding to the Nth data unit using a long short-term memory network (LSTM) structure;

[0033] The second generating unit is used to generate a second sentence vector corresponding to the Nth data unit by using a Monte Carlo algorithm.

[0034] Optionally, the splitting module is specifically used to:

[0035] The original data is divided into multiple data units in word units.

[0036] In a third aspect, an embodiment of the present invention further provides an electronic device, characterized in that it comprises a processor, a memory, and a computer program stored in the memory and runnable on the processor, wherein when the computer program is executed by the processor, the steps of the data generation method as described in any one of the above items are implemented.

[0037] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps of the data generation method described in any one of the above items are implemented.

[0038] In this way, the embodiment of the present invention generates sentence vectors by splitting the data units according to the original data, and adjusts the generation model according to the generated sentence vectors. The adjusted model can generate data similar to the original data. In this way, through the established generation model, more high-quality data can be generated based on a smaller amount of original data, which can achieve data expansion and help improve the matching effect with the problem. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in describing the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0040] Figure 1is a flow chart of a data generation method provided by an embodiment of the present invention;

[0041] Figure 2 is a flow chart of another data generation method provided by an embodiment of the present invention;

[0042] Figure 3 is a flow chart of another data generation method provided by an embodiment of the present invention;

[0043] Figure 4 It is a structural diagram of a data generating device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0044] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0045] The technical solutions of each embodiment of the present invention can be applied to scenarios such as intent recognition and classification, where intent refers to the item corresponding to the information, and intent recognition and classification refers to determining the intent of the information through recognition and classification in order to perform other subsequent operations.

[0046] For example, an intelligent customer service representative offers multiple services, such as balance inquiry and user information modification. These two services correspond to different intents. During implementation, users enter information in the hope of receiving an answer. This information needs to be identified and classified to determine the intent it corresponds to. User input depends on factors such as user habits and may differ from the intended classification. For example, a user might enter "how much money is left" or "my balance" to check their balance. In this case, the user's input needs to be identified and classified to determine the intended intent.

[0047] The more different expressions corresponding to the same intent are provided, the easier it is to determine whether the input information corresponds to the intent by comparing and fitting the input information with these expressions. It can be understood that the more data samples corresponding to each intent, the more complete the recognition and classification model of the intent. The embodiment of the present invention is mainly used for intent recognition and classification. The original data initially provided has a small amount of data. The purpose of the embodiment of the present invention is to generate a large amount of data samples based on the original data, and use the generated large amount of data samples as the basis for intent recognition and classification.

[0048] See also Figure 1 , Figure 1 This is a flow chart of a data generation method provided by an embodiment of the present invention. Figure 1 As shown, the following steps are included:

[0049] Step 101: Split original data into multiple data units.

[0050] For the recognition and classification of intent, corresponding data samples need to be provided. Here, the data samples initially provided are called original data.

[0051] The original data can be split based on grammar, for example, according to grammatical elements such as subject, predicate, and object. The original data can also be split in other ways, such as words or short sentences.

[0052] Step 102: Use the multiple data units as input of a first generation model to train the first generation model to obtain a second generation model.

[0053] The output of the first generative model is a first sentence vector associated with each data unit and a second sentence vector associated with each data unit.

[0054] The first generative model can be understood as a generator that generates sentence vectors associated with each data unit. The sentence vector directly generated by the generator is specifically the first sentence vector. Further, a second sentence vector is generated based on the first sentence vector. The first and second sentence vectors are used to adjust the first generative model, which can also be understood as the process of training the generator.

[0055] The first sentence vector and the second sentence vector output by the first generation model are used to adjust the first generation model. Specifically, after the first generation model outputs the first sentence vector and the second sentence vector, the output results of the first generation model are guided so that the output results of the first generation model are more targeted. This process is also called the training process of the first generation model.

[0056] After multiple adjustments, the first generation model can be made to generate data of a specific type as much as possible. In this embodiment, the first generation model is specifically adjusted so that it outputs data similar to the original data in a targeted manner.

[0057] The output result of the first generative model that has been adjusted sufficiently many times is relatively certain, and the first generative model that has completed training is used as the second generative model.

[0058] Step 103: Input the multiple data units into the second generation model to obtain target data.

[0059] The second generative model can be understood as a trained generator. That is, after the original data is input into the second generative model, the second generative model outputs target data that is substantially similar to the original data. Furthermore, the amount of target data output is larger than the original data. This means that more target data similar to the original data can be obtained based on the original data, effectively increasing the number of data samples.

[0060] The embodiment of the present invention generates sentence vectors based on the data units split from the original data, and adjusts the generation model based on the generated sentence vectors. The adjusted model can generate data similar to the original data. In this way, through the established generation model, more high-quality data can be generated based on a smaller amount of original data, which can achieve data expansion and help improve the matching effect with the problem.

[0061] See also Figure 2 , Figure 2 is a flow chart of another data generation method provided by an embodiment of the present invention, Figure 1 The main difference between the embodiment shown is that the original data is split into word units in this embodiment. Figure 2 As shown, the following steps are included:

[0062] Step 201: Split the original data into multiple data units in word units.

[0063] In this embodiment, the original data is divided into characters, which can also be understood as dividing the original data into morphemes, the most basic units of language. Although there are many Chinese characters, the number of commonly used characters is only about 3,500 to 5,000, so the initial data processing volume is less.

[0064] Step 202: Use the multiple data units as input of a first generation model to train the first generation model to obtain a second generation model.

[0065] Optionally, in a specific embodiment, step 202 includes:

[0066] The Nth data unit among the multiple data units is used as the input of the first generation model to perform model training to obtain a first sentence vector associated with the Nth data unit and a second sentence vector associated with the Nth data unit.

[0067] When N is less than a preset value, the first generation model is adjusted according to the target vector, and the N+1th data unit among the multiple data units is used as the input of the adjusted first generation model, and model training continues until N is equal to the number of the multiple data units, and the first generation model adjusted for the last time is used as the second generation model.

[0068] In this specific embodiment, N is a positive integer, and the preset value is no greater than the total number of data units. When the Nth data unit is input into the first generation model, the output of the first generation model is a first sentence vector and a second sentence vector, and both the first sentence vector and the second sentence vector are associated with the Nth data unit.

[0069] The target vector is a sentence vector, among the first sentence vector associated with the Nth data unit and the second sentence vector associated with the Nth data unit, whose correlation degree with the original data is greater than a preset threshold.

[0070] This model training process can be understood as inputting the Nth data unit into the first generative model, then adjusting the first generative model according to the target vector in the sentence vector output by the first generative model, and then inputting the next data unit.

[0071] In this way, by continuously looping through this training process, the generator can be continuously adjusted, resulting in a larger number of target vectors in the output, which means that the data is more closely related to the original data. Finally, after multiple cycles of training, a trained generator can be obtained, which is the second generative model mentioned above.

[0072] Optionally, the using the Nth data unit among the multiple data units as the input of the first generation model to perform model training to obtain a first sentence vector associated with the Nth data unit and a second sentence vector associated with the Nth data unit includes:

[0073] Generate a first sentence vector corresponding to the Nth data unit using an LSTM (Long Short-Term Memory) structure;

[0074] A second sentence vector corresponding to the Nth data unit is generated using a Monte Carlo algorithm.

[0075] The first generative model feeds the original data h into the LSTM generator to generate the first sentence vector X1. During the generation process of X1, it's not always clear whether the sentence is standardized and meets the intent category requirements with each generated word. Therefore, the second sentence vector Xi is further expanded using the Monte Carlo algorithm. This ensures that the generated data conforms to the intent of the original data while increasing the amount of generated data. The LSTM structure and Monte Carlo algorithm themselves can be referenced in related art and are not further defined or described here.

[0076] Optionally, when N is less than a preset value, adjusting the first generation model according to the target vector includes:

[0077] Scoring the first sentence vector associated with the Nth data unit and the second sentence vector associated with the Nth data unit according to the degree of relevance to the original data, wherein the score increases with the increase of the degree of relevance to the original data;

[0078] The first sentence vector and the second sentence vector whose scores are not lower than a preset score threshold are used as target vectors, and the parameters of the first generation model are adjusted according to the target vectors so that when the N+1th data unit is used as the input of the first generation model, the probability of generating the target vector is increased, wherein the preset score threshold is higher than the score corresponding to the original data.

[0079] In this specific implementation, the relevance of the generated sentence vector to the original data is quantified using a score. Specifically, the original data is assigned a score, which serves as a baseline value, i.e., the preset score threshold. The score can be a specific score value or a probability value for generating the corresponding sentence vector.

[0080] The scores of sentence vectors related to the original data are all higher than the preset score threshold, and the higher the relevance to the original data, the higher the score of the sentence vector. Obviously, if a sentence vector is generated that is irrelevant to the original data, the score of the sentence vector is lower than the score of the original data, and it is a useless sentence vector.

[0081] Sentence vectors with scores above a preset threshold are used as target vectors, and the parameters of the first generative model are adjusted based on the target vectors. This increases the probability of generating the target vector when the next data unit is input into the first generative model. By continuously adjusting the first generative model, the probability of generating a sentence vector with a high correlation with the original data can be continuously increased.

[0082] Step 203: Input the multiple data units into the second generation model to obtain target data, where the data volume of the target data is greater than the data volume of the original data.

[0083] In this process, the LSTM structure is used for word-by-word generation, and finally a large sample of data can be generated. For example, in one test, more than 10 million large sample data can be generated based on about 10,000 initial data.

[0084] In this embodiment, by splitting the original data into words, the initial data processing volume can be reduced and the data processing speed can be increased. At the same time, the fewer the initial samples, the greater the room for subsequent improvement.

[0085] It should be understood that the optional steps in this embodiment can also be applied to Figure 1In the embodiments shown, the same or similar technical effects are achieved and will not be described in detail here.

[0086] like Figure 3 As shown, the training process of the first generative model can be summarized as follows: inputting the original data into the first generative model to obtain a first sentence vector X1, such as "I don't know". At the same time, the Monte Carlo algorithm is used to obtain a second sentence vector Xi associated with the first sentence vector X1. For example, when generating "I", the corresponding Xi is generated, such as "I understand", "I don't know", "I really know", etc. The generated results are scored based on the correlation between the first sentence vector X1, the second sentence vector Xi, and the original data h. The data with a higher correlation with the original data has a higher score.

[0087] The purpose of scoring is to give the generated high-quality sentence vector a high probability value, while the probability value of the original data is relatively low. Next, this scoring result is fed back to the generator to guide the generator to increase the probability of generating data similar to the original data. Figure 3 The X2 vector represents the data generated after the Monte Carlo search. Repeating the training process repeatedly, the resulting generator is able to generate data that is highly similar to the original data. Thus, by feeding the original data into the generator, a large sample of data similar to the original data can be obtained.

[0088] The embodiment of the present invention further provides a data generating device 400, such as Figure 4 Shown, including:

[0089] A splitting module 401 is used to split the original data into multiple data units;

[0090] a training module 402 configured to train a first generative model using the plurality of data units as input to the first generative model to obtain a second generative model, wherein the output of the first generative model is a first sentence vector associated with each data unit and a second sentence vector associated with each data unit, wherein the first sentence vector and the second sentence vector are used to adjust the first generative model;

[0091] The data generation module 403 is configured to input the plurality of data units into the second generation model to obtain target data, where the target data has a larger data volume than the original data.

[0092] Optionally, the training module 402 includes:

[0093] a generation submodule, configured to use an Nth data unit among the multiple data units as an input of a first generation model, perform model training, and obtain a first sentence vector associated with the Nth data unit and a second sentence vector associated with the Nth data unit, wherein N is a positive integer;

[0094] A training submodule is used to adjust the first generation model according to the target vector when N is less than a preset value, and use the N+1th data unit among the multiple data units as the input of the adjusted first generation model, continue model training until N is equal to the number of the multiple data units, and use the first generation model adjusted for the last time as the second generation model, wherein the target vector is a sentence vector among the first sentence vector associated with the Nth data unit and the second sentence vector associated with the Nth data unit, the sentence vector whose degree of association with the original data is greater than a preset threshold.

[0095] Optionally, the training submodule includes:

[0096] a scoring unit, configured to score the first sentence vector associated with the Nth data unit and the second sentence vector associated with the Nth data unit according to a degree of relevance to the original data, wherein the score increases as the degree of relevance to the original data increases;

[0097] An adjustment unit is used to use the first sentence vector and the second sentence vector whose scores are not lower than a preset score threshold as target vectors, and adjust the parameters of the first generation model according to the target vectors so that when the N+1th data unit is used as the input of the first generation model, the probability of generating the target vector is increased, wherein the preset score threshold is higher than the score corresponding to the original data.

[0098] Optionally, the generating submodule includes:

[0099] A first generating unit is configured to generate a first sentence vector corresponding to the Nth data unit using a long short-term memory network (LSTM) structure;

[0100] The second generating unit is used to generate a second sentence vector corresponding to the Nth data unit by using a Monte Carlo algorithm.

[0101] Optionally, the splitting module 401 is specifically configured to:

[0102] The original data is divided into multiple data units in word units.

[0103] The data generating device 400 provided in the embodiment of the present invention can implement each process in the above method embodiment, and will not be described again here to avoid repetition.

[0104] Preferably, an embodiment of the present invention also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and runnable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned data generation method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0105] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the computer program implements the various processes of the above-mentioned data generation method embodiment and can achieve the same technical effects. To avoid repetition, the details are not described here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0106] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.

[0107] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0108] In the embodiments provided in this 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 merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, 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.

[0109] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the objectives of the embodiments of the present invention.

[0110] In addition, each functional unit in each embodiment of the present invention 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.

[0111] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, ROM, RAM, a magnetic disk, or an optical disk.

[0112] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A data generation method, characterized in that: include: Split the original data into multiple data units; Using the multiple data units as inputs of a first generative model to train the first generative model to obtain a second generative model, wherein the output of the first generative model is a first sentence vector associated with each of the data units and a second sentence vector associated with each of the data units, and the first sentence vector and the second sentence vector are used to adjust the first generative model; Inputting the plurality of data units into the second generation model to obtain target data, wherein the data volume of the target data is greater than the data volume of the original data; The step of using the plurality of data units as inputs of a first generation model to train the first generation model to obtain a second generation model includes: Using an Nth data unit among the multiple data units as an input of a first generation model, performing model training, and obtaining a first sentence vector associated with the Nth data unit and a second sentence vector associated with the Nth data unit, wherein N is a positive integer; When N is less than a preset value, the first generative model is adjusted according to the target vector, and the N+1th data unit among the multiple data units is used as the input of the adjusted first generative model, and model training is continued until N is equal to the number of the multiple data units, and the first generative model adjusted for the last time is used as the second generative model, wherein the target vector is a sentence vector of the first sentence vector associated with the Nth data unit and the second sentence vector associated with the Nth data unit, the sentence vector having a degree of association with the original data greater than a preset threshold; The step of splitting the original data into multiple data units includes: The original data is divided into multiple data units in word units.

2. The data generation method according to claim 1, wherein: When N is less than a preset value, adjusting the first generation model according to the target vector includes: Scoring the first sentence vector associated with the Nth data unit and the second sentence vector associated with the Nth data unit according to the degree of relevance to the original data, wherein the score increases with the increase of the degree of relevance to the original data; The first sentence vector and the second sentence vector whose scores are not lower than a preset score threshold are used as target vectors, and the parameters of the first generation model are adjusted according to the target vectors so that when the N+1th data unit is used as the input of the first generation model, the probability of generating the target vector is increased, wherein the preset score threshold is higher than the score corresponding to the original data.

3. The data generation method according to claim 1, wherein: The step of using the Nth data unit among the multiple data units as an input of a first generation model to perform model training to obtain a first sentence vector associated with the Nth data unit and a second sentence vector associated with the Nth data unit includes: Generate a first sentence vector corresponding to the Nth data unit using a long short-term memory network (LSTM) structure; A second sentence vector corresponding to the Nth data unit is generated using a Monte Carlo algorithm.

4. A data generating device, characterized in that: include: A splitting module, used to split the original data into multiple data units; a training module, configured to use the plurality of data units as inputs of a first generative model to train the first generative model to obtain a second generative model, wherein the output of the first generative model is a first sentence vector associated with each of the data units and a second sentence vector associated with each of the data units, the first sentence vector and the second sentence vector being used to adjust the first generative model; a data generation module, configured to input the plurality of data units into the second generation model to obtain target data, wherein the target data has a larger data volume than the original data; The training module includes: a generation submodule, configured to use an Nth data unit among the multiple data units as an input of a first generation model, perform model training, and obtain a first sentence vector associated with the Nth data unit and a second sentence vector associated with the Nth data unit, wherein N is a positive integer; a training submodule, configured to adjust the first generative model according to a target vector when N is less than a preset value, and use the N+1th data unit among the multiple data units as an input of the adjusted first generative model, continue model training until N is equal to the number of the multiple data units, and use the first generative model adjusted for the last time as a second generative model, wherein the target vector is a sentence vector, among the first sentence vector associated with the Nth data unit and the second sentence vector associated with the Nth data unit, whose correlation with the original data is greater than a preset threshold; The splitting module is specifically used for: The original data is divided into multiple data units in word units.

5. The data generating device according to claim 4, wherein The training submodule includes: a scoring unit, configured to score the first sentence vector associated with the Nth data unit and the second sentence vector associated with the Nth data unit according to a degree of relevance to the original data, wherein the score increases as the degree of relevance to the original data increases; An adjustment unit is used to use the first sentence vector and the second sentence vector whose scores are not lower than a preset score threshold as target vectors, and adjust the parameters of the first generation model according to the target vectors so that when the N+1th data unit is used as the input of the first generation model, the probability of generating the target vector is increased, wherein the preset score threshold is higher than the score corresponding to the original data.

6. The data generating device according to claim 4, wherein: The generation submodule includes: A first generating unit is configured to generate a first sentence vector corresponding to the Nth data unit using a long short-term memory network (LSTM) structure; The second generating unit is used to generate a second sentence vector corresponding to the Nth data unit by using a Monte Carlo algorithm.

7. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the data generating method according to any one of claims 1 to 3 are implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the data generation method according to any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Automatic text generation method and device

    CN108334497A

  • Generative adversarial network technology-based medical text generation method

    CN108491497A

  • Problem generation method based on progressive multi-discriminator

    CN109271483A