A tag identification method, apparatus, electronic device, and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA TELECOM NETWORK SECURITY TECH CO LTD
- Filing Date
- 2022-12-22
- Publication Date
- 2026-06-30
AI Technical Summary
Existing technologies cannot flexibly apply unified data labeling standards in different business scenarios, resulting in inaccurate label determination processes and affecting data security and rigor.
By adjusting the initial classification model based on the category information of the data to be processed, the target classification model is determined, enabling accurate label determination in different business scenarios.
A single model can adapt to different business scenarios, accurately match labels under various classification criteria, and improve the accuracy of data labels and the flexibility of the model.
Smart Images

Figure CN115905656B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a tag identification method, apparatus, electronic device, and storage medium. Background Technology
[0002] In data security, data acquisition is the initial stage of the data security lifecycle, and the data labeling process is a crucial part of the data acquisition stage. The accuracy of the labels affects the security and confidentiality of the data. Different labeling standards are typically used in different business scenarios.
[0003] In related technologies, data labels are determined for a single business scenario.
[0004] However, different business scenarios use different classification standards (category information), so the above method cannot be flexibly applied to different business scenarios. Summary of the Invention
[0005] This application provides a tag determination method, apparatus, electronic device, and storage medium for accurately determining data tags in different business scenarios.
[0006] In a first aspect, embodiments of this application provide a label determination method, the method comprising:
[0007] Upon receiving the data to be processed, the model information corresponding to the category information is determined based on the category information of the data to be processed.
[0008] The initial classification model is adjusted based on the corresponding model information to obtain the target classification model corresponding to the category information;
[0009] The data to be processed is input into the target classification model to obtain the label of the data to be processed.
[0010] The above solution, upon receiving the data to be processed, adjusts the initial classification model based on the model information corresponding to the category information of the data to obtain a target classification model corresponding to the aforementioned category information. Thus, by inputting the data to be processed into the target classification model, labels matching the category information can be obtained. Therefore, for different business scenarios, only the initial classification model needs to be adjusted to match different classification criteria (category information), and labels under each classification criterion can be accurately obtained using only one model.
[0011] In some optional implementations, the model information includes the number of targets and the target model parameters of the target classification units; adjusting the initial classification model based on the corresponding model information to obtain the target classification model corresponding to the category information includes:
[0012] Select the target number of classification units from the initial classification model as the target classification units;
[0013] For any target classification unit, the current model parameters of the target classification unit are adjusted to the corresponding target model parameters to obtain the target classification model.
[0014] The above scheme selects a target number of classification units from the initial classification model as target classification units to satisfy the label hierarchy of category information; by adjusting the current model parameters of each target classification unit to the corresponding target model parameters, a target classification model that accurately determines the labels of each level of category information is obtained.
[0015] In some optional implementations, based on the category information of the data to be processed, the model information corresponding to the category information is determined, including:
[0016] Based on a preset correspondence, the model information corresponding to the category information of the data to be processed is determined; wherein, the preset correspondence includes a preset correspondence between category information and model information.
[0017] The above scheme can accurately determine the model information corresponding to the category information of each piece of data to be processed by setting a preset correspondence between different categories of information and model information.
[0018] In some optional implementations, the model information includes the number of targets and the target model parameters of the target classification units; the preset correspondence is determined in the following way:
[0019] For any preset category information, the target quantity corresponding to the category information is determined based on the hierarchical relationship of the sample labels of the category information;
[0020] Based on the sample data and sample labels of the category information, the target classification units of the target number are trained to obtain the target model parameters corresponding to the category information.
[0021] The above scheme accurately determines the target quantity corresponding to each category of information based on the hierarchical relationship of the sample labels of each category of information; and accurately determines the target model parameters suitable for each category of information by training the target classification unit with the sample data and sample labels of each category of information.
[0022] In some optional implementations, the target number of target classification units is trained based on the sample data and sample labels of the category information to obtain the target model parameters corresponding to the category information, including:
[0023] For any level of target classification unit, the target classification unit is trained based on the sample data of the category information and the sample labels corresponding to the level to obtain the target model parameters of the target classification unit at that level.
[0024] The above scheme requires different classification units to determine each level of label because different categories of information have different label levels. The target model parameters of each level of target classification unit are obtained by training the target classification units based on sample data and the corresponding sample labels of each level.
[0025] In some optional implementations, if the target classification unit has a higher-level target classification unit, then before training the target classification unit based on the sample data of the category information and the sample labels corresponding to the level, the method further includes:
[0026] After the target classification unit at the previous level has been trained, the initial model parameters of the target classification unit at that level are adjusted to the target model parameters of the target classification unit at the previous level.
[0027] The above scheme, through parameter transfer, provides a better training starting point for the next level of target classification units, rapidly improving the timeliness of model training and increasing iteration efficiency.
[0028] In some optional implementations, the target classification unit is trained based on sample data containing the category information and sample labels corresponding to the level, including:
[0029] For any sample label corresponding to the level, the sampling weight of the sample label is determined based on the number of sample data corresponding to the sample label;
[0030] Based on the sampling weights, the sample labels and corresponding sample data are sampled, and the target classification unit is trained based on the sampled sample data and sample labels.
[0031] Secondly, embodiments of this application provide a label determining device, the device comprising:
[0032] The model information determination module is used to determine the model information corresponding to the category information based on the category information of the data to be processed after receiving the data to be processed.
[0033] The model adjustment module is used to adjust the initial classification model based on the corresponding model information to obtain the target classification model corresponding to the category information;
[0034] The label determination module is used to input the data to be processed into the target classification model to obtain the label of the data to be processed.
[0035] Thirdly, embodiments of this application provide an electronic device, the electronic device including at least one processor and at least one memory, wherein the memory stores a computer program, and when the program is executed by the processor, the processor performs the tag determination method described in any of the first aspects above.
[0036] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform any of the tag determination methods described in the first aspect above.
[0037] Furthermore, the technical effects of any of the implementation methods in the second to fourth aspects can be found in the technical effects of different implementation methods in the first aspect, and will not be repeated here. Attached Figure Description
[0038] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0039] Figure 1 A schematic flowchart illustrating the first label determination method provided in this application embodiment;
[0040] Figure 2 A schematic flowchart illustrating the second label determination method provided in this application embodiment;
[0041] Figure 3 A schematic diagram of the classification unit provided in the embodiments of this application;
[0042] Figure 4 A schematic flowchart illustrating the third label determination method provided in this application embodiment;
[0043] Figure 5 A schematic flowchart illustrating the first method for determining a preset correspondence provided in this application embodiment;
[0044] Figure 6 A schematic flowchart illustrating the second method for determining a preset correspondence provided in an embodiment of this application;
[0045] Figure 7 This is a schematic diagram of the tag determining device provided in the embodiments of this application;
[0046] Figure 8 A schematic block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0048] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0049] In the description of this application, unless otherwise expressly specified and limited, the term "connection" should be interpreted broadly. For example, it can refer to a direct connection, an indirect connection through an intermediate medium, or a connection within two devices. Those skilled in the art can understand the specific meaning of the above term in this application based on the specific circumstances.
[0050] In data security, data acquisition is the initial stage of the data security lifecycle, and the data labeling process is a crucial part of the data acquisition stage. The accuracy of the labels affects the security and confidentiality of the data. Different labeling standards are typically used in different business scenarios.
[0051] In related technologies, data labels are determined for a single business scenario.
[0052] However, due to differences in industry and business functions, data classification standards need to be developed based on the current situation. Furthermore, different business scenarios within an organization may also lead to different classification standards. Therefore, the above approach cannot be flexibly applied to different business scenarios.
[0053] Based on this, embodiments of this application provide a label determination method, apparatus, electronic device, and storage medium. The method includes: after receiving data to be processed, determining model information corresponding to the category information based on the category information of the data to be processed; adjusting an initial classification model based on the corresponding model information to obtain a target classification model corresponding to the category information; and inputting the data to be processed into the target classification model to obtain a label for the data to be processed.
[0054] The above solution, upon receiving the data to be processed, adjusts the initial classification model based on the model information corresponding to the category information of the data to obtain a target classification model corresponding to the aforementioned category information. Thus, by inputting the data to be processed into the target classification model, labels matching the category information can be obtained. Therefore, for different business scenarios, only the initial classification model needs to be adjusted to match different classification criteria (category information), and labels under each classification criterion can be accurately obtained using only one model.
[0055] The technical solution of this application and how it solves the above-mentioned technical problems will be described in detail below with reference to the accompanying drawings and specific embodiments. 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.
[0056] This application provides a first tag determination method, applied to electronic devices, such as... Figure 1 As shown, the method may include:
[0057] Step S101: After receiving the data to be processed, determine the model information corresponding to the category information based on the category information of the data to be processed.
[0058] During implementation, it is necessary to determine the labels of the data for different business scenarios. Therefore, the category information of the data to be processed is not fixed, and the model parameters and other information used will also be different. Based on this, after receiving the data to be processed, the model information corresponding to the category information is determined based on the category information of the data to be processed.
[0059] Step S102: Adjust the initial classification model based on the corresponding model information to obtain the target classification model corresponding to the category information.
[0060] In this embodiment, in order to reduce the occurrence of model resource constraints and increase the flexibility of model use, instead of training a target classification model for each type of information, the same model is used for all types of information, and the model parameters and other information are adjusted for different types of information.
[0061] Based on this, this embodiment adjusts the initial classification model according to the corresponding model information to obtain the target classification model corresponding to the above category information.
[0062] Step S103: Input the data to be processed into the target classification model to obtain the label of the data to be processed.
[0063] The above solution, upon receiving the data to be processed, adjusts the initial classification model based on the model information corresponding to the category information of the data to obtain a target classification model corresponding to the aforementioned category information. Thus, by inputting the data to be processed into the target classification model, labels matching the category information can be obtained. Therefore, for different business scenarios, only the initial classification model needs to be adjusted to match different classification criteria (category information), and labels under each classification criterion can be accurately obtained using only one model.
[0064] In some optional implementations, the model information includes the number of targets and the target model parameters of the target classification units;
[0065] Correspondingly, embodiments of this application provide a second tag determination method, applied to electronic devices, such as... Figure 2 As shown, the method may include:
[0066] Step S201: After receiving the data to be processed, determine the model information corresponding to the category information based on the category information of the data to be processed.
[0067] The specific implementation of step S201 can be found in the above embodiments, and will not be repeated here.
[0068] Step S202: Select the target number of classification units from the initial classification model as the target classification units.
[0069] In practice, different categories of information have different labeling levels. For example, some standards require three-level labels, while others require four-level labels. Each level of label needs to be determined through different classification units.
[0070] Therefore, the model information needs to include the number of targets. The classification units of the target number are selected from the initial classification model as target classification units, which are used to determine the labels of the corresponding levels after parameter settings.
[0071] This embodiment does not limit the specific implementation of the classification unit, such as a gated recurrent unit (GRU);
[0072] See Figure 3As shown, GRU is the foundational architecture for constructing context and attention mechanisms for memorizing text documents. The attention mechanism allows GRU to selectively focus on important elements in the text, optionally employing a word attention module, and using a bidirectional GRU to encode forward and backward sequences. In implementation, the word sequence can be used as the forward embedding input to the GRU, and each state produced by the GRU is a backward and forward hidden state for each time step t. Attention is placed on the GRU states to produce a fixed-dimensional vector representation; and the max-pool and mean-pool representations of all GRU hidden states are combined with the attention vector to produce the sequence representation of the input and output layers; the output layer is set as a fully connected layer with activations in the shape of the GRU state sequence, and the dimension of the layer is determined by the number of classes in the classification task.
[0073] Step S203: For any target classification unit, adjust the current model parameters of the target classification unit to the corresponding target model parameters to obtain the target classification model.
[0074] As mentioned above, each target classification unit is used to determine the label of the corresponding level after parameter settings are performed;
[0075] Based on this, the model information also needs to include the target model parameters of each target classification unit. The current model parameters of each target classification unit are adjusted to the corresponding target model parameters, so as to obtain the target classification model that accurately determines the labels of each level of the corresponding category information.
[0076] Step S204: Input the data to be processed into the target classification model to obtain the label of the data to be processed.
[0077] The specific implementation of step S204 can be found in the above embodiments, and will not be repeated here.
[0078] The above scheme selects a target number of classification units from the initial classification model as target classification units, thereby satisfying the label hierarchy of the corresponding category information; by adjusting the current model parameters of each target classification unit to the corresponding target model parameters, a target classification model that accurately determines the labels of each level of the corresponding category information is obtained.
[0079] This application provides a third tag determination method, applied to electronic devices, such as... Figure 4 As shown, the method may include:
[0080] Step S401: After receiving the data to be processed, determine the model information corresponding to the category information of the data to be processed based on the preset correspondence.
[0081] The preset correspondence includes the preset correspondence between category information and model information.
[0082] In this embodiment, by setting a preset correspondence between different category information and model information, the model information corresponding to the category information of each piece of data to be processed can be accurately determined based on the preset correspondence.
[0083] Step S402: Adjust the initial classification model based on the corresponding model information to obtain the target classification model corresponding to the category information;
[0084] Step S403: Input the data to be processed into the target classification model to obtain the label of the data to be processed.
[0085] The specific implementation of steps S402 to S403 can be found in the above embodiments, and will not be repeated here.
[0086] The above scheme can accurately determine the model information corresponding to the category information of each piece of data to be processed by setting a preset correspondence between different categories of information and model information.
[0087] See Figure 5 As shown, in some optional implementations, the preset correspondence is obtained in the following way:
[0088] Step S501: For any preset category information, determine the target quantity corresponding to the category information based on the hierarchical relationship of the sample labels of the category information.
[0089] As mentioned above, different categories of information have different label levels, and each level of label needs to be determined through different classification units;
[0090] Based on this, during model training, the number of targets (the required number of classification units) corresponding to each category of information is determined according to the hierarchical relationship of the sample labels of each category of information.
[0091] Step S502: Train the target classification units of the target number based on the sample data and sample labels of the category information to obtain the target model parameters corresponding to the category information.
[0092] In this embodiment, in order to determine the target model parameters corresponding to each category of information, it is necessary to train the target classification unit based on the sample data of each category of information and the corresponding sample labels.
[0093] For example, for any category of information, the sample data of that category of information and the corresponding sample labels are used as input, the predicted labels are used as output, and the similarity between the sample labels and the predicted labels is used as the optimization condition to train the target classification unit. After training, the model parameters (target model parameters) of the target classification unit are determined.
[0094] This embodiment does not limit the specific implementation method of the above sample data, such as including sample data with sample labels (positive instances) and sample data without sample labels (negative instances).
[0095] As described above, the classification unit can be a GRU. For example, a 1-layer GRU with 136 hidden units can be used, and attention is added to the top of the GRU layer; an exit probability of 0.5 is applied to the GRU output; training is performed after 10 epochs (one generation of training) and a batch (a batch of data) of 128.
[0096] The above scheme accurately determines the target quantity corresponding to each category of information based on the hierarchical relationship of the sample labels of each category of information; and accurately determines the target model parameters suitable for each category of information by training the target classification unit with the sample data and sample labels of each category of information.
[0097] This application provides a second method for determining a preset correspondence, such as... Figure 6 As shown, the method may include:
[0098] Step S601: For any preset category information, determine the target quantity corresponding to the category information based on the hierarchical relationship of the sample labels of the category information.
[0099] The specific implementation of step S601 can be found in the above embodiments, and will not be repeated here.
[0100] Step S602: For any level of target classification unit, train the target classification unit based on the sample data of the category information and the sample label corresponding to the level to obtain the target model parameters of the target classification unit at that level.
[0101] Because different categories of information have different label levels, each level of label needs to be determined by different classification units; therefore, the sample labels of the target classification units at each level are different, and the corresponding target model parameters are also different.
[0102] Based on this, in this embodiment, the target classification units of each level are trained based on the sample data and the sample labels corresponding to each level to obtain the target model parameters of the target classification units of each level.
[0103] The above scheme requires different classification units to determine each level of label because different categories of information have different label levels. The target model parameters of each level of target classification unit are obtained by training the target classification units based on sample data and the corresponding sample labels of each level.
[0104] In some optional implementations, if the target classification unit has a higher-level target classification unit, the following steps are performed before training the target classification unit based on the sample data of the category information and the sample labels corresponding to the level:
[0105] After the target classification unit at the previous level has been trained, the initial model parameters of the target classification unit at that level are adjusted to the target model parameters of the target classification unit at the previous level.
[0106] In practice, if each classification unit is trained based on initial random parameters, the training time is relatively long. Since there is a certain correlation between hierarchical labels, the target model parameters of the previous level can be inherited through knowledge distillation. For example, the initial model parameters of the target classification unit at this level, except for the output layer, can be adjusted to the target model parameters of the target classification unit at the previous level. This allows for faster iteration and the acquisition of the target model parameters at this level.
[0107] For example, each level of target classification unit is the "parent class" of the target classification unit in the next level and the "subclass" of the target classification unit in the previous level.
[0108] In implementation, a lower learning rate can be applied to the transfer parameters (from the target classification unit in the previous layer), and a higher learning rate can be used for the final fully connected classification (output) layer. The learning rate for the fully connected layer is set to 0.001 (high learning rate) using Adam (Adaptive Moment Estimation) as the optimizer, since all parameters in this layer are randomly initialized and should be readjusted to their best possible values. The learning rates for other layers are randomly changed to below 0.001 to preserve model knowledge from the target classification unit in the previous layer. The embedding layer is frozen after training the top-level target classification unit; freezing the embedding layer prevents over-matching of classifiers for lower-level categories.
[0109] The above scheme, through parameter transfer, provides a better training starting point for the next level of target classification units, rapidly improving the timeliness of model training and increasing iteration efficiency.
[0110] In some optional implementations, step S602 above can be implemented in, but is not limited to, the following ways:
[0111] For any sample label corresponding to the level, the sampling weight of the sample label is determined based on the number of sample data corresponding to the sample label;
[0112] Based on the sampling weights, the sample labels and corresponding sample data are sampled, and the target classification unit is trained based on the sampled sample data and sample labels.
[0113] For example, since there are many categories of sample data (involving sample labels), the imbalance in the number of sample data between different categories has a significant impact on the training difficulty. We can also use weighted sampling, which assigns different weights to different categories based on the number of sample data (weights are inversely proportional to the number of data). The sampling frequency is determined by the weights, meaning that the fewer sample data corresponding to a certain sample label, the more times it is sampled.
[0114] like Figure 7 As shown, based on the same inventive concept, this application provides a label determining device 700, comprising:
[0115] The model information determination module 701 is used to determine the model information corresponding to the category information based on the category information of the data to be processed after receiving the data to be processed.
[0116] The model adjustment module 702 is used to adjust the initial classification model based on the corresponding model information to obtain the target classification model corresponding to the category information;
[0117] The label determination module 703 is used to input the data to be processed into the target classification model to obtain the label of the data to be processed.
[0118] In some optional implementations, the model information includes the number of targets and the target model parameters of the target classification units; the model adjustment module 702 is specifically used for:
[0119] Select the target number of classification units from the initial classification model as the target classification units;
[0120] For any target classification unit, the current model parameters of the target classification unit are adjusted to the corresponding target model parameters to obtain the target classification model.
[0121] In some optional implementations, the model information determination module 701 is specifically used for:
[0122] Based on a preset correspondence, the model information corresponding to the category information of the data to be processed is determined; wherein, the preset correspondence includes a preset correspondence between category information and model information.
[0123] In some optional implementations, the model information includes the number of targets and the target model parameters of the target classification units; the preset correspondence is determined in the following way:
[0124] For any preset category information, the target quantity corresponding to the category information is determined based on the hierarchical relationship of the sample labels of the category information;
[0125] Based on the sample data and sample labels of the category information, the target classification units of the target number are trained to obtain the target model parameters corresponding to the category information.
[0126] In some optional implementations, the target number of target classification units is trained based on the sample data and sample labels of the category information to obtain the target model parameters corresponding to the category information, including:
[0127] For any level of target classification unit, the target classification unit is trained based on the sample data of the category information and the sample labels corresponding to the level to obtain the target model parameters of the target classification unit at that level.
[0128] In some optional implementations, if the target classification unit has a higher-level target classification unit, then before training the target classification unit based on the sample data of the category information and the sample labels corresponding to the level, the method further includes:
[0129] After the target classification unit at the previous level has been trained, the initial model parameters of the target classification unit at that level are adjusted to the target model parameters of the target classification unit at the previous level.
[0130] In some optional implementations, the target classification unit is trained based on sample data containing the category information and sample labels corresponding to the level, including:
[0131] For any sample label corresponding to the level, the sampling weight of the sample label is determined based on the number of sample data corresponding to the sample label;
[0132] Based on the sampling weights, the sample labels and corresponding sample data are sampled, and the target classification unit is trained based on the sampled sample data and sample labels.
[0133] Since this device is the same as the device in the method of this application embodiment, and the principle of the device in solving the problem is similar to that of the method, the implementation of the device can be referred to the implementation of the method, and the repeated parts will not be described again.
[0134] like Figure 8 As shown, based on the same inventive concept, this application provides an electronic device 800, including: a processor 801 and a memory 802;
[0135] Memory 802 may be volatile memory, such as random-access memory (RAM); memory 802 may also be non-volatile memory, such as read-only memory, flash memory, hard disk drive (HDD), or solid-state drive (SSD); or memory 802 may be any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto. Memory 802 may be a combination of the above-described memories.
[0136] The processor 801 may include one or more central processing units (CPUs), graphics processing units (GPUs), or digital processing units, etc.
[0137] This application embodiment does not limit the specific connection medium between the memory 802 and the processor 801. This application embodiment... Figure 8 The memory 802 and the processor 801 are connected via a bus 803, which is in... Figure 8 The bus 803, represented by thick lines, can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 8 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0138] The memory 802 stores program code, which, when executed by the processor 801, causes the processor 801 to perform the following processes:
[0139] Upon receiving the data to be processed, the model information corresponding to the category information is determined based on the category information of the data to be processed.
[0140] The initial classification model is adjusted based on the corresponding model information to obtain the target classification model corresponding to the category information;
[0141] The data to be processed is input into the target classification model to obtain the label of the data to be processed.
[0142] In some optional implementations, the model information includes the number of targets and the target model parameters of the target classification units; the processor 801 specifically executes:
[0143] Select the target number of classification units from the initial classification model as the target classification units;
[0144] For any target classification unit, the current model parameters of the target classification unit are adjusted to the corresponding target model parameters to obtain the target classification model.
[0145] In some optional implementations, the processor 801 specifically performs:
[0146] Based on a preset correspondence, the model information corresponding to the category information of the data to be processed is determined; wherein, the preset correspondence includes a preset correspondence between category information and model information.
[0147] In some optional implementations, the model information includes the number of targets and the target model parameters of the target classification units; the preset correspondence is determined in the following way:
[0148] For any preset category information, the target quantity corresponding to the category information is determined based on the hierarchical relationship of the sample labels of the category information;
[0149] Based on the sample data and sample labels of the category information, the target classification units of the target number are trained to obtain the target model parameters corresponding to the category information.
[0150] In some optional implementations, the target number of target classification units is trained based on the sample data and sample labels of the category information to obtain the target model parameters corresponding to the category information, including:
[0151] For any level of target classification unit, the target classification unit is trained based on the sample data of the category information and the sample labels corresponding to the level to obtain the target model parameters of the target classification unit at that level.
[0152] In some optional implementations, if the target classification unit has a higher-level target classification unit, then before training the target classification unit based on the sample data of the category information and the sample labels corresponding to the level, the method further includes:
[0153] After the target classification unit at the previous level has been trained, the initial model parameters of the target classification unit at that level are adjusted to the target model parameters of the target classification unit at the previous level.
[0154] In some optional implementations, the target classification unit is trained based on sample data containing the category information and sample labels corresponding to the level, including:
[0155] For any sample label corresponding to the level, the sampling weight of the sample label is determined based on the number of sample data corresponding to the sample label;
[0156] Based on the sampling weights, the sample labels and corresponding sample data are sampled, and the target classification unit is trained based on the sampled sample data and sample labels.
[0157] Since the electronic device is the same electronic device that executes the method in the embodiments of this application, and the principle of the electronic device in solving the problem is similar to that of the method, the implementation of the electronic device can refer to the implementation of the method, and the repeated parts will not be described again.
[0158] This application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the tag determination method described above. The readable storage medium can be a non-volatile readable storage medium.
[0159] The present application has been described above with reference to block diagrams and / or flowcharts illustrating methods, apparatus (systems), and / or computer program products according to embodiments of the present application. It should be understood that a block of a block diagram and / or flowchart, as well as combinations of blocks of block diagrams and / or flowcharts, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, and / or other programmable means to produce a machine, such that the instructions, executable via the computer processor and / or other programmable means, create methods for implementing the functions / actions specified in the blocks of the block diagrams and / or flowcharts.
[0160] Accordingly, this application can also be implemented using hardware and / or software (including firmware, resident software, microcode, etc.). Furthermore, this application can take the form of a computer program product on a computer-usable or computer-readable storage medium, having computer-usable or computer-readable program code implemented in the medium for use by or in conjunction with an instruction execution system. In the context of this application, a computer-usable or computer-readable medium can be any medium that can contain, store, communicate, transmit, or deliver a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0161] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0162] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A label determination method characterized by, The method includes: Upon receiving the data to be processed, the model information corresponding to the category information is determined based on the category information of the data to be processed; wherein, the data to be processed is a text document; The initial classification model is adjusted based on the corresponding model information to obtain the target classification model corresponding to the category information; The data to be processed is input into the target classification model to obtain the label of the data to be processed; The model information includes the number of targets and the target model parameters of the target classification units; the initial classification model is adjusted based on the corresponding model information to obtain the target classification model corresponding to the category information, including: Select the target number of classification units from the initial classification model as the target classification units; For any target classification unit, the current model parameters of the target classification unit are adjusted to the corresponding target model parameters to obtain the target classification model.
2. The method of claim 1, wherein, Based on the category information of the data to be processed, determine the model information corresponding to the category information, including: Based on a preset correspondence, the model information corresponding to the category information of the data to be processed is determined; wherein, the preset correspondence includes a preset correspondence between category information and model information.
3. The method as described in claim 2, characterized in that, The model information includes the number of targets and the target model parameters of the target classification units; the preset correspondence is determined in the following way: For any preset category information, the target quantity corresponding to the category information is determined based on the hierarchical relationship of the sample labels of the category information; Based on the sample data and sample labels of the category information, the target classification units of the target number are trained to obtain the target model parameters corresponding to the category information.
4. The method as described in claim 3, characterized in that, Based on the sample data and sample labels of the category information, the target classification units of the target number are trained to obtain the target model parameters corresponding to the category information, including: For any level of target classification unit, the target classification unit is trained based on the sample data of the category information and the sample labels corresponding to the level to obtain the target model parameters of the target classification unit at that level.
5. The method as described in claim 4, characterized in that, If the target classification unit has a higher-level target classification unit, then before training the target classification unit based on the sample data of the category information and the sample labels corresponding to the level, the following steps are also included: After the target classification unit at the previous level has been trained, the initial model parameters of the target classification unit at that level are adjusted to the target model parameters of the target classification unit at the previous level.
6. The method as described in claim 4, characterized in that, Training the target classification unit based on the sample data containing the category information and the sample labels corresponding to the level includes: For any sample label corresponding to the level, the sampling weight of the sample label is determined based on the number of sample data corresponding to the sample label; Based on the sampling weights, the sample labels and corresponding sample data are sampled, and the target classification unit is trained based on the sampled sample data and sample labels.
7. A label determining device, characterized in that, The device includes: The model information determination module is used to determine the model information corresponding to the category information based on the category information of the data to be processed after receiving the data to be processed; wherein the data to be processed is a text document; The model adjustment module is used to adjust the initial classification model based on the corresponding model information to obtain the target classification model corresponding to the category information; The label determination module is used to input the data to be processed into the target classification model to obtain the label of the data to be processed. The model information includes the number of targets and the target model parameters for the target classification units; the model adjustment module is specifically used for: Select the target number of classification units from the initial classification model as the target classification units; For any target classification unit, the current model parameters of the target classification unit are adjusted to the corresponding target model parameters to obtain the target classification model.
8. An electronic device, characterized in that, The electronic device includes at least one processor and at least one memory, wherein the memory stores a computer program that, when executed by the processor, causes the processor to perform the method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, It stores a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform the method as described in any one of claims 1 to 6.