A directed acyclic graph-based data label generation method

By constructing a weighted directed acyclic graph and combining it with a graph neural network model, the problem of insufficient accuracy and reliability of label generation in existing technologies is solved, and the logical consistency, interpretability, adaptability and accuracy of label generation are improved.

CN121117811BActive Publication Date: 2026-02-10THE 28TH RES INST OF CHINA ELECTRONICS TECH GROUP CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511678997.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-17
Publication Date
2026-02-10
Estimated Expiration
2045-11-17

AI Technical Summary

Technical Problem

Existing data tag generation methods suffer from poor long-tail tag recall, semantic drift, opaque generation chain, and insufficient modeling of logical topological relationships, which limits their application in scenarios with high trust requirements.

Method used

We construct a weighted directed acyclic graph (DAG), integrate co-occurrence probabilities, semantic similarity, and business rules among labels, use a cycle detection algorithm to ensure acyclicity, generate labels through topological sorting and graph neural network models, and optimize the label system by combining business constraints and dynamic update mechanisms.

Benefits of technology

It improves the accuracy and reliability of tag generation, effectively recalls long-tail tags, avoids tag dependency errors, provides an interpretable generation process, and enhances the credibility of the results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121117811B_ABST
    Figure CN121117811B_ABST
Patent Text Reader

Abstract

The application discloses a data label generation method based on a directed acyclic graph, which comprises the following steps: converting original data and a label knowledge base into a weighted directed acyclic graph; converting partial order relations in the graph into total order relations through topological sorting; then, extracting original data features, fusing the original data features with the graph structure, uniformly modeling by using a graph neural network based on BERT, outputting hierarchical conditional probabilities of generated labels, and generating target data labels in combination with business constraint rules; after model prediction, updating the graph structure according to the conditional probabilities, identifying potential strong relation edges as candidate update objects through a probability screening mechanism, so as to form a continuously optimized closed loop system; the application forms a continuously optimized closed loop system by constructing a weighted acyclic graph fusing multiple source information and modeling and dynamically updating by using a graph neural network, and the accuracy of label generation is structurally guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of multi-label classification technology, and in particular relates to a data label generation method based on directed acyclic graphs. Background Technology

[0002] In the field of intelligent decision support analysis, data tagging, due to its clear logical chain and agile dynamic construction, is gradually becoming an important means of mining and utilizing data value. Currently, data tagging has been widely applied in various scenarios such as intelligent recommendation and knowledge graph construction. For example, in intelligent recommendation systems, constructing data tags for subjects and objects and their associated logic can effectively improve the ability to discover long-tail content; in knowledge graph completion systems, the introduction of business logic tags helps to achieve rapid graph-based organization of data content. The automated generation of data tags has become a key link in improving the intelligence level of the system. Its goal is to efficiently map raw data to a predefined tag system through algorithmic models, thereby completing the transformation process from data to semantic tags.

[0003] Currently, the main technical paths for automatic data label generation fall into three categories: automatic label generation methods based on predictive activation language models, which typically use pre-trained language models such as BERT or RoBERTa to encode text, and then achieve multi-label prediction through fully connected layers, possessing good domain adaptability and multi-label output capabilities; iterative label generation methods based on semi-supervised learning, which first train an initial model based on labeled data, generate secondary labels that can be used for retraining, and filter high-confidence results through multiple rounds of iteration, thereby reducing the dependence on manual annotation and improving the coverage of general labels; and multimodal feature fusion label generation technology, which achieves label prediction based on multimodal features by preprocessing and constructing relational networks for multiple modal data such as text and images.

[0004] Despite significant progress, existing methods each have distinct limitations. Predictive activation model-based methods perform poorly in recalling long-tailed labels lacking contextual dependencies; iterative methods based on semi-supervised learning tend to amplify the deviation between initial labels and the data during optimization, and due to the lack of modeling of the logical topological relationships of labels, they cannot effectively constrain and guide the label generation path at the semantic level, leading to semantic drift; while multimodal feature fusion technology improves label diversity, it is highly dependent on a predefined label system, and the feature fusion decision process is black-boxed, resulting in an opaque generation chain and difficulty in tracing and interpreting key decision-making criteria, thus limiting its application in scenarios with high credibility requirements. Summary of the Invention

[0005] Purpose of the invention: The purpose of this invention is to provide a data label generation method based on directed acyclic graphs that improves the accuracy and reliability of label generation.

