A data classification method, device, equipment, medium and product

By determining the coarse-grained and fine-grained hierarchies in the multi-label classification problem and building models based on these levels, the problems of high complexity of model training and slow classification speed in the existing technology are solved, and more efficient data classification is achieved.

CN119740140APending Publication Date: 2025-04-01CHINA MOBILE COMM CORP TIANJIN +1
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411706882.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

When dealing with multi-label classification problems in the prior art, local classifier methods are difficult to utilize the dependencies between levels, resulting in upper-level errors affecting the prediction results of lower-levels, and model training and maintenance are complex; while global classifier methods require the introduction of multiple output layers and embedding layers, resulting in high training complexity.

Method used

By obtaining training data with granularity labels, coarse-grained hierarchy and fine-grained hierarchy, building the model to be trained based on these levels and preset language models, using the training data to be trained, obtaining the pre-trained model, and using the pre-trained model to classify the data.

Benefits of technology

This reduces the training complexity of the model, improves the classification speed of the model, reduces the number of labels that require model classification, makes the model to be trained easier to train, and improves the model accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119740140A_ABST
    Figure CN119740140A_ABST
Patent Text Reader

Abstract

The present disclosure provides a data classification method, including obtaining a training data set, the training data set at least including first data with granularity labels; determining the coarse-grained level and the fine-grained level of the model to be trained based on the first parameter set of the first data; constructing the model to be trained based on the coarse-grained level, the fine-grained level and the preset language model; training the model to be trained based on the training data set to obtain a pre-trained model; and classifying the data to be classified using the pre-trained model. The present disclosure reduces the number of labels required for model classification by training the model to be trained using the first data with coarse-grained labels, thereby reducing the model complexity of the model to be trained, making the model to be trained easier to train, improving the model accuracy, and when using the pre-trained model for data classification, the preset language model only needs to determine the category of the data to be classified based on the node list corresponding to the current node in the granularity level, thereby improving the data classification speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence, and in particular to a data classification method, device, equipment, medium and product. Background Art

[0002] When dealing with multi-label classification problems, local classifier methods and global classifier methods are usually used for data classification. Among them, the local classifier methods mainly include local classifier layer-by-layer classification methods and local classifier node-by-node classification methods. The global classifier methods mainly include hierarchical classification methods based on Convolutional Neural Networks (CNN) and hierarchical classification methods based on transformer pre-trained models.

[0003] However, local classifier methods usually cannot make good use of the dependencies between layers. Errors in the upper layer will affect the prediction results of all lower layers, and model training and maintenance will be more complicated when there are extremely many labels. The global classifier method needs to introduce multiple output layers arranged in hierarchical order, as well as label embedding and text embedding for training, which makes model training more complicated. Summary of the invention

[0004] The present disclosure provides a data classification method, device, equipment, medium and product to solve the problems in related technologies, reduce the training complexity of the model, and improve the classification speed of the model.

[0005] The first aspect of the present disclosure proposes a data classification method, including: obtaining a training data set, the training data set at least including first data with a granularity label; determining a coarse-grained level and a fine-grained level of a model to be trained based on a first parameter set of the first data; constructing a model to be trained based on the coarse-grained level, the fine-grained level and a preset language model; training the model to be trained based on the training data set to obtain a pre-trained model; and classifying the data to be classified using the pre-trained model.

[0006] In some embodiments of the present disclosure, determining the coarse-grained level and the fine-grained level of the model to be trained based on the first parameter set of the first data includes: determining the category frequency index of the first category data based on the first number of first category data and the second number of the first data in the first data; determining the information entropy of the first category data based on the third number and the second number of first data points in the first category data; determining the category similarity between the first category data and the second category data based on the first semantic vector of the first category data and the second semantic vector of the second category data; determining the intra-category similarity of the first category data based on the third semantic vector of the first data point in the first category data and the fourth semantic vector of the second data point in the first category data; determining the coarse-grained level and the fine-grained level based on at least one of the category frequency index, information entropy, category similarity and intra-category similarity.

[0007] In some embodiments of the present disclosure, constructing a model to be trained based on the coarse-grained level and the fine-grained level includes: based on the coarse-grained level, using a global classifier, constructing a coarse classification module of the model to be trained; based on the fine-grained level and the coarse-grained level, using a preset hierarchical relationship table, constructing a graph structure of the fine-grained level; based on the coarse classification module, the graph structure and the preset language model, constructing the model to be trained.

[0008] In some embodiments of the present disclosure, training a model to be trained based on a training data set to obtain a pre-trained model includes: performing a first processing on the training data set to obtain a pre-processed data set; constructing semantic prompts based on the pre-processed data set; generating data classification results based on the semantic prompts using a preset language model; determining the accuracy of the preset language model based on the number of correct classifications in the data classification results; determining the hit rate of the preset language model based on the number of correct responses of the preset language model to the semantic prompts during the classification process; and correcting the preset language model based on the accuracy and hit rate to obtain a pre-trained model.

[0009] In some embodiments of the present disclosure, the first processing may include at least one of the following: performing data cleaning on the training data set to remove noise values ​​and outliers; clearing fine-grained labels in the training data set; performing data supplementation on the training data set; uniformly sampling the training data set based on coarse-grained labels; and labeling the coarse-grained labels of the training data set.

[0010] In some embodiments of the present disclosure, based on a preprocessed data set and preset semantic prompts, a data classification result is generated using a preset language model, including: using the preset semantic model to determine a first semantic feature in the preprocessed data set and a second semantic feature of a node in a graph structure; constructing semantic options based on the first semantic feature and the second semantic feature; using the preset language model to select a semantic option that meets the semantic prompt requirements from a majority of semantic options to generate a classification result.

