Data asset classification method and device, equipment, storage medium and product
By using the double tower model to extract data asset characteristics and find vector representations, the problems of insufficient robustness and low computational efficiency of data asset classification in the prior art are solved, and more efficient and accurate classification results are achieved.
Patent Information
- Application Number
- CN202411112807.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2025-02-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art has problems of insufficient robustness, low accuracy and low computational efficiency when classifying hierarchical data assets, especially when dealing with large amounts of data and complex naming rules.
The Twin-tower Based Data Asset Classification (TBDAC) is used to classify data assets, extract the characteristics of data assets through the first subnet in the double tower model, and find a matching vector representation from the label vector library to determine Classification of data assets.
It improves the robustness and accuracy of data asset classification, reduces the overhead of computing efficiency, and allows the model to process large-scale data assets more efficiently.
Smart Images

Figure CN119415698A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of coding technology, and in particular, to a data asset classification method, device, equipment, storage medium and product. Background Art
[0002] In order to manage data security for specific and differentiated data assets of different data categories and sensitivity levels, accurate hierarchical classification (including grading) of data assets has become a basic pre-work. There are many unclassified tables in the system database, among which the Chinese name of the table, the English name of the table, the Chinese name of the field, the English name of the field and the description information of the notes are the main basis for classification and grading. For such data, since the name contains specific semantic information and exists in both Chinese and English, the model needs to accurately extract effective information. At the same time, since multiple fields in a table may belong to different categories, the model needs to have a keen perception of subtle name changes. In addition, due to the huge amount of data and the need for professional power grid technicians to participate in the understanding of table names, the data annotation cost is high, time-consuming and labor-intensive, so the model is required to infer the data of the entire field based on only partial field data, which puts higher requirements on the semantic understanding of the model.
[0003] There are two existing technical solution frameworks for hierarchical labeled text classification: local methods and global methods. The local method first determines the label classification of each layer of the hierarchical label, and then combines all hierarchical predictions to generate the final classification. This framework generates a hierarchy of classifiers according to a top-down strategy, where each classifier is responsible for the prediction of a specific label subtree or a specific hierarchical level; the global method is different from the local method in that it uses a single classifier to model the structure of the entire hierarchical label, so that it can consider the complete hierarchy when predicting without relying on multiple classifiers at different levels.
[0004] Local methods suffer from severe scaling issues, as the number of local classifiers required depends entirely on the structure of the hierarchical labels. Furthermore, the top-down techniques employed by all local methods are prone to error propagation issues. If an error occurs at a particular level of the hierarchy, the error will propagate downwards unless some steps are taken to avoid this.
[0005] The global method has efficiency issues such as high time overhead and high computational complexity, because the global classifier needs to model the entire hierarchical label structure and consider the overall structural information. When the model is calculated and deduced, other irrelevant redundant structures are often included in the classification and hierarchical information retrieval. These redundant structures, which are regarded as noise, will increase the computational burden of the model.
[0006] In addition, there are two shortcomings in the application of existing technologies in actual business scenarios: first, due to the huge amount of data in the database, it is difficult to complete the classification by professional technicians alone, and the naming rules are relatively complex and difficult to correspond to specific categories. Secondly, the classification and grading standards are still under revision. If a new version of the classification standard appears, the previous classification will be invalid; secondly, labeled data is scarce, and a large amount of data remains in its original unlabeled state. Generating accurate classification and grading labels requires more complex algorithm design, which greatly reduces the algorithm's running speed.
[0007] In summary, how to improve the robustness of hierarchical data asset classification and improve accuracy and computational efficiency has become an urgent problem to be solved. Summary of the invention
[0008] The present application provides a data asset classification method, apparatus, device, storage medium and product to efficiently determine appropriate encoding parameters and improve the classification quality and efficiency of data assets.
[0009] In a first aspect, an embodiment of the present application provides a data asset classification method, including:
[0010] Acquire data assets to be classified and a label vector library, wherein the label vector library stores vector representations corresponding to labels for classifying data assets, wherein the vector representations are obtained during the training process of a dual-tower model, wherein the dual-tower model includes a first sub-network for extracting features of labels and a second sub-network for extracting features of sample data assets;
[0011] Extracting the features of the data asset through the first sub-network in the dual-tower model;
[0012] The vector representation corresponding to the feature of the data asset is searched in the label vector library, and the category to which the data asset belongs is determined according to the label corresponding to the vector representation.
[0013] In a second aspect, the embodiment of the present application further provides a data asset classification device, including:
[0014] An acquisition module is used to acquire data assets to be classified and a label vector library, wherein the label vector library stores vector representations corresponding to labels for classifying data assets, wherein the vector representations are obtained during the training process of a dual-tower model, wherein the dual-tower model includes a first sub-network for extracting features of labels and a second sub-network for extracting features of sample data assets;
[0015] An extraction module, which extracts the features of the data asset through the first sub-network in the dual-tower model;
[0016] The classification module searches the label vector library for the vector representation corresponding to the feature of the data asset, and determines the classification to which the data asset belongs according to the label corresponding to the vector representation.
[0017] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0018] one or more processors;
[0019] A storage device for storing one or more programs;
[0020] When the one or more programs are executed by the one or more processors, the one or more processors implement the data asset classification method as described in the first aspect.
[0021] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the data asset classification method as described in the first aspect.
[0022] In a fourth aspect, an embodiment of the present application further provides a computer program product, including a computer program and / or instructions, which, when executed by a processor, implements a data asset classification method as described in any of the above embodiments.
[0023] The embodiments of the present application provide a data asset classification method, apparatus, device, storage medium and product, the data asset classification method includes: obtaining data assets to be classified and a label vector library, the label vector library stores vector representations corresponding to labels for classifying data assets, the vector representations are obtained during the training process of a dual-tower model, the dual-tower model includes a first sub-network for extracting features of labels and a second sub-network for extracting features of sample data assets; extracting features of data assets through the first sub-network in the dual-tower model; searching for vector representations corresponding to the features of data assets from the label vector library, and determining the category to which the data assets belong based on the labels corresponding to the vector representations. The above technical solution can obtain vector representations of labels during the training process of the dual-tower model, extract text features of data assets during actual reasoning, quickly match corresponding labels from the vector representations, complete classification, and improve the robustness and efficiency of classification. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0025] Figure 1A flowchart of a data asset classification method provided in an embodiment of the present application;
[0026] Figure 2 A schematic diagram of a Transformer-based generative encoder provided in an embodiment
[0027] Figure 3 A schematic diagram of using a label vector library and ANN to accelerate label matching provided by an embodiment
[0028] Figure 4 A schematic diagram of a sample data asset classification process based on a TBDAC model provided by an embodiment;
[0029] Figure 5 A schematic diagram of the structure of a data asset classification device provided in an embodiment of the present application;
[0030] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only the parts related to the present application, rather than all structures, are shown in the accompanying drawings.
[0032] It should be mentioned before discussing the exemplary embodiments in more detail that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the steps as sequential processes, many of the steps therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0033] It should be noted that the concepts of "first", "second", etc. mentioned in the embodiments of the present application are only used to distinguish different devices, modules, units or other objects, and are not used to limit the order or interdependence of the functions performed by these devices, modules, units or other objects.
[0034] In addition, the embodiments in the present application and the features in the embodiments may be combined with each other if there is no conflict.
[0035] The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0036] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the relevant content of the solution.
[0037] In this application, the classification of data assets mainly refers to hierarchical classification, which can also be understood as grading data assets. In a scenario, the overall classification strategy of data assets can be summarized as "three-dimensional, five-layer, and six-level", where "three-dimensional" refers to the classification and grading of data from three dimensions: enterprise data, personal information, and public data; "five-layer" means that the overall data classification can be divided into five layers, and the classification depth of each dimension data can be adjusted as appropriate according to different data characteristics to be close to the actual business and data management; "six-level" means that data classification is based on importance and the degree of harm after leakage or misuse. The business data can be divided into six levels from high to low with reference to the business confidential items catalog and the data sharing negative list. It can be seen that the classification standards of data are relatively complex and the categories are relatively fine. To achieve more accurate classification, it is necessary to grasp the dependencies between labels at different levels, rather than simply flattening them. In addition, it is difficult to unify the classification strategies and standards in different scenarios, and the classification strategies and standards in the same scenario may also be updated and modified, which requires the model to adapt to changes and be able to respond to label changes more flexibly.
[0038] In view of the above-mentioned business scenario characteristics, the embodiment of the present application proposes an unsupervised data asset classification method based on a twin-tower data asset classification model (Twin-tower Based Data Asset Classification, TBDAC) model (referred to as the twin-tower model, or TBDACM), which involves the entire process of collecting the data required for the classification task, processing it, and then collecting experimental results. This method not only semantically understands the data asset text such as the table name, but also effectively utilizes the hierarchical structure information of the label to ensure that the classification and grading are accurate and reliable, improve the robustness of the classification method to the hierarchical labels, and improve the accuracy and computational efficiency of the hierarchical classification.
[0039] Figure 1 A flowchart of a data asset classification method provided in an embodiment of the present application, this embodiment can be applied to the case of classifying data assets. Specifically, the data asset classification method can be executed by a data asset classification device, and the data asset classification device can be implemented by software and / or hardware and integrated in an electronic device. Electronic devices include but are not limited to computers, smart phones, servers, and other devices with image processing functions.
[0040] like Figure 1 As shown, the method specifically comprises the following steps:
[0041] S110. Obtain data assets to be classified and a label vector library, wherein the label vector library stores vector representations corresponding to labels for classifying data assets, and the vector representations are obtained during the training process of a dual-tower model, wherein the dual-tower model includes a first subnetwork for extracting features of labels and a second subnetwork for extracting features of sample data assets.
[0042] In this embodiment, data assets may refer to data resources with certain value owned or controlled by an individual or enterprise, which may be recorded in a database in a physical or electronic manner. Specifically, it may include information such as the Chinese name of the table, the English name of the table, the Chinese name of the field, the English name of the field, and the table and field description text in the database. Classification mainly refers to hierarchical classification, including determining the level to which each data asset belongs and the category under the corresponding level.
[0043] For example, data assets of a certain business are divided into the following three levels:
[0044] The first level is recorded as A, and the first level includes only one category;
[0045] The second level is denoted as B. The second level includes two categories, which can be denoted as B1 and B2 respectively;
[0046] The third level is denoted as C, wherein the third level of B1 can be specifically divided into two categories, denoted as C11 and C12, and the third level of B2 can be specifically divided into two categories, denoted as C21 and C22.
[0047] The main purpose of classifying a data asset is to determine which level and category under the level the data asset belongs to.
[0048] The label vector library is used to store the vector representation of all labels, where labels can be understood as marks or annotations used to describe classifications, and can also be called classification labels, grade and category labels, or hierarchical labels. Each classification has a unique corresponding label. For the above example, there are four labels involved. The first label corresponds to A>B1->C11, the second label corresponds to A->B2->C12, the third label corresponds to A->B2->C21, and the fourth label corresponds to A->B2->C22. The vector representation can be understood as the feature encoding of the label. For any data asset, if the feature encoding of the data asset matches the vector representation of a certain label, it can be determined that the classification result corresponding to the data asset is the grade and category corresponding to the label.
[0049] For example, a large number of database table names, field names, and description texts of data assets commonly used in the power grid business data center are exported from the database; by manually integrating standard charter documents such as the classification and grading guidelines and the power data classification and grading guidelines, the hierarchical relationship between all tag names and tags can be constructed, and on this basis, 192,706 data asset records and 288 hierarchical tag traversal sequences are initially obtained.
[0050] In this embodiment, a large number of unlabeled data assets (i.e., sample data assets) can be used to train a twin-tower model, so that the twin-tower model learns the association between data assets and labels, so that for the data assets to be classified, the corresponding labels can be inferred. In addition, the vector representation of each label obtained during the training process can be stored in the label vector library for subsequent actual reasoning process. Among them, the twin-tower model is mainly used to encode the features of the two fields into a vector, and then recall based on the vector similarity. Specifically, the twin-tower model includes two sub-networks. During the training process, the first sub-network can be used to extract the features of the label, and the second sub-network can be used to extract the features of the sample data assets. The label can be annotated using a contrastive learning framework (such as SimCSE, etc.), and the labeling results can be output. The similarity between the features of the sample data assets and the features of the labels is calculated to train it to have the ability to accurately classify the input data assets. In addition, during the training process, the precision, recall rate, F1 value, etc. can also be calculated based on the classification results of the sample data assets to evaluate the twin-tower model.
[0051] S120, extracting the features of the data assets through the first sub-network in the dual-tower model;
[0052] Specifically, in the actual reasoning process, the data assets to be classified are input into the dual-tower model, and the features of the data assets to be classified can be extracted through the first sub-network in the dual-tower model. Usually, the data assets include discrete text fragments, which can be synthesized into longer sentences and input into the dual-tower model for feature extraction.
[0053] S130: Search the label vector library for a vector representation corresponding to the feature of the data asset, and determine the category to which the data asset belongs according to the label corresponding to the vector representation.
[0054] Specifically, according to the characteristics of the data assets to be classified, the vector representation of the matching label (such as the one with the highest similarity, the one with a similarity higher than a set threshold, the one with the shortest distance between feature vectors or the one with a distance less than a threshold, etc.) can be searched from the label vector library, and the grade and category corresponding to the label can be used as the classification result.
[0055] It should be noted that the vector representation of the label is obtained and solidified based on the TBDACM training process. On this basis, a vector database (such as Milvus) can be introduced to store the vector representation of the label. In the actual reasoning process, there is no need to obtain the vector representation of the label through the second sub-network in the dual-tower model, thereby accelerating the retrieval of the vector and accelerating the reasoning, and improving the efficiency of obtaining classification results.
[0056] The embodiment of the present application provides a data asset classification method, which not only performs semantic understanding of data asset texts such as table names, but also effectively utilizes the hierarchical structure information of labels, thereby greatly improving the accuracy and efficiency of data asset classification and grading.
[0057] In one embodiment, a data asset includes at least one text segment; a feature of the data asset includes semantic encoding information of each text segment; extracting the feature of the data asset through the second sub-network in the twin-tower model includes: for each text segment: segmenting the text of the text segment to obtain multiple segmentation sequences; inputting each segmentation sequence into the second sub-network in the twin-tower model, so as to calculate the attention weights between each segmentation through the second sub-network, and outputting the semantic encoding information of the corresponding text segment according to the attention weights between each segmentation.
[0058] Specifically, in the process of feature extraction of data assets, since the name formats of database data assets are not uniform and are independent and discrete short texts, in order to improve the semantic feature extraction ability of the model, it can be divided into two stages: preprocessing the text data of data assets, and using pre-trained generative encoders or semantic representation models to obtain semantic representations of text data.
[0059] Among them, the text data of the data assets is preprocessed, which mainly refers to the word segmentation of the input data assets, which is converted into word segmentation units (tokens) by a word segmenter, and then the sentences are synthesized for each token. A sentence is recorded as a token sequence, and each word segmentation sequence is input into the dual-tower model respectively; the first sub-network in the dual-tower model can be a transformer-based generative encoder, such as ERNIE or BERT model, etc., which can calculate the attention weights between each word segmentation and output the semantic encoding information of the corresponding text fragment according to the attention weights between each word segmentation. The preprocessed word segmentation sequence can be input into the multi-head attention encoding layer in ENRIE. For a sentence, by calculating the attention weights between the tokens in the sentence, the correlation between the word segmentations can be determined, thereby determining the importance of the text. The relevant formula is as follows:
[0060]
[0061] Among them, the query vector q i Sum value vector kj They are tag embedding, and are two weight matrices, A∈R n×n | is the attention matrix, where n is the number of tags. The model is finally normalized by softmax to output the encoding information of the corresponding text segment, i.e., the semantic representation, i.e., R i text .
[0062] It should be noted that during the training process of the twin-tower model, feature extraction of sample data assets can also be similarly divided into two stages: the first stage is to preprocess the text data of the sample data assets, and the second stage can use a pre-trained generative encoder or semantic representation model to obtain the semantic representation of the text data.
[0063] In one embodiment, before each word segmentation sequence is input into the second sub-network in the double-tower model, it also includes: 1) adding a sentence start marker to the beginning of each word segmentation sequence; 2) padding or truncating each word segmentation sequence according to a set length; 3) generating position coding information for each word segmentation sequence, and the position coding information is used to indicate the position of each word in the corresponding word segmentation sequence.
[0064] Specifically, a sentence header marker is added at the beginning of each word segmentation sequence, such as the [CLS] marker, to indicate the beginning of the word segmentation sequence. This marker can also be used to indicate the information of the entire sentence, and each word segmentation corresponds to an identifier (ID) in the vocabulary. Since the sentence length required by the ERNIE model is fixed, the word segmentation sequence can be padded or truncated according to the set length range. Position encoding information is generated to indicate the position of each token in the sentence. On this basis, the original data assets are preprocessed to obtain a token sequence that can be input into the ERNIE model.
[0065] Figure 2 FIG. 1 is a schematic diagram of a Transformer-based generative encoder provided by an embodiment. Figure 2 As shown in the figure, the second sub-network in the twin tower model can be implemented based on BERT or ERNIE, which are generative encoders based on Transformer. Each word sequence is processed and marked before being input into the second sub-network to clarify the position of each word. The second sub-network outputs the corresponding semantic representation of the word sequence.
[0066] In one embodiment, the method further includes: during the training process of the dual-tower model, for each label: extracting the text information features and label structure features of the label through the first sub-network in the dual-tower model; fusing the text information features and label structure features to obtain a vector representation corresponding to the label.
[0067] In this embodiment, during the training process, the first sub-network of the dual-tower model can be used to extract the vector representation of the label. Extracting the vector representation of the label includes three stages: the first stage is to extract the text information features of the label, the second stage is to extract the label structure features of the label, and the third stage is to fuse the text information features with the label structure features.
[0068] In one embodiment, text information features of a label are extracted through the first sub-network in the dual-tower model, including: constructing a label structure tree, each path from a root node to a leaf node in the label structure tree corresponds to a label; traversing each path in the label structure tree; for any path, connecting the root node and the leaf node that the path passes through into a sentence, and extracting the text information features of the sentence through the first sub-network in the dual-tower model.
[0069] Specifically, to extract the text information features of the label, a label structure tree is constructed. The nodes passed through each path from the root node to the leaf node in the label structure tree can be connected into sentences, which can be encoded using the first subnetwork in the double-tower model to obtain the text features of the label.
[0070] For example, data assets of a certain business can be divided into the following three levels:
[0071] The first level is recorded as A, and the first level includes only one category;
[0072] The second level is denoted as B. The second level includes two categories, which can be denoted as B1 and B2 respectively;
[0073] The third level is denoted as C, wherein the third level of B1 can be specifically divided into two categories, denoted as C11 and C12, and the third level of B2 can be specifically divided into two categories, denoted as C21 and C22.
[0074] The root node of the label structure tree is A, which involves four paths, namely A>B1->C11, A->B2->C12, A->B2->C21, and A->B2->C22. Each path is encoded using the first subnetwork to obtain the text features of the label.
[0075] In one embodiment, label structure features of label data are extracted through a graph neural network model.
[0076] Specifically, we can use a graph neural network method based on Graphormer to obtain the structural information of the label GraphStrc(i) through Graphormer. GraphStrc(i) modifies the original self-attention matrix as shown in the following formula:
[0077]
[0078] Among them, cij is the edge encoding between label i and label j, and its value is is a learnable scalar, D = φ(y i ,y j )$ is the shortest distance between label i and label j on the graph, is a learnable scalar on this shortest distance, and GraphStrc(i) can be obtained by Get, as shown in the following formula:
[0079]
[0080] Among them, V is the learnable vector, F is the bias term, It represents the sum of self-attention of label i and all labels j, LayerNorm represents normalization processing, and the activation function used by graph neural network is softmax function.
[0081] On the basis of the above, the text information features are fused with the label structure features, that is, ERNIE(i) and GraphStrc(i) are added together to obtain the vector representation of the label:
[0082] It is important to keep the dimensions of the structural information and the text information consistent to avoid dimensional errors when adding vectors of different dimensions.
[0083] In one embodiment, the method further includes: taking the vector representation of features and labels of sample data assets of the same dimension as positive samples, and the vector representation of features and labels of sample data assets of different dimensions as negative samples, and training to obtain a double-tower model based on a set loss function; wherein the set loss function is determined according to the cosine similarity between the samples.
[0084] In this embodiment, contrastive learning is used to perform labeling and cosine similarity is calculated to achieve data classification.
[0085] In this embodiment, for a label i, the semantic representation of the text segment with the same dimension can be and the vector representation of label i As positive sample pairs, the vector representations of the labels of other text fragments in the same batch are used as negative samples, and the training loss function is designed by contrastive learning as follows:
[0086]
[0087] Among them, cos(,) represents the cosine similarity between two vectors, and the angle between the two vectors is θ, then the cosine similarity can be expressed as: yi ∈{-1,1} indicates whether two vectors are similar, and the margin is recommended to be in the range [0,0.5]. The model is trained by the above loss function to obtain an accurate and reliable unsupervised hierarchical label classification model.
[0088] For example, data assets of a certain business can be divided into the following three levels:
[0089] The first level is recorded as A, and the first level includes only one category;
[0090] The second level is denoted as B. The second level includes two categories, which can be denoted as B1 and B2 respectively;
[0091] The third level is denoted as C, wherein the third level of B1 can be specifically divided into two categories, denoted as C11 and C12, and the third level of B2 can be specifically divided into two categories, denoted as C21 and C22.
[0092] There are four labels, corresponding to A>B1->C11, A->B2->C12, A->B2->C21, and A->B2->C22. For a data asset belonging to A>B1->C11, the label "A>B1->C11" is a positive sample, and the labels "A->B2->C12", "A->B2->C21", and "A->B2->C22" are all negative samples.
[0093] In one embodiment, it is characterized in that searching for vector representations corresponding to features of data assets from a label vector library includes: searching for vector representations corresponding to features of data assets from a label vector library based on an Approximate Nearest Neighbor (ANN) algorithm.
[0094] Specifically, for a given data asset to be classified, ANN can be used to find a vector representation of the label that is very close to the data asset to be classified in the label vector library, but it is not necessarily the absolute closest one. The main purpose is to accelerate the label matching process and improve the classification efficiency under the premise of ensuring that the classification structure has a certain accuracy. The basic principle of ANN is as follows: Assume that the set U and the distance measure D on it, the ANN problem is to construct a data structure. For a given subset and benchmark q∈S, find the target b∈S, such that: D(q,b)≤c·D(q,a); where the hyperparameter c>1, and the target point a∈S is the true nearest neighbor, then it is called that for the measure D, b is the approximate nearest neighbor of q in S. According to different needs, the final b can be more than one, and all the obtained b are weighted and integrated to form the final label classification result of q.
[0095] Figure 3A schematic diagram of using a label vector library and ANN to accelerate label matching is provided in an embodiment. Figure 3 As shown, the model reasoning performance is improved by solidifying the vector representation of the labels obtained during the training process. The vector database (Milvus) is introduced to accelerate vector retrieval and reasoning. Specifically, the vector representation of the label can be fixed and stored in Milvus after the model training is completed. For the text input of different data assets to be classified, there is no need to reinitialize the feature vector of the label every time, thereby avoiding repeated calculations. Furthermore, using ANN to accelerate label matching, usually does not require an absolute nearest neighbor result, and finding an approximate label can meet actual needs.
[0096] Figure 4 FIG. 1 is a schematic diagram of a sample data asset classification process based on a TBDACM model provided by an embodiment. Figure 4 As shown in the figure, the whole process includes the following two stages:
[0097] The first stage is implemented based on the dual-tower model. The two sub-networks (two towers) are used to process the text and labels of the sample data assets respectively. For the text, we first perform word segmentation and embedding, and then input it into the text encoder (such as ENIRE) for encoding. The text encoder is based on the multi-head attention mechanism and uses the pre-trained model to output the vector representation of the text; for the label, we first construct a label hierarchy structure tree, and then generate samples for each path from the root node to the leaf node in the label structure tree, and then enter the label encoder to divide the label encoding into semantic information encoding and structural information encoding, and the two are fused to obtain the label features. The label data sample generation and augmentation of the input data and the classification label semantics SimCSE are adopted, and the vector representation of the label is obtained using the aggregation function, and then the cosine similarity is used to calculate the semantic similarity between the label and the text to achieve label classification based on semantic indexing. In the first stage, the model as a whole is further trained based on ERNIE, and some of its parameters are fine-tuned to adapt to the task requirements;
[0098] The second stage is to optimize the model's reasoning performance. The TBDACM framework model optimized by the vector database application is deployed on the actual hardware. For each input text of the data asset to be classified, the first sub-network in the dual-tower model can be used to extract the semantic representation of the text fragment. For the label, there is no need to use the second sub-network in the dual-tower model for processing. Instead, the label representation is fixed once according to the vector representation obtained during the training process. Then, the matching label information can be efficiently obtained through ANN nearest neighbor search, ultimately achieving efficient and accurate classification.
[0099] Table 1 is a comparison of the classification accuracy of different classification methods. As shown in Table 1, it has been proven that the data asset classification method of the embodiment of the present application has achieved an improvement of 2.1% and 6% in the accuracy of Micro-F1 and Macro-F1, respectively, indicating that the method has shown superior performance in extracting short text information from data assets. Such improvements are derived from specific optimizations for given tasks, as well as the design of the experiment in model architecture and hyperparameter selection.
[0100] Table 1 Classification accuracy of different classification methods
[0101] method Precision Recall Micro-F1 Macro-F1 HGCLR 0.7299 0.3649 0.4866 0.1205 HiAGM-LA 0.9919 0.9657 0.9786 0.9390 HiAGM-MP 0.9821 0.9743 0.9794 0.9278 TBDACM(Ours) 0.9993 0.9808 0.9993 0.9998
[0102] Table 2 is a comparison of classification accuracy on different data sets. As shown in Table 2, the data asset classification method of the embodiment of the present application uses semantic matching for hierarchical classification in the first stage, which gives the model a strong migration ability, performs well on data sets in different fields, is not restricted by a specific label set, and greatly improves the robustness and generalization ability of the hierarchical classification method for data.
[0103] Table 2 Classification accuracy on different datasets
[0104] Dataset Recall@1 Recall@5 Recall@10 Recall@20 DS 98.078% 99.629% 99.931% 99.974% AF-3 85.276% 98.224% 99.569% 99.836% AF-5 83.767% 98.293% 99.328% 99.810%
[0105] Table 3 compares the classification efficiency of different models. As shown in Table 3, the data asset classification method of the embodiment of the present application directly uses the first-stage model for classification inference, and the time required for each data point is as high as 0.85 seconds; by introducing the second-stage reasoning optimization, the inference time is significantly reduced to only 0.066 seconds. This significant performance improvement not only makes the system more practical, but also demonstrates the excellent performance of the TBDAC model in processing large-scale data.
[0106] Table 3 Comparison of classification efficiency of different models
[0107] method Ours w / o sec. Ours CNN GRU Transformer Time / s 0.85 0.066 0.108 0.156 0.103 Accuracy 99.9% 99.9% - - 99.4%
[0108] Figure 5 This is a schematic diagram of the structure of a data asset classification device provided in an embodiment of the present application. Figure 5 As shown, the data asset classification device provided in this embodiment includes:
[0109] An acquisition module 210 acquires data assets to be classified and a label vector library, wherein the label vector library stores vector representations corresponding to labels for classifying data assets, wherein the vector representations are obtained during the training process of a dual-tower model, wherein the dual-tower model includes a first sub-network for extracting features of labels and a second sub-network for extracting features of sample data assets;
[0110] An extraction module 220 extracts the features of the data asset through the first sub-network in the dual-tower model;
[0111] The classification module 230 searches the label vector library for the vector representation corresponding to the feature of the data asset, and determines the classification to which the data asset belongs according to the label corresponding to the vector representation.
[0112] The above technical solution of the device can obtain the vector representation of the label during the training process of the dual-tower model, extract the text features of the data assets during actual reasoning, and quickly match the corresponding label from the vector representation to complete the classification, thereby improving the robustness and efficiency of the classification.
[0113] Optionally, the data asset includes at least one text segment; the characteristics of the data asset include semantic encoding information of each of the text segments;
[0114] The extracting the features of the data asset through the second sub-network in the dual-tower model includes:
[0115] For each of these text snippets:
[0116] Segmenting the text of the text fragment to obtain multiple segmentation sequences;
[0117] Each of the word segmentation sequences is respectively input into the second sub-network in the dual-tower model, so that the attention weights between each of the word segmentations are respectively calculated through the second sub-network, and the semantic encoding information of the corresponding text fragment is output according to the attention weights between each of the word segmentations.
[0118] Optionally, the device further comprises: a preprocessing module, which is used for, before inputting each of the word segmentation sequences into the second sub-network in the double-tower model,
[0119] Adding a sentence header mark to the beginning of each word segmentation sequence respectively;
[0120] Filling or truncating each of the word segmentation sequences according to a set length;
[0121] The position coding information of each of the word segmentation sequences is generated respectively, and the position coding information is used to indicate the position of each word segmentation in the corresponding word segmentation sequence.
[0122] Optionally, the device further comprises a training module, which is used for, during the training process of the dual-tower model, for each of the labels:
[0123] Extracting text information features and label structure features of the label through the first sub-network in the dual-tower model;
[0124] The text information feature and the tag structure feature are fused to obtain a vector representation corresponding to the tag.
[0125] Optionally, extracting the text information features of the label through the first sub-network in the dual-tower model includes:
[0126] Constructing a label structure tree, in which each path from a root node to a leaf node corresponds to a label;
[0127] Traversing each path in the tag structure tree;
[0128] For any of the paths, the root nodes and leaf nodes that the path passes through are connected to form a sentence, and the text information features of the sentence are extracted through the first sub-network in the dual-tower model.
[0129] Optionally, extracting the tag structure features of the tag data includes:
[0130] The label structure features of the label data are extracted through a graph neural network model.
[0131] Optionally, the device further includes a training module, which is used to use the vector representations of features and labels of sample data assets of the same dimension as positive samples, and the vector representations of features and labels of sample data assets of different dimensions as negative samples, and to obtain the dual-tower model through training based on a set loss function;
[0132] The setting loss function is determined according to the cosine similarity between samples.
[0133] Optionally, searching the label vector library for a vector representation corresponding to the feature of the data asset includes:
[0134] Based on an approximate nearest neighbor retrieval algorithm, a vector representation corresponding to the feature of the data asset is searched from the label vector library.
[0135] The data asset classification device provided in the embodiment of the present application can be used to execute the data asset classification method provided in any of the above embodiments, and has corresponding functions and beneficial effects.
[0136] Figure 6A schematic diagram of an electronic device 10 that can be used to implement an embodiment of the present application is shown. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device 10 can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, user equipment, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.
[0137] like Figure 6 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0138] Multiple components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, wireless networks.
[0139] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above.
[0140] In some embodiments, the method of the above embodiment may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform any of the above embodiment methods in any other appropriate manner (e.g., by means of firmware).
[0141] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0142] The computer programs for implementing the methods of the present application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer programs are executed by the processor, the functions / operations specified in the flow charts and / or block diagrams are implemented. The computer programs may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0143] In the context of the present application, a computer readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device or equipment. A computer readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer readable storage medium may be a machine readable signal medium. A more specific example of a machine readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0144] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device 10 having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device 10. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0145] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0146] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0147] An embodiment of the present application also provides a computer program product, including a computer program and / or instructions, which, when executed by a processor, implements the data asset classification method as described in any of the above embodiments.
[0148] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution of this application can be achieved, and this document is not limited here.
[0149] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. A data asset classification method, characterized in that: include: Acquire data assets to be classified and a label vector library, wherein the label vector library stores vector representations corresponding to labels for classifying data assets, wherein the vector representations are obtained during the training process of a dual-tower model, wherein the dual-tower model includes a first sub-network for extracting features of labels and a second sub-network for extracting features of sample data assets; Extracting the features of the data asset through the first sub-network in the dual-tower model; The vector representation corresponding to the feature of the data asset is searched in the label vector library, and the category to which the data asset belongs is determined according to the label corresponding to the vector representation.
2. The method according to claim 1, characterized in that The data asset includes at least one text segment; the characteristics of the data asset include semantic encoding information of each of the text segments; The extracting the features of the data asset through the second sub-network in the dual-tower model includes: For each of these text snippets: Segmenting the text of the text fragment to obtain multiple segmentation sequences; Each of the word segmentation sequences is respectively input into the second sub-network in the dual-tower model, so that the attention weights between each of the word segmentations are respectively calculated through the second sub-network, and the semantic encoding information of the corresponding text fragment is output according to the attention weights between each of the word segmentations.
3. The method according to claim 2, characterized in that Before each of the word segmentation sequences is input into the second sub-network in the double-tower model, the method further includes: Adding a sentence header mark to the beginning of each word segmentation sequence respectively; Filling or truncating each of the word segmentation sequences according to a set length; The position coding information of each of the word segmentation sequences is generated respectively, and the position coding information is used to indicate the position of each word segmentation in the corresponding word segmentation sequence.
4. The method according to claim 1, characterized in that: Also includes: During the training of the dual-tower model, for each of the labels: Extracting text information features and label structure features of the label through the first sub-network in the dual-tower model; The text information feature and the tag structure feature are fused to obtain a vector representation corresponding to the tag.
5. The method according to claim 4, characterized in that The extracting the text information features of the label through the first sub-network in the dual-tower model includes: Constructing a label structure tree, in which each path from a root node to a leaf node corresponds to a label; Traversing each path in the tag structure tree; For any of the paths, the root nodes and leaf nodes that the path passes through are connected to form a sentence, and the text information features of the sentence are extracted through the first sub-network in the dual-tower model.
6. The method according to claim 1, characterized in that Searching the label vector library for a vector representation corresponding to the feature of the data asset includes: Based on an approximate nearest neighbor retrieval algorithm, a vector representation corresponding to the feature of the data asset is searched from the label vector library.
7. A data asset classification device, characterized in that: include: An acquisition module is used to acquire data assets to be classified and a label vector library, wherein the label vector library stores vector representations corresponding to labels for classifying data assets, wherein the vector representations are obtained during the training process of a dual-tower model, wherein the dual-tower model includes a first sub-network for extracting features of labels and a second sub-network for extracting features of sample data assets; An extraction module, which extracts the features of the data asset through the first sub-network in the dual-tower model; The classification module searches the label vector library for the vector representation corresponding to the feature of the data asset, and determines the classification to which the data asset belongs according to the label corresponding to the vector representation.
8. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data asset classification method as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, it implements the data asset classification method as described in any one of claims 1-6.
10. A computer program product comprising a computer program and / or instructions, characterized in that: When the computer program and / or instructions are executed by a processor, the data asset classification method as described in any one of claims 1-6 is implemented.
Citation Information
Patent Citations
Method and device for determining labels of text data
CN114254110A
Hierarchical multi-label professional technical document classification method and system using label information
CN116932763A
Text classification method and device, model training method and device, equipment and storage medium
CN117807223A
Model training method and device, text classification method and device, equipment, medium and product
CN118070063A
Text topic extraction method and device, equipment, storage medium and product
CN118467726A