[0006] Technical solution: The data tag generation method of the present invention includes the following steps:

[0007] S1. Transform the original data and tag knowledge base into a weighted directed acyclic graph; wherein, by parsing the tag knowledge base, weighted directed edges are constructed by integrating the co-occurrence probability, semantic similarity and business rules between tags; a cycle detection algorithm is used to detect and break circular dependencies so that the weighted directed acyclic graph satisfies acyclicity; a conflict resolution mechanism is adopted to handle multiple parent nodes and mutual exclusion relationships, which are resolved by inserting virtual nodes or splitting paths, thereby forming a structured semantic network;

[0008] S2. Based on the weighted directed acyclic graph constructed in step S1, determine the topological order from the data starting node to the leaf generating node, and transform the partial order relation in the graph into a total order relation.

[0009] S3. Extract the data features of the original data and integrate them with the graph structure of the weighted directed acyclic graph described in step S1. Perform unified modeling using a BERT-based graph neural network model to output the hierarchical conditional probability of generating labels; and generate target data labels based on business constraint rules.

[0010] S4. Based on the hierarchical conditional probabilities of the labels generated in step S3, update the weighted directed acyclic graph; through a probability screening mechanism, analyze the conditional probabilities and confidence scores predicted by the model, and when the strength of the identified potential relationship exceeds a preset threshold, mark the corresponding edge as a candidate update object.

[0011] This invention effectively integrates complex relationships such as semantics, co-occurrence, and business rules by constructing a weighted directed acyclic graph (S1) that integrates multidimensional relationships between tags, forming a structured semantic network and enhancing the logical consistency and interpretability of the tag system. Through topological sorting, the partial order relationships in the graph are transformed into total order relationships (S2), providing a clear computational path for tag generation and improving processing efficiency and sequential rationality. By utilizing a BERT-based graph neural network to fuse data features and graph structure (S3), accurate modeling of the conditional probability of tag levels is achieved, and business constraints are introduced to ensure that the tag generation results are both data-driven and business-adaptable. Finally, through a dynamic update mechanism (S4), the graph structure is continuously optimized based on predicted probabilities and confidence levels, enabling the tag system to have self-evolution capabilities and significantly improving the accuracy, flexibility, and long-term adaptability of tag generation to business scenarios.

[0012] Preferably, the process of constructing weighted directed edges in step S1 includes:

[0013] Calculate the co-occurrence probability between tags: Based on historical data, calculate the conditional probability of tag B appearing when tag A appears.

[0014] The calculation formula is:

[0015]

[0016] in, This indicates the number of times label A and label B appear simultaneously in historical data. The total number of times label A appears alone. As a cardinality factor, used to prevent When the value is 0, the probability is zero. K is a constant representing the size of the label set, which helps to avoid excessive probability deviation when the data is sparse. The higher the value, the stronger the dependence from A to B;

[0017] Calculate the semantic similarity between tags: Use the BERT model to convert the tag text into vector representations, and calculate the cosine similarity between tag A and tag B:

[0018]

[0019] in, This means that text labels are converted into high-dimensional vectors using a pre-trained BERT semantic model. The dimension of a vector is represented by... The algorithm determines this;

[0020] Introduce business rule weights: Assign maximum values ​​to necessary relationships based on prior knowledge defined by domain experts.

[0021] Assign a minimum value to a relation that is prohibited from existing:

[0022]

[0023] in, This is the maximum value when the relation must exist. This is the minimum value when the relation is prohibited from existing;

[0024] Comprehensive weight calculation: The final edge weight W(A→B) from node A to node B is obtained by weighted fusion of the above three factors. The calculation formula is as follows:

[0025]

[0026] in, These are the weighting coefficients for the co-occurrence probability. is the weighting coefficient for semantic similarity, and .

[0027] By comprehensively calculating the co-occurrence probability and semantic similarity between tags and incorporating business rules, a weighted directed edge system capable of accurately quantifying multidimensional relationships between tags is constructed. This method not only captures the statistical dependencies between tags using historical data but also deeply understands the textual associations of tags through semantic analysis. Furthermore, business rules serve as strong constraints, ensuring the effective embedding of prior knowledge. Finally, a comprehensive weight is formed through weighted fusion, making the construction of directed edges both data-driven objectivity and business logic guidance, laying a solid foundation for subsequently generating a structurally rigorous and semantically rich tag network.

