A data set construction method for a special reasoning model

By constructing a dependency structure graph of a dedicated inference model, performing topology unrolling and consistency detection, and generating a consistency matrix, the problem of topological information distortion in existing technologies is solved, and the generalization performance and reliability of the model are improved.

CN121257759BActive Publication Date: 2026-04-17BEIJING ZHONGDIAN HUIZHI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-03
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing methods for constructing training datasets for dedicated inference models ignore the nonlinear topological information of the inference task, resulting in distortion of the topological information in the training data. This limits the model's ability to generalize to the topological structure of real tasks and the reliability of the inference process.

Method used

By parsing the domain task text information, rule constraint information, and causal dependency information, a dependency structure graph of the target reasoning task is established. The topology expansion of the causal constraint path and node reachability analysis are performed to generate path topology feature data. Reverse topology backtracking and consistency detection are performed to integrate and generate a forward and reverse dependency consistency matrix. Topology conflicts are identified and consistency correction results are output. Finally, a training dataset for a dedicated reasoning model is generated.

Benefits of technology

It improves the structural expressiveness of training data and the scene adaptability of inference tasks, thereby enhancing the reliability and generalization performance of dedicated inference models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121257759B_ABST
    Figure CN121257759B_ABST
Patent Text Reader

Abstract

This invention discloses a dataset construction method for specialized inference models, specifically relating to the field of dataset construction technology. It involves parsing domain task text information, rule constraint information, and causal dependency information to construct a dependency structure graph for the target inference task. Based on the dependency structure graph, topological path expansion and counterfactual topological path backtracking analysis are performed according to semantic relationship direction and constraint inverse relationship to form forward path topological feature data and reverse topological verification data. This establishes a forward and reverse dependency consistency matrix for topological conflict identification and outputs consistency correction results. Finally, based on the consistency correction results, topological labeling, topological equivalence determination, and multi-path admission screening are performed to obtain a topological fidelity sample set. Dependency signature annotation and topological label encoding are then performed to generate a training dataset for a specialized inference model of the target inference task. This improves the reliability of the inference path and the structuring level of the dataset for the specialized inference model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of dataset construction technology, and more specifically, to a dataset construction method for a specific inference model. Background Technology

[0002] With the widespread application of artificial intelligence technology, specialized inference models have been extensively used in various industries. The training and generalization performance of specialized inference models highly depends on constructing high-quality training datasets. Existing methods for constructing training datasets typically involve obtaining inference task samples through manual annotation, rule template matching, or automatic extraction, thus forming sample data for model training.

[0003] In the process of constructing datasets for dedicated inference models, the accurate characterization of nonlinear topological information involved in the inference task is generally neglected, which leads to distortion of topological information in the training data and limits the generalization ability of dedicated inference models to real task topological structures and the reliability of the inference process. Summary of the Invention

[0004] To overcome the aforementioned deficiencies of the prior art, embodiments of the present invention provide a dataset construction method for specialized inference models to address the problems raised in the background art.

[0005] To achieve the above objectives, the present invention provides the following technical solution:

[0006] A method for constructing a dataset for a specific inference model includes the following steps:

[0007] S1: Parse the textual information, rule constraint information, and causal dependency information of the domain task to establish a dependency structure graph of the target reasoning task;

[0008] S2: Based on the dependency structure graph, according to the semantic relationship direction of the target reasoning task, perform topological expansion and node reachability analysis on the causal constraint path to generate path topological feature data.

[0009] S3: Based on the dependency structure graph, according to the constraint reverse relationship of the target reasoning task, perform topological backtracking and consistency detection on the counterfactual dependency path to generate reverse topological verification data;

[0010] S4: Integrate the path topology feature data and reverse topology verification data to establish a forward and reverse dependency consistency matrix, identify topology conflicts, and output consistency correction results;

[0011] S5: Based on the consistency correction results, perform topological labeling, topological equivalence determination and multi-path admission screening on the candidate samples, and output the topologically accurate sample set;

[0012] S6: Perform dependency signature annotation and topological label encoding on the topology-fidelity sample set to generate a dedicated inference model training dataset for the target inference task.

[0013] In a preferred embodiment, S1 specifically refers to:

[0014] Acquire domain task text information, rule constraint information, and causal dependency information;

[0015] Perform word segmentation, part-of-speech tagging, and named entity recognition on domain task text information, and extract task term nodes from domain task text information;

[0016] The rule constraint information is symbolically represented and transformed to extract the constraint type, triggering conditions and result relationship, and form constraint relationship edges;

[0017] By locating event trigger words and extracting causal pairs from causal dependency information, causal relationship edges are obtained.

[0018] By integrating task terminology nodes, constraint type nodes, and causal relationship edges, a dependency structure graph for the target reasoning task is constructed.

[0019] In a preferred embodiment, S2 specifically refers to:

[0020] Based on the dependency structure graph of the target reasoning task, the inference start node and the termination node are determined according to the semantic relationship direction of the target reasoning task.

[0021] Starting from the inference start node, perform topological traversal in sequence, expand the inference path based on the constraint relationship edges and causal relationship edges between nodes, and generate a topological traversal sequence.

[0022] Based on the topological traversal sequence, node reachability is determined, and the path reachability identifier of each node in the topological traversal sequence is determined according to the constraint relationship edges and causal relationship edges.

[0023] Based on the node path reachability identifiers and topological traversal sequences, path topological feature data representing causal constraint path characteristics is generated.

[0024] In a preferred embodiment, S3 specifically refers to:

[0025] Based on the dependency structure graph of the target reasoning task, the termination node and the starting node of the counterfactual analysis are determined according to the reverse relationship direction of the constraints of the target reasoning task.