[0011] A second aspect embodiment of the present disclosure proposes a data classification device, which includes: an acquisition unit, used to acquire a training data set, the training data set at least including first data with a granularity label; a determination unit, used to determine the coarse-grained level and the fine-grained level of the model to be trained based on a first parameter set of the first data; a construction unit, used to construct the model to be trained based on the coarse-grained level and the fine-grained level; a training unit, used to train the model to be trained based on the training data set to obtain a pre-trained model; and a classification unit, used to classify the data to be classified using the pre-trained model.

[0012] The third aspect embodiment of the present disclosure proposes an electronic device, comprising: a processor and a memory for storing a computer program that can be run on the processor, wherein the processor, when used to run the computer program, executes the method described in the first aspect embodiment of the present disclosure.

[0013] The fourth aspect embodiment of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the method described in the first aspect embodiment of the present disclosure.

[0014] The fifth aspect embodiment of the present disclosure provides a computer program product, including a computer program, which implements the method described in the first aspect embodiment of the present disclosure when executed by a processor.

[0015] In summary, according to a data classification method proposed in the present disclosure, the method includes: obtaining a training data set, the training data set includes at least first data with granular labels; determining the coarse-grained level and the fine-grained level of the model to be trained based on the first parameter set of the first data; constructing the model to be trained based on the coarse-grained level, the fine-grained level and the preset language model; training the model to be trained based on the training data set to obtain a pre-trained model; and classifying the data to be classified using the pre-trained model. The present disclosure reduces the number of labels required for model classification by training the model to be trained using the first data with coarse-grained labels, thereby reducing the model complexity of the model to be trained, making the model to be trained easier to train and improving the model accuracy. When using the pre-trained model for data classification, the preset language model only needs to determine the category of the data to be classified based on the node list corresponding to the current node in the granularity level, thereby improving the data classification speed.

[0016] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0018] Figure 1 A flowchart of a data classification method provided in an embodiment of the present disclosure;

[0019] Figure 2 A flowchart of another data classification method provided in an embodiment of the present disclosure;

[0020] Figure 3 A flowchart of another data classification method provided by an embodiment of the present disclosure;

[0021] Figure 4 A flowchart of another data classification method provided in an embodiment of the present disclosure;

[0022] Figure 5 An example diagram of a classification method provided by an embodiment of the present disclosure;

[0023] Figure 6 An example diagram of another classification method provided by the embodiment of the present disclosure;

[0024] Figure 7 An example diagram of another classification method provided by an embodiment of the present disclosure;

[0025] Figure 8 A schematic diagram of the structure of a data classification device provided in an embodiment of the present disclosure;

[0026] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0027] Embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.

[0028] The following is a brief introduction to the background technology involved in this disclosure:

[0029] 1. Local classifier layer by layer: A strategy for dealing with hierarchical multi-label classification problems, which defines an independent classifier for each layer in the hierarchical structure. In this strategy, the hierarchical structure is regarded as a system consisting of multiple layers, each layer can contain one or more labels, and the model can be adjusted and optimized independently for different layers. However, the classifiers between the layers are independent and cannot make good use of the dependencies between the layers. Moreover, errors in the upper layer will affect the prediction results of all the lower layers.

[0030] 2. Local classifier node by node: Define an independent classifier for each node (or label) in the hierarchy. Unlike the layer-by-layer strategy, the node-by-node strategy is more refined, and each classifier focuses on a specific label and its sub-labels. Although it provides more fine-grained control, the classifier of each node can be adjusted specifically. However, model training and maintenance will be more complicated when there are extremely many labels.

[0031] 3. Hierarchical classification method based on CNN: Branched convolutional neural network is a neural network model designed for hierarchical classification. It effectively processes data with hierarchical structure by introducing multiple output layers arranged in hierarchical order into the traditional convolutional neural network structure. This model can make predictions at different levels of abstraction, thereby improving the accuracy and efficiency of classification.

[0032] 4. Hierarchical classification method based on Transformer pre-trained model: XML-BERT is a model designed for a large number of multi-label text classification tasks. It introduces label embedding and text embedding for training based on BERT to handle tens of thousands of labels. BERT's powerful semantic understanding ability is used to match and align labels with text.

[0033] The present disclosure is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0034] Figure 1 A flow chart of a data classification method provided by an embodiment of the present disclosure. Figure 1 As shown, the method includes steps 101-105.

[0035] Step 101: Obtain a training data set.

[0036] In some embodiments, the training data set includes at least first data having a granularity label.

[0037] In other words, the training data set may also include data without strength labels.

[0038] Step 102: Determine the coarse-grained level and the fine-grained level of the model to be trained based on the first parameter set of the first data.

[0039] In some embodiments, the first parameter set may include: a first category of the first data, a semantic vector of the first data, the number of the first data, etc., which is not limited in the present disclosure.

[0040] In some embodiments, an evaluation index for determining whether the granularity is a coarse-grained level or a fine-grained level can be determined based on the first parameter set to facilitate construction of a model to be trained.

[0041] Specifically, in some embodiments, the category frequency index of the first category data can be determined based on the first number of first category data in the first data and the second number of the first data; the information entropy of the first category data can be determined based on the third number of first data points in the first category data and the second number; the category similarity between the first category data and the second category data can be determined based on the first semantic vector of the first category data and the second semantic vector of the second category data; the intra-category similarity of the first category data can be determined based on the third semantic vector of the first data point in the first category data and the fourth semantic vector of the second data point in the first category data; and the coarse-grained level and the fine-grained level can be determined based on at least one of the category frequency index, the information entropy, the category similarity and the intra-category similarity.

[0042] Step 103, constructing a model to be trained based on the coarse-grained level, the fine-grained level and the preset language model.

[0043] In some embodiments, a coarse classification module may be constructed based on a coarse-grained hierarchy.

[0044] Optionally, each coarse-grained level can be determined as an output of a global classifier, thereby constructing a coarse classification model.