[0028] Preferably, the ring detection and removal process in step S1 includes:

[0029] The Tarjan strongly connected component algorithm is used to detect the cyclic structure in a weighted directed acyclic graph.

[0030] Identify the edge with the smallest weight in the ring structure as the weakest dependency;

[0031] Iteratively remove the edge with the smallest weight in the cycle structure until there are no cycles in the weighted directed acyclic graph;

[0032] After each edge removal, the Tarjan algorithm is rerun to detect cycle structures until the entire weighted directed acyclic graph no longer contains any cycles.

[0033] By systematically applying the Tarjan algorithm to detect strongly connected components in a graph, all cyclic dependencies can be accurately and comprehensively identified. Then, by iteratively removing the edge with the smallest weight within a cycle (i.e., the weakest dependency), the cycle is broken. This method effectively maintains the strength of the overall semantic associations and the integrity of the main logic of the graph structure while minimizing disruption. Finally, through repeated iterations of detection and breaking, the resulting graph is ensured to meet the strict acyclicity requirement, laying a solid foundation for subsequent stable computation and probabilistic reasoning based on topological sorting.

[0034] Preferably, the conflict resolution mechanism in step S1 includes:

[0035] In the event of a conflict between multiple parent nodes, the business rules will determine whether to retain all parent nodes or create a new common parent node.

[0036] For mutual exclusion conflicts, virtual nodes are introduced as selection nodes, pointing to the mutually exclusive labels;

[0037] Perform sparse edge pruning, removing edges with weights below a preset threshold;

[0038] Complex dependencies can be handled by creating new virtual nodes and redirecting the original conflicting paths to those virtual nodes.

[0039] By introducing a multi-parent node retention and common parent node creation mechanism, the conflict between multiple parent nodes is effectively resolved, enhancing the clarity of the hierarchical structure while maintaining label diversity. For mutual exclusion relationships, the introduction of virtual nodes transforms explicit conflicts into structured choices, ensuring the rigor of business logic. Combined with sparse edge pruning, low-weight associations are automatically filtered to simplify the graph structure and improve computational efficiency. Finally, by reconstructing complex dependency paths through virtual nodes, deep logical conflicts are fundamentally resolved, significantly enhancing the semantic consistency and structural stability of the entire label network.

[0040] Preferably, the topological sorting process in step S2 includes:

[0041] S2-1. Calculate the in-degree of each node in the weighted directed acyclic graph, and add all nodes with an in-degree of zero to a queue as the starting set of nodes for sorting.

[0042] S2-2. Take a node from the queue and add it to the topology sequence;

[0043] S2-3. Traverse all successor nodes pointed to by this node, and decrement the in-degree value of each successor node by one;

[0044] S2-4. After the in-degree value is decremented by one, if the in-degree of any successor node becomes zero, then add it to the queue.

[0045] S2-5. Repeat steps S2-2 to S2-4 until the queue is empty;

[0046] S2-6. Verify the final generated topology sequence. Confirm the topology sequence if and only if the number of nodes in the sequence is equal to the total number of nodes in the weighted directed acyclic graph. Valid and output.

[0047] This topological sorting process, through systematic in-degree management, ensures that all nodes can be processed in an orderly manner while satisfying all their predecessor dependencies, thereby transforming the complex partial order relationships in the graph into a clear and linear total order sequence. Its queue-based breadth-first traversal mechanism guarantees the efficiency and stability of the sorting process, effectively avoiding deadlocks and logical confusion. Finally, through node count verification, the integrity and correctness of the output sequence are strictly guaranteed, providing a reliable and consistent computational path for subsequent label generation and probability calculation based on this order.

[0048] Preferably, the hierarchical conditional probability calculation in step S3 includes:

[0049] For topological sequences Each of them The conditional context construction and feature fusion processes are executed sequentially to form the feature fusion function for each label:

[0050]

[0051] in, This represents the vector concatenation process. for The characteristics of the original data This represents the embedding representation of the current tag. This indicates the status information of the parent tag of this tag. This represents the label feature vector matrix formed by concatenating the vectors of the above three variables. This is the bias vector, which provides the underlying values ​​for each label vector;

[0052] The raw score for the current label is calculated using a neural network:

[0053]

[0054] in, This is the weight matrix of the neural network, where each value represents... For predicting the current label The weight value, This represents the bias value of the neural network's output layer, providing a benchmark for the score;

