A small sample training sample automatic expansion method and system based on meta-path guidance
Patent Information
- Application Number
- CN202611169335.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-04
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2046-08-04
AI Technical Summary
现有小样本扩充技术通常缺少对扩充样本来源路径、证据节点、字段变更片段和敏感字段使用状态的记录,导致扩充样本难以追溯,后续模型效果异常时也难以定位样本污染来源
[0031]本发明通过构建包含样本、标签、数据对象、字段、指标、业务场景、规则和来源系统节点的异构语义图,使样本扩充过程能够利用领域元数据中的结构关系;通过以稀缺标签及其已标注样本为锚点筛选候选元路径,并依据路径覆盖度、标签纯度、证据完整性和敏感字段可用性确定目标元路径,可以减少与稀缺标签无关或证据不足的路径被用于扩充;通过将目标元路径实例转化为样本扩充证据链,并在证据链约束下进行字段替换、语义片段拼接或结构化槽位重组,能够使候选扩充样本保留来源元路径、证据节点和变更片段标记;通过标签一致性、路径闭合性、重复度和敏感信息校验,可以降低伪标签样本、近重复样本和不合规敏感字段进入训练集的概率,从而提升小样本训练数据的质量,并便于后续审计、回溯和规则调整。
Smart Images

Figure CN122692570B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of data governance, machine learning training data processing, and artificial intelligence model training technology. Specifically, it relates to a method and system for automatically expanding small training samples based on meta-path guidance. It is applicable to the automatic expansion of training samples in scenarios such as data asset management, data quality problem identification, metadata entity extraction, indicator caliber matching, business intent identification, risk event identification, and data development task recommendation. Background Technology
[0002] As data governance efforts deepen in sectors such as government affairs, healthcare, medical insurance, and pharmaceuticals, data asset management, data analysis and mining, and data development and utilization are increasingly reliant on machine learning models to perform tasks such as automatic classification, entity recognition, intent recognition, rule matching, and risk identification. These tasks typically require high-quality labeled samples as a training foundation. However, in real-world projects, data sources are complex, business labeling systems change rapidly, and some labels have only a few historical samples, leading to inconsistent model performance in long-tail categories, low-frequency business scenarios, and newly created data asset categories.
[0003] In existing technologies, methods such as text rewriting, synonym replacement, back translation, generative models, or meta-learning are commonly used to expand training samples to address the problem of few-shot training. For example, Chinese Patent Publication CN115964486A discloses a data-augmented few-shot intent recognition method. This method obtains a few-shot intent recognition dataset, inputs it into a natural language inference and generative model to generate expanded samples, and then trains the intent recognition model using feature mapping and a prototype network. This approach can alleviate the problem of insufficient samples in few-shot intent recognition scenarios to some extent.
[0004] However, common sample augmentation methods often start from the sample text itself, mainly focusing on the semantic similarity or linguistic diversity of the generated samples, while rarely considering the relationships between the underlying data objects, fields, metrics, business scenarios, rules, source systems, and permission constraints. In data governance scenarios, training samples are not simply text; their labels are often determined by data lineage, field meanings, quality rules, business processes, and source systems. Simply randomly replacing or generating sample text can easily lead to problems such as mismatches between fields and business scenarios, incomplete rule bases, semantic shifts in labels, and training set contamination.
[0005] Furthermore, data in government services, healthcare, medical insurance, and pharmaceutical fields often involve sensitive fields and access boundaries. During sample augmentation, it is also necessary to control which fields can be shared externally, which fields can only be used with anonymized data, and which fields must not be included in the training set. Existing small-sample augmentation techniques typically lack records of the source path of the augmented samples, evidence nodes, field change fragments, and the usage status of sensitive fields, making it difficult to trace the augmented samples and locate the source of sample contamination when subsequent model performance is abnormal.
[0006] Therefore, there is an urgent need to provide an automatic expansion scheme for small-sample training samples oriented towards semantic relationships in data governance. This scheme should not only increase the number of scarce labeled samples during the expansion process, but also constrain the process based on domain metadata relationships. While generating candidate expansion samples, it should retain the source metadata path and evidence chain, and control the quality of data entry through label consistency, path closure, redundancy, and sensitive information verification. This would improve the availability and auditability of small-sample training sets. Summary of the Invention
[0007] The purpose of this invention is to provide a method and system for automatic expansion of small training samples based on meta-path guidance, so as to improve the semantic consistency, traceability and reliability of data entry of training samples in data governance scenarios where samples are scarce and domain relationships are complex.
[0008] To achieve the above objectives, the present invention provides the following technical solution.
[0009] In a first aspect, the present invention provides a method for automatic expansion of small training samples based on meta-path guidance, executed by a server, comprising:
[0010] S1. Obtain labeled samples, unlabeled business data, and domain metadata for the target training task, and construct a heterogeneous semantic graph containing samples, labels, data objects, fields, metrics, business scenarios, rules, and source system nodes.
[0011] S2. Identify scarce labels with a sample number lower than a preset threshold, and use the scarce labels and their labeled samples as anchor points to filter candidate meta-paths connecting sample nodes with business scenario nodes, rule nodes, or data object nodes from the heterogeneous semantic graph.
[0012] S3. Determine the target meta path based on the path coverage, label purity, evidence integrity and sensitive field availability of the candidate meta path, and extract the target meta path instances to form a sample augmented evidence chain containing the path instance node sequence, edge relationship type, evidence nodes and recombinable fields.
[0013] S4. Based on the sample-based evidence chain expansion, while maintaining the traceability of scarce labels and target meta-paths, the anchor sample is subjected to field replacement, semantic fragment splicing, or structured slot reorganization to generate candidate expanded samples carrying source meta-paths, evidence nodes, and changed fragment markers.
[0014] S5. Perform label consistency, path closure, repetition and sensitive information verification on the candidate augmented samples. Add the candidate augmented samples that pass the verification to the training set, and write the candidate augmented samples that fail the verification and the reasons for failure to the fallback database.
[0015] Specifically, the target training task includes one or more of the following: data asset classification, data quality problem identification, metadata entity extraction, indicator caliber matching, business intent identification, risk event identification, and data development task recommendation; the domain metadata includes one or more of the following: data catalog, data lineage, field dictionary, indicator caliber, quality rules, permission rules, source system records, and business process records.
[0016] Specifically, in step S1, constructing a heterogeneous semantic graph includes: mapping labeled samples and unlabeled business data to sample nodes, mapping sample labeling results to tag nodes, mapping tables, interfaces, files, reports, or data products to data object nodes, and establishing heterogeneous edges based on field attribution relationships, indicator reference relationships, rule hit relationships, source system relationships, and business scenario relationships; the meta-path is a path template connected in the order of preset node types.
[0017] Specifically, in step S2, identifying scarce labels includes: counting the number of labeled samples, the number of sample sources, and the number of business scenarios covered for each label; when the number of labeled samples for any label is lower than a preset threshold, or its number of business scenarios covered is lower than a preset coverage threshold, the label is identified as a scarce label.
[0018] Specifically, in step S2, the screening of candidate meta paths includes: starting from the labeled sample nodes corresponding to scarce tags, performing path search according to the preset node type order among sample nodes, field nodes, data object nodes, business scenario nodes, rule nodes, or source system nodes; eliminating paths containing prohibited fields, invalid source systems, or conflicting tag nodes to obtain candidate meta paths.
[0019] Specifically, in step S3, determining the target metapath includes: determining path coverage based on the number of anchor point samples covered by the candidate metapath; determining label purity based on the proportion of samples in the candidate metapath instance that match scarce labels; determining evidence integrity based on the completeness of evidence nodes, field nodes, and source system nodes in the candidate metapath instance; and determining sensitive field availability based on the matching results of available fields in the candidate metapath instance with permission rules. Candidate metapaths that meet the path coverage threshold, label purity threshold, evidence integrity threshold, and sensitive field availability threshold, and do not contain fields that are prohibited from use and cannot be desensitized and replaced, are determined as target metapaths.
[0020] Specifically, in step S3, the sample expansion evidence chain includes a target meta-path identifier, a path instance node sequence, an edge relationship type, an anchor sample identifier, a scarce label identifier, a business scenario identifier, a rule node identifier, a set of replaceable fields, a set of splicable semantic fragments, a set of structured slots, and an evidence summary; the evidence summary is used to record the source of the fields, the source of the rules, or the source of the business scenario that supports the generation of candidate expansion samples in the target meta-path instance.
[0021] Specifically, in step S4, field replacement includes: replacing non-sensitive fields in the anchor sample with the same type of field values in the same target meta-path instance while keeping the scarce label, business scenario node, and rule node unchanged; semantic fragment splicing includes: splicing semantic fragments related to the same scarce label and the same business scenario to the corresponding fragment positions of the anchor sample; and structured slot reorganization includes: writing reorganizable fields into the same slot template as the anchor sample, and retaining the field source marker, fragment position marker, and reorganization method marker.
[0022] Specifically, in step S5, the label consistency verification includes: obtaining the predicted labels of the candidate expanded samples through a label discrimination model, rule discriminator, or manual review interface, and determining whether they are consistent with the scarce labels; the path closure verification includes: determining whether the sample nodes corresponding to the candidate expanded samples can still be connected to the evidence nodes, business scenario nodes, or rule nodes through the target meta-path; the duplication verification includes: identifying duplicate samples based on text fingerprints, structured field fingerprints, or semantic vector similarity; and the sensitive information verification includes: identifying the sensitivity level of the fields in the candidate expanded samples, blocking prohibited fields, de-identifying and replacing them, or replacing the evidence index according to the permission rules.
[0023] In a second aspect, the present invention also provides a small-sample training sample automatic expansion system based on meta-path guidance, for implementing the method described in the first aspect, the system comprising:
[0024] The data access module is used to acquire labeled samples, unlabeled business data, and domain metadata for the target training task;
[0025] The heterogeneous graph construction module is used to build heterogeneous semantic graphs that include samples, labels, data objects, fields, metrics, business scenarios, rules, and source system nodes.
[0026] The meta-path filtering module is used to identify scarce labels and filter candidate meta-paths and determine target meta-paths using scarce labels and their labeled samples as anchor points.
[0027] The evidence chain generation module is used to extract target meta-path instances and form sample-enhanced evidence chains.
[0028] The sample augmentation module is used to generate candidate augmented samples based on the sample augmentation evidence chain.
[0029] The verification and entry module is used to verify the candidate augmented samples for label consistency, path closure, repetition, and sensitive information. The candidate augmented samples that pass the verification are added to the training set, and the candidate augmented samples that fail the verification and the reasons for their failure are written to the fallback database.
[0030] Thirdly, the present invention also provides a computer-readable storage medium having a computer program or instructions stored thereon, which, when executed by a processor, implements the method described in the first aspect.
[0031] This invention constructs a heterogeneous semantic graph containing samples, labels, data objects, fields, metrics, business scenarios, rules, and source system nodes, enabling the sample expansion process to utilize structural relationships in domain metadata. By using scarce labels and their labeled samples as anchors to filter candidate meta-paths, and determining target meta-paths based on path coverage, label purity, evidence completeness, and sensitive field availability, it reduces the use of paths unrelated to scarce labels or with insufficient evidence for expansion. By transforming target meta-path instances into sample expansion evidence chains, and performing field replacement, semantic fragment splicing, or structured slot reorganization under the constraints of the evidence chain, it ensures that candidate expanded samples retain source meta-paths, evidence nodes, and changed fragment markers. Through label consistency, path closure, repetition, and sensitive information verification, it reduces the probability of pseudo-labeled samples, near-duplicate samples, and non-compliant sensitive fields entering the training set, thereby improving the quality of small-sample training data and facilitating subsequent auditing, backtracking, and rule adjustment. Attached Figure Description
[0032] Figure 1 This is a schematic diagram of the automatic expansion method for small-sample training samples according to the present invention.
[0033] Figure 2 This is a schematic diagram of the structure and data flow of the small-sample training sample automatic expansion system of the present invention. Detailed Implementation
[0034] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments. It should be understood that the following embodiments are used to illustrate the implementation of the present invention and are not intended to limit the scope of protection of the present invention. Unless otherwise specified, the embodiments and technical features in these embodiments can be combined with each other.
[0035] I. Terminology Explanation
[0036] To facilitate understanding of the technical solution of this invention, unless otherwise expressly defined, the following terms have the following meanings in this specification:
[0037] Heterogeneous semantic graphs are graph structures composed of different types of nodes and edges, used to represent semantic relationships between training samples, labels, data objects, fields, metrics, business scenarios, rules, and source systems; where nodes represent specific objects and edges represent relationships such as attribution, reference, hit, source, applicability, or association.
[0038] Metapaths refer to path templates formed in a heterogeneous semantic graph according to a preset node type order, such as sample node—field node—rule node—business scenario node, or sample node—field node—data object node—source system node—business scenario node. Metapaths are used to limit the scope of semantic relationships that can be used when expanding samples.
[0039] Scarce labels refer to label categories where the number of labeled samples in the target training task is lower than a preset threshold, or the number of business scenarios covered is lower than a preset coverage threshold. The labeled samples corresponding to scarce labels serve as anchor samples for sample expansion in this invention.
[0040] Candidate metapaths refer to metapaths that are searched from heterogeneous semantic graphs using scarce labels and their labeled samples as anchors, and have not yet undergone comprehensive screening; target metapaths refer to metapaths used to generate candidate augmented samples after being screened based on path coverage, label purity, evidence completeness, and availability of sensitive fields.
[0041] An augmented evidence chain refers to a structured record formed based on target meta-path instances. It records one or more pieces of information, including path instance node sequences, edge relationship types, evidence nodes, anchor sample identifiers, scarce label identifiers, replaceable fields, concatenable semantic fragments, structured slots, and evidence summaries. The augmented evidence chain supports the generation, tracing, and verification of candidate augmented samples.
[0042] Evidence nodes refer to nodes in the target metapath instance that can support the generation or verification of candidate expanded samples, including one or more of field nodes, data object nodes, indicator nodes, business scenario nodes, rule nodes, and source system nodes.
[0043] Reconfigurable fields are fields that, within the scope permitted by the permission rules, can be used for field replacement, semantic fragment concatenation, or structured slot reconfiguration. Reconfigurable fields do not include sensitive fields that are prohibited from use and cannot be de-identified and replaced.
[0044] Change fragment markers refer to the marker information used to record the location, type, and source of changes in candidate augmented samples relative to anchor samples. Change types include one or more of field replacement, semantic fragment splicing, and structured slot reorganization.
[0045] Path closure refers to the state where, after a candidate expanded sample is generated, its corresponding sample node can still be connected to the evidence node, business scenario node, or rule node according to the target meta-path. Path closure is used to determine whether the candidate expanded sample still maintains a semantic association consistent with the target meta-path.
[0046] Sensitive field availability refers to the degree to which fields in the candidate metapath or target metapath can be used for sample augmentation after being judged by permission rules, sensitivity level rules, or de-identification rules. Fields that are prohibited from use and cannot be de-identified and replaced will not be included as recombinable fields in the candidate augmentation samples.
[0047] II. General Description
[0048] This invention provides a method for automatically expanding small training samples based on meta-path guidance. This method can be executed by a server, data governance platform, model training platform, or computing nodes deployed in a dedicated cloud, private cloud, or intranet environment. The server may include a processor, memory, database, graph computing engine, sample management component, permission rule component, and model training component. This method is applicable to training sample expansion tasks in data governance and analysis service scenarios such as government services, healthcare, medical insurance, and pharmaceuticals. It is particularly suitable for training tasks with insufficient labeled samples, uneven label distribution, complex data sources, high field sensitivity levels, and the need to retain the basis for sample generation.
[0049] In this embodiment, the target training task can be any one of the following: data asset classification, data quality problem identification, metadata entity extraction, indicator caliber matching, business intent identification, risk event identification, or data development task recommendation. Taking data asset classification as an example, the platform needs to classify data assets into preset categories based on data table names, field names, field annotations, source systems, business processes, data quality rule hit rates, and historical usage scenarios. However, in actual projects, the number of labeled samples corresponding to some categories is relatively small. Directly training the model can easily lead to problems such as low recall rate for that category and model output bias towards categories with a larger number of samples. If the samples are directly expanded using methods such as ordinary text replacement, back translation, or generative model expansion, it may result in inconsistencies between the expanded samples and the original labels, or the inclusion of sensitive fields that should not be used in training. Therefore, this embodiment constrains the sample expansion process through heterogeneous semantic graphs and meta-paths, enabling candidate expanded samples to trace back to the corresponding evidence nodes along a specific path and performing multiple verifications before being stored in the database.
[0050] III. Specific Implementation Steps of the Method of the Invention
[0051] like Figure 1 As shown, the automatic expansion method for small training samples based on meta-path guidance in this embodiment of the invention includes the following steps.
[0052] 3.1 Data Acquisition and Heterogeneous Semantic Graph Construction
[0053] S1 acquires labeled samples, unlabeled business data, and domain metadata for the target training task, and constructs a heterogeneous semantic graph containing samples, labels, data objects, fields, metrics, business scenarios, rules, and source system nodes.
[0054] In this embodiment, labeled samples refer to training samples that have been manually labeled, labeled by historical systems, or confirmed through a review process. Each labeled sample may include sample text, structured fields, tags, source system, business scenario, labeling time, and labeler or labeling source. Unlabeled business data refers to data objects and their descriptive information that have not yet been assigned training labels but can be obtained from business systems, data catalogs, data lakes, subject libraries, data platforms, or business reports. Domain metadata may include data catalogs, data lineage, field dictionaries, indicator definitions, quality rules, permission rules, source system records, and business process records.
[0055] The server can first perform format standardization on the above data. For example, it can convert data table names, interface names, report names, field names, field descriptions, indicator names, indicator definitions, rule names, and business process names into a unified text representation; convert source systems, business departments, business scenarios, permission levels, and sensitivity levels into structured attributes; and establish associations between labeled samples and their corresponding tags. After preprocessing, the server builds a heterogeneous semantic graph in a graph database or graph computing engine.
[0056] In the heterogeneous semantic graph, sample nodes represent a labeled sample or an unlabeled business sample that can be used for expansion; label nodes represent the label category in the training task; data object nodes represent tables, interfaces, files, reports, subject libraries, datasets, or data products; field nodes represent fields in data objects; indicator nodes represent business indicators, regulatory indicators, statistical indicators, or analytical indicators; business scenario nodes represent scenarios such as government services, public health, medical insurance settlement, drug supervision, risk monitoring, asset management, and business collaboration; rule nodes represent data quality rules, classification rules, permission rules, risk control rules, or business verification rules; and source system nodes represent business systems, data exchange platforms, data warehouses, data lakes, subject libraries, or external access systems.
[0057] Edges in a heterogeneous semantic graph can include sample-label edges, sample-field edges, field-data object edges, data object-source system edges, data object-business scenario edges, metric-field edges, rule-field edges, rule-business scenario edges, label-business scenario edges, and label-rule edges. Edge attributes can include relation type, generation time, credibility, source, whether it can be used for expansion, and whether it contains sensitive fields. These nodes and edges together constitute the semantic relation foundation for sample expansion.
[0058] To facilitate subsequent path searching, the server can also be configured with meta-path templates. The meta-path is a path template connected in a preset node type order. For example, for a data asset classification task, the following types of meta-path templates can be configured:
[0059] Sample node — Field node — Data object node — Business scenario node;
[0060] Sample node — Field node — Rule node — Business scenario node;
[0061] Sample node — Data object node — Source system node — Business scenario node;
[0062] Sample node — Field node — Metric node — Business scenario node;
[0063] Sample node — Tag node — Rule node — Business scenario node.
[0064] The above meta-path template is for illustrative purposes only. Different tasks can adjust the node type order and path length according to the domain metadata structure. Generally, the path length can be controlled between two and five hops to reduce the probability of introducing irrelevant nodes and the cost of graph search.
[0065] 3.2 Scarce Label Identification and Candidate Meta Path Selection
[0066] S2 identifies scarce labels with a sample count below a preset threshold. Using these scarce labels and their labeled samples as anchor points, it filters candidate meta-paths from the heterogeneous semantic graph to connect sample nodes with business scenario nodes, rule nodes, or data object nodes.
[0067] In this embodiment, the server counts the number of labeled samples, the number of sample sources, and the number of business scenarios covered for each label in the target training task. The number of labeled samples reflects the scale of samples that can be directly used for training under a certain label; the number of sample sources reflects whether the samples are concentrated from a single source system; and the number of business scenarios covered reflects whether the samples cover sufficient business usage scenarios.
[0068] When the number of labeled samples for any label is lower than a preset threshold, or the number of business scenarios it covers is lower than a preset coverage threshold, the server determines that label as a scarce label. For example, in a data asset classification task, if the category "abnormal medical insurance settlement data" has only 18 labeled samples, and the system's preset minimum training sample threshold is 50, then this category can be determined as a scarce label. Similarly, if a label has 60 labeled samples, but all come from the same source system and only cover one business scenario, and the preset business scenario coverage threshold is 3, then this label can also be determined as a scarce label.
[0069] After identifying scarce labels, the server uses the scarce label node and its corresponding labeled sample node as anchor points to perform path search in the heterogeneous semantic graph. Path search can start from the sample node corresponding to the scarce label, or it can start from the scarce label node and then enter field nodes, data object nodes, rule nodes, indicator nodes, business scenario nodes, or source system nodes through the sample nodes. During the search process, the server matches according to a preset meta-path template to generate candidate meta-paths.
[0070] The selection of candidate meta paths is not solely based on their existence. The server needs to eliminate paths unsuitable for generating candidate augmented samples. For example, if a path contains prohibited fields or fields with sensitivity levels exceeding the limits allowed by the target training task, the path is eliminated; if the source system traversed by the path is disabled, awaiting verification, or in a low-trust state, the path is eliminated; if other label nodes on the path conflict with scarce labels, the path is eliminated; if the business scenario in the path does not match the target training task, the path is eliminated. After the above processing, the remaining paths are considered candidate meta paths.
[0071] In a specific implementation, the server can set a lower limit on the number of path instances for candidate meta-paths. For example, although a certain meta-path template can connect anchor point samples and business scenario nodes, if it only matches a small number of path instances in the graph, then this meta-path template may not be sufficient to support stable expansion and can be temporarily excluded from the candidate meta-path list. The server can also sample path instances to avoid excessive influence from source systems with a large number of samples on candidate paths.
[0072] 3.3 Target Path Determination and Evidence Chain Generation
[0073] S3 determines the target meta-path based on the path coverage, label purity, evidence completeness, and sensitive field availability of the candidate meta-paths, and extracts instances of the target meta-path to form a sample-enhanced evidence chain containing the path instance node sequence, edge relation type, evidence nodes, and recombinable fields.
[0074] In this embodiment, path coverage can be determined based on the number of anchor point samples covered by the candidate meta path, the number of business scenarios covered, the number of source systems covered, or the number of data objects covered. Path coverage is used to indicate whether a candidate meta path can provide sufficient basis for expanding scarce tags. If a candidate meta path only covers one anchor point sample and has few path instances, then even if the candidate meta path is semantically accurate, it may not provide sufficient expansion space.
[0075] Label purity can be determined based on the proportion of samples in a candidate metapath instance that match the scarce label. For example, if the server finds 100 path instances along a candidate metapath, and 85 of these path instances connect labeled samples with scarce labels, while the remaining 15 path instances connect to other labels, then the label purity of this candidate metapath is high. If a candidate metapath connects multiple labels with a mixed label distribution, this path is prone to introducing label shifts when used to generate augmented samples, and its priority should be reduced or it should be removed.
[0076] Evidence completeness can be determined based on the completeness of evidence nodes, field nodes, rule nodes, and source system nodes in a candidate metapath instance. Evidence nodes can be field nodes, rule nodes, indicator nodes, business scenario nodes, source system nodes, or data object nodes that support the generation of candidate expanded samples. For example, if a field in a candidate expanded sample replaces a field node from a data object of the same type within the same business scenario, then that field node and its associated data object node can serve as evidence nodes; if a candidate expanded sample retains the hit status of a certain quality rule, then the corresponding rule node can serve as evidence nodes. If a path instance lacks field descriptions, source system information, rule source information, or business scenario information, the evidence completeness is low, and it is not suitable for directly generating expanded samples.
[0077] The availability of sensitive fields can be determined based on the matching results between available fields in candidate metapath instances and permission rules. The server can read permission rules and sensitivity level configurations to determine whether fields in the path instance are allowed to be used for training sample expansion. For fields such as personal identification, contact number, detailed address, precise geographic location, original medical records, prescription details, and account information, direct inclusion in training samples can be prohibited according to business rules. For fields that have undergone generalization or desensitization, such as age group, region code, institution level, time range, and event type, they can participate in expansion if the permission rules are met. The server determines the availability of sensitive fields based on the above judgment results.
[0078] To facilitate the determination of the target meta-path from the candidate meta-paths, a path evaluation value can be calculated for each candidate meta-path. Let the i-th meta-path be... The candidate meta-paths are Its path coverage is The label purity is The completeness of the evidence is The availability of sensitive fields is Then the path evaluation value It can be represented as:
[0079]
[0080] in, , , , These are weighting coefficients, which can be configured according to the requirements of the target training task regarding coverage, label consistency, evidence completeness, and restrictions on the use of sensitive fields. The server can... Reaching the preset scoring threshold, and , and Candidate metapaths that satisfy the corresponding threshold conditions are determined as target metapaths.
[0081] In one implementation, path coverage It can be represented as:
[0082]
[0083] In the formula, Candidate metapath The number of scarce label anchor point samples covered. This represents the total number of anchor point samples corresponding to this scarce label.
[0084] Label purity It can be represented as:
[0085]
[0086] In the formula, Candidate metapath The number of samples in the path instances that match the scarce label. For this candidate metapath The total number of all labeled path instances.
[0087] Completeness of evidence It can be represented as:
[0088]
[0089] In the formula, Candidate metapath The actual number of evidentiary elements present in the path instance. The number of evidence elements to be preset is specified; the evidence elements include one or more of the following: field nodes, data object nodes, business scenario nodes, rule nodes, source system nodes, and evidence summaries.
[0090] Sensitive field availability It can be determined based on the number of available fields and the number of candidate fields:
[0091]
[0092] In the formula, Candidate metapath The number of fields allowed for sample expansion after being determined by the permission rules. Candidate metapath The total number of candidate fields participating in the expansion judgment; when the candidate metapath When the field contains prohibited fields that cannot be de-identified and replaced, you can... Set it to 0.
[0093] The above formula illustrates an feasible method for determining target meta-paths. In other implementations, threshold filtering, rule sorting, or multi-level screening methods can also be used to determine target meta-paths, as long as candidate meta-paths can be screened based on path coverage, label purity, evidence integrity, and availability of sensitive fields.
[0094] In one implementation, the path coverage threshold can be set to 0.6, the label purity threshold to 0.8, the evidence integrity threshold to 0.8, the sensitive field availability threshold to 0.7, and the repetition threshold to 0.9. For scarce label recognition, the number of labeled samples threshold can be set to 50, and the business scenario coverage threshold can be set to 3. The above thresholds are merely exemplary configurations and do not constitute a limitation on the scope of protection of this invention; in practical applications, the server can adjust the above thresholds according to the number of labels, sample size, business scenario complexity, field sensitivity level, and model training requirements of the target training task.
[0095] After determining the target meta-path, the server extracts the specific path instance of the target meta-path in the heterogeneous semantic graph. Each path instance can be represented as a sequence of nodes and a sequence of edge relationships. For example:
[0096] Sample A—Field F1—Data Object D1—Business Scenario B1;
[0097] Sample A—Field F2—Rule R1—Business Scenario B1;
[0098] Sample A—Data Object D1—Source System S1—Business Scenario B1.
[0099] The server organizes the path instance node sequence, edge relationship type, anchor sample identifier, scarce label identifier, business scenario identifier, rule node identifier, set of replaceable fields, set of splicable semantic fragments, set of structured slots, and evidence summary into a sample to expand the evidence chain.
[0100] The evidence chain for sample augmentation can be stored in a structured record format. For example, each evidence chain record should include at least: target meta-path identifier, path instance number, path instance node sequence, node type sequence, edge type sequence, anchor point sample identifier, corresponding scarce label, candidate field list, candidate semantic fragment, recombinable slot, evidence digest, sensitivity level, and availability status. The evidence digest can be represented by a hash digest, field source digest, rule source digest, or business scenario source digest, and is used for subsequent tracing and verification.
[0101] For example, in a healthcare data governance scenario, a scarce tag might be a sample that matches an anomaly rule in healthcare settlement. A target meta-path instance could include: a sample node "Healthcare Settlement Field Anomaly Sample 001", a field node "Settlement Amount", a rule node "Amount and Project Category Matching Rule", a business scenario node "Healthcare Settlement Audit", and a source system node "Healthcare Expense Settlement System". The server can use these nodes and edge relationships to form a sample-enhanced evidence chain. This chain records recombinable fields such as project category, settlement amount range, institution level, and settlement month, while also noting that fields such as personal identification, detailed address, and contact information are unavailable.
[0102] 3.4 Sample Expansion under the Constraint of the Chain of Evidence
[0103] S4 expands the evidence chain based on samples. While maintaining the traceability of scarce labels and target meta-paths, it performs field replacement, semantic fragment splicing, or structured slot reorganization on anchor samples to generate candidate expanded samples carrying source meta-paths, evidence nodes, and changed fragment tags.
[0104] Unlike ordinary data augmentation, the field replacement, semantic fragment splicing, and structured slot reorganization in this embodiment are all constrained by the sample augmentation evidence chain. The server does not arbitrarily replace words or randomly splice text, but performs augmentation under the conditions of scarce labels, target meta-paths, and traceable evidence nodes.
[0105] In the field replacement method, the server first determines the replaceable fields in the anchor sample. Replaceable fields are generally non-sensitive fields or fields that have been anonymized and are allowed to be used, such as business item type, organization level, regional level, time interval, field type, indicator name, rule name, project category, and data object name. The server then selects field values of the same type from instances of the same target metapath or adjacent path instances that satisfy the same target metapath, and uses these values to replace the corresponding fields in the anchor sample. After the replacement is complete, the server records the location of the replaced field, the field type before replacement, the source node of the replaced field, its target metapath, and the evidence summary.
[0106] For example, an anchor sample might be: In a medical insurance settlement review scenario, if the settlement amount field of the inpatient expense details table matches the item category rule, it should be classified as a medical insurance settlement anomaly sample. Within the same target meta-path instance, another path instance might involve the outpatient expense details table, the item category field, medical insurance settlement review, and the same rule node. The server can replace the inpatient expense details table with the outpatient expense details table and the settlement amount field with the item category field, while maintaining consistency between scarce tags and the business scenario, thus forming candidate expanded samples. If the replaced sample can still be traced back to the corresponding rule node and business scenario node along the target meta-path, the replacement can be retained for subsequent verification.
[0107] In the semantic fragment concatenation method, the server extracts semantic fragments related to the same scarce label, the same business scenario, or the same rule node from the evidence chain expanded by the sample, and concatenates them to the corresponding fragment positions in the anchor sample. Semantic fragments can come from field annotations, indicator definitions, rule descriptions, business process descriptions, or data directory descriptions. The concatenation process can be performed according to preset fragment types. For example, the matching rule description can be concatenated to the judgment basis position in the sample; the business scenario description can be concatenated to the scenario description position in the sample; and the source system description can be concatenated to the data source position in the sample. After concatenation, the server retains the source of the concatenated fragment, the fragment position, and the target meta-path identifier.
[0108] In the structured slot reorganization method, the server decomposes the anchor sample into several slots, such as data object slots, field slots, business scenario slots, rule slots, source system slots, and processing suggestion slots. The server expands the evidence chain with reorganizable fields based on the sample, writing the field values into the same slot template to form new structured samples. For data asset classification tasks, the slot template may include: data object name, field name, field description, source system, business scenario, rule hit summary, and candidate tags. For business intent recognition tasks, the slot template may include: user question, business scenario, involved objects, indicator words, time range, organizational scope, and candidate intent. After slot reorganization, the server records the field source tag and reorganization method tag for each slot.
[0109] When generating candidate augmented samples, the server needs to include the source metapath, evidence nodes, and change fragment markers in the samples. The source metapath records which target metapath the candidate augmented sample was generated from; the evidence node records the fields, rules, data objects, business scenarios, or source system information involved in the candidate augmented sample; and the change fragment marker records the position and manner of change of the candidate augmented sample relative to the anchor sample. These markers can be excluded from the model input or used as auxiliary fields during model training, depending on the training task. In most cases, to avoid excessive model reliance on generated markers, these markers can be stored in the sample management table and audit table, rather than being directly appended to the sample text.
[0110] 3.5 Multiple Validation and Training Set Input
[0111] S5 performs label consistency, path closure, repetition, and sensitive information verification on candidate augmented samples. Candidate augmented samples that pass the verification are added to the training set, while candidate augmented samples that fail the verification and the reasons for their failure are written to the fallback database.
[0112] Step S5 controls the conditions for candidate augmented samples to enter the training set. The server can perform label consistency verification, path closure verification, duplication verification, and sensitive information verification sequentially, or it can perform some verifications in parallel and then summarize the results.
[0113] Label consistency verification is used to determine whether candidate augmented samples still belong to scarce labels. In one implementation, the server uses a trained label discrimination model to predict candidate augmented samples and determines whether the predicted labels are consistent with the scarce labels. In another implementation, the server uses a rule discriminator to determine whether candidate augmented samples meet the rule conditions corresponding to the scarce labels. For example, if the scarce label is "quality rule hit class sample", then the candidate augmented samples should still contain the hit basis of that quality rule. For tasks with high security requirements or serious business consequences, the server can also push low-confidence samples to a manual review interface, and add them to the training set only after the review is passed.
[0114] Path closure verification is used to determine whether the sample node corresponding to the candidate expanded sample can still be connected to the evidence node, business scenario node, or rule node via the target meta-path. Specifically, the server can temporarily create sample nodes for the candidate expanded sample in the heterogeneous semantic graph and establish corresponding edges based on the fields, data objects, business scenarios, rules, and source systems in the candidate expanded sample. Subsequently, the server searches whether the candidate sample node can still be connected to the original evidence node or similar evidence nodes according to the target meta-path template. If the connection relationship is broken, for example, if the fields in the candidate expanded sample cannot be connected to the original business scenario after being replaced, or if the replaced rule node is no longer associated with the scarce label, then the candidate expanded sample fails the path closure verification.
[0115] Duplicate verification is used to prevent the generation of a large number of duplicate or near-duplicate samples. The server can identify duplicate samples based on text fingerprints, structured field fingerprints, or semantic vector similarity. Text fingerprints can be generated from word sequence summaries of sample text after removing stop words; structured field fingerprints can be generated by concatenating fields such as data objects, fields, rules, business scenarios, and source systems; semantic vector similarity can be calculated using text encoding models or sentence vector models.
[0116] To perform repeatability checks, candidate augmented samples can be used. With existing samples in the training set Perform similarity calculation. (Repetition) It can be determined based on text similarity and structured field similarity:
[0117]
[0118] In the formula, Expanding the sample for candidates Compared with existing samples Text semantic similarity, This is the similarity of structured fields between the two data objects, field names, rule nodes, business scenario nodes, and source system nodes. When the number of duplicates exceeds a preset threshold, the server determines the candidate augmentation sample. If a sample is a duplicate or nearly duplicate, it will not be added to the training set.
[0119] In one implementation, text semantic similarity The cosine similarity of the text encoding vectors can be used to determine this:
[0120]
[0121] In the formula, Expanding the sample for candidates The text encoding vector, For existing samples The text encoding vector, Represents the vector dot product. Represents the vector norm.
[0122] Structured field similarity This can be determined based on the degree of overlap in the structured field sets:
[0123]
[0124] In the formula, Expanding the sample for candidates A structured collection of fields. For existing samples The structured field set can include one or more of the following: data objects, field names, rule nodes, business scenario nodes, and source system nodes. When the structured field sets are completely identical, or when the text semantic similarity reaches a preset duplication threshold, the server can determine that the candidate expanded sample is a duplication or near-duplication with an existing sample.
[0125] Sensitive information verification is used to prevent prohibited fields from entering the training set. The server identifies the sensitivity level of fields in the candidate augmentation samples based on permission rules, blocks prohibited fields, and performs masking replacement or evidence index replacement. For fields that are not allowed to be used directly, the server can replace them with range-based numerical values, categorical descriptions, masked summaries, or evidence indexes. For example, a specific age can be replaced with an age range, a precise address can be replaced with a district / county-level administrative division, a personal identification identifier can be replaced with an irreversible summary or directly deleted, and the original medical record can be replaced with an authorized structured label or report index. If a candidate augmentation sample contains prohibited fields that cannot be replaced or deleted, that sample will not be added to the training set.
[0126] Once a candidate augmented sample passes the above verification, the server adds it to the training set and records the augmentation source, target meta-path, evidence node, changed fragment marker, verification result, and entry time. For candidate augmented samples that fail verification, the server writes them to the fallback database. The fallback database records the reasons for failure, such as inconsistent labels, incomplete path closure, excessive repetition, inclusion of prohibited fields, or missing evidence nodes. The fallback database can be used for subsequent manual review, rule adjustments, path template correction, or sample augmentation strategy optimization.
[0127] IV. System Implementation
[0128] like Figure 2 As shown in the figure, this embodiment of the invention also provides an automatic expansion system for small-sample training samples based on meta-path guidance. The system includes a data access module, a heterogeneous graph construction module, a meta-path filtering module, an evidence chain generation module, a sample expansion module, and a verification and storage module. The data access module is used to acquire labeled samples, unlabeled business data, and domain metadata of the target training task; the heterogeneous graph construction module is used to construct a heterogeneous semantic graph; the meta-path filtering module is used to identify scarce labels, filter candidate meta-paths, and determine the target meta-path; the evidence chain generation module is used to extract instances of the target meta-path and form a sample expansion evidence chain; the sample expansion module is used to generate candidate expansion samples based on the sample expansion evidence chain; the verification and storage module is used to perform label consistency, path closure, repetition, and sensitive information verification, and add candidate expansion samples that pass the verification to the training set, and write candidate expansion samples that fail the verification and the reasons for failure to the fallback database.
[0129] In specific deployments, the data access module can connect to a data catalog system, metadata management system, business database, file system, or annotation system; the heterogeneous graph construction module can be implemented based on a graph database or relational database; the meta-path filtering module can be implemented based on graph traversal algorithms, graph query languages, or custom path matching algorithms; the evidence chain generation module can use structured tables or document-oriented databases to store the evidence chain; the sample expansion module can be implemented using rule templates, field mapping tables, slot templates, and text processing programs; and the verification and storage module can connect to the permission management system, sensitive field identification component, model training platform, and manual review interface.
[0130] This invention also provides a computer-readable storage medium storing a computer program or instructions thereon, which, when executed by a processor, implements the above-described method for automatically expanding small training samples based on meta-path guidance.
[0131] V. Examples
[0132] 5.1 Example 1
[0133] This embodiment uses the data asset classification task in a government affairs and medical security data governance project as an example to illustrate the specific implementation process of the method of the present invention. The data in this embodiment are all anonymized test data; the field names, business scenario names, and category names are used to describe the implementation process and do not represent a limitation on the actual business system.
[0134] 5.1.1 Data Preparation
[0135] A data governance platform has integrated data directories and field dictionaries from several source systems. The target training task is to classify descriptive text of data assets. Classification labels include basic population data, legal entity data, public service data, medical insurance settlement data, drug and consumable data, risk monitoring data, and other data. Initially, 820 samples were labeled, including 38 samples corresponding to medical insurance settlement data, 27 samples corresponding to drug and consumable data, and 21 samples corresponding to risk monitoring data. All of these are below the preset threshold of 50 samples and are therefore identified as scarce labels.
[0136] Unlabeled business data includes table name, field names, field comments, data source system, related business scenarios, applicable data quality rules, and indicator definitions. Domain metadata includes a data directory table, field dictionary table, rule base, indicator base, list of source systems, list of business items, and sensitive field classification table.
[0137] 5.1.2 Construction of Heterogeneous Semantic Graphs
[0138] The server maps 820 labeled samples to sample nodes, each category label to label nodes, data tables, interfaces, and reports to data object nodes, fields in the field dictionary to field nodes, data quality rules and classification rules to rule nodes, business items and application scenarios to business scenario nodes, and business systems to source system nodes. The server establishes heterogeneous edges based on the field names, data object names, rule hit summaries, and source system information appearing in the samples.
[0139] For example, the sample "Settlement Amount, Pooled Payment Amount, and Individual Out-of-Pocket Amount fields in the Medical Insurance Expense Details Table are used for medical insurance settlement review" is mapped as a sample node; it is connected to the tag node "Medical Insurance Settlement Data"; connected to the field nodes "Settlement Amount", "Pocket Payment Amount", and "Individual Out-of-Pocket Amount"; connected to the data object node "Medical Insurance Expense Details Table"; connected to the business scenario node "Medical Insurance Settlement Review"; and connected to the source system node "Medical Insurance Settlement System". If the data object matches the "Non-negative Validation Rule for Amount Field" and the "Matching Rule between Item Category and Amount Range", then an edge is established between the sample node or field node and the corresponding rule node.
[0140] 5.1.3 Scarce Label Identification and Candidate Meta Path Selection
[0141] After counting the number of samples for each tag, the server identifies medical insurance settlement data, drug and consumable data, and risk monitoring data as scarce tags. Taking medical insurance settlement data as an example, the server reads the 38 anchor point samples corresponding to this tag and performs a path search from these sample nodes according to a preset meta-path template.
[0142] The server retrieved several candidate meta paths after the search. One of the candidate meta paths is:
[0143] Sample node — Field node — Rule node — Business scenario node.
[0144] This metapath covers 31 anchor point samples under the "Medical Insurance Settlement Data" label, and most of these path instances are connected to business scenarios such as medical insurance settlement review and medical insurance expense verification.
[0145] Another candidate meta path is: Sample node—Field node—Data object node—Source system node—Business scenario node.
[0146] The metapath covers 34 anchor point samples under the "Medical Insurance Settlement Data" label, but some of the path instances pass through source systems that contain unconfirmed data exchange sources. The server removes these path instances based on the source system list.
[0147] 5.1.4 Determining the Target Path and Forming the Evidence Chain for Sample Expansion
[0148] The server calculates metrics for candidate meta paths. Taking "Sample Node—Field Node—Rule Node—Business Scenario Node" as an example, this candidate meta path covers 31 anchor point samples. If the total number of anchor point samples corresponding to the "Medical Insurance Settlement Data" label is 38, then its path coverage is:
[0149]
[0150] Of all path instances, 0.89% of the samples were connected to the "Medical Insurance Settlement Data" tag, and the tag purity met the threshold. All path instances contained field nodes, rule nodes, and business scenario nodes, and the evidence integrity met the threshold. After removing path instances involving personal identification, the remaining fields were all business fields or fields that could be anonymized, and the availability of sensitive fields met the permission rules. Therefore, the server determined this candidate metapath as the target metapath.
[0151] Subsequently, the server extracts the target metapath instance and generates a sample-enhanced evidence chain. For example, an evidence chain record is as follows:
[0152] Target meta path identifier: MP-Medical Insurance-Field-Rule-Scenario;
[0153] Path instance node sequence: Sample 001—Settlement Amount Field—Project Category and Amount Range Matching Rules—Medical Insurance Settlement Review Scenario;
[0154] Edge relationship type: Sample contains fields, field matching rules, and applicable scenarios for the rules;
[0155] Anchor point sample identifier: Sample 001;
[0156] Scarcity label: Medical insurance settlement data;
[0157] Replaceable field set: Settlement amount field, Unified payment amount field, Project category field;
[0158] A collection of semantic fragments that can be concatenated: rule descriptions, field comments, and business scenario descriptions;
[0159] Structured slot collection: data object, field name, rule name, business scenario, source system;
[0160] Evidence digest: A digest value generated from field sources, rule sources, and business scenario sources;
[0161] Sensitive field status: Does not include prohibited fields.
[0162] 5.1.5 Generation of Candidate Augmented Samples
[0163] The server uses sample 001 as the anchor sample and performs field replacement and slot reorganization based on the aforementioned chain of evidence. The original content of the anchor sample is: the settlement amount field in the medical insurance expense details table matches the item category and amount range matching rules, which is applicable to medical insurance settlement audit scenarios.
[0164] The server selects the same type of field "unified payment amount field" and the data object "medical insurance inpatient settlement details table" under the same business scenario from the path instances of the same target meta path. Under the condition of maintaining the traceability of the "medical insurance settlement data" label and the target meta path, it generates candidate expanded samples: the unified payment amount field in the medical insurance inpatient settlement details table matches the project category and amount range matching rules, which is suitable for medical insurance settlement review scenarios.
[0165] The server simultaneously records the source metapath MP-medical insurance-field-rule-scenario. Evidence nodes include the pooled payment amount field, the matching rule between project category and amount range, and the medical insurance settlement audit scenario. Change fragment markers include data object replacement and field replacement.
[0166] For another anchor sample, the server uses a semantic fragment concatenation method to concatenate the "used to verify whether the item category and the cost amount range match" in the rule description into the judgment basis slot of the sample, forming a candidate expanded sample: the item category field and the settlement amount field in the medical insurance outpatient settlement details table are used together for medical insurance settlement review; the judgment basis is whether the item category and the cost amount range match.
[0167] The candidate expanded sample retains the evidence summary of the corresponding rule node and business scenario node, but does not contain personal identification.
[0168] 5.1.6 Validation of Candidate Augmented Samples
[0169] The server performs label consistency checks on the aforementioned candidate augmented samples. The discriminative model used for label consistency checks employs a text encoder and a fully connected classification layer structure. The input text includes data object names, field names, field descriptions, rule hit summaries, and business scenario descriptions, with a maximum input length of 256 characters or sub-word units. The text encoder can use a language model pre-trained on a general Chinese corpus or a domain-specific text encoding model trained within the enterprise. The classification layer is a two-layer fully connected network with a hidden dimension of 256 and an output dimension of the number of labels.
[0170] During training, pre-labeled samples are used, and the training, validation, and test sets are divided in a 7:1:2 ratio; the batch size is set to 16, and the learning rate is set to... The training run consists of 5 to 10 rounds, and training stops when the validation set loss fails to decrease for two consecutive rounds. The loss function uses class-weighted cross-entropy to reduce the impact of the majority class on the training process. The model described above provides the predicted labels and confidence scores for candidate augmented samples. When the predicted label matches the scarce label and the confidence score reaches a preset threshold, the candidate augmented sample passes the label consistency check. Samples with confidence scores below the threshold but complete rule matching can be entered into a manual review queue.
[0171] The aforementioned label consistency discrimination model is only one possible implementation and does not require the use of a specific neural network structure. In scenarios where the rules are clear, the sample size is small, or computing power is limited, rule discriminators, lightweight text classification models, keyword and field rule combination discrimination methods can also be used, or candidate expanded samples can be submitted to a manual review interface for label consistency confirmation; as long as it can be determined whether the candidate expanded samples are still consistent with the scarce labels, they can all be used to implement the label consistency verification process of this invention.
[0172] During path closure verification, the server temporarily maps candidate expanded samples as sample nodes and establishes edges between them and the pooled payment amount field, the matching rules for project category and amount range, and the medical insurance settlement review scenario. The server then searches whether the sample node still satisfies the target meta-path of "sample node—field node—rule node—business scenario node". If the search result indicates the existence of a closed path, the verification passes.
[0173] During duplicate verification, the server generates structured field fingerprints for candidate augmented samples. These fingerprints include the data object name, field name, rule name, and business scenario name. If a candidate augmented sample has the exact same field fingerprint as an existing sample in the training set, it is considered a duplicate. If the text semantic vector similarity is higher than a preset threshold and the structured field fingerprints are only slightly different, it is considered a near-duplicate. Duplicate or near-duplicate samples are not added to the training set.
[0174] During sensitive information verification, the server identifies whether prohibited fields such as personal identification, contact numbers, addresses, and original medical records appear in the candidate expanded samples based on a sensitive field classification table. If prohibited fields are found, they are de-identified and replaced; if replacement is not possible, the data is rejected from being entered into the database. In this embodiment, the aforementioned candidate expanded samples only contain data objects, fields, rules, and business scenario descriptions, and do not contain prohibited fields, therefore they pass the sensitive information verification.
[0175] After verification, the server adds the verified candidate augmented samples to the training set. For the scarce label "medical insurance settlement data," this embodiment expands from 38 initial samples to 92 usable training samples; for the scarce label "drug and consumable data," it expands from 27 initial samples to 76 usable training samples; and for the scarce label "risk monitoring data," it expands from 21 initial samples to 63 usable training samples. Candidate augmented samples that fail verification are written to the rollback database, and the reason for failure is recorded.
[0176] 5.1.7 Model Training and Usage
[0177] The expanded training set is used to train the target classification model. The target classification model can use the same structure as the label consistency discrimination model, or a lighter model more suitable for the deployment environment can be used. In this embodiment, the target classification model adopts a Chinese text encoder plus a classification layer structure. The input is obtained by concatenating the data object name, field list, field description, source system, business scenario, and rule summary, with a maximum length of 256. The training set includes the original labeled samples and the validated expanded samples; the validation and test sets use only manually labeled samples, without automatically expanded samples, to observe the impact of expanded samples on the classification effect of real samples. The training parameters are: batch size 16, learning rate... The training run consisted of 8 epochs, using AdamW as the optimizer with a weight decay of 0.01. Class weights were normalized based on the inverse of the number of samples in each class. After training, the model was used to classify newly accessed data asset description texts.
[0178] The parameters such as the structure, input length, number of training rounds, optimizer, and learning rate of the target classification model described above are only used to illustrate one feasible training method and do not limit the present invention to the use of this model structure. Those skilled in the art can implement the target training task by using support vector machines, gradient boosting trees, lightweight text classification models, pre-trained language models, or a combination of rules and models, depending on the deployment environment, sample size, and training task type.
[0179] 5.1.8 Comparative Test
[0180] To illustrate the impact of path constraints, evidence chains, and verification processes on the technical effectiveness in the embodiments of the present invention, the following comparative examples are provided.
[0181] Comparative Example 1: No sample augmentation was performed. This group used only 820 initially labeled samples to train the classification model.
[0182] Comparative Example 2: Text replacement augmentation was performed on the scarce label samples. This group performed synonym replacement, random field name replacement, and sentence rewriting, but did not construct heterogeneous semantic graphs, nor did it use meta-paths or chains of evidence.
[0183] Comparative Example 3: Meta-path sampling is used, but evidence chain constraints and path closure verification are not performed. This group constructs a heterogeneous semantic graph and extracts adjacent fields or business scenarios according to meta-paths, but does not record the evidence chain when generating samples, and does not verify whether candidate expanded samples can still be connected to evidence nodes along the target meta-path.
[0184] Example group: The small sample training sample automatic expansion method based on meta-path guidance described in Example 1 is used to expand the scarce label samples, and the candidate expanded samples that pass the verification of label consistency, path closure, repetition and sensitive information are added to the training set.
[0185] In this comparative test, the test set only used manually labeled samples and did not include automatically generated augmented samples to avoid the inclusion of augmented samples in the test set and affecting the evaluation results. All groups used the same target classification model structure, the same input fields, the same training parameters, and the same evaluation metrics during training. During manual sampling, candidate augmented samples with labels inconsistent with scarce labels, paths that could not be closed, fields that did not match the business scenario, rule nodes that were inconsistent with the business scenario, containing prohibited fields that could not be anonymized and replaced, or whose duplication with existing samples exceeded a preset threshold, were judged as unqualified augmented samples.
[0186] The test results for each group are shown in Table 1 below.
[0187] Table 1. Comparison of model recognition performance under different sample augmentation methods
[0188]
[0189] Among them, the macro average F1 value is the arithmetic mean of the F1 values of each label category, which is used to evaluate the overall recognition balance of the model across different categories. Since this indicator is not weighted by the number of samples, it is suitable for observing the impact of expanding scarce labels on the multi-category recognition effect.
[0190] As shown in Table 1, Comparative Example 1, without sample expansion, exhibited relatively stable classification results across most categories. However, due to the limited number of samples for scarce labels such as medical insurance settlement data, drug and consumable data, and risk monitoring data, the average recall rate for scarce labels was only 0.51. Comparative Example 2 increased the number of training samples through plain text replacement, raising the average recall rate for scarce labels to 0.58. However, due to the lack of constraints based on the relationships between data objects, fields, business scenarios, and rules, manual sampling revealed that some expanded samples had mismatches between fields and business scenarios, resulting in 13.6% of the expanded samples being deemed unqualified. Comparative Example 3, by introducing meta-path sampling, improved the domain relevance of the expanded samples, increasing the average recall rate for scarce labels to 0.62 and the macro average F1 score to 0.75. However, due to the lack of recording of the sample expansion evidence chain and the absence of path closure verification, incomplete path relationships still existed, such as fields originating from one business scenario while rule nodes originated from another. In manual sampling, samples with incomplete path relationships accounted for 7.8%.
[0191] The example group, building upon Comparative Example 3, further introduces target meta-path filtering, sample augmentation evidence chain, label consistency verification, path closure verification, repetition verification, and sensitive information verification. This ensures that candidate augmented samples maintain a traceable relationship with scarce labels, evidence nodes, and target meta-paths before being added to the training set. This group achieved an average recall rate of 0.69 for scarce labels, an average macro F1 score of 0.79, and a non-compliant augmented sample ratio of 2.4% in manual sampling. These results demonstrate that, under the same training model and initial sample conditions, the combined processing of target meta-path, sample augmentation evidence chain, and database entry verification can reduce the proportion of non-compliant augmented samples entering the training set and improve the recognition performance of scarce labels.
[0192] 5.2, Example 2
[0193] This embodiment uses a business intent recognition task as an example to illustrate the implementation of the method of the present invention in non-data asset classification tasks. A government data analysis platform needs to identify user intents such as data queries, indicator interpretations, report generation, quality verification, and data requests. In the initial labeled samples, the intent categories of "cross-departmental data request" and "indicator caliber verification" have relatively few samples, with 24 and 19 samples respectively.
[0194] When the server constructs a heterogeneous semantic graph, it maps user questions to sample nodes, intent categories to tag nodes, and related data tables, interfaces, metrics, business items, permission rules, and source systems to corresponding nodes. For the scarce tag "metric verification," the server filters out the target meta-path of "sample node—metric node—metric definition node—business scenario node." Target meta-path examples show that if a user question involves fragments such as "statistical period, definition explanation, applicable scope, and business scenario," and the path can connect to the corresponding metric definition node, then the sample can be used to expand the "metric verification" category.
[0195] After the server forms an evidence chain to expand the sample, it uses the anchor sample "Please check whether the statistical caliber of this month's medical insurance fund expenditure indicators is consistent with last month" as a basis. It then extracts recombinable fields such as drug procurement amount indicators, statistical periods, and applicable scope from instances of the same target metapath to generate candidate expanded samples: "Please check whether the statistical caliber of this quarter's drug procurement amount indicators is consistent with last quarter." This candidate sample carries the source metapath, indicator node, caliber node, and change fragment marker. The server verifies that it can still be connected to the drug procurement amount indicator and corresponding caliber node along the target metapath, and that the predicted label remains indicator caliber verification; therefore, it is added to the training set.
[0196] For cross-departmental data requests with scarce tags, the server filters the target meta-path from "sample node—data object node—permission rule node—business scenario node". If a candidate expansion sample contains unauthorized detail fields or personal identification fields, the sensitive information verification will write the sample to the fallback database and record the reason for failure as "containing prohibited fields" or "permission rule not met". In this way, the expansion process can adapt to the permission constraints and data request scenarios in business intent recognition tasks.
[0197] In terms of model structure, the business intent recognition model employs a text encoder, an intent classification layer, and an optional slot recognition layer. The text encoder extracts the semantic representation of the user's question; the intent classification layer outputs the intent category; and the slot recognition layer identifies slots such as metric names, time ranges, department names, and data object names. During training, the intent classification loss and slot recognition loss can be weighted and summed; if the target task only requires intent classification, the slot recognition layer can be omitted. Training data includes original labeled samples and validated augmented samples; the test set still uses manually labeled samples. Parameters can be set as follows: maximum input length 128, batch size 32, and learning rate... The training rounds are 6, the classification loss weight is 1, and the slot recognition loss weight is 0.5. The above structure and parameters are one possible implementation, and those skilled in the art can adjust them according to computing power and deployment requirements.
[0198] As can be seen from this embodiment, the method of the present invention does not depend on a fixed model structure. As long as the training task has labeled samples, unlabeled business data, and domain metadata that can construct heterogeneous semantic graphs, it can be implemented according to the process of scarce label identification, target meta-path determination, evidence chain generation, candidate expansion sample generation, and verification and storage.
[0199] 5.3, Example 3
[0200] This embodiment illustrates how the rollback database is used in a real system. After generating candidate augmented samples, if a sample fails verification, it is not directly deleted but written to the rollback database. The rollback database includes at least the candidate augmented sample identifier, anchor sample identifier, scarce tag, source metapath, evidence node, changed fragment marker, type of failed verification, reason for failure, generation time, and processing status.
[0201] For example, if a candidate expanded sample fails the path closure check and is rolled back to the database, the reason is: the candidate sample node cannot be connected to rule node R-023 via the target meta-path. Administrators or system tasks can check this reason to see if the meta-path template is too short, if the field mapping is incorrect, or if the rule node association is missing. As another example, if a candidate expanded sample fails the sensitive information check and is rolled back to the database, the reason is: field F-ID number is a prohibited field and no de-identification replacement rule is configured. Administrators can supplement the de-identification rule accordingly, or remove the field from the set of recombinable fields.
[0202] In subsequent sample expansion tasks, the server can read the reasons for failure from the rollback database and adjust the candidate metapath filtering conditions. For example, for metapath templates that fail multiple times due to path incompatibility, their priority can be reduced or they can be temporarily disabled; for field types that fail multiple times due to sensitive fields, they can be automatically added to the prohibited field set; for business scenarios that fail multiple times due to inconsistent labels, the label purity threshold can be adjusted or a manual review step can be added. Thus, the rollback database is not only used to record samples that have not been added to the database, but also to provide a basis for subsequent configuration corrections.
[0203] In one implementation, samples in the rollback database can be converted into usable samples after manual review. Manual reviewers can view candidate expanded samples, source metapaths, evidence nodes, modified fragment tags, and reasons for failure to determine if the sample can be modified and added to the database. If the manual review confirms that the sample label is correct and sensitive information has been processed, the server can resubmit the sample to the verification process. After successful verification, it will be added to the training set. This process ensures seamless integration between automatic expansion and manual review.
[0204] 5.4, Example 4
[0205] This embodiment describes the deployment method in an intranet or dedicated environment. The server can be deployed within the applicant's data governance platform, or in a dedicated cloud or local data center on the client's side. Labeled samples, unlabeled business data, and domain metadata are all stored in an intranet database. The heterogeneous semantic graph can be stored in a graph database, or it can be implemented using node tables, edge tables, and path instance tables in a relational database. If the client environment does not allow the use of externally pre-trained models, the label consistency discrimination model can be implemented using a locally trained text classification model or rule discriminator. If the client environment does not allow the external distribution of sample text, the system only generates candidate augmented samples locally and stores the evidence summary, path identifier, and verification results in a local audit table.
[0206] In resource-constrained environments, meta-path search can be performed in batches. The server can first search for paths to anchor points corresponding to scarce tags, and then cache candidate path instances. For large-scale heterogeneous semantic graphs, storage can be partitioned according to business domain, source system, or data object type. Paths are searched within each partition first, and then cross-partition paths are merged. For target meta-paths with a large number of path instances, maximum instance count, sampling ratio, or source system balanced sampling rules can be set to control computational costs.
[0207] In this embodiment, the sample expansion evidence chain can be implemented using the following data table structure: The main evidence chain table stores the evidence chain identifier, target meta-path identifier, scarce label, anchor sample identifier, and evidence summary; the evidence chain node table stores the evidence chain identifier, node identifier, node type, and node order; the evidence chain edge table stores the evidence chain identifier, starting node, ending node, and edge relationship type; the reconfigurable field table stores the field identifier, field type, sensitivity level, availability status, and source node; and the candidate sample table stores the candidate expanded sample content, source evidence chain, changed fragment marker, and verification status. With the above structure, those skilled in the art can implement the present invention in common database environments.
[0208] The above embodiments illustrate the implementation process of the present invention, but do not constitute a limitation on the scope of protection of the present invention. Those skilled in the art can, based on the disclosure in this specification, make adaptive adjustments to node types, edge relationship types, meta-path templates, verification thresholds, and training parameters according to different data governance scenarios, tagging systems, permission rules, and model deployment environments. These adjustments do not affect the implementation of the technical solution of the present invention.
Claims
1. A method for automatically expanding small training samples based on meta-path guidance, executed by a server, characterized in that, include: S1. Obtain labeled samples, unlabeled business data, and domain metadata for the target training task, and construct a heterogeneous semantic graph containing samples, labels, data objects, fields, metrics, business scenarios, rules, and source system nodes; S2. Identify scarce labels with a sample number lower than a preset threshold, and use the scarce labels and their labeled samples as anchor points to filter candidate meta-paths connecting sample nodes with business scenario nodes, rule nodes, or data object nodes from the heterogeneous semantic graph. S3. Determine the target meta path based on the path coverage, label purity, evidence integrity and sensitive field availability of the candidate meta paths, and extract the target meta path instances to form a sample augmented evidence chain containing the path instance node sequence, edge relationship type, evidence nodes and recombinable fields. S4. Based on the sample-based evidence chain expansion, while maintaining the traceability of scarce labels and target meta-paths, the anchor point samples are subjected to field replacement, semantic fragment splicing, or structured slot reorganization to generate candidate expanded samples carrying source meta-paths, evidence nodes, and changed fragment markers. S5. Verify the candidate augmented samples for label consistency, path closure, repetition and sensitive information. Add the candidate augmented samples that pass the verification to the training set, and write the candidate augmented samples that fail the verification and the reasons for failure to the fallback database. The determination of the target metapath includes: determining path coverage based on the number of anchor point samples covered by the candidate metapath; determining label purity based on the proportion of samples in the candidate metapath instance that match the scarce label; determining evidence integrity based on the completeness of evidence nodes, field nodes, and source system nodes in the candidate metapath instance; determining sensitive field availability based on the matching results of available fields in the candidate metapath instance with permission rules; and determining the target metapath as the candidate metapath whose path coverage reaches the path coverage threshold, label purity reaches the label purity threshold, evidence integrity reaches the evidence integrity threshold, and sensitive field availability reaches the preset availability threshold, and which does not contain fields that are prohibited from use and cannot be desensitized and replaced.
2. The method for automatic expansion of small training samples based on meta-path guidance according to claim 1, characterized in that, The target training tasks include one or more of the following: data asset classification, data quality problem identification, metadata entity extraction, indicator caliber matching, business intent identification, risk event identification, and data development task recommendation. The domain metadata includes one or more of the following: data catalog, data lineage, field dictionary, indicator definitions, quality rules, permission rules, source system records, and business process records.
3. The method for automatic expansion of small training samples based on meta-path guidance according to claim 1, characterized in that, In step S1, constructing a heterogeneous semantic graph includes: mapping labeled samples and unlabeled business data to sample nodes, mapping sample labeling results to tag nodes, mapping tables, interfaces, files, reports, or data products to data object nodes, and establishing heterogeneous edges based on field attribution relationships, indicator reference relationships, rule hit relationships, source system relationships, and business scenario relationships; the meta-path is a path template connected in the order of preset node types.
4. The method for automatic expansion of small training samples based on meta-path guidance according to claim 1, characterized in that, In step S2, identifying scarce labels includes: counting the number of labeled samples, the number of sample sources, and the number of business scenarios covered for each label; when the number of labeled samples for any label is lower than a preset threshold, or its number of business scenarios covered is lower than a preset coverage threshold, the label is identified as a scarce label; the number of sample sources is used to reflect whether the samples are concentrated from a single source system; And / or, the candidate meta path selection includes: starting from the labeled sample nodes corresponding to scarce tags, performing path search according to the preset node type order among sample nodes, field nodes, data object nodes, business scenario nodes, rule nodes, or source system nodes; eliminating paths containing prohibited fields, invalid source systems, or conflicting tag nodes to obtain candidate meta paths.
5. The method for automatic augmentation of small training samples based on meta-path guidance according to claim 1, characterized in that, In step S3, the sample expansion evidence chain includes target meta-path identifier, path instance node sequence, edge relationship type, anchor sample identifier, scarce label identifier, business scenario identifier, rule node identifier, set of replaceable fields, set of splicable semantic fragments, set of structured slots, and evidence summary; the evidence summary is used to record the source of fields, rule sources, or business scenario sources that support the generation of candidate expansion samples in the target meta-path instance.
6. The method for automatic augmentation of small training samples based on meta-path guidance according to claim 1, characterized in that, In step S4, field replacement includes: replacing non-sensitive fields in the anchor sample with the same type of field values in the same target meta-path instance while keeping the scarce label, business scenario node, and rule node unchanged; semantic fragment splicing includes: splicing semantic fragments related to the same scarce label and the same business scenario to the corresponding fragment positions in the anchor sample; structured slot reorganization includes: writing reorganizable fields into the same slot template as the anchor sample, and retaining the field source marker, fragment position marker, and reorganization method marker.
7. The method for automatic expansion of small training samples based on meta-path guidance according to claim 1, characterized in that, In step S5, the label consistency verification includes: obtaining the predicted labels of the candidate expanded samples through the label discrimination model, rule discriminator, or manual review interface, and determining whether they are consistent with the scarce labels; the path closure verification includes: determining whether the sample nodes corresponding to the candidate expanded samples can still be connected to the evidence nodes, business scenario nodes, or rule nodes through the target meta-path; the duplication verification includes: identifying duplicate samples based on text fingerprints, structured field fingerprints, or semantic vector similarity; and the sensitive information verification includes: identifying the sensitivity level of the fields in the candidate expanded samples, blocking prohibited fields, de-identifying and replacing them, or replacing the evidence index according to the permission rules.
8. A small-sample training sample automatic augmentation system based on meta-path guidance, characterized in that, The system for implementing the method according to any one of claims 1-7 comprises: The data access module is used to acquire labeled samples, unlabeled business data, and domain metadata for the target training task; The heterogeneous graph construction module is used to build heterogeneous semantic graphs that include samples, labels, data objects, fields, metrics, business scenarios, rules, and source system nodes. The meta-path filtering module is used to identify scarce labels and filter candidate meta-paths and determine target meta-paths using scarce labels and their labeled samples as anchor points. The evidence chain generation module is used to extract target meta-path instances and form sample-enhanced evidence chains. The sample augmentation module is used to generate candidate augmented samples based on the sample augmentation evidence chain. The verification and entry module is used to verify the candidate augmented samples for label consistency, path closure, repetition, and sensitive information. The candidate augmented samples that pass the verification are added to the training set, and the candidate augmented samples that fail the verification and the reasons for their failure are written to the fallback database.
9. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed by a processor, they implement the method described in any one of claims 1-7.
Citation Information
Patent Citations
Small sample intention recognition method based on data enhancement
CN115964486A
End-to-end semantic parsing system and training method
CN110084323A
Sample expansion method, apparatus and device, and computer readable storage medium
CN111460156A