[0045] In some embodiments, a fine-grained hierarchy graph structure may be constructed based on the fine-grained hierarchy.

[0046] Optionally, you can build a graph structure based on the relationships between different fine-grained levels. For details, see Figure 2 The embodiment shown.

[0047] Furthermore, the output layer of the coarse classification model can be used as the first layer of the graph structure.

[0048] In some embodiments, the preset language model can be integrated with the coarse classification module and the graph structure to construct a model to be trained, so that the preset language model can use the coarse classification module and the graph structure to perform model training on the training model.

[0049] Step 104: Based on the training data set, the model to be trained is trained to obtain a pre-trained model.

[0050] In some embodiments, a training data set may be used to train a preset language model in a model to be trained, thereby obtaining a pre-trained model.

[0051] In some embodiments, the pre-trained model can be obtained in the following manner: a training data set is first processed to obtain a pre-processed data set; semantic prompts are constructed based on the pre-processed data set; data classification results are generated based on the semantic prompts using a preset language model; the accuracy of the preset language model is determined based on the number of correct classifications in the data classification results; the hit rate of the preset language model is determined based on the number of correct responses of the preset language model to the semantic prompts during the classification process; and the preset language model is corrected based on the accuracy and hit rate to obtain the pre-trained model.

[0052] Step 105: classify the data to be classified using the pre-trained model.

[0053] In some embodiments, the data to be classified can be input into a pre-trained model, and semantic analysis can be performed on the data to be classified through a preset language model trained in the pre-trained model. Then, the type of the data to be classified is determined based on the semantics of the data to be classified, as well as the coarse classification module and the graph structure, thereby achieving classification of the data to be classified.

[0054] In summary, according to the data classification method proposed in the present disclosure, the method includes: obtaining a training data set, the training data set includes at least first data with granular labels; based on the first parameter set of the first data, determining the coarse-grained level and the fine-grained level of the model to be trained; based on the coarse-grained level, the fine-grained level and the preset language model, constructing the model to be trained; based on the training data set, training the model to be trained to obtain a pre-trained model; using the pre-trained model to classify the data to be classified. The present disclosure reduces the number of labels required for model classification by using the first data with coarse-grained labels to train the model to be trained, thereby reducing the model complexity of the model to be trained, making the model to be trained easier to train, improving the model accuracy, and when using the pre-trained model for data classification, the preset language model only needs to determine the category of the data to be classified according to the node list corresponding to the current node in the granularity level, thereby improving the data classification speed.

[0055] Figure 2 A flow chart of a data classification method proposed in the present disclosure is further shown. Figure 1 The embodiment shown further explains step 102. Figure 2 The following steps are included.

[0056] Step 201: determine the category frequency index of the first category data based on the first quantity of the first category data in the first data and the second quantity of the first data.

[0057] In some embodiments, the first category of data may refer to any category of data in the first data.

[0058] In some embodiments, the first number refers to the total number of data in the first category of data, and the second number refers to the total number of first data.

[0059] In some embodiments, the category frequency index is used to indicate the category label statistical frequency of the first category data in the first data.

[0060] In some embodiments, the category frequency index of the first category data may be determined by the following formula:

[0061]

[0062] Where CFI(c) represents the category frequency index of the first category c, N c represents the number of data points in the first category c, N total Represents the total number of data points in the first data.

[0063] Step 202: Determine the information entropy of the first category data based on the third number and the second number of first data points in the first category data.

[0064] In some embodiments, the first data point may be any data point in the first category of data.

[0065] In some embodiments, the third quantity may be the number of data in any type of data in the first category of data.

[0066] In some embodiments, the information entropy of the first category data may be determined by determining the occurrence probability of the first data point in the first category data.

[0067] In some embodiments, the information entropy may indicate the information entropy of data distribution of the first category of data in the first data.

[0068] In some embodiments, the occurrence probability of the first data point in the first category of data may be determined by the following formula:

[0069]

[0070] Among them, p i Indicates the probability of occurrence of the first category data c, N_data c Indicates the number of data of the i-th type in the first category data c, N_data total Indicates the total number of the first data, that is, N_data total With the above N total Have the same meaning.

[0071] Furthermore, the information entropy of the first data can be determined by using the occurrence probability of the first data point through the following formula:

[0072]

[0073] Wherein, CE(c) is used to represent the information entropy of the first category data c.

[0074] Step 203 : determining the category similarity between the first category data and the second category data based on the first semantic vector of the first category data and the second semantic vector of the second category data.

[0075] In some embodiments, the second category data may be any category data in the first data except the first category data.

[0076] In some embodiments, the first semantic vector and the second semantic vector may be parameters in the first parameter set described above, or may be obtained by embedding the first category data and the second category data through a bag-of-words model Glove or a semantic model Bert, which is not limited in the present disclosure.

[0077] In some embodiments, the category similarity may be a similarity index between granularity labels of each category of data in the first data.

[0078] In some embodiments, the category similarity can be determined by the following formula:

[0079] CS(c 1 , c 2 )=sim(vec(c 1 ), vec(c 2 ))

[0080] Among them, CS (c 1 , c 2 ) represents the category similarity between the first category c1 data and the second category c2 data, vec(c 1 ) represents the first semantic feature, vec(c 2 ) represents the second semantic feature.

[0081] Step 204 : determining the intra-category similarity of the first category data based on the third semantic vector of the first data point in the first category data and the fourth semantic vector of the second data point in the first category data.

[0082] In some embodiments, the intra-category similarity may indicate the similarity between first data points within the first category of data.

[0083] In some embodiments, the intra-category similarity can be determined by the following formula:

[0084]

[0085] Among them, CIS(c) represents the intra-category similarity of the first category data c, vec(x i ) represents the first data point x i The third semantic vector of the first data point x, vec(xj) j The fourth semantic vector represented by .