[0055] Convert the raw score into a probability value using the sigmoid function:

[0056]

[0057] in, It is a parameterless activation function, used Original score Convert it to a probability value between 0 and 1;

[0058] Output the set of hierarchical conditional probabilities for all labels: .

[0059] By sequentially processing each label in the topological sequence and constructing a comprehensive feature vector that integrates the original data features, its own embedded representation, and the parent label's state information, deep modeling of the hierarchical dependencies between labels is achieved. The fused features are transformed into raw scores using a neural network and then mapped to probability values ​​using a sigmoid function, thereby generating hierarchical conditional probabilities with clear semantics for each label. Finally, a complete set of conditional probabilities is output, making label prediction not only based on the data itself but also strictly following the topological constraints of the label system, significantly improving the logical consistency and accuracy of label generation.

[0060] Preferably, the business constraint rules in step S3 include:

[0061] Define the mandatory tag generation path;

[0062] Set the minimum probability threshold for label generation;

[0063] Establish mutual exclusion rules for labels;

[0064] Implement an interpretability verification mechanism for tag generation.

[0065] By introducing a mandatory tag generation path, the strict execution of key business logic is ensured; by setting a minimum probability threshold, low-confidence prediction results are effectively filtered out, improving the accuracy and practicality of tag generation; by establishing tag mutual exclusion constraint rules, the simultaneous generation of semantically conflicting tags is fundamentally avoided, ensuring the inherent consistency of the results; finally, through an interpretability verification mechanism, the decision-making basis of the entire tag generation process is clear and transparent, significantly enhancing the reliability of the output results and the adaptability to business scenarios.

[0066] Preferably, the process of updating the weighted directed acyclic graph in step S4 includes:

[0067] S4-1. Analyze the hierarchical conditional probabilities and their confidence scores, calculate the potential relationship strength, and mark the corresponding potential relationship as a candidate edge only when the relationship strength exceeds a preset threshold.

[0068] S4-2. For each candidate edge, an incremental loop detection algorithm is used to verify in real time whether adding it to the weighted directed acyclic graph will form a loop.

[0069] S4-3. When S4-2 verifies that adding a candidate edge will form a loop, compare the weights of all edges in the loop and remove the edge with the smallest weight to break the loop.

[0070] S4-4. The candidate edges that pass the acyclic verification are formally added to the weighted directed acyclic graph.

[0071] By analyzing the conditional probabilities and confidence levels output by the model, potential relationship strengths are identified and screened, ensuring that only significant new associations are included as candidates, thus achieving data-driven dynamic optimization of the graph structure. An incremental cycle detection algorithm is used to perform real-time acyclic verification of candidate edges, effectively maintaining the topological correctness of the graph model. When a cycle is detected, the cycle is broken by removing the weakest dependency within the cycle, maximizing the preservation of existing strong associations while introducing new knowledge. Ultimately, this process enables the entire weighted directed acyclic graph to continuously and stably absorb new knowledge and evolve itself, significantly improving the adaptability and vitality of the labeling system.

[0072] Preferably, step S4 further includes a weight update and pruning process:

[0073] S4-5. Based on the prediction confidence, update the weights of existing edges in the graph using a weighted average method; and set initial weights for newly added edges based on their relation strength scores.

[0074] S4-6. Remove all edges with weights lower than a preset threshold value from the weighted directed acyclic graph, so that only strong connections with weights higher than the threshold value are retained in the graph.

[0075] By dynamically updating the weights of existing edges using a weighted average method based on prediction confidence, the graph's connectivity can adapt to changes in data distribution and continuously reflect the latest semantic association strength. Simultaneously, initial weights are rationally assigned to new edges based on association strength, ensuring a smooth integration of old and new knowledge within the weight system. Furthermore, a pruning mechanism automatically removes weak connections with low weights, effectively simplifying the graph structure, improving computational efficiency, and strengthening the overall network's robustness and semantic clarity, thereby ensuring that the labeling system always focuses on core strong association logic.

[0076] Preferably, the method further includes:

[0077] Use a pre-trained language model to transform newly labeled text into high-dimensional semantic vectors;

[0078] By matching existing labels with cosine similarity calculation, potential parent and child node candidate sets are identified.

[0079] New tags are integrated according to the principle of prioritizing the connection of nodes with the highest similarity;

[0080] When multiple inheritance is possible, create virtual nodes to balance the relationships.

