A social governance risk element discovery method and system based on knowledge-guided counterfactual reasoning
By constructing a multi-granularity risk knowledge graph and causal reasoning, the problem of missing causal logic and insufficient interpretability in social governance technologies is solved, achieving highly accurate and interpretable identification of risk factors, and supporting government decision-making and accountability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUAZHONG UNIV OF SCI & TECH
- Filing Date
- 2026-01-30
- Publication Date
- 2026-05-29
AI Technical Summary
Existing social governance technologies suffer from a lack of causal logic, insufficient interpretability, and superficial knowledge utilization, making it difficult to accurately identify and explain social risks.
A multi-granularity risk knowledge graph is constructed, and by combining semantic encoders, graph neural networks, fusion modules and causal gating units, causal enhancement features are generated through counterfactual reasoning and cross-modal fusion mechanisms, and a structured risk element list is output.
It significantly improves the accuracy and credibility of risk factor identification, possesses logical rigor and interpretability, supports fine-grained attribution and traceable causes, and meets the needs of government implementation.
Smart Images

Figure CN122114610A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the interdisciplinary field of artificial intelligence and public governance, and more specifically, relates to a method and system for discovering social governance risk factors based on knowledge-guided counterfactual reasoning. Background Technology
[0002] With the accelerated digital transformation of urban governance, massive amounts of case texts are continuously generated, making traditional manual analysis methods insufficient to meet the needs of early risk detection and intervention. Current social risk identification technologies mainly rely on keyword rules, sentiment analysis, or event extraction models, which have three major shortcomings: First, there is a lack of causal logic: existing methods only capture superficial co-occurrence relationships (such as "complaint + gathering"), and cannot distinguish between correlation and causation, which can easily lead to misjudging occasional events as systemic risks. Second, there is a lack of interpretability: the black box model outputs a "high risk" label but cannot explain "why it is high risk", making it difficult to support the formulation and accountability. Third, knowledge utilization is superficial: Although there are rich governance and case databases, existing systems mostly use them as static retrieval sources, failing to dynamically align with the semantics of cases, and even less able to simulate counterfactual deductions such as "whether the outcome could be avoided if a certain condition were changed".
[0003] Although some studies have attempted to introduce knowledge graphs or causal models, the former remains at the level of entity links, while the latter mostly intervenes at the tag level (such as deleting a certain type of event). They lack controllable semantic operations on risk concept clusters (such as "communication failure" and "regulatory vacuum"), making it difficult to support fine-grained attribution.
[0004] This shows that existing social governance technologies suffer from technical problems such as a lack of causal logic, insufficient interpretability, and superficial knowledge utilization. Summary of the Invention
[0005] In response to the above-mentioned deficiencies or improvement needs of existing technologies, this invention provides a method and system for discovering social governance risk factors based on knowledge-guided counterfactual reasoning, thereby solving the technical problems of existing social governance technologies such as lack of causal logic, insufficient interpretability, and superficial knowledge utilization.
[0006] To achieve the above objectives, according to a first aspect of the present invention, a method for discovering social governance risk factors based on knowledge-guided counterfactual reasoning is provided, comprising: Input the knowledge graph and the case information to be predicted into the trained social governance model, and output a list of risk factors; The social governance model includes a semantic encoder, a graph neural network, a fusion module, a causal gating unit, and a multi-label classification head, and is trained in the following manner: A knowledge graph is constructed based on historical case information. A semantic encoder is used to extract semantic features from the historical case information. A graph neural network is used to embed the nodes in the knowledge graph to obtain knowledge features. Perform semantic-level counterfactual intervention at the concept cluster level of the knowledge graph to generate counterfactual knowledge features; Semantic features and knowledge features are input into the fusion module to obtain factual fusion features, and semantic features and counterfactual knowledge features are input into the fusion module to obtain counterfactual fusion features. The causal gating unit corrects the bias of fact fusion features by analyzing the difference between fact fusion features and counterfactual fusion features, thereby obtaining causal enhancement features; Input the causal enhancement features into the multi-label classification head to predict the list of risk factors; The error between the predicted list of risk factors and the actual risk factors corresponding to historical case information is used as the loss function. The model is then backpropagated and trained until convergence to obtain a well-trained social governance model.
[0007] Furthermore, the knowledge graph is a multi-granularity risk knowledge graph, constructed in the following manner: Historical case information and its real risk factors are collected from social governance datasets. For each historical case, entities are used as nodes and the relationships between entities are used as edges to construct a case-level subgraph. Similar risk factors are clustered, and entities of the same category in multiple case-level subgraphs are merged to form a category-level subgraph. The case-level subgraph and the category-level subgraph are merged to construct a multi-granularity risk knowledge graph.
[0008] Furthermore, the counterfactual knowledge features are generated in the following manner: The nodes in the knowledge graph are clustered into multiple risk concept clusters according to governance semantics. In each training batch, a non-empty risk concept cluster is randomly selected as the intervention target, and the semantic state of all its nodes is flipped, while the other risk concept clusters remain unchanged, thereby constructing a counterfactual knowledge graph. The nodes in the counterfactual knowledge graph are embedded using a graph neural network to generate counterfactual knowledge features.
[0009] Furthermore, the fusion module fuses factual fusion features and counterfactual fusion features in the same way. The fusion module includes a feedforward network and parallel knowledge guidance paths and evidence correction paths. The knowledge-guided path uses knowledge features as queries and performs cross-attention calculation on semantic features to obtain knowledge-guided features; the evidence-corrected path uses semantic features as queries and performs cross-attention calculation on knowledge features to obtain evidence-corrected features. The knowledge-guided features and evidence-corrected features are concatenated and fused through a feedforward network to generate fact fusion features.
[0010] Furthermore, the causal gating unit maps the difference between the fact fusion feature and the antifactual fusion feature into soft gating weights, and superimposes the soft gating weights onto the fact fusion feature in a residual manner to obtain the causal enhancement feature.
[0011] Furthermore, the loss function is a standard binary cross-entropy loss plus a causal consistency regularization term.
[0012] Furthermore, the method also includes: By comparing and correcting the risk factor list output by the trained social governance model, an optimal risk factor list is obtained.
[0013] According to a second aspect of the present invention, a device for discovering social governance risk factors based on knowledge-guided counterfactual reasoning is provided, comprising: The training module constructs a knowledge graph based on historical case information, extracts semantic features from the historical case information using a semantic encoder, and embeds nodes in the knowledge graph using a graph neural network to obtain knowledge features. Semantic-level counterfactual intervention is performed at the concept cluster level of the knowledge graph to generate counterfactual knowledge features. Semantic and knowledge features are input into a fusion module to obtain factual fusion features, and vice versa. A causal gating unit corrects the factual fusion features based on the difference between the factual and counterfactual fusion features to obtain causal enhancement features. These causal enhancement features are input into a multi-label classification head to predict a list of risk factors. The error between the predicted risk factor list and the actual risk factors corresponding to the historical case information is used as a loss function, backpropagated, and trained until convergence to obtain a trained social governance model. The prediction module is used to input the knowledge graph and the case information to be predicted into the trained social governance model and output a list of risk factors.
[0014] According to a third aspect of the present invention, a social governance risk discovery system is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement a social governance risk discovery method.
[0015] According to a fourth aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements a method for discovering social governance risk factors.
[0016] In summary, compared with the prior art, the above-described technical solutions conceived by this invention can achieve the following beneficial effects: (1) This invention, by constructing a knowledge graph and introducing semantic-level counterfactual intervention, achieves for the first time controllable inference at the concept cluster level, which can simulate the governance causal thinking of "if a certain condition were not met, a certain consequence would not occur"; the fusion mechanism avoids the amplification of misjudgments caused by one-way guidance; the causal gating unit based on fact-counterfactual differences can accurately identify and suppress false risk associations caused by data bias, significantly improving the accuracy and credibility of risk element identification; the entire framework does not require additional manual labeling of causal tags, and can achieve interpretable and highly robust risk discovery under the standard supervised training paradigm, with good potential for government implementation. Overall, this invention, by deeply integrating structured governance knowledge with causal reasoning, avoids the superficial use of knowledge and the lack of causal logic, and effectively improves the logical rigor, interpretability and generalization ability of risk element identification without the need for a large number of causal tags, which is significantly better than existing risk analysis methods based on keyword matching or statistical co-occurrence.
[0017] (2) When constructing a knowledge graph, this invention first constructs a case-level subgraph to form a fine-grained causal chain. In order to further enhance the generalization ability, it clusters similar risk elements to form a more representative category-level subgraph. The case-level and category-level subgraphs are then merged to form a multi-granular risk knowledge graph that combines detail and generalization ability.
[0018] (3) This invention flips the knowledge graph at the risk concept cluster level, so that the model no longer depends on surface co-occurrence, but explicitly models causal dependence through counterfactual deduction of "if not A, then B will not occur"; it can effectively identify the structural causes that truly drive the occurrence of risk (such as institutional absence), rather than accidental accompanying phenomena (such as a certain cluster); it significantly reduces the false positive rate in prediction and improves the logical rigor and credibility of risk attribution.
[0019] (4) The present invention uses a two-way cross-modal fusion mechanism. The knowledge-guided path uses knowledge as the query and can focus on evidence fragments related to prior risk concepts in the case. The evidence correction path uses case semantics as the query and can dynamically correct risk assumptions in the knowledge graph to avoid prior bias.
[0020] (5) The difference between fact fusion features and counterfactual fusion features reflects the sensitivity of the model output to specific risk interventions, i.e., causal effects. The causal gating unit of this invention maps this difference to soft gating weights and superimposes them onto the fact fusion features in a residual manner to output causal enhancement features. This operation preserves the causal components that are sensitive to interventions and suppresses spurious associations driven by statistical co-occurrence bias.
[0021] (6) In the training phase, this invention employs a joint loss function, which includes: a standard binary cross-entropy loss and a causal consistency regularization term (encouraging the difference between factual and counterfactual outputs to align with the direction of intervention). This strategy forces the model to learn causally robust risk judgment behavior while optimizing recognition accuracy.
[0022] (7) When outputting risk factors, the present invention adopts a comparative debiasing strategy so that the final result retains only the causal semantic components that are sensitive to knowledge intervention, and suppresses false risk associations caused by data statistical co-occurrence bias. Attached Figure Description
[0023] Figure 1 This is a flowchart of the method provided in an embodiment of the present invention. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.
[0025] like Figure 1 As shown, a method for discovering social governance risk factors based on knowledge-guided counterfactual reasoning includes: Input the knowledge graph and the case information to be predicted into the trained social governance model, and output a list of risk factors; The social governance model includes a semantic encoder, a graph neural network, a fusion module, a causal gating unit, and a multi-label classification head, and is trained in the following manner: A knowledge graph is constructed based on historical case information. A semantic encoder is used to extract semantic features from the historical case information. A graph neural network is used to embed the nodes in the knowledge graph to obtain knowledge features. Perform semantic-level counterfactual intervention at the concept cluster level of the knowledge graph to generate counterfactual knowledge features; Semantic features and knowledge features are input into the fusion module to obtain factual fusion features, and semantic features and counterfactual knowledge features are input into the fusion module to obtain counterfactual fusion features. The causal gating unit corrects the bias of fact fusion features by analyzing the difference between fact fusion features and counterfactual fusion features, thereby obtaining causal enhancement features; Input the causal enhancement features into the multi-label classification head to predict the list of risk factors; The error between the predicted list of risk factors and the actual risk factors corresponding to historical case information is used as the loss function. The model is then backpropagated and trained until convergence to obtain a well-trained social governance model.
[0026] Example 1 A method for discovering social governance risk factors based on knowledge-guided counterfactual reasoning includes the following steps: S1: Construct a multi-granularity risk knowledge graph for social governance and extract semantic features from case information; S2: Align the multi-granularity risk knowledge graph with semantic features to form knowledge features containing semantic dependencies between events and risk elements; S3: Perform semantic-level counterfactual intervention at the concept cluster level of the multi-granularity risk knowledge graph to generate counterfactual knowledge representations; S4: Implement knowledge-guided semantic interpretation and evidence-corrected risk reasoning through a bidirectional cross-modal fusion mechanism to obtain fused features; S5: Based on the difference between factual fused features and corresponding counterfactual fused features, perform bias correction on the fused features through a causal gating unit to obtain causal enhancement features; S6: Output a structured list of social risk elements based on causal enhancement features.
[0027] Specifically, in S1, the knowledge graph construction involves the following steps: First, in the data acquisition phase, paired case descriptions and their handling results are collected from publicly available social governance datasets (such as historical work orders from the 12345 citizen hotline). Then, pre-trained structured information extraction tools (such as LegalNER or GovBERT) are used to perform entity recognition and causal relationship extraction on the text, constructing an independent case-level subgraph for each case. Nodes represent subjects (e.g., "community residents' committee"), behaviors (e.g., "unresponsive demands"), systems (e.g., "property management regulations"), or consequences (e.g., "group gathering"), while edges represent semantic relationships (e.g., "caused," "violated," "missing"). To further enhance generalization ability, clustering of similar risk concepts is performed based on a large-scale model semantic assistant (e.g., classifying "no way to complain," "no feedback," and "no access to channels" as "failure of the demand expression mechanism"). Entities of the same category in multiple case-level subgraphs are merged to form a more representative category-level subgraph. Finally, the case-level and category-level subgraphs are merged to form a multi-granularity risk knowledge graph (RKG).
[0028] Specifically, in the process of establishing the dependency relationship between case text and knowledge graph in S2, a pre-trained semantic encoder (such as Sentence-BERT or ChatGLM-Embedding) is used to obtain sentence-level and keyword-level semantic features for each case information in the training set; at the same time, a graph neural network (such as GAT) is used to embed the nodes in the RKG. Thus, a soft correspondence between nodes and semantic features is established through a learnable alignment matrix, thereby forming knowledge features that integrate causal dependency and textual evidence.
[0029] Specifically, in the process of generating counterfactual knowledge representations in S3, nodes in the knowledge graph are clustered into several risk concept clusters based on governance semantics (e.g., "response delay," "unclear responsibilities," and "insufficient resources" can be categorized into the "weak grassroots governance capacity" cluster). In each training batch, a non-empty concept cluster is randomly selected as the intervention target, and the semantic state of all its nodes (e.g., "there is a lack of institutional support") is flipped (set to "there is no lack of institutional support"), while keeping other clusters unchanged, thereby constructing a counterfactual knowledge graph. It is worth noting that this process only modifies the knowledge representation; the original case description and its semantic features remain unchanged, ensuring the purity and causal isolation of the intervention.
[0030] Specifically, the S4 bidirectional cross-modal fusion mechanism comprises two parallel paths: a knowledge-guided path and an evidence correction path. The knowledge node embeddings (knowledge features) serve as the query, and cross-attention calculations are performed on the case's semantic features. This allows the model to prioritize text fragments consistent with governance priors during risk assessment, achieving "knowledge-guided text." The evidence correction path uses the case's semantic features as the query, performs cross-attention calculations on the knowledge node embeddings, and dynamically adjusts the confidence level of risk assumptions based on the actual case details, achieving "text-corrected knowledge." The outputs of the two paths are concatenated and fused through a feedforward network to generate bidirectional fused features.
[0031] Specifically, S5 inputs semantic features and knowledge features into the fusion module to obtain factual fusion features, and inputs semantic features and counterfactual knowledge features into the fusion module to obtain counterfactual fusion features. The difference between the two is calculated; this difference reflects the sensitivity of the model output to specific risk interventions, i.e., the causal effect. Subsequently, the causal gating unit (CGU) maps this difference vector to soft-gating weights and superimposes them onto the original fusion features as residuals, outputting causal enhancement features. This operation preserves the causal components sensitive to interventions and suppresses spurious associations driven by statistical co-occurrence bias.
[0032] Specifically, S6 inputs causal enhancement features into a multi-label classification head (such as a fully connected layer with sigmoid activation) and outputs a probability distribution of a predefined set of risk factors (such as 32 categories). During training, a joint loss function is used, which includes a standard binary cross-entropy loss and a causal consistency regularization term (encouraging the difference between factual and counterfactual outputs to align with the direction of intervention). This strategy forces the model to learn causally robust risk judgment behavior while optimizing recognition accuracy.
[0033] Preferably, when outputting risk factors in S6, a comparative debiasing strategy is adopted so that the final result retains only the causal semantic components that are sensitive to knowledge intervention, and suppresses false risk associations caused by data statistical co-occurrence bias.
[0034] Furthermore, the case information includes, but is not limited to, 12345 hotline work orders, online posts, or emergency incident reports; the output list of social risk factors covers common clinical governance issues, including the absence of institutional implementation, information asymmetry, insufficient protection of the rights and interests of vulnerable groups, failure of cross-departmental collaboration, weak grassroots response capabilities, delayed guidance, imbalanced resource allocation, or unclear legal basis.
[0035] Through the above implementation methods, the present invention achieves the automatic discovery of logically rigorous, explainable, and traceable social risk elements from unstructured case texts without the need for additional manual labeling of causal tags, by utilizing structured governance knowledge and controllable counterfactual intervention. This is significantly superior to existing risk identification methods based on keyword matching, sentiment analysis, or static knowledge retrieval.
[0036] This invention avoids the absence of causal logic in the following ways: 1. Introduce a semantic-level counterfactual intervention mechanism (S3): At the level of risk concept clusters (such as "communication failure" and "regulatory vacuum"), the knowledge graph is controllably flipped (for example, "there is a communication failure" is set to "there is no communication failure") to generate counterfactual knowledge representations.
[0037] 2. Construct a causal gating unit (S5): Calculate the difference vector between factual fusion features and counterfactual fusion features. This difference directly reflects whether a risk factor has a causal effect. Simultaneously, only semantic components sensitive to knowledge intervention are retained to suppress spurious associations caused by data co-occurrence bias.
[0038] By employing the above methods, the model can move away from relying on surface co-occurrence and instead explicitly model causal dependencies through counterfactual reasoning that "if it is not A, then it will not be B." This approach can effectively identify the structural causes that truly drive risk (such as institutional deficiencies) rather than accidental accompanying phenomena (such as a particular clustering event). In experiments, it significantly reduces the false positive rate and enhances the logical rigor and credibility of risk attribution.
[0039] This invention avoids insufficient interpretability in the following ways: 1. Bidirectional cross-modal fusion mechanism (S4): Knowledge-guided approach: Use governance knowledge as the search tool and focus on evidence fragments in the case text that are related to the concept of prior risk (such as "unresponsive demands" corresponding to "weak grassroots response capabilities"). Evidence correction path: Using case semantics as the query, dynamically correct risk assumptions in the knowledge graph to avoid prior bias.
[0040] 2. Output a structured list of risk elements (S6): Directly output predefined, meaningful risk categories (such as "cross-departmental collaboration failure"), rather than fuzzy probability values.
[0041] 3. The entire reasoning process is based on a multi-granularity knowledge graph (S1–S2), and each risk judgment can be traced back to specific entities, relationships, and concept clusters.
[0042] The above methods can make the risk identification results inherently interpretable: each output risk element corresponds to a clear governance concept and textual evidence; support attribution and accountability: for example, it can point out that "the main cause of this incident is 'information asymmetry' + 'delayed guidance'", which facilitates subsequent rectification; and meet the requirements of government scenarios for transparent decision-making and audit compliance.
[0043] This invention avoids superficial knowledge utilization in the following ways: 1. Construct a multi-granularity risk knowledge graph (S1): Case-level subgraphs: Extracting fine-grained causal chains from historical cases (e.g., "Property management negligence → No way to complain → Gathering"). Category-level subgraphs: Risk concept clusters are abstracted from social governance ontology (such as "conflicts and disputes - handling entities - institutional basis - consequence types"); the two are integrated to form a knowledge base with both detailed and generalizable capabilities.
[0044] 2. Knowledge and Semantic Dynamic Alignment (S2 & S4): Through a learnable alignment matrix and cross-attention mechanism, bidirectional semantic fusion of knowledge and text is achieved, rather than simple retrieval.
[0045] 3. Supports counterfactual reasoning (S3): It can intervene in abstract concepts such as "communication failure" and "insufficient resources" to simulate "whether the conflict can be avoided if communication is strengthened?" Through the above methods, governance knowledge can be transformed from a static resource into a dynamic reasoning engine; achieving fine-grained attribution: not only knowing "there is a risk," but also locating "which institutional links have failed"; and possessing sand table simulation capabilities: providing decision-makers with intelligent assistance in "whether changing X can avoid Y," supporting precise intervention.
[0046] Example 2 A device for discovering social governance risk factors based on knowledge-guided counterfactual reasoning, comprising: The training module constructs a knowledge graph based on historical case information, extracts semantic features from the historical case information using a semantic encoder, and embeds nodes in the knowledge graph using a graph neural network to obtain knowledge features. Semantic-level counterfactual intervention is performed at the concept cluster level of the knowledge graph to generate counterfactual knowledge features. Semantic and knowledge features are input into a fusion module to obtain factual fusion features, and vice versa. A causal gating unit corrects the factual fusion features based on the difference between the factual and counterfactual fusion features to obtain causal enhancement features. These causal enhancement features are input into a multi-label classification head to predict a list of risk factors. The error between the predicted risk factor list and the actual risk factors corresponding to the historical case information is used as a loss function, backpropagated, and trained until convergence to obtain a trained social governance model. The prediction module is used to input the knowledge graph and the case information to be predicted into the trained social governance model and output a list of risk factors.
[0047] Example 3 A social governance risk discovery system includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement a method for discovering social governance risk factors.
[0048] Example 4 A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for discovering social governance risk factors.
[0049] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for discovering social governance risk factors based on knowledge-guided counterfactual reasoning, characterized in that, include: Input the knowledge graph and the case information to be predicted into the trained social governance model, and output a list of risk factors; The social governance model includes a semantic encoder, a graph neural network, a fusion module, a causal gating unit, and a multi-label classification head, and is trained in the following manner: A knowledge graph is constructed based on historical case information. A semantic encoder is used to extract semantic features from the historical case information. A graph neural network is used to embed the nodes in the knowledge graph to obtain knowledge features. Perform semantic-level counterfactual intervention at the concept cluster level of the knowledge graph to generate counterfactual knowledge features; Semantic features and knowledge features are input into the fusion module to obtain factual fusion features, and semantic features and counterfactual knowledge features are input into the fusion module to obtain counterfactual fusion features. The causal gating unit corrects the bias of fact fusion features by analyzing the difference between fact fusion features and counterfactual fusion features, thereby obtaining causal enhancement features; Input the causal enhancement features into the multi-label classification head to predict the list of risk factors; The error between the predicted list of risk factors and the actual risk factors corresponding to historical case information is used as the loss function. The model is then backpropagated and trained until convergence to obtain a well-trained social governance model.
2. The method for discovering social governance risk factors based on knowledge-guided counterfactual reasoning as described in claim 1, characterized in that, The knowledge graph is a multi-granularity risk knowledge graph, constructed in the following manner: Historical case information and its real risk factors are collected from social governance datasets. For each historical case, entities are used as nodes and the relationships between entities are used as edges to construct a case-level subgraph. Similar risk factors are clustered, and entities of the same category in multiple case-level subgraphs are merged to form a category-level subgraph. The case-level subgraph and the category-level subgraph are merged to construct a multi-granularity risk knowledge graph.
3. A method for discovering social governance risk factors based on knowledge-guided counterfactual reasoning as described in claim 1 or 2, characterized in that, The counterfactual knowledge features are generated in the following manner: The nodes in the knowledge graph are clustered into multiple risk concept clusters according to governance semantics. In each training batch, a non-empty risk concept cluster is randomly selected as the intervention target, and the semantic state of all its nodes is flipped, while the other risk concept clusters remain unchanged, thereby constructing a counterfactual knowledge graph. The nodes in the counterfactual knowledge graph are embedded using a graph neural network to generate counterfactual knowledge features.
4. A method for discovering social governance risk factors based on knowledge-guided counterfactual reasoning as described in claim 1 or 2, characterized in that, The fusion module uses the same method to fuse factual fusion features and counterfactual fusion features. The fusion module includes a feedforward network and parallel knowledge guidance paths and evidence correction paths. The knowledge-guided path uses knowledge features as queries and performs cross-attention calculation on semantic features to obtain knowledge-guided features; the evidence-corrected path uses semantic features as queries and performs cross-attention calculation on knowledge features to obtain evidence-corrected features. The knowledge-guided features and evidence-corrected features are concatenated and fused through a feedforward network to generate fact fusion features.
5. A method for discovering social governance risk factors based on knowledge-guided counterfactual reasoning as described in claim 1 or 2, characterized in that, The causal gating unit maps the difference between fact fusion features and antifactual fusion features into soft gating weights, and superimposes the soft gating weights onto the fact fusion features in a residual manner to obtain causal enhancement features.
6. A method for discovering social governance risk factors based on knowledge-guided counterfactual reasoning as described in claim 1 or 2, characterized in that, The loss function is the standard binary cross-entropy loss and the causal consistency regularization term.
7. A method for discovering social governance risk factors based on knowledge-guided counterfactual reasoning as described in claim 1 or 2, characterized in that, The method further includes: By comparing and correcting the risk factor list output by the trained social governance model, an optimal risk factor list is obtained.
8. A device for discovering social governance risk factors based on knowledge-guided counterfactual reasoning, characterized in that, include: The training module constructs a knowledge graph based on historical case information, uses a semantic encoder to extract semantic features from the historical case information, and embeds the nodes in the knowledge graph using a graph neural network to obtain knowledge features. Perform semantic-level counterfactual intervention at the concept cluster level of the knowledge graph to generate counterfactual knowledge features; Semantic features and knowledge features are input into the fusion module to obtain factual fusion features, and semantic features and counterfactual knowledge features are input into the fusion module to obtain counterfactual fusion features. The causal gating unit corrects the bias of fact fusion features by analyzing the difference between fact fusion features and counterfactual fusion features, thereby obtaining causal enhancement features; The causal enhancement features are input into the multi-label classification head to predict the list of risk factors; the error between the predicted list of risk factors and the real risk factors corresponding to historical case information is used as the loss function, backpropagated, and trained until convergence to obtain the trained social governance model. The prediction module is used to input the knowledge graph and the case information to be predicted into the trained social governance model and output a list of risk factors.
9. A social governance risk detection system, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.