[0086] Step 205 , determining a coarse-grained level and a fine-grained level based on at least one of a category frequency index, information entropy, category similarity, and intra-category similarity.

[0087] In some embodiments, the category frequency index, information entropy, category similarity and intra-category similarity can be fused by parameters using the following formula to obtain a comprehensive hierarchical splitting index, and then the coarse-grained level and the fine-grained level are determined according to the comprehensive hierarchical splitting index. For example, the category whose comprehensive hierarchical splitting index value is greater than a preset value is determined as a fine-grained level, and the category whose value is less than the preset value is determined as a fine-grained level.

[0088] Score(c)=W 1 *CFI(c)+w 2 *CE(c)+W 3 *CS(c)+W 4 *CIS(c)

[0089] Among them, Score(c) represents the comprehensive level splitting index, W 1 、w 2 , W 3 With w 4 It represents the parameter weight. It should be understood that the above weight is adjusted according to each parameter in the hierarchical splitting decision. For example, if the data distribution of the first category is obviously uneven or the number is too small, then the information entropy of the first category and the w corresponding to the similarity within the category are involved. 2 With w 4 The weight value should be smaller.

[0090] Optionally, the coarse-grained level and the fine-grained level may be determined according to any one of a category frequency index, information entropy, category similarity, and intra-category similarity.

[0091] For example, when the category frequency index of a first category of data is in the top 10% to 30% of all categories, it can be considered that the frequency index of the category is high. In this context, the first category can be classified as a coarse-grained level.

[0092] For example, when the information entropy of a certain first category of data is in the top 70% to 90% of all categories, the category of the first category of data may be classified as a fine-grained level.

[0093] For example, when the category similarity between a first category data and a second category data is greater than a preset value, the categories of the first category data and the second category data may be determined as a fine-grained level, wherein the preset value may be 0.7 but is not limited thereto.

[0094] For example, when the intra-category similarity of a certain first category of data is greater than a preset value, the category of the first category of data may be determined as a fine-grained level, wherein the preset value may be 0.7 but is not limited thereto.

[0095] In summary, the data classification method proposed in the present disclosure includes: determining the category frequency index of the first category data based on the first number of first category data in the first data and the second number of the first data; determining the information entropy of the first category data based on the third number and the second number of the first data points in the first category data; determining the category similarity between the first category data and the second category data based on the first semantic vector of the first category data and the second semantic vector of the second category data; determining the intra-category similarity of the first category data based on the third semantic vector of the first data point in the first category data and the fourth semantic vector of the second data point in the first category data; determining the coarse-grained level and the fine-grained level based on at least one of the category frequency index, information entropy, category similarity and intra-category similarity. The method disclosed in the present disclosure improves the rationality and scientificity of the level splitting by determining multiple parameters for splitting the data level, and then determines the comprehensive level splitting index by fusing the multiple parameters to determine the coarse-grained level and the fine-grained level, and can improve the accuracy of the pre-trained model when performing data classification.

[0096] Figure 3 A flow chart of a data classification method proposed in the present disclosure is further shown. Figure 1 The embodiment shown further explains step 103. Figure 3 The following steps are included.

[0097] Step 301, based on the coarse-grained level, using the global classifier, constructs a coarse classification module of the model to be trained.

[0098] In some embodiments, since there is a clear distinction between the data semantics of the coarse-grained labels, this means that the categories represented by different labels have significant differences in data features, and the model can use these differences to perform effective classification. Due to the high degree of distinction between categories, the global classifier can better identify and distinguish these coarse-grained categories, thereby improving classification accuracy. Therefore, the coarse classification module of the model to be trained can be constructed by using the global classifier.

[0099] Moreover, compared with fine-grained classification, coarse-grained classification has fewer labels, which simplifies the complexity of the classification problem. The global classifier can handle such classification tasks with fewer labels, avoiding the complexity of training a model separately for each label.

[0100] In some embodiments, the coarse-grained level can be determined as data of the branch classifier to construct a coarse classification module.

[0101] In some embodiments, an output channel of the branch classifier can be used to output the upper category data and the lower category data in the coarse-grained level.

[0102] For example, if category 1 is a higher-level category than category 2, and category 1 has no lower-level categories except category 2, then the global classifier can be used to classify both the data of category 1 and the data of category 2 into category 2 for output.

[0103] Step 302 : Based on the fine-grained level and the coarse-grained level, a graph structure of the fine-grained level is constructed using a preset level relationship table.

[0104] In some embodiments, the last layer of the coarse-grained hierarchy can be used as the top-level node of the graph structure, and each node can be further refined to form a multi-level fine-grained classification system, thereby forming a fine-grained hierarchical graph structure.

[0105] Among them, the preset hierarchical relationship table is used to indicate the hierarchical relationship between different fine-grained levels. The design of the graph structure can be as follows:

[0106] 1. Node definition: Each node in the graph represents a category. The top-level node corresponds to the last layer of the coarse-grained hierarchy, and other nodes correspond to the classification of the fine-grained hierarchy.

[0107] 2. Edge definition: The edge between nodes represents the hierarchical relationship between categories. It can be unidirectional or bidirectional, depending on the actual business logic and data relationship.

[0108] 3. Graph functions: The graph structure must have conventional add, delete, modify, and query functions, as well as the function of querying all child nodes of the current node.

[0109] Step 303: construct a model to be trained based on the coarse classification module, the graph structure and the preset language model.

[0110] In some embodiments, the model to be trained is constructed by fusing the coarse classification module, the graph structure and the preset language model.

[0111] In some embodiments, the output (coarse-grained label) of the coarse classification module can be used as a node in the input query graph structure, and the data classification function of the model can be realized by obtaining the corresponding set of child nodes and performing further semantic analysis and selection operations through a preset language model.

