Traceable answering generation and verification method and system based on government affair knowledge graph

CN122886803APending Publication Date: 2026-10-09BEIJING ZHILIANTIANXIA TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611166757.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-03
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0003]但是,在实际的智能问答应用中,不同用户的提问往往存在前提条件隐蔽、表述边界模糊的情况,现有的大语言模型生成方法主要依赖向量相似度进行上下文拼接,在面对具有强逻辑互斥或多重前置条件的复杂图谱网络时,容易发生条件遗漏和逻辑关系颠倒的问题

Benefits of technology

(1)本发明所记载的本技术方案中,对咨询文本进行句法解析并遍历知识图谱构建基础条件树,将业务标签映射至基础条件树进行属性对齐,提取未匹配的空缺节点生成缺失条件向量并与业务标签融合构建边界约束矩阵;依据边界约束矩阵在知识图谱执行多跳寻径获取候选子图,交叉比对节点约束属性与缺失条件向量,剪枝剔除属性冲突的节点及关联边获取衍生子图,并为衍生子图内的要素节点与关系边分配唯一标识,映射生成溯源锚点字典与拓扑邻接表。由此,能够改善现有技术面对模糊提问时容易发生条件遗漏和检索范围偏移的问题,在寻径阶段提前过滤逻辑互斥的图谱分支,为后续生成过程建立精确的底层拓扑约束。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122886803A_ABST
    Figure CN122886803A_ABST
Patent Text Reader

Abstract

The application discloses a traceable answering generation and verification method and system based on government affair knowledge graph, and particularly relates to the technical field of natural language processing. The method extracts business tags from the consultation text, traverses the graph to construct a basic condition tree, extracts a missing condition vector to fuse and construct a boundary constraint matrix, finds a path according to the constraint matrix and obtains a derived subgraph by pruning, allocates unique identifiers to nodes and relationship edges, generates a traceable anchor point dictionary and a topological adjacency list, inputs the text and the derived subgraph into a pre-trained language model, constructs a prefix tree based on the dictionary and intervenes in a probability distribution matrix in the decoding stage, forcibly injects an implicit mask to generate a preliminary draft text, extracts the mask and a connection fragment to convert into a text logical operator, reversely maps the adjacency list to convert into a reference topological operator, compares consistency, replaces the connection fragment when there is a conflict, and renders the mask into a reference link to output an answering text. The system is used for implementing the above method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing technology, specifically to a method and system for generating and verifying traceable Q&A based on government knowledge graphs. Background Technology

[0002] The deepening digital transformation of public services has made building knowledge graphs from massive amounts of document and regulatory data to support automated question answering a crucial way to improve information retrieval efficiency. When handling complex transactions or querying professional information, the public typically needs systems that can accurately understand their individual situation and quickly return precise guidance and suggestions. Automated question-answering systems can integrate multi-source heterogeneous data, transforming complex text into structured knowledge networks, thereby helping users quickly locate the information they need in complex business processes.

[0003] However, in practical intelligent question-answering applications, questions from different users often have hidden preconditions and ambiguous expression boundaries. Existing large language model generation methods mainly rely on vector similarity for contextual concatenation. When facing complex graph networks with strong logical mutual exclusion or multiple preconditions, they are prone to omissions of conditions and reversals of logical relationships. When generating long text answers, existing technologies treat the text content and underlying graph nodes as a black box. The generated answer conjunctions are prone to deviating from the true topological structure of the original graph, leading to factual biases in the final output conclusions and making structured source tracing and automatic error correction difficult. Therefore, it is still necessary to provide a traceable question-answering generation and verification method and system based on government knowledge graphs to improve the factual reliability and verification consistency of generated content under complex constraints. Summary of the Invention

[0004] In order to overcome the above-mentioned defects of the prior art, embodiments of the present invention provide a method and system for generating and verifying traceable Q&A based on government knowledge graphs to solve the problems mentioned in the background art.

[0005] To achieve the above objectives, the present invention provides the following technical solution: a traceable Q&A generation and verification method based on a government knowledge graph, comprising the following steps: S1, performing syntactic parsing on the consultation text to extract business tags, traversing the prerequisite nodes of the knowledge graph to construct a basic condition tree; mapping the business tags to the basic condition tree through slots for attribute alignment, extracting unmatched empty nodes to generate missing condition vectors, and merging them with the business tags to construct a boundary constraint matrix; S2, performing multi-hop pathfinding on the knowledge graph based on the boundary constraint matrix to obtain candidate subgraphs, cross-comparing node constraint attributes with missing condition vectors, pruning and removing nodes with conflicting attributes and related edges to obtain derived subgraphs; assigning unique identifiers to element nodes and relational edges within the derived subgraphs, and mapping to generate traceability anchors. S3. Convert the consultation text and derived subgraph into a prompt sequence and input it into the pre-trained language model. In the autoregressive decoding stage, construct a prefix tree based on the source anchor dictionary. Monitor the hidden semantic state and intervene in the candidate word probability distribution matrix when triggering element node prediction. Force sampling of the corresponding unique identifier as an implicit mask is injected into the decoding sequence to generate the first draft text. S4. Parse the first draft text to extract continuous implicit masks and natural language connection fragments, convert them into text logic operators, and reverse map the implicit mask to the topological adjacency list. Read the original relation edge type and convert it into the benchmark topological operator. Compare the consistency between the two. When there is a mapping conflict, replace the connection fragment according to the standard associated words bound by the original relation edge type. Render the implicit mask as a reference link and output the Q&A text.

[0006] Preferably, the specific process of extracting business tags from the consultation text through syntactic parsing and traversing the prerequisite nodes of the knowledge graph to construct the basic condition tree is as follows: the consultation text is split into business entities and business actions through a pre-built semantic parsing engine, and business tags containing subject, object and intent dimensions are aggregated; the business tags are mapped to the event meta-template of the knowledge graph to extract the event root node; the directed dependency edges of the knowledge graph are traced forward, and prerequisite nodes with hierarchical constraints related to the event root node are extracted level by level, and the event root node is used as the root, the constraint relationship is used as the tree edge, and the prerequisite nodes are used as branches to construct the basic condition tree according to the hierarchical dependency order.

[0007] Preferably, the specific process of mapping business tags to the basic condition tree through slots for attribute alignment, extracting unmatched empty nodes to generate missing condition vectors, and merging them with business tags to construct a boundary constraint matrix is ​​as follows: Parse the branch node structure of the basic condition tree to extract standard condition slots, traverse the feature dimensions of the business tags to fill the corresponding standard condition slots, and perform attribute feature comparison; scan the basic condition tree to extract empty nodes in an vacant state, extract the primitive semantic attributes and hierarchical depth weights of the empty nodes, and convert them into a high-dimensional representation sequence to generate missing condition vectors; perform tensor expansion on the business tags to obtain business feature tensors, concatenate the missing condition vectors and business feature tensors in the hidden layer dimension, and perform nonlinear transformations to construct a boundary constraint matrix.

[0008] Preferably, the specific process of obtaining candidate subgraphs by performing multi-hop pathfinding in the knowledge graph based on the boundary constraint matrix, cross-comparing node constraint attributes with missing condition vectors, and pruning and removing nodes with conflicting attributes and related edges to obtain derived subgraphs is as follows: The boundary constraint matrix is ​​converted into graph data query instructions; the starting seed node for matching features is activated in the knowledge graph; the step size is limited by expanding outward along the network topology according to the breadth-first strategy; nodes and directed relationships on the access path are aggregated to generate candidate subgraphs; the applicable jurisdiction and effective range of independent nodes are extracted to form node constraint attributes; the node constraint attributes and missing condition vectors are cross-compared with the topological boundary; conflicting nodes whose node constraint attributes exceed the limit or generate mutually exclusive logic are stripped; the related edges connecting conflicting nodes are cut off; and the connected components in the residual structure are extracted to obtain derived subgraphs.