[0081] The weights of relevant edges are dynamically adjusted based on the prediction confidence and usage frequency of the new labels, forming a closed-loop update mechanism.

[0082] By transforming new labeled text into semantic vectors through a pre-trained language model and combining it with cosine similarity calculation, accurate identification and automatic matching of semantic associations between new labels and the existing label system are achieved. By prioritizing the connection of high-similarity nodes and combining virtual nodes to balance complex inheritance relationships, it is ensured that new labels can be integrated into the existing graph structure in a logically consistent manner. At the same time, the edge weights are dynamically adjusted according to the prediction confidence and usage frequency, forming a closed-loop update mechanism that can continuously learn and self-optimize, thereby significantly improving the semantic extensibility, structural stability and long-term evolution capability of the entire label system.

[0083] Beneficial Effects: Compared with existing technologies, this invention has the following significant advantages: 1. Improved accuracy and reliability of tag generation: By constructing a weighted acyclic graph that integrates multi-source information and using graph neural networks for modeling and dynamic updates, a continuously optimized closed-loop system is formed, structurally ensuring the accuracy of tag generation; 2. Effective recall of long-tail tags: With the help of a hierarchical information inheritance mechanism, sparse long-tail tags can inherit semantic features from their parent tags, thus being effectively identified and recalled; 3. Avoidance of tag dependency errors: Through multiple mechanisms such as loop detection, conflict resolution, topology sorting, and business constraints, circular dependencies and logical conflicts are prevented from the root, ensuring the correctness of tag dependency relationships; 4. Provision of an interpretable generation process: Topology sequences, dependency strength visualization, and constraint decision logs together transform "black box" prediction into a transparent and traceable decision-making process, enhancing the credibility of the results. Attached Figure Description

[0084] Figure 1 This is a schematic diagram of the method flow of the present invention;

[0085] Figure 2 This is a schematic diagram of the data tag generation process based on external data changes according to the present invention;

[0086] Figure 3 This is a schematic diagram of the data tag generation process based on probability calculation according to the present invention;

[0087] Figure 4 This is a schematic diagram of the DAG update process for the data tags of the present invention;

[0088] Figure 5 This is a schematic diagram of the loop detection process of the present invention;

[0089] Figure 6 This is a schematic diagram of the topological sorting process of the present invention. Detailed Implementation

[0090] The technical solution of the present invention will be further described below with reference to the accompanying drawings.

[0091] Combination Figure 1 This invention is a tag generation technique that constructs a directed acyclic graph of tag semantics, and the steps are as follows:

[0092] The first step is to transform the database data into a semantic network that strictly satisfies acyclicity, orderability, and decodability. By parsing the tag knowledge base, weighted directed edges are constructed by integrating co-occurrence probability, semantic similarity, and business rules. Cycle algorithms are used to detect and break circular dependencies to ensure acyclicity. Conflict resolution mechanisms are employed to handle multiple parent nodes and mutual exclusion relationships. Virtual nodes or split paths are inserted to ensure logical consistency, thus forming a structured semantic network.

[0093] (1) Relation extraction and weighted directed edge construction: Relationships are extracted from the knowledge base, including parent and child tables in the database, tag definition text, business documents, and tag co-occurrence records in historical data. At the same time, a weight value is calculated for each pair of tag relationships to measure the strength of their dependency relationship. The weight value is composed of three aspects: co-occurrence probability, semantic similarity, and business rules.

[0094] a. Co-occurrence probability can be calculated to determine the statistical probability that label B also occurs given that label A has occurred. It is usually calculated using conditional probability.

[0095]

[0096] in, This indicates the number of times label A and label B appear simultaneously in historical data. The total number of times label A appears alone. As a cardinality factor, used to prevent When the value is 0, the probability is zero. K is usually a constant representing the size of the label set to avoid excessive probability deviation when the data is sparse. The higher the value, the stronger the dependence from A to B.

[0097] b. Semantic similarity is measured by calculating the cosine distance between the embedding vectors of the tags in the high-dimensional semantic space. This method uses the BERT language model to vectorize the tag text, so the semantic similarity between tag A and tag B is:

[0098]

[0099] in, The vector text representing label A. Vector text representing label B This means that text labels are converted into high-dimensional vectors using a pre-trained BERT semantic model. The dimension of a vector is represented by... It is determined by the algorithm itself.