[0112] Furthermore, the above query can be to locate the current node in the graph structure using the output label of the coarse classification module. This step involves performing a node query in the graph database to ensure that the current node corresponding to the output of the classification model is found. Once the current node is determined, the next operation is to retrieve all direct child nodes of the node. These child nodes represent possible next-level finer-grained classification options, providing the necessary candidate categories for the subsequent classification process. In this way, it is possible to systematically transition from coarse-grained classification to fine-grained classification, ensuring the coherence of each step of classification.

[0113] In summary, the data classification method proposed in the present disclosure includes: based on the coarse-grained hierarchy, using a global classifier, constructing a coarse classification module of the model to be trained; based on the fine-grained hierarchy and the coarse-grained hierarchy, using a preset hierarchical relationship table, constructing a graph structure of the fine-grained hierarchy; based on the coarse classification module, the graph structure and the preset language model, constructing the model to be trained. The method disclosed in the present disclosure constructs the model to be trained by using the coarse classification module, the graph structure and the preset language model, thereby reducing the number of categories that the coarse classification module needs to consider for data recognition and classification during training, reducing the data classification time, and when using the preset language model to process the fine-grained classification, it is only necessary to consider the sub-node list of the current node in combination with the graph structure, reducing the need to identify from a large number of hierarchical classification labels each time, reducing the complexity of the preset language model processing, and further improving the data classification speed.

[0114] Figure 4 A flow chart of a data classification method proposed in the present disclosure is further shown. Figure 1 The embodiment shown further explains step 104. Figure 3 The following steps are included.

[0115] Step 401: Perform a first process on the training data set to obtain a preprocessed data set.

[0116] In some embodiments, the first processing may include at least one of the following: performing data cleaning on the training data set to remove noise values ​​and outliers; clearing fine-grained labels in the training data set; performing data supplementation on the training data set; uniformly sampling the training data set based on coarse-grained labels; and labeling the coarse-grained labels of the training data set.

[0117] In some embodiments, since the training data set may be directly obtained from business data, the quality of the data in the training data set and the data annotation conditions may be different, so the training data set needs to be first processed.

[0118] For example, for the first data with a granularity label in the training data set, the following processing can be performed:

[0119] 1. Perform data cleaning on the training data set to remove noise and outliers in the data and deal with problems such as missing data.

[0120] 2. Clear the fine-grained labels in the training data set. Since the coarse classification module can achieve data diversion based on coarse-grained labels, it is only necessary to extract and retain the corresponding coarse-grained category labels. This step can also significantly improve the accuracy of classification and reduce the workload required for subsequent manual review.

[0121] 3. Uniformly sample the training data set based on coarse-grained labels. Since the number of first data in different categories may be different, in order to ensure that each category has enough samples during the model training and testing stages, it is necessary to uniformly sample the training data set based on coarse-grained labels to ensure the effectiveness of model evaluation and generalization capabilities.

[0122] For example, for data without granular labels in the training dataset, the following processing can be performed:

[0123] 1. Perform data cleaning on the training data set.

[0124] 2. Label the coarse-grained labels of the training data set. Data without granular labels can be labeled with coarse-grained labels manually or using classification algorithms, so that they can be diverted using the coarse classification module later.

[0125] 3. Based on the coarse-grained labels, the training data set is uniformly sampled.

[0126] Step 402: construct semantic prompts based on the preprocessed data set.

[0127] In some embodiments, semantic prompts may be constructed based on a preprocessed data set so that a preset language model can learn semantic relationships between different nodes.

[0128] For example, a preset language model can be used to convert the sub-node information in the graph structure into a multiple-choice question format (i.e., semantic prompts), and use the preset language model to generate a corresponding format such as a Json answer to evaluate the correlation between the current text and its sub-nodes.

[0129] Step 403: Generate data classification results based on the semantic prompts using a preset language model.

[0130] In some embodiments, the preset language model determines the child nodes of the classified data in the graph structure according to the semantic prompts, thereby classifying the data to be classified and generating data classification results.

[0131] In some embodiments, a preset semantic model can be used to determine the first semantic feature in the preprocessed data set and the second semantic feature of the node in the graph structure; based on the first semantic feature and the second semantic feature, semantic options are constructed; and using a preset language model, semantic options that meet the semantic prompt requirements are selected from the majority of semantic options to generate classification results.

[0132] Step 404: Determine the accuracy of the preset language model based on the number of correct classifications in the data classification results.

[0133] In some embodiments, the accuracy of the preset model can be determined by the following formula:

[0134]

[0135] Among them, Acc represents accuracy, Correct represents the number of misclassifications (Correct in the above formula can also be replaced by True, that is, the number of correct classifications), and Total represents the total number of classifications.

[0136] Step 405 : determining the hit rate of the preset language model based on the number of correct responses of the preset language model to the semantic prompts during the classification process.

[0137] In some embodiments, the hit rate of the preset model may be determined by the following formula:

[0138]

[0139] Among them, Hit Rate represents the hit rate, Hit Correct represents the number of incorrect answers to the semantic prompts given by the preset language model during the classification process (Hit Correct in the above formula can also be replaced by Hit True, that is, the number of correct responses to the semantic prompts, which includes the number of correct answers and the number of incorrect answers), and Total represents the total number of answers.

[0140] Step 406: Based on the accuracy and hit rate, the preset language model is modified to obtain a pre-trained model.

[0141] In some embodiments, if the accuracy is low, this may indicate that the model preset language type fails to effectively utilize semantic information. In this case, it should be considered to improve the semantic understanding and classification capabilities of the preset language type under the current vertical task, such as further optimizing the prompts, adding few-shot examples, etc.

[0142] In some embodiments, if the hit rate is low, it means that the preset language type lacks the ability to understand and follow instructions. It is not appropriate to simply optimize the prompts, etc., and it is necessary to replace the alternative preset language type or fine-tune the current preset language type so that it can have the ability to follow instructions.