[0009] Preferably, the specific process of assigning unique identifiers to element nodes and relation edges within the derived subgraph and mapping them to generate a source anchor dictionary and a topological adjacency table is as follows: traverse the derived subgraph to extract element nodes that map government parameters and relation edges connecting element nodes; use a distributed ID generation algorithm to distribute unique identifiers that cannot be repeated to element nodes and relation edges respectively; extract natural language text fragments of element nodes as keys and unique identifiers of mapped element nodes as values, and organize and construct a source anchor dictionary with a key-value pair structure; parse the directed connection directions and hierarchical dependency links formed between element nodes, concatenate the unique identifiers of the starting node, relation edges, and terminal nodes according to a triplet sequence, and perform structured storage to generate a topological adjacency table.

[0010] Preferably, the consultation text and derived subgraph are transformed into prompt sequences and input into the pre-trained language model. The specific process of constructing a prefix tree based on the source anchor dictionary in the autoregressive decoding stage is as follows: extract the character sequence of the consultation text, flatten the element nodes and relationship edges in the derived subgraph into a graph-text structure sequence according to the topological hierarchy, merge the character sequence and the graph-text structure sequence and insert special instruction identifiers to generate a prompt sequence; parse the key-value pairs in the source anchor dictionary, extract natural language text fragments as node branches, extract unique identifiers as leaf nodes, and construct a multi-branch tree hierarchy relationship according to the character arrangement order of the natural language text fragments to generate a prefix tree.

[0011] Preferably, the specific process of monitoring the hidden layer semantic state, intervening in the candidate word probability distribution matrix when triggering feature node prediction, and forcibly sampling the corresponding unique identifier as an implicit mask to inject into the decoding sequence to generate the initial draft text is as follows: In the autoregressive generation loop of the pre-trained language model, by monitoring the hidden layer semantic state, the feature vector matrix of the current hidden layer output is extracted to obtain the candidate word vocabulary, and the currently output decoding sequence is used as a matching prefix to perform state transition traversal in the prefix tree; when the state transition path hits the leaf node of the prefix tree, the feature node prediction condition is activated, the sampling probability weight of the dimension of the unique identifier attached to the leaf node is increased in the probability distribution matrix corresponding to the candidate word vocabulary, the probability of other candidate word dimensions is compressed, the unique identifier is extracted from the probability distribution matrix to generate an implicit mask and appended to the end of the decoding sequence, and the iteration continues until the termination symbol is triggered to output the initial draft text.

[0012] Preferably, the process of parsing the initial draft text to extract continuous implicit masks and natural language connection fragments, converting them into text logic operators, and then reverse-mapping the implicit masks to the topological adjacency list and reading the original relation edge types to convert them into benchmark topological operators is as follows: Scan the initial draft text to extract continuous implicit masks by matching mask feature character substrings, extract the natural language connection fragments existing between two adjacent continuous implicit masks, and parse the natural language connection fragments into Boolean-level text logic operators according to preset semantic mapping rules; extract two adjacent continuous implicit masks as query indexes to input the topological adjacency list to retrieve matching triples, extract the original relation edge types recorded in the matching triples, and convert the original relation edge types into benchmark topological operators representing conditional constraint logic according to the graph ontology definition specifications.

[0013] Preferably, the specific process of comparing the consistency between the two and replacing the connection fragments with standard related words bound by the original relation edge type when a mapping conflict occurs, rendering the implicit mask as a reference link to output the Q&A text, is as follows: Extract the text logical operator and perform a Boolean truth table comparison test with the baseline topological operator. When the text logical operator and the baseline topological operator are in the mutually exclusive quadrant, a topological mapping conflict signal is triggered; extract the standard related words bound by the original relation edge type in the topological adjacency table, and overwrite and replace the natural language connection fragments at the character offset positions corresponding to the initial draft text where the mapping conflict signal is generated; extract the implicit mask and the natural language text fragments in the source anchor dictionary, and concatenate the reference link tags in hypertext markup format to replace the corresponding implicit mask to output the Q&A text.

[0014] The traceable Q&A generation and verification system based on government knowledge graphs is used to execute the aforementioned traceable Q&A generation and verification method based on government knowledge graphs. It includes: a constraint construction module, used to perform syntactic parsing on consultation texts to extract business tags, traverse the prerequisite nodes of the knowledge graph to construct a basic condition tree; map business tags to the basic condition tree through slots for attribute alignment, extract unmatched empty nodes to generate missing condition vectors, and merge them with business tags to construct a boundary constraint matrix; and a pathfinding and pruning module, used to perform multi-hop pathfinding in the knowledge graph based on the boundary constraint matrix to obtain candidate subgraphs, cross-compare node constraint attributes with missing condition vectors, prune and remove nodes with conflicting attributes and related edges to obtain derived subgraphs; assign unique identifiers to element nodes and relationship edges within the derived subgraphs, and map them to generate... The system includes: a source anchor dictionary and a topological adjacency list; a decoding generation module that converts consultation text and derived subgraphs into prompt sequences input to a pre-trained language model, constructing a prefix tree based on the source anchor dictionary during the autoregressive decoding stage; monitoring the hidden semantic state, intervening in the candidate word probability distribution matrix during element node prediction, forcibly sampling the corresponding unique identifier as an implicit mask and injecting it into the decoding sequence to generate the initial draft text; and a source verification module that parses the initial draft text to extract continuous implicit masks and natural language connection fragments, converting them into text logic operators; inversely mapping the implicit mask to the topological adjacency list, reading the original relation edge types and converting them into baseline topological operators; comparing the consistency between the two, and replacing the connection fragments according to the standard associated words bound by the original relation edge types when mapping conflicts occur, rendering the implicit mask as a reference link to output the Q&A text.

[0015] The technical effects and advantages of this invention are as follows: (1) In the technical solution described in this invention, the consultation text is parsed syntactically and the knowledge graph is traversed to construct a basic condition tree. The business tags are mapped to the basic condition tree for attribute alignment. Unmatched empty nodes are extracted to generate missing condition vectors and are fused with the business tags to construct a boundary constraint matrix. Based on the boundary constraint matrix, multi-hop pathfinding is performed in the knowledge graph to obtain candidate subgraphs. The node constraint attributes and missing condition vectors are cross-compared. Nodes with conflicting attributes and related edges are pruned to obtain derived subgraphs. Unique identifiers are assigned to the element nodes and relation edges in the derived subgraphs, and a source anchor dictionary and a topological adjacency table are generated. Thus, the problem of condition omission and retrieval range deviation that easily occurs when facing fuzzy queries in the prior art can be improved. Logically mutually exclusive graph branches are filtered in advance during the pathfinding stage, and accurate underlying topological constraints are established for the subsequent generation process.

[0016] (2) In the technical solution described in this invention, the consultation text and derived subgraph are transformed into prompt sequences and input into a pre-trained language model. During the autoregressive decoding stage, a prefix tree is constructed based on the source anchor dictionary. When the element node prediction is triggered, the probability distribution matrix of candidate words is intervened, and the corresponding unique identifier is forcibly sampled as an implicit mask and injected into the decoding sequence to generate the initial draft text. The initial draft text is parsed to extract continuous implicit masks and natural language connection fragments, which are then transformed into text logic operators. The original relation edge types are read from the topological adjacency list and transformed into benchmark topological operators. The structural consistency is compared, and the connection fragments are replaced when there is a mapping conflict. Finally, the implicit mask is rendered as a reference link and the answer text is output. Thus, the problem of logical association reversal and source breakage that easily occurs in the generation of long texts in existing large language models can be overcome. The structured verification and automatic error correction of the generated text and the underlying topology of the graph are realized, and the factual reliability and interpretability of the final answer result are improved.