[0026] Starting from the terminal node of the counterfactual analysis, a reverse topological traversal is performed along the constraint relationship edges and causal relationship edges between nodes to backtrack the counterfactual reasoning path and generate a reverse topological traversal sequence.

[0027] Based on the reverse topology traversal sequence, counterfactual topology consistency analysis is performed on each node, and the rationality of the reverse topology path is determined for the constraint relationship edges and causal relationship edges between nodes.

[0028] Based on the rationality determination results of the reverse topology path, reverse topology verification data representing the topology consistency characteristics of the counterfactual path is generated.

[0029] In a preferred embodiment, S4 specifically refers to:

[0030] Feature parsing is performed on the path topology feature data and the reverse topology verification data to obtain the path topology node features and the reverse topology node features.

[0031] Node correspondence matching is performed based on the node identifiers between the path topology node features and the reverse topology node features;

[0032] Based on the node correspondence matching results, construct a positive and negative dependency consistency matrix;

[0033] Based on the positive and negative dependency consistency matrix, topological feature conflict identification is performed on the matrix elements to determine the nodes where topological conflicts occur.

[0034] Based on the nodes where topology conflicts occur, topology consistency correction is performed, and consistency correction result data is generated.

[0035] In a preferred embodiment, S5 specifically refers to:

[0036] Obtain consistency correction result data and candidate samples, and establish an index mapping between candidate samples and corresponding dependency structure graphs;

[0037] For each candidate sample, a topological feature signature is calculated based on the corresponding dependency structure graph to generate a topological label;

[0038] Based on the consistency correction results, the topology labels are mapped to the positive and negative dependency consistency matrix to form a preliminary compliance sample subset;

[0039] Topological equivalence determination is performed on the initial compliant sample subset to identify topologically equivalent samples and group the equivalent samples into the same topological equivalence class.

[0040] For each topological equivalence class, samples that meet the multi-path admission threshold are selected according to the path diversity coverage index to obtain the topological fidelity sample set.

[0041] In a preferred embodiment, S6 specifically refers to:

[0042] Based on the topology-fidelity sample set, the dependency structure graph of the target inference task corresponding to each topology-fidelity sample is extracted;

[0043] Dependency signature annotations are performed on the nodes and edges between nodes in the dependency structure graph for each target inference task;

[0044] Based on the topology-fidelity sample set after dependency signature annotation, the topology labels are converted into structured topology codes according to the topology label encoding rules;

[0045] Based on structured topological coding and topologically accurate sample sets with signature annotation, a dedicated training dataset for the inference model of the target inference task is generated.

[0046] The technical effects and advantages of the dataset construction method for specialized inference models proposed in this invention are as follows:

[0047] By analyzing the domain task text information, rule constraint information, and causal dependency information, a dependency structure graph of the target reasoning task is established, achieving a systematic expression of the internal structure of the reasoning task. Based on the dependency structure graph, topological expansion and node reachability analysis of causal constraint paths, as well as reverse backtracking and consistency detection of counterfactual dependency paths, are carried out, which can extract path topological feature data and reverse topological verification data. By integrating the path topological feature data and reverse topological verification data, a forward and reverse dependency consistency matrix is ​​established, which can accurately identify path conflicts and reasonably verify the sample structure. By performing topological labeling, topological equivalence judgment, and multi-path admission screening on candidate samples, the structural diversity and topological fidelity of training samples are effectively guaranteed. Finally, by performing dependency signature annotation and topological label encoding on the topologically fidelity sample set, a training dataset for a dedicated reasoning model is generated. This improves the structural expressiveness of the training data and the scenario adaptability of the reasoning task, which helps to improve the reliability and generalization performance of the dedicated reasoning model. Attached Figure Description

[0048] Figure 1 This is a schematic diagram of a dataset construction method for a specific inference model according to the present invention. Detailed Implementation

[0049] The technical solutions of the embodiments 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, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0050] Example

[0051] Figure 1 This invention presents a method for constructing a dataset for a specific inference model, comprising the following steps:

[0052] S1: Parse the textual information, rule constraint information, and causal dependency information of the domain task to establish a dependency structure graph of the target reasoning task;

[0053] S2: Based on the dependency structure graph, according to the semantic relationship direction of the target reasoning task, perform topological expansion and node reachability analysis on the causal constraint path to generate path topological feature data.

[0054] S3: Based on the dependency structure graph, according to the constraint reverse relationship of the target reasoning task, perform topological backtracking and consistency detection on the counterfactual dependency path to generate reverse topological verification data;

[0055] S4: Integrate the path topology feature data and reverse topology verification data to establish a forward and reverse dependency consistency matrix, identify topology conflicts, and output consistency correction results;

[0056] S5: Based on the consistency correction results, perform topological labeling, topological equivalence determination and multi-path admission screening on the candidate samples, and output the topologically accurate sample set;

[0057] S6: Perform dependency signature annotation and topological label encoding on the topology-fidelity sample set to form a dedicated inference model training dataset.

[0058] S1: Parse the domain task text information, rule constraint information, and causal dependency information to establish a dependency structure graph for the target reasoning task, including:

[0059] Acquire domain task text information, rule constraint information, and causal dependency information;

[0060] Specifically, the process of acquiring domain task text information is as follows: Based on the application scenario of the target reasoning task, relevant documents, case data, and business description data related to the target reasoning task are collected using pre-established text information collection channels to obtain preliminary domain task text information; the process of acquiring rule constraint information is as follows: Based on the specific business scenario corresponding to the target reasoning task, rule constraints and constraint logic relationships with definite definitions are selected and summarized from existing domain rule knowledge bases and domain expert documents through manual sorting by business experts to obtain rule constraint information; the process of acquiring causal dependency information is as follows: Based on the business context of the target reasoning task, domain experts use causal knowledge sorting tools and domain knowledge graphs to gradually deduce the events and business processes involved in the task, determine the causal relationship and logical sequence relationship between events, and form causal dependency information.