[0100] c. Business rules are prior knowledge injected by domain experts, usually expressed as functions, and their weights are typically set to extreme values ​​to ensure their highest priority.

[0101]

[0102] in, This is the maximum value when the relation must exist (this method uses 1000 as the value). The minimum value when the relation is prohibited (this method takes a value of -1000).

[0103] Based on the above three factors, the edge weight W(A→B) from node A to node B is a weighted sum of the three factors:

[0104]

[0105] in, These are the weighting coefficients for the co-occurrence probability. The weighting coefficients for semantic similarity are: This method obtains the relationships and weights between tags in the tag knowledge base, and selects... Based on the relationship that the values ​​are greater than the threshold, construct a directed label graph.

[0106] (2) Cycle detection involves performing acyclic detection on the labeled directed graph constructed in step (1) to prevent topological sorting and hierarchical reasoning from failing. This method uses the Tarjan strongly connected component algorithm to detect whether there are cycles in the graph. The process is as follows: Figure 5 Once a cycle is detected, the system needs to break the cycle by removing the edge with the smallest weight. This is because the edge with the smallest weight usually represents the weakest and least certain dependency, and removing it causes the least damage to the overall structure. This is an iterative process: after removing an edge, the Tarjan algorithm is run again to check for any remaining cycles, until the entire graph no longer contains any cycles. Finally, the system outputs directed acyclic graphs (DAGs) that satisfy the "acyclic" property.

[0107] (3) The purpose of conflict resolution is to resolve logical inconsistencies such as conflicts between multiple parent nodes and conflicts between mutually exclusive relationships. By checking the logical consistency of the parent nodes of each label in the DAG, if the business allows a label to belong to multiple parent classes (i.e., multiple inheritance), multiple edges are retained. If not, the most important parent node is selected according to the weight or business rules, or a new common parent node (virtual node) is created. For mutually exclusive relationships, virtual nodes are introduced, and then the virtual nodes point to two mutually exclusive labels, thus logically clarifying the constraint of "only one can be chosen". Finally, through sparse edge pruning, edges with weights below a specified threshold are removed, and only strong relationships are retained, making the DAG structure clearer and purer.

[0108] The second step is to determine the topological sort from the data originating node to the leaf generating node. This method uses Kahn's algorithm to transform all nodes in the DAG into a linear sequence; the process is as follows. Figure 6As shown, this ensures that any directed edge (u, v) with node u is listed before node v. This guarantees that the label generation process strictly adheres to semantic dependencies. Through strict in-degree management, the in-degree value of each node represents the number of its predecessor dependent nodes. A node can only be processed after all its predecessor nodes have been processed. A queue is used to ensure that nodes are processed in dependency order. Finally, a loop check ensures that the final result sequence contains no fewer nodes than the total number of nodes in the graph. This step outputs... .

[0109] Step 3: (as follows) Figure 3 As shown, by fusing features from external input data with graph topology sorting, the hierarchical probability of generated labels is output. Business constraints are then constructed using these labels to generate target data labels. The feature extraction process for external data still employs the BERT feature extraction method, such as... Figure 2 As shown, I will not elaborate further.

[0110] (1) Hierarchical conditional prediction can calculate the activation probability of each label sequentially according to the order determined by the DAG topology. The prediction of each label depends not only on the features of the input data, but also explicitly on the prediction states of all its parent labels. By analyzing the topological sequence... Each of them The conditional context construction and feature fusion processes are executed sequentially to form the feature fusion function for each label:

[0111]

[0112] in, This represents the vector concatenation process. for The characteristics of the original data This represents the embedding representation of the current tag. This indicates the status information of the parent tag of this tag. This represents the label feature vector matrix formed by concatenating the vectors of the above three variables. This is the bias vector, providing the underlying values ​​for each label vector.

[0113] (2) The probability calculation process uses a neural network to calculate the original score of the current label, and then uses conditional probability to convert the score into a probability value. The original score is:

[0114]

[0115] in, This is the weight matrix of the neural network, where each value represents... For predicting the current label The weight value, This represents the bias value of the neural network's output layer, providing a benchmark for the score.

[0116] The conditional probability is calculated as follows:

[0117]

[0118] in, It is a parameterless activation function, used Original score Convert it to a probability value between 0 and 1.

[0119] The final output is the set of hierarchical conditional probabilities for all labels:

[0120]

[0121] These probability values ​​satisfy the dependency constraints defined in the DAG, ensuring semantic consistency.