[0017] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description

[0018] Figure 1 This is a flowchart of the traceable Q&A generation and verification method based on government knowledge graph of the present invention; Figure 2 This is a schematic diagram illustrating the trend of depth attenuation weight changes in an embodiment of the present invention; Figure 3 This is a schematic diagram illustrating the intervention and comparison of candidate word probability distribution in an embodiment of the present invention; Figure 4 This is a flowchart of the traceable Q&A generation and verification system based on government knowledge graphs according to the present invention. Detailed Implementation

[0019] Example 1; please refer to Figure 1This invention provides a technical solution: a traceable Q&A generation and verification method based on a government knowledge graph, comprising the following steps: S1, performing syntactic parsing on the consultation text to extract business tags, traversing the prerequisite nodes of the knowledge graph to construct a basic condition tree; mapping the business tags to the basic condition tree through slots for attribute alignment, extracting unmatched empty nodes to generate missing condition vectors, and merging them with the business tags to construct a boundary constraint matrix; S2, performing multi-hop pathfinding on the knowledge graph based on the boundary constraint matrix to obtain candidate subgraphs, cross-comparing node constraint attributes with missing condition vectors, pruning and removing nodes with conflicting attributes and related edges to obtain derived subgraphs; assigning unique identifiers to element nodes and relational edges within the derived subgraphs, and mapping to generate traceability anchor words. S3. Transform the consultation text and derived subgraph into a prompt sequence and input it into the pre-trained language model. During the autoregressive decoding stage, construct a prefix tree based on the source anchor dictionary. Monitor the hidden semantic state and intervene in the candidate word probability distribution matrix when triggering element node prediction. Force sampling of the corresponding unique identifier as an implicit mask is injected into the decoding sequence to generate the initial draft text. S4. Parse the initial draft text to extract continuous implicit masks and natural language connection fragments, transform them into text logic operators, and reverse map the implicit mask to the topological adjacency list. Read the original relation edge type and transform it into the benchmark topological operator. Compare the consistency between the two. When there is a mapping conflict, replace the connection fragment according to the standard associated words bound by the original relation edge type. Render the implicit mask as a reference link and output the Q&A text.

[0020] In this implementation plan, step S1 specifically involves the structured parsing and constraint construction of the consultation text. The system utilizes syntactic parsing technology to decompose the unstructured text input by the user, extracting business tags representing the handling entity and business actions. It then traces the prerequisites for handling matters level by level in the underlying government knowledge graph, establishing a hierarchical basic condition tree. Syntactic parsing refers to a method that uses natural language processing algorithms to analyze the dependency relationships of sentence components to extract core entity features. The system fills the extracted business tags into the preset data slots corresponding to the basic condition tree for attribute alignment, identifies nodes in the tree structure that are not yet covered by the user text, and transforms them into missing condition vectors containing primitive semantic attributes and hierarchical depth weights. The system further concatenates this missing condition vector with the features corresponding to the business tags to form a boundary constraint matrix. This matrix will serve as a rigid filtering condition for defining the search boundary during subsequent graph retrieval.

[0021] Step S2 filters applicable data and establishes structured traceability credentials in the graph based on the previously constructed constraint matrix. The system uses the boundary constraint matrix as the query command to search for related node sequences within the government knowledge graph through multi-hop pathfinding. Multi-hop pathfinding refers to the retrieval process of continuously traversing multiple topological levels along nodes and directed edges in the graph database to obtain deeply related data. After obtaining candidate subgraphs, the system cross-compares the applicable jurisdiction and validity period of the internal nodes with the missing condition vector from the previous step, performing graph pruning. Graph pruning directly removes nodes and their connecting edges that have mutually exclusive conditions or exceed applicable limits from the graph network, thereby obtaining derived subgraphs that accurately match the current business context. Subsequently, the system uses an algorithm to assign unique, non-repeatable identifiers to the retained element nodes and relational edges, establishes a mapping dictionary based on this, and uses a topological adjacency list that records node connection directions and triple dependencies for structured storage.

[0022] Step S3 is responsible for forcibly injecting machine-readable tracking tags while restricting the free generation of the large language model. The system converts the consultation text and derived subgraphs into prompt sequences to input into the model, and monitors the semantic state of the hidden layer in real time during the autoregressive decoding stage. Autoregressive decoding is the basic mechanism for the pre-trained language model to predict and generate subsequent text word by word based on the context. The system uses the source anchor dictionary generated in the previous step to construct a prefix tree, which is a tree-shaped data structure used for fast string prefix matching and state transition. When the hidden layer state predicted by the model matches the prediction conditions of the element nodes in the prefix tree, the system directly intervenes in the candidate word probability distribution matrix at the model output, artificially increasing the sampling probability weight of the corresponding unique identifier, and forcing the model to output the unique identifier as an implicit mask along with the natural language text. An implicit mask is a special placeholder with global index positioning function but hidden from ordinary users. It is embedded in the generated draft text to provide a precise target positioning point for subsequent reverse fact verification.

[0023] Step S4 performs text fact logic verification and automatic error correction to prevent reversal by reverse mapping the relationships between graph nodes. The system scans the generated draft text, extracts the natural language connection fragments generated between two implicit masks, and parses them into text logic operators for Boolean operations. Based on the extracted implicit masks, the system reverse-searches the topological adjacency list constructed above, retrieves the original recorded native relation edge types between the two nodes, and converts them into a benchmark topological operator as a verification standard. The text logic operator represents the connection logic freely generated by the language model, while the benchmark topological operator represents the absolutely true objective relation logic in the government knowledge graph. The system compares the consistency of the two in logical topological structure. When it finds that the connection fragments generated by the model and the real connections in the graph are mutually exclusive or misaligned, it directly uses the standardized related words bound by the native relation edge types to overwrite the original erroneous connection fragments in the text. After completing the structured error correction, the implicit mask is converted into a visual reference link to output the final Q&A text.

[0024] Specifically, the process of extracting business tags from consultation text through syntactic parsing and traversing the prerequisite nodes of the knowledge graph to construct a basic condition tree is as follows: The consultation text is split using a pre-built semantic parsing engine to extract business entities and actions, and business tags containing subject, object, and intent dimensions are aggregated. These business tags are mapped to the event meta-template of the knowledge graph to extract the event root node. Following the directed dependency edges of the knowledge graph, prerequisite nodes with hierarchical limitations related to the event root node are extracted level by level. The event root node is used as the root, the limiting relationships as tree edges, and the prerequisite nodes as branches, constructing the basic condition tree according to the hierarchical dependency order.