[0061] Perform word segmentation, part-of-speech tagging, and named entity recognition on domain task text information, and extract task term nodes from domain task text information;

[0062] Specifically, the acquired domain task text information undergoes text preprocessing, including but not limited to removing redundant whitespace characters, removing special symbols, and text normalization operations, to form standardized domain task text information. The standardized domain task text information is then segmented into independent and meaningful word units using a Chinese word segmentation tool, such as a conditional random field-based Chinese word segmentation tool. Each word unit is then labeled with a pre-trained part-of-speech tagging model. The part-of-speech tagging model is implemented using a Hidden Markov Model or a Conditional Random Field Model, and outputs the part-of-speech tag corresponding to each word unit. A pre-trained named entity recognition model is used for named entity recognition, including an entity recognition method based on a bidirectional long short-term memory network combined with a conditional random field model, to identify named entities with definite business meanings from the segmented and labeled word units. Based on the named entity recognition results, task term nodes with business relevance are extracted from the standardized domain task text information.

[0063] The rule constraint information is symbolically represented and transformed to extract the constraint type, triggering conditions and result relationship, and form constraint relationship edges;

[0064] Specifically, based on the business logic semantics of the rule constraint information, a pre-designed symbolic representation transformation method is used to transform it, including using logical expressions, such as predicate logic expressions or propositional logic expressions, to formally reconstruct and express each rule constraint information, thereby obtaining a standard rule constraint logical expression. From the symbolically expressed rule constraint logical expression, based on the logical order and triggering method of the constraint conditions, the type of rule constraint, the triggering conditions corresponding to the constraint conditions, and the execution results corresponding to the triggering conditions are extracted. Based on the extracted rule constraint type, triggering conditions, and result relationships, rule constraint relationship edges are constructed, and the rule constraint relationship edges are identified and recorded.

[0065] By locating event trigger words and extracting causal pairs from causal dependency information, causal relationship edges are obtained.

[0066] Specifically, based on the business characteristics and domain requirements of the target inference task, the causal dependency information is preprocessed, including removing redundant characters and normalization. After text preprocessing, a pre-trained event trigger word recognition model is used to locate the event trigger words in the causal dependency information, determining their positions. Using the located event trigger words as the core, a dependency parsing-based method or a pre-trained causal relationship extraction model is used to extract the event causal relationship pairs corresponding to the event trigger words from the causal dependency information text. Based on the extracted event causal relationship pairs, causal relationship edges are constructed and recorded with identifiers.

[0067] By integrating task terminology nodes, constraint type nodes, and causal relationship edges, a dependency structure graph for the target reasoning task is constructed.

[0068] Specifically, based on the extracted task terminology nodes, node numbers and semantic identifiers are assigned; then, based on the extracted rule constraint edges and causal relationship edges, numbering, type identifiers, and logical relationship identifiers are assigned respectively; according to the type and logical relationship of the rule constraint edges and causal relationship edges, with the task terminology nodes as the base nodes, node and edge fusion is performed, including but not limited to logically associating the rule constraint edges and causal relationship edges with the corresponding task terminology nodes through the consistency matching rules of node identifiers, thereby obtaining the dependency structure graph corresponding to the target reasoning task, which represents the constraint logic and causal logic relationship between task terminology nodes.

[0069] S2: Based on the dependency structure graph, and following the semantic relationship direction of the target inference task, perform topological expansion and node reachability analysis on the causal constraint path to generate path topological feature data, including:

[0070] Based on the dependency structure graph of the target reasoning task, the inference start node and the termination node are determined according to the semantic relationship direction of the target reasoning task.

[0071] Specifically, based on the topological relationships of all nodes in the dependency structure graph of the target inference task, the in-degree and out-degree of each node are statistically analyzed to obtain the in-degree and out-degree of each node. Based on the in-degree and out-degree of each node, according to predetermined semantic relationship direction rules, nodes with an in-degree of 0 in the dependency structure graph of the target inference task are determined as the inference start node, and nodes with an out-degree of 0 are determined as the inference termination node. In the case where there are multiple nodes with an in-degree of 0 in the dependency structure graph of the target inference task, the start node is selected according to the business rules predefined by domain experts. For example, the nodes are ranked based on indicators such as the business importance of the nodes, the frequency of occurrence, or the scope of business knowledge covered, and one or more nodes with the highest ranking are selected as the inference start node. Similarly, for nodes with an out-degree of 0, the same business rules are used to select the termination node, thereby determining a unique inference start node and inference termination node.

[0072] Starting from the inference start node, perform topological traversal in sequence, expand the inference path based on the constraint relationship edges and causal relationship edges between nodes, and generate a topological traversal sequence.

[0073] Specifically, the initial processing node is determined by the inference start node in the target inference task dependency structure graph. A predetermined topology traversal algorithm is used to traverse the nodes of the target inference task dependency structure graph. The implementation of the topology traversal algorithm includes, but is not limited to, depth-first search or breadth-first search, for example, breadth-first search is selected. In the breadth-first search process, starting from the inference start node, the topology connections defined by the pre-determined constraint and causal relationships between nodes are expanded outwards layer by layer, traversing all nodes that can be accessed through constraint and causal relationships in sequence, and recording them in the order they are traversed to form a topology traversal sequence. The recorded content of each node in the topology traversal sequence includes, but is not limited to, the node number, the node business semantic identifier, and the topology level number of the node. In the process of generating the topology traversal sequence, duplicate access of nodes is controlled by setting node access tags, that is, a unique tag is set for each node that has been visited, thereby avoiding duplicate access of nodes and ensuring that each node appears exactly once in the topology traversal sequence, and finally obtaining the topology traversal sequence.

