Text processing model training method, text processing method and device
By segmenting the sample set and predicting set training, and integrating the prediction results to train the text processing model, the error and feature unmined caused by artificial setting of model fusion weights in the existing technology are solved, and the generalization and accuracy of the text processing model are achieved.
Patent Information
- Application Number
- CN202210278968.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-21
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2042-03-21
AI Technical Summary
In the prior art, when the model is fusion through weighting, the weight is often set by man, resulting in the failure to fully explore errors and feature details. Especially when the basic model is not clear, it is difficult to effectively integrate the characteristics of different basic models, resulting in low applicability and accuracy of text processing models.
By obtaining the sample set and multiple basic models, the sample set is divided into multiple sample subsets, the prediction set and training set corresponding to each basic model are determined, and the training set corresponding to each basic model is used for training and prediction to obtain the prediction results. These prediction results are integrated into the target training set, and the pre-constructed initial text processing model is trained to obtain the fused text processing model.
The feature details of each basic model are fully explored. Especially when the performance of the basic model is not clear, the characteristics of different basic models can be effectively integrated, the generalization and accuracy of the text processing model can be improved, and errors caused by human factors are reduced.
Smart Images

Figure CN114692625B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method for training a text processing model. The present application also relates to a text processing method, a training device for a text processing model, a text processing device, a computing device, and a computer-readable storage medium. Background Art
[0002] In the task of Natural Language Processing (NLP), for a specific task, it is often necessary to integrate multiple basic models with different structural or parameter characteristics so that the integrated text processing model has different functions for specific tasks. For example, if a specific task requires both processing long texts and the ability of the model to discover the content indirectly referred to by the referent entity, it is necessary to integrate the model suitable for processing long texts and the model suitable for discovering deep referential relationships.
[0003] At present, an iterative method is often used for model fusion: for each basic model, after the training based on the training set is completed, the model parameters of the basic model are further adjusted based on the prediction results of the prediction set, so that the recognition rate of the erroneous sample text data in the prediction set is continuously improved. Finally, the model parameters of each basic model are weighted according to the weights to obtain the fused text processing model.
[0004] However, when model fusion is performed in a weighted manner, the weights are often set manually, which not only introduces certain errors, but also fails to fully explore the characteristic details of each model. Especially when the performance of the basic model is unclear, the characteristics of different basic models cannot be well integrated, resulting in poor applicability of the fused text processing model and low accuracy of text processing. Summary of the invention
[0005] In view of this, the embodiment of the present application provides a text processing model training method and a text processing method to solve the technical defects existing in the prior art. The embodiment of the present application also provides a text processing model training device and a text processing device, a computing device, and a computer-readable storage medium.
[0006] According to a first aspect of an embodiment of the present application, a method for training a text processing model is provided, comprising:
[0007] Obtain a sample set and multiple basic models, and divide the sample set into multiple sample subsets, wherein the sample set includes multiple sample text data, and the multiple basic models are neural network models that respectively implement different text processing tasks;
[0008] Determine a prediction set and a training set corresponding to each basic model from a plurality of sample subsets, wherein a different sample subset is selected as a prediction set for each basic model;
[0009] Using the training sets corresponding to the basic models, each basic model is trained respectively, and using the trained basic models to predict the sample text data in the prediction sets corresponding to the basic models respectively, to obtain prediction results;
[0010] The prediction results obtained for each basic model are integrated into a target training set, and the pre-built initial text processing model is trained using the target training set to obtain a fused text processing model.
[0011] According to a second aspect of an embodiment of the present application, a text processing method is provided, comprising:
[0012] Get the text to be processed;
[0013] The text to be processed is input into the fused text processing model to obtain a processing result of the text to be processed, wherein the fused text processing model is trained using the method provided in the first aspect of the embodiment of the present application.
[0014] According to a third aspect of an embodiment of the present application, a training device for a text processing model is provided, comprising:
[0015] A first acquisition module is configured to acquire a sample set and a plurality of basic models, and divide the sample set into a plurality of sample subsets, wherein the sample set includes a plurality of sample text data, and the plurality of basic models are neural network models for respectively realizing different text processing tasks;
[0016] A first determination module is configured to determine a prediction set and a training set corresponding to each basic model from a plurality of sample subsets, wherein a different sample subset is selected as a prediction set for each basic model;
[0017] The prediction module is configured to use the training sets corresponding to the basic models to train the basic models respectively, and use the trained basic models to predict the sample text data in the prediction sets corresponding to the basic models to obtain prediction results;
[0018] The model training module is configured to integrate the prediction results obtained for each basic model into a target training set, and use the target training set to train the pre-built initial text processing model to obtain a fused text processing model.
[0019] According to a fourth aspect of an embodiment of the present application, there is provided a text processing device, including:
[0020] A second acquisition module is configured to acquire the text to be processed;
[0021] The processing module is configured to input the text to be processed into the fused text processing model to obtain the processing result of the text to be processed, wherein the fused text processing model is trained using the method provided in the first aspect of the embodiment of the present application.
[0022] According to a fifth aspect of an embodiment of the present application, there is provided a computing device, including:
[0023] Memory and processor;
[0024] The memory is used to store computer-executable instructions, and when the processor executes the computer-executable instructions, the steps of the method provided in the first aspect or the second aspect of the embodiment of the present application are implemented.
[0025] According to the sixth aspect of the embodiments of the present application, a computer-readable storage medium is provided, which stores computer-executable instructions. When the instructions are executed by a processor, the steps of the method provided in the first aspect or the second aspect of the embodiments of the present application are implemented.
[0026] The training method of the text processing model provided in the present application is to obtain a sample set and multiple basic models, and divide the sample set into multiple sample subsets, wherein the sample set includes multiple sample text data, and the multiple basic models are neural network models that respectively implement different text processing tasks; determine the prediction set and training set corresponding to each basic model from the multiple sample subsets, wherein the sample subset selected as the prediction set for each basic model is different; use the training set corresponding to each basic model to train each basic model respectively, and use the trained basic models to predict the sample text data in the prediction set corresponding to each basic model respectively, and obtain the prediction result; integrate the prediction results obtained for each basic model into a target training set, and use the target training set to train the pre-built initial text processing model to obtain a fused text processing model. It realizes the full mining of the feature details of each basic model, especially when the performance of the basic model is unclear, the features of different basic models can be integrated to improve the generalization of the text processing model, further improve the accuracy of text processing, and reduce the error caused by human factors. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a structural diagram of a text processing model system provided by an embodiment of the present application;
[0028] Figure 2 This is a flowchart of a first text processing model training method provided by an embodiment of the present application;
[0029] Figure 3 is a flowchart of a second text processing model training method provided in one embodiment of the present application;
[0030] Figure 4 is a flowchart of a third text processing model training method provided in an embodiment of the present application;
[0031] Figure 5 is a flowchart of a fourth text processing model training method provided in an embodiment of the present application;
[0032] Figure 6 is a flowchart of a fifth text processing model training method provided in an embodiment of the present application;
[0033] Figure 7 is a flowchart of a first text processing method provided by an embodiment of the present application;
[0034] Figure 8 is a flowchart of a second text processing method provided by an embodiment of the present application;
[0035] Fig. 9 is a flowchart of a third text processing method provided by an embodiment of the present application;
[0036] Fig.10 is a schematic diagram of a text processing flow provided by an embodiment of the present application;
[0037] Fig.11 It is a structural schematic diagram of a training device for a text processing model provided in one embodiment of the present application;
[0038] Fig.12 is a structural schematic diagram of a text processing device provided by an embodiment of the present application;
[0039] Fig.13 It is a structural diagram of a computing device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0040] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0041] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms of "a", "said" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.
[0042] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first.
[0043] In the present application, a training method for a text processing model is provided. The present application also provides a text processing method, a text processing model training device, a text processing device, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
[0044] Figure 1 A structural diagram of a text processing model system provided by an embodiment of the present application is shown.
[0045] The present application can be divided into two execution entities, a server and an application terminal. The server is used to train the model, and the application terminal includes a first terminal and a second terminal. The first terminal is used to provide samples and multiple basic models to the server, and the second terminal is used to receive the model trained by the server and input the text to be processed into the model to obtain the processing result.
[0046] That is to say, the server obtains a sample set and multiple basic models from the first terminal, divides the sample set into multiple sample subsets, determines the prediction set and training set corresponding to each basic model from the multiple sample subsets, uses the training set corresponding to each basic model to train each basic model respectively, and uses the trained basic models to predict the sample text data in the prediction set corresponding to each basic model to obtain a prediction result, integrates the prediction results obtained for each basic model into a target training set, uses the target training set to train a pre-built initial text processing model to obtain a fused text processing model, and after obtaining the text processing model, the server sends the text processing model to the second terminal, the second terminal receives the text processing model, obtains the text to be processed, inputs the text to be processed into the text processing model, and obtains the processing result of the text to be processed.
[0047] The scheme of the embodiment of the present application is applied to obtain the text to be processed, input the text to be processed into the text processing model, obtain the processing result of the text to be processed, and in the process of training the text processing model, by obtaining a sample set and multiple basic models, the sample set is divided into multiple sample subsets, wherein the sample set includes multiple sample text data, and the multiple basic models are neural network models that respectively implement different text processing tasks; from the multiple sample subsets, the prediction set and training set corresponding to each basic model are determined, wherein the sample subset selected as the prediction set for each basic model is different; using the training set corresponding to each basic model, each basic model is trained respectively, and each basic model after training is used to predict the sample text data in the prediction set corresponding to each basic model, and obtain the prediction result; the prediction results obtained for each basic model are integrated into the target training set, and the pre-built initial text processing model is trained using the target training set to obtain the fused text processing model. It realizes the full mining of the feature details of each basic model, the fusion of the features of different basic models, the improvement of the generalization of the text processing model, the further improvement of the accuracy of text processing, and the reduction of errors caused by human factors.
[0048] Figure 2 A flowchart of a first text processing model training method provided in an embodiment of the present application is shown, and the method specifically comprises the following steps:
[0049] Step S202: Obtain a sample set and multiple basic models, and divide the sample set into multiple sample subsets, wherein the sample set includes multiple sample text data, and the multiple basic models are neural network models that respectively implement different text processing tasks.
[0050] In the embodiment of the present application, when training a text processing model, it is necessary to obtain a sample set including multiple sample text data. Generally, the method of obtaining the sample set can be to manually input a large number of sample texts to form a sample set, or to read a large number of sample texts from other data acquisition devices or databases to form a sample set. The method of obtaining the sample set is selected according to the actual situation, and the embodiment of the present application does not impose any restrictions on this. The obtained sample set includes multiple sample texts, each of which is generally manually annotated, that is, the sample texts in the obtained sample set all carry labels.
[0051] It should be noted that the basic model is a neural network model for processing tasks, which can be optionally a convolutional neural network (CNN) or a recurrent neural network (RNN) or a long short-term memory network (LSTM), etc. The specific selection depends on the actual situation, and this application does not impose any limitation on this.
[0052] In an embodiment of the present application, the sample set is divided into multiple sample subsets, and the sample set can be divided into two parts in the following ways: the first way is to divide the sample set into two parts according to the number of basic models. For example, if the number of basic models is 4, the sample set is divided into four parts; the second way is not necessary to divide the sample set into two parts according to the number of basic models. For example, if the number of basic models is 4, the sample set is divided into five parts. The present application does not limit the number of sample sets to be divided into two parts, but the number of sample sets to be divided into two parts should not be less than the number of basic models. Dividing the sample set into multiple sample subsets can avoid model bias in the sample text data in subsequent training, thereby avoiding the inability to fully explore the feature details of each basic model and human intervention.
[0053] Step S204: determining prediction sets and training sets corresponding to the respective basic models from the multiple sample subsets, wherein the sample subset selected as the prediction set for each basic model is different.
[0054] In the embodiment of the present application, the model sizes of multiple basic models are the same, the word segmentation rules are the same, and the task types are the same. For example, the model sizes of multiple basic models are all base or large models. In order to ensure that the text processing model can complete the fusion, the word segmentation rules of multiple basic models also need to be the same, because the subsequent output structure of the text processing model is designed according to the task. Therefore, the task types of multiple basic models also need to be the same, such as all question-answering tasks, or all sentiment analysis, etc., and the number of basic models is selected according to the actual situation, and this application does not impose any restrictions on this.
[0055] Exemplarily, determining the prediction set and training set corresponding to each basic model from multiple sample subsets can be carried out in the following manner: In the first manner, four basic models are obtained, namely basic model A, basic model B, basic model C and basic model D, and the sample set is divided into sample subset 1, sample subset 2, sample subset 3 and sample subset 4. When determining the prediction set and prediction set of each basic model from the above four sample subsets, it is necessary to ensure that the sample subsets selected as the prediction set for each basic model are different. For example, for basic model A, sample subset 1, sample subset 2, and sample subset 3 can be selected as training sets, and sample subset 4 can be selected as prediction set; for basic model B, sample subset 1, sample subset 2, and sample subset 4 can be selected as training sets, and sample subset 3 can be selected as prediction set; for basic model C, sample subset 1, sample subset 3, and sample subset 4 can be selected as training sets, and sample subset 2 can be selected as prediction set; for basic model D, sample subset 2, sample subset 3, and sample subset 4 can be selected as training sets, and sample subset 1 can be selected as prediction set.
[0056] The second method is to obtain four basic models, namely basic model A, basic model B, basic model C, and basic model D. The sample set is divided into sample subset 1, sample subset 2, sample subset 3, sample subset 4, and sample subset 5. The prediction set of each model is determined from the five sample subsets. When the prediction set is determined, it is necessary to ensure that the sample subsets selected as the prediction set for each basic model are different. For example, for basic model A, sample subset 1, sample subset 2, sample subset 3, and sample subset 4 can be selected as training sets, and sample subset 5 can be selected as prediction sets; for basic model B, sample subset 1, sample subset 2, sample subset 3, and sample subset 5 can be selected as training sets, and sample subset 4 can be selected as prediction sets; for basic model C, sample subset 1, sample subset 3, sample subset 4, and sample subset 5 can be selected as training sets, and sample subset 2 can be selected as prediction sets; for basic model D, sample subset 2, sample subset 3, sample subset 4, and sample subset 5 can be selected as training sets, and sample subset 1 can be selected as prediction sets.
[0057] Step S206: using the training sets corresponding to the basic models, respectively train the basic models, and use the trained basic models to respectively predict the sample text data in the prediction sets corresponding to the basic models to obtain prediction results.
[0058] In an embodiment of the present application, for each of the multiple basic models obtained, after determining the prediction set and training set corresponding to each basic model from multiple sample subsets, each basic model can be trained separately using the training set corresponding to each basic model, and then the trained basic models can be used to predict the sample text data in the prediction set corresponding to each basic model to obtain the prediction data of the sample text data in the prediction set corresponding to each basic model, and for any basic model, the prediction data and the sample text data are integrated into a prediction result.
[0059] For example, citing the example of the first method in the above step S204, for basic model A, sample subset 1, sample subset 2, and sample subset 3 are used to train basic model A, and then the trained basic model A is used to predict the sample text data in sample subset 4 to obtain prediction data a, and the prediction data a and the sample text data in sample subset 4 are integrated into prediction result A1; for basic model B, sample subset 1, sample subset 2, and sample subset 4 are used to train basic model B, and then the trained basic model B is used to predict the sample text data in sample subset 3 to obtain prediction data b, and the prediction data b and the sample text data in sample subset 3 are integrated into prediction result A1. This data is integrated into the prediction result B1; for the basic model C, the sample subset 1, sample subset 3, and sample subset 4 are used to train the basic model C, and then the trained basic model C is used to predict the sample text data in the sample subset 2 to obtain the predicted data c, and the predicted data c and the sample text data in the sample subset 2 are integrated into the prediction result C1; for the basic model D, the sample subset 2, sample subset 3, and sample subset 4 are used to train the basic model D, and then the trained basic model D is used to predict the sample text data in the sample subset 1 to obtain the predicted data d, and the predicted data d and the sample text data in the sample subset 1 are integrated into the prediction result D1.
[0060] Step S208: Integrate the prediction results obtained for each basic model into a target training set, and use the target training set to train the pre-built initial text processing model to obtain a fused text processing model.
[0061] In an embodiment of the present application, the prediction results obtained for each basic model are integrated into a target training set, and the pre-built initial text processing model is trained using the target training set to obtain a fused text processing model.
[0062] Exemplarily, referring to the example in the above step S206, prediction results A1, prediction results B1, prediction results C1, and prediction results D1 are integrated into a target training set, and the pre-built initial text processing model is trained using the target training set to obtain a fused text processing model.
[0063] In an embodiment of the present application, in order to make the model more comparable, the method of pre-constructing the initial text processing model includes: constructing the initial text processing model according to the model size, word segmentation rules and task type of each basic model.
[0064] Apply the scheme of the embodiment of the present application, obtain a sample set and multiple basic models, divide the sample set into multiple sample subsets, wherein the sample set includes multiple sample text data, and the multiple basic models are neural network models that respectively implement different text processing tasks; determine the prediction set and training set corresponding to each basic model from the multiple sample subsets, wherein the sample subset selected as the prediction set for each basic model is different; use the training set corresponding to each basic model to train each basic model respectively, and use the trained basic models to predict the sample text data in the prediction set corresponding to each basic model respectively to obtain the prediction result; integrate the prediction results obtained for each basic model into a target training set, use the target training set to train the pre-built initial text processing model, and obtain a fused text processing model. It realizes the full mining of the feature details of each basic model, especially when the performance of the basic model is unclear, the features of different basic models can be integrated to improve the generalization of the text processing model, further improve the accuracy of text processing, and reduce the errors caused by human factors.
[0065] based on Figure 2 In the embodiment shown, step S206 can be specifically performed as follows: Figure 3 The flowchart shown implements, Figure 3 A flowchart of a second text processing model training method provided in an embodiment of the present application is shown, and the method specifically comprises the following steps:
[0066] Step S2062: for the first basic model, extracting sample text data corresponding to the first basic model from a training set corresponding to the first basic model, wherein the first basic model is any one of the basic models.
[0067] Step S2064: perform word segmentation processing on the sample text data using preset word segmentation rules.
[0068] Step S2066: Input each word after the word segmentation processing into the first basic model to obtain the processing result of the sample text data.
[0069] Step S2068: Obtain a loss value according to the processing result of the sample text data and the label carried by the sample text data.
[0070] Step S2070: If the loss value is greater than the preset threshold, adjust the parameters of the first basic model and return to execute step S2062.
[0071] Step S2072: If the loss value is less than or equal to the preset threshold, the training is stopped to obtain the trained first basic model.
[0072] In an embodiment of the present application, for each basic model obtained, after determining the prediction set and training set corresponding to each basic model from multiple sample subsets, the sample text data corresponding to each basic model is extracted from the training set corresponding to each basic model, and the extracted sample text data is segmented using preset word segmentation rules.
[0073] Exemplarily, a word library is set in advance, and the sample text data "Apples are really sweet, but the price is too expensive" is matched with the preset word library, and the word segmentation results of the sample text data are "apple", "sweet", "price", and "expensive". The words obtained by the word segmentation are input into the first basic model to obtain the processing result of the sample text data. The loss value is obtained based on the processing result of the sample text data and the label carried by the sample text data. If the loss value is greater than a preset threshold, the parameters of the first basic model are adjusted, and the process returns to step S2062. When the preset training stop condition is met, the iteration is stopped to obtain the trained resume document recognition model; if the loss value is less than or equal to the preset threshold, the training is stopped to obtain the trained first basic model, wherein the preset training stop condition and the preset threshold are selected according to the actual situation, and the embodiment of the present application does not impose any limitation on this.
[0074] By extracting sample text data from the training set and performing word segmentation on the sample text data, we can effectively obtain sample information and avoid information loss. Based on the processing results of the sample text data and the labels carried by the sample text data, we can obtain the loss value. If the loss value is greater than the preset threshold, we can adjust the parameters of the basic model to make the text processing model more accurate, thereby improving the efficiency and accuracy of text processing.
[0075] Figure 4 A flowchart of a third text processing model training method provided in an embodiment of the present application is shown, and the method specifically comprises the following steps:
[0076] Step S402: Obtain a sample set and multiple basic models, and divide the sample set into multiple sample subsets, wherein the sample set includes multiple sample text data, and the multiple basic models are neural network models that respectively implement different text processing tasks.
[0077] Step S404: determining prediction sets and training sets corresponding to the respective basic models from the plurality of sample subsets, wherein the sample subset selected as the prediction set for each basic model is different.
[0078] Step S406: using the training sets corresponding to the basic models, respectively train the basic models, and use the trained basic models to respectively predict the sample text data in the prediction sets corresponding to the basic models to obtain prediction results.
[0079] The descriptions of steps S402, S404, and S406 are the same as those of steps S202, S204, and S206, and thus will not be repeated in this embodiment.
[0080] Step S408: For each basic model, the pre-set test sets corresponding to each basic model are respectively input into each basic model, each basic model is tested, and the test results corresponding to each basic model are obtained.
[0081] In an embodiment of the present application, in order to improve the accuracy of the text processing model, for each basic model, the pre-set test sets corresponding to each basic model are input into each basic model respectively, and each basic model is tested to obtain the test results corresponding to each basic model.
[0082] Exemplarily, a test set A pre-set for basic model A is obtained, and test set A is input into basic model A, to obtain an accuracy of basic model A of 70%; a test set B pre-set for basic model B is obtained, and test set B is input into basic model B, to obtain an accuracy of basic model B of 66%; a test set C pre-set for basic model C is obtained, and test set C is input into basic model C, to obtain an accuracy of basic model C of 72%; a test set D pre-set for basic model D is obtained, and test set D is input into basic model D, to obtain an accuracy of basic model D of 50%.
[0083] Step S410: Output the test results of each basic model.
[0084] Step S412: Integrate the prediction results obtained for each basic model into a target training set, and use the target training set to train the pre-built initial text processing model to obtain a fused text processing model.
[0085] The description of step S412 is the same as that of step S208, and will not be repeated in this embodiment.
[0086] The scheme of the embodiment of the present application is applied, by obtaining a sample set and multiple basic models, the sample set is divided into multiple sample subsets, wherein the sample set includes multiple sample text data, and the multiple basic models are neural network models that respectively implement different text processing tasks; the prediction set and training set corresponding to each basic model are determined from the multiple sample subsets, wherein the sample subset selected as the prediction set for each basic model is different; the training set corresponding to each basic model is used to train each basic model respectively, and the trained basic models are used to predict the sample text data in the prediction set corresponding to each basic model respectively to obtain the prediction result; the prediction results obtained for each basic model are integrated into the target training set, and the pre-built initial text processing model is trained using the target training set to obtain the fused text processing model. It is realized to fully explore the feature details of each basic model, fuse the features of different basic models, improve the generalization of the text processing model, and further improve the accuracy of text processing. By outputting the test results of each basic model, the prediction ability of the model is made transparent for subsequent processing.
[0087] Figure 5 A flowchart of a fourth text processing model training method provided in an embodiment of the present application is shown, and the method specifically comprises the following steps:
[0088] Step S502: Obtain a sample set and multiple basic models, and divide the sample set into multiple sample subsets, wherein the sample set includes multiple sample text data, and the multiple basic models are neural network models that respectively implement different text processing tasks.
[0089] Step S504: determining prediction sets and training sets corresponding to the respective basic models from the multiple sample subsets, wherein the sample subset selected as the prediction set for each basic model is different.
[0090] Step S506: using the training sets corresponding to the basic models, respectively train the basic models, and use the trained basic models to respectively predict the sample text data in the prediction sets corresponding to the basic models to obtain prediction results.
[0091] Step S508: For each basic model, the pre-set test sets corresponding to each basic model are respectively input into each basic model, each basic model is tested, and the test results corresponding to each basic model are obtained.
[0092] The descriptions of steps S502, S504, S506, and S508 are the same as those of steps S202, S204, S206, and S308, and will not be repeated in this embodiment.
[0093] Step S510: Compare the test results corresponding to the basic models to determine the target basic model whose test results meet the preset test conditions.
[0094] In an embodiment of the present application, after obtaining the test results corresponding to each basic model, the test results of each basic model are compared to determine the target basic model whose test results meet the preset test conditions. The preset test conditions are selected based on actual conditions, and the present application does not impose any limitations on this.
[0095] Exemplarily, citing the example in the above step S408, the accuracies of basic model A, basic model B, basic model C, and basic model D are compared. If the accuracies corresponding to the above four basic models are 70%, 66%, 72%, and 50%, respectively, and the preset test condition is that the accuracy is greater than 70%, then it can be determined that the target basic model whose test results meet the preset test conditions is basic model C.
[0096] Step S512: adjusting the proportion of sample text data in the prediction set selected for the target basic model according to a preset adjustment proportion.
[0097] In an embodiment of the present application, the proportion of sample text data in the prediction set selected for the target basic model is adjusted according to a preset adjustment ratio. That is, the proportion of the prediction set selected for the target basic model in the training set serving as the initial text model is adjusted. Taking the aforementioned target basic model that best meets the preset test conditions as the basic model C as an example, the proportion of the prediction set corresponding to the basic model C in the training set serving as the initial text model can be increased, wherein the preset adjustment ratio cannot be much higher than its original average value, for example, the ratio adjusted each time is 1%, which is specifically selected according to the actual situation, and the embodiment of the present application does not impose any limitation on this. In this way, the model can have a higher recall rate while ensuring the original accuracy of the model.
[0098] Step S514: Integrate the prediction results obtained for each basic model into a target training set, and use the target training set to train the pre-built initial text processing model to obtain a fused text processing model.
[0099] The description of step S514 is the same as that of step S208, and will not be repeated in this embodiment.
[0100] The scheme of the embodiment of the present application is applied to obtain a sample set and multiple basic models, and the sample set is divided into multiple sample subsets, wherein the sample set includes multiple sample text data, and the multiple basic models are neural network models that respectively implement different text processing tasks; the prediction set and training set corresponding to each basic model are determined from the multiple sample subsets, wherein the sample subset selected as the prediction set for each basic model is different; the training set corresponding to each basic model is used to train each basic model respectively, and the trained basic models are used to predict the sample text data in the prediction set corresponding to each basic model respectively to obtain the prediction result; the prediction results obtained for each basic model are integrated into the target training set, and the pre-built initial text processing model is trained using the target training set to obtain the fused text processing model. It is realized to fully explore the feature details of each basic model, fuse the features of different basic models, improve the generalization of the text processing model, and further improve the accuracy of text processing. At the same time, according to the task requirements or on the premise of knowing that some basic models perform higher, by adjusting the proportion of sample text data in the prediction set selected for the target basic model, the model can have a higher recall rate on the basis of ensuring the original accuracy of the model.
[0101] Figure 6 A flowchart of a fifth text processing model training method provided in an embodiment of the present application is shown, and the method specifically comprises the following steps:
[0102] Step S602: Obtain a sample set and multiple basic models, and divide the sample set into multiple sample subsets, wherein the sample set includes multiple sample text data, and the multiple basic models are neural network models that respectively implement different text processing tasks.
[0103] Step S604: determining prediction sets and training sets corresponding to the respective basic models from the multiple sample subsets, wherein the sample subset selected as the prediction set for each basic model is different.
[0104] Step S606: using the training sets corresponding to the basic models, respectively train the basic models, and use the trained basic models to respectively predict the sample text data in the prediction sets corresponding to the basic models to obtain prediction results.
[0105] Step S608: Integrate the prediction results obtained for each basic model into a target training set, and use the target training set to train the pre-built initial text processing model to obtain a fused text processing model.
[0106] The descriptions of steps S602, S604, S606, and S608 are the same as those of steps S202, S204, S206, and S208, and thus will not be repeated in this embodiment.
[0107] Step S610: Generate a fusion test set based on the test sets set for each basic model.
[0108] Step S612: input the fusion test set into the fusion text processing model, test the fusion text processing model, and obtain the fusion test result.
[0109] Step S614: Output the fusion test result.
[0110] In an embodiment of the present application, after obtaining the fused text processing model, a fused test set is generated based on the test sets set for each basic model, the fused test set is input into the fused text processing model, the fused text processing model is tested, the fused test result is obtained, and the fused test result is output.
[0111] It should be noted that the way to generate the fusion test set can be to select a part of each test set. For example, if there are n test sets, 1 / n of the data is selected from each test set to form the fusion test set. In this way, the fusion test set contains text data with the characteristics of each basic model, which can better test the generalization of the fusion text processing model.
[0112] The scheme of the embodiment of the present application is applied, by obtaining a sample set and multiple basic models, the sample set is divided into multiple sample subsets, wherein the sample set includes multiple sample text data, and the multiple basic models are neural network models that respectively implement different text processing tasks; the prediction set and training set corresponding to each basic model are determined from the multiple sample subsets, wherein the sample subset selected as the prediction set for each basic model is different; the training set corresponding to each basic model is used to train each basic model respectively, and the trained basic models are used to predict the sample text data in the prediction set corresponding to each basic model respectively to obtain the prediction result; the prediction results obtained for each basic model are integrated into the target training set, and the pre-built initial text processing model is trained using the target training set to obtain the fused text processing model. The feature details of each basic model are fully mined, especially when the performance of the basic model is unclear, the features of different basic models can be integrated to improve the generalization of the text processing model, further improve the accuracy of text processing, and reduce the errors caused by human factors.
[0113] Figure 7 A flowchart of a first text processing method provided by an embodiment of the present application is shown, and the method specifically comprises the following steps:
[0114] Step S702: Obtain the text to be processed.
[0115] In the embodiment of the present application, the form of the text to be processed may include many kinds, including but not limited to txt, doc, docx, etc., which is selected according to the actual situation, and the embodiment of the present application does not impose any limitation on this.
[0116] Step S704: Input the text to be processed into the fused text processing model to obtain the processing result of the text to be processed, wherein the fused text processing model is to use Figures 2 to 6 The text processing model training method shown is used for training.
[0117] Apply the scheme of the embodiment of the present application, obtain the text to be processed, input the text to be processed into the text processing model, and obtain the processing result of the text to be processed. Specifically, in the process of training the text processing model, by obtaining a sample set and multiple basic models, the sample set is divided into multiple sample subsets, wherein the sample set includes multiple sample text data, and the multiple basic models are neural network models that respectively implement different text processing tasks; determine the prediction set and training set corresponding to each basic model from the multiple sample subsets, wherein the sample subset selected as the prediction set for each basic model is different; use the training set corresponding to each basic model to train each basic model respectively, and use the trained basic models to predict the sample text data in the prediction set corresponding to each basic model respectively, and obtain the prediction result; integrate the prediction results obtained for each basic model into a target training set, and use the target training set to train the pre-built initial text processing model to obtain a fused text processing model. It realizes the full mining of the feature details of each basic model, especially when the performance of the basic model is unclear, the features of different basic models can be integrated to improve the generalization of the text processing model, further improve the accuracy of text processing, and reduce the errors caused by human factors.
[0118] Figure 8 A flowchart of a second text processing method provided by an embodiment of the present application is shown, and the method specifically comprises the following steps:
[0119] Step S802: Obtain the original processed text.
[0120] Step S804: Using preset word segmentation rules, the original processing text is segmented to obtain a text to be processed.
[0121] In an embodiment of the present application, after obtaining the original processing text, the original processing text can be segmented using preset word segmentation rules to obtain the text to be processed.
[0122] Exemplarily, a word library is set in advance, and the original processing text "The weather is really nice today" is matched with the pre-set word library, and the word segmentation results of the original processing text are "today", "weather", "real", and "good", and "today", "weather", "real", and "good" are used as the final text to be processed.
[0123] Step S806: Input the text to be processed into the fused text processing model to obtain the processing result of the text to be processed, wherein the fused text processing model is to use Figures 2 to 6 The text processing model training method shown is used for training.
[0124] Among them, step S806 is the same as step S704, and will not be described in detail in this embodiment.
[0125] By applying the solution of the embodiment of the present application, the original processing text is obtained, and the original processing text is segmented using preset word segmentation rules to obtain the text to be processed, thereby improving the efficiency of text processing.
[0126] Fig. 9 A flowchart of a third text processing method provided by an embodiment of the present application is shown, and the method specifically comprises the following steps:
[0127] Step S902: Obtain the text to be processed.
[0128] Among them, step S902 is the same as step S702, and will not be described in detail in this embodiment.
[0129] Step S904: input the text to be processed into the fused text processing model to obtain a processing result integrating multiple text tasks.
[0130] In an embodiment of the present application, the fused text processing model is trained based on multiple basic models, each basic model implements different text tasks, and by inputting the text to be processed into the fused text processing model, the obtained processing result integrates the characteristics of multiple text tasks, thereby further improving the accuracy of text processing.
[0131] Fig.10 A schematic diagram of a text processing process provided by an embodiment of the present application is shown, and the process specifically includes:
[0132] A sample set and four basic models are obtained. The four basic models are basic model A, basic model B, basic model C and basic model D. The sample set is divided equally into sample subset 1, sample subset 2, sample subset 3 and sample subset 4 according to the number of basic models.
[0133] For basic model A, sample subset 1, sample subset 2, and sample subset 3 are selected as the training sets of basic model A, and sample subset 4 is used as the prediction set of basic model A; for basic model B, sample subset 1, sample subset 2, and sample subset 4 are selected as the training sets of basic model B, and sample subset 3 is used as the prediction set of basic model B; for basic model C, sample subset 1, sample subset 3, and sample subset 4 are selected as the training sets of basic model C, and sample subset 2 is used as the prediction set of basic model C; for basic model D, sample subset 2, sample subset 3, and sample subset 4 are selected as the training sets of basic model D, and sample subset 1 is used as the prediction set of basic model D.
[0134] For basic model A, basic model A is trained using sample subsets 1, sample subsets 2, and sample subsets 3, and then the trained basic model A is used to predict the sample text data in sample subset 4 to obtain prediction data a, and the prediction data a and the sample text data in sample subset 4 are integrated into prediction result A1; for basic model B, basic model B is trained using sample subsets 1, sample subsets 2, and sample subsets 4, and then the trained basic model B is used to predict the sample text data in sample subset 3 to obtain prediction data b, and the prediction data b and the sample text data in sample subset 3 are integrated into prediction result B1; For the basic model C, the sample subset 1, sample subset 3, and sample subset 4 are used to train the basic model C, and then the trained basic model C is used to predict the sample text data in the sample subset 2 to obtain the predicted data c, and the predicted data c and the sample text data in the sample subset 2 are integrated into the prediction result C1; for the basic model D, the sample subset 2, sample subset 3, and sample subset 4 are used to train the basic model D, and then the trained basic model D is used to predict the sample text data in the sample subset 1 to obtain the predicted data d, and the predicted data d and the sample text data in the sample subset 1 are integrated into the prediction result D1.
[0135] The prediction results A1, B1, C1, and D1 are integrated into a target training set. The pre-built initial text processing model is trained using the target training set to obtain a fused text processing model.
[0136] According to test set A of basic model A, test set B of basic model B, test set C of basic model C and test set D of basic model D, obtain test set A2 corresponding to basic model A, test set B2 corresponding to basic model B, test set C2 corresponding to basic model C and test set D2 corresponding to basic model D, then generate a fusion test set based on test set A2, test set B2, test set C2 and test set D2, input the fusion test set into the fusion text processing model, test the fusion text processing model, obtain the fusion test result, and output the fusion test result.
[0137] Apply the scheme of the embodiment of the present application, obtain a sample set and multiple basic models, divide the sample set into multiple sample subsets, wherein the sample set includes multiple sample text data, and the multiple basic models are neural network models that respectively implement different text processing tasks; determine the prediction set and training set corresponding to each basic model from the multiple sample subsets, wherein the sample subset selected as the prediction set for each basic model is different; use the training set corresponding to each basic model to train each basic model respectively, and use the trained basic models to predict the sample text data in the prediction set corresponding to each basic model respectively to obtain the prediction result; integrate the prediction results obtained for each basic model into a target training set, use the target training set to train the pre-built initial text processing model, and obtain a fused text processing model. It realizes the full mining of the feature details of each basic model, especially when the performance of the basic model is unclear, the features of different basic models can be integrated to improve the generalization of the text processing model, further improve the accuracy of text processing, and reduce the errors caused by human factors.
[0138] Corresponding to the above method embodiment, the present application also provides an embodiment of a training device for a text processing model. Fig.11 FIG. 1 is a schematic diagram showing a structure of a training device for a text processing model provided by an embodiment of the present application. Fig.11 As shown, the device comprises:
[0139] The first acquisition module 1102 is configured to acquire a sample set and a plurality of basic models, and divide the sample set into a plurality of sample subsets, wherein the sample set includes a plurality of sample text data, and the plurality of basic models are neural network models for respectively realizing different text processing tasks;
[0140] A first determination module 1104 is configured to determine a prediction set and a training set corresponding to each basic model from a plurality of sample subsets, wherein a different sample subset is selected as a prediction set for each basic model;
[0141] The prediction module 1106 is configured to use the training sets corresponding to the basic models to train the basic models respectively, and use the trained basic models to predict the sample text data in the prediction sets corresponding to the basic models to obtain prediction results;
[0142] The model training module 1108 is configured to integrate the prediction results obtained for each basic model into a target training set, and use the target training set to train the pre-built initial text processing model to obtain a fused text processing model.
[0143] Optionally, the prediction module 1106 is further configured to extract, for the first basic model, sample text data corresponding to the first basic model from the training set corresponding to the first basic model, wherein the first basic model is any one of the basic models; perform word segmentation on the sample text data using a preset word segmentation rule; input each word after the word segmentation processing into the first basic model to obtain a processing result of the sample text data; obtain a loss value based on the processing result of the sample text data and the label carried by the sample text data; if the loss value is greater than a preset threshold, adjust the parameters of the first basic model, and return to execute the step of extracting the sample text data corresponding to the first basic model from the training set corresponding to the first basic model; if the loss value is less than or equal to the preset threshold, stop training to obtain the trained first basic model.
[0144] Optionally, the basic models have the same model size, the same word segmentation rules, and the same task type.
[0145] Optionally, the model training module 1108 is further configured to construct an initial text processing model according to the model size, word segmentation rules and task type of each basic model.
[0146] Optionally, after the prediction module 1106, the device further includes:
[0147] The first testing module is configured to input the pre-set test sets corresponding to the basic models into the basic models respectively, test the basic models, and obtain the test results corresponding to the basic models;
[0148] The first output module is configured to output the test results of each basic model.
[0149] Optionally, after the model training module 1108, the device further includes:
[0150] A generation module is configured to generate a fusion test set based on the test sets respectively set for each basic model;
[0151] The second testing module is configured to input the fusion test set into the fusion text processing model, test the fusion text processing model, and obtain the fusion test result;
[0152] The second output module is configured to output the fusion test result.
[0153] Optionally, after the prediction module 1106, the device further includes:
[0154] A second determination module is configured to compare the test results corresponding to the basic models and determine a target basic model whose test results meet the preset test conditions;
[0155] The adjustment module is configured to adjust the proportion of sample text data in the prediction set selected for the target basic model according to a preset adjustment ratio.
[0156] Apply the scheme of the embodiment of this specification to obtain a sample set and multiple basic models, divide the sample set into multiple sample subsets, wherein the sample set includes multiple sample text data, and the multiple basic models are neural network models that respectively implement different text processing tasks; determine the prediction set and training set corresponding to each basic model from the multiple sample subsets, wherein the sample subset selected as the prediction set for each basic model is different; use the training set corresponding to each basic model to train each basic model respectively, and use the trained basic models to predict the sample text data in the prediction set corresponding to each basic model to obtain the prediction result; integrate the prediction results obtained for each basic model into a target training set, use the target training set to train the pre-built initial text processing model, and obtain a fused text processing model. It fully exploits the feature details of each basic model, fuses the features of different basic models, improves the generalization of the text processing model, further improves the accuracy of text processing, and reduces the errors caused by human factors.
[0157] The above is a schematic scheme of a text processing model training device of the present embodiment. It should be noted that the technical scheme of the text processing model training device and the technical scheme of the text processing model training method mentioned above belong to the same concept. For the details not described in detail in the technical scheme of the text processing model training device, please refer to the description of the technical scheme of the text processing model training method mentioned above. In addition, each component in the device embodiment should be understood as a functional module that must be established to implement each step of the program flow or each step of the method, and each functional module is not an actual functional division or separation definition. The device defined by such a group of functional modules should be understood as a functional module architecture that mainly implements the solution through the computer program recorded in the specification, and should not be understood as a physical device that mainly implements the solution through hardware.
[0158] Corresponding to the above method embodiment, the present application also provides a text processing device embodiment, Fig.12 FIG. 1 shows a schematic diagram of the structure of a text processing device provided by an embodiment of the present application. Fig.12 As shown, the device comprises:
[0159] The second acquisition module 1202 is configured to acquire the text to be processed;
[0160] The processing module 1204 is configured to input the text to be processed into the fused text processing model to obtain the processing result of the text to be processed, wherein the fused text processing model is trained using the above-mentioned text processing model training method.
[0161] Optionally, the second acquisition module 1202 is further configured to acquire an original processing text; perform word segmentation processing on the original processing text using a preset word segmentation rule to obtain a text to be processed.
[0162] Optionally, the processing module 1204 is further configured to input the text to be processed into a fused text processing model to obtain a processing result integrating multiple text tasks.
[0163] The scheme of the embodiment of this specification is applied to obtain the text to be processed, input the text to be processed into the fused text processing model, and obtain the processing result of the text to be processed, wherein, in the process of training the text processing model, by obtaining the sample set and multiple basic models, the sample set is divided into multiple sample subsets; the prediction set and training set corresponding to each basic model are determined from the multiple sample subsets, wherein the sample subset selected as the prediction set for each basic model is different; the training set corresponding to each basic model is used to train each basic model respectively, and the trained basic models are used to predict the sample text data in the prediction set corresponding to each basic model respectively to obtain the prediction result; the prediction results obtained for each basic model are integrated into the target training set, and the pre-built initial text processing model is trained using the target training set to obtain the fused text processing model. It realizes the full mining of the feature details of each basic model, the fusion of the features of different basic models, the improvement of the generalization of the text processing model, the further improvement of the accuracy of text processing, and the reduction of errors caused by human factors.
[0164] The above is a schematic scheme of the text processing device of this embodiment. It should be noted that the technical scheme of the text processing device and the technical scheme of the above-mentioned text processing method belong to the same concept. For details not described in detail in the technical scheme of the text processing device, please refer to the description of the technical scheme of the above-mentioned text processing method. In addition, the various components in the device embodiment should be understood as functional modules that must be established to implement each step of the program flow or each step of the method, and each functional module is not actually divided or separated. The device defined by such a group of functional modules should be understood as a functional module architecture that mainly implements the solution through the computer program recorded in the specification, and should not be understood as a physical device that mainly implements the solution through hardware.
[0165] Fig.13 The structure block diagram of a computing device 1300 provided in an embodiment of the present application is shown. The components of the computing device 1300 include but are not limited to a memory 1310 and a processor 1320. The processor 1320 is connected to the memory 1310 via a bus 1330, and the database 1350 is used to store data.
[0166] The computing device 1300 also includes an access device 1340, which enables the computing device 1300 to communicate via one or more networks 1360. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 1340 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world microwave interconnection access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0167] In one embodiment of the present application, the above components of the computing device 1300 and Fig.13 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig.13 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0168] Computing device 1300 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. Computing device 1300 may also be a mobile or stationary server.
[0169] Among them, the processor 1320 is used to execute the following computer executable instructions: obtain a sample set and multiple basic models, divide the sample set into multiple sample subsets, wherein the sample set includes multiple sample text data, and the multiple basic models are neural network models that respectively implement different text processing tasks; determine the prediction set and training set corresponding to each basic model from the multiple sample subsets, wherein the sample subset selected as the prediction set for each basic model is different; use the training set corresponding to each basic model to train each basic model respectively, and use the trained basic models to predict the sample text data in the prediction set corresponding to each basic model to obtain prediction results; integrate the prediction results obtained for each basic model into a target training set, and use the target training set to train a pre-constructed initial text processing model to obtain a fused text processing model.
[0170] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the training method of the above-mentioned text processing model belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the training method of the above-mentioned text processing model.
[0171] Processor 1320 is also used to execute the following computer executable instructions: obtain the text to be processed; input the text to be processed into a text processing model to obtain a processing result of the text to be processed, wherein the text processing model is trained using the training method of the above-mentioned text processing model.
[0172] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above text processing method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above text processing method.
[0173] An embodiment of the present application also provides a computer-readable storage medium, which stores computer instructions, which when executed by a processor are used to: obtain a sample set and multiple basic models, divide the sample set into multiple sample subsets, wherein the sample set includes multiple sample text data, and the multiple basic models are neural network models that respectively implement different text processing tasks; determine a prediction set and a training set corresponding to each basic model from the multiple sample subsets, wherein a different sample subset is selected as the prediction set for each basic model; use the training set corresponding to each basic model to train each basic model, and use the trained basic models to predict the sample text data in the prediction set corresponding to each basic model to obtain a prediction result; integrate the prediction results obtained for each basic model into a target training set, and use the target training set to train a pre-constructed initial text processing model to obtain a fused text processing model.
[0174] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the training method of the above-mentioned text processing model belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the training method of the above-mentioned text processing model.
[0175] An embodiment of the present specification also provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, are used to: obtain a text to be processed; input the text to be processed into a text processing model to obtain a processing result of the text to be processed, wherein the text processing model is trained using the training method of the above-mentioned text processing model.
[0176] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above text processing method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above text processing method.
[0177] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0178] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0179] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0180] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0181] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the present application. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can understand and use the present application well. The present application is only limited by the claims and their full scope and equivalents.
Claims
1. A training method for a text processing model, characterized in that: include: Acquire a sample set and a plurality of basic models, and divide the sample set into a plurality of sample subsets, wherein the sample set includes a plurality of sample text data, and the plurality of basic models are neural network models that respectively implement different text processing tasks; Determining a prediction set and a training set corresponding to each basic model from the multiple sample subsets, wherein a different sample subset is selected as the prediction set for each basic model; Using the training sets corresponding to the basic models, respectively train the basic models, and use the trained basic models to respectively predict the sample text data in the prediction sets corresponding to the basic models, to obtain the prediction data of the sample text data in the prediction sets corresponding to the basic models, and for any of the basic models, integrate the prediction data and the sample text data into a prediction result; The prediction results obtained for the basic models are integrated into a target training set, and the pre-built initial text processing model is trained using the target training set to obtain a fused text processing model.
2. The method according to claim 1, characterized in that The step of respectively training each basic model using the training set corresponding to each basic model comprises: For a first basic model, extracting sample text data corresponding to the first basic model from a training set corresponding to the first basic model, wherein the first basic model is any one of the basic models; Using preset word segmentation rules, the sample text data is segmented; Inputting each word after word segmentation processing into the first basic model to obtain a processing result of the sample text data; Obtaining a loss value according to a processing result of the sample text data and a label carried by the sample text data; If the loss value is greater than a preset threshold, the parameters of the first basic model are adjusted, and the step of extracting sample text data corresponding to the first basic model from the training set corresponding to the first basic model is returned to be executed; If the loss value is less than or equal to the preset threshold, the training is stopped to obtain the first basic model after training.
3. The method according to claim 2, characterized in that The basic models have the same model size, the same word segmentation rules, and the same task type.
4. The method according to claim 2 or 3, characterized in that: The construction method of the initial text processing model includes: An initial text processing model is constructed according to the model size, word segmentation rules and task type of each basic model.
5. The method according to claim 1, characterized in that After the step of respectively training the basic models using the training sets corresponding to the basic models, the method further includes: For each basic model, input the pre-set test sets corresponding to each basic model into each basic model respectively, test each basic model, and obtain the test results corresponding to each basic model; Output the test results of each basic model.
6. The method according to claim 1 or 5, characterized in that: After the step of using the target training set to train the pre-built initial text processing model to obtain a fused text processing model, the method further includes: Generate a fusion test set based on the test sets respectively set for the basic models; Inputting the fusion test set into the fusion text processing model, testing the fusion text processing model, and obtaining a fusion test result; Output the fusion test result.
7. The method according to claim 5, characterized in that After the step of inputting the preset test sets corresponding to the basic models into the basic models respectively, testing the basic models, and obtaining the test results corresponding to the basic models, the method further includes: Compare the test results corresponding to the basic models to determine the target basic model whose test results meet the preset test conditions; According to a preset adjustment ratio, the ratio of sample text data in the prediction set selected for the target basic model is adjusted.
8. A text processing method, characterized in that: include: Get the text to be processed; The text to be processed is input into a fused text processing model to obtain a processing result of the text to be processed, wherein the fused text processing model is trained using the method described in any one of claims 1-7.
9. The method according to claim 8, characterized in that The step of obtaining the text to be processed includes: Get the original processed text; The original processing text is segmented using a preset word segmentation rule to obtain the text to be processed.
10. The method according to claim 8, characterized in that The fused text processing model is obtained by training based on multiple basic models, and each basic model implements different text tasks; The step of inputting the text to be processed into the fused text processing model to obtain the processing result of the text to be processed includes: The text to be processed is input into the fused text processing model to obtain a processing result integrating multiple text tasks.
11. A training device for a text processing model, characterized in that: include: A first acquisition module is configured to acquire a sample set and a plurality of basic models, and divide the sample set into a plurality of sample subsets, wherein the sample set includes a plurality of sample text data, and the plurality of basic models are neural network models that respectively implement different text processing tasks; A first determination module is configured to determine a prediction set and a training set corresponding to each basic model from the multiple sample subsets, wherein a different sample subset is selected as the prediction set for each basic model; The prediction module is configured to use the training sets corresponding to the basic models to train the basic models respectively, and use the trained basic models to predict the sample text data in the prediction sets corresponding to the basic models respectively, to obtain the prediction data of the sample text data in the prediction sets corresponding to the basic models, and for any of the basic models, to integrate the prediction data and the sample text data into a prediction result; The model training module is configured to integrate the prediction results obtained for the basic models into a target training set, and use the target training set to train the pre-built initial text processing model to obtain a fused text processing model.
12. A text processing device, characterized in that: include: A second acquisition module is configured to acquire the text to be processed; The processing module is configured to input the text to be processed into a fused text processing model to obtain a processing result of the text to be processed, wherein the fused text processing model is trained using the method described in any one of claims 1-7.
13. A computing device, characterized in that: include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the steps of any one of claims 1 to 7 or any one of claims 8 to 10.
14. A computer-readable storage medium storing computer instructions, characterized in that: When the instruction is executed by a processor, the steps of any one of claims 1 to 7 or any one of claims 8 to 10 are implemented.
Citation Information
Patent Citations
Language model training method and device, electronic equipment and computer readable medium
CN112966712A
Resume document recognition model training method and resume document recognition method and device
CN114120341A