[0025] In this implementation plan, after obtaining the original consultation text, a preprocessing module deployed in a local security sandbox is first invoked to perform data anonymization, removing potentially sensitive personal privacy data to mitigate compliance risks in the processing of government data. Subsequently, the anonymized text is input into a pre-defined joint extraction network model, and a character-level hidden state matrix is ​​obtained through a bidirectional long short-term memory network. Conditional random fields are used to decode the sequence and output the entity sequence. Attention pooling is then used to extract the intent distribution features of the entire sentence, and the extracted entity vector is... Object vector and intent vector By concatenating features along their dimensions, a business tag representation is generated. In the mapping to the event meta template phase, the business tag representation is calculated. The node with the smallest Euclidean distance to each node in the candidate event meta-node set within the government knowledge graph, while also satisfying the baseline confidence interval, is selected as the event root node. When constructing the basic condition tree, with Starting from the knowledge graph, a reverse relational subgraph search is performed, and a hierarchical dependency strength measurement model is established between nodes. Let any adjacent child nodes... With parent node The strength of the dependency between them is Its calculation logic is as follows: ;in, Indicates the activation function; Represents the learnable dependency feature mapping weight matrix; Represents child nodes The semantic representation vector; Indicates the parent node The semantic representation vector; Represents a node and The relational feature tensor of directed dependency edges between them; This represents a vector concatenation operation; This represents the dependency bias term. To ensure the structural compactness of the basic condition tree and avoid endless computational resource consumption, a dynamic adaptive truncation threshold is constructed. The method for determining it is the product of the average dependency strength of all traversed nodes at the current level and the node degree decay factor. The calculation formula is as follows: Where K represents the total number of candidate nodes expanded from the current level, and K is limited to a non-zero positive integer. When K=0, the dynamic adaptive truncation threshold is used. Set to 0; k represents the traversal index of the current candidate node; This represents the dependency strength between the k-th candidate node and its parent node; Indicates the parent node The degree of departure; This represents the global maximum out-degree constant defined in the government affairs graph model structure. It also represents the computational intensity on a certain reverse link. Less than If the above-point tracing of that branch is stopped, all remaining links are replicated according to the topology of the source knowledge graph, thereby instantiating and constructing the basic condition tree.

[0026] Specifically, the process of mapping business tags to the basic condition tree through slots for attribute alignment, extracting unmatched empty nodes to generate missing condition vectors, and fusing them with business tags to construct a boundary constraint matrix is ​​as follows: Parse the branch node structure of the basic condition tree to extract standard condition slots; traverse the feature dimensions of business tags to fill the corresponding standard condition slots and perform attribute feature comparison; scan the basic condition tree to extract empty nodes in an vacant state; extract the primitive semantic attributes and hierarchical depth weights of the empty nodes, convert them into a high-dimensional representation sequence to generate missing condition vectors; perform tensor expansion on the business tags to obtain business feature tensors; concatenate the missing condition vectors and business feature tensors in the hidden layer dimension; and perform nonlinear transformations to construct a boundary constraint matrix.

[0027] In this implementation scheme, when parsing the basic condition tree to perform attribute alignment, predefined conceptual constraint attributes within each branch node are extracted to form a standard condition slot set. Represent the business tags generated in the early stage. Input to the multi-head attention cross-matching module and calculate Each feature dimension and each slot semantic alignment score Filter by alignment score The condition tree nodes corresponding to slots approaching zero are marked as empty nodes. For the extracted set of empty nodes, their primitive semantic attribute matrices in the basic condition tree are further extracted. And assign a corresponding depth decay weight based on the level depth of the missing node in the tree structure. The formula for calculating the depth decay weight is: ;in, Represents an exponential function; The smooth control parameters, which are dynamically learned as the government affairs processing procedures change, are obtained by back-solving the extreme values ​​of the hierarchical distribution of supplementary business conditions by fitting real users in the historical question and answer log database, ensuring that the weight allocation fits the logic of the actual government affairs scenario. This indicates the distance of the currently vacant node from the event root node. The shortest topological level hop count is then determined. Subsequently, the primitive semantic attribute matrix is ​​weighted and modulated using depth decay weights, and mapped to a fixed-length high-dimensional representation sequence via a multilayer perceptron, outputting the missing condition vector. ;in, Represents a multilayer perceptron network; Indicates a missing condition vector; This represents the primitive semantic attribute matrix of missing nodes. Combined with... Figure 2 The graph shown illustrates the trend of depth decay weight changes, visually reflecting the depth decay weight of missing nodes in the knowledge graph. (i.e., the vertical axis) varies with the number of hops in the topology. The nonlinear decay evolution mechanism (i.e., the horizontal axis). For example... Figure 2 As shown in the scatter plot trend, when the smoothing control parameter... When the topological level hop count increases from 1 to 6 (corresponding to the upper broken line in the figure), its decay weight gradually decreases from 0.82 to 0.30. This indicates that under this parameter, the system allows the model to explore the conditional constraints of deep knowledge graph branches over longer distances; when the smoothing control parameter... As the number of hops increases from 1 to 3 (corresponding to the lower line in the graph), the decay weight rapidly drops from 0.45 to 0.09, and approaches 0.01 at hop count 6. Figure 2 The numerical change mapping verifies the control logic of the exponential function described above, namely: the larger the smoothing parameter, the stricter the system's requirement for the spatial locality of prerequisite nodes, thus effectively preventing the dimensional contamination of business features by remote weakly correlated topology nodes. To achieve cross-dimensional feature fusion, tensor product operations are used to represent business labels. Perform dimensional expansion to obtain the business feature tensor under the high-dimensional mapping. Final boundary constraint matrix The generation follows the calculation process as follows: ;in, Represents the hyperbolic tangent nonlinear transform function; This represents the fusion weight matrix used for dimension alignment and feature interaction; This represents a tensor concatenation operation along the hidden layer dimension; Represents a business feature tensor; This represents the constraint baseline bias matrix. This step, through rigorous tensor mapping and splicing calculations, achieves a hard coupling between the existing entity elements in the user's consultation text and the blank prerequisite elements required by the graph logic in the underlying feature space.

[0028] Specifically, the process of obtaining candidate subgraphs by performing multi-hop pathfinding in the knowledge graph based on the boundary constraint matrix, cross-comparing node constraint attributes with missing condition vectors, and pruning and removing nodes with conflicting attributes and related edges to obtain derived subgraphs is as follows: The boundary constraint matrix is ​​converted into graph data query instructions. The starting seed node for matching features is activated in the knowledge graph. The step size is limited and the nodes and directed relationships on the access path are aggregated to generate candidate subgraphs. The candidate subgraphs are traversed to extract the applicable jurisdiction and effective range of independent nodes to form node constraint attributes. The node constraint attributes and missing condition vectors are cross-compared with the topological boundary. Conflicting nodes whose node constraint attributes exceed the limit or generate mutually exclusive logic are stripped. The related edges connecting conflicting nodes are cut off, and the connected components in the residual structure are extracted to obtain derived subgraphs.

[0029] In this implementation, after obtaining the boundary constraint matrix, the system performs reverse serialization in the graph data execution engine, mapping it into a dense query tensor suitable for attribute graph structures. The system will serialize the dense query tensor. A dot product operation is performed with the global node vector set of the graph, and a group of nodes whose dot product score is greater than a preset threshold is activated as the starting seed nodes. Then, starting from the initial seed nodes, the traversal proceeds at a preset maximum depth. Within the constraints, the pathfinding is expanded hop-by-hop outward along the adjacent physical storage blocks of the graph, aggregating all government element entities and directed relational attribute edges along the way, and assembling them into a candidate subgraph residing in memory. For each independent node in this candidate subgraph, its underlying structured metadata is extracted, and the spatial code representing the policy's applicable jurisdiction and the timestamp column representing the policy's effective range are extracted and concatenated to form the constraint attribute tensor of that node. To determine the legitimacy of a node in the current consultation context, the constraint attribute tensor and the missing condition vector generated in the previous step are subjected to nonlinear topological cross-calculation to generate a boundary compatibility score. Its calculation logic is as follows: ;in, Represents the linear rectification activation function; This represents the transpose operation of a constraint attribute tensor. This represents the bilinear mapping weight matrix used for aligning features in the spatial and temporal dimensions; This represents the missing condition vector. To perform precise pruning, the system constructs a pruning threshold that dynamically floats with the business tolerance. The method for determining this pruning threshold is as follows: ;in, This represents a smoothing adjustment coefficient based on the severity level of government affairs review. The higher the review level, the closer the coefficient approaches scalar one. This represents the mathematical expectation of the boundary compatibility scores of all nodes within the current candidate subgraph; This represents the infimum of the boundary compatibility score within the current candidate subgraph. When traversing to... Strictly less than the pruning threshold When a node is encountered, the system identifies it as a conflicting node that generates mutual exclusion logic. It then directly performs pointer unbinding operations in memory, stripping the conflicting node and all its directly connected incoming and outgoing edges. After full graph traversal and pruning, the connected component discovery algorithm is used to extract the largest maximal connected subgraph in the residual topology, solidifying it as a target derived subgraph with strict policy application boundaries.