[0074] Based on the topological traversal sequence, node reachability is determined, and the path reachability identifier of each node in the topological traversal sequence is determined according to the constraint relationship edges and causal relationship edges.

[0075] Specifically, node reachability is determined by utilizing the information of each node recorded in the topological traversal sequence and the pre-determined constraint and causal relationship edges between nodes. This includes traversing each node in the topological traversal sequence based on the path information represented by the sequence, starting from the inference starting node, and determining whether there exists at least one valid path connecting the current node through constraint and causal relationship edges. During the determination process, the logical validity and path coherence of the constraint and causal relationship edges between the current node and its predecessor nodes are checked. The current node is determined to be reachable only when all nodes on the path satisfy the logical conditions and coherence defined by the edge. The path coherence check includes, but is not limited to, verifying the existence of edges between nodes, whether they meet the business logic and causal logic requirements of the predecessor nodes, and whether there are logical contradictions or circular references. After the node reachability determination, a path reachability identifier for each node in the topological traversal sequence is obtained, representing the node's accessibility in the semantic relationship direction, including but not limited to the node's reachable, uncertain, or unreachable state.

[0076] Based on the node path reachability identifier and topology traversal sequence, generate path topology feature data representing the causal constraint path characteristics;

[0077] Specifically, based on the topological traversal sequence and node path reachability identifiers, nodes in the path that are reachable are extracted. The extracted reachable nodes are then used to construct a set of causal constraint paths represented by a topological path structure, based on pre-determined constraint edges and causal relationship information between them. The resulting set of causal constraint paths is then feature-represented. Feature representation methods include, but are not limited to, path signature representation, which utilizes node semantic identifiers, connection types between nodes, and node path order to construct structured feature vectors for the causal constraint paths. The structured feature vectors are constructed as follows: the node's hierarchical order in the topological traversal sequence is used as the node position number; the node position number, node semantic identifier, and edge type identifiers between nodes are combined into feature vector elements, arranged according to the topological path order to form a fixed-length structured feature vector. For cases where path lengths differ, a pre-defined padding method is used to unify the path lengths, such as adding virtual nodes with specific identifiers to the end of shorter paths to ensure that the structured feature vectors of all causal constraint paths have the same length. All obtained structured feature vectors are combined to form path topological feature data, representing the structured features of all valid causal constraint paths in the semantic relationship direction for the target reasoning task.

[0078] S3: Based on the dependency structure graph, and according to the constraint reverse relationship of the target inference task, perform topological backtracking and consistency checks on the counterfactual dependency path to generate reverse topological verification data, including:

[0079] Based on the dependency structure graph of the target reasoning task, the termination node and the starting node of the counterfactual analysis are determined according to the reverse relationship direction of the constraints of the target reasoning task.

[0080] Specifically, based on the topological connections of each node in the dependency structure graph of the target inference task, the in-degree and out-degree of all nodes are obtained by statistically analyzing the in-degree and out-degree of each node. Using the inverse relationship direction of the constraints of the target inference task as a basis, nodes with an out-degree of 0 in the dependency structure graph are determined as the termination nodes of the counterfactual analysis, and nodes with an in-degree of 0 are determined as the starting nodes of the counterfactual analysis. For multiple nodes with an out-degree of 0 in the dependency structure graph, all candidate nodes are ranked according to selection rules defined by domain experts based on business importance, scope of business coverage, rule constraint information involved in the node, and priority of causal dependency information. One or more nodes with the highest ranking are selected as the termination nodes of the counterfactual analysis. Similarly, for multiple nodes with an in-degree of 0 in the dependency structure graph, the same selection rules are used for analysis and ranking, and one or more nodes with the highest ranking are selected as the starting nodes of the counterfactual analysis.

[0081] Starting from the terminal node of the counterfactual analysis, a reverse topological traversal is performed along the constraint relationship edges and causal relationship edges between nodes to backtrack the counterfactual reasoning path and generate a reverse topological traversal sequence.

[0082] Specifically, the determined counterfactual analysis termination node is used as the starting node for reverse topology traversal. A pre-determined reverse topology traversal algorithm is used to traverse the dependency graph in reverse. The implementation of the reverse topology traversal algorithm includes, but is not limited to, reverse depth-first search or reverse breadth-first search algorithms; for example, a reverse breadth-first search algorithm is used. During the traversal, starting from the counterfactual analysis termination node, the topology nodes are expanded layer by layer forward based on the reverse connections of pre-built constraint and causal relationship edges between nodes. That is, nodes that can be reached are visited and recorded one by one in the reverse direction of the edge connections, generating a reverse topology traversal sequence. In the generated reverse topology traversal sequence, the recorded information for each node includes the node identifier number, the node business semantic identifier, and the node's hierarchical order number during the traversal process. During the generation of the traversal sequence, a unique node access marker is set to control repeated node visits. Each time a node is visited, it is marked, thus avoiding repeated visits and ensuring that each node appears only once in the generated reverse topology traversal sequence, thereby obtaining the reverse topology traversal sequence.

[0083] Based on the reverse topology traversal sequence, counterfactual topology consistency analysis is performed on each node, and the rationality of the reverse topology path is determined for the constraint relationship edges and causal relationship edges between nodes.

