Data labeling method based on graph clustering and knowledge spectrum
By combining graph clustering and knowledge spectrum, the data domain is automatically divided and type descriptions are generated, and the annotation order is optimized. This solves the problem of high cost and low efficiency in existing technologies and realizes an efficient and low-cost data annotation method.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-23
- Publication Date
- 2026-04-10
AI Technical Summary
In the development of supervised machine learning models, existing technologies suffer from high costs, low efficiency, and poor consistency in acquiring high-quality labeled data. Furthermore, they fail to effectively utilize domain knowledge and expert judgment, leading to decreased labeling accuracy and low efficiency.
The dataset is divided into clusters with similar internal features by graph clustering, and type descriptions are generated using decision trees. The semantic correlation between data batches is calculated by combining knowledge spectrum, and the cross-labeling order is planned to optimize the labeling process.
It significantly reduces the workload of manual annotation, improves annotation consistency and efficiency, and enhances the automation and accuracy of the annotation process.
Smart Images

Figure CN121834529A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data annotation, and more particularly to data annotation methods based on graph clustering and knowledge spectrum. Background Technology
[0002] In the development of supervised machine learning models, obtaining a large amount of high-quality labeled data is a core challenge. Traditional manual annotation is costly, inefficient, and inconsistent. Existing automatic annotation technologies (such as rule-based annotation, active learning, and semi-supervised learning) have the following drawbacks: (1) Lack of domain knowledge: Most methods treat data as a homogeneous set and do not consider the complex subdomains within the data, i.e., data heterogeneity, which leads to a decrease in accuracy when general models are labeled with data in specific domains.
[0003] (2) Blind labeling order: In cross-labeling scenarios (such as different experts labeling different subsets), the labeling order is usually random or simple polling, without considering the semantic relationship between data, which leads to experts frequently switching cognitive contexts and low efficiency.
[0004] (3) Knowledge cannot be systematically reused: The domain knowledge and expert judgments generated during the annotation process are not recorded in a structured way and used to guide the subsequent annotation process. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a data annotation method based on graph clustering and knowledge spectrum.
[0006] The objective of this invention is achieved through the following technical solution: A first aspect of the present invention provides a data annotation method based on graph clustering and knowledge spectrum, comprising the following steps: S1: For the original dataset, clustering is performed based on graph clustering to identify clusters with similar internal features, and decision trees are used to generate understandable type descriptions for each cluster. S2: Associate the type description with the knowledge spectrum and calculate the semantic correlation between data batches; use the semantic correlation as the cross-labeling order for data labeling.
[0007] Further, in step S1, the step of dividing the original dataset into clusters with similar internal features based on graph clustering includes: S101: Transform the unstructured raw data in the original dataset into a graph structure containing a set of nodes and a set of edges; S102: Divide the graph structure into several internally tightly connected but sparsely connected subclusters, each subcluster representing a potential clustering area.
[0008] Further, in step S101, the unstructured raw data in the original dataset is transformed into a graph structure containing a set of nodes and a set of edges, including: S10101: Node Construction: Represent each data sample as a node in the graph; S10102: Feature vectorization: Extracting the feature vector of each node; S10103: Edge Construction: Calculate the similarity between node pairs and construct edges using the k-nearest neighbor method.
[0009] Further, in step S102, dividing the graph structure into several internally tightly connected but sparsely connected subclusters, each subcluster representing a potential clustering neighborhood, includes: Clustering algorithms are used to assign a corresponding cluster label to each node, thereby dividing the original dataset into several sub-clusters, or clustering neighborhoods.
[0010] Further, in step S1, generating an understandable type description for each clustering domain using a decision tree includes: S10301: Constructing the training set: For a given sub-cluster, all its samples are taken as positive examples; a portion of samples are randomly sampled from other sub-clusters, merged, and taken as negative examples to form a binary classification training set; S10302: Training a decision tree model: Train a decision tree model on a binary classification training set; S10303: Extract description rules: Extract the path from the root node to the leaf node from the trained decision tree model, and convert each path into an IF-THEN description rule. S10304: Summarize into type description: Merge and simplify the extracted core description rules to form the final type description of the clustering domain of this sub-cluster.
[0011] Further, in step S2, associating the type description with the knowledge spectrum and calculating the semantic correlation between data batches includes: S201: Construct a knowledge spectrum that can represent the semantic relationships between different types of descriptions; S202: Divide the data to be labeled into several data blocks according to the clustering domain of its source, and calculate the semantic correlation between any two data blocks.
[0012] The beneficial effects of this invention are: In an exemplary embodiment of the present invention, by first performing automated domain division and type description on the original data, and then intelligently planning the annotation order based on the knowledge spectrum, the workload of manual annotation is significantly reduced, and the consistency and efficiency of annotation are improved. Attached Figure Description
[0013] Figure 1 A flowchart illustrating a data annotation method based on graph clustering and knowledge spectrum provided as an exemplary embodiment of the present invention. Detailed Implementation
[0014] The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. Furthermore, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0015] See Figure 1 , Figure 1 A flowchart of a data annotation method based on graph clustering and knowledge spectrum provided by an exemplary embodiment of the present invention is shown, including the following steps: S1: For the original dataset, clustering is performed based on graph clustering to identify clusters with similar internal features, and decision trees are used to generate understandable type descriptions for each cluster. S2: Associate the type description with the knowledge spectrum and calculate the semantic correlation between data batches; use the semantic correlation as the cross-labeling order for data labeling.
[0016] Specifically, in this exemplary embodiment, an efficient and low-cost data annotation method is provided. First, for the unlabeled raw dataset, a graph clustering method is used to automatically divide it into clusters with similar internal features, and a decision tree algorithm is used to generate understandable type description rules for each cluster. Then, these type descriptions are associated with a pre-constructed knowledge spectrum, and the semantic correlation between data batches is dynamically calculated based on the correlation strength. Based on this, a cross-annotation order that minimizes the cognitive load on annotators and maximizes efficiency is planned. Finally, human annotators or automated scripts perform efficient annotation according to this order.
[0017] By adopting the approach of this application, the original data is first automatically divided into domains and described in terms of type, and then the annotation order is intelligently planned based on the knowledge spectrum, which significantly reduces the workload of manual annotation and improves the consistency and efficiency of annotation.
[0018] The following will provide a detailed explanation of each step: More preferably, in an exemplary embodiment, in step S1, the step of dividing the original dataset into clusters with similar internal features based on graph clustering includes: S101: Transform the unstructured raw data in the original dataset D into a graph structure G=(V,E) containing a set of nodes V and a set of edges E; S102: Divide the graph structure into several internally tightly connected but sparsely connected subclusters, each subcluster representing a potential clustering area.
[0019] Specifically, in this exemplary embodiment, step S101 implements the construction of the original data graph representation, the purpose of which is to transform unstructured original data (such as text, image feature vectors, and tabular data) into a graph structure; while step S102 implements the division of clustering domains based on graph clustering, which is used to divide the graph G into K tightly connected and sparsely connected subclusters, each subcluster representing a potential data domain C_k.
[0020] More preferably, in an exemplary embodiment, in step S101, the unstructured raw data in the original dataset is transformed into a graph structure containing a set of nodes and a set of edges, including: S10101: Node Construction: Represent each data sample (such as a document, an image, or a user record) as a node v_i in the graph; S10102: Feature vectorization: Extract the feature vector x_i of each node (e.g., TF-IDF vector of text, sentence embedding vector; deep feature vector of image). S10103: Edge Construction: Calculate the similarity (such as cosine similarity) between node pairs (v_i, v_j) and construct edges using the k-nearest neighbor method. That is, for each node v_i, only connect it to its k most similar nodes, with the weight being the similarity value.
[0021] More preferably, in an exemplary embodiment, in step S102, dividing the graph structure into several internally tightly connected but sparsely connected subclusters, each subcluster representing a potential clustering domain, includes: Clustering algorithms are used to assign a cluster label l_i to each node v_i, thereby dividing the original dataset D into several sub-clusters, i.e., clustering neighborhoods {C_1, C_2, ..., C_K}.
[0022] Specifically, in this exemplary embodiment, existing graph clustering algorithms can be used, such as the Louvain algorithm and the Leiden algorithm.
[0023] More preferably, in an exemplary embodiment, in step S1, generating an understandable type description for each clustering domain using a decision tree includes: S10301: Constructing the training set: For a given sub-cluster C_k, all its samples are taken as positive examples; a portion of samples are randomly sampled from other sub-clusters, merged, and taken as negative examples to form a binary classification training set; S10302: Training a decision tree model: Train a decision tree model on a binary classification training set; the decision tree will learn the key feature paths that distinguish the current cluster from other clusters; S10303: Extracting Description Rules: Extract the paths from the root node to the leaf node from the trained decision tree model, and convert each path into an IF-THEN description rule; for example, for a cluster about sports news, the following rule may be generated: IF (occurrence of "player" > 0.1) AND (occurrence of "match" > 0.05) AND (occurrence of "company" < 0.01) THEN belongs to the category "sports news"; S10304: Summarize into type description: Merge and simplify the extracted core description rules to form the final type description T_k of the clustering domain C_k of this sub-cluster.
[0024] Specifically, in this exemplary embodiment, this step is to generate a type description based on a decision tree, with the goal of generating a human-understandable, feature-based description rule for each clustering domain C_k as the type description T_k for that domain.
[0025] In summary, step S1 divides the original data into K clusters {C_k}, each with a corresponding type description {T_k}.
[0026] More preferably, in an exemplary embodiment, in step S2, associating the type description with the knowledge spectrum and calculating the semantic correlation degree between data batches includes: S201: Construct a knowledge spectrum that can represent the semantic relationships between different types of descriptions; S202: Divide the data to be labeled into several data blocks according to the clustering domain of its source, and calculate the semantic correlation between any two data blocks.
[0027] Specifically, in this exemplary embodiment, step S201 is used to construct / associate a domain knowledge spectrum, with the goal of establishing a network that can represent the semantic relationships between different types of descriptions: In one exemplary embodiment, by utilizing an external knowledge base, keywords or core concepts in type description T_k are linked to corresponding entities in a public knowledge graph (such as Wikipedia, WordNe), and the relationships between entities in the knowledge graph (such as "belonging to the same category", "related", "part-whole" relationships) are mapped to the relationships between type descriptions; In another exemplary embodiment, a self-built association graph is constructed. Each type description T_k is treated as a "document", and its semantic vector representation is calculated (e.g., word vector averaging or BERT encoding is used on the description text). The similarity (e.g., cosine similarity) between each pair of (T_a, T_b) semantic vectors is calculated as the association strength w_{ab} between them. Finally, a knowledge spectrum association graph G_knowledge = (V_k, E_k) is constructed, where V_k is the type description T_k, E_k is the edge between them, and the weight is the association strength w_{ab}.
[0028] Step S202 involves planning the cross-labeling order based on the association graph. The goal is to plan a labeling order that minimizes the overall cognitive switching cost for labelers, given a batch of data to be labeled (which may come from different clustering domains). Specific implementation method: (1) Task partitioning: Divide the data to be labeled into several data blocks B_m according to the clustering domain of its source. (2) Calculate the inter-block correlation: For any two data blocks B_p (from domain C_i) and B_q (from domain C_j), their correlation R(B_p, B_q) is equal to the correlation strength w_{ij} of their corresponding type descriptions T_i and T_j in the knowledge spectrum correlation graph G_knowledge. (3) Sequential planning modeling: Find a sequence [B_{s1}, B_{s2}, ..., B_{sM}] that visits all data blocks {B_m}, such that the sum of the correlation of adjacent data blocks in the sequence is maximized (i.e., the cognitive switching is smoothest).
[0029] In a specific exemplary embodiment, the data block (B_m) can be divided in two ways: (1) Direct partitioning based on clustering, that is, directly treating each cluster neighborhood C_k as an initial data block B_k. Applicable scenarios: suitable for the initial stage of labeling tasks, where all data needs to be labeled as a whole, and the size of each cluster is moderate (e.g., several thousand rows). The advantage is that the partitioning is completely automated and requires no manual intervention. However, if some clusters are very large (e.g., hundreds of thousands of rows), directly treating them as blocks is not conducive to task scheduling and parallelization.
[0030] (2) Based on the equal partitioning of clustering, a target block size S is set (e.g., each block contains 1000 data points). For a large cluster neighborhood C_k, it is further divided into multiple sub-blocks {B_{k1}, B_{k2}, ...} according to its characteristics or random order, so that the data volume of each sub-block is approximately equal to S. Specific implementation: (2-1) For a large cluster C_k, calculate its total number of samples N_k; (2-2) Calculate the number of sub-blocks M_k = ceil(N_k / S). (2-3) Within C_k, a secondary partition can be performed based on K-means clustering of sample feature vectors to ensure the compactness of samples within the sub-blocks; or a simple sequential partitioning can be used. Advantages: It ensures that the size of each annotation task package is uniform, which is convenient for task allocation and management.
[0031] Meanwhile, in another specific exemplary embodiment, the calculation method for the association strength R(B_p, B_q) between data blocks aims to quantify the semantic similarity or cognitive relevance of the domains represented by the two data blocks. Its core is to utilize the generated type description T and the knowledge spectrum association graph G_knowledge constructed in the second stage, where the nodes are type descriptions T_k, and the edge weights w_{ij} represent the association strength. The calculation method is as follows: (1) Determine the main domain label of data block B_p as C_i, and the corresponding type description as T_i. (2) Determine the main domain label of data block B_q as C_j, and the corresponding type description as T_j. (3) Direct association: If there is an edge (T_i, T_j) in G_knowledge, then R(B_p, B_q) = w_{ij}. (4) Indirect association (path association): If there is no direct edge between T_i and T_j, but there is a path, then the weight of the path can be calculated as the association degree. For example: shortest path weight: R = 1 / (shortest path length); or path weight product: R = product of the weights of all edges on the path (applicable to probabilistic association).
[0032] In a specific exemplary embodiment, step S1 obtains three clustering domains C and their type descriptions T through a first stage: C1 / T1: New Energy Vehicles (Keywords: Electric Vehicles, Batteries, Range, Charging Stations) C2 / T2: Traditional gasoline vehicles (keywords: engine, transmission, fuel consumption, four-wheel drive) C3 / T3: Intelligent Driving (Keywords: Autonomous Driving, Radar, Sensors, Algorithms) Step S201: In the constructed knowledge spectrum association graph, w_{12} (vehicles and vehicles) is high = 0.8, w_{13} (vehicles and intelligent driving) is medium = 0.6, and w_{23} (traditional vehicles and intelligent driving) is low = 0.4.
[0033] Step S202: Partitioning: The original data is divided into three data blocks: B1 (new energy vehicles), B2 (traditional fuel vehicles), and B3 (intelligent driving). The correlation coefficients are calculated as follows: R(B1, B2) = w_{12} = 0.8; R(B1, B3) = w_{13} = 0.6; R(B2, B3) = w_{23} = 0.4. The planning order is as follows: If the starting block is B1, the next block with the highest correlation coefficient is B2 (0.8), and the last is B3 (0.4). The final order is: [B1 -> B2 -> B3].
[0034] The annotators first annotated all the data related to "new energy vehicles," then annotated the semantically highly related "traditional fuel vehicles," and finally switched to the slightly different but still overlapping "intelligent driving" data. This is much smoother than the random sequential cognitive switching [B1 -> B3 -> B2].
[0035] Step S203: Perform efficient cross-annotation, annotating according to the planned sequence. Send the planned annotation order [B_{s1}, B_{s2}, ..., B_{sM}] to the annotation platform or annotation management system. The system pushes the data blocks to the annotators sequentially. Because adjacent data blocks are highly semantically related, annotators do not need to frequently switch their thinking modes, resulting in high focus and improved annotation speed and quality. Parallelization is possible: highly related data blocks can be assigned to the same annotator; low-related data blocks can be assigned to different annotators, achieving efficiency optimization under parallel workloads.
[0036] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.
Claims
1. A data annotation method based on graph clustering and knowledge spectrum, characterized by: Includes the following steps: S1: For the original dataset, clustering is performed based on graph clustering to identify clusters with similar internal features, and decision trees are used to generate understandable type descriptions for each cluster. S2: Associate the type description with the knowledge spectrum and calculate the semantic correlation between data batches; use the semantic correlation as the cross-labeling order for data labeling.
2. The data annotation method based on graph clustering and knowledge spectrum according to claim 1, characterized in that: In step S1, the step of dividing the original dataset into clusters with similar internal features based on graph clustering includes: S101: Transform the unstructured raw data in the original dataset into a graph structure containing a set of nodes and a set of edges; S102: Divide the graph structure into several internally tightly connected but sparsely connected subclusters, each subcluster representing a potential clustering area.
3. The data annotation method based on graph clustering and knowledge spectrum according to claim 2, characterized in that: In step S101, the unstructured raw data in the original dataset is transformed into a graph structure containing a set of nodes and a set of edges, including: S10101: Node Construction: Represent each data sample as a node in the graph; S10102: Feature vectorization: Extracting the feature vector of each node; S10103: Edge Construction: Calculate the similarity between node pairs and construct edges using the k-nearest neighbor method.
4. The data annotation method based on graph clustering and knowledge spectrum according to claim 2, characterized in that: In step S102, the graph structure is divided into several internally tightly connected but sparsely connected subclusters, each subcluster representing a potential clustering neighborhood, including: Clustering algorithms are used to assign a corresponding cluster label to each node, thereby dividing the original dataset into several sub-clusters, or clustering neighborhoods.
5. The data annotation method based on graph clustering and knowledge spectrum according to claim 2, characterized in that: In step S1, generating an understandable type description for each clustering domain using a decision tree includes: S10301: Constructing the training set: For a given sub-cluster, all its samples are taken as positive examples; a portion of samples are randomly sampled from other sub-clusters, merged, and taken as negative examples to form a binary classification training set; S10302: Training a decision tree model: Train a decision tree model on a binary classification training set; S10303: Extract description rules: Extract the path from the root node to the leaf node from the trained decision tree model, and convert each path into an IF-THEN description rule. S10304: Summarize into type description: Merge and simplify the extracted core description rules to form the final type description of the clustering domain of this sub-cluster.
6. The data annotation method based on graph clustering and knowledge spectrum according to claim 1, characterized in that: In step S2, associating the type description with the knowledge spectrum and calculating the semantic association degree between data batches includes: S201: Construct a knowledge spectrum that can represent the semantic relationships between different types of descriptions; S202: Divide the data to be labeled into several data blocks according to the clustering domain of its source, and calculate the semantic correlation between any two data blocks.