Associated field reasoning method based on semantic model
By constructing a multi-dimensional semantically enhanced dataset and a Transformer-based semantic model, the semantic ambiguity and bias problems of related field reasoning in traditional methods are solved, enabling accurate association and rapid response in medical, financial, and e-commerce scenarios.
Patent Information
- Application Number
- CN202511463382.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-14
- Publication Date
- 2026-01-09
AI Technical Summary
In scenarios such as healthcare, finance, and e-commerce, existing technologies cannot effectively avoid semantic ambiguity in association field reasoning methods based on traditional semantic similarity models, leading to deviations in recommendation or association results and failing to meet real-time business needs.
A multi-dimensional semantic augmentation dataset is constructed, employing a Transformer-based semantic model, including a semantic fusion module, a causal semantic encoding module, and a symbolic and semantic fusion reasoning module. Through a multi-task training strategy and a dynamic adaptation mechanism, accurate matching and rapid response of associated fields are achieved.
It achieves accurate matching of related fields in scenarios such as healthcare, finance, and e-commerce, avoiding semantic ambiguity and business logic deviations, meeting real-time business needs, and providing rapid inference response.
Smart Images

Figure CN121303345A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of pipe brackets, and more particularly to a semantic model-based method for inferring related fields. Background Technology
[0002] In the field of related field reasoning, existing purely semantic-driven technical solutions generally rely on traditional semantic similarity models. They filter related fields by calculating the similarity between field text or basic semantic vectors. Their applications cover multiple scenarios such as medical care, finance, and e-commerce. For example, in medical scenarios, semantic matching based on chief complaint and examination items is used to recommend examination items; in financial scenarios, semantic matching is used to associate risk control indicators and early warning fields; and in e-commerce scenarios, semantic matching between product titles is used to recommend related products.
[0003] Traditional methods either fail to effectively avoid semantic ambiguity, such as confusing the meaning of the same medical field in outpatient and physical examination scenarios, or deviating from domain business rules in association logic, leading to biased recommendations of medical examination items, inaccurate association of financial risk control warning fields, and unreasonable matching of related products in e-commerce. Summary of the Invention
[0004] This application aims to at least partially address one of the technical problems in the related art.
[0005] Therefore, one objective of this application is to provide a semantic model-based inference method for related fields, which can make the matching of related fields more accurate in scenarios such as medical care, finance, and e-commerce. For example, it can accurately recommend examination items in medical care, accurately associate risk control and early warning fields in finance, and reasonably match related products in e-commerce, avoiding deviations caused by semantic ambiguity or associations that do not fit business logic; the inference response is fast and can meet real-time business needs.
[0006] To achieve the above objectives, the first aspect of this application proposes a method for inferring related fields based on a semantic model, comprising the following steps: S1: Construct a multi-dimensional semantically enhanced dataset, which integrates basic field information, contextual features, domain knowledge, and relationships; S2: Construct a semantic model, which includes a semantic fusion module, a causal semantic encoding module, and a symbolic and semantic fusion reasoning module. The semantic fusion module processes multimodal input and enhances context awareness. The causal semantic encoding module mines implicit relationships between fields. The symbolic and semantic fusion reasoning module realizes joint reasoning of semantic representation and domain rules. S3: The semantic model is trained using a multi-task training strategy. The training strategy covers semantic understanding tasks, causal association learning tasks, and rule adaptation tasks, and supports incremental learning for dynamic semantic changes. S4: Perform related field reasoning based on the trained semantic model. The reasoning process includes input semantic parsing, candidate field generation, rule filtering, and interpretable result output. S5: Establish a dynamic adaptation mechanism to trigger model updates by monitoring changes in field semantics, thereby achieving continuous optimization of the inference chain.
[0007] According to the semantic model-based association field reasoning method in the embodiments of this application, in scenarios such as medical care, finance, and e-commerce, it can make the matching of association fields more accurate. For example, medical care can accurately recommend examination items, financial care can accurately associate risk control and early warning fields, and e-commerce can reasonably match associated products, avoiding deviations caused by semantic ambiguity or associations that do not fit business logic; the reasoning response is fast and can meet real-time business needs.
[0008] In addition, the semantic model-based association field reasoning method proposed in this application may also have the following additional technical features: In one embodiment of this application, in step S1, the multi-dimensional semantic enhancement dataset specifically includes field basic semantic data, field contextual data, domain knowledge data, and field causal association data; The field contextual data includes the data source attribute to which the field belongs, the data generation scenario attribute, and the cross-field historical association attribute; The dataset construction also includes: performing semantic normalization on the basic semantic data of the fields, using a causal discovery algorithm to mine causal association data of the fields and labeling the association strength, and filtering noisy data through domain expert review and domain ontology library rule verification.
[0009] In one embodiment of this application, in step S2, the semantic model is based on the Transformer as its skeleton; The semantic fusion module is a multimodal semantic fusion layer that receives field text embedding vectors, context attribute embedding vectors, and multimodal feature embedding vectors. It assigns dynamic weights to relevant semantic tokens through a context attention mechanism and combines a domain semantic dictionary to achieve semantic error correction for ambiguity. The causal semantic encoding module is a causal semantic encoding layer that learns implicit causal relationships and generates causal-enhanced semantic vectors through a causal attention layer. The symbolic and semantic fusion reasoning module is a differentiable symbolic reasoning layer that transforms domain rules into differentiable logical expressions to achieve joint optimization of semantics and rules.
[0010] In one embodiment of this application, the contextual attention mechanism of the multimodal semantic fusion layer is implemented by introducing a contextual weight factor ω, which is dynamically adjusted according to the correlation between the field contextual attributes and the semantic token. The ambiguous semantic error correction is constrained by the domain semantic dictionary to ensure that the cosine similarity between the semantic vector of the ambiguous field and the standard semantic vector of the scene is not less than 0.8.
[0011] In one embodiment of this application, the implementation of the causal semantic coding layer includes: learning field causal links through a causal masking task, randomly masking 10%-20% of causal pairs and training with a contrastive loss function; The formula for the causal enhanced semantic vector is V_causal=V_original×α+V_cause×(1-α), where α is the causal association strength, V_original is the original semantic vector, and V_cause is the semantic vector of the associated field.
[0012] In one embodiment of this application, the differentiable symbolic inference layer includes a TensorLog framework for transforming domain rules, with the logical expression Rule(x,y)=sigmoid(Sem(x)・Sem(y)+θ), where θ is the rule threshold; During joint optimization, the weight ratio of symbol rule matching loss to semantic modeling loss is 0.4:0.6. The symbol rule matching loss adopts the binary cross-entropy loss, and the semantic modeling loss adopts the masked language model loss.
[0013] In one embodiment of this application, in step S3, the multi-task joint training strategy includes: Phased training: The first phase trains the multimodal semantic fusion layer and the contextual semantic masking task, with 10 training rounds; The second stage involves training the causal semantic coding layer and the causal link prediction task, with 5 training rounds. The third stage involves training the differentiable symbolic reasoning layer and the symbolic rule matching task, with 5 training rounds. The dynamic semantic drift adaptation task adopts an incremental training mechanism, freezing the multimodal semantic fusion layer of the semantic model and updating the causal semantic encoding layer and the differentiable symbolic reasoning layer.
[0014] In one embodiment of this application, step S4, the reasoning process includes: generating a context-fused semantic vector during the input parsing stage; During the candidate field generation stage, the Top 10 candidate set is filtered using the FAISS library index; The rule selection phase uses the ONNX format to accelerate symbolic reasoning; The output stage includes associated fields and their corresponding semantic similarity, rule numbers, and summaries.
[0015] In one embodiment of this application, in step S5, the semantic drift monitoring module identifies semantic changes through multiple indicators, including: Semantic similarity decay rate: Calculate the cosine similarity between the current field semantic vector and the historical semantic vector. If the similarity is less than 0.7, it is judged as semantic drift. Association frequency change rate: The historical association frequency between a statistical field and other fields. If the change exceeds 50% in a short period of time, it is determined that the association scenario has changed. The dynamic adaptation mechanism also includes collaborative deployment between the edge and the cloud: a lightweight semantic model is deployed at the edge and quantized into FP16 format using TensorRT; The complete semantic model is deployed in the cloud for batch inference and incremental training parameter generation, while the edge devices periodically synchronize semantic drift data to the cloud and obtain updated parameters.
[0016] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0017] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 This is a system block diagram of the semantic model-based association field reasoning method according to this application; Figure 2 This is a system block diagram for constructing a semantic model in the semantic model-based association field reasoning method according to this application; Figure 3 This is a system block diagram of the association field reasoning method based on the semantic model according to this application; Figure 4 This is a block diagram of a dynamic adaptation system in a semantic model-based association field reasoning method according to another embodiment of this application. Detailed Implementation
[0018] Embodiments of this application are described in detail below. Examples of these embodiments are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application. Rather, embodiments of this application include all variations, modifications, and equivalents falling within the spirit and scope of the appended claims.
[0019] The semantic model-based association field reasoning method of this application embodiment will be described below with reference to the accompanying drawings.
[0020] like Figures 1-4 As shown, the semantic model-based association field reasoning method of this application includes the following steps: S1: Construct a multi-dimensional semantically enhanced dataset that integrates basic field information, contextual features, domain knowledge, and relationships. S2: Construct a semantic model, which includes a semantic fusion module, a causal semantic encoding module, and a symbolic and semantic fusion reasoning module. The semantic fusion module processes multimodal input and enhances context awareness. The causal semantic encoding module mines implicit relationships between fields. The symbolic and semantic fusion reasoning module realizes joint reasoning of semantic representation and domain rules. S3: The semantic model is trained using a multi-task training strategy. The training strategy covers semantic understanding tasks, causal association learning tasks, and rule adaptation tasks, and supports incremental learning for dynamic semantic changes. S4: Perform related field reasoning based on the trained semantic model. The reasoning process includes input semantic parsing, candidate field generation, rule filtering, and interpretable result output. S5: Establish a dynamic adaptation mechanism to trigger model updates by monitoring changes in field semantics, thereby achieving continuous optimization of the inference chain.
[0021] The S1 multi-dimensional semantic augmented dataset construction breaks through the limitations of traditional single-field datasets.
[0022] By integrating basic field information (such as field text and data type), contextual features (such as the data source and generation scenario), domain knowledge (such as industry ontology rules), and relationships (such as explicit / implicit relationships between fields), a semantically complete, scenario-adaptable, and knowledge-rich input foundation is provided for subsequent models.
[0023] The construction of the S2 semantic model is the stage of building the carrier of the method.
[0024] The three modules collaborate in a hierarchical manner according to the logic of "semantic understanding → association mining → rule constraint": the semantic fusion module first performs contextual processing on multimodal inputs (such as text, numerical values, and image features), and eliminates field ambiguity by enhancing context awareness (such as the semantic distinction of "apple" in medical / e-commerce scenarios). Building upon this foundation, the causal semantic encoding module further explores implicit relationships between fields that are not explicitly presented (such as "user browsing diapers → potentially related to wet wipes field"), thus overcoming the shortcomings of traditional reasoning that relies solely on explicit relationships. The symbolic and semantic fusion reasoning module integrates domain business rules (such as medical diagnosis and treatment standards and financial risk control rules) into semantic reasoning, thus preventing semantic reasoning from deviating from actual business logic.
[0025] The S3 multi-task training strategy is a crucial step in developing model capabilities.
[0026] By using multi-task collaborative training (semantic understanding task to solidify basic semantic capabilities, causal association learning task to enhance implicit association mining capabilities, and rule adaptation task to ensure that reasoning conforms to domain rules), the model can simultaneously master multi-dimensional capabilities, avoiding the ability imbalance caused by single-task training. Meanwhile, the "incremental learning of dynamic semantic changes" design reserves an interface for subsequent optimization in advance, so that the model can adapt to semantic changes without full retraining, balancing training effect and efficiency.
[0027] S4 related field inference execution is a practical application of model capabilities.
[0028] The reasoning process proceeds in the order of "precise analysis → preliminary screening → strict filtering → reliable output": input semantic analysis transforms the original input into a contextualized semantic vector that the model can recognize, ensuring that the input is understood without bias; Candidate field generation uses semantic similarity calculation to initially identify potentially related fields, thus narrowing down the scope of inference; Rule-based filtering combines domain rules to perform logical validation on candidate fields, eliminating fields that are semantically similar but irrelevant to the business (such as "high blood sugar → exclude cold medicine" in a medical scenario). Interpretable output provides semantic basis (such as similarity values) and rule basis (such as industry standard numbers), solving the "black box" problem of traditional reasoning.
[0029] The establishment of the S5 dynamic adaptation mechanism ensures the continued applicability of the method.
[0030] It is by monitoring changes in field semantics in real time (such as semantic drift and changes in associated scenarios) to promptly identify the risk of failure in the model's reasoning ability; Once the monitoring threshold is triggered, the model update is immediately initiated (e.g., adjusting parameters based on incremental learning). Through collaboration between the edge (lightweight model to ensure real-time inference) and the cloud (complete model to support batch training), a balance is struck between "real-time response" and "update quality" to ensure that the inference chain always adapts to business changes and achieves long-term stable inference performance.
[0031] In one embodiment of this application, in step S1, the multi-dimensional semantic enhancement dataset specifically includes field basic semantic data, field contextual data, domain knowledge data, and field causal relationship data; Field contextual data includes the data source attribute to which the field belongs, the data generation scenario attribute, and cross-field historical association attributes; The dataset construction also includes: semantic normalization of the basic semantic data of the fields, mining causal association data of the fields and labeling the association strength using causal discovery algorithms, and filtering noisy data through domain expert review and domain ontology rule verification.
[0032] In practice, it is necessary to first collect scattered raw field data for the target application scenario (such as medical and financial), and then perform structured decomposition according to four dimensions: "basic semantics - context - domain knowledge - causal relationship". The basic semantic data of the fields corresponds to the core information of the fields in the raw data (such as the text and numerical type of the "blood sugar" field in the medical scenario), which is the basis for subsequent semantic understanding. Field contextual data needs to be extracted from business system logs and data lineage information (such as the "blood sugar" field coming from the outpatient HIS system, generated in the context of diabetes follow-up visits, and often associated with "glycated hemoglobin" in the past) to solve the problem of semantic ambiguity caused by traditional data being out of context, such as avoiding confusion between "blood sugar" in outpatient scenarios and "blood sugar" in physical examination scenarios.
[0033] In the practical aspects of data processing, semantic normalization is a key preprocessing step.
[0034] In practical applications, fields with the same semantic meaning often have different expressions due to differences in business systems (such as "non-performing loan rate" and "bad debt rate" in financial scenarios, and "FBG" and "fasting blood glucose" in medical scenarios). It is necessary to eliminate the expression differences by using unified field identifiers (such as mapping to industry standard terms) to ensure that the model receives standardized input with the same synonyms and identifiers, and avoid semantic misunderstanding caused by confusing expressions.
[0035] Mining causal data requires selecting an algorithm based on the characteristics of the business data (e.g., using causal forest for medical data and PC algorithm for financial data). Implicit causal relationships (e.g., "browsing baby diapers → subsequently purchasing baby wipes") should be mined from historical business data (e.g., user behavior logs and medical records). The strength of the association should be labeled (e.g., strong association 0.8, weak association 0.3) to provide a basis for "association priority" for the model.
[0036] The data quality assurance process combines algorithm verification with manual review.
[0037] In practical use, obvious erroneous data is first automatically filtered out using rules from domain ontology libraries (such as SNOMEDCT for medical data and FIBO for financial data). For example, "blood glucose level of 100 mmol / L" in medical data is outside the reasonable range of medicine, and "debt rate of -5%" in financial data is logically incorrect. Then, domain experts review the ambiguous data that is difficult for the algorithm to identify (such as the reasonableness of the association between "patient's complaint of polydipsia and polyuria" and "blood glucose"). Finally, an unambiguous, rule-compliant, and reliable dataset is formed. This dataset can not only directly improve the semantic understanding accuracy of subsequent models, but also avoid inference errors caused by data noise.
[0038] In one embodiment of this application, in step S2, the semantic model is based on the Transformer as the basic skeleton; the semantic fusion module is a multimodal semantic fusion layer that receives field text embedding vectors, context attribute embedding vectors and multimodal feature embedding vectors, assigns dynamic weights to relevant semantic tokens through a context attention mechanism, and achieves ambiguous semantic error correction by combining a domain semantic dictionary; The causal semantic encoding module is a causal semantic encoding layer that learns implicit causal relationships and generates causal-enhanced semantic vectors through a causal attention layer. The symbolic and semantic fusion reasoning module is a differentiable symbolic reasoning layer that transforms domain rules into differentiable logical expressions to achieve joint optimization of semantics and rules.
[0039] From the perspective of basic framework selection, the application of Transformer is adapted and adjusted according to the needs of the scenario: if the application scenario is the edge (such as real-time inference in outpatient clinics), lightweight Transformer variants (such as DistilBERT) will be preferred to balance computing power consumption and semantic capture capabilities. For cloud-based batch inference (such as nighttime medical data correlation analysis and financial risk control batch review), a more complex BERT-base or industry-customized version (BioBERT for medical use and FinBERT for financial use) can be used to enhance the accuracy of domain semantic understanding. This is to avoid delays in edge inference due to an overly cumbersome model or insufficient capture of complex domain semantics due to an overly simplistic model.
[0040] The practical operation of the multimodal semantic fusion layer lies in the collaboration of multi-source vectors and contextualized semantic calibration: In practice, field text embedding vectors need to be generated by domain pre-trained models (e.g., in medical scenarios, BioBERT is used to convert "blood sugar" into a 768-dimensional vector), and contextual attribute embedding vectors need to be extracted from data metadata (e.g., the system to which the field belongs, the generation time, and historical related records) (e.g., the "blood sugar" field comes from the outpatient HIS system, the generation scenario is a follow-up visit for diabetes, corresponding to a 256-dimensional contextual vector), and multimodal feature vectors need to be processed specifically (e.g., in medical scenarios, X-ray images are extracted with ResNet to obtain 256-dimensional features, and in financial scenarios, the "loan amount" value is mapped to a 256-dimensional vector using a linear layer).
[0041] The dynamic weight assignment of the contextual attention mechanism will be combined with the priority of business scenarios: for example, in the medical scenario, the semantic token of the "fever" field will give higher weight (0.8-0.9) to context-related tokens such as "white blood cell count" and "C-reactive protein", and lower weight (0.1-0.2) to non-core tokens such as "cold medicine". Ambiguity correction requires integration with domain-specific semantic dictionaries (such as medical terminology databases and financial terminology databases). For example, in a medical context, if the field "apple" appears in the context of "drug ingredients", its semantic vector will be forced to shift towards "malic acid (drug excipient)", completely avoiding semantic confusion with "fruit apple" and solving the problem of misjudging semantics when the traditional model is out of context.
[0042] In practical applications of the causal semantic coding layer, the training of the causal attention layer needs to be based on real business data in the domain to design tasks. Taking e-commerce scenarios as an example, real causal links such as "browsing baby diapers → adding baby wipes to the shopping cart" and "searching notebooks → viewing the mouse" are extracted from user behavior logs. 10%-20% of the links are randomly masked and the model is allowed to predict them. The sensitivity of the model to causal relationships is enhanced by comparing the loss function (positive samples are real causal pairs, and negative samples are non-causal pairs such as "browsing diapers → viewing the phone"). The generation of causal-enhanced semantic vectors requires combining domain statistics to label the causal strength (e.g., in e-commerce scenarios, the association strength of "diapers → wipes" is labeled as 0.8, based on historical purchase conversion rate statistics). The final generated semantic vector of "diapers" will be integrated with the semantic features of "wipes" (weight 0.2) to ensure that the model prioritizes associating fields with causal logic during inference, rather than relying solely on semantic similarity (e.g., avoiding misassociating "diapers" with "adult diapers").
[0043] The practical application of the symbolic and semantic fusion reasoning layer is to integrate domain rules into semantic reasoning. In actual implementation, domain business rules (such as "fasting blood glucose > 7.0 mmol / L in medicine → need to be associated with glycated hemoglobin test" in medical field, and "non-performing loan ratio > 5% in finance → need to be associated with risk reserve provision") need to be transformed into machine-recognizable structured rules. Then, tools such as TensorLog are used to translate them into differentiable logical expressions (such as medical rules translated into Rule(blood glucose, glycated hemoglobin) = sigmoid(Sem(blood glucose)·Sem(glycated hemoglobin) + 0.6), where the threshold of 0.6 is calibrated by clinical guidelines.
[0044] The joint optimization process needs to adjust the loss weights according to the domain's requirements for rule compliance: for example, the medical scenario has higher requirements for the rigor of rules, so the weight of symbol rule matching loss will be set to 0.5 (semantic modeling loss 0.5) to ensure that the model's reasoning does not violate clinical norms; In financial scenarios where semantic flexibility and rule compliance need to be balanced, the rule loss weight is set to 0.4 (semantic loss 0.6), so that the inference results can both conform to the domain business logic and flexibly respond to semantic changes.
[0045] In this embodiment, the contextual attention mechanism of the multimodal semantic fusion layer is further implemented by introducing a contextual weight factor ω, which is dynamically adjusted according to the correlation between the field contextual attributes and the semantic token. Ambiguity semantic correction uses domain semantic dictionary constraints to ensure that the cosine similarity between the semantic vector of the ambiguous field and the standard semantic vector of the scene is no less than 0.8.
[0046] Contextual attention mechanism (ω factor): In actual use, the relevance between the verb and semantic tokens will be calculated according to the business scenario. For example, in the medical and pediatric scenario, "fever" will focus on core tokens such as "blood routine" (ω set to 0.7-0.9), while weakening irrelevant tokens (such as "tumor detection", ω set to 0.1-0.2), to ensure that the semantics focus on the business priorities.
[0047] Ambiguity semantic correction: First, it connects to the authoritative dictionary in the domain. After the model generates the semantic vector of the ambiguous field (such as "apple"), it calculates the similarity with the scene standard vector (medical → "malic acid", e-commerce → "fruit apple"). If the similarity is less than 0.8, the vector is automatically calibrated until it conforms to the scene semantics to avoid misunderstanding.
[0048] In this embodiment, the implementation of the causal semantic coding layer includes: learning the causal links of the field through a causal masking task, randomly masking 10%-20% of the causal pairs and training with a contrastive loss function; The formula for the causal enhanced semantic vector is V_causal=V_original×α+V_cause×(1-α), where α is the causal association strength, V_original is the original semantic vector, and V_cause is the semantic vector of the associated field.
[0049] Specifically, the causal relationship strength α is calculated from business data. For example, in a medical scenario, if the probability of a patient with "high blood sugar" subsequently undergoing "glycated hemoglobin testing" is 85%, then α is set to 0.85; in an e-commerce scenario, if the conversion rate of "browsing diapers" and then adding "wipes" to the cart is 70%, then α is set to 0.7.
[0050] If the causal relationship is weak (e.g., the conversion rate of "browsing shirts → adding ties to cart" is 30%), then α should be set to 0.3 to ensure that strong causal relationships are combined more often and weak causal relationships are combined less often.
[0051] V_original and V_cause must also correspond to business semantics: V_original is the original semantic vector of the "cause field" (such as the vector generated by the medical pre-trained model for "high blood sugar"), and V_cause is the semantic vector of the "effect field" (such as the vector for "glycated hemoglobin detection").
[0052] After calculating V_causal, it is not used only once, but to replace the original "cause field" vector. When the model performs association inference, it uses a semantic vector with causal information. For example, in the medical scenario, the V_causal of "high blood sugar" incorporates the semantic features of "glycated hemoglobin detection". In subsequent inference, this field will be associated first, instead of just looking at semantic similarity as in traditional models (for example, it will not mistakenly associate with fields like "blood glucose test strips" that are semantically similar but have no strong causal relationship).
[0053] In practical use, α also needs to be updated regularly: for example, in e-commerce scenarios, the conversion rate of "browsing down jackets" → "adding scarves to cart" rises to 80% in winter (from 60% before), so α is changed from 0.6 to 0.8, so that the causal weights of vector fusion follow the business changes and ensure that the model captures causal relationships without lag.
[0054] In this embodiment, the differentiable symbolic inference layer includes the TensorLog framework for transforming domain rules, with the logical expression Rule(x,y)=sigmoid(Sem(x)・Sem(y)+θ), where θ is the rule threshold. During joint optimization, the weight ratio of symbol rule matching loss to semantic modeling loss is 0.4:0.6. The symbol rule matching loss adopts the binary cross-entropy loss, and the semantic modeling loss adopts the masked language model loss.
[0055] First, break down the business rules (such as medical "blood sugar > 7 → check glycated hemoglobin") into a structured form of condition field + target field, and then use TensorLog to convert it into the formula Rule(x,y)=sigmoid(Sem(x)・Sem(y)+θ).
[0056] The θ value is calibrated according to the strictness of the domain rules: In scenarios with strong rules, such as medical care (e.g., diagnostic standards), θ is set high (e.g., 0.6) to ensure rigorous correlation; in scenarios with non-mandatory rules, θ can be relaxed (e.g., 0.4) to retain flexibility.
[0057] In one embodiment of this application, step S3, the multi-task joint training strategy includes: Phased training: The first phase trains the multimodal semantic fusion layer and the contextual semantic masking task, with 10 training rounds; The second stage involves training the causal semantic coding layer and the causal link prediction task, with 5 training rounds. The third stage involves training the differentiable symbolic reasoning layer and the symbolic rule matching task, with 5 training rounds. The dynamic semantic drift adaptation task adopts an incremental training mechanism, freezing the multimodal semantic fusion layer of the semantic model and updating the causal semantic encoding layer and the differentiable symbolic reasoning layer.
[0058] In the first stage, the priority is to enable the model to master the basic ability to understand the semantics of fields in conjunction with context. The number of rounds is set more because context fusion requires learning a large number of scene features. The second stage, based on the semantic understanding capabilities already acquired, specifically strengthens the ability to mine implicit causality in fields. The number of rounds is reduced because the semantic foundation of the first stage can be reused in causal relationship learning. The third stage of training integrates domain rules to ensure that the model, based on understanding semantics and mastering causality, produces inference results that conform to business specifications, with rounds consistent with the causal layer, and that rule adaptation relies on the accumulated capabilities of the first two layers.
[0059] Incremental training with dynamic semantic drift will freeze the multimodal semantic fusion layer when it detects changes in field semantics (such as new medical diagnosis and treatment terms or adjustments to financial regulatory indicators) because its basic contextual ability is relatively stable and retraining is likely to destroy existing knowledge. Only the causal semantic encoding layer (to adapt to new causal relationships) and the differentiable symbolic reasoning layer (to adapt to new rules) will be updated.
[0060] It should be noted that in practice, the number of rounds can be fine-tuned according to the amount of data (e.g., 2-3 rounds can be reduced in small sample scenarios), but the phased order and the "freeze-update" logic of incremental training must be strictly followed to ensure that the model's capabilities are progressive and adapt to changes efficiently.
[0061] In one embodiment of this application, in step S4, the reasoning process includes: generating a context-fused semantic vector during the input parsing stage; During the candidate field generation stage, the Top 10 candidate set is filtered using the FAISS library index; The rule selection phase uses the ONNX format to accelerate symbolic reasoning; The output stage includes associated fields and their corresponding semantic similarity, rule numbers, and summaries.
[0062] Specifically, input parsing: generates context-integrated semantic vectors based on business scenarios to avoid misunderstandings that are divorced from the actual background; Candidate generation: Using the FAISS library for vector indexing, we can quickly filter the top 10 fields with the closest semantics to adapt to real-time scenarios; Rule filtering: Convert the symbolic inference layer to ONNX format to accommodate both edge and cloud deployments; Output results include semantic similarity, rule number, and summary, in addition to the associated fields, making the reasoning logic traceable.
[0063] In one embodiment of this application, in step S5, the semantic drift monitoring module identifies semantic changes through multiple indicators, including: Semantic similarity decay rate: Calculate the cosine similarity between the current field semantic vector and the historical semantic vector. If the similarity is less than 0.7, it is judged as semantic drift. Association frequency change rate: The historical association frequency between a statistical field and other fields. If the change exceeds 50% in a short period of time, it is determined that the association scenario has changed. The dynamic adaptation mechanism also includes collaborative deployment between the edge and the cloud: a lightweight semantic model is deployed at the edge and quantized into FP16 format using TensorRT; The complete semantic model is deployed in the cloud for batch inference and incremental training parameter generation, while the edge devices periodically synchronize semantic drift data to the cloud and obtain updated parameters.
[0064] In practical applications, semantic drift monitoring needs to be implemented in conjunction with business rhythm: calculate the cosine similarity between the current and historical semantic vectors of a field daily, and immediately determine semantic drift if it falls below 0.7; at the same time, count the frequency of field associations using a 7-day short-term window, and identify changes in the associated scenario if the fluctuation exceeds 50%.
[0065] Edge-cloud collaboration emphasizes a balance between efficiency and real-time performance: lightweight FP16 models quantized with TensorRT are used at the edge to ensure real-time inference. The cloud processes batch data and generates incremental training parameters using a complete model, while the edge device synchronizes drifting data and updates parameters during off-peak hours each day, ensuring that services are not affected and that changes can be adapted to in a timely manner.
[0066] The semantic model-based association field reasoning method of this application, in practical use, First, prepare domain data: Collect raw field data from business systems (such as medical HIS and financial risk control platforms), split them according to "basic semantics - context - domain knowledge - causal relationship", unify fields with the same meaning but different names (such as unifying "FBG" in medical terms as "fasting blood glucose"), and then filter out erroneous data through algorithm verification and expert review to obtain a high-quality dataset.
[0067] Next, we build an adaptation model: using Transformer as the skeleton, lightweight models (such as DistilBERT) are used at the edge to ensure real-time performance, and domain-customized versions (such as BioBERT for medical use) are used in the cloud to enhance semantic understanding; the modules are built in three layers: semantic fusion processes multi-source vectors and corrects ambiguity, causal encoding mines implicit associations and generates causal enhancement vectors, and symbolic reasoning converts business rules into differentiable formulas (with parameters calibrated according to the domain).
[0068] Then, model training is performed in three progressive stages: first, semantic understanding is trained; then, causal mining is trained; and finally, rules are integrated. When semantic changes occur, the semantic module is frozen, and only the causal and symbol modules are updated, without full retraining.
[0069] The inference process follows a four-step procedure: the input is combined with the scenario to generate a semantic vector, the top 10 candidate fields are screened using FAISS, the rule filtering is accelerated using ONNX, and the output includes semantic similarity and rule number to ensure traceability.
[0070] Finally, dynamic adaptation: daily monitoring of field semantics (similarity <0.7 indicates drift) and association frequency (7-day fluctuation >50% indicates scenario change); lightweight models are used for real-time inference at the edge, data is processed in batches in the cloud and updated parameters are generated, and data is updated synchronously at the edge during off-peak hours to ensure long-term adaptation to business.
[0071] In summary, the semantic model-based association field reasoning method of this application can make the matching of association fields more accurate in scenarios such as medical care, finance, and e-commerce. For example, it can accurately recommend examination items in medical care, accurately associate risk control and early warning fields in finance, and reasonably match related products in e-commerce, avoiding deviations caused by semantic ambiguity or associations that do not fit business logic; the reasoning response is fast and can meet real-time business needs.
[0072] In the description of this specification, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0073] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0074] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A semantic model-based method for inferring related fields, characterized in that, Includes the following steps: S1: Construct a multi-dimensional semantically enhanced dataset, which integrates basic field information, contextual features, domain knowledge, and relationships; S2: Construct a semantic model, which includes a semantic fusion module, a causal semantic encoding module, and a symbolic and semantic fusion reasoning module. The semantic fusion module processes multimodal input and enhances context awareness. The causal semantic encoding module mines implicit relationships between fields. The symbolic and semantic fusion reasoning module realizes joint reasoning of semantic representation and domain rules. S3: The semantic model is trained using a multi-task training strategy. The training strategy covers semantic understanding tasks, causal association learning tasks, and rule adaptation tasks, and supports incremental learning for dynamic semantic changes. S4: Perform related field reasoning based on the trained semantic model. The reasoning process includes input semantic parsing, candidate field generation, rule filtering, and interpretable result output. S5: Establish a dynamic adaptation mechanism to trigger model updates by monitoring changes in field semantics, thereby achieving continuous optimization of the inference chain.
2. The method according to claim 1, characterized in that, In step S1, the multi-dimensional semantic enhancement dataset specifically includes field basic semantic data, field contextual data, domain knowledge data, and field causal relationship data; The field contextual data includes the data source attribute to which the field belongs, the data generation scenario attribute, and the cross-field historical association attribute; The dataset construction also includes: performing semantic normalization on the basic semantic data of the fields, using a causal discovery algorithm to mine causal association data of the fields and labeling the association strength, and filtering noisy data through domain expert review and domain ontology library rule verification.
3. The method according to claim 1, characterized in that, In step S2, the semantic model is based on the Transformer as its framework; The semantic fusion module is a multimodal semantic fusion layer that receives field text embedding vectors, context attribute embedding vectors, and multimodal feature embedding vectors. It assigns dynamic weights to relevant semantic tokens through a context attention mechanism and combines a domain semantic dictionary to achieve semantic error correction for ambiguity. The causal semantic encoding module is a causal semantic encoding layer that learns implicit causal relationships and generates causal-enhanced semantic vectors through a causal attention layer. The symbolic and semantic fusion reasoning module is a differentiable symbolic reasoning layer that transforms domain rules into differentiable logical expressions to achieve joint optimization of semantics and rules.
4. The method according to claim 3, characterized in that, The contextual attention mechanism of the multimodal semantic fusion layer is implemented by introducing a contextual weight factor ω, which is dynamically adjusted according to the correlation between the field contextual attributes and the semantic token. The ambiguous semantic error correction is constrained by the domain semantic dictionary to ensure that the cosine similarity between the semantic vector of the ambiguous field and the standard semantic vector of the scene is not less than 0.
8.
5. The method according to claim 3, characterized in that, The implementation of the causal semantic coding layer includes: learning the causal links of fields through a causal masking task, randomly masking 10%-20% of causal pairs and training with a contrastive loss function; The formula for the causal enhanced semantic vector is V_causal=V_original×α+V_cause×(1-α), where α is the causal association strength, V_original is the original semantic vector, and V_cause is the semantic vector of the associated field.
6. The method according to claim 3, characterized in that, The differentiable symbolic inference layer includes the TensorLog framework for transforming domain rules, with the logical expression being Rule(x,y)=sigmoid(Sem(x)・Sem(y)+θ), where θ is the rule threshold. During joint optimization, the weight ratio of symbol rule matching loss to semantic modeling loss is 0.4:0.
6. The symbol rule matching loss adopts the binary cross-entropy loss, and the semantic modeling loss adopts the masked language model loss.
7. The method according to claim 1, characterized in that, In step S3, the multi-task joint training strategy includes: Phased training: The first phase trains the multimodal semantic fusion layer and the contextual semantic masking task, with 10 training rounds; The second stage involves training the causal semantic coding layer and the causal link prediction task, with 5 training rounds. The third stage involves training the differentiable symbolic reasoning layer and the symbolic rule matching task, with 5 training rounds. The dynamic semantic drift adaptation task adopts an incremental training mechanism, freezing the multimodal semantic fusion layer of the semantic model and updating the causal semantic encoding layer and the differentiable symbolic reasoning layer.
8. The method according to claim 1, characterized in that, In step S4, the reasoning process includes: generating a context-fused semantic vector during the input parsing stage; During the candidate field generation stage, the Top 10 candidate set is filtered using the FAISS library index; The rule selection phase uses the ONNX format to accelerate symbolic reasoning; The output stage includes associated fields and their corresponding semantic similarity, rule numbers, and summaries.
9. The method according to claim 1, characterized in that, In step S5, the semantic drift monitoring module identifies semantic changes through multiple indicators, including: Semantic similarity decay rate: Calculate the cosine similarity between the current field semantic vector and the historical semantic vector. If the similarity is less than 0.7, it is judged as semantic drift. Association frequency change rate: The historical association frequency between a statistical field and other fields. If the change exceeds 50% in a short period of time, it is determined that the association scenario has changed. The dynamic adaptation mechanism also includes collaborative deployment between the edge and the cloud: a lightweight semantic model is deployed at the edge and quantized into FP16 format using TensorRT; The complete semantic model is deployed in the cloud for batch inference and incremental training parameter generation, while the edge devices periodically synchronize semantic drift data to the cloud and obtain updated parameters.
Citation Information
Cited By
Logistics anomaly identification method and system based on multi-modal perception fusion
CN122263031A