[0084] Specifically, for each node in the reverse topology traversal sequence, counterfactual topology consistency analysis is performed based on the reverse connections defined by the constraint and causal relationships between nodes. Starting from the termination node of the counterfactual analysis, the analysis proceeds node by node along the sequence back to the starting node. Each step of the analysis checks the rationality of the business rule logic and causal dependency logic corresponding to the edges connecting nodes. The rationality determination of the reverse topology path includes, but is not limited to, checking whether the edges between nodes actually exist, verifying whether the business rules and causal logic relationships defined by the edges meet the requirements of the counterfactual reasoning scenario of the domain task, and checking whether there are contradictions, unreasonable or circular logic paths in the business logic and causal logic defined by the edges between nodes. After analysis and determination, each node obtains a corresponding reverse topology path rationality determination result. The reverse topology path rationality determination result records the validity of the node in the counterfactual topology traversal path, including the identification information of whether the node path is reasonable or unreasonable.

[0085] Based on the rationality determination results of the reverse topology path, reverse topology verification data representing the topology consistency characteristics of the counterfactual path is generated;

[0086] Specifically, based on the obtained reverse topology path rationality judgment results, nodes judged as reasonable in the reverse topology traversal sequence are screened and extracted; the constraint relationship edges and causal relationship edge information between the screened and extracted nodes are used to construct a counterfactual path set; then, the counterfactual path set is feature-represented, including but not limited to path topology signature representation; the hierarchical order of the nodes in the reverse topology traversal sequence is used as the node position number, and the node position number, node business semantic identifier, and edge connection relationship type identifier between nodes are combined into a structured feature vector; for different path lengths, a unified path filling method is used for unified processing, for example, virtual nodes with specific identifiers can be added to the end of shorter counterfactual paths to ensure that all structured feature vectors have the same length; finally, the structured feature vectors corresponding to all paths are integrated and recorded to form reverse topology verification data; the reverse topology verification data represents the topology consistency feature data of all valid counterfactual paths in the direction of constraint reverse relationship for the target reasoning task.

[0087] S4: Integrate path topology feature data and reverse topology verification data to establish a forward and reverse dependency consistency matrix, identify topology conflicts, and output consistency correction results, including:

[0088] Feature parsing is performed on the path topology feature data and the reverse topology verification data to obtain the path topology node features and the reverse topology node features.

[0089] Specifically, based on the path topology feature data of the target inference task, feature parsing operations are performed, including but not limited to expanding each structured feature vector in the path topology feature data, parsing based on the node position number, node business semantic identifier, and edge connection relationship type identifier contained in the feature vector, and generating an independent path topology node feature for each node; including node number, node business semantic identifier, node path position feature, and type identifier of the path in which the node is located; based on the reverse topology verification data of the target inference task, the same feature parsing operation is performed, expanding each structured feature vector in the reverse topology verification data, parsing based on the node position number, node business semantic identifier, and edge connection relationship type identifier of the feature vector, and generating a reverse topology node feature for each node, including node number, node business semantic identifier, node reverse path position feature, and type identifier of the reverse path in which the node is located.

[0090] Node correspondence matching is performed based on the node identifiers between the path topology node features and the reverse topology node features;

[0091] Specifically, the node IDs and business semantic identifiers recorded in the path topology node features are used as the basis for node identification, and the node IDs and business semantic identifiers recorded in the reverse topology node features are used as the basis for node identification comparison. A node correspondence matching operation is performed, that is, node identifier indexes are established for both the path topology node features and the reverse topology node features, and each node is matched one by one using matching rules between the node identifier indices. These matching rules include, but are not limited to, constraints such as identical business semantic identifiers, identical node IDs, or identical node position IDs. A valid correspondence is determined when the node identifier indices completely match the matching rules. Finally, the successfully matched node correspondences are recorded to form the node correspondence matching result. The node correspondence matching result includes the node ID, the node's position ID in the path topology node features and the reverse topology node features, etc.

[0092] Based on the node correspondence matching results, construct a positive and negative dependency consistency matrix;

[0093] Specifically, based on the node identifiers in the node correspondence matching results and the number of path topology node features and reverse topology node features, a two-dimensional matrix is ​​constructed with nodes of path topology node features as rows and nodes of reverse topology node features as columns. Each element in the matrix is ​​assigned a value according to the node correspondence matching results. When the row node and column node corresponding to the matrix element form a valid match in the node correspondence matching results, the matrix element is assigned a value representing consistency, such as 1. When the row node and column node corresponding to the matrix element do not have a valid match, the matrix element is assigned a value representing inconsistency, such as 0. Finally, a positive and negative dependency consistency matrix is ​​obtained, which represents the consistency of the correspondence between the path topology node features and the reverse topology node features of the target inference task.

[0094] Based on the positive and negative dependency consistency matrix, topological feature conflict identification is performed on the matrix elements to determine the nodes where topological conflicts occur.

[0095] Specifically, based on each row and column of the forward and reverse dependency consistency matrix, the topological consistency relationship represented by each matrix element is checked, including but not limited to identifying elements with values ​​of 0 as inconsistencies. For the identified inconsistencies, the identification information of the corresponding row and column nodes is recorded. Then, based on the recorded node identification information, topological feature conflict identification is performed. Based on the path topological node features and reverse topological node features of the corresponding row and column nodes, the conflict type between nodes is identified. Topological conflict types include but are not limited to node semantic identification conflicts, node path location conflicts, and node connection relationship type conflicts. Finally, the nodes identified as having topological conflicts are recorded in the topological conflict node set, which records the information of all nodes identified as having topological conflicts.

[0096] Based on the nodes where topology conflicts occur, perform topology consistency correction and generate consistency correction result data;