[0122] Step four, as Figure 4 As shown, based on the label conditional probabilities formed in the third step, reliable potential relationships are identified through a probability screening mechanism. The system analyzes the conditional probabilities and confidence scores predicted by the model, and only marks the corresponding edges as candidate update objects when the relationship strength exceeds a preset threshold. Candidate edges that pass the screening must undergo rigorous acyclicity verification before being integrated into the DAG. Similar to the acyclicity detection module in the first step, this step uses an incremental cycle detection algorithm to check in real time whether each edge to be added will disrupt the acyclicity of the graph. When a cycle is detected, the system automatically compares the weight strength of each edge within the cycle, prioritizing the removal of the edge with the lowest weight, thereby breaking the cycle while preserving the most important dependencies. After confirming acyclicity, the method executes a priority link weight adjustment strategy. The weights of existing edges are dynamically updated based on their predicted confidence, using a weighted average to balance historical weights. Simultaneously, the initial weight of new edges is set based on their relationship strength scores. Finally, the system performs sparse pruning on all edges in the network, removing weak connections with weights below the critical value to ensure the simplicity of the DAG structure and the prominence of key dependencies.

Claims

1. A method for generating data labels based on directed acyclic graphs, characterized in that, Includes the following steps: Step S1: Transform the original data and tag knowledge base into a weighted directed acyclic graph; wherein, by parsing the tag knowledge base, weighted directed edges are constructed by integrating the co-occurrence probability, semantic similarity and business rules between tags; a cycle detection algorithm is used to detect and break circular dependencies so that the weighted directed acyclic graph satisfies the acyclicity property; a conflict resolution mechanism is adopted to handle multiple parent nodes and mutual exclusion relationships, which are resolved by inserting virtual nodes or splitting paths, thereby forming a structured semantic network; Step S2: Based on the weighted directed acyclic graph constructed in step S1, determine the topological order from the data starting node to the leaf generating node, and transform the partial order relation in the graph into a total order relation. Step S3: Extract the data features of the original data and integrate them with the graph structure of the weighted directed acyclic graph described in Step S1. Perform unified modeling using a BERT-based graph neural network model to output the hierarchical conditional probability of generating labels; and generate target data labels based on business constraint rules. Step S4: Update the weighted directed acyclic graph based on the hierarchical conditional probabilities of the labels generated in step S3; By using a probability screening mechanism, the conditional probability and confidence score predicted by the model are analyzed. When the strength of the identified potential relationship exceeds a preset threshold, the corresponding edge is marked as a candidate update object. Step S5: Use a pre-trained language model to convert the new label text into a high-dimensional semantic vector; use cosine similarity calculation to match with existing labels to identify potential parent and child node candidate sets; integrate the new labels according to the principle of prioritizing the connection of the nodes with the highest similarity; create virtual node balancing relationships when multiple inheritance is possible; dynamically adjust the weights of relevant edges according to the prediction confidence and usage frequency of the new labels to form a closed-loop update mechanism.

2. The data tag generation method according to claim 1, characterized in that, The process of constructing weighted directed edges in step S1 includes: Calculate the co-occurrence probability between tags: Based on historical data, calculate the conditional probability of tag B appearing when tag A appears. The calculation formula is: ;in, This indicates the number of times label A and label B appear simultaneously in historical data. The total number of times label A appears alone. As a cardinality factor, used to prevent When the value is 0, the probability is zero. K is a constant representing the size of the label set, which helps to avoid excessive probability deviation when the data is sparse. The higher the value, the stronger the dependence from A to B; Calculate the semantic similarity between tags: Use the BERT model to convert the tag text into vector representations, and calculate the cosine similarity between tag A and tag B: ;in, This means that text labels are converted into high-dimensional vectors using a pre-trained BERT semantic model. The dimension of a vector is represented by... The algorithm determines this; Introduce business rule weights: Assign maximum values ​​to necessary relationships based on prior knowledge defined by domain experts. Assign a minimum value to a relation that is prohibited from existing: ;in, This is the maximum value when the relation must exist. This is the minimum value when the relation is prohibited from existing; Comprehensive weight calculation: The final edge weight W(A→B) from node A to node B is obtained by weighted fusion of the co-occurrence probability between tags, the semantic similarity between tags, and the business rule weights. The calculation formula is as follows: ;in, These are the weighting coefficients for the co-occurrence probability. is the weighting coefficient for semantic similarity, and .

