Model training method, device, system and storage medium
By preprocessing training data under different labeling systems, the problems of decreased model training performance and data waste caused by label changes are solved, thereby improving the model's training performance and the ability to recognize new labels.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ALIBABA (CHINA) CO LTD
- Filing Date
- 2023-02-01
- Publication Date
- 2026-07-24
AI Technical Summary
Existing technologies use training data labeled with the previous labeling system to train new models when the labeling system changes, which leads to a decline in model training performance or waste of labeled data.
By preprocessing training data under different labeling systems, including masking and/or removal, we can ensure that training data under different labeling systems participate in model training, avoid the influence of historical data on the new labels of the model, and make full use of historical data.
This improved the model training effect, avoided the waste of labeled data, and ensured the model's ability to recognize new labels.
Smart Images

Figure CN116010820B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence, and in particular to a model training method, device, system and storage medium. Background Technology
[0002] Intelligent dialogue systems are the product of the integration of technologies such as natural language processing, artificial intelligence, and machine learning. They allow users to communicate with intelligent robots through voice and text, while the intelligent robots respond to users based on technologies such as speech recognition, natural language understanding, natural language generation, and speech synthesis.
[0003] Typically, intelligent robots have pre-trained dialogue models built in. These models mainly involve dialogue understanding, dialogue strategies, and dialogue generation. Dialogue understanding refers to the understanding of the dialogue content input by the user, which can be achieved by training the model with a large amount of labeled dialogue data.
[0004] However, the labeling system of the data used for training dialogue models often changes. If training data labeled with the previous labeling system is used to train a new model, the training data may contain data corresponding to the new labels. These data are marked as 0 by default, but should actually be marked as the new labels, which will affect the training effect of the model. Summary of the Invention
[0005] This application provides a model training method, device, system, and storage medium that can simultaneously use training data labeled with different label systems for model training, thereby improving the model training effect.
[0006] A first aspect of this application provides a model training method, the method comprising:
[0007] Obtain multiple datasets for model training and an initial deep learning model; the label data in the multiple datasets are different, and the multiple datasets include a first dataset and a second dataset, wherein the label data of the first dataset is the label data for model training;
[0008] The labeled data of the second dataset is preprocessed to obtain the preprocessed labeled data of the second dataset;
[0009] The initial deep learning model is trained based on the preprocessed labeled data of the second dataset and the labeled data of the first dataset; the labeled data is used to indicate the labels and label positions corresponding to the data in the dataset.
[0010] In an optional embodiment of the first aspect of this application, the labeled data of the second dataset is preprocessed, including at least one of the following:
[0011] Masking is applied to a portion of the labels in the labeled data of the second dataset;
[0012] Remove some of the labeled data from the second dataset.
[0013] In an optional embodiment of the first aspect of this application, the label data of the second dataset is a subset of the label data of the first dataset; preprocessing the labeled data of the second dataset to obtain preprocessed labeled data of the second dataset includes:
[0014] A portion of the labels in the labeled data of the second dataset is masked to obtain the masked labeled data of the second dataset.
[0015] In an optional embodiment of the first aspect of this application, a portion of the labels in the labeled data of the second dataset is masked, including:
[0016] By comparing the label data of the first dataset with the label data of the second dataset, the first label missing in the second dataset compared to the first dataset is determined;
[0017] The first label in the labeled data of the second dataset is masked.
[0018] In an optional embodiment of the first aspect of this application, the label data of the first dataset is a subset of the label data of the second dataset; preprocessing the labeled data of the second dataset to obtain preprocessed labeled data of the second dataset includes:
[0019] Remove some of the labeled data from the second dataset to obtain the labeled data of the second dataset after the removal process.
[0020] In an optional embodiment of the first aspect of this application, removing a portion of the labeled data from the second dataset includes:
[0021] By comparing the label data of the first dataset with the label data of the second dataset, a second label unique to the second dataset compared to the first dataset is determined.
[0022] Remove the labeled data of the second label from the second dataset.
[0023] A second aspect of this application provides a model training method, comprising:
[0024] The system receives a model training request from a client. The model training request includes multiple datasets for model training and an initial deep learning model. The label data in the multiple datasets are different. The multiple datasets include a first dataset and a second dataset. The label data in the first dataset is the label data for model training.
[0025] The labeled data of the second dataset is preprocessed to obtain the preprocessed labeled data of the second dataset;
[0026] Based on the preprocessed labeled data of the second dataset and the labeled data of the first dataset, the initial deep learning model is trained, and the trained deep learning model is obtained when the loss function of the deep learning model converges; the labeled data is used to indicate the label and label position of the data in the dataset.
[0027] The trained deep learning model is returned to the client.
[0028] A third aspect of this application provides a model training apparatus, comprising:
[0029] The acquisition unit is used to acquire multiple datasets for model training and an initial deep learning model; the label data in the multiple datasets are different, and the multiple datasets include a first dataset and a second dataset, wherein the label data of the first dataset is the label data for model training;
[0030] The processing unit is used to preprocess the labeled data of the second dataset to obtain the preprocessed labeled data of the second dataset.
[0031] The processing unit is further configured to train the initial deep learning model based on the preprocessed labeled data of the second dataset and the labeled data of the first dataset; the labeled data is used to indicate the labels and label positions corresponding to the data in the dataset.
[0032] In an optional embodiment of the third aspect of this application, the processing unit preprocesses the labeled data of the second dataset, including at least one of the following:
[0033] Masking is applied to a portion of the labels in the labeled data of the second dataset;
[0034] Remove some of the labeled data from the second dataset.
[0035] In an optional embodiment of the third aspect of this application, the label data of the second dataset is a subset of the label data of the first dataset; the processing unit is configured to:
[0036] A portion of the labels in the labeled data of the second dataset is masked to obtain the masked labeled data of the second dataset.
[0037] In an optional embodiment of a third aspect of this application, the processing unit is configured to:
[0038] By comparing the label data of the first dataset with the label data of the second dataset, the first label missing in the second dataset compared to the first dataset is determined;
[0039] The first label in the labeled data of the second dataset is masked.
[0040] In an optional embodiment of the third aspect of this application, the label data of the first dataset is a subset of the label data of the second dataset; the processing unit is used to remove the annotation data of some labels in the second dataset and obtain the annotation data of the second dataset after the removal process.
[0041] In an optional embodiment of a third aspect of this application, the processing unit is configured to:
[0042] By comparing the label data of the first dataset with the label data of the second dataset, a second label unique to the second dataset compared to the first dataset is determined.
[0043] Remove the labeled data of the second label from the second dataset.
[0044] A fourth aspect of this application provides a model training apparatus, comprising:
[0045] A receiving unit is configured to receive a model training request from a client. The model training request includes multiple datasets for model training and an initial deep learning model. The label data in the multiple datasets are different. The multiple datasets include a first dataset and a second dataset. The label data in the first dataset is the label data for model training.
[0046] The processing unit is used to preprocess the labeled data of the second dataset to obtain the preprocessed labeled data of the second dataset.
[0047] The processing unit is further configured to train the initial deep learning model based on the preprocessed labeled data of the second dataset and the labeled data of the first dataset, and to obtain the trained deep learning model when the loss function of the deep learning model converges; the labeled data is used to indicate the label and label position of the data in the dataset.
[0048] The sending unit is used to return the trained deep learning model to the client.
[0049] The fifth aspect of this application provides a data processing system, including: an edge device and a cloud device;
[0050] The edge device is used to send a model training request to the cloud device. The model training request includes multiple datasets for model training and an initial deep learning model. The label data in the multiple datasets are different. The multiple datasets include a first dataset and a second dataset. The label data in the first dataset is the label data for model training.
[0051] The cloud-side device is used to preprocess the labeled data of the second dataset to obtain preprocessed labeled data of the second dataset; to train the initial deep learning model based on the preprocessed labeled data of the second dataset and the labeled data of the first dataset; to obtain the trained deep learning model when the loss function of the deep learning model converges; and to send the trained deep learning model to the edge device; wherein the labeled data is used to indicate the label and label position of the data in the dataset.
[0052] A sixth aspect of this application provides an electronic device, including: a memory, a processor, and a computer program; the computer program is stored in the memory and configured to be executed by the processor to implement the method as described in any of the first aspects of this application, or the method as described in the second aspect of this application.
[0053] A seventh aspect of this application provides a computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the method as described in any of the first aspects of this application, or the method as described in the second aspect of this application.
[0054] An eighth aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the method described in any of the first aspects of this application, or the method described in the second aspect of this application.
[0055] A ninth aspect of this application provides a chip, the chip including a processor, the processor being configured to invoke a computer program in memory to perform the method described in any of the first aspects of this application, or the method described in the second aspect of this application.
[0056] This application provides a model training method, device, system, and storage medium, relating to the field of artificial intelligence. Before model training, the labeled data of the first dataset from multiple acquired datasets is first determined as the labeled data for this model training. Since the labeled data of the first and second datasets are different, the labeled data of the second dataset (excluding the first dataset) needs to be preprocessed to obtain the preprocessed labeled data of the second dataset. Then, based on the preprocessed labeled data of the second dataset and the labeled data of the first dataset, an initial deep learning model is trained. When the model loss function converges, the trained deep learning model is obtained. The above scheme can make full use of datasets with different labels and avoid wasting historical labeled data. In addition, by preprocessing the labeled data of the second dataset, the training effect of the model can be improved. Attached Figure Description
[0057] Figure 1 This is a schematic diagram illustrating an application scenario of a model training method provided in an embodiment of this application.
[0058] Figure 2 A schematic flowchart illustrating a model training method provided in an embodiment of this application;
[0059] Figure 3 A schematic flowchart illustrating a model training method provided in an embodiment of this application;
[0060] Figure 4 This is a schematic diagram of a data item in a dataset provided in an embodiment of this application;
[0061] Figure 5 An example diagram illustrating the masking process of labeled data in a dataset, provided in an embodiment of this application;
[0062] Figure 6 This is a schematic diagram of the structure of a model training device provided in an embodiment of this application;
[0063] Figure 7 This is a schematic diagram of the structure of a model training device provided in an embodiment of this application;
[0064] Figure 8 This is a hardware structure diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0065] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, other embodiments obtained by those skilled in the art without creative effort are all within the scope of protection of this application.
[0066] In this application embodiment, "at least one" refers to one or more, and "multiple" refers to two or more. "And / or" describes the relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following associated objects are in an "or" relationship. "At least one of the following (kind / items)" or similar expressions refer to any combination of these items, including any combination of single (kind / items) or multiple (kind / items). For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0067] It should be noted that, in the embodiments of this application, the words "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design scheme described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0068] The following is a brief introduction to the technical terms used in the embodiments of this application.
[0069] First, multi-label classification: Multi-label classification refers to a task where a piece of data may have one or more labels. For each label, the data may be labeled as 1.
[0070] Second, the label system: the set of possible labels in a multi-label classification task.
[0071] Third, masking: In deep learning models, masking is an operation used to obscure data. Masking can be applied to input features, intermediate results, or training objectives. In this embodiment, the masking mechanism primarily targets the training objective, "labels."
[0072] When using deep learning models to perform multi-label classification on dialogue data, a large amount of labeled data is required. Before labeling the dialogue data, users usually define a labeling system, which includes multiple labels. For example, users can select existing labels on the model training platform or define their own labels.
[0073] In practical applications, the tagging system will change as business develops, especially with the addition of new tags. For example, the original tagging system for training a dialogue model includes 10 tags, such as "people," "transportation," and "destination." Now, a tag called "notification successful" is added, making it 11 tags. Of course, in some model training, old tags may also be deleted. These deleted tags are usually due to changes in business needs that render them unnecessary. For instance, the original tagging system might include the tag "real estate marketing," but if the business later changes and no longer targets the real estate industry, this tag becomes useless.
[0074] In response to changes in the labeling system, there are currently three possible solutions:
[0075] One approach is to directly use previously labeled data for model training. This will negatively impact the model's training performance, especially its ability to recognize new labels. Specifically, after new labels are generated, if labeled data from the old labeling system is directly used for model training, the model will typically assume that the data corresponding to the new labels in the old data is labeled as 0. This is usually not the case, and therefore is likely to cause a decline in model training performance.
[0076] Second, discard the old labeled data and only use the data labeled under the new labeling system for model training. This approach avoids the problem of deteriorating model training performance due to training with old data. However, it wastes labeled data because it cannot utilize the portion of historical data that is consistent with the current labeling system.
[0077] Third, re-label the past data, only adding new labels. This method can utilize historical labeled data, but because it requires re-labeling all historical data, the workload is enormous.
[0078] It should be noted that the above problems exist in the training of all deep learning multi-label models, not limited to dialogue data or natural language processing models.
[0079] In one example, a text classification model is used to identify document attributes from user-input text. For instance, the text classification model can generate different labels such as "court judgment", "civil dispute", and "contract dispute" from user-input text to identify the category of the text.
[0080] In another example, the image recognition model is used to identify target objects from images input by the user. Target objects include, for example, "people," "street view," "daytime," etc. Here, the target objects can be regarded as labels of the image recognition model.
[0081] Based on this, this application proposes a model training method. In this method, training data under different labeling systems is identified, and data preprocessing is performed on training data from labeling systems prior to the current labeling system. Data preprocessing includes masking and / or removal of label data to ensure that training data from different labeling systems can participate in model training, avoiding waste of labeled training data and improving model training performance. By masking the training data under the old labeling system, data corresponding to new labels in the old data is masked, preventing it from affecting the training of the new labels in the model. By removing data from the training data under the old labeling system, data corresponding to unique labels in the old data is removed, and the removed labeled data will not participate in model training.
[0082] It should be noted that the above solution can solve the problem of label variation during training of deep learning multi-label models in various scenarios and industries.
[0083] To facilitate understanding, the application scenarios of the technical solutions provided in the embodiments of this application will be briefly introduced below. Figure 1 This is a schematic diagram illustrating an application scenario of a model training method provided in an embodiment of this application. For example... Figure 1 As shown, the scenario includes a client 110 and a server 120, with the client 110 connected to the server 120 via a communication network.
[0084] Server 120 can be any suitable server for storing information, data, programs, and / or any other suitable type of content. In some embodiments, server 120 can perform any suitable function. For example, in some embodiments, server 120 deploys executable code for implementing the technical solutions of this application, for preprocessing datasets of historical tag systems prior to the current tag system, such as data masking and / or data removal, and for training the deep learning model based on the dataset of the current tag system, the preprocessed dataset of the historical tag system, and the initial deep learning model.
[0085] The communication network can be any suitable combination of one or more wired and / or wireless networks. For example, the communication network can include any one or more of the following: the Internet, intranet, wide area network (WAN), local area network (LAN), wireless network, digital subscriber line (DSL) network, frame relay network, asynchronous transfer mode (ATM) network, virtual private network (VPN), and / or any other suitable communication network. Client 110 can connect to the communication network via one or more communication links, which can be linked to server 120 via one or more communication links. The communication link can be any communication link suitable for transmitting data between client 110 and server 120, such as a network link, dial-up link, wireless link, hardwired link, any other suitable communication link, or any suitable combination of such links.
[0086] Client 110 may include any one or more user devices suitable for receiving model training requests from user input, including a dataset for model training and an initial deep learning model, which is not specifically limited in this application. In some embodiments, client 110 may include any suitable type of device. For example, in some embodiments, client 110 may include a mobile device, tablet computer, laptop computer, desktop computer, wearable computer, or any other suitable type of user device, which is not limited in this application embodiment.
[0087] Although server 120 is illustrated as a single device, in some embodiments, any suitable number of devices may be used to perform the functions performed by server 120. For example, in some embodiments, multiple devices may be used to implement the functions performed by server 120. Alternatively, the functions of server 120 may be implemented using cloud services; that is, server 120 may be a cloud server.
[0088] based on Figure 1 The scenario shown is an example. Server 120 receives a model training request from a client. This request includes training data and an initial deep learning model. The training data includes labeled data under multiple label systems, including the current label system, which is the label system used for this model training. Based on the current label system, server 120 preprocesses the labeled data under the historical label systems to obtain preprocessed labeled data for the historical label systems. Subsequently, server 120 trains the model based on the labeled data under the current label system, the preprocessed labeled data from the historical label systems, and the initial deep learning model. Finally, server 120 sends a model training response to client 110, which includes the trained deep learning model.
[0089] In some embodiments, server 120 may perform data prediction based on a trained deep learning model. For example, a dialogue model understands the meaning of dialogue content by predicting labels for the dialogue content. As another example, a text classification model identifies the category of input text by predicting labels for the input text.
[0090] The model training scheme provided in this application will be described in detail below through specific embodiments. It should be noted that the technical solutions provided in the embodiments of this application may include some or all of the following contents. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0091] Figure 2 This is a flowchart illustrating a model training method provided in an embodiment of this application. This model training method can be applied to... Figure 1 The server, or other execution device shown, such as Figure 2 As shown, the method includes the following steps:
[0092] Step 201: Obtain multiple datasets for model training and an initial deep learning model.
[0093] In this embodiment, the labeled data in multiple datasets are different. These datasets include a first dataset and a second dataset. The labeled data in the first dataset is the label data used for model training. It should be understood that the different labeled data in multiple datasets means that the labeled data in the first dataset and the second dataset are not completely identical. The first dataset can be considered as the dataset under the current labeling system, and the second dataset can be considered as the dataset under the historical labeling system.
[0094] One possibility is that the first dataset has more labels than the second dataset. For example, the first dataset may contain labels 1, 2, and 3, while the second dataset may contain labels 1 and 2.
[0095] Another possibility is that the number of labels in the first dataset is less than the number of labels in the second dataset. For example, the first dataset may contain labels 1, 2, and 3, while the second dataset may contain labels 1, 2, 3, and 4.
[0096] Another possible scenario is that the number of labels in the first dataset is equal to the number of labels in the second dataset. For example, the first dataset contains labels 1, 2, and 3, while the second dataset contains labels 1, 2, and 4.
[0097] For example, Figure 3 This is a flowchart illustrating a model training method provided in an embodiment of this application. Figure 3 As shown, the server obtains multiple datasets, including: Dataset 1, Dataset 2, and Dataset 3. Dataset 1 was obtained through data annotation process 1, and corresponds to label system 1; Dataset 2 was obtained through data annotation process 2, and corresponds to label system 2; Dataset 3 was obtained through data annotation process 3, and corresponds to label system 3. Label system 3 is the label system used for this model training. Each label system includes multiple labels, which can be existing labels provided by the server and / or user-defined labels.
[0098] In one possible implementation, the server obtains multiple datasets for model training, as well as an initial deep learning model, from the client. For example... Figure 2 As shown, the user accesses the server through a client. In response to the user-triggered model training operation, the client sends a model training request to the server. The model training request includes multiple datasets selected by the user and an initial deep learning model. These multiple datasets include datasets under different labeling systems, and the initial deep learning model can be one of the deep learning models from different domains provided by the server, such as a dialogue model, a text classification model, or an image recognition model.
[0099] For example, Figure 4 This is a schematic diagram of a data point in a dataset provided in an embodiment of this application. For example... Figure 4 As shown, taking dialogue data as an example, a piece of data in the dataset includes the model's input and output. The model's input can be a segment of dialogue data, for example, a dialogue between user A and robot B: user A's sentences 1, 3, and 5, and robot B's sentences 2 and 4. Correspondingly, the model's output can be the labeled data of that dialogue segment, for example, label data 1, label data 2, label data 3, label data 4, and label data 5, indicating the data positions corresponding to the labels in sentences 1, 2, 3, 4, and 5, respectively. It should be understood that the dialogue sentences in the dataset can be used as the model's input, and the labeled data in the dataset can be used as the model's output for model training.
[0100] Considering that the labeling system of the second dataset is not exactly the same as the labeling system used for training the current model, further processing of the labeled data in the second dataset is required to improve the model training effect. Please refer to step 202 for details.
[0101] Step 202: Preprocess the labeled data of the second dataset to obtain the preprocessed labeled data of the second dataset.
[0102] In this embodiment, the preprocessing of the labeled data of the second dataset includes: masking some of the labels in the labeled data of the second dataset, and / or removing some of the labeled data of the second dataset.
[0103] In one possible implementation, the label data of the second dataset is a subset of the label data of the first dataset. Preprocessing the labeled data of the second dataset to obtain preprocessed labeled data includes: masking a portion of the labels in the labeled data of the second dataset to obtain masked labeled data of the second dataset.
[0104] As an example, by comparing the label data of the first dataset with the label data of the second dataset, the missing first label in the second dataset compared to the first dataset is determined; the first label in the labeled data of the second dataset is then masked.
[0105] For example, refer to the appendix. Figure 3 The first dataset can be dataset 3, where the label data corresponds to label system 3. This example trains the model based on label system 3 of dataset 3. The second dataset can be dataset 1, where the label data corresponds to label system 1. If label system 1 is a subset of label system 3, for example, label system 1 includes label 1, label 2, and label 3, and label system 3 includes label 1, label 2, label 3, and label 4, then by comparing label system 1 and label system 2, we know that label 4 is a newly added label, meaning that dataset 1 is missing label 4 compared to dataset 3. After obtaining the newly added label, we need to mask some of the labeled data in dataset 1. For example, if a data entry in dataset 1 contains data corresponding to the newly added label 4, we mask the label corresponding to that data entry to obtain the masked labeled data for that data entry.
[0106] To facilitate understanding, the masking process will be explained below with a specific example.
[0107] Figure 5 This is an example diagram illustrating the masking process of labeled data in a dataset, provided as an embodiment of this application. For example... Figure 5 As shown, the first dataset can be dataset 2, and the second dataset can be dataset 1. This example trains the model based on the labeling system of dataset 2; that is, dataset 1 is the dataset under the historical labeling system, and dataset 2 is the dataset under the current labeling system. Assume that the label data of dataset 1 is a subset of the label data of dataset 2, for example, in... Figure 5In dataset 1, the labeled data includes tags such as "ticket booking," "transportation," "departure point," "destination," "high-speed rail ticket," "passenger count," "time," "station," "train number," and "confirmation." Dataset 2 includes all the tags from dataset 1, plus the newly added tags "cancel" and "successful notification." A training data set in dataset 1 includes the dialogue content of dialog box 501 and its annotation information, including the tag category of sentences within the dialogue content and the position of that tag category within the sentence. Similarly, a training data set in dataset 2 includes the dialogue content of dialog box 502 and its annotation information, including the newly added tag category (such as "cancel" and "successful notification") and the position of that newly added tag category within the sentence.
[0108] based on Figure 5 The training data shown includes a record in dataset 1 that contains the data "Ticket reservation completed" corresponding to the newly added label "Notification successful," but this data is not labeled in the labeling system of dataset 1. Figure 5 The data "Ticket reservation completed" is labeled as 0, but in fact, it should be labeled as 1. Directly using this training data will affect the model's ability to add new labels during training. Therefore, it is necessary to mask the label corresponding to the "Ticket reservation completed" data to hide the default label of "Ticket reservation completed" in this training data and avoid the impact on the model training effect caused by using the historical dataset 1.
[0109] In this embodiment, the labels corresponding to missing labels in the historical labeling system are masked. During the model training process, the data corresponding to missing labels in the historical dataset will be masked, which can improve the training effect of the model on the newly added labels.
[0110] In another possible implementation, the label data of the first dataset is a subset of the label data of the second dataset; preprocessing the labeled data of the second dataset to obtain the preprocessed labeled data of the second dataset includes: removing some of the labeled data of the second dataset to obtain the labeled data of the second dataset after removal.
[0111] As an example, by comparing the label data of the first dataset with the label data of the second dataset, the second label unique to the second dataset compared to the first dataset is determined; the labeled data of the second label in the second dataset is then removed.
[0112] For example, refer to the appendix. Figure 3The first dataset can be dataset 3, where the labeled data corresponds to label system 3. This example trains the model based on label system 3 of dataset 3. The second dataset can be dataset 2, where the labeled data corresponds to label system 2. If label system 3 is a subset of label system 2, for example, label system 2 includes label 1, label 2, and label 3, and label system 3 includes label 1 and label 2, then by comparing label system 2 and label system 3, we know that label 3 is unique to label system 2. That is, dataset 2 has label 3 unique to label system 2 compared to dataset 3. After knowing the unique label of label system 2, we need to remove some of the labeled data in dataset 2. For example, if a data entry in dataset 2 contains the label 3, we remove that label to obtain the labeled data of that data entry after removal.
[0113] In this implementation, the annotations corresponding to the old labels that are unique to the dataset under the historical labeling system are removed. The model training process does not involve training on the old label data, thereby making full use of the dataset under the historical labeling system for model training and avoiding the waste of historical labeled data.
[0114] Step 203: Train the initial deep learning model based on the preprocessed labeled data of the second dataset and the labeled data of the first dataset.
[0115] In this embodiment, the labeled data of the first dataset is used to indicate the labels corresponding to the data in that dataset. The labeled data of the second dataset is used to indicate the labels corresponding to the data in that dataset. For example, the labeled data of the second dataset includes the label categories corresponding to the data in the second dataset and the position of the label categories within the data. Similarly, the labeled data of the first dataset is used to indicate the labels corresponding to the data in the first dataset. For example, the labeled data of the first dataset includes the label categories corresponding to the data in the first dataset and the position of the label categories within the data.
[0116] For example, in the case of a deep learning model that is a dialogue model, the preprocessed dialogue data from the second dataset is used as the input to the dialogue model, and the labeled dialogue data from the second dataset is used as the output to train the model. Similarly, the dialogue data from the first dataset is used as the input to the dialogue model, and the labeled dialogue data from the first dataset is used as the output to train the model.
[0117] It should be understood that in this embodiment, the labeled data of the first dataset is the labeled data under the current label system. There is no need to process the labeled data, and it can be directly used as training data to participate in model training.
[0118] Step 204: When the loss function of the deep learning model converges, obtain the trained deep learning model.
[0119] In some embodiments, the model training method further includes the following steps:
[0120] Step 205: After obtaining the trained deep learning model, the server sends a model training response to the client, which includes the trained deep learning model.
[0121] In subsequent applications, users can use this trained deep learning model for data prediction.
[0122] The model training method illustrated in this application first determines the label data of the first dataset from multiple acquired datasets as the label data for this model training before training. Since the label data of the first and second datasets differ, the labeled data of the second dataset (excluding the first dataset) needs to be preprocessed to obtain preprocessed labeled data for the second dataset. Then, based on the preprocessed labeled data of the second dataset and the labeled data of the first dataset, an initial deep learning model is trained. When the model loss function converges, the trained deep learning model is obtained. This approach fully utilizes datasets with different label data and avoids wasting historical labeled data. Furthermore, preprocessing the labeled data of the second dataset improves the model's training performance.
[0123] It should be noted that some processes described in the above embodiments and accompanying drawings include multiple operations that appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or may be executed in parallel. The sequence numbers are merely used to distinguish different operations, and the sequence numbers themselves do not represent any execution order. Furthermore, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel.
[0124] The above describes the model training method provided in the embodiments of this application. The following will describe the model training device provided in the embodiments of this application.
[0125] This application embodiment can divide the model training device into functional modules according to the above method embodiment. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or software functional modules. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods. The following description uses the division of functional modules according to each function as an example.
[0126] Figure 6 This is a schematic diagram of the structure of a model training device provided in an embodiment of this application. Figure 6 As shown, the model training device 600 of this embodiment includes: an acquisition unit 601 and a processing unit 602.
[0127] The acquisition unit 601 is used to acquire multiple datasets for model training and an initial deep learning model; the label data in the multiple datasets are different, and the multiple datasets include a first dataset and a second dataset, wherein the label data of the first dataset is the label data for model training;
[0128] Processing unit 602 is used to preprocess the labeled data of the second dataset to obtain the preprocessed labeled data of the second dataset;
[0129] The processing unit 602 is further configured to train the initial deep learning model based on the preprocessed labeled data of the second dataset and the labeled data of the first dataset; the labeled data is used to indicate the labels and label positions corresponding to the data in the dataset.
[0130] In an optional embodiment, the processing unit 602 preprocesses the labeled data of the second dataset, including at least one of the following:
[0131] Masking is applied to a portion of the labels in the labeled data of the second dataset;
[0132] Remove some of the labeled data from the second dataset.
[0133] In an optional embodiment, the label data of the second dataset is a subset of the label data of the first dataset; the processing unit 602 is configured to:
[0134] A portion of the labels in the labeled data of the second dataset is masked to obtain the masked labeled data of the second dataset.
[0135] In an optional embodiment, the processing unit 602 is configured to:
[0136] By comparing the label data of the first dataset with the label data of the second dataset, the first label missing in the second dataset compared to the first dataset is determined;
[0137] The first label in the labeled data of the second dataset is masked.
[0138] In an optional embodiment, the label data of the first dataset is a subset of the label data of the second dataset; the processing unit 602 is used to remove some of the label data in the second dataset to obtain the label data of the second dataset after removal processing.
[0139] In an optional embodiment, the processing unit 602 is configured to:
[0140] By comparing the label data of the first dataset with the label data of the second dataset, a second label unique to the second dataset compared to the first dataset is determined.
[0141] Remove the labeled data of the second label from the second dataset.
[0142] The model training device provided in this embodiment can be used to execute the model training method of the above method embodiment. Its implementation principle and technical effect are similar, and will not be described again in this embodiment.
[0143] Figure 7 This is a schematic diagram of the structure of a model training device provided in an embodiment of this application. Figure 7 As shown, the model training device 700 of this embodiment includes: a receiving unit 701, a processing unit 702, and a sending unit 703.
[0144] The receiving unit 701 is configured to receive a model training request from a client. The model training request includes multiple datasets for model training and an initial deep learning model. The label data in the multiple datasets are different. The multiple datasets include a first dataset and a second dataset. The label data in the first dataset is the label data for model training.
[0145] Processing unit 702 is used to preprocess the labeled data of the second dataset to obtain the preprocessed labeled data of the second dataset;
[0146] The processing unit 702 is further configured to train the initial deep learning model based on the preprocessed labeled data of the second dataset and the labeled data of the first dataset, and to obtain the trained deep learning model when the loss function of the deep learning model converges; the labeled data is used to indicate the label and label position of the data in the dataset.
[0147] The sending unit 703 is used to return the trained deep learning model to the client.
[0148] The model training device provided in this embodiment can be used to execute the model training method of the above method embodiment. Its implementation principle and technical effect are similar, and will not be described again in this embodiment.
[0149] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 8As shown, the electronic device includes a memory 801 and a processor 802. The memory 801 stores computer programs and can be configured to store various other data to support operations on a model training device. The processor 802, coupled to the memory 801, executes the computer programs in the memory 801 to implement the technical solutions of the aforementioned method embodiments. Its implementation principle and technical effects are similar and will not be repeated here.
[0150] In some embodiments, such as Figure 8 As shown, the electronic device also includes other components such as a firewall 803, a load balancer 804, a communication component 805, and a power supply component 806. Figure 8 The diagram only shows some components and does not mean that the electronic device includes only these components. Figure 8 The components shown.
[0151] This application also provides a data processing system, as shown in the attached document. Figure 1 The data processing system in this embodiment may include end-side devices (e.g., Figure 1 Client 110 in the middle) and cloud-side devices (e.g. Figure 1 The server 120 in the cloud is equipped with a deep learning model. Optionally, the deep learning model can be a dialogue model, a text classification model, an image recognition model, etc., and this embodiment does not limit it in any way.
[0152] The edge device is used to send a model training request to the cloud device. The model training request includes multiple datasets for model training and an initial deep learning model. The label data in the multiple datasets are different. The multiple datasets include a first dataset and a second dataset. The label data in the first dataset is the label data for model training.
[0153] The cloud-side device is used to preprocess the labeled data of the second dataset to obtain preprocessed labeled data of the second dataset; to train the initial deep learning model based on the preprocessed labeled data of the second dataset and the labeled data of the first dataset; to obtain the trained deep learning model when the loss function of the deep learning model converges; and to send the trained deep learning model to the edge device; wherein the labeled data is used to indicate the label and label position of the data in the dataset.
[0154] In this embodiment, the cloud-side device can be used to perform... Figure 2 The method steps of the server in the illustrated embodiment can be correspondingly implemented on the cloud-side device. Figure 6 The model training device 600 in the embodiment, or Figure 7 The model training device 700 in this embodiment can be found in the above embodiment, and will not be described again here.
[0155] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the technical solution described in the foregoing method embodiments.
[0156] This application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, causes the processor to implement the technical solutions described in the foregoing method embodiments.
[0157] This application also provides a chip, including a processing module and a communication interface, wherein the processing module is capable of executing the technical solutions in the foregoing method embodiments. In some embodiments, the chip further includes a storage module (e.g., a memory), the storage module being used to store instructions, the processing module being used to execute the instructions stored in the storage module, and the execution of the instructions stored in the storage module causing the processing module to execute the technical solutions in the foregoing method embodiments.
[0158] The aforementioned storage can be object storage (OSS).
[0159] The aforementioned memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0160] The aforementioned communication components are configured to facilitate wired or wireless communication between the device containing the communication components and other devices. The device containing the communication components can access wireless networks based on communication standards, such as WiFi, 2G, 3G, 4G / LTE, 5G, and other mobile communication networks, or combinations thereof. In one exemplary embodiment, the communication components receive broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication components also include a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra-Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0161] The aforementioned power supply components provide power to various components within the device in which they reside. These power supply components may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the device in which they reside.
[0162] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0163] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0164] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0165] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0166] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0167] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0168] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0169] It should be noted that the user information (including but not limited to user device information, user personal information, user conversation information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0170] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0171] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A data processing method, characterized in that, include: The dialogue content input by the user is obtained, the dialogue content is input into a trained dialogue model, and after processing by the trained dialogue model, the labels of the dialogue content are obtained. Obtain a first dataset, a second dataset, and an initial dialogue model for training the dialogue model; the first dataset includes multiple sets of first dialogue content and first annotation data for each set of first dialogue content, the first annotation data including labels of sentences in the first dialogue content identified based on the current labeling system; the second dataset includes multiple sets of second dialogue content and second annotation data for each set of second dialogue content, the second annotation data including labels of sentences in the second dialogue content identified based on the historical labeling system; Preprocess the second labeled data of the multiple sets of second dialogue content in the second dataset to obtain the preprocessed second dataset; The initial dialogue model is trained based on the preprocessed second dataset and the first dataset to obtain the trained dialogue model. Preprocessing the second labeled data of the multiple sets of second dialogue content in the second dataset includes at least one of the following: masking some of the labels in the second labeled data of the multiple sets of second dialogue content in the second dataset; Alternatively, some labels can be removed from the second annotation data of the multiple sets of second dialogue content in the second dataset.
2. The method according to claim 1, characterized in that, The tag data of the historical tagging system is a subset of the tag data of the current tagging system; the preprocessing of the second annotation data of the multiple sets of second dialogue content in the second dataset to obtain the preprocessed second dataset includes: A portion of the labels in the second annotation data of the multiple sets of second dialogue content in the second dataset are masked to obtain the masked second dataset.
3. The method according to claim 2, characterized in that, The masking process for a portion of the labels in the second annotation data of the multiple sets of second dialogue content in the second dataset includes: By comparing the tag data of the current tag system with the tag data of the historical tag system, the first tag that is missing in the historical tag system compared to the current tag system is determined; The first label in the second annotation data of the multiple sets of second dialogue content in the second dataset is masked.
4. The method according to claim 1, characterized in that, The tag data of the current tagging system is a subset of the tag data of the historical tagging system; the preprocessing of the second annotation data of the multiple sets of second dialogue content in the second dataset to obtain the preprocessed second dataset includes: Remove some labels from the second annotation data of the multiple sets of second dialogue content in the second dataset to obtain the second dataset after removal.
5. The method according to claim 4, characterized in that, The labels in the second annotation data of the multiple sets of second dialogue content in the second dataset are partially removed, including: By comparing the tag data of the current tag system with the tag data of the historical tag system, a second tag that is unique to the historical tag system compared to the current tag system is determined; Remove the second label from the second annotation data of the multiple sets of second dialogue content in the second dataset.
6. A data processing method, characterized in that, include: Receive a model training request from a client, the model training request including a first dataset, a second dataset, and an initial dialogue model for training the dialogue model; The first dataset includes multiple sets of first dialogue content and first annotation data for each set of first dialogue content. The first annotation data includes tags for sentences in the first dialogue content identified based on the current tagging system. The second dataset includes multiple sets of second dialogue content and second annotation data for each set of second dialogue content. The second annotation data includes tags for sentences in the second dialogue content identified based on the historical tagging system. Preprocess the second labeled data of the multiple sets of second dialogue content in the second dataset to obtain the preprocessed second dataset; The initial dialogue model is trained based on the preprocessed second dataset and the first dataset. When the loss function of the dialogue model converges, the trained dialogue model is obtained; the trained dialogue model is used to identify the dialogue content input by the user and obtain the label of the dialogue content input by the user. The trained dialogue model is returned to the client. Preprocessing the second labeled data of the multiple sets of second dialogue content in the second dataset includes at least one of the following: Masking is applied to a portion of the labels in the second annotation data of the multiple sets of second dialogue content in the second dataset; or, Remove some labels from the second annotation data of the multiple sets of second dialogue content in the second dataset.
7. A data processing device, characterized in that, include: The acquisition unit is used to acquire the dialogue content input by the user; The processing unit is used to input the dialogue content into a trained dialogue model, and after processing by the trained dialogue model, obtain the tags of the dialogue content. The acquisition unit is used to acquire a first dataset, a second dataset, and an initial dialogue model for training the dialogue model. The first dataset includes multiple sets of first dialogue content and first annotation data for each set of first dialogue content. The first annotation data includes tags for sentences in the first dialogue content identified based on the current tagging system. The second dataset includes multiple sets of second dialogue content and second annotation data for each set of second dialogue content. The second annotation data includes tags for sentences in the second dialogue content identified based on the historical tagging system. The processing unit is used to preprocess the second labeled data of the multiple sets of second dialogue content in the second dataset to obtain the preprocessed second dataset. The processing unit is further configured to train the initial dialogue model based on the preprocessed second dataset and the first dataset to obtain the trained dialogue model. The processing unit is used to preprocess the second annotation data of the multiple sets of second dialogue content in the second dataset, including at least one of the following: masking some of the labels in the second annotation data of the multiple sets of second dialogue content in the second dataset; Alternatively, some labels can be removed from the second annotation data of the multiple sets of second dialogue content in the second dataset.
8. A data processing device, characterized in that, A receiving unit is configured to receive a model training request from a client. The model training request includes a first dataset, a second dataset, and an initial dialogue model for training a dialogue model. The first dataset includes multiple sets of first dialogue content and first annotation data for each set of first dialogue content. The first annotation data includes tags for sentences in the first dialogue content identified based on the current tagging system. The second dataset includes multiple sets of second dialogue content and second annotation data for each set of second dialogue content. The second annotation data includes tags for sentences in the second dialogue content identified based on a historical tagging system. The processing unit is used to preprocess the second labeled data of the multiple sets of second dialogue content in the second dataset to obtain the preprocessed second dataset; The processing unit is further configured to train the initial dialogue model based on the preprocessed second dataset and the first dataset, and obtain the trained dialogue model when the loss function of the dialogue model converges; the trained dialogue model is used to identify the dialogue content input by the user and obtain the label of the dialogue content input by the user. A sending unit is used to return the trained dialogue model to the client. The processing unit is used to preprocess the second annotation data of the multiple sets of second dialogue content in the second dataset, including at least one of the following: masking some of the labels in the second annotation data of the multiple sets of second dialogue content in the second dataset; Alternatively, some labels can be removed from the second annotation data of the multiple sets of second dialogue content in the second dataset.
9. A data processing system, characterized in that, include: End-side equipment and cloud-side equipment; The edge device is used to send a model training request to the cloud device. The model training request includes a first dataset, a second dataset, and an initial dialogue model for training the dialogue model. The first dataset includes multiple sets of first dialogue content and first annotation data for each set of first dialogue content. The first annotation data includes tags for sentences in the first dialogue content identified based on the current tagging system. The second dataset includes multiple sets of second dialogue content and second annotation data for each set of second dialogue content. The second annotation data includes tags for sentences in the second dialogue content identified based on the historical tagging system. The cloud-side device is used to preprocess the second labeled data of the multiple sets of second dialogue content in the second dataset to obtain the preprocessed second dataset; Based on the preprocessed second dataset and the first dataset, the initial dialogue model is trained, and the trained dialogue model is obtained when the loss function of the dialogue model converges. The trained dialogue model is sent to the terminal device; the trained dialogue model is used to identify the dialogue content input by the user and obtain the tags of the dialogue content input by the user. The cloud-side device is used to preprocess the second annotation data of the multiple sets of second dialogue content in the second dataset, including at least one of the following: masking some of the labels in the second annotation data of the multiple sets of second dialogue content in the second dataset; Alternatively, some labels can be removed from the second annotation data of the multiple sets of second dialogue content in the second dataset.
10. An electronic device, characterized in that, include: A memory, a processor, and a computer program; the computer program is stored in the memory and configured to be executed by the processor to implement the method as claimed in any one of claims 1 to 6.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that is executed by a processor to implement the method as described in any one of claims 1 to 6.