[0097] Specifically, topology consistency correction includes, but is not limited to, node path location correction, node connection relationship type correction, or node semantic identifier unification. The node path location correction method is as follows: for nodes with topological conflicts, the node location numbers are reordered based on the differences between the node location numbers recorded by the path topology node features and the reverse topology node features, according to business rules predefined by domain experts. The node connection relationship type correction method is as follows: for nodes with connection relationship type conflicts, the connection relationship type is redefined based on the importance order of connection relationship types predetermined by domain experts. The node semantic identifier unification method is as follows: for nodes with semantic identifier conflicts, a unified business semantic identifier is determined using a manually defined standard business terminology unification mapping table. Through topology consistency correction, each node obtains a topology consistency correction result, which includes the corrected node location number, the unified node business semantic identifier, and the corrected node connection relationship type identifier. Finally, all corrected topology node features are recorded as consistency correction result data. The consistency correction result data represents the unified correction processing result of the path topology feature data and the reverse topology verification data for the target inference task.

[0098] S5: Based on the consistency correction results, perform topological labeling, topological equivalence determination, and multi-path admission screening on the candidate samples, and output a topologically accurate sample set, including:

[0099] Obtain consistency correction result data and candidate samples, and establish an index mapping between candidate samples and corresponding dependency structure graphs;

[0100] Specifically, based on the consistency correction result data, the topology node features after topology consistency correction are obtained. Each topology node feature includes the corrected node location number, the unified node business semantic identifier, and the corrected node connection relationship type identifier. According to business requirements, initial candidate samples are obtained. The methods for obtaining candidate samples include, but are not limited to, manual annotation and extraction of historical inference task data, such as selecting case samples from the historical inference case library. The dependency structure graph corresponding to each candidate sample for a specific target inference task is determined. Using the unique identifier information of the candidate sample, such as the sample sequence number or business scenario identifier information, as the search keyword, the dependency structure graph corresponding to the candidate sample is determined from the consistency correction result data through a search operation. Finally, an index mapping relationship between candidate samples and corresponding dependency structure graphs is established and recorded as the index mapping data between candidate samples and dependency structure graphs.

[0101] For each candidate sample, a topological feature signature is calculated based on the corresponding dependency structure graph to generate a topological label;

[0102] Specifically, the dependency structure graph corresponding to each candidate sample is selected from the index mapping data between candidate samples and dependency structure graphs. Based on the topological positional relationships of nodes, the connection relationship type identifiers between nodes, and the business semantic identifiers of nodes in the selected dependency structure graph, a topological feature signature calculation method is used to calculate the topological feature signature, including but not limited to hash signature algorithms. For example, a topological hash signature calculation method based on hash functions is used, taking the topological features such as node position numbers, node business semantic identifiers, and connection relationship type identifiers between nodes in the dependency structure graph as input, and generating a unique topological feature signature after hash function operation. The topological feature signature is then converted into a uniformly encoded topological label. The topological label is represented in a predefined structured encoding form, such as using a combination of letters and numbers, to ensure that each topological label is unique. Finally, the generated topological labels are associated with the corresponding candidate samples to obtain a candidate sample topological label data set.

[0103] Based on the consistency correction results, the topology labels are mapped to the positive and negative dependency consistency matrix to form a preliminary compliance sample subset;

[0104] Specifically, based on the topology labels recorded in the candidate sample topology label dataset, and according to the correspondence between topology labels and topology node features, the topology label of each candidate sample is mapped to a forward and reverse dependency consistency matrix. The mapping process includes matching the node identification information in the dependency structure graph associated with each topology label and locating the node identification information in the forward and reverse dependency consistency matrix. Compliance judgment is performed based on the element values ​​in the forward and reverse dependency consistency matrix. The compliance judgment criteria are: when the element value at the corresponding position of the topology label in the matrix represents a value indicating consistency, the candidate sample is determined to be a compliant candidate sample; when the element value represents a value indicating inconsistency, the candidate sample is determined to be non-compliant and deleted. After the above judgment, a preliminary compliant sample subset is formed. The preliminary compliant sample subset contains all candidate samples that have passed the compliance judgment and is recorded in the preliminary compliant sample subset data.

[0105] Topological equivalence determination is performed on the initial compliant sample subset to identify topologically equivalent samples and group the equivalent samples into the same topological equivalence class.

[0106] Specifically, based on the topological labels of all candidate samples recorded in the preliminary compliant sample subset data, topological equivalence determination is performed between topological labels. The topological equivalence determination method includes, but is not limited to, the topological label encoding matching method, that is, directly comparing whether the encoding of the topological labels is completely consistent. If and only if the topological label encoding is completely consistent, the corresponding candidate samples are determined to be topologically equivalent. After the above determination process, all candidate samples with completely identical topological label encodings are identified as topologically equivalent samples. All topologically equivalent samples are merged into the same topological equivalence class, and each topological equivalence class contains all candidate samples with the same topological structure features. Finally, the merged topological equivalence class information is completely recorded as topological equivalence class data.

[0107] For each topological equivalence class, samples that meet the multi-path admission threshold are selected according to the path diversity coverage index to obtain the topological fidelity sample set.

[0108] Specifically, for each topological equivalence class in the topological equivalence class data, a path diversity coverage index is calculated. The path diversity coverage index is used to quantify the diversity of paths corresponding to all samples in the topological equivalence class. The calculation method includes, but is not limited to, the path coverage calculation method, for example, path diversity coverage index = total number of unique nodes covered by each path / total number of paths in the topological equivalence class; where the total number of unique nodes covered by each path represents the total number of different nodes appearing in all paths of the topological equivalence class, and the total number of paths in the topological equivalence class represents the total number of all paths in the topological equivalence class; the Coverage path diversity coverage index is a floating-point number between 0 and 1.