[0030] Specifically, the process of assigning unique identifiers to element nodes and relation edges within the derived subgraph, and mapping them to generate a source anchor dictionary and a topological adjacency table, is as follows: Traverse the derived subgraph to extract element nodes that map government parameters and relation edges connecting these element nodes; use a distributed ID generation algorithm to distribute unique, non-repeating identifiers to element nodes and relation edges respectively; extract natural language text fragments from element nodes as keys and unique identifiers of mapped element nodes as values, and organize and construct a key-value pair structured source anchor dictionary; parse the directed connection directions and hierarchical dependency links formed between element nodes, concatenate the unique identifiers of the starting node, relation edges, and terminal nodes according to a triplet sequence, and perform structured storage to generate a topological adjacency table.

[0031] In this implementation scheme, the system performs element-level labeling and parsing on the aforementioned solidified derived subgraph, traverses all element nodes mapping government parameters and relational edges connecting different element nodes within the derived subgraph, and calls a hardware-level ID allocator generated by a distributed consensus algorithm to assign a hard-coded, non-repeatable, unique identifier to each element. This unique identifier is not randomly generated, but is assigned based on deterministic bit operations performed according to the physical node state. Its core logic is as follows: ;in, This represents the machine absolute timestamp bit sequence obtained when the identifier was generated; This represents the binary left shift operator; This indicates the preset timestamp displacement step size; Indicates the bitwise OR logical operator; This indicates the machine signature of the computing node currently performing the graph parsing task; This indicates the preset machine characteristic displacement step size; This represents the sequence number feature generated by auto-incrementing within the same clock cycle of a single node. After completing the identifier assignment for all elements, the system extracts the unformatted natural language text fragment stored within the feature node as a dictionary key, thus assigning a unique identifier to that feature node. As the mapping result, a source anchor dictionary with bidirectional mapping characteristics is instantiated and constructed in the distributed key-value storage system. To transform the two-dimensional network graph topological dependencies into a flattened decision sequence that can be directly read in the subsequent large language model verification stage, the system performs dimensionality reduction decomposition on the connected substructures within the derived subgraph, extracting the unique identifier of the starting node on any directed connection direction and hierarchical dependency link. Unique identifier of the relationship edge and the unique identifier of the terminal node Concatenate these three sets of identifiers sequentially according to the graph flow order to construct a sequence of relation triples. The system iteratively parses all directed edges in the derived subgraph, collects all generated relation triple sequences, writes them into the same family set of a non-relational database, and performs structured persistent storage. This generates a topological adjacency list to record the current local topological logical facts and rules of government affairs, providing an undisputed comparison benchmark for subsequent verification.

[0032] Specifically, the consultation text and derived subgraph are transformed into prompt sequences and input into the pre-trained language model. The specific process of constructing a prefix tree based on the source anchor dictionary in the autoregressive decoding stage is as follows: extract the character sequence of the consultation text, flatten the element nodes and relationship edges in the derived subgraph into a graph-text structure sequence according to the topological hierarchy, merge the character sequence and the graph-text structure sequence and insert special instruction identifiers to generate a prompt sequence; parse the key-value pairs in the source anchor dictionary, extract natural language text fragments as node branches, extract unique identifiers as leaf nodes, and construct a multi-branch tree hierarchy relationship according to the character arrangement order of the natural language text fragments to generate a prefix tree.

[0033] In this implementation scheme, within a privately deployed and physically isolated computing node, a word segmenter is first invoked to extract the consultation text and obtain the basic character sequence. For the derived subgraphs obtained in the previous stage, a depth-first topological sorting algorithm is used to flatten the network-distributed element nodes and relation edges into a one-dimensional graph-text structure sequence according to the topological hierarchy. To enable the pre-trained language model to recognize the boundaries of different data modalities, special instruction identifiers are used to delimit and combine sequences, merging them to generate complete prompt sequences. Its construction logic is as follows: ;in, This indicates the embedding of system-level role commands; This indicates a concatenation operation along the sequence dimensions. This represents a feature delimiter used to isolate natural language text from topological structures. This indicates the truncation termination marker of the prompt sequence. After the prompt sequence is constructed and cached, the system reads the source anchor dictionary stored in memory and initiates the construction of the multi-branch tree hierarchy of the prefix tree. It then parses the key-value pairs in the dictionary sequentially, extracts the natural language text fragments used as keys, and segments them into individual characters at the word-level. Starting from the root node of the prefix tree, branches are created or traversed downwards according to the character order of the natural language text fragment. The state transition operator inside the prefix tree is defined as follows: ;in, This represents the exact match addressing operator within the prefix tree structure; This indicates the index of the current parent node; This represents the q-th cursor character in a natural language text segment; This represents the index of the child node that was hit during addressing. When all characters of a natural language text segment have completed state transition mapping, the unique identifier corresponding to the value is extracted from the source anchor dictionary and attached to the node at the end of the current branch. This completes the physical instantiation of the leaf node. The entire dictionary is parsed iteratively to generate a prefix tree that covers the local node features of the graph.

[0034] Specifically, the process of monitoring the hidden layer semantic state, intervening in the candidate word probability distribution matrix when triggering feature node prediction, and forcibly sampling the corresponding unique identifier as an implicit mask to inject into the decoding sequence to generate the initial draft text is as follows: In the autoregressive generation loop of the pre-trained language model, by monitoring the hidden layer semantic state, the feature vector matrix of the current hidden layer output is extracted to obtain the candidate word vocabulary. The currently output decoding sequence is used as a matching prefix to perform state transition traversal in the prefix tree. When the state transition path hits the leaf node of the prefix tree, the feature node prediction condition is activated. The sampling probability weight of the dimension where the unique identifier attached to the leaf node is increased in the probability distribution matrix corresponding to the candidate word vocabulary, the probability of other candidate word dimensions is compressed, the unique identifier is extracted from the probability distribution matrix to generate an implicit mask and appended to the end of the decoding sequence. The iteration continues until the termination symbol is triggered to output the initial draft text.

