A causal path generation method, device, equipment, medium and product
By generating a causal map and using the cross attention mechanism and the causal map neural network, the causal path is dynamically updated, and the accuracy of causal relationship analysis in the dynamic field is solved, achieving stronger interpretability and adaptability.
Patent Information
- Application Number
- CN202510846482.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-06-24
AI Technical Summary
The existing causal relationship analysis methods cannot adapt to dynamically changing domain data, resulting in insufficient accuracy of causal reasoning in complex scenarios and difficulty in distinguishing between correlation and causal relationship.
By obtaining domain text data, a causal map is generated, and using the cross attention mechanism and the causal map neural network, the entity feature representation and association weights are dynamically updated, and the causal relationship is verified in combination with counterfactual reasoning to generate a dynamic causal path.
It realizes the more accurate reflection of causal relationships in the field of dynamic changes, improves the interpretability and adaptability of causal reasoning, and can effectively distinguish between correlation and causal relationships.
Smart Images

Figure CN120354928B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of artificial intelligence technology, and in particular relates to a causal path generation method, device, equipment, medium and product. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] Current causal relationships are mainly based on knowledge graphs to describe static associations between entities. However, in some special scenarios, such as tax scenarios and supply chain scenarios, with the introduction of new policies or market changes, the nodes in the causal chain and the influence of cause nodes on result nodes may change. The static association method cannot adapt to domain changes. Summary of the Invention
[0004] In view of this, the present invention provides a causal path generation method, apparatus, device, medium and product.
[0005] To achieve the above object, a first aspect of the present invention provides a causal path generation method, comprising the following steps:
[0006] Obtain domain text data, extract entities and relationships, and generate causal graphs;
[0007] Acquire real-time domain text data, perform semantic alignment based on the real-time domain text data and the causal graph using a cross-attention mechanism, fuse contextual information of each entity with the feature representation of the corresponding entity, and update the feature representation of each entity;
[0008] A causal graph neural network is constructed based on the causal graph. According to the updated feature representation of each entity, the association weight is calculated based on the attention mechanism. Information is transferred according to the association weights between entities to dynamically generate causal paths.
[0009] In some embodiments, after entities and relationships are extracted from domain text data, causal relationships between entities are verified through counterfactual reasoning, specifically including: pre-building a counterfactual reasoning rule library for storing counterfactual reasoning rules, each counterfactual reasoning rule includes a baseline value of the change rate of another entity caused by the change rate of one entity; for every two related entities, when the other entities meet given conditions, the change rate of the other entity is calculated when one of the entities changes at a set change rate; if the change rate of the other entity deviates significantly from the baseline value, it is determined that there is a causal relationship between the two.
[0010] In some embodiments, performing semantic alignment based on a cross-attention mechanism includes:
[0011] Acquire real-time domain text data, segment it into text segments, and extract the embedding vectors of each text segment;
[0012] Based on the cross-attention mechanism, by calculating the similarity between the entities in the causal graph and the embedding vectors of each text fragment, semantically similar entities and text fragments are aligned into the same semantic space.
[0013] In some embodiments, dynamically generating a causal path includes:
[0014] Determining candidate causal directions based on a causal mask, wherein the causal mask is used to represent the causal relationship and direction between entities in the causal graph;
[0015] According to the updated feature representation of each entity, starting from the first entity, along the candidate causal path, the association weights with other entities are calculated based on the attention mechanism, and the next associated entity is selected according to the association weight to dynamically generate the causal path.
[0016] In some embodiments, after obtaining the causal path, the association weights in the causal path are also corrected based on the domain text data over a period of time, specifically including: for each real-time domain text data, semantic alignment is performed with the entities in the causal graph based on the cross-attention mechanism, and the causal relationships therein are extracted. For the same causal relationship that appears multiple times, the association weights between the corresponding entities are increased. If a causal relationship in the causal graph is not extracted from the real-time domain text data, the association weights between the corresponding entities are reduced.
[0017] In some embodiments, the method further comprises: performing a quantitative evaluation on the causal path in terms of one or more aspects of fidelity, robustness, and consistency with expert ratings.
[0018] A second aspect of the present invention provides a causal path generation device, comprising:
[0019] The causal graph generation module is configured to: obtain domain text data, perform entity and relationship extraction, and generate a causal graph;
[0020] The entity semantic enhancement module is configured to: obtain real-time domain text data, perform semantic alignment based on the real-time domain text data and the causal graph based on a cross-attention mechanism, fuse the context information of each entity with the feature representation of the corresponding entity, and update the feature representation of each entity;
[0021] The causal path generation module is configured to: construct a causal graph neural network based on the causal graph, calculate the association weights based on the attention mechanism according to the updated feature representation of each entity, transfer information according to the association weights between entities, and dynamically generate causal paths.
[0022] A third aspect of the present invention provides an electronic device, comprising a processor and a memory, wherein the memory stores computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the method described.
[0023] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which implements the method described above when the program is executed by a processor.
[0024] A fifth aspect of the present invention provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method described is implemented.
[0025] After creating a causal graph, one or more of the above technical solutions also obtain the contextual information of each entity in the causal graph based on real-time domain text data, embed the contextual information into the feature representation of each entity, and then transmit information through the graph neural network constructed by the causal graph. Based on the entities embedded with contextual information, the association weights between entities are updated. It has strong dynamic adaptability, can more accurately reflect the current causal relationship, is more interpretable, and can be applied to complex causal reasoning scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The accompanying drawings, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0027] Figure 1 A schematic diagram of an implementation environment provided for an embodiment of the present application;
[0028] Figure 2 A flow chart of the causal path generation method provided in an embodiment of the present application;
[0029] Figure 3 A flowchart for verifying causal relationships provided in an embodiment of the present application;
[0030] Figure 4 A flowchart for updating entity feature representation based on real-time domain text provided in an embodiment of the present application;
[0031] Figure 5 A flowchart of dynamically generating a causal path provided in an embodiment of the present application;
[0032] Figure 6 This is a program module architecture diagram of the causal path generation device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] The following describes embodiments of the present application in more detail with reference to the accompanying drawings. Although certain embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be construed as limited to the embodiments described herein. Instead, these embodiments are provided to provide a more thorough and complete understanding of the present application. It should be understood that the drawings and embodiments of the present application are for illustrative purposes only and are not intended to limit the scope of protection of the present application.
[0034] In the description of the embodiments of the present application, the term “including” and similar terms should be understood as open inclusion, that is, “including but not limited to.” The term “based on” should be understood as “at least partially based on.”
[0035] As described in the background, current causal relationships are primarily based on knowledge graphs to describe static associations between entities. This is unable to adapt to dynamically changing domain data, resulting in an inability to adapt to causal reasoning in complex scenarios and insufficient interpretability. Furthermore, the underlying logic of commonly used causal analysis methods is data-driven probabilistic statistics, such as causal inference based on Bayesian networks. This approach has high computational complexity when processing large-scale data, and the resulting relationships cannot be distinguished as mere correlations or causal relationships, such as "policy adjustments → corporate behavior."
[0036] Figure 1 This is a schematic diagram of an implementation environment provided by an embodiment of the present application, see Figure 1 The implementation environment includes: a terminal 101 and a server 102. The terminal 101 and the server 102 are directly or indirectly connected via wired or wireless communication. Through the interaction between the terminal 101 and the server 102, various functions such as visualization of causal graphs and dynamic generation of causal paths can be achieved.
[0037] In one possible implementation, a target application, served by server 102, is installed on terminal 101. Terminal 101 can use this target application to implement functions such as causal graph creation, causal graph visualization, and causal path query. Optionally, the target application is an application in the terminal 101 operating system, or an application provided by a third party. For example, the target application is a causal path generation application. Optionally, server 102 is the backend server for the target application, or a cloud server that provides cloud computing and cloud storage services.
[0038] In one possible implementation, the server 102 provides historical and real-time domain text data to the terminal 101. Based on user operations, the terminal 101 can create a causal graph based on the domain text data, and through counterfactual reasoning, perform causal relationship judgments on the relationships between entities to generate a causal graph; the generated causal graph can be stored in the server 102 as domain prior knowledge. When needed, the terminal 101 retrieves the causal graph from the server 102 and dynamically generates a causal path in combination with the real-time domain text data.
[0039] In one possible implementation, the terminal 101 can be a mobile phone, tablet computer, laptop computer, desktop computer, or other types of devices. The server 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, etc., and this embodiment of the application does not limit this.
[0040] Figure 2 This is a flow chart of a causal path generation method provided in an embodiment of the present application, see Figure 2 , the method comprising:
[0041] S210: Obtain domain text data, extract entities and relationships, and generate a causal graph.
[0042] The domain text data mentioned above refers to text data in specific fields, such as tax policy texts and supply chain node information, for which causal relationships are to be established. After obtaining the domain text data, entity and relationship extraction is performed on it, including entities such as "tax rate" and "supplier" and relationships such as "adjustment" and "dependency".
[0043] S220: Acquire real-time domain text data, perform semantic alignment based on the cross-attention mechanism according to the real-time domain text data and the causal graph, fuse the context information of each entity with the feature representation of the corresponding entity, and update the feature representation of each entity.
[0044] Through the cross-attention mechanism, the embedding vectors of entities in the structured causal graph and real-time domain text data are aligned in the same semantic space, and then the entities in the causal graph are associated with the corresponding text fragments in the real-time domain text data. The feature representation of the entity is updated according to the contextual information of the text fragment corresponding to each entity (that is, the contextual information of the entity) to make it contain richer semantic information, which makes it easier for real-time domain text data to guide the update of entities and causal relationships in the causal graph, as well as the transmission of relationships.
[0045] S230: Construct a causal graph neural network based on the causal graph, calculate the association weights based on the attention mechanism according to the updated feature representation of each entity, transfer information based on the association weights between entities, and dynamically generate causal paths.
[0046] Causal GNNs (Causal GNNs) model causal graphs using a graph neural network (GNN) architecture. They leverage node features (such as the initial weight of "purchase price") and edge relationships (such as "causal masks") for information transfer. For example, node embeddings aggregate the causal masks and attention weights of neighboring nodes to gradually derive multi-hop paths (e.g., "purchase price → subsidiary profit → tax return amount").
[0047] After creating the causal graph, the above method also obtains the contextual information of each entity in the causal graph based on real-time domain text data, embeds the contextual information into the feature representation of each entity, and then transmits information through the graph neural network constructed by the causal graph. Based on the entities embedded with contextual information, the association weights between entities are updated. It has strong dynamic adaptability, can more accurately reflect the current causal relationship, is more interpretable, and can be applied to complex causal reasoning scenarios.
[0048] In step S210, after the entities and relationships of the domain text data are extracted, the probability distribution of other related nodes under the conditions of the node is calculated for each node based on the Bayesian network, and the relationship between the entities is preliminarily screened based on the probability distribution. The nodes of the Bayesian network represent random variables, which can be observable variables, hidden variables or unknown parameters. The directed edges represent the dependencies between variables, and the conditional probability table defines the probability distribution of each node under the conditions of its parent node. For example, if node A affects node B, it is represented by the arrow A→B. The greater the conditional probability P(BA), the greater the impact relationship. By preliminarily screening the relationships between entities, noise filtering can be achieved and the core causal relationships can be retained.
[0049] It's important to note that the adjustment or dependency relationships mentioned above aren't necessarily causal. For example, in a tax compliance scenario, the co-occurrence of policy adjustments and corporate behavior may simply be a temporal correlation, not a causal relationship. Similarly, in a tax scenario, "tax rate adjustments" and "changes in corporate profits" may simply be a correlation, not a causal relationship. Therefore, a causal determination is necessary for the aforementioned relationships.
[0050] For example, in some embodiments, after the entities and relationships are advanced in step S210, the process further includes: verifying the causal relationship between the entities through counterfactual reasoning.
[0051] By using counterfactual reasoning to determine the causal relationship of the above relationship, a structured causal graph can be generated. The causal graph includes the causal relationship between entities, wherein the causal relationship is represented by a causal mask. M is a N × N A binary matrix with elements Mij ∈{0,1} represents an entity i and j The causal relationship and direction ( Mij =1 indicates causal relationship, Mij = 0 indicates correlation).
[0052] As a possible implementation, the verification step can be implemented through steps S211-S212, see Figure 3 , elaborated as follows:
[0053] S211: Verify the correctness of the causal relationship between entities through counterfactual reasoning, and generate a causal graph after verification, wherein the causal relationship and direction between entities in the causal graph are represented by a causal mask.
[0054] Combined with counterfactual reasoning to verify the causal direction, counterfactual reasoning verifies the stability of the causal chain by simulating the counterfactual scenario of "how will the result change if the input conditions change". Specifically, when verifying the causal relationship between two entities, each entity is used as a variable. When the other entities meet the given conditions, the change rate of the other entity is calculated when one of the entities changes at a set rate of change. If the change rate of the other entity deviates significantly from the baseline value, it is determined that there is a causal relationship between the two. When the verification ratio and accuracy meet the set requirements, the current data is considered reliable, and a causal graph is constructed based on this. It can be understood that a counterfactual reasoning rule library is pre-built. For specific fields, the change of one entity with another entity is constructed based on factual data. Based on the factual changes, counterfactual reasoning rules are constructed. Each counterfactual reasoning rule includes a baseline value of the change rate of another entity caused by the change rate of one entity.
[0055] The counterfactual reasoning is implemented based on the Do-Calculus framework and uses statistical tests (such as t-tests and chi-square tests) to calculate the p-value to determine whether the difference between the inference result and the actual result is significant. The reliability is verified based on the p-value (such as p < 0.01). For example:
[0056] (1) Simulate the counterfactual scenario of "whether the subsidiary's profit margin will decrease if the purchase price increases by 10%. If the actual profit margin decreases by 8% (p = 0.004 < 0.01), mark it as causal ( M Purchase price, subsidiary profit = 1).
[0057] (2) Simulate the counterfactual scenario of “what would happen if the policy was not adjusted?” For example, in the supply chain scenario, if the rate of change in the probability of supplier switching is ≤4.2% when the tariff is increased by ±5%, it is marked as a causal relationship.
[0058] (3) Simulate the impact of different purchase prices (e.g., ±5%) on the tax declaration amount of the subsidiary. If the rate of change is <3%, mark it as a causal relationship.
[0059] Causal Mask M Used to represent the causal relationship and direction between entities in the causal graph, causal mask M is a N × N A binary matrix with elements Mij ∈{0,1} represents an entity i and j The causal relationship and direction ( Mij =1 indicates causal relationship, Mij = 0 indicates correlation), such as the element M12=1 , indicating that there is a causal relationship between the first and second entities, with the first entity being the cause and the second entity being the effect. Causal masks enable explicit labeling of causal relationships and directions.
[0060] For example, in the tax scenario, through counterfactual reasoning: if the change in corporate profits after policy adjustment deviates significantly from the baseline value (p value < 0.01), the relationship between the "policy" entity (the i-th entity) and the "corporate profit" (the j-th entity) entity is marked as causal Mij =1; if there is only time correlation, it is marked as correlation Mij =0.
[0061] By constructing a causal map with the help of counterfactual reasoning, the computational complexity of statistical analysis is avoided. At the same time, the correlation and causal relationships are effectively distinguished, which serves as the basis for subsequent dynamic updates and ensures the correctness of the causal relationships and directions in the causal map.
[0062] S212: According to the causal graph and the causal mask, based on the self-attention mechanism, the attention weights between entities with causal relationships are obtained.
[0063] For example, based on the Transformer architecture, by using the self-attention mechanism, the attention weights between nodes are calculated to obtain the probability distribution between entities with causal relationships. The main steps are as follows: (1) Input embedding. Entity nodes such as "purchase price" and "subsidiary profit" are converted into vectors through feature encoding; (2) Self-attention calculation. Three vectors are generated for each node: query vector, key vector, and value vector. This can be achieved by linearly transforming the embedding vector. For example, to calculate self-attention for the nodes "purchase price" and "subsidiary profit", three vectors are generated for these two nodes respectively; then the attention score between them is calculated; (3) Causal relationship probability distribution calculation. Use the Softmax function for normalization to normalize the scores of all node pairs into probability distributions (i.e., attention weights).
[0064] Based on this, a causal graph for a specific field can be obtained. The causal graph can be stored on the server. When there is a need for causal reasoning in this field, the causal graph is retrieved and updated based on new real-time field data, and then the causal path construction is performed based on the following steps.
[0065] It can be understood that the server periodically collects domain text data and periodically updates the causal graph. When new policies are released or the supply chain structure is adjusted, new nodes may be generated or the probability distribution between nodes may change. Therefore, the causal graph is also periodically updated. Specifically, incremental domain text data is received regularly, the above steps are re-executed, entities and relationships are re-identified based on the incremental data, and causal relationship verification is performed through counterfactual reasoning to regenerate the causal mask. Based on this, when there are new policies or market fluctuations, the causal graph can be updated in a timely manner, invalid causal edges or new nodes are removed, and the dynamic update mechanism ensures that the constructed causal graph can adapt to domain changes and ensure the accuracy of subsequent causal reasoning. For example, if the p-value of a causal relationship is greater than 0.05 in three consecutive verifications, the causal relationship is deleted.
[0066] Existing methods (such as RAG) rely on explicit path retrieval and have difficulty handling implicit causal chains (e.g., “tariff adjustment → reduced supply chain resilience → financial risk”). For example, in a supply chain scenario, if the causal path is broken (e.g., missing intermediate nodes), the generated results may be incomplete or erroneous.
[0067] As a possible implementation, step S220 may be implemented through steps S221-S223, which are described in detail as follows:
[0068] S221: Acquire real-time domain text data, segment it into text segments, and extract embedding vectors for each text segment. It is understood that embedding vector extraction for text segments can be performed using pre-trained language models such as BERT and RoBERTa. These text segments not only contain segments corresponding to each entity in the causal graph, but also include contextual information about these segments. For example, for the sentence "The central bank's interest rate hike occurred during an economic downturn," the embedding vectors for "central bank interest rate hike" and "economic downturn" are extracted.
[0069] S222: Based on the cross-attention mechanism, by calculating the similarity between the embedding vectors of entities in the causal graph and each text segment, a correspondence between entities and text segments is established based on the similarity. Entities and text segments with similar semantics are aligned into the same semantic space. This association is established between entities in the causal graph (such as "rising interest rates") and text segments in real-time domain text data (such as "central bank interest rate hikes lead to increased corporate financing costs") to guide the generation of subsequent causal paths. For example, aligning the embedding vectors of the entity "rising interest rates" in the causal graph with the text segment "central bank interest rate hikes" indicates that they refer to the same event; another example is aligning the embedding vectors of "increased debt costs" in the causal graph with the text segment "increased financing costs."
[0070] S223: For each pair of associated entities and text fragments, the embedding vector of the context information of the text fragment is fused with the initial embedding vector of the entity, and the embedding vector of the node corresponding to the entity is updated. For example, the embedding vector of the context information can be fused with the initial embedding vector of the entity using a weighted average or splicing method. Taking the sentence "The central bank's interest rate hike occurred in the economic downturn cycle" as an example, the entity "interest rate rise" in the knowledge graph is aligned with the text fragment "central bank interest rate hike", and "occurred in the economic downturn cycle" is the context information embedding vector of the text fragment; by integrating the context information in the real-time domain text into the feature representation of the entity in the causal graph, the semantics of the entity can be enriched and more in line with reality. For example, after integrating the economic environment information into the embedding vector of the "interest rate rise" node, it can better reflect the impact on "increased debt costs".
[0071] In step S230, a causal graph neural network (Causal GNN) is constructed based on the causal graph. The Causal GNN combines the structure of a graph neural network (GNN) with the ability of causal reasoning. Nodes transmit information through edges. During message passing, an attention mechanism calculates the attention weights between each node and its neighbors. Messages are weighted based on the attention weights, giving more important neighbors a greater influence on the current node. During message passing, the most important neighbors are selected for information transmission based on the attention weights, enabling dynamic adjustment of path priorities.
[0072] As a possible implementation, step S230 may be implemented through steps S231-S233, which are described in detail as follows:
[0073] S231: Constructing a causal graph neural network based on the causal graph.
[0074] S232: Determine candidate causal directions based on the causal mask to avoid operations between non-causal nodes.
[0075] S233: Based on the updated feature representations of each entity, starting from the first entity, along the candidate causal path, the association weights with other entities are calculated using the attention mechanism. The next associated entity is selected based on the association weights, and a causal path is dynamically generated. If an entity is connected to multiple other entities along the candidate causal path, the entity with the largest association weight is selected as the next entity.
[0076] By using the causal mask to shield the non-causal direction, the associated weights of the entity feature representation enhanced by the context are optimized based on the attention mechanism. For example, when the causal mask between node I and node j Mij =1, the attention weight between the two nodes is calculated, avoiding the interference of non-causal nodes, saving the amount of calculation and ensuring the accuracy of the association weight.
[0077] In addition, for the causal path obtained in step S140, the causal strength between nodes is dynamically adjusted based on counterfactual reasoning to ensure the logical consistency of the path generation.
[0078] With the update and accumulation of text data in important fields such as policies, the association weights between nodes on the causal path may change. For example, new policies may introduce new regulatory requirements, incentives or restrictions, thereby changing the relationship between certain nodes. If a causal relationship appears repeatedly in multiple independent data sources or texts, this usually means that the causal relationship has a high degree of credibility and importance. If a causal relationship does not appear in the latest data, this may mean that the relationship is no longer important or no longer holds true in the current situation. Based on this, in some embodiments, after obtaining the causal path, the association weights in the causal path are also corrected based on the field text data for a period of time, specifically including: for each real-time field text data, semantic alignment is performed with the entities in the causal graph based on the cross-attention mechanism, and the causal relationships therein are extracted. For the same causal relationship that appears multiple times, the association weights between the corresponding entities are increased. If a causal relationship in the causal graph is not extracted from the real-time field text data, the association weights between the corresponding entities are reduced.
[0079] Example: For the specific scenario where Chinese company A establishes subsidiary B in country A, tax risks are identified by establishing a causal path.
[0080] First, a causal graph is constructed based on step S210. Specifically, it includes:
[0081] (1) Entity and relationship extraction. Extract key entities (e.g., “Chinese parent company,” “Subsidiary in Country A,” “Raw material procurement,” “Processing costs”) and relationships (e.g., “Procurement → Cost,” “Processing → Profit”) from the enterprise resource management system. Perform noise filtering to remove non-critical information (e.g., equipment depreciation, employee salaries), retaining data related to related-party transactions.
[0082] (2) Causal graph construction. Combine counterfactual reasoning to verify the causal relationship and direction. For example, simulate "If the purchase price increases by 10%, will the subsidiary's profit margin decrease?" If the actual profit margin decreases by 8% (p = 0.004 < 0.01), mark it as a causal relationship ( M Purchase price, subsidiary profit = 1); generate causal mask, set N = 6 nodes (parent company, subsidiary, purchase price, processing cost, profit margin, tax declaration amount), Mij represents the causal mask. M Purchase price, subsidiary profit = 1, which means that the purchase price directly affects the subsidiary profit.
[0083] Then, based on steps S220-S230, a causal path is dynamically generated, specifically including:
[0084] (3) Integrate enterprise resource management system data (such as procurement contract amount and processing cost) with local data of country A (such as prices of similar products in the market of country A and requirements of electronic invoice system) and strengthen the correlation through the cross-attention mechanism.
[0085] (4) Using a causal graph neural network, a multi-hop path is inferred based on node features and edge relationships: purchase price → subsidiary profit → tax declaration amount → tax anomaly. The association weights between purchase price and subsidiary profit, between subsidiary profit and tax declaration amount, and between tax declaration amount and tax anomaly are 0.88, 0.72, and 0.91, respectively.
[0086] Causal inference: Probability of tax anomaly = 0.88 × 0.72 × 0.91 = 0.574.
[0087] As the model is trained, the weights are optimized through backpropagation. For example, if the purchase price has a more significant impact on profit in the actual data (e.g. R 2=0.85), the model will automatically adjust w Close to 0.85.
[0088] When country A releases a new policy, the causal graph is updated and a new node, "Policy Compliance," is added. This automatically adjusts the association weights on the causal path, generating a new path: Purchase Price → Subsidiary Profit → Policy Compliance → Tax Anomalies. The association weights between purchase price and subsidiary profit, between subsidiary profit and policy compliance, and between policy compliance and tax anomalies are 0.88, 0.72, and 0.85, respectively.
[0089] Based on this, a complete causal path from "purchase price" to "tax declaration anomaly" was generated, revealing hidden risks.
[0090] Existing causal chain generation lacks unified evaluation criteria, resulting in low credibility of the results. For example, in a financial scenario, the generated causal relationship between "tax rate reduction" and "profit increase" may be misused due to lack of data support. To address this issue, the method further includes step S240: quantitatively evaluating the causal path based on one or more aspects of fidelity, robustness, and consistency with expert ratings, thereby forming a closed-loop iterative process: If at least one of the scores for a path's fidelity, robustness, and consistency with expert ratings falls below a threshold, a dynamic correction process for the causal graph is triggered (such as adding new entities or adjusting masks).
[0091] As a fidelity assessment method, the reliability of causal paths is verified based on counterfactual reasoning. To ensure that the rules contained in the counterfactual reasoning rule base cover as many entities as possible, the rule base is periodically updated. For example, entity and relationship recognition and counterfactual verification are regularly performed on incremental domain text data, and the baseline values in the rule base are updated. Furthermore, business experts are allowed to manually adjust the baseline values based on prior knowledge.
[0092] As another way to implement fidelity assessment, the rationality of the causal path is verified by matching historical data. Specifically, for the generated causal path, the embedding vectors of the entities in the path are arranged and spliced according to the order in the path to obtain the vector representation of the causal path to be verified; multiple historical cases in the same field are analyzed, and for each case, a true causal path is constructed separately; for each true causal path, the embedding vectors of the entities in the path are arranged and spliced according to the order in the path to obtain the vector representation of each true causal path; the similarity between the vector representation of the causal path to be verified and each true causal path is calculated, and if all meet the set threshold requirements, it is marked as high fidelity. For example, cosine similarity is used to measure the similarity between the generated causal path and the causal path of the historical case. Cosine similarity is used as a fidelity score. If the fidelity score is greater than or equal to the preset threshold, it is marked as high fidelity. For example, in a tax scenario, if the similarity between the causal path and the five historical tax rate adjustment cases is ≥0.85, it is marked as high fidelity.
[0093] (2) Robustness evaluation
[0094] Through input perturbation testing, one or more entities are increased or decreased by a certain percentage, and the rate of change of their associated nodes is calculated. If the rate of change does not exceed a set threshold, the corresponding causal path is marked as highly robust. For example, if the purchase price increases or decreases by 10%, simulating market fluctuations, the rate of change of the predicted value of the tax return is calculated. If the predicted value changes from 100 to 103 after the perturbation, the rate of change is 3%. In corporate tax scenarios, the threshold can be set based on the company's risk tolerance.
[0095] (3) Consistency assessment
[0096] Verify logical compatibility using domain expert scoring (1-5 points). For example, in a financial scenario, if the path score is ≥ 4.3, it is marked as highly consistent.
[0097] Modify the model based on the evaluation results. If the fidelity of a causal chain S= 0.72 (lower than the threshold of 0.85), triggering the correction process: a. Add a new node "related party fund flow" and adjust the causal mask (such as M Subsidiary profit, related party capital flow = 1); b. Retrain the large model and optimize the attention weight (such as w Subsidiary profit, related party funds flow = 0.82).
[0098] It should be noted that the retraining here is done through incremental learning rather than complete retraining, and only the affected parts are updated, thereby reducing training costs.
[0099] Based on the above method, one or more embodiments of the present invention further provide a causal path generation device, see Figure 6 , including: a causal graph generation module 310, configured to: obtain domain text data, perform entity and relationship extraction, and generate a causal graph; an entity semantic enhancement module 320, configured to: obtain real-time domain text data, perform semantic alignment based on the real-time domain text data and the causal graph based on a cross-attention mechanism, and fuse the context information of each entity with the feature representation of the corresponding entity, and update the feature representation of each entity; a causal path generation module 330, configured to: construct a causal graph neural network based on the causal graph, calculate the association weight based on the attention mechanism according to the updated feature representation of each entity, transfer information based on the association weights between entities, and dynamically generate a causal path.
[0100] It should be noted that the relationship graph creation device provided in the above embodiment is merely an example of the division of the above-mentioned functional modules. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the terminal can be divided into different functional modules to complete all or part of the functions described above. In addition, the relationship graph creation device provided in the above embodiment and the relationship graph creation method embodiment are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0101] One or more embodiments of the present invention further provide an electronic device that can be used to implement the method in the above embodiments. The electronic device includes one or more processors, one or more memories coupled to the processors, and a communication module coupled to the processors.
[0102] The memory in the embodiment of the present invention is used to store various types of data to support Figure 1 Implementation of the method shown in .
[0103] It is understood that the memory can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. The memory in the embodiment of the present invention can store the following: Figure 1 The computer programs corresponding to the steps in the method shown in . The operating system includes various system programs, such as a framework layer, a core library layer, and a driver layer, which are used to implement various basic services and handle hardware-based tasks. The application program can include various application programs.
[0104] As an example, a processor can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0105] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, the computer program including a computer program for executing Figure 1 In such an embodiment, the computer program can be downloaded and installed from a network via the communication portion and / or installed from a removable medium. When the computer program is executed by the central processing unit, the various functions defined in the apparatus of the present application are performed.
[0106] in, Figure 1The computer program instructions corresponding to the method shown can also be stored in a computer readable memory that can guide a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0107] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A causal path generation method, characterized in that: The following steps are involved: Obtain domain text data, extract entities and relationships, and generate causal graphs; Acquire real-time domain text data, perform semantic alignment based on the real-time domain text data and the causal graph using a cross-attention mechanism, fuse contextual information of each entity with the feature representation of the corresponding entity, and update the feature representation of each entity; A causal graph neural network is constructed based on the causal graph. Based on the updated feature representation of each entity, the association weight is calculated based on the attention mechanism. Information is transferred based on the association weights between entities to dynamically generate causal paths. After extracting entities and relationships from domain text data, the causal relationship between the entities is verified through counterfactual reasoning. Specifically, a counterfactual reasoning rule library is pre-built to store counterfactual reasoning rules. Each counterfactual reasoning rule includes a baseline value for the change rate of one entity caused by the change rate of another entity. For every two related entities, the change rate of one entity is calculated when the other entity changes at a set rate, provided that the other entity meets given conditions. If the change rate of the other entity significantly deviates from the baseline value, a causal relationship is determined between the two entities. Dynamically generated causal paths include: Determining candidate causal directions based on a causal mask, wherein the causal mask is used to represent the causal relationship and direction between entities in the causal graph; According to the updated feature representation of each entity, starting from the first entity, along the candidate causal path, the association weights with other entities are calculated based on the attention mechanism, and the next associated entity is selected according to the association weight to dynamically generate the causal path.
2. The causal path generation method according to claim 1, characterized in that: Semantic alignment based on the cross-attention mechanism includes: Acquire real-time domain text data, segment it into text segments, and extract the embedding vectors of each text segment; Based on the cross-attention mechanism, by calculating the similarity between the entities in the causal graph and the embedding vectors of each text fragment, semantically similar entities and text fragments are aligned into the same semantic space.
3. The causal path generation method according to claim 1, wherein: After obtaining the causal path, the association weights in the causal path are also corrected based on the domain text data over a period of time. Specifically, for each real-time domain text data, semantic alignment is performed with the entities in the causal graph based on the cross-attention mechanism to extract the causal relationships therein. For the same causal relationship that appears multiple times, the association weights between the corresponding entities are increased. If a causal relationship in the causal graph is not extracted from the real-time domain text data, the association weights between the corresponding entities are reduced.
4. The causal path generation method according to claim 1, wherein: The method further includes: performing a quantitative evaluation on the causal path in terms of one or more aspects of fidelity, robustness, and consistency with expert ratings.
5. A causal path generation device, characterized in that: include: The causal graph generation module is configured to: obtain domain text data, perform entity and relationship extraction, and generate a causal graph; The entity semantic enhancement module is configured to: obtain real-time domain text data, perform semantic alignment based on the real-time domain text data and the causal graph based on a cross-attention mechanism, fuse the context information of each entity with the feature representation of the corresponding entity, and update the feature representation of each entity; The causal path generation module is configured to: construct a causal graph neural network based on the causal graph, calculate association weights based on the updated feature representations of each entity using the attention mechanism, transfer information based on the association weights between entities, and dynamically generate causal paths; After extracting entities and relationships from domain text data, the causal relationship between the entities is verified through counterfactual reasoning. Specifically, a counterfactual reasoning rule library is pre-built to store counterfactual reasoning rules. Each counterfactual reasoning rule includes a baseline value for the change rate of one entity caused by the change rate of another entity. For every two related entities, the change rate of one entity is calculated when the other entity changes at a set rate, provided that the other entity meets given conditions. If the change rate of the other entity significantly deviates from the baseline value, a causal relationship is determined between the two entities. Dynamically generated causal paths include: Determining candidate causal directions based on a causal mask, wherein the causal mask is used to represent the causal relationship and direction between entities in the causal graph; According to the updated feature representation of each entity, starting from the first entity, along the candidate causal path, the association weights with other entities are calculated based on the attention mechanism, and the next associated entity is selected according to the association weight to dynamically generate the causal path.
6. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein computer instructions are stored in the memory. When the computer instructions are executed by the processor, the electronic device executes the method according to any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
8. A computer program product, comprising a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
AI-driven multilingual intelligent document abstract and mind map generation system
CN119494394A
Name disambiguation method based on multi-relation deep retrieval text matching
CN119862878A