3. The data tag generation method according to claim 1, characterized in that, The ring detection and removal process in step S1 includes: The Tarjan strongly connected component algorithm is used to detect the cyclic structure in a weighted directed acyclic graph. Identify the edge with the smallest weight in the ring structure as the weakest dependency; Iteratively remove the edge with the smallest weight in the cycle structure until there are no cycles in the weighted directed acyclic graph; After each edge removal, the Tarjan algorithm is rerun to detect cycle structures until the entire weighted directed acyclic graph no longer contains any cycles.

4. The data tag generation method according to claim 1, characterized in that, The conflict resolution mechanism in step S1 includes: In the event of a conflict between multiple parent nodes, the business rules will determine whether to retain all parent nodes or create a new common parent node. For mutual exclusion conflicts, virtual nodes are introduced as selection nodes, pointing to the mutually exclusive labels; Perform sparse edge pruning, removing edges with weights below a preset threshold; Complex dependencies can be handled by creating new virtual nodes and redirecting the original conflicting paths to those virtual nodes.

5. The data tag generation method according to claim 1, characterized in that, The topological sorting process in step S2 includes: S2-1. Calculate the in-degree of each node in the weighted directed acyclic graph, and add all nodes with an in-degree of zero to a queue as the starting set of nodes for sorting. S2-2. Take a node from the queue and add it to the topology sequence; S2-3. Traverse all successor nodes pointed to by this node, and decrement the in-degree value of each successor node by one; S2-4. After the in-degree value is decremented by one, if the in-degree of any successor node becomes zero, then add it to the queue. S2-5. Repeat steps S2-2 to S2-4 until the queue is empty; S2-6. Verify the final generated topology sequence. Confirm the topology sequence if and only if the number of nodes in the sequence is equal to the total number of nodes in the weighted directed acyclic graph. Valid and output.

6. The data tag generation method according to claim 1, characterized in that, The hierarchical conditional probability calculation in step S3 includes: For topological sequences Each of them The conditional context construction and feature fusion processes are executed sequentially to form the feature fusion function for each label: ;in, This represents the vector concatenation process. for The characteristics of the original data This represents the embedding representation of the current tag. This indicates the status information of the parent tag of this tag. This represents the label feature vector matrix formed by concatenating vectors representing the original data features, the embedded representation of the current label, and the state information of the parent label. This is the bias vector, which provides the underlying values ​​for each label vector; The raw score for the current label is calculated using a neural network: ;in, This is the weight matrix of the neural network, where each value represents... For predicting the current label The weight value, This represents the bias value of the neural network's output layer, providing a benchmark for the score; Convert the raw score into a probability value using the sigmoid function: ;in, It is a parameterless activation function, used Original score Convert it to a probability value between 0 and 1; Output the set of hierarchical conditional probabilities for all labels: .

7. The data tag generation method according to claim 1, characterized in that, The business constraint rules in step S3 include: Define the mandatory tag generation path; Set the minimum probability threshold for label generation; Establish mutual exclusion rules for labels; Implement an interpretability verification mechanism for tag generation.

8. The data tag generation method according to claim 1, characterized in that, The process of updating the weighted directed acyclic graph in step S4 includes: S4-1. Analyze the hierarchical conditional probabilities and their confidence scores, calculate the potential relationship strength, and mark the corresponding potential relationship as a candidate edge only when the relationship strength exceeds a preset threshold. S4-2. For each candidate edge, an incremental loop detection algorithm is used to verify in real time whether adding it to the weighted directed acyclic graph will form a loop. S4-3. When S4-2 verifies that adding a candidate edge will form a loop, compare the weights of all edges in the loop and remove the edge with the smallest weight to break the loop. S4-4. The candidate edges that pass the acyclic verification are formally added to the weighted directed acyclic graph.

9. The data tag generation method according to claim 1, characterized in that, Step S4 also includes a weight update and pruning process: S4-5. Based on the prediction confidence, update the weights of existing edges in the graph using a weighted average method; and set initial weights for newly added edges based on their relation strength scores. S4-6. Remove all edges with weights lower than a preset threshold value from the weighted directed acyclic graph, so that only strong connections with weights higher than the threshold value are retained in the graph.

Citation Information

Patent Citations

  • Data label classification method and system based on artificial intelligence

    CN119494058A

  • Complex task-based high-quality pseudo-annotation data set construction method

    CN120297445A