[0035] In this implementation scheme, the prompt sequence will be... After being fed into the encoder layer of the pre-trained language model, an autoregressive generation loop is initiated. At the current time step t, the system directly reads the high-dimensional tensor features output from the hidden layer of the model network via a mounted hardware probe, obtaining the feature vector matrix for the current step. The probability distribution matrix of the candidate words is then projected onto the global candidate vocabulary space via the vocabulary mapping module to obtain the original candidate word probability distribution matrix. ;in, The vocabulary mapping weight tensor of the language model; This represents the output feature bias matrix. During the word-by-word generation process, the system maintains a state cursor that continuously tracks the currently output decoded sequence, using it as a matching prefix to perform state transition traversal in the previously constructed prefix tree. When the state cursor accurately hits a leaf node in the prefix tree after multiple rounds of stepping, it indicates that the continuous context currently output by the model has completely covered the prediction conditions of the feature nodes in the derived subgraph. At this point, the system triggers the interception mechanism of the underlying computation graph, blocking the normalized output process and re-processing the original candidate word probability distribution matrix. Perform forced intervention. Assume the unique identifier mounted on the leaf node has the following dimension index in the extended vocabulary: Inject boost sampling weights for this specific dimension Apply a suppression penalty scalar to the remaining word dimension v. The calculation logic for the reconstructed probability distribution matrix of the intervention target is as follows: And for all different Dimension v, execution ;in, This represents the probability distribution matrix of the intervention target after intervention reconstruction; This represents the numerical superposition operator; Represents the numerical reduction operator; suppressing the penalty scalar. Set the system constant to a maximum positive value to implement absolute suppression; increase the sampling weight. Depending on the original feature distribution at the current time step, it is calculated as follows: ;in, This indicates the extremum operator for solving along the vocabulary dimension; This represents the scaling factor, whose value is strictly greater than scalar two to ensure the monotonic absolute dominance of the unique identifier dimension. Subsequently, the reconstructed probability distribution matrix of the intervention target is analyzed. After performing exponential normalization, the sampling probability of the unique identifier dimension collapses and approaches the upper confidence limit. Based on this, the system forcibly extracts the corresponding unique identifier from the probability distribution matrix. Since this unique identifier is a special encoded feature within the vocabulary extension space that is detached from natural semantics, it is physically transformed into an externally isolated implicit mask, appended to the end of the decoding sequence and synchronously written to the video memory. Then, the computation graph interception is released and the time step is advanced, iteratively executing the generation loop until the termination symbol is triggered, outputting the initial draft text embedded with structured tracking features. To further illustrate the data mapping state of the above probability intervention process in the underlying hardware video memory, please refer to... Figure 3 The figure shows a comparison of the candidate word probability distribution after intervention. The horizontal axis represents the different dimensional sequences in the expanded vocabulary (including regular words A to D and unique identifiers), and the vertical axis represents the sampling probability weights after normalization by the Softmax function. Figure 3 The light-colored bars on the left (before intervention) show that the pre-trained language model, based on the statistical distribution of natural language corpora, assigns higher sampling priority to common words B (weight 0.32) and A (weight 0.28), while the sampling probability of the 'unique identifier' representing the objective logic of the graph is only 0.05. At this point, the illusion of a large model and logical deviation are highly likely to occur; for example... Figure 3 As shown in the dark bars on the right (after intervention), after the cursor in the triggered state hits a leaf node in the prefix tree, the system injects a boosted sampling weight into the probability matrix. And apply a suppression penalty scalar. This forces the sampling weight of the unique identifier to undergo a non-linear jump, which is forcibly pulled up to 0.96 to form a monotonically dominant state. At the same time, all other regular word dimensions (such as regular words A to D) are compressed and decayed to a low confidence dead zone of 0.01. Figure 3The data mapping clearly reveals the physical implementation process of this scheme in breaking the black box of model decoding and realizing the forced injection of deterministic traceability anchor points.

[0036] Specifically, the process of parsing the initial draft text to extract continuous implicit masks and natural language connection fragments, and converting them into text logic operators, and then reverse mapping the implicit masks to the topological adjacency list and reading the original relation edge types to convert them into benchmark topological operators is as follows: Scan the initial draft text to extract continuous implicit masks by matching mask feature character substrings, extract the natural language connection fragments existing between two adjacent continuous implicit masks, and parse the natural language connection fragments into Boolean-level text logic operators according to preset semantic mapping rules; extract two adjacent continuous implicit masks as query indexes to input the topological adjacency list to retrieve matching triples, extract the original relation edge types recorded in the matching triples, and convert the original relation edge types into benchmark topological operators representing conditional constraint logic according to the graph ontology definition specifications.

[0037] In this implementation, after obtaining the initial draft text output by the language model, the system calls the underlying deterministic finite automaton string matching engine to perform a full scan of the character sequence of the initial draft text. Based on the encoding feature boundaries of special characters, all consecutive implicit masks present in the sequence are extracted. For any two adjacent consecutive implicit masks intercepted during the scanning process, the natural language connection fragments sandwiched between these two masks in the memory physical address segment are extracted. To map unstructured natural language text into Boolean logic that can be computed by machines, the system computes logical semantic state vectors through a pre-built logical inference classification network. The calculation formula is as follows: ;in, This represents the normalized exponential function; This represents the logical projection weight matrix obtained through pre-training with massive amounts of government regulatory texts; This represents a character-level feature embedding mapping function; This represents the logical projection bias tensor. Subsequently, extract... The largest component index in the text is directly mapped and instantiated as a text logical operator. To ensure the rigor of the logical analysis, a confidence threshold for the analysis is set. The threshold is determined by subtracting the standard deviation of the distribution from the lower bound of the predicted probabilities of all correctly classified samples on the model validation set. If the maximum component value is lower than... If the connection segment is not found to be in an unknown logical state, it will be downgraded to an unknown logical state to prevent out-of-bounds parsing. Simultaneously, the system encapsulates the two consecutive implicit masks extracted above into a query structure and initiates concurrent retrieval of the topological adjacency table through the underlying interface. After a matching triple is found, the original relation edge type recorded within that triple is extracted from the parsed return value. Based on the ontology definition architecture of the government affairs graph, the system hard-codes the native relation edge types into benchmark topological operators that represent absolute objective constraint rules. This allows for the construction of a comparative target of subjective and objective logic at the same connection position.

[0038] Specifically, the process of comparing the consistency between the two and replacing the connection fragments with standard related words bound by the original relation edge type when a mapping conflict occurs, rendering the implicit mask as a reference link to output the Q&A text, is as follows: Extract the text logical operator and perform a Boolean truth table comparison test with the baseline topological operator. When the text logical operator and the baseline topological operator are in the mutually exclusive quadrant, a topological mapping conflict signal is triggered; extract the standard related words bound by the original relation edge type in the topological adjacency table, and overwrite and replace the natural language connection fragments at the character offset positions corresponding to the initial draft text where the mapping conflict signal is generated; extract the implicit mask and the natural language text fragments in the source anchor dictionary, and concatenate the reference link tags in hypertext markup format to replace the corresponding implicit mask to output the Q&A text.

[0039] In this implementation scheme, the text logical operators at the same source location are obtained. With reference topology operator The system then converts it into a one-hot encoded format and inputs it into a preset Boolean truth check matrix. A comparative test was performed. The system calculated the topology mapping conflict state variables. Its calculation logic is as follows: ;in, Represents the transpose sequence of one-hot vectors of textual logical operators; This represents a two-dimensional Boolean truth check matrix, where the elements on the main diagonal are scalar zeros representing logical consistency, and the elements off the diagonal that are in the mutually exclusive logic quadrant are scalar ones representing logical conflicts. This represents the one-hot vector of the baseline topological operator. When the calculated... When the value equals scalar one, the system triggers a hardware-level interrupt instruction, throwing a topology mapping conflict signal. In response to this conflict signal, the system determines the topology mapping conflict based on the original relation edge type. Query the database to extract standard correlation terms that are absolutely bound to this edge type. Subsequently, the system retrieved the natural language connection fragment from the initial draft text. Corresponding starting character offset pointer offset pointer to terminating character It calls the memory overwrite interface and directly uses standard conjunctions within the corresponding physical memory address range. Replace the original erroneous connection segments. After completing all error correction processes, the system extracts the implicit mask remaining in the initial draft text and combines it with the natural language text segments mapped to it in the source anchor dictionary. Using Hypertext Markup Language formatting instructions, reference link tags are generated by concatenating them. The concatenation logic involves converting implicit masks into clickable, interactive code segments on the front end by inserting preset hyperlink action attribute specifiers. The system utilizes the generated reference link tags. The implicit mask in the initial draft text is replaced globally, and the original data structure with strict logical verification marks is rendered into source Q&A text that supports clicking to trace back to the original text.