[0109] A path diversity coverage threshold is pre-set as the multi-path admission threshold. The setting method is as follows: based on the statistical analysis of historical samples, an experimental analysis is conducted on the relationship between path diversity and model generalization performance in the historical inference dataset. The optimal range in which the path diversity coverage index can significantly improve the model generalization performance is selected as a reference.

[0110] For each topological equivalence class, the path diversity coverage index is compared with a preset multipath admission threshold. When the path diversity coverage index of the topological equivalence class is greater than or equal to the preset multipath admission threshold, all samples in the topological equivalence class are included in the topological fidelity sample set. When the path diversity coverage index of the topological equivalence class is less than the preset multipath admission threshold, the topological equivalence class is screened, and samples with higher path diversity contributions are selectively retained. The selection method includes, but is not limited to, a greedy path selection method. For example, samples that can increase the path diversity coverage index are selected sequentially and added to the topological fidelity sample set until the path diversity coverage index threshold is reached.

[0111] After the above selection and screening, a topology-fidelity sample set that meets the path diversity admission threshold requirement is obtained; the topology-fidelity sample set records all candidate samples after screening and topology structure determination, which can reflect the topology structure characteristics of the target reasoning task.

[0112] S6: Perform dependency signature annotation and topological label encoding on the topology-fidelity sample set to generate a dedicated inference model training dataset for the target inference task, including:

[0113] Based on the topology-fidelity sample set, the dependency structure graph of the target inference task corresponding to each topology-fidelity sample is extracted;

[0114] Specifically, based on the unique identifier information of each topology-fidelity sample recorded in the topology-fidelity sample set, an index retrieval of the sample and its dependency structure graph is performed. The retrieval methods include, but are not limited to, matching and retrieving the sample sequence number or business scenario identifier recorded for each sample through an index mapping database. The retrieval process obtains the target inference task dependency structure graph corresponding to each topology-fidelity sample. The obtained target inference task dependency structure graph is a structure graph that meets the topology-fidelity requirements after screening and verification, recording the node number, node business semantic identifier, node position number, and connection relationship type identifier between nodes for each node. After the retrieval is completed, the extracted dependency structure graph is recorded to form a dependency structure graph data set corresponding to the topology-fidelity sample set.

[0115] Dependency signature annotations are performed on the nodes and edges between nodes in the dependency structure graph for each target inference task;

[0116] Specifically, the dependency structure graph for each target inference task is selected from the dependency structure graph dataset, and dependency signature annotation is performed. Each node in the dependency structure graph is annotated with a node dependency signature, which includes the node number, the node's business semantic identifier, the node's location number, and the type identifier of the path the node belongs to, expressed using a structured string. Each edge in the dependency structure graph is annotated with an edge dependency signature, which includes the connection relationship type identifier, the starting and ending node numbers connected to the edge, and the constraint type or causal relationship type corresponding to the edge, expressed using a structured string. During the dependency signature annotation process, it is ensured that each node and edge obtains a unique dependency signature annotation, and the dependency signature annotation results for nodes and edges are recorded to form the dependency structure graph data after dependency signature annotation.

[0117] Based on the topology-fidelity sample set after dependency signature annotation, the topology labels are converted into structured topology codes according to the topology label encoding rules;

[0118] Specifically, based on the dependency structure graph data annotated with dependency signatures, a topology label corresponding to each topology-fidelity sample is extracted. The topology label is a unique identifier. Based on predefined topology label encoding rules, each topology label undergoes structured encoding transformation. These rules include, but are not limited to, combined encoding based on node position numbers, node dependency signatures, and edge dependency signatures. For example, the node dependency signature and edge dependency signature are encoded using hash functions respectively, and then sequentially concatenated with the node position numbers to form a unified code. During the topology label encoding process, SHA256 or MD5 hash algorithms can be used to generate fixed-length string hash values, ensuring that each topology label corresponds to a unique and reproducible structured topology code. The generated structured topology code represents the topological features of the dependency structure graph corresponding to each topology-fidelity sample. All generated structured topology codes are recorded to form a set of structured topology codes.

[0119] Based on structured topological coding and topologically accurate sample sets with signature annotation, a dedicated training dataset for the inference model of the target inference task is generated.

[0120] Specifically, the structured topological codes are matched with topologically accurate samples, establishing a one-to-one mapping relationship based on the unique identifier of each sample. Based on this mapping, each topologically accurate sample and its corresponding structured topological code are organized in a unified structured format, including but not limited to key-value pairs or JSON format. For example, the unique identifier of the sample serves as the primary key, and the structured topological code and its corresponding node dependency signature and edge dependency signature serve as the values. Then, normalization processing is performed, including but not limited to data deduplication, data consistency verification, and data format conversion, such as converting to the tensor format or CSV file format required for training the dedicated inference model. After normalization, a data format suitable for training the dedicated inference model is obtained, forming the dedicated inference model training dataset.

[0121] The normalization processing of the training dataset for the dedicated inference model includes, but is not limited to: digitizing the topological codes using a vocabulary mapping method, i.e., pre-defining a topological code vocabulary and assigning a unique integer number to each structured topological code; constructing a sample matrix, where rows represent the number of samples, columns represent the feature dimensions of the structured topological codes, and elements are the integer numbers of the corresponding topological codes; for example, if the number of samples is 1000 and the feature dimension is 128, then a 1000×128 dimensional sample matrix is ​​constructed; combining the constructed sample matrix with the node features and edge features after dependency signature annotation to generate an additional feature matrix; the additional feature matrix is ​​based on node... Feature information extracted from vertex-dependent signature annotations and edge-dependent signature annotations, such as node semantic category, node position number, and edge connection type, is used. The sample matrix and the additional feature matrix are then fused to generate a training data tensor. Feature fusion methods include, but are not limited to, concatenation fusion, weighted fusion, or multiplicative fusion. During the fusion process, the fusion weight parameters are obtained through historical sample statistical analysis. For example, the weight parameters are set as the statistical proportion of the contribution of nodes and edges to prediction performance in the historical dataset, determined through statistical analysis. Finally, the generated training data tensor is stored in a standard format, such as TFRecord or HDF5, for use in the training process of a dedicated inference model.