[0143] In summary, the data classification method proposed in the present disclosure includes: performing a first processing on a training data set to obtain a preprocessing data set; constructing semantic prompts based on the preprocessing data set; generating data classification results based on the semantic prompts using a preset language model; determining the accuracy of the preset language model based on the number of correct classifications in the data classification results; determining the hit rate of the preset language model based on the number of correct responses of the preset language model to the semantic prompts during the classification process; and correcting the preset language model based on the accuracy and hit rate to obtain a pretrained model. The method of the present disclosure further improves the accuracy of data classification by evaluating the accuracy and hit rate indicators of the answers generated by the training model, and according to the evaluation results, adopting a strategy to improve the semantic understanding and classification capabilities of the preset language model, or replacing the alternative preset language model to improve the instruction following ability, so as to obtain a pretrained model.

[0144] The following is an exemplary description of the disclosed method:

[0145] In this application, a data classification method implementation flow chart is as follows Figure 5 As shown, the classification layer is Figure 6 As shown, the graph storage structure is as follows Figure 7 shown.

[0146] Embodiment 1:

[0147] Step 1

[0148] The operator complaint ticket classification standard is adopted as the hierarchical classification standard in the solution.

[0149] Step 2

[0150] Calculating composite indicators splits the hierarchical classification categories into coarse or fine-grained categories.

[0151] Category Frequency Index (CFI): For each category in the hierarchical classification standard, the category frequency index (CFI) is used to calculate the number of the current 3500 classification categories in each category. For example, if there is only one node "mobile service" in the first layer, its frequency is 3500 / 3500=1, because this classification category includes categories of all sub-layers.

[0152] Category Entropy (CE): used to calculate the amount of data in each category. According to the number of occurrences of the current 4500 data in each category, the intervals are divided into [0-10], [11-20], [21-30], etc., so as to obtain the entropy corresponding to each category. For example, there are 5 nodes in the next layer for the first-layer category "mobile service", and the corresponding data volumes are [100, 800, 1300, 700, 1600], and the corresponding category entropy is 2.03. The maximum distribution of category entropy is uniform distribution, that is, [900, 900, 900, 900, 900], which is 2.32.

[0153] Category similarity (CS) and intra-category similarity (CIS): CS is a similarity index between sub-levels corresponding to a level calculated by using word embedding models such as BERT or GloVe. CIS is a similarity index calculated by randomly sampling a number of data between sub-categories corresponding to each level by using word embedding models such as BERT or GloVe.

[0154] Step 3

[0155] By calculating the comprehensive indicators for each category in the hierarchy, we set the threshold suitable for the task. For example, the first three layers of the complaint ticket category are set as coarse-grained categories, about 20% of the categories in the fourth layer are coarse-grained categories, and the rest are fine-grained categories. By extracting the coarse-grained categories from the 4,500 previously collected data, we obtain a relatively accurate coarse-grained data set, and manually review to determine whether the data and classification are correct. This step can greatly reduce the workload compared to reviewing all categories. Finally, the data with a relatively close number of categories is used as the coarse-grained hierarchical classification data set after standard annotation.

[0156] In addition, dozens of fine-grained category data were manually reviewed and labeled as the optimized verification set for subsequent LLM.

[0157] Step 4

[0158] This solution uses TextCNN as the global classifier model, but is not limited to this model. The labeled data is trained with a training, test, and validation set ratio of 8:1:1 to obtain a classification model.

[0159] Step 5

[0160] Create a graph structure. The last layer of coarse-grained categories is used as the head node of the graph, and the fine-grained categories are inserted into the graph storage structure as their child nodes.

[0161] Step 6

[0162] For the fine-grained classification validation set. This solution will use LLM's instruction following to make semantic choices, that is, let LLM do multiple-choice questions, but the method is not limited to this. By first measuring the hit rate of LLM on the validation set, it is determined whether LLM needs to be replaced or fine-tuned. Indicator evaluation is performed by designing prompts of various styles:

[0163] 1. Directly construct the following multiple-choice question prompts.

[0164] 2. Use a few examples as learning samples to reconstruct the following multiple-choice questions.

[0165] 3. Use dozens of examples as learning samples to reconstruct the following multiple-choice question prompts.

[0166] Among them, the hit rate requires that the options and the corresponding answers are completely matched to be correct, otherwise it is a miss.

[0167] The large language model used in this solution is deepseek, and its command following ability has reached 100% hit rate in 2 and 3 on the validation set. Combined with the accuracy index for evaluation, it is found that the accuracy in 2 and 3 is almost the same, so a few examples can be used as learning samples to reconstruct the following single-choice question prompts. During use, only the corresponding prompts need to be adjusted appropriately, without replacing or fine-tuning the LLM.

[0168] Step 7

[0169] By inputting the complaint text into TextCNN, we obtain a coarse-grained classification label, and then use the label to query the constructed graph structure to obtain its corresponding child node list.

[0170] Step 8

[0171] The sub-node list is embedded into the template followed by the instruction as the input of LLM, and LLM outputs the corresponding classification category.

[0172] Therefore, this solution has the following beneficial effects:

[0173] 1. The present invention reduces the number of labels that need to be classified by the model by using the first data with coarse-grained labels to train the model to be trained, thereby reducing the model complexity of the model to be trained, making the model to be trained easier to train and improving the model accuracy. When using the pre-trained model for data classification, the preset language model only needs to determine the category of the data to be classified according to the node list corresponding to the current node in the granularity level, thereby improving the data classification speed.

[0174] 2. The method disclosed in the present invention determines multiple parameters for splitting data levels, and then determines a comprehensive level splitting index by fusing multiple parameters to determine the coarse-grained level and the fine-grained level, thereby improving the rationality and scientificity of the level splitting and being able to improve the accuracy of the pre-trained model when performing data classification.

