Data processing method and device, equipment, medium and program product
Training samples are generated through data mixing and slicing processing, and training samples are updated based on quality assessment scores. This solves the problem of being unable to dynamically update pre-training data during large language model training, and improves training effects and efficiency.
Patent Information
- Application Number
- CN202410877689.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-10-18
AI Technical Summary
Existing large language models cannot dynamically update pre-training data during the training process, resulting in high training costs, low efficiency, and inability to adapt to the supplement of high-quality data.
Through data mixing processing and data slicing processing, training samples are generated, and the training samples are updated according to the quality evaluation score during the training process, and the low-quality first data file is replaced with a high-quality second data file.
It realizes the dynamic update of training samples during the training process, improves the training effect of the model, avoids the impact of pre-training data collection and sorting work on efficiency, and improves work efficiency.
Smart Images

Figure CN118796980A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a data processing method, device, equipment, medium and program product. Background Art
[0002] According to existing research progress, the leap-forward improvement in the capabilities of large language models is brought about by the combination of large amounts of data and large amounts of computing power. Therefore, when building large language models, the quantity, quality, and diversity of pre-trained data are crucial to the performance of the model. In order to enable large language models to have emergent capabilities, on the one hand, the scale of pre-trained data needs to reach more than 2T tokens, and the scale is even continuing to increase, with more than 4T tokens; on the other hand, pre-trained data needs to be evenly distributed in the entire training space. In other words, pre-trained data of more than 2T tokens must be prepared at the beginning of training and fixed. However, when higher-quality new data is added in the middle, the pre-trained data cannot be updated, or the previous training needs to be abandoned, the data needs to be updated, and the training needs to be restarted, resulting in high training costs, low training efficiency, and lack of flexibility. Summary of the invention
[0003] The technical solution of the present invention aims to provide a data processing method, device, equipment, medium and program product, which are used to solve the problem in the prior art that pre-training data cannot be updated during the training process.
[0004] To achieve the above object, the present invention is achieved by:
[0005] In a first aspect, an embodiment of the present invention provides a data processing method, comprising:
[0006] Performing a first processing on a plurality of first data files to obtain training samples; wherein the first processing includes: data mixing processing and / or data slicing processing; and the data types of any two of the first data files are different;
[0007] In the process of training using the training samples, if the quality of the first training sample that has completed training is lower than the quality of the second data file, the first data file that has not participated in the training is updated using the second data file to obtain an updated training sample; wherein the second data file is a data file other than the multiple first data files; the data type of the second data file is the same as that of the first training sample.
[0008] Optionally, the data processing method, wherein performing first processing on a plurality of first data files to obtain training samples, comprises:
[0009] Performing a first process on the plurality of first data files to obtain a plurality of first slice segments and / or first mixed data files;
[0010] A training sample is obtained from each of the first slice segments and / or the first mixed data file.
[0011] Optionally, the data processing method, wherein performing first processing on a plurality of first data files to obtain a plurality of first slice segments, comprises:
[0012] Performing data mixing processing on the plurality of first data files according to weights corresponding to different data types to obtain a second mixed data file;
[0013] The second mixed data file is subjected to data slicing processing according to a first preset length to obtain a plurality of first slicing segments.
[0014] Optionally, the data processing method, wherein performing a first process on a plurality of first data files to obtain a first mixed data file, comprises:
[0015] Performing data slicing processing on each first data file according to a second preset length to obtain a plurality of second slicing segments;
[0016] Generate multiple slice sets based on the second slice segments of different data types; wherein the data types of any two second slice segments in each of the slice sets are different;
[0017] Data mixing processing is performed on the plurality of second slice segments in each of the slice sets according to weights corresponding to different data types to obtain a first mixed data file.
[0018] Optionally, the data processing method further comprises:
[0019] A first type identification file is generated based on the data type of each training sample in the second mixed data file.
[0020] Optionally, the data processing method, wherein the second data file is used to update the first data file that is not involved in the training to obtain an updated training sample, comprises:
[0021] Determine, according to the first type identification file, a second training sample in the first data file that is not involved in the training and has the same data type as that of the second data file;
[0022] The second training sample is updated using the second data file to obtain an updated training sample.
[0023] Optionally, the data processing method, wherein the second data file is used to update the first data file that is not involved in the training to obtain an updated training sample, comprises:
[0024] Performing data slicing processing on the second data file according to a second preset length to obtain a plurality of third slicing segments;
[0025] Using the plurality of third slice segments, the target second slice segments corresponding to the first data file not involved in the training are updated to obtain updated training samples;
[0026] The target second slice segment is a second slice segment having the same data type as that of the third slice segment.
[0027] Optionally, the data processing method further comprises:
[0028] Obtaining a quality assessment score of the first training sample according to the first training sample and a plurality of intermediate nodes of the model; wherein the intermediate nodes are selected from a sequence obtained by sorting the historical nodes of the model according to the number of training steps of the historical nodes;
[0029] Obtaining a quality assessment score of the second data file;
[0030] If the quality evaluation score of the first training sample is less than the quality evaluation score of the second data file, it is determined that the quality of the first training sample is lower than the quality of the second data file.
[0031] Optionally, the data processing method, wherein obtaining the quality assessment score of the first training sample according to the first training sample and multiple intermediate nodes of the model, comprises:
[0032] The quality assessment score of the first training sample is obtained according to the model perplexity and / or the loss function value of the downstream task corresponding to each intermediate node of the model of the first training sample, and the weight of each intermediate node.
[0033] In a second aspect, an embodiment of the present invention further provides a data processing device, comprising:
[0034] A processing module, used for performing a first processing on a plurality of first data files to obtain training samples; wherein the first processing includes: data mixing processing and / or data slicing processing; and the data types of any two of the first data files are different;
[0035] An updating module is used to update a first data file that has not participated in the training by using the second data file to obtain an updated training sample if the quality of the first training sample that has completed the training is lower than the quality of the second data file during the training process using the training sample; wherein the second data file is a data file other than the multiple first data files; and the data type of the second data file is the same as that of the first training sample.
[0036] In a third aspect, an embodiment of the present invention further provides a data processing device, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the data processing method as described in the first aspect is implemented.
[0037] In a fourth aspect, an embodiment of the present invention further provides a readable storage medium, on which a program is stored, and when the program is executed by a processor, the data processing method as described in the first aspect is implemented.
[0038] In a fifth aspect, an embodiment of the present invention further provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the data processing method as described in the first aspect.
[0039] The beneficial effects of the above technical solution of the present invention are as follows:
[0040] Using the data processing method described in the embodiment of the present invention, a first processing is performed on multiple first data files to obtain training samples; wherein the first processing includes: data mixing processing and / or data slicing processing; the data types of any two first data files are different; in the process of training using the training samples, if the quality of the first training sample that has completed the training is lower than the quality of the second data file, the first data file that has not participated in the training is updated using the second data file to obtain an updated training sample; wherein the second data file is a data file other than the multiple first data files; the data type of the second data file is the same as that of the first training sample. In this way, during the training process, data can be prepared while training is started, so as to avoid the impact of model pre-training data collection and organization work on work efficiency, and high-quality second data files can be used to dynamically update the training samples, thereby improving the training effect of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 A schematic diagram of a flow chart of a data processing method according to an embodiment of the present invention;
[0042] Figure 2 A schematic diagram of a flow chart of one implementation of the method described in an embodiment of the present invention;
[0043] Figure 3 A schematic diagram of another implementation of the method according to an embodiment of the present invention;
[0044] Figure 4 A schematic diagram of a flow chart of another implementation method of the method according to an embodiment of the present invention;
[0045] Figure 5 is a structural block diagram of a data processing device according to an embodiment of the present invention;
[0046] Figure 6 The figure is a schematic diagram of the hardware structure of the data processing device described in the embodiment of the present invention. DETAILED DESCRIPTION
[0047] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0048] The embodiment of the present invention, as Figure 1 As shown, a data processing method is provided, comprising:
[0049] Step 101, performing a first processing on a plurality of first data files to obtain training samples; wherein the first processing includes: data mixing processing and / or data slicing processing; and the data types of any two of the first data files are different.
[0050] In the embodiment of the present invention, the plurality of first data files may be subjected to data mixing processing first and then to data slicing processing. Of course, the plurality of first data files may also be subjected to data slicing processing first and then to data mixing processing.
[0051] The data types of any two first data files are different, which means that the data type of each first data file in the multiple first data files is different, and each first data file corresponds to a data type, and the data type may include at least one of the following: CommonCrawl; C4; Github; Wikipedia; Books; ArXiv; StackExchange.
[0052] It should be noted that the first data file is a data file of the corresponding data type that is evenly shuffled. The first data file corresponding to each data type stores all tokens of the data type. The token can be obtained by processing the word segmenter, and each first data file needs to be evenly shuffled in the bucket.
[0053] Step 102, during the process of training using the training samples, if the quality of the first training sample that has completed training is lower than the quality of the second data file, the first data file that has not participated in the training is updated using the second data file to obtain an updated training sample; wherein the second data file is a data file other than the multiple first data files; and the data type of the second data file is the same as that of the first training sample.
[0054] In an embodiment of the present invention, during the training process, the training samples can be updated to achieve high-quality data replacement. The model training work can be started while the training samples are being prepared, thus avoiding the impact of model pre-training data collection and organization on work efficiency.
[0055] In one implementation mode, optionally, performing a first process on a plurality of first data files to obtain training samples includes:
[0056] Performing a first process on the plurality of first data files to obtain a plurality of first slice segments and / or first mixed data files;
[0057] A training sample is obtained from each of the first slice segments and / or the first mixed data file.
[0058] In the embodiment of the present invention, a plurality of first data files are first subjected to data mixing processing to obtain a second mixed data file, and then a data slicing processing is performed on the second mixed data file to obtain a plurality of first slicing segments; and / or,
[0059] The plurality of first data files are firstly subjected to data slicing processing to obtain a plurality of second slicing segments, and then the plurality of second slicing segments are subjected to data mixing processing to obtain a first mixed data file.
[0060] For each first slice segment, a first preset number of training samples are selected from the first slice segment each time in a loop until all the first slice segments are taken, wherein the first preset number can be understood as a batch size, such as 4 megabytes (M).
[0061] For each first mixed data file, a first preset number of training samples are selected from the first mixed data file each time in a loop until all slice sets are completely taken.
[0062] In one implementation manner, optionally, performing a first process on a plurality of first data files to obtain a plurality of first slice segments includes:
[0063] Performing data mixing processing on the plurality of first data files according to weights corresponding to different data types to obtain a second mixed data file;
[0064] The second mixed data file is subjected to data slicing processing according to a first preset length to obtain a plurality of first slicing segments.
[0065] In the embodiment of the present invention, each first data file corresponds to a data type, and each data type corresponds to a weight, that is, each first data file corresponds to a weight, and the value of the weight represents the proportion of each data type in each batch of data during training. Figure 2 As shown, there are three first data files bin 1, bin 2, and bin 3, where the first data file bin 1 corresponds to weight w 1, the first data file bin 2 corresponds to weight w 2, and the first data file bin 3 corresponds to weight w 3. Data mixing is performed on these three first data files to obtain a second mixed data file. It should be noted that the data mixing performed on multiple first data files is full mixing processing, and the obtained second mixed data file is full mixed data, which is represented by "full data_list".
[0066] Each unit in the second mixed data file is a training sample with a length of max-length tokens, and the max-length is 4096 tokens. Therefore, each training sample includes 4096 tokens.
[0067] Assume that the length of the second mixed data file is length, and perform data slicing on the second mixed data file to cut it into L first slice segments (such as Figure 2 , slice 1, slice 2, . . . , slice n) shown in , the length of each first slice segment is length / L (that is, the first preset length is length / L), and the unit is sample.
[0068] In one implementation manner, optionally, performing a first process on a plurality of first data files to obtain a first mixed data file includes:
[0069] Performing data slicing processing on each first data file according to a second preset length to obtain a plurality of second slicing segments;
[0070] Generate multiple slice sets based on the second slice segments of different data types; wherein the data types of any two second slice segments in each of the slice sets are different;
[0071] Data mixing processing is performed on the plurality of second slice segments in each of the slice sets according to weights corresponding to different data types to obtain a first mixed data file.
[0072] like Figure 3As shown, two first data files bin 1 and bin 2 are respectively subjected to data slicing processing to obtain multiple second slice segments. Assume that the length of the first data file is length', and the first data file is subjected to data slicing processing to be cut into L' second slice segments (such as Figure 3 , each second slice segment has a length of length' / L' (i.e., the second preset length is length' / L'), and the unit is sample. The second preset length may be equal to the first preset length.
[0073] Further, a plurality of slice sets are generated, and the data types of any two second slice segments in each slice set are different, for example Figure 3 A slice set consisting of slice 1 of the first data file bin 1 and slice 1 of the first data file bin2.
[0074] Furthermore, the first data file bin 1 corresponds to weight w 1, the second data file bin 2 corresponds to weight w 2, and for each of the plurality of second slice segments in the slice set ( Figure 3 The slice set in the second slice segment includes two second slice segments) performs data mixing processing according to weights corresponding to different data types to obtain a first mixed data file.
[0075] It should be noted that the data processing method described in the embodiment of the present invention adopts data slicing processing for the first data file, and selects training samples based on each slice segment, so that model training can be started under the condition of satisfying the minimum slice unit during the training process, instead of all reaching the training storage space at the beginning of training, thereby improving the utilization effect of computing resources and training hardware.
[0076] In one embodiment, optionally, the method further comprises:
[0077] A first type identification file is generated based on the data type of each training sample in the second mixed data file.
[0078] In the embodiment of the present invention, while generating the second mixed data file, a first type identification file is also generated, represented by "label_list", and the first type identification file stores the data type corresponding to each training sample in the second mixed data file.
[0079] Of course, when the first mixed data file is generated, a second type identification (label) file is also generated, and the second type identification file stores the data type corresponding to each training sample in the first mixed data file.
[0080] In one implementation manner, optionally, using the second data file to update the first data file that is not involved in the training to obtain an updated training sample includes:
[0081] Determine, according to the first type identification file, a second training sample in the first data file that is not involved in the training and has the same data type as that of the second data file;
[0082] The second training sample is updated using the second data file to obtain an updated training sample.
[0083] In the embodiment of the present invention, Figure 2 As shown, in the first data file that did not participate in the training, specifically, in the first slice segments that did not participate in the training (for example, slice n and slice n+1), the second training samples are searched in sequence based on the first type identification file, and the training samples in the second data file bin 1' are used to update the second training samples one by one in order to obtain updated training samples, and the updated training samples are used to continue the normal model training process.
[0084] In one implementation manner, optionally, using the second data file to update the first data file that is not involved in the training to obtain an updated training sample includes:
[0085] Performing data slicing processing on the second data file according to a second preset length to obtain a plurality of third slicing segments;
[0086] Using the plurality of third slice segments, the target second slice segments corresponding to the first data file not involved in the training are updated to obtain updated training samples;
[0087] The target second slice segment is a second slice segment having the same data type as that of the third slice segment.
[0088] In the embodiment of the present invention, Figure 3 As shown, in the first data file that did not participate in the training, specifically, in the target second slice segment that did not participate in the training (for example, slice 2, the same data type as the second data file), the third slice segment obtained from the second data file bin 1' is used to update the target second slice segment.
[0089] Furthermore, data mixing processing is performed on the updated second slice segments to obtain updated training samples.
[0090] In one embodiment, optionally, the method further comprises:
[0091] According to the first training sample and multiple intermediate nodes of the model, a quality assessment score of the first training sample is obtained; wherein the target node is selected from a sequence obtained by sorting the historical nodes of the model according to the size of the training steps of the historical nodes;
[0092] Obtaining a quality assessment score of the second data file;
[0093] If the quality evaluation score of the first training sample is less than the quality evaluation score of the second data file, it is determined that the quality of the first training sample is lower than the quality of the second data file.
[0094] It should be noted that the data processing method described in the embodiment of the present invention can use the split method to obtain K intermediate nodes. The basis for selection is that the closer the model, the more accurate it is. Therefore, unequal intervals are used here. Within the range of selecting K nodes, the farther the distance, the sparser the selection of nodes, and the closer the distance, the denser the selection of nodes. The specific selection formula is shown below.
[0095] [L p ] = np.split([I0,I1,…,I k ],indices)
[0096] I0,I1,…,I k is a sequence obtained by sorting the historical nodes according to the size of the training steps of the historical nodes, k∈R,I i Represents a historical node, i∈[0,k]. indices is a hyperparameter, which can be a value or an array, and the specific value range is [0,k]. p is a list of historical node sequences divided into unequal intervals, L p The length of is K.
[0097] If all slice segments are input into the intermediate nodes of the model for quality assessment, the amount of calculation is too large, so sampling is required. The embodiment of the present invention can use N first training samples as the input of the model to obtain the quality assessment score.
[0098] In an embodiment of the present invention, the intermediate nodes of the model evaluate the data quality based on the model perplexity and / or the loss function of the downstream task, which not only minimizes the dependence on the current node of the model, but also provides sufficient time for data quality evaluation, thereby reducing the amount of calculation.
[0099] like Figure 4 As shown, from the slice fragment (in Figure 4The training samples are selected in sequence from slice 1, slice 2, slice 3, ..., slice n, ..., slice m, etc. to be input into the model for training. At the same time, the historical nodes in the training process are saved according to the training settings, and the cycle is repeated. When the slice changes or in order to monitor the effect of the model training process, it is necessary to evaluate the data quality of each slice, so as to update the slice fragment according to the result of the data quality evaluation.
[0100] It should also be noted that the quality assessment score of the second data file can be obtained in advance. The specific acquisition method can refer to the method for obtaining the quality assessment score of the first training sample, which will not be repeated here. Of course, the quality assessment score of the second data file can also be obtained at the same time as the quality assessment score of the first training sample, that is, the model is trained based on the first data file and the model is trained based on the second data file at the same time.
[0101] In one implementation manner, optionally, obtaining a quality assessment score of the first training sample according to the first training sample and a plurality of intermediate nodes of the model includes:
[0102] The quality assessment score of the first training sample is obtained according to the model perplexity and / or the loss function value of the downstream task corresponding to each intermediate node of the model of the first training sample, and the weight of each intermediate node.
[0103] It can be understood that, in the data processing method described in the embodiment of the present invention, obtaining the quality assessment score of the first training sample includes at least one of the following:
[0104] Obtaining a quality assessment score of the first training sample according to the model perplexity corresponding to each intermediate node of the model of the first training sample and the weight of each intermediate node;
[0105] According to the loss function of the downstream task corresponding to each intermediate node of the model of the first training sample and the weight of each intermediate node, the quality assessment score of the first training sample is obtained:
[0106] A first sub-quality assessment score of the first training sample is obtained according to the model perplexity corresponding to each intermediate node of the model of the first training sample and the weight of each intermediate node, and a second sub-quality assessment score of the first training sample is obtained according to the loss function of the downstream task corresponding to each intermediate node of the model of the first training sample and the weight of each intermediate node, and a quality assessment score of the first training sample is obtained according to the first sub-quality assessment score, the weight of the first sub-quality assessment score, the second sub-quality assessment score and the weight of the second sub-quality assessment score.
[0107] In an embodiment of the present invention, the model perplexity (PPL) corresponding to each intermediate node of the current model of the first training sample may be obtained, and the specific formula is as follows.
[0108]
[0109] PPL(P,Q)=2 H(P,Q)
[0110] Among them, P(x) and Q(x) represent the predicted sequence Q and the true sequence P corresponding to each intermediate node of the current model. PPL(P,Q) is the cross entropy, which represents the difference between the predicted sequence Q and the true sequence P, that is, the loss function value corresponding to each intermediate node of the current model. PPL(P,Q) is the exponential cross entropy with a base of 2, which represents the uncertainty of the model for the predicted sequence, so the smaller the PPL value, the better.
[0111] In addition, the downstream task loss function corresponding to each intermediate node of the current model of the first training sample can also be obtained. Taking the downstream as an example of a CEVAL task, the specific formula of the loss function is as follows.
[0112]
[0113]
[0114] It should be noted that the data processing method described in the embodiment of the present invention can dynamically adjust the training samples during the training process according to the current model or the downstream tasks of the current model, realize dynamic drawer-type replacement of high-quality data, and thus improve the training effect of the model.
[0115] Assuming that there are K intermediate nodes, the first training sample corresponds to K quality assessment scores, which can be the loss function of PPL and / or at least one downstream task. The quality assessment score of the first training sample is obtained by calculating the K quality assessment scores in an ensemble manner. Considering that the historical nodes at different stages have different effects on the quality assessment scores, the weighted averaging method can be used. The weighted average ensemble is an integrated machine learning method that combines predictions from multiple intermediate nodes of the model, where the contribution of each intermediate node is weighted in proportion to its ability or skill. The weighted average prediction involves first assigning a fixed weight to each ensemble member, and the value of the weight w is a floating point value between 0 and 1, indicating the percentage of the weight. Specifically, the quality assessment score Quality_score_bin-i of the first training sample bin-i is as shown in the following formula.
[0116] Quality_score_bin-i=(Quality_score_bin-i_1*w_1+Quality_score_bin-i_2*
[0117] w_2+…+Quality_score_bin-i_k*w_k) / (w_1+w_2+…+w_k)
[0118] Here, the meaning of the symbols in the above formula is explained:
[0119] When the quality assessment scores Quality_score_bin-i_k calculated by each intermediate node k of the model for the first training sample are all PPLs or are all loss functions of downstream tasks, for example, Quality_score_bin-i_1 is the PPL calculated by the intermediate node 1 of the model for the first training sample, Quality_score_bin-i_2 is the PPL calculated by the intermediate node 2 of the model for the first training sample, ..., Quality_score_bin-i_k*w_k is the PPL calculated by the intermediate node k of the model for the first training sample; or In other words, Quality_score_bin-i_1 is the loss function of the downstream task calculated by the intermediate node 1 of the model for the first training sample prediction, Quality_score_bin-i_2 is the loss function of the downstream task calculated by the intermediate node 2 of the model for the first training sample prediction, …, Quality_score_bin-i_k*w_k is the loss function of the downstream task calculated by the intermediate node k of the model for the first training sample prediction, then w_1 represents the weight of the intermediate node 1 of the model, w_2 represents the weight of the intermediate node 2 of the model, …, w_k represents the weight of the intermediate node k of the model.
[0120] When the quality assessment score Quality_score_bin-i_k calculated by each intermediate node k of the model for the prediction of the first training sample includes PPL and the loss function of the downstream task, for example, Quality_score_bin-i_1 is the PPL calculated by the k intermediate nodes of the model for the prediction of the first training sample, Quality_score_bin-i_2 is the loss function of downstream task 1 calculated by the k intermediate nodes of the model for the prediction of the first training sample, Quality_score_bin-i_3 is the loss function of downstream task 2 calculated by the k intermediate nodes of the model for the prediction of the first training sample, …, then w_1 represents the weight of the PPL calculated by the k intermediate nodes of the model for the prediction of the first training sample, w_2 represents the weight of the loss function of downstream task 1 calculated by the k intermediate nodes of the model for the prediction of the first training sample, w_3 represents the weight of the loss function of downstream task 2 calculated by the k intermediate nodes of the model for the prediction of the first training sample, …. In summary, by adopting the data processing method described in the embodiment of the present invention, training samples are selected based on slice segments, so that the training process does not have to reach the training storage space in its entirety at the beginning of training, thereby solving the problems of long training cycle of the model and long preparation cycle and low efficiency caused by massive sequence data. Moreover, during the training process, high-quality second data files can be used to update training samples, realize dynamic drawer-type updates, and improve the training effect of the model.
[0121] like Figure 5 As shown, an embodiment of the present invention further provides a data processing device, comprising:
[0122] Processing module 501, used for performing first processing on a plurality of first data files to obtain training samples; wherein the first processing includes: data mixing processing and / or data slicing processing; the data types of any two of the first data files are different;
[0123] An updating module 502 is used to update a first data file that has not participated in the training by using the second data file to obtain an updated training sample if the quality of the first training sample that has completed the training is lower than the quality of the second data file during the training process using the training sample; wherein the second data file is a data file other than the first data files; and the data type of the second data file is the same as that of the first training sample.
[0124] Optionally, in the data processing device, the processing module 501 includes:
[0125] A processing unit, configured to perform a first processing on the plurality of first data files to obtain a plurality of first slice segments and / or a first mixed data file;
[0126] An obtaining unit is used to obtain a training sample from each of the first slice segments and / or the first mixed data file.
[0127] Optionally, in the data processing device, the processing unit is specifically configured to:
[0128] Performing data mixing processing on the plurality of first data files according to weights corresponding to different data types to obtain a second mixed data file;
[0129] The second mixed data file is subjected to data slicing processing according to a first preset length to obtain a plurality of first slicing segments.
[0130] Optionally, in the data processing device, the processing unit is specifically configured to:
[0131] Performing data slicing processing on each first data file according to a second preset length to obtain a plurality of second slicing segments;
[0132] Generate multiple slice sets based on the second slice segments of different data types; wherein the data types of any two second slice segments in each of the slice sets are different;
[0133] Data mixing processing is performed on the plurality of second slice segments in each of the slice sets according to weights corresponding to different data types to obtain a first mixed data file.
[0134] Optionally, the data processing device further comprises:
[0135] A generating module is used to generate a first type identification file based on the data type of each training sample in the second mixed data file.
[0136] Optionally, in the data processing device, the updating module 502 is specifically configured to:
[0137] Determine, according to the first type identification file, a second training sample in the first data file that is not involved in the training and has the same data type as that of the second data file;
[0138] The second training sample is updated using the second data file to obtain an updated training sample.
[0139] Optionally, in the data processing device, the updating module 502 is specifically configured to:
[0140] Performing data slicing processing on the second data file according to a second preset length to obtain a plurality of third slicing segments;
[0141] Using the plurality of third slice segments, the target second slice segments corresponding to the first data file not involved in the training are updated to obtain updated training samples;
[0142] The target second slice segment is a second slice segment having the same data type as that of the third slice segment.
[0143] Optionally, the data processing device further comprises:
[0144] A first acquisition module is used to acquire a quality assessment score of the first training sample according to the first training sample and a plurality of intermediate nodes of the model; wherein the intermediate nodes are selected from a sequence obtained by sorting the historical nodes of the model according to the size of the training steps of the historical nodes;
[0145] A second acquisition module, used to acquire a quality assessment score of the second data file;
[0146] The judgment module is configured to judge that the quality of the first training sample is lower than the quality of the second data file if the quality evaluation score of the first training sample is lower than the quality evaluation score of the second data file.
[0147] Optionally, in the data processing device, the first acquisition module is specifically configured to:
[0148] The quality assessment score of the first training sample is obtained according to the model perplexity and / or the loss function value of the downstream task corresponding to each intermediate node of the model of the first training sample, and the weight of each intermediate node.
[0149] The data processing device provided in the embodiment of the present invention can execute the above-mentioned data processing method embodiment, and its implementation principle and technical effect are similar, which will not be repeated in this embodiment.
[0150] like Figure 6 As shown, the data processing device of an embodiment of the present invention includes: a processor 601; and a memory 602 connected to the processor 601 through a bus interface, the memory 602 is used to store programs and data used by the processor 601 when performing operations, and the processor 601 calls and executes the programs and data stored in the memory 602.
[0151] The processor 601 is used to read the program in the memory 602 and execute the following process:
[0152] Performing a first processing on a plurality of first data files to obtain training samples; wherein the first processing includes: data mixing processing and / or data slicing processing; and the data types of any two of the first data files are different;
[0153] In the process of training using the training samples, if the quality of the first training sample that has completed training is lower than the quality of the second data file, the first data file that has not participated in the training is updated using the second data file to obtain an updated training sample; wherein the second data file is a data file other than the multiple first data files; the data type of the second data file is the same as that of the first training sample.
[0154] The transceiver 603 is used to receive and send data in the controller of the processor 601 .
[0155] Among them, Figure 6 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically one or more processors represented by processor 601 and various circuits of memory represented by memory 602 are linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 603 may be a plurality of components, namely, a transmitter and a transceiver, providing a unit for communicating with various other devices on a transmission medium. For different user devices, the user interface 604 may also be an interface capable of externally and internally connecting required devices, and the connected devices include but are not limited to a keypad, a display, a speaker, a microphone, a joystick, and the like.
[0156] The processor 601 is responsible for managing the bus architecture and general processing, and the memory 602 can store data used by the processor 701 when performing operations.
[0157] Optionally, the processor 601 is specifically configured to read the computer program and execute the following steps:
[0158] Performing a first process on the plurality of first data files to obtain a plurality of first slice segments and / or first mixed data files;
[0159] A training sample is obtained from each of the first slice segments and / or the first mixed data file.
[0160] Optionally, the processor 601 is specifically configured to read the computer program and execute the following steps:
[0161] Performing data mixing processing on the plurality of first data files according to weights corresponding to different data types to obtain a second mixed data file;
[0162] The second mixed data file is subjected to data slicing processing according to a first preset length to obtain a plurality of first slicing segments.
[0163] Optionally, the processor 601 is specifically configured to read the computer program and execute the following steps:
[0164] Performing data slicing processing on each first data file according to a second preset length to obtain a plurality of second slicing segments;
[0165] Generate multiple slice sets based on the second slice segments of different data types; wherein the data types of any two second slice segments in each of the slice sets are different;
[0166] Data mixing processing is performed on the plurality of second slice segments in each of the slice sets according to weights corresponding to different data types to obtain a first mixed data file.
[0167] Optionally, the processor 601 is further configured to read the computer program and execute the following steps:
[0168] A first type identification file is generated based on the data type of each training sample in the second mixed data file.
[0169] Optionally, the processor 601 is specifically configured to read the computer program and execute the following steps:
[0170] Determine, according to the first type identification file, a second training sample in the first data file that is not involved in the training and has the same data type as that of the second data file;
[0171] The second training sample is updated using the second data file to obtain an updated training sample.
[0172] Optionally, the processor 601 is specifically configured to read the computer program and execute the following steps:
[0173] Performing data slicing processing on the second data file according to a second preset length to obtain a plurality of third slicing segments;
[0174] Using the plurality of third slice segments, the target second slice segments corresponding to the first data file not involved in the training are updated to obtain updated training samples;
[0175] The target second slice segment is a second slice segment having the same data type as that of the third slice segment.
[0176] Optionally, the processor 601 is further configured to read the computer program and execute the following steps:
[0177] Obtaining a quality assessment score of the first training sample according to the first training sample and a plurality of intermediate nodes of the model; wherein the intermediate nodes are selected from a sequence obtained by sorting the historical nodes of the model according to the number of training steps of the historical nodes;
[0178] Obtaining a quality assessment score of the second data file;
[0179] If the quality evaluation score of the first training sample is less than the quality evaluation score of the second data file, it is determined that the quality of the first training sample is lower than the quality of the second data file.
[0180] Optionally, the processor 601 is specifically configured to read the computer program and execute the following steps:
[0181] The quality assessment score of the first training sample is obtained according to the model perplexity and / or the loss function value of the downstream task corresponding to each intermediate node of the model of the first training sample, and the weight of each intermediate node.
[0182] A specific embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps in the above-mentioned data processing method are implemented and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0183] In addition, an embodiment of the present invention further provides a computer program product, including computer instructions, which, when executed by a processor, implement the above Figure 1 The various processes of the method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.
[0184] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0185] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0186] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform some steps of the sending and receiving methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.
[0187] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A data processing method, characterized in that: include: Performing a first processing on a plurality of first data files to obtain training samples; wherein the first processing includes: data mixing processing and / or data slicing processing; and the data types of any two of the first data files are different; In the process of training using the training samples, if the quality of the first training sample that has completed training is lower than the quality of the second data file, the first data file that has not participated in the training is updated using the second data file to obtain an updated training sample; wherein the second data file is a data file other than the multiple first data files; the data type of the second data file is the same as that of the first training sample.
2. The data processing method according to claim 1, characterized in that: Performing a first process on a plurality of first data files to obtain training samples includes: Performing a first process on the plurality of first data files to obtain a plurality of first slice segments and / or first mixed data files; A training sample is obtained from each of the first slice segments and / or the first mixed data file.
3. The data processing method according to claim 2, characterized in that: Performing a first process on a plurality of first data files to obtain a plurality of first slice segments includes: Performing data mixing processing on the plurality of first data files according to weights corresponding to different data types to obtain a second mixed data file; The second mixed data file is subjected to data slicing processing according to a first preset length to obtain a plurality of first slicing segments.
4. The data processing method according to claim 2, characterized in that: Performing a first process on the plurality of first data files to obtain a first mixed data file includes: Performing data slicing processing on each first data file according to a second preset length to obtain a plurality of second slice segments; generating a plurality of slice sets based on the second slice segments of different data types; wherein the data types of any two second slice segments in each of the slice sets are different; Data mixing processing is performed on the plurality of second slice segments in each of the slice sets according to weights corresponding to different data types to obtain a first mixed data file.
5. The data processing method according to claim 3, characterized in that: The method further comprises: A first type identification file is generated based on the data type of each training sample in the second mixed data file.
6. The data processing method according to claim 5, characterized in that: Using the second data file to update the first data file that is not involved in the training to obtain an updated training sample includes: Determine, according to the first type identification file, a second training sample in the first data file that is not involved in the training and has the same data type as that of the second data file; The second training sample is updated using the second data file to obtain an updated training sample.
7. The data processing method according to claim 4, characterized in that: Using the second data file to update the first data file that is not involved in the training to obtain an updated training sample includes: Performing data slicing processing on the second data file according to a second preset length to obtain a plurality of third slicing segments; Using the plurality of third slice segments, the target second slice segments corresponding to the first data file not involved in the training are updated to obtain updated training samples; The target second slice segment is a second slice segment having the same data type as that of the third slice segment.
8. The data processing method according to claim 1, characterized in that: The method further comprises: Obtaining a quality assessment score of the first training sample according to the first training sample and a plurality of intermediate nodes of the model; wherein the intermediate nodes are selected from a sequence obtained by sorting the historical nodes of the model according to the number of training steps of the historical nodes; Obtaining a quality assessment score of the second data file; If the quality evaluation score of the first training sample is less than the quality evaluation score of the second data file, it is determined that the quality of the first training sample is lower than the quality of the second data file.
9. The data processing method according to claim 8, characterized in that: Acquiring a quality assessment score of the first training sample according to the first training sample and a plurality of intermediate nodes of the model includes: The quality assessment score of the first training sample is obtained according to the model perplexity and / or the loss function value of the downstream task corresponding to the first training sample at each intermediate node of the model, and the weight of each intermediate node.
10. A data processing device, characterized in that: include: A processing module, used for performing a first processing on a plurality of first data files to obtain training samples; wherein the first processing includes: data mixing processing and / or data slicing processing; and the data types of any two of the first data files are different; An updating module is used to update a first data file that has not participated in the training by using the second data file to obtain an updated training sample if the quality of the first training sample that has completed the training is lower than the quality of the second data file during the training process using the training sample; wherein the second data file is a data file other than the multiple first data files; and the data type of the second data file is the same as that of the first training sample.
11. A data processing device, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the data processing method according to any one of claims 1 to 9 is implemented.
12. A readable storage medium, characterized in that: The readable storage medium stores a program, and when the program is executed by a processor, the data processing method according to any one of claims 1 to 9 is implemented.
13. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the data processing method according to any one of claims 1 to 9.