[0122] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. The semiconductor medium can be a solid-state drive.

[0123] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0124] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0125] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.

[0126] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0127] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.

[0128] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0129] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0130] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for constructing a dataset for a specific inference model, characterized in that, Includes the following steps: S1: Analyze the domain task text information, rule constraint information, and causal dependency information to establish a dependency structure graph for the target reasoning task, specifically: Acquire domain task text information, rule constraint information, and causal dependency information; Perform word segmentation, part-of-speech tagging, and named entity recognition on domain task text information, and extract task term nodes from domain task text information; The rule constraint information is symbolically represented and transformed to extract the constraint type, triggering conditions and result relationship, and form constraint relationship edges; By locating event trigger words and extracting causal pairs from causal dependency information, causal relationship edges are obtained. By integrating task terminology nodes, constraint type nodes, and causal relationship edges, a dependency structure graph for the target reasoning task is constructed. S2: Based on the dependency structure graph, according to the semantic relationship direction of the target reasoning task, perform topological expansion and node reachability analysis on the causal constraint path to generate path topological feature data. S3: Based on the dependency structure graph, according to the constraint reverse relationship of the target reasoning task, perform topological backtracking and consistency detection on the counterfactual dependency path to generate reverse topological verification data; S4: Integrate the path topology feature data and reverse topology verification data to establish a forward and reverse dependency consistency matrix, identify topology conflicts, and output consistency correction results; S5: Based on the consistency correction results, perform topological labeling, topological equivalence determination and multi-path admission screening on the candidate samples, and output the topologically accurate sample set; S6: Perform dependency signature annotation and topological label encoding on the topology-fidelity sample set to generate a dedicated inference model training dataset for the target inference task.

2. The dataset construction method for a specialized inference model according to claim 1, characterized in that, S2, specifically: Based on the dependency structure graph of the target reasoning task, the inference start node and the termination node are determined according to the semantic relationship direction of the target reasoning task. Starting from the inference start node, perform topological traversal in sequence, expand the inference path based on the constraint relationship edges and causal relationship edges between nodes, and generate a topological traversal sequence. Based on the topological traversal sequence, node reachability is determined, and the path reachability identifier of each node in the topological traversal sequence is determined according to the constraint relationship edges and causal relationship edges. Based on the node path reachability identifiers and topological traversal sequences, path topological feature data representing causal constraint path characteristics is generated.

3. The dataset construction method for a specialized inference model according to claim 2, characterized in that, S3, specifically: Based on the dependency structure graph of the target reasoning task, the termination node and the starting node of the counterfactual analysis are determined according to the reverse relationship direction of the constraints of the target reasoning task. Starting from the terminal node of the counterfactual analysis, a reverse topological traversal is performed along the constraint relationship edges and causal relationship edges between nodes to backtrack the counterfactual reasoning path and generate a reverse topological traversal sequence. Based on the reverse topology traversal sequence, counterfactual topology consistency analysis is performed on each node, and the rationality of the reverse topology path is determined for the constraint relationship edges and causal relationship edges between nodes. Based on the rationality determination results of the reverse topology path, reverse topology verification data representing the topology consistency characteristics of the counterfactual path is generated.

4. The dataset construction method for a specialized inference model according to claim 3, characterized in that, S4, specifically: Feature parsing is performed on the path topology feature data and the reverse topology verification data to obtain the path topology node features and the reverse topology node features. Node correspondence matching is performed based on the node identifiers between the path topology node features and the reverse topology node features; Based on the node correspondence matching results, construct a positive and negative dependency consistency matrix; Based on the positive and negative dependency consistency matrix, topological feature conflict identification is performed on the matrix elements to determine the nodes where topological conflicts occur. Based on the nodes where topology conflicts occur, topology consistency correction is performed, and consistency correction result data is generated.

5. The dataset construction method for a specialized inference model according to claim 4, characterized in that, S5, specifically: Obtain consistency correction result data and candidate samples, and establish an index mapping between candidate samples and corresponding dependency structure graphs; For each candidate sample, a topological feature signature is calculated based on the corresponding dependency structure graph to generate a topological label; Based on the consistency correction results, the topology labels are mapped to the positive and negative dependency consistency matrix to form a preliminary compliance sample subset; Topological equivalence determination is performed on the initial compliant sample subset to identify topologically equivalent samples and group the equivalent samples into the same topological equivalence class. For each topological equivalence class, samples that meet the multi-path admission threshold are selected according to the path diversity coverage index to obtain the topological fidelity sample set.

6. The dataset construction method for a specialized inference model according to claim 5, characterized in that, S6, specifically: Based on the topology-fidelity sample set, the dependency structure graph of the target inference task corresponding to each topology-fidelity sample is extracted; Dependency signature annotations are performed on the nodes and edges between nodes in the dependency structure graph for each target inference task; Based on the topology-fidelity sample set after dependency signature annotation, the topology labels are converted into structured topology codes according to the topology label encoding rules; Based on structured topological coding and topologically accurate sample sets with signature annotation, a dedicated training dataset for the inference model of the target inference task is generated.

Citation Information

Patent Citations

  • Anti-fact fair synthesis data generation method and device based on causal reasoning

    CN120354938A

  • Training data synthesis method and device based on error extrapolation and inference chain analysis, medium and program product

    CN120611192A