[0040] Example 2; please refer to Figure 4 A traceable Q&A generation and verification system based on government knowledge graphs is used to execute the traceable Q&A generation and verification method based on government knowledge graphs described in the embodiments. The system includes: a constraint construction module, used to perform syntactic parsing on consultation texts to extract business tags, traverse the prerequisite nodes of the knowledge graph to construct a basic condition tree; map business tags to the basic condition tree through slots for attribute alignment, extract unmatched empty nodes to generate missing condition vectors, and merge them with business tags to construct a boundary constraint matrix; and a pathfinding and pruning module, used to perform multi-hop pathfinding in the knowledge graph based on the boundary constraint matrix to obtain candidate subgraphs, cross-compare node constraint attributes with missing condition vectors, prune and remove nodes with conflicting attributes and related edges to obtain derived subgraphs; assign unique identifiers to element nodes and relationship edges within the derived subgraphs, and map them... The system generates a source anchor dictionary and a topological adjacency list. A decoding generation module converts the consultation text and derived subgraphs into prompt sequences for input into a pre-trained language model. During the autoregressive decoding stage, a prefix tree is constructed based on the source anchor dictionary. The system monitors the hidden semantic state, triggers intervention in the candidate word probability distribution matrix during element node prediction, and forces sampling of the corresponding unique identifier as an implicit mask to inject into the decoding sequence, generating the initial draft text. A source verification module parses the initial draft text to extract continuous implicit masks and natural language connection fragments, converting them into text logic operators. The implicit mask is then reverse-mapped to the topological adjacency list, and the original relation edge types are read and converted into baseline topological operators. The consistency between the two is compared; in case of mapping conflicts, connection fragments are replaced according to the standard related words bound by the original relation edge types, and the implicit mask is rendered as a reference link to output the answer text.

[0041] In this implementation scheme, the constraint construction module undertakes the pre-processing functions of data parsing and feature boundary delineation. Its internal parsing engine performs syntactic parsing on the consultation text to separate business tags, and constructs a basic condition tree by traversing prerequisite nodes through the government knowledge graph via underlying interfaces. This module uses a slot mapping mechanism to fill the extracted business tags into the basic condition tree for attribute alignment, scans unmatched empty nodes in the tree structure, and converts them into missing condition vectors. Finally, this module performs tensor feature concatenation, fusing the missing condition vectors with the business tags to convert them into a boundary constraint matrix, thus transforming the unstructured consultation text into the structured query boundaries required for subsequent graph computation.

[0042] The pathfinding and pruning module takes the boundary constraint matrix as a query command, activates the matching starting seed node in the government knowledge graph, and performs multi-hop pathfinding based on a set step size to aggregate nodes along the path and directed relationships to generate candidate subgraphs. This module is responsible for extracting the constraint attributes of each node in the candidate subgraph and performing topological boundary cross-comparison with the missing condition vector. In the comparison operation, this module directly strips nodes that produce attribute conflicts and prunes the corresponding associated edges, extracting the residual connected components to form derived subgraphs. Subsequently, this module calls the identifier distribution interface to assign unique, non-repeatable identifiers to the feature nodes and relation edges in the derived subgraphs, and organizes key-value pairs to be written into the source anchor dictionary and topological adjacency table for structured persistent storage.

[0043] The decoding and generation module controls the autoregressive generation logic at the bottom layer of the pre-trained language model. It merges the consultation text and the expanded derivative subgraph into a prompt sequence, which is then fed into the model's encoding layer. Simultaneously, it reads the source anchor dictionary to construct a prefix tree for state transitions. During the model's decoding output cycle, this module continuously acquires the candidate word list from the model's hidden layer semantic state output and matches the currently output sequence with the prefix tree execution path. When it detects that a path transition hits a leaf node of the prefix tree, triggering feature node prediction, this module intercepts the regular sampling process at the bottom layer, applies a bias intervention to the candidate word probability distribution matrix, and forcibly increases the sampling probability weight of the corresponding unique identifier, appending it as an implicit mask to the generated initial text sequence.

[0044] The source verification module performs post-review and visualization rendering of the initial draft text. It uses a string matching component to scan the initial draft text, extracting continuous implicit masks and intermediate natural language connection fragments, and mapping them into text logic operators. This module uses the extracted implicit masks as index parameters to concurrently query the topological adjacency table, reading the original relational edge types of the records and translating them into baseline topological operators. Subsequently, the module inputs the two sets of operators into a Boolean verification matrix for consistency comparison. Upon capturing a topological mapping conflict signal, it directly calls the memory overwrite interface, replacing the connection fragments in the initial draft text with standard related words bound to the original relational edge types. Finally, it concatenates hypertext tags to translate the implicit masks into reference links and outputs the Q&A text.

[0045] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A traceable Q&A generation and verification method based on government knowledge graph, characterized in that, Includes the following steps: S1. Perform syntactic parsing on the consultation text to extract business tags, and traverse the prerequisite nodes of the knowledge graph to construct a basic condition tree; Business tags are mapped to the basic condition tree through slots for attribute alignment. Unmatched empty nodes are extracted to generate missing condition vectors, which are then merged with business tags to construct a boundary constraint matrix. S2. Based on the boundary constraint matrix, perform multi-hop pathfinding in the knowledge graph to obtain candidate subgraphs, cross-compare node constraint attributes and missing condition vectors, prune and remove nodes with conflicting attributes and related edges to obtain derived subgraphs; assign unique identifiers to element nodes and relational edges in the derived subgraphs, and map and generate a source anchor point dictionary and a topological adjacency table. S3. Transform the consultation text and derived subgraphs into prompt sequences and input them into the pre-trained language model. In the autoregressive decoding stage, construct a prefix tree based on the source anchor dictionary. Monitor the hidden semantic state, trigger the intervention of the candidate word probability distribution matrix when predicting element nodes, force the sampling of the corresponding unique identifier as an implicit mask to inject into the decoding sequence, and generate the first draft text; S4. Parse the initial draft text to extract continuous implicit masks and natural language connection fragments, convert them into text logic operators, reverse map the implicit masks to the topological adjacency list, read the original relation edge types and convert them into baseline topological operators; compare the consistency between the two, and replace the connection fragments according to the standard related words bound by the original relation edge types when there is a mapping conflict, and render the implicit mask as a reference link to output the Q&A text.

2. The method for generating and verifying traceable Q&A based on government knowledge graphs according to claim 1, characterized in that: The specific process of extracting business tags from the consultation text through syntactic parsing and traversing the prerequisite nodes of the knowledge graph to construct the basic condition tree is as follows: By splitting the consultation text with a pre-built semantic parsing engine to extract business entities and business actions, business tags containing subject, object and intent dimensions are generated. Map business tags to event meta-templates in the knowledge graph to extract event root nodes; Tracing forward along the directed dependency edges of the knowledge graph, the prerequisite nodes that have hierarchical constraints related to the event root node are extracted level by level. The event root node is used as the root, the constraints are used as tree edges, and the prerequisite nodes are used as branches to construct the basic condition tree according to the hierarchical dependency order.