[0175] 3. The method disclosed in the present invention constructs a model to be trained by utilizing a coarse classification module, a graph structure, and a preset language model, thereby reducing the number of categories that the coarse classification module needs to consider for data identification and classification during training, thereby reducing data classification time. Moreover, when utilizing the preset language model for fine-grained classification, it is only necessary to consider the child node list of the current node in combination with the graph structure, thereby reducing the need to identify from a large number of hierarchical classification labels each time, reducing the complexity of the preset language model processing, and further improving the data classification speed.

[0176] 4. The method disclosed in the present invention evaluates the answers generated by the training model based on the accuracy and hit rate indicators. According to the evaluation results, a strategy is adopted to improve the semantic understanding and classification capabilities of the preset language model, or to replace the alternative preset language model to improve the instruction following ability, so as to obtain a pre-trained model, thereby further improving the accuracy of data classification.

[0177] Figure 8 FIG. 8 is a schematic diagram of a data classification device 800 provided in an embodiment of the present disclosure. Figure 8 As shown, the data classification device includes:

[0178] An acquiring unit 810 is used to acquire a training data set, where the training data set at least includes first data with a granularity label;

[0179] A determination unit 820, configured to determine a coarse-grained level and a fine-grained level of a model to be trained based on a first parameter set of the first data;

[0180] A construction unit 830, configured to construct a model to be trained based on the coarse-grained level, the fine-grained level and a preset language model;

[0181] A training unit 840 is used to train the model to be trained based on the training data set to obtain a pre-trained model;

[0182] The classification unit 850 is used to classify the data to be classified using the pre-trained model.

[0183] In some embodiments of the present disclosure, the determination unit 820 is further used to determine a category frequency index of the first category data based on a first quantity of the first category data in the first data and a second quantity of the first data; determine an information entropy of the first category data based on a third quantity and a second quantity of the first data points in the first category data; determine a category similarity between the first category data and the second category data based on a first semantic vector of the first category data and a second semantic vector of the second category data; determine an intra-category similarity of the first category data based on a third semantic vector of the first data point in the first category data and a fourth semantic vector of the second data point in the category data; and determine a coarse-grained level and a fine-grained level based on at least one of the category frequency index, the information entropy, the category similarity, and the intra-category similarity.

[0184] In some embodiments of the present disclosure, the construction unit 830 is also used to construct a coarse classification module of the model to be trained based on the coarse-grained level using a global classifier; to construct a graph structure of the fine-grained level based on the fine-grained level and the coarse-grained level using a preset hierarchical relationship table; and to construct the model to be trained based on the coarse classification module, the graph structure and the preset language model.

[0185] In some embodiments of the present disclosure, the training unit 840 is further used to perform a first processing on the training data set to obtain a preprocessed data set; construct semantic prompts based on the preprocessed data set; generate data classification results based on the semantic prompts using a preset language model; determine the accuracy of the preset language model based on the number of correct classifications in the data classification results; determine the hit rate of the preset language model based on the number of correct responses of the preset language model to the semantic prompts during the classification process; and modify the preset language model based on the accuracy and hit rate to obtain a pretrained model.

[0186] In some embodiments of the present disclosure, the first processing may include at least one of the following: performing data cleaning on the training data set to remove noise values ​​and outliers; clearing fine-grained labels in the training data set; performing data supplementation on the training data set; uniformly sampling the training data set based on coarse-grained labels; and labeling the coarse-grained labels of the training data set.

[0187] In some embodiments of the present disclosure, the training unit 840 is also used to use a preset semantic model to determine a first semantic feature in a preprocessed data set and a second semantic feature of a node in a graph structure; construct semantic options based on the first semantic feature and the second semantic feature; and use a preset language model to select a semantic option that meets the semantic prompt requirement from a majority of semantic options to generate a classification result.

[0188] In summary, the data classification device proposed in the present disclosure includes: an acquisition unit for acquiring a training data set, wherein the training data set includes at least first data with a granular label; a determination unit for determining the coarse-grained level and the fine-grained level of the model to be trained based on the first parameter set of the first data; a construction unit for constructing the model to be trained based on the coarse-grained level and the fine-grained level; a training unit for training the model to be trained based on the training data set to obtain a pre-trained model; and a classification unit for classifying the data to be classified using the pre-trained model. The device of the present disclosure reduces the number of labels required for model classification by training the model to be trained using the first data with a coarse-grained label, thereby reducing the model complexity of the model to be trained, making the model to be trained easier to train and improving the model accuracy. When the pre-trained model is used for data classification, the preset language model only needs to determine the category of the data to be classified based on the node list corresponding to the current node in the granularity level, thereby improving the data classification speed.

[0189] It should be noted that: the data classification device provided in the above embodiment only uses the division of the above-mentioned program modules as an example when performing data classification. In actual applications, the above-mentioned processing can be assigned to different program modules as needed, that is, the internal structure of the data classification device is divided into different program modules to complete all or part of the processing described above.

[0190] Since the device provided in the embodiment of the present disclosure corresponds to the methods provided in the above-mentioned embodiments, the implementation of the method is also applicable to the device provided in the embodiment and will not be described in detail in this embodiment.

[0191] In the embodiments provided in the present application, the methods and devices provided in the embodiments of the present application are introduced. In order to implement the functions in the methods provided in the embodiments of the present application, the electronic device may include a hardware structure and a software module, and implement the functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. A function of the functions may be executed in the form of a hardware structure, a software module, or a hardware structure plus a software module.

[0192] Fig. 9 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure is shown in FIG. Fig. 9As shown, the electronic device 900 includes at least one processor 902; and a memory 901 communicatively connected to the at least one processor 902; wherein the memory 901 stores instructions executable by the at least one processor 902, and the instructions are executed by the at least one processor 902 to implement the steps of the data classification method described in the embodiment of the present disclosure; or, the instructions are executed by the at least one processor 902 to implement the steps of the data classification method described in the embodiment of the present disclosure.