3. The method for generating and verifying traceable Q&A based on government knowledge graphs according to claim 1, characterized in that: The specific process of mapping business tags to the basic condition tree for attribute alignment, extracting unmatched empty nodes to generate missing condition vectors, and merging them with business tags to construct the boundary constraint matrix is ​​as follows: Parse the branch node structure of the basic condition tree to extract standard condition slots, traverse the feature dimensions of the business tags to fill the corresponding standard condition slots and perform attribute feature comparison; Scan the basic condition tree to extract empty nodes in an empty state, extract the primitive semantic attributes and hierarchical depth weights of the empty nodes, and convert them into a high-dimensional representation sequence to generate a missing condition vector. The business labels are expanded into business feature tensors. The missing condition vectors are concatenated with the business feature tensors in the hidden layer dimension, and a nonlinear transformation is performed to construct the boundary constraint matrix.

4. The method for generating and verifying traceable Q&A based on government knowledge graphs according to claim 1, characterized in that: The specific process of obtaining candidate subgraphs by performing multi-hop pathfinding on the knowledge graph based on the boundary constraint matrix, cross-checking node constraint attributes with missing condition vectors, and pruning out nodes with conflicting attributes and related edges to obtain derived subgraphs is as follows: The boundary constraint matrix is ​​transformed into graph data query instructions. The starting seed node for matching features is activated in the knowledge graph. Based on the breadth-first strategy, the step size is limited and the nodes and directed relationships on the access path are aggregated to generate candidate subgraphs. Traverse the candidate subgraph to extract the applicable jurisdiction and effective range of independent nodes to form node constraint attributes, and perform topological boundary cross-comparison between the node constraint attributes and the missing condition vector; Remove conflicting nodes whose constraint attributes exceed the limit or generate mutual exclusion logic, prune the associated edges connecting conflicting nodes, and extract the connected components in the residual structure to obtain the derived subgraph.

5. The method for generating and verifying traceable Q&A based on government knowledge graphs according to claim 1, characterized in that: The specific process of assigning unique identifiers to feature nodes and relation edges within the derived subgraph, and mapping them to generate the source anchor dictionary and topological adjacency list, is as follows: Traverse the derived subgraph to extract the element nodes that map government parameters and the relational edges that connect the element nodes, and use a distributed ID generation algorithm to distribute unique identifiers that cannot be repeated for the element nodes and relational edges respectively; Extract natural language text fragments from feature nodes as keys and map unique identifiers of feature nodes as values ​​to organize and construct a dictionary of source anchor points for key-value pair structures; The system parses the directed connection directions and hierarchical dependency links formed between element nodes, concatenates the unique identifiers of the starting node, the relation edges, and the terminal nodes into a triple sequence, and performs structured storage to generate a topological adjacency table.

6. The method for generating and verifying traceable Q&A based on government knowledge graphs according to claim 1, characterized in that: The specific process of converting consultation text and derived subgraphs into prompt sequences input to a pre-trained language model, and constructing a prefix tree based on the source anchor dictionary during the autoregressive decoding stage, is as follows: Extract the character sequence of the consultation text, flatten the element nodes and relationship edges in the derived subgraph into a graph-text structure sequence according to the topological hierarchy, merge the character sequence and the graph-text structure sequence, and insert special instruction identifiers to generate a prompt sequence; The key-value pairs in the source anchor dictionary are parsed, natural language text fragments are extracted as node branches, unique identifiers are extracted as leaf nodes, and a multi-branch tree hierarchy is constructed according to the character arrangement order of the natural language text fragments to generate a prefix tree.

7. The method for generating and verifying traceable Q&A based on government knowledge graphs according to claim 1, characterized in that: The specific process of monitoring the hidden semantic state, triggering intervention in the candidate word probability distribution matrix during feature node prediction, and forcibly sampling the corresponding unique identifier as an implicit mask to inject into the decoding sequence to generate the initial draft text is as follows: In the autoregressive generation loop of the pre-trained language model, the feature vector matrix of the hidden layer output is extracted by monitoring the semantic state of the hidden layer to obtain the candidate word vocabulary, and the currently output decoded sequence is used as the matching prefix to perform state transition traversal in the prefix tree; When the state transition path hits a leaf node of the prefix tree, the prediction condition of the feature node is activated. The sampling probability weight of the dimension of the unique identifier attached to the leaf node is increased in the probability distribution matrix corresponding to the candidate word vocabulary. The probability of other candidate word dimensions is compressed. The unique identifier is extracted from the probability distribution matrix to generate an implicit mask and appended to the end of the decoding sequence. The process is iterated until the terminator is triggered and the first draft text is output.

8. The method for generating and verifying traceable Q&A based on government knowledge graphs according to claim 1, characterized in that: The process of parsing the initial draft text to extract continuous implicit masks and natural language connection fragments, converting them into text logical operators, and then inversely mapping the implicit masks to a topological adjacency list and reading the original relation edge types to convert them into baseline topological operators is as follows: Scan the initial draft text to match the mask feature character substrings to extract continuous implicit masks, extract the natural language connection fragments between two adjacent continuous implicit masks, and parse the natural language connection fragments into Boolean operation level text logic operators according to the preset semantic mapping rules; Extract two consecutive implicit masks as query indexes, input the topological adjacency list to retrieve matching triples, extract the native relation edge types recorded in the matching triples, and transform the native relation edge types into benchmark topological operators representing conditional constraint logic according to the graph ontology definition specification.

9. The method for generating and verifying traceable Q&A based on government knowledge graphs according to claim 1, characterized in that: The specific process of comparing the consistency between the two, replacing the connection fragment with the standard associated words bound by the original relation edge type when there is a mapping conflict, and rendering the implicit mask as a reference link to output the Q&A text is as follows: Extract the text logic operator and perform a Boolean truth table comparison test with the baseline topology operator. Trigger a topology mapping conflict signal when the text logic operator and the baseline topology operator are in the mutually exclusive quadrant. Extract the standard related words bound by the native relation edge type in the topological adjacency table, and overwrite and replace the natural language connection fragments at the character offset positions corresponding to the initial draft text where the mapping conflict signal is generated. Extract the implicit mask and natural language text fragments from the source anchor dictionary, concatenate hypertext markup format reference link tags to replace the corresponding implicit mask, and output the Q&A text.

10. A traceable Q&A generation and verification system based on government knowledge graph, used to execute the traceable Q&A generation and verification method based on government knowledge graph as described in any one of claims 1-9, characterized in that, include: The constraint construction module is used to perform syntactic parsing on consultation texts to extract business tags and traverse the prerequisite nodes of the knowledge graph to build a basic condition tree. Business tags are mapped to the basic condition tree through slots for attribute alignment. Unmatched empty nodes are extracted to generate missing condition vectors, which are then merged with business tags to construct a boundary constraint matrix. The pathfinding and pruning module is used to perform multi-hop pathfinding in the knowledge graph based on the boundary constraint matrix to obtain candidate subgraphs, cross-compare node constraint attributes and missing condition vectors, prune and remove nodes with conflicting attributes and related edges to obtain derived subgraphs; assign unique identifiers to element nodes and relational edges in the derived subgraphs, and map and generate a source anchor point dictionary and a topological adjacency table. The decoding and generation module is used to convert consultation text and derived subgraphs into prompt sequences to input into the pre-trained language model, and to build a prefix tree based on the source anchor dictionary during the autoregressive decoding stage; Monitor the hidden semantic state, trigger the intervention of the candidate word probability distribution matrix when predicting element nodes, force the sampling of the corresponding unique identifier as an implicit mask to inject into the decoding sequence, and generate the first draft text; The source verification module is used to parse the initial draft text to extract continuous implicit masks and natural language connection fragments, and convert them into text logic operators; it reverse maps the implicit masks to the topological adjacency list, reads the original relation edge types and converts them into baseline topological operators; it compares the consistency between the two, and when there is a mapping conflict, it replaces the connection fragments according to the standard related words bound by the original relation edge types, and renders the implicit mask as a reference link to output the Q&A text.