[0193] It is understood that the electronic device also includes a communication interface. The various components in the electronic device are coupled together through a bus system. It is understood that the bus system is used to achieve connection and communication between these components. In addition to the data bus, the bus system also includes a power bus, a control bus and a status signal bus.

[0194] It can be understood that the memory 901 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM).The memory 901 described in this embodiment of the present solution is intended to include, but is not limited to, these and any other suitable types of memories.

[0195] The method disclosed in the above embodiment of the present disclosure may be applied to the processor 902, or implemented by the processor 902. The processor 902 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in the processor 902 or an instruction in the form of software.

[0196] The processor 902 described above may be a general-purpose processor, a DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 902 may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this solution. A general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiments of this solution, it may be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in a decoding processor. The software module may be located in a storage medium, which is located in the memory 901, and the processor 902 reads the information in the memory 901 and completes the steps of the aforementioned method in combination with its hardware.

[0197] In an exemplary embodiment, the electronic device may be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD), FPGA, general purpose processor, controller, MCU, microprocessor, or other electronic components to execute the aforementioned method.

[0198] The embodiment of the present disclosure also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to implement the steps of the data classification method described in the embodiment of the present solution when the computer instructions are executed.

[0199] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0200] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples" or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present solution. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0201] Any process or method description in the flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiment of the present scheme includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present scheme belong.

[0202] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processing module, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (control method), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary, and then stored in a computer memory.

[0203] It should be understood that the various parts of the implementation of the present solution can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned implementation, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another implementation, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0204] A person skilled in the art may understand that all or part of the steps in the above-mentioned embodiment method may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0205] In addition, each functional unit in each embodiment of the present solution can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. The above-mentioned storage medium can be a read-only memory, a disk or an optical disk, etc.

[0206] Although the implementation methods of the present scheme have been shown and described above, it can be understood that the above implementation methods are exemplary and cannot be understood as limitations on the present scheme. Ordinary technicians in this field can change, modify, replace and modify the above implementation methods within the scope of the present scheme.

Claims

1. A data classification method, characterized in that: The method comprises: Acquire a training data set, where the training data set at least includes first data with a granularity label; Determining a coarse-grained level and a fine-grained level of a model to be trained based on a first parameter set of the first data; Based on the coarse-grained level and the fine-grained level, construct the model to be trained; Based on the training data set, training the model to be trained to obtain a pre-trained model; The pre-trained model is used to classify the data to be classified.

2. The method according to claim 1, characterized in that The determining, based on the first parameter set of the first data, the coarse-grained level and the fine-grained level of the model to be trained comprises: determining a category frequency index of the first category data based on a first quantity of the first category data in the first data and a second quantity of the first data; determining information entropy of the first category of data based on a third number of first data points in the first category of data and the second number; Determine the category similarity between the first category data and the second category data based on the first semantic vector of the first category data and the second semantic vector of the second category data; Determining the intra-category similarity of the first category data based on the third semantic vector of the first data point in the first category data and the fourth semantic vector of the second data point in the first category data; The coarse-grained level and the fine-grained level are determined based on at least one of the category frequency index, the information entropy, the category similarity, and the intra-category similarity.

3. The method according to claim 1, characterized in that The constructing the model to be trained based on the coarse-grained level and the fine-grained level includes: Based on the coarse-grained level, using a global classifier, constructing a coarse classification module of the model to be trained; Based on the fine-grained level and the coarse-grained level, a graph structure of the fine-grained level is constructed using a preset level relationship table; Based on the coarse classification module, the graph structure and the preset language model, the model to be trained is constructed.

4. The method according to claim 1, characterized in that: The training of the model to be trained based on the training data set to obtain a pre-trained model includes: Performing a first processing on the training data set to obtain a preprocessing data set; Based on the preprocessed data set, construct semantic prompts; Based on the semantic prompt, using a preset language model, generating a data classification result; Determining the accuracy of the preset language model based on the number of correct classifications in the data classification results; Determining a hit rate of the preset language model based on the number of correct responses of the preset language model to the semantic prompt during the classification process; Based on the accuracy and the hit rate, the preset language model is modified to obtain a pre-trained model.

5. The method according to claim 4, characterized in that The first process may include at least one of the following: Performing data cleaning on the training data set to remove noise values ​​and outliers; Clearing fine-grained labels in the training dataset; Supplementing the training data set; Based on the coarse-grained labels, uniformly sampling the training data set; Annotate the training dataset with coarse-grained labels.

6. The method according to claim 4, characterized in that The generating of data classification results based on the preprocessed data set and the preset semantic prompt using the preset language model includes: Determine, by using the preset semantic model, a first semantic feature in the preprocessed data set and a second semantic feature of a node in the graph structure; constructing a semantic option based on the first semantic feature and the second semantic feature; The preset language model is used to select a semantic option that meets the semantic prompt requirement from a majority of semantic options to generate the classification result.

7. A data classification device, characterized in that: The device comprises: An acquisition unit, configured to acquire a training data set, wherein the training data set at least includes first data having a granularity label; A determination unit, configured to determine a coarse-grained level and a fine-grained level of a model to be trained based on a first parameter set of the first data; A construction unit, configured to construct the model to be trained based on the coarse-grained level and the fine-grained level; A training unit, used for training the model to be trained based on the training data set to obtain a pre-trained model; The classification unit is used to classify the data to be classified using the pre-trained model.

8. An electronic device, characterized in that: include: a processor and a memory for storing a computer program capable of being executed on the processor, Wherein, when the processor is used to run the computer program, it executes the method described in any one of claims 1-6.

9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-6.

10. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 6.

Citation Information

Cited By

  • Generalized classification method and device for domain awareness based on large language model

    CN122286452A

  • Generalized classification method and device based on large language model for domain perception

    CN122286452B