Intelligent learning question and answer analysis method based on government service and application system
By identifying the mutually exclusive relationships between cross-departmental rules and constructing decision trees, the government service Q&A system was optimized, resolving the issues of circular dependencies and timing conflicts between cross-departmental rules, providing personalized service path suggestions, and improving Q&A efficiency and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-26
- Publication Date
- 2026-06-23
AI Technical Summary
Existing government service Q&A systems are unable to effectively identify and handle circular dependencies and temporal conflicts between cross-departmental rules, lack consideration for users' personalized situations, resulting in inaccurate or impractical answers, low utilization of the knowledge base, and low Q&A efficiency.
By acquiring user question-and-answer data through semantic parsing, identifying mutually exclusive relationships between cross-departmental rules, generating conflict sets, calculating the time difference between user qualifications and the deadline for completing tasks, constructing decision trees and knowledge bases, optimizing task paths, and using deep learning models to recommend resolution paths.
It enables intelligent identification and processing of cross-departmental rules, provides personalized service path suggestions, improves the efficiency and operability of Q&A, reduces the intervention of human customer service, and enhances the practicality and pertinence of government services.
Smart Images

Figure CN122262289A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and government services technology, specifically to an intelligent learning question-answering analysis method and application system based on government services. Background Technology
[0002] With the deepening of the digital transformation of government services, government departments at all levels have established numerous online Q&A systems to improve service efficiency. When handling cross-departmental government matters, users often face problems such as conflicting rules between multiple departments and complex procedures. Traditional Q&A systems mainly rely on human customer service or simple keyword matching technology, which struggles to effectively identify and handle mutually exclusive relationships between cross-departmental rules, resulting in inaccurate or impractical answers for users.
[0003] Existing technologies include rule-based government Q&A systems that match user questions with preset rules and return answers. However, these systems cannot automatically identify circular dependencies and timing conflicts in cross-departmental processes. When a user inquires about matters requiring collaboration from multiple departments, the system cannot provide reasonable service path suggestions. Furthermore, existing systems lack consideration for user personalization and fail to dynamically adjust the priority of service paths based on factors such as the validity period of user qualifications and completed service milestones.
[0004] Existing technologies also suffer from low knowledge base utilization. Although historical question-and-answer data contains a large number of successful case studies, there is a lack of effective statistical analysis and mapping mechanisms to transform this experiential knowledge into reusable solution paths. The system often needs to recalculate when faced with new questions, failing to respond quickly to high-frequency issues, thus impacting question-and-answer efficiency and user experience. Summary of the Invention
[0005] The purpose of this invention is to provide an intelligent learning question-and-answer analysis method and application system based on government services, aiming to solve at least one of the technical problems existing in the prior art.
[0006] The technical solution of this invention is: an intelligent learning question-answering analysis method based on government services, comprising the following steps:
[0007] Obtain user-submitted question and answer data and perform semantic parsing to extract intent features and entity features to obtain semantic representations;
[0008] Based on entity features in semantic representation, the mutual exclusion relationship of cross-departmental rules is identified in the pre-set government affairs rule base, conflict elements and constraints are extracted, and a conflict set is generated.
[0009] For each conflict element in the conflict set, calculate the time difference between the validity period of the user's qualification and the deadline for completing the task. When the time difference is less than the preset priority threshold, set a time priority flag for the current conflict element.
[0010] Based on the constraints and time-priority indicators in the conflict set, and combined with the user's completed tasks, a decision tree containing multiple resolution paths is constructed, and the resolution paths with time-priority indicators are adjusted to be the preferred paths.
[0011] Extract resolution records containing the same conflict elements from historical question and answer data, count the resolution paths corresponding to each resolution record, select resolution paths that have been used more than a threshold to establish a mapping relationship with the conflict elements, and form a knowledge base;
[0012] When new question-and-answer data is received, the knowledge base is queried to obtain a matching resolution path. If the query is successful, the matching resolution path is directly output. If the query fails, the preferred path is selected from the decision tree and the response text is output.
[0013] Based on entity features in semantic representation, the mutual exclusion relationships of cross-departmental rules are identified in a pre-defined government affairs rule base. Conflict elements and constraints are extracted to generate a conflict set, including:
[0014] Entity features are extracted from semantic representations, and the subject and items of the service in the entity features are combined to construct query key values. Based on the query key values, government rules are retrieved from a preset government rule base to obtain an association rule set.
[0015] Extract the department identifier and material name of each government rule in the association rule set. Using the department identifier as a node, when the material name required by one government rule is the same as the material name produced by another government rule, establish a directed edge between the corresponding department identifiers to construct a dependency graph.
[0016] The dependency graph is traversed to detect closed paths. When a closed path exists, it is identified as a circular dependency and mutual exclusion relationship. The department identifier and material name on the closed path are extracted as circular conflict elements.
[0017] Extract the time constraints of two government rules that do not form a closed path in the dependency graph as constraints, calculate the time difference between the constraints of the preceding and subsequent rules, and treat the corresponding constraints as time conflict elements when the time difference is negative.
[0018] The cyclical conflict elements and the temporal conflict elements are grouped into conflict elements, which are then associated with the service subject and the service item to generate a conflict set.
[0019] Depth-first traversal of the dependency graph to detect closed paths includes:
[0020] Select the department identifier in the dependency graph as the traversal starting point, create a path stack and push the traversal starting point onto the path stack, and mark the traversal starting point as being visited.
[0021] Get the outgoing edge of the door icon at the top of the path stack, and extract the target department icon that the outgoing edge points to;
[0022] When the target department identifier is marked as being visited, extract the consecutive department identifiers from the target department identifier to the top of the stack to form a closed node sequence. When the target department identifier is marked as not visited, mark the target department identifier as being visited and push it onto the path stack.
[0023] Mark the door icon at the top of the path stack as visited and pop it from the path stack. Continue to obtain the outgoing edges of the door icons at the top of the stack while the path stack is not empty. When the path stack is empty and there are unvisited department icons, select a new department icon as the starting point for traversal.
[0024] For each conflict element in the conflict set, calculate the time difference between the validity period of the user's qualification and the deadline for completing the task. When the time difference is less than a preset priority threshold, set a time priority flag for the current conflict element, including:
[0025] Iterate through each conflict element in the conflict set, extract the constraints associated with each conflict element, and extract the time limits in each constraint as the deadline for completing the task corresponding to each conflict element.
[0026] Extract the validity period of user qualifications from the Q&A data submitted by users, and calculate the time difference between the validity period of user qualifications and the deadline for completing the task for each conflicting element.
[0027] Extract conflicting elements whose time difference is less than a preset priority threshold and their corresponding time differences to form a set of urgent conflicting elements.
[0028] For each conflict element in the set of urgent conflict elements, the ratio of the time difference corresponding to each conflict element to the preset priority threshold is calculated, and the ratio is used as the time urgency coefficient of each conflict element.
[0029] By embedding the timeliness urgency coefficient into the timeliness priority identifier, a timeliness priority identifier carrying the timeliness urgency coefficient is generated for each conflicting element.
[0030] Based on the constraints and time-priority indicators in the conflict set, and combined with the user's completed tasks, a decision tree containing multiple resolution paths is constructed. The resolution paths with time-priority indicators are then adjusted to be the preferred paths, including:
[0031] The constraints bound to each conflicting element are compared with the tasks completed by the user. Uncovered constraints in each conflicting element are extracted. The ratio of the number of uncovered constraints to the total number of bound constraints is used as the progress weight of each conflicting element. The time priority indicator is marked to the corresponding uncovered constraint.
[0032] Uncovered constraints that belong to two or more conflicting elements are marked as shared constraints. A decision tree is constructed using all uncovered constraints as nodes, each node carrying the time priority identifier of the corresponding constraint, and the order dependency relationship between constraints as directed edges.
[0033] The path completion degree is calculated based on the average progress weight of the conflict elements to which the nodes belong on each resolution path, and the path reuse degree is calculated based on the ratio of the number of shared constraints on each resolution path to the total number of nodes on the path.
[0034] The timeliness density is the ratio of the number of nodes carrying timeliness priority markers on each resolution path to the total number of nodes on the path.
[0035] The comprehensive priority index of each resolution path is obtained by weighting and integrating the timeliness density, path completion degree and path reuse degree according to the preset weights. Resolution paths with non-zero timeliness density are arranged in descending order of comprehensive priority index and adjusted to be the preferred selection paths.
[0036] Extract resolution records containing the same conflict elements from historical question-and-answer data, statistically analyze the resolution paths corresponding to each resolution record, and establish a mapping relationship between resolution paths used more than a threshold and the conflict elements to form a knowledge base including:
[0037] Filter resolution records containing the same conflict elements from historical Q&A data, and extract the resolution path and the responsible party for each resolution record;
[0038] For each resolution path, the material name produced by the preceding department is identified as the transmission relationship of the input material of the subsequent department, a material transmission chain is established, and the ratio of the number of department identifiers covered by the material transmission chain to the total number of department identifiers in the resolution path is calculated as the path connectivity.
[0039] The number of times each resolution path is used is counted, and the resolution paths whose usage exceeds a preset threshold and whose path connectivity is greater than a preset connectivity threshold are selected to construct a training set.
[0040] The service entities in the training set are converted into input feature vectors, the resolution paths are converted into output label vectors, and the path connectivity is used as the sample weights to train the path recommendation model.
[0041] The relevant entities corresponding to the conflict elements are converted into query feature vectors, which are then input into the trained path recommendation model to obtain recommended resolution paths.
[0042] Extract the material transfer chain from the recommended resolution path, match and verify the material transfer chain with the constraints bound to the conflict element, and when the matching verification is successful, select the recommended resolution path that has been used more than a preset threshold number of times and establish a mapping relationship with the conflict element to form a knowledge base.
[0043] Path recommendation models trained using path connectivity as sample weights include:
[0044] A neural network structure containing an input layer, a hidden layer, and an output layer is constructed as a path recommendation model, and a material transport chain attention mechanism is embedded in the hidden layer.
[0045] The input feature vector is input into the input layer of the path recommendation model and passed from the input layer to the hidden layer. The material transfer chain attention mechanism calculates the association weight of the material transfer relationship between department identifiers based on the input feature vector received by the hidden layer.
[0046] The hidden layer feature representation is weighted and adjusted based on the association weights to obtain the adjusted hidden layer feature representation. The adjusted hidden layer feature representation is then passed to the output layer to generate the predicted label vector.
[0047] Extract the path connectivity corresponding to each solution record in the training set as the training sample weight, calculate the loss value between the predicted label vector and the output label vector, and sum the loss values of each training sample using the training sample weight to obtain the weighted total loss.
[0048] The path recommendation model parameters are updated based on the associated weights output by the weighted total loss and the material transport chain attention mechanism. The trained path recommendation model is obtained when the weighted total loss converges.
[0049] When new question-and-answer data is received, the knowledge base is queried to obtain a matching resolution path. If the query is successful, the matching resolution path is directly output. If the query fails, the preferred path is selected from the decision tree, and the output response text includes:
[0050] Receive new question and answer data, extract the service subject and conflict elements from the new question and answer data, and convert the service subject into a query feature vector;
[0051] Input the query feature vector into the path recommendation model in the knowledge base. The path recommendation model outputs the recommended resolution path and the path confidence. Compare the path confidence with a preset confidence threshold. When the path confidence is greater than the preset confidence threshold, it is determined that the query of the knowledge base is successful. The recommended resolution path is used as the matching resolution path and the matching resolution path is directly output.
[0052] When the path confidence is less than the preset confidence threshold, the query to the knowledge base is deemed to have failed. Based on the conflicting elements in the new question and answer data, the preferred path with the highest comprehensive priority index is selected from the decision tree.
[0053] The selected preferred path is converted into a path label vector. The query feature vector and the path label vector are combined to construct an update sample. The update sample is input into the path recommendation model to update the model parameters. The path recommendation model with updated parameters is reprocessed with the query feature vector to output an updated and resolved path.
[0054] Extract the department identifier sequence and material name sequence from the update resolution path, organize the department identifier sequence and material name sequence into a structured text description according to the processing order, and output the response text.
[0055] This invention provides an intelligent learning question-and-answer analysis system based on government services, the system comprising:
[0056] The semantic parsing module is used to acquire user-submitted question and answer data and perform semantic parsing to extract intent features and entity features to obtain semantic representations.
[0057] The conflict identification module is used to identify mutually exclusive relationships between cross-departmental rules in a pre-set government affairs rule base based on entity features in semantic representation, extract conflict elements and constraints, and generate a conflict set.
[0058] The timeliness identification module is used to calculate the time difference between the validity period of the user's qualification and the deadline for completing the task for each conflict element in the conflict set. When the time difference is less than the preset priority threshold, a timeliness priority identification is set for the current conflict element.
[0059] The decision tree construction module is used to construct a decision tree containing multiple resolution paths based on the constraints and time priority indicators in the conflict set, combined with the user's completed task nodes, and to adjust the resolution paths with time priority indicators to the preferred selection paths;
[0060] The knowledge base construction module is used to extract resolution records containing the same conflict elements from historical question and answer data, count the resolution paths corresponding to each resolution record, select resolution paths that have been used more than a threshold to establish a mapping relationship with the conflict elements, and form a knowledge base.
[0061] The path output module is used to query the knowledge base to obtain a matching resolution path when new question and answer data is received. If the query is successful, the matching resolution path is directly output. If the query fails, the preferred path is selected from the decision tree and the response text is output.
[0062] One technical solution provided in this embodiment of the invention is a computer-readable storage medium storing computer program instructions, which, when executed by a processor, implement the steps in any of the aforementioned methods.
[0063] This invention systematically identifies and resolves rule conflicts by identifying mutually exclusive relationships among cross-departmental rules in the government affairs rule base and generating conflict sets. This overcomes the technical limitations of existing technologies that cannot effectively identify cross-departmental business circular dependencies and temporal conflicts. By calculating the time difference between the validity period of a user's qualifications and the deadline for completing the task, and setting a time-priority identifier, it achieves path optimization based on the user's individual circumstances. This ensures that users receive optimal task path suggestions within tight deadlines, improving the practicality and relevance of government services. By constructing a decision tree containing multiple resolution paths and adjusting the path based on the user's completed task nodes, it provides users with highly actionable task guidance, avoiding the problem of path suggestions being out of touch with the user's actual progress. It also enables the automatic accumulation and reuse of successful experiences. When receiving new question-and-answer data, it can directly query the knowledge base to quickly respond to high-frequency questions, significantly improving question-and-answer efficiency and reducing the cost of human customer service intervention. Attached Figure Description
[0064] Figure 1 A flowchart illustrating the intelligent learning question-answering analysis method based on government services provided in this embodiment of the invention;
[0065] Figure 2 This is a schematic diagram of the structure of the intelligent learning question-and-answer analysis system based on government services according to an embodiment of the present invention. Detailed Implementation
[0066] like Figure 1 As shown, Figure 1 A flowchart of an intelligent learning question-answering analysis method based on government services provided in an embodiment of the present invention is shown. The method includes the following steps:
[0067] Step 101: Obtain the question and answer data submitted by the user and perform semantic parsing to extract intent features and entity features to obtain semantic representation.
[0068] Step 102: Based on entity features in semantic representation, identify mutually exclusive relationships between cross-departmental rules in the preset government affairs rule base, extract conflict elements and constraints, and generate a conflict set.
[0069] In some embodiments of the present invention, step 102 may specifically include the following sub-steps:
[0070] Sub-step 1021: Extract entity features from semantic representation, combine the subject of the service and the service item in the entity features to construct a query key value, and retrieve government rules in the preset government rule base based on the query key value to obtain an association rule set;
[0071] Sub-step 1022: Extract the department identifier and material name of each government rule in the association rule set. Using the department identifier as a node, when the material name required by one government rule is the same as the material name produced by another government rule, establish a directed edge between the corresponding department identifiers to construct a dependency graph.
[0072] Sub-step 1023: Perform a depth-first traversal of the dependency graph to detect closed paths. When a closed path exists, it is identified as a circular dependency and mutual exclusion relationship. Extract the department identifier and material name on the closed path as circular conflict elements.
[0073] Sub-step 1024: Extract the time limits of two government rules that do not form a closed path in the dependency graph as constraints, calculate the time difference between the constraints of the preceding rule and the subsequent rule, and when the time difference is negative, treat the corresponding constraint as a time conflict element.
[0074] Sub-step 1025: The cyclical conflict elements and the temporal conflict elements are grouped into conflict elements, which are then associated and bound with the service subject and the service item to generate a conflict set.
[0075] When extracting entity features from semantic representations, deep learning technology is used to process user-input queries, identifying the service providers and service items contained within. Service providers can be individuals applying for business registration, legal representatives of small businesses, etc.; service items include business registration, tax registration, social security account opening, etc. The extracted service providers and service items are combined into query key-value pairs, such as "individual business owner - business license application". The government affairs rule base stores the service rules formulated by various departments, each rule containing fields such as department identifier, material name, and time limit. Using the constructed query key-value pairs, a retrieval operation is performed in the government affairs rule base. A semantic matching algorithm is used to find all government affairs rules related to the current service requirement, forming a set of associated rules. When querying "individual business owner - business license application", multiple associated rules may be retrieved, such as business license application rules from the business administration department, tax registration rules from the tax department, and bank account opening rules.
[0076] The department identifiers and material names of each government rule in the association rule set are extracted to construct a dependency graph between government rules. Department identifiers indicate the department to which the rule belongs, such as the Industry and Commerce Bureau, Tax Bureau, and Social Security Center; material names indicate the materials required or generated during the processing, such as business licenses and tax registration certificates. When constructing the dependency graph, each department identifier is treated as a node. When the material name required by one government rule is the same as the material name generated by another government rule, a directed edge is established between the corresponding department identifiers, indicating that the former depends on the latter. For example, if the tax registration rule requires a business license, and the business license is generated by the Industry and Commerce Bureau, a directed edge is established between the Tax Bureau node and the Industry and Commerce Bureau node, pointing from the Tax Bureau to the Industry and Commerce Bureau. In this way, all rule dependencies in the association rule set are constructed into a directed graph structure, intuitively reflecting the business dependencies between departments.
[0077] A depth-first search (DFS) is performed on the constructed dependency graph to detect closed paths. A closed path is a loop that starts from a node, traverses a series of directed edges, and returns to the starting node. Using a DFS algorithm, each unvisited node in the dependency graph is traversed, and its reachability is marked. When a node's successor is found in the current path, a closed path is detected, identifying it as a circular dependency. The department identifiers and material names involved in the closed path are extracted as circular conflict elements. For example, if the Industry and Commerce Bureau requires a bank account opening certificate, the bank account opening requires a tax registration certificate, and the tax registration requires a business license, forming a closed path "Industry and Commerce Bureau → Bank → Taxation Bureau → Industry and Commerce Bureau," then the identifiers of these three departments, along with their corresponding business licenses, account opening certificates, and tax registration certificates, are extracted as circular conflict elements.
[0078] For rule pairs with directed edges that do not form closed paths in the dependency graph, their time constraints are extracted as constraints for analysis. Each government rule typically includes time-limited elements, such as the validity period of prerequisite materials and the approval cycle. The time difference between the constraints of the preceding and subsequent rules is calculated to determine whether a time conflict exists. A negative time difference indicates that the materials generated by the preceding rule have exceeded their validity period by the time the subsequent rule requires submission, and the corresponding constraint is identified as a time conflict element. For example, if the processing cycle for a business license is 15 working days, while tax registration requires the business license to be issued within 10 working days, the time difference is -5 working days, constituting a time conflict.
[0079] The identified cyclical and temporal conflict elements are aggregated and associated with the currently processed service entity and service item to generate a complete conflict set. This conflict set is stored in a structured data format, containing key information such as conflict type, involved departments, conflicting materials, and time constraints. This conflict set can be used for internal rule optimization analysis or transformed into user-friendly prompts to help users understand potential obstacles. Through the generation and analysis of conflict sets, intelligent identification and processing of cross-departmental rule exclusion relationships in government services are achieved.
[0080] This invention constructs an inter-departmental dependency graph through semantic feature extraction and government rule retrieval, and effectively solves the problem of incoordination of cross-departmental rules in traditional government services by identifying circular dependencies and temporal conflicts using graph theory algorithms. This invention can automatically discover mutually exclusive relationships hidden in complex rule systems, avoiding repeated trips between multiple departments for applicants and reducing duplicate submissions and expired applications. By extracting and aggregating conflicting elements, it provides data support for optimizing government service rules and re-engineering processes, promoting the standardization and normalization of government services.
[0081] Sub-step 1023, performing a depth-first traversal of the dependency graph to detect closed paths, also includes:
[0082] Select the department identifier in the dependency graph as the traversal starting point, create a path stack and push the traversal starting point onto the path stack, and mark the traversal starting point as being visited.
[0083] Get the outgoing edge of the door icon at the top of the path stack, and extract the target department icon that the outgoing edge points to;
[0084] When the target department identifier is marked as being visited, extract the consecutive department identifiers from the target department identifier to the top of the stack to form a closed node sequence. When the target department identifier is marked as not visited, mark the target department identifier as being visited and push it onto the path stack.
[0085] Mark the door icon at the top of the path stack as visited and pop it from the path stack. Continue to obtain the outgoing edges of the door icons at the top of the stack while the path stack is not empty. When the path stack is empty and there are unvisited department icons, select a new department icon as the starting point for traversal.
[0086] When performing a depth-first search algorithm to detect closed paths in a dependency graph, the algorithm uses a path stack structure to record the current traversal path and avoids repeated visits by marking the node status, thus effectively detecting circular dependencies between government rules.
[0087] Before performing a depth-first traversal of the dependency graph, the node states must be initialized. Each department identifier node in the dependency graph can be in one of three states: unvisited, being visited, or visited. Unvisited means that the node has not yet been processed by the traversal algorithm; being visited means that the node is currently on the traversal path; and visited means that the node and all its outgoing edges have been processed. Before the traversal begins, the initial state of all department identifier nodes is set to unvisited, and an empty path stack is created to record the traversal path.
[0088] Select an unvisited department identifier in the dependency graph as the starting point for traversal. For example, in the dependency graph related to processing individual business licenses, select the business registration department as the starting node. Push this starting node onto the path stack and mark its status as being visited. The path stack uses a last-in-first-out (LIFO) data structure. The top element of the stack represents the department identifier currently being processed, and the sequence of elements in the stack reflects the complete path from the starting node to the current node.
[0089] Retrieve all outgoing edges from the top door identifier of the path stack, i.e., the relationships between other departments that the current department depends on. For example, the business registration department may depend on tax payment certificates provided by the tax department, so there is an outgoing edge between the business registration department and the tax department. For each outgoing edge, extract the identifier of the target department that the outgoing edge points to, such as the identifier of the tax department. Outgoing edge information is obtained from the adjacency list or adjacency matrix of the dependency graph, including attributes such as the source department, the target department, and the name of the associated material.
[0090] The current state of the target department identifier is determined, and corresponding processing logic is executed according to different states. When the target department identifier is in the "accessing" state, it indicates that the department already exists on the current traversal path, i.e., a closed path is detected. The continuous department identifiers from the target department identifier to the top of the stack are extracted from the path stack to form a closed node sequence. For example, if the business registration department depends on the tax department, the tax department depends on bank account opening, and bank account opening depends on the business registration department, then the tax department is detected as being in the "accessing" state. The continuous department identifiers from the tax department to the top of the stack are extracted to obtain the closed node sequence: tax department → bank → business registration department → tax department. This closed node sequence is recorded as a circular dependency relationship, and the names of related materials, such as tax payment certificates, bank account opening certificates, and business licenses, are extracted to form a complete circular conflict element.
[0091] When the target department's status is "unvisited," it means that the department has not yet been processed. It is then marked as "visited" and pushed onto the path stack, and the depth-first traversal continues. If the outgoing edge from the business registration department points to the tax department, which is also "unvisited," the tax department is pushed onto the top of the stack, its status is updated to "visited," and the outgoing edges from the tax department are processed.
[0092] When the target department's status is marked as visited, it means that the department has been traversed and no further processing is needed; we can directly check the next outgoing edge. This status marking mechanism avoids repeated visits during the traversal process, improving algorithm efficiency.
[0093] After processing all outgoing edges from the door marker at the top of the stack, update its status to visited and pop it from the path stack, then backtrack to the previous node to continue processing. If all outgoing edges from the tax department have been processed, mark the tax department as visited and pop it from the stack, then return to the business registration department to continue processing the remaining outgoing edges.
[0094] When the path stack is not empty, continue processing the outgoing edges of the door identifiers at the top of the stack; when the path stack is empty and there are still unvisited department identifiers in the dependency graph, select a new unvisited department identifier as the starting point for traversal, create a new path stack, and continue the above process. This approach ensures a complete traversal of the disconnected graph and avoids missing isolated circular dependencies.
[0095] The depth-first search algorithm described above can comprehensively identify closed paths in the dependency graph and pinpoint circular dependencies between government rules. For each detected closed path, the department identifiers and related material names are extracted to form the elements of a circular conflict. For example, if a circular dependency is identified in the process of obtaining a business license for an individual business owner—"Business registration requires a tax certificate, a tax certificate requires a bank account opening certificate, and a bank account opening certificate requires a business license"—the identifiers of the business registration department, tax department, and bank institution, as well as the material names of the business license, tax certificate, and bank account opening certificate, are extracted to form a complete description of the circular conflict.
[0096] This invention employs a depth-first search algorithm combining path stacks and state markers to accurately locate closed-loop structures in complex dependency networks, providing clear guidance for subsequent conflict resolution. This invention features low computational complexity and low memory footprint, making it suitable for detecting circular dependencies in large-scale government rule bases. Compared to traditional manual review methods, it comprehensively uncovers circular dependencies hidden within complex rule systems, preventing users from making unnecessary trips between multiple departments and significantly improving the efficiency of government services and user experience.
[0097] Step 103: For each conflict element in the conflict set, calculate the time difference between the validity period of the user's qualification and the deadline for completing the task. When the time difference is less than the preset priority threshold, set a time priority flag for the current conflict element.
[0098] In some embodiments of the present invention, step 103 may specifically include the following sub-steps:
[0099] Sub-step 1031: Traverse each conflict element in the conflict set, extract the constraints associated with each conflict element, and extract the time limit in each constraint as the deadline for completing the task corresponding to each conflict element.
[0100] Sub-step 1032: Extract the validity period of user qualifications from the question and answer data submitted by the user, and calculate the time difference between the validity period of user qualifications and the deadline for completing the task for each conflicting element.
[0101] Sub-step 1033: Extract conflict elements with time differences less than a preset priority threshold and their corresponding time differences to form a set of urgent conflict elements;
[0102] Sub-step 1034: For each conflict element in the set of urgent conflict elements, calculate the ratio of the time difference corresponding to each conflict element to the preset priority threshold, and use the ratio as the time urgency coefficient of each conflict element.
[0103] Sub-step 1035: Embed the timeliness urgency coefficient into the timeliness priority identifier to generate a timeliness priority identifier carrying the timeliness urgency coefficient for each conflicting element.
[0104] The process iterates through each conflict element in the conflict set, obtaining its structured data information. Conflict elements typically include attributes such as department identifiers, material names, and constraints, with the constraints containing time limits for the workflow. The constraints associated with each conflict element are extracted, their data structure is parsed, and the time limit attributes are located. Time limits can be expressed as material validity periods, approval cycles, or completion deadlines. These time limit values are extracted as the completion deadlines for each conflict element. Taking the scenario of processing applications for individual businesses as an example, the time limits in the conflict elements might include a 15-working-day processing period for a business license, a 12-working-day time limit for tax registration, and a 7-working-day time limit for opening a bank account. These time limit values are standardized into a standard date format for easy subsequent time difference calculations.
[0105] The validity period of user qualifications is extracted from user-submitted Q&A data. These qualifications may be certificates, licenses, or other credentials already held by the user. The validity period information in the Q&A data may appear as explicit dates or expressed in descriptive language. For descriptive language, semantic understanding technology is used to parse out specific time points. The user qualification validity period information is standardized into a date format, consistent with the time representation of the service completion deadline. For each conflicting element, the time difference between the user qualification validity period and the corresponding service completion deadline is calculated. The time difference calculation uses a date difference algorithm, considering the difference between working days and calendar days, to determine the size of the actual operable time window. For example, if a user's business license has 20 working days remaining, while tax registration requires 12 working days, the corresponding time difference is 8 working days.
[0106] Conflict elements with time differences less than a preset priority threshold are extracted, along with their corresponding time differences. The preset priority threshold is a time critical point set based on experience in government services, representing the size of the time window requiring priority processing, typically set to 10 working days. When the calculated time difference is less than this threshold, it means that the related matters of the conflict element have time urgency and need to be resolved first. Conflict elements with time differences less than the preset priority threshold are filtered out from the original conflict set and stored together with their corresponding time differences in an urgent conflict element set. The urgent conflict element set is stored using a priority queue data structure, which can automatically sort according to the time difference; the smaller the time difference, the higher the priority.
[0107] For each conflict element in the set of urgent conflict elements, the ratio of the time difference corresponding to each conflict element to a preset priority threshold is calculated. This ratio is used as the timeliness urgency coefficient for each conflict element. The timeliness urgency coefficient is a normalized value, ranging from 0 to 1, with values closer to 0 indicating greater urgency. For example, if the time difference is 4 working days and the preset priority threshold is 10 working days, the timeliness urgency coefficient is 0.4. When the time difference is negative, it indicates that the user's qualification validity period is insufficient to complete the relevant procedures; in this case, the timeliness urgency coefficient is directly set to 0, indicating the highest level of urgency. By quantifying the timeliness of conflict elements, the timeliness urgency coefficient provides a precise basis for subsequent intelligent question-and-answer priority ranking.
[0108] By embedding the urgency coefficient into the timeliness priority identifier, a timeliness priority identifier carrying the urgency coefficient is generated for each conflicting element. The timeliness priority identifier adopts a standardized data structure, including attributes such as identifier type, urgency coefficient, and associated conflicting elements. The identifier type is set to timeliness priority, the urgency coefficient field stores the timeliness urgency coefficient calculated in the previous step, and the associated conflicting element field stores the corresponding conflicting element information. In this way, a priority identifier carrying a timeliness urgency coefficient is generated for each time-sensitive conflicting element. The timeliness priority identifier is associated and bound to the original conflicting element through additional attributes, without changing the data structure of the original conflicting element, thus maintaining data integrity.
[0109] Timeliness priority tags, carrying a timeliness urgency coefficient, are applied to the intelligent question-answering analysis process. When users inquire about government services, the answers are sorted and highlighted based on these priority tags. Content related to conflicting elements with lower urgency coefficients is placed at the beginning of the answer, accompanied by clear prompts to guide users to prioritize these time-sensitive matters. For conflicting elements with multiple timeliness priority tags, they are arranged in ascending order of urgency coefficient, ensuring users see the most urgent information first. Timeliness priority tags also trigger additional suggestions in the question-answering response, such as providing expedited processing channels and appointment scheduling, helping users efficiently complete government matters within a limited timeframe.
[0110] This invention achieves accurate identification and quantification of the timeliness of conflicting elements in government services through a timeliness priority identifier generation method, solving the problem of traditional government Q&A systems' inability to distinguish the urgency of service matters. By calculating time difference and quantifying urgency coefficients, it can quickly identify the most time-sensitive service matters for users from a massive amount of government rules and highlight them through timeliness priority identifiers. The application of timeliness priority identifiers significantly improves the accuracy and relevance of government services, preventing users from ignoring timeliness requirements and causing problems such as expired qualifications and invalid materials, thus reducing service costs and time losses.
[0111] Step 104: Based on the constraints and time-priority identifiers in the conflict set, and combined with the user's completed tasks, construct a decision tree containing multiple resolution paths, and adjust the resolution paths with time-priority identifiers to be the preferred paths.
[0112] In some embodiments of the present invention, step 104 may specifically include the following sub-steps:
[0113] Sub-step 1041: Compare the constraints bound to each conflicting element with the completed tasks of the user, extract the uncovered constraints in each conflicting element, use the ratio of the number of uncovered constraints to the total number of bound constraints as the progress weight of each conflicting element, and mark the time priority indicator to the corresponding uncovered constraint.
[0114] Sub-step 1042: Mark the uncovered constraints that belong to two or more conflicting elements as shared constraints, construct a decision tree with all uncovered constraints as nodes, each node carrying the time priority identifier of the corresponding constraint, and the order dependency relationship between constraints as directed edges.
[0115] Sub-step 1043: Calculate the path completion degree based on the average progress weight of the conflict elements to which the nodes belong on each resolution path, and calculate the path reuse degree based on the ratio of the number of shared constraints on each resolution path to the total number of nodes on the path.
[0116] Sub-step 1044: The ratio of the number of nodes carrying time priority identifiers on each resolution path to the total number of nodes on the path is used as the time density.
[0117] Sub-step 1045: The timeliness density, path completion degree and path reuse degree are weighted and integrated according to preset weights to obtain the comprehensive priority index of each resolution path. The resolution paths with timeliness density not equal to zero are arranged in descending order according to the comprehensive priority index and adjusted to be the preferred selection paths.
[0118] The constraints associated with each conflicting element are compared with the user's completed service steps to form the basis for evaluating service progress. Constraints in conflicting elements typically include prerequisite material requirements, qualification requirements, and processing time limits. Completed service steps can be extracted from historical interaction data, recording the steps and materials the user has completed during the government service process. The comparison process uses a semantic matching algorithm to calculate the similarity between the constraints and the descriptions of completed steps. When the similarity exceeds a set threshold, a successful match is determined, and the constraint is considered covered. For individual business owners, constraints may include more than ten items such as identity verification materials, proof of premises, and a description of the business scope. If the user has already submitted identity verification and proof of premises, these two constraints are marked as covered.
[0119] Extract the uncovered constraints from each conflict element and calculate the progress weight index. Uncovered constraints refer to those constraints that failed to match the user's completed nodes during the comparison process, representing tasks the user still needs to complete. Calculate the progress weight by comparing the number of uncovered constraints in a conflict element with the total number of constraints bound to that conflict element. The progress weight ranges from 0 to 1; a smaller value indicates higher completion progress for the conflict element. For a conflict element containing five constraints, if two of them have been covered by the user's completed nodes, the number of uncovered constraints for that conflict element is three, and the progress weight is 0.6. For conflict elements with a time-priority identifier, pass this identifier and mark it on its corresponding uncovered constraints, ensuring that the time-priority characteristic is retained in subsequent path construction.
[0120] Uncovered constraints belonging to two or more conflicting elements are marked as shared constraints. Reusable nodes in the process are identified. Shared constraints are identical constraints appearing in different conflicting elements; completing one constraint satisfies the requirements of multiple conflicting elements simultaneously. Equivalence relationships between constraints are identified through text similarity calculations; constraints with a similarity exceeding 0.85 are considered identical. In the scenario of individual business owners, the constraint "proof of legal use of premises" may appear in both business license and food business permit applications, and is thus marked as a shared constraint. A decision tree structure is constructed using all uncovered constraints as nodes. Each node in the decision tree corresponds to a specific constraint, carrying the time priority identifier inherited by that constraint. Nodes are connected by directed edges, which represent the order dependencies between constraints; these dependencies are extracted from the government rules database.
[0121] In a decision tree, each path from the root node to a leaf node constitutes a possible resolution path, representing a possible order in which a user resolves a conflict. For each node on the path, the progress weight of its associated conflict element is obtained, and the average progress weight of all nodes on the path is calculated. Inverting this average yields the path completion index, representing the overall progress of the resolution path. The path completion index ranges from 0 to 1; a higher value indicates a higher overall completion progress. Based on the ratio of the number of shared constraint nodes on each resolution path to the total number of nodes on the path, the path reuse degree is calculated. The path reuse degree represents the proportion of nodes that can be reused on the resolution path, with a value range of 0 to 1; a higher value indicates a higher degree of reuse and better efficiency.
[0122] The timeliness density index is calculated as the ratio of the number of nodes carrying timeliness priority markers on each resolution path to the total number of nodes on the path. Timeliness density reflects the proportion of time-critical constraints in the resolution path and is a key indicator for measuring the timeliness of the path. The timeliness density value ranges from 0 to 1; a higher value indicates that the path contains more time-critical constraints and requires a higher processing priority. For a resolution path containing eight nodes, if three of the nodes carry timeliness priority markers, the timeliness density of the path is 0.375. A path with a timeliness density of 0 indicates that there are no time-critical constraints on the path, and its processing priority can be reduced.
[0123] Timeliness density, path completion rate, and path reuse are weighted and integrated according to preset weights. These preset weights reflect the relative importance of the three indicators in priority evaluation; typically, timeliness density is weighted at 0.5, path completion rate at 0.3, and path reuse rate at 0.2. The weight allocation can be adjusted according to the actual application scenario. The weighted integration uses a linear combination method, adding the three indicators according to their weights to obtain a comprehensive priority index. The comprehensive priority index ranges from 0 to 1, with a higher value indicating a higher priority for the solution path. Solution paths with non-zero timeliness density are sorted in descending order of their comprehensive priority index and adjusted to be the preferred selection paths. These paths will be prioritized for recommendation to users during Q&A interactions, helping them choose the optimal route when time is tight.
[0124] When presenting priority paths on the intelligent Q&A interface, different display styles are set according to the comprehensive priority index. Paths with the top three comprehensive priority indices are marked as "Highly Recommended" and accompanied by eye-catching visual labels. For paths with particularly high time-sensitive content, an "Urgent" label is added to remind users to prioritize them. The Q&A response will display in detail the various constraints on the priority path, and shared constraints will be specially marked to indicate that multiple requirements can be met at once. Based on the user's completed tasks, the "Completed" and "Pending" sections are clearly marked in the path display, making it easy for users to intuitively understand the progress of their tasks.
[0125] This invention assesses user task completion status through progress weighting, quantifies path urgency through timeliness density, measures processing efficiency through path reusability, and constructs a priority selection path based on multiple dimensions to provide users with personalized service guides. This invention not only solves the problems of mechanical and unspecific conflict handling in traditional government services but also ensures timely processing of time-sensitive matters through a timeliness priority mechanism. The decision tree structure visualizes complex procedures, shared constraint identification reduces redundant processing steps, and comprehensive priority index ranking ensures the scientific and practical nature of the recommended path.
[0126] Step 105: Extract resolution records containing the same conflict elements from historical question and answer data, count the resolution paths corresponding to each resolution record, select resolution paths whose usage exceeds a threshold, establish a mapping relationship with the conflict elements, and form a knowledge base.
[0127] In some embodiments of the present invention, step 105 may specifically include the following sub-steps:
[0128] Sub-step 1051: Filter out resolution records containing the same conflict elements from historical question and answer data, and extract the resolution path and the responsible party corresponding to each resolution record;
[0129] Sub-step 1052: For each resolution path, identify the material name produced by the preceding department as the transmission relationship of the input material of the subsequent department, establish a material transmission chain, and calculate the ratio of the number of department identifiers covered by the material transmission chain to the total number of department identifiers in the resolution path as the path connectivity.
[0130] Sub-step 1053: Count the number of times each resolution path is used, and select resolution paths whose number of uses exceeds a preset threshold and whose path connectivity is greater than a preset connectivity threshold to construct a training set;
[0131] Sub-step 1054: Convert the entities in the training set into input feature vectors, convert the resolution paths into output label vectors, and train the path recommendation model using path connectivity as sample weights.
[0132] Sub-step 1055: Convert the service entities corresponding to the conflict elements into query feature vectors, input them into the trained path recommendation model, and obtain recommended resolution paths;
[0133] Sub-step 1056: Extract the material transfer chain from the recommended resolution path, match and verify the material transfer chain with the constraint conditions bound to the conflict element, and when the matching verification is successful, select the recommended resolution path whose usage exceeds the preset threshold and establish a mapping relationship with the conflict element to form a knowledge base.
[0134] This method filters historical question-and-answer data to identify resolution records containing the same conflict elements, enabling the accumulation and reuse of experiential knowledge. Historical question-and-answer data is stored in a structured database, containing multi-dimensional information such as problem description, conflict elements, solutions, and the responsible parties. The filtering process uses semantic similarity calculation to match and compare conflict elements. A similarity threshold of 0.8 is set; when the similarity between a historical conflict element and a current conflict element exceeds this threshold, the record is identified as a resolution record containing the same conflict elements. The extraction process preserves the complete context of the resolution record, including the resolution path and the responsible party information. The resolution path records the processing order and related materials of each department in the workflow, while the responsible party information includes attributes such as entity type, size, and business scope. For the registration scenario of individual businesses, there may be hundreds of resolution records containing the same conflict elements in the historical data, each record corresponding to a previously used resolution path.
[0135] For each resolution path, the material names produced by preceding department identifiers are identified as input materials for subsequent department identifiers, establishing a material transfer chain. Each resolution path consists of multiple department identifiers, with materials flowing between different departments to form transfer relationships. Text parsing technology is used to extract department identifiers and their processed material names from the resolution path descriptions. Material names are standardized to eliminate differences caused by different expressions. For each department identifier, it is analyzed whether its produced materials serve as input materials for subsequent department identifiers. When this condition is met, a directed connection is established between the two department identifiers, forming a material transfer relationship. All material transfer relationships are connected sequentially to construct a complete material transfer chain. The ratio of the number of department identifiers covered by the material transfer chain to the total number of department identifiers in the resolution path is calculated to obtain the path connectivity index. Path connectivity reflects the coherence of material flow in the resolution path, with a value range of 0 to 1; a larger value indicates a tighter path connectivity.
[0136] The usage frequency of each resolution path is statistically analyzed, and high-quality paths are selected to construct a training set. Usage frequency refers to the frequency of a resolution path's occurrence in historical resolution records, reflecting its practicality and reliability. A preset usage threshold is determined based on the data size, typically set to 5% of the total records. A preset connectivity threshold is set to 0.6, indicating that at least 60% of departments have material transfer relationships. Resolution paths that simultaneously meet both the preset usage threshold and the preset connectivity threshold are selected to construct the training set. Each record in the training set includes three parts: the information of the entity handling the matter, details of the resolution path, and the connectivity of the path. For the registration scenario of individual businesses, dozens of high-quality resolution paths may be selected from hundreds of historical records for inclusion in the training set. The training set data undergoes cleaning and normalization to eliminate outliers and redundant information, ensuring data quality.
[0137] The service providers in the training set are converted into input feature vectors, and the resolution paths are converted into output label vectors. The path recommendation algorithm is trained using path connectivity as sample weights. Service provider information contains multiple discrete and continuous features, requiring feature engineering. Discrete features, such as service provider type, are converted into numerical representations using one-hot encoding, while continuous features, such as business scale, are normalized. Information gain is used for feature selection, retaining features highly correlated with resolution path selection to form the input feature vector. Resolution paths are converted into output label vectors using sequence encoding, with each department identifier mapped to a unique identifier, preserving the department processing order information. Path connectivity is used as sample weights during training, with samples having higher connectivity receiving greater weights. The gradient boosting tree algorithm is used for training, with a learning rate of 0.01, a tree depth of 6, and 200 iterations. Cross-validation is used during training to evaluate algorithm performance and avoid overfitting.
[0138] The relevant service entities corresponding to conflicting elements are converted into query feature vectors, which are then input into a trained path recommendation algorithm to obtain recommended resolution paths. The construction of the query feature vectors uses the same feature engineering methods as the input feature vectors in the training set to ensure consistency in the feature space. The algorithm output represents the probability distribution of each possible resolution path, and the top three paths with the highest probabilities are selected as recommended resolution paths. The recommendation results include complete departmental processing order and material flow information, providing users with actionable service guidance. For individual business owners, the recommended resolution path may include multiple steps such as business registration, tax registration, and official seal engraving, arranged in the optimal order to reduce the number of trips required for the user.
[0139] The material transfer chain in the recommended resolution path is extracted, and its matching and verification with the constraints bound to the conflict elements are performed to ensure the feasibility of the recommended path. The material transfer chain extraction uses the same text parsing method as described above to obtain the material flow relationships between departments in the path. The constraints bound to the conflict elements typically include prerequisite material requirements and qualification conditions. The matching and verification process checks whether the material transfer chain meets the constraints, including multiple verifications such as material type matching and temporal dependency checks. When all verifications pass, the recommended resolution path is considered to conform to business rules and can be used for practical guidance. Recommended resolution paths that pass verification and have been used more than a preset threshold are selected, mapped to conflict elements, and stored in a knowledge base. The knowledge base uses a graph structure, with conflict elements as nodes and recommended resolution paths as edges, the edge weight being the number of times they have been used. The knowledge base is updated regularly to maintain data timeliness.
[0140] When a new question-answering request arrives, the system first searches the knowledge base to see if a matching conflict element and corresponding resolution path exist. If a match is found, a recommended resolution path is directly extracted from the knowledge base, eliminating the need to repeatedly execute complex path recommendation algorithms and significantly improving response speed. The knowledge base supports fuzzy matching and similarity queries, allowing for the identification of similar conflict elements and solutions even if the question descriptions differ. For new scenarios not covered by the knowledge base, the system reverts to the complete path recommendation process, while simultaneously storing the newly generated solutions in the knowledge base, enabling continuous knowledge accumulation and expansion.
[0141] This invention utilizes a knowledge base for intelligent path recommendation built upon historical data, effectively addressing path optimization issues in complex and conflict-ridden situations within government services. By extracting high-quality resolution paths from a large volume of historical question-and-answer data and establishing a mapping relationship between conflict elements and optimal solutions, it achieves the structured accumulation and intelligent reuse of experiential knowledge. The introduction of path connectivity ensures the coherence of recommended paths, reducing repeated trips between multiple departments for users. Matching and verifying material delivery chains and constraints guarantee the compliance and operability of the recommended results. This improves the accuracy and efficiency of intelligent question-and-answer in government services, shortens problem-solving time, and reduces user costs.
[0142] Sub-step 1054, training the path recommendation model using path connectivity as sample weights, also includes:
[0143] A neural network structure containing an input layer, a hidden layer, and an output layer is constructed as a path recommendation model, and a material transport chain attention mechanism is embedded in the hidden layer.
[0144] The input feature vector is input into the input layer of the path recommendation model and passed from the input layer to the hidden layer. The material transfer chain attention mechanism calculates the association weight of the material transfer relationship between department identifiers based on the input feature vector received by the hidden layer.
[0145] The hidden layer feature representation is weighted and adjusted based on the association weights to obtain the adjusted hidden layer feature representation. The adjusted hidden layer feature representation is then passed to the output layer to generate the predicted label vector.
[0146] Extract the path connectivity corresponding to each solution record in the training set as the training sample weight, calculate the loss value between the predicted label vector and the output label vector, and sum the loss values of each training sample using the training sample weight to obtain the weighted total loss.
[0147] The path recommendation model parameters are updated based on the associated weights output by the weighted total loss and the material transport chain attention mechanism. The trained path recommendation model is obtained when the weighted total loss converges.
[0148] When training the path recommendation algorithm using path connectivity as sample weights, a neural structure comprising an input layer, hidden layers, and an output layer is constructed. This structure is specifically designed for government service scenarios. The number of nodes in the input layer is consistent with the feature dimension of the service recipient, typically 50 to 100 nodes, receiving the input feature vector after feature engineering. The hidden layer adopts a multi-layer architecture, containing 3 to 5 hidden layers, with the number of nodes decreasing in each layer: 256, 128, and 64 nodes respectively. The ReLU activation function is used to enhance the non-linear expressive power. The number of nodes in the output layer is equal to the number of possible department identifiers in the resolution path, typically 20 to 30 nodes for government service scenarios. A material transfer chain attention mechanism is embedded in the hidden layer. This mechanism is specifically used to capture the importance weights of material transfer relationships between departments, improving the ability to identify key process nodes.
[0149] The input feature vector is fed into the input layer of the path recommendation algorithm. The feature vector contains attribute information such as the type, scale, and business scope of the service provider. In government service scenarios, the typical dimension of the feature vector is 80, where discrete features are expanded to 60 dimensions through one-hot encoding, and continuous features are normalized to 20 dimensions. The input data is passed from the input layer to the first hidden layer, undergoing linear transformation and nonlinear activation to form preliminary feature representations. These feature representations continue to propagate forward between hidden layers, extracting more abstract features layer by layer. The material transfer chain attention mechanism plays a crucial role in the feature transfer process. This mechanism calculates the association weights of material transfer relationships between department identifiers based on the input feature vectors received by the hidden layer. The attention mechanism uses three parameter sets: a query matrix, a key matrix, and a value matrix. It calculates the relevance scores between department identifiers based on the hidden layer features, generating an association weight matrix. The association weight matrix reflects the importance of material transfer between different departments; high weights indicate that the material transfer relationship between the two departments has a significant impact on the overall path selection.
[0150] The hidden layer feature representation is weighted and adjusted based on the calculated association weights to generate an adjusted hidden layer feature representation. This process uses matrix multiplication between the association weight matrix and the original feature representation to highlight the influence of important material transfer relationships and suppress interference from irrelevant features. The adjusted hidden layer feature representation pays more attention to the material flow relationships between departments and can better reflect the key indicator of path connectivity. For the scenario of establishing individual businesses, the adjusted feature representation will strengthen the material transfer characteristics between business registration and tax registration, as this transfer relationship plays an important role in high-quality solution paths. After feature adjustment, the adjusted hidden layer feature representation is passed to the output layer and a softmax activation function is used to generate a predicted label vector, representing the probability distribution of each possible solution path.
[0151] The path connectivity scores corresponding to each solution record in the training set are extracted as training sample weights to enhance the influence of high connectivity samples during training. The path connectivity score distribution in the training set is typically right-skewed, with most samples having connectivity scores between 0.6 and 0.8, and a very small number exceeding 0.9. Path connectivity scores are directly used as weight coefficients to assign different importance to each sample when calculating the loss function. The loss value between the predicted label vector and the true output label vector is calculated, and the cross-entropy loss function is used to measure the difference between the predicted result and the true label. In government service scenarios, the output label vector is typically a 20-30 dimensional one-dimensional array, with each element corresponding to the appearance of a department identifier in the resolution path. The loss values of each training sample are weighted and summed using the training sample weights to obtain the weighted total loss. This weighting method makes the algorithm focus more on high-quality samples with complete material transfer chains and high path connectivity, improving training performance.
[0152] Based on the calculated weighted total loss and the association weights output by the material transport chain attention mechanism, the path recommendation algorithm parameters are updated. Parameter updates employ backpropagation and the Adam optimizer, with an initial learning rate of 0.001. A learning rate decay strategy is used, reducing the learning rate to 0.9 times its original value every 50 training epochs to ensure stable convergence during training. Regularization constraints are applied to the parameters of the material transport chain attention mechanism to prevent excessive concentration of association weights on a few department identifier pairs, maintaining a reasonable attention distribution. During training, model performance is periodically evaluated on the validation set. When the weighted total loss changes by less than 0.001 for five consecutive evaluation epochs, training is considered converged, resulting in a trained path recommendation algorithm. For a typical government service dataset containing 5000 valid training samples, convergence typically requires 200 to 300 training epochs.
[0153] The trained path recommendation algorithm can predict the most suitable solution path based on the characteristics of newly input applicants. When an individual business owner submits their information through the intelligent Q&A interface, this information is converted into a feature vector and input into the algorithm. After forward computation, the prediction result is obtained. The prediction result is represented as the probability distribution of the processing order of each department, and the sequence with the highest probability is selected as the recommended solution path. For complex service scenarios, multiple alternative paths can be generated for the user to choose from. The recommended path includes the complete departmental processing order and material delivery requirements, providing users with clear service guidance. The path recommendation result can be further matched and verified with the previously constructed material delivery chain to ensure the feasibility and compliance of the recommended path.
[0154] During training, the introduction of the material transfer chain attention mechanism significantly improved the algorithm's ability to understand inter-departmental relationships. Traditional methods often treat departmental identifiers as independent entities, neglecting the importance of material flow in government services. The attention mechanism establishes an explicit representation of material transfer by calculating the association weights between departmental identifiers, enabling the algorithm to identify and reinforce key material transfer links.
[0155] This invention achieves accurate modeling of complex inter-departmental relationships in government services through a path recommendation algorithm that embeds a material transfer chain attention mechanism, significantly improving the accuracy and practicality of path recommendation. By capturing the importance weights of material transfer relationships between departments, key process nodes can be identified, ensuring the coherence and feasibility of recommended paths. The path connectivity weight training method makes the algorithm pay more attention to high-quality samples, optimizing the learning effect. It solves the problem that traditional methods cannot effectively model inter-departmental dependencies, improves the service quality of intelligent question answering in government services, and reduces the complexity of user procedures.
[0156] Step 106: When new question and answer data is received, query the knowledge base to obtain the matching resolution path. If the query is successful, the matching resolution path is directly output. If the query fails, the preferred path is selected from the decision tree and the response text is output.
[0157] In some embodiments of the present invention, step 106 may specifically include the following sub-steps:
[0158] Sub-step 1061: Receive new question and answer data, extract the service subject and conflict elements from the new question and answer data, and convert the service subject into a query feature vector;
[0159] Sub-step 1062: Input the query feature vector into the path recommendation model in the knowledge base. The path recommendation model outputs the recommended resolution path and the path confidence. Compare the path confidence with a preset confidence threshold. When the path confidence is greater than the preset confidence threshold, it is determined that the query of the knowledge base is successful. The recommended resolution path is used as the matching resolution path and the matching resolution path is directly output.
[0160] Sub-step 1063: When the path confidence is less than the preset confidence threshold, the query to the knowledge base is determined to fail. Based on the conflicting elements in the new question and answer data, the preferred path with the highest comprehensive priority index is selected from the decision tree.
[0161] Sub-step 1064: Convert the selected preferred path into a path label vector, combine the query feature vector and the path label vector to construct an update sample, input the update sample into the path recommendation model to update the model parameters, and reprocess the query feature vector of the path recommendation model with updated parameters to output an updated and resolved path.
[0162] Sub-step 1065: Extract the department identifier sequence and material name sequence from the update resolution path, organize the department identifier sequence and material name sequence into a structured text description according to the processing order, and output the response text.
[0163] When receiving new question-and-answer data, it is necessary to quickly retrieve matching resolution paths from the built knowledge base to provide users with accurate answers. New question-and-answer data is typically input in natural language, containing information such as the user's question description and service requirements. Key information is extracted from the new question-and-answer data, primarily including two core types: the service provider and conflict elements. Service provider extraction uses named entity recognition technology to identify entities such as organizations and individuals in the text, and classifies entity types based on keyword matching. Conflict element extraction uses dependency parsing technology to identify contradictions, obstacles, or difficulties described in the question. After extraction, the service provider information is converted into query feature vectors. The conversion process is consistent with the feature engineering methods used in the aforementioned training process to ensure vector space compatibility.
[0164] The query feature vector is input into the path recommendation algorithm in the knowledge base to obtain a recommended solution path suitable for the current user. The input process uses a forward computation method, where the query feature vector is processed sequentially through the input layer, hidden layer, and attention mechanism to generate the output prediction result. The path recommendation algorithm output includes two parts: the recommended solution path and the path confidence score. The recommended solution path is the order in which departments with the highest predicted probabilities are processed, typically containing 5 to 10 department identifiers arranged in the order of processing. The path confidence score reflects the algorithm's degree of certainty about the recommendation result, ranging from 0 to 1; a higher value indicates a more reliable recommendation. The confidence score is calculated based on the probability distribution of the output layer, obtained by normalizing the product of the probabilities of each node in the main path. The calculated path confidence score is compared with a preset confidence threshold, typically set at 0.75, which can be adjusted according to the actual application scenario. When the path confidence score is greater than the preset confidence threshold, the knowledge base query is considered successful, indicating that a solution highly matching the current problem exists in the knowledge base. In this case, the recommended solution path is directly output as the matching result without further processing.
[0165] When the path confidence score is less than a preset confidence threshold, the query to the knowledge base is deemed a failure, indicating that there is no mature solution directly applicable to the current problem in the knowledge base. This situation usually occurs in novel problems or rare scenarios, requiring reasoning and judgment based on existing knowledge to generate a reasonable solution. Based on the conflict elements extracted from the new question-and-answer data, the preferred path with the highest comprehensive priority index is selected from the decision tree. The decision tree is a conflict handling knowledge structure constructed in the early stage, containing multiple layers of nodes, with each leaf node corresponding to a possible processing path. The decision tree traversal process locates the node matching the conflict element and selects the optimal branch according to the priority rules. The comprehensive priority index consists of three parts: path efficiency weight, compliance weight, and historical success rate weight. The path efficiency weight reflects the time and resource consumption required by the path, the compliance weight measures the path's conformity with relevant regulations, and the historical success rate weight represents the proportion of successful applications of the path in the historical record. The three weights are combined in a 4:3:3 ratio to form the comprehensive priority index. The path with the highest comprehensive priority index is selected as the preferred path and as a candidate solution to resolve the current conflict element.
[0166] The selected preferred paths are converted into path label vectors using the same conversion method as the output label vector generation during training, ensuring data format consistency. The query feature vectors and path label vectors are combined to construct update samples for real-time adjustment of algorithm parameters. The construction of update samples follows the supervised learning paradigm, pairing input features with expected outputs to form complete training instances. The constructed update samples are input into the path recommendation algorithm, performing single-step gradient updates to adjust the algorithm's internal parameters. Parameter updates employ mini-batch gradient descent, with the learning rate set to one-tenth of the original training learning rate to prevent a single sample from excessively impacting overall performance. After parameter updates, the adjusted path recommendation algorithm reprocesses the original query feature vectors, outputting updated resolution paths. These updated resolution paths integrate historical experience from the knowledge base with the specific needs of the current problem, making them more aligned with user requirements compared to the original recommended paths.
[0167] The process extracts the department identifier sequence and material name sequence from the updated resolution path. The department identifier sequence indicates the processing order of each department in the process, and the material name sequence records the materials required or generated at each stage. Sequence extraction uses structured parsing technology to separate department and material information from the path representation while preserving the correspondence between them. The department identifier sequence and material name sequence are then organized into a structured text description according to the processing order, forming a user-understandable response. The text organization process uses a template-filling method, with a pre-set response template containing an introduction, body, and conclusion. The introduction greets the user and outlines the direction for problem resolution; the body details the departments, required materials, and precautions for each stage of the process; and the conclusion provides supplementary information and follow-up guidance. The text generation emphasizes fluency and professionalism, avoiding overly technical jargon to ensure comprehension by ordinary users. The generated structured text is output as the final response to the user, providing clear and concise guidance.
[0168] This invention achieves efficient and accurate responses to government service inquiries through an intelligent question-answering analysis method that integrates knowledge base querying and decision tree selection. By employing a path confidence threshold mechanism, it reasonably distinguishes between knowledge base-covered and uncovered scenarios, enabling rapid responses to familiar questions and intelligent reasoning for novel questions. Structured text generation technology transforms complex processing paths into user-understandable and specific guidance, enhancing the accessibility and usability of government services. This invention significantly improves the response speed and accuracy of government inquiries, reduces the number of trips users make due to unclear information, and lowers administrative costs and user burden.
[0169] like Figure 2 As shown, Figure 2 This is a schematic diagram of the structure of an intelligent learning question-answering analysis system based on government services provided in an embodiment of the present invention. The system includes:
[0170] The semantic parsing module 201 is used to obtain user-submitted question and answer data and perform semantic parsing to extract intent features and entity features to obtain semantic representations.
[0171] The conflict identification module 202 is used to identify the mutually exclusive relationships of cross-departmental rules in a preset government affairs rule base based on entity features in semantic representation, extract conflict elements and constraints, and generate a conflict set.
[0172] The timeliness identification module 203 is used to calculate the time difference between the validity period of the user's qualification and the deadline for completing the task for each conflict element in the conflict set. When the time difference is less than the preset priority threshold, a timeliness priority identification is set for the current conflict element.
[0173] The decision tree construction module 204 is used to construct a decision tree containing multiple resolution paths based on the constraints and time priority indicators in the conflict set, combined with the user's completed task nodes, and to adjust the resolution paths with time priority indicators to the preferred selection paths.
[0174] The knowledge base construction module 205 is used to extract resolution records containing the same conflict elements from historical question and answer data, count the resolution paths corresponding to each resolution record, select resolution paths that have been used more than a threshold to establish a mapping relationship with conflict elements, and form a knowledge base.
[0175] The path output module 206 is used to query the knowledge base to obtain a matching resolution path when new question and answer data is received. If the query is successful, the matching resolution path is directly output. If the query fails, the preferred path is selected from the decision tree and the response text is output.
[0176] One technical solution provided in this embodiment of the invention is a computer-readable storage medium storing a computer program, wherein the processor executes the computer program to implement the steps in any of the aforementioned methods.
[0177] The specific embodiments described above are preferred embodiments of the present invention and are not intended to limit the specific scope of the present invention. The scope of the present invention includes, but is not limited to, these specific embodiments. All equivalent changes made in accordance with the shape and structure of the present invention are within the protection scope of the present invention.
Claims
1. An intelligent learning question and answer analysis method based on government service, characterized in that, Includes the following steps: Obtain user-submitted question and answer data and perform semantic parsing to extract intent features and entity features to obtain semantic representations; Based on entity features in semantic representation, the mutual exclusion relationship of cross-departmental rules is identified in the pre-set government affairs rule base, conflict elements and constraints are extracted, and a conflict set is generated. For each conflict element in the conflict set, calculate the time difference between the validity period of the user's qualification and the deadline for completing the task. When the time difference is less than the preset priority threshold, set a time priority flag for the current conflict element. Based on the constraints and time-priority indicators in the conflict set, and combined with the user's completed tasks, a decision tree containing multiple resolution paths is constructed, and the resolution paths with time-priority indicators are adjusted to be the preferred paths. Extract resolution records containing the same conflict elements from historical question and answer data, count the resolution paths corresponding to each resolution record, select resolution paths that have been used more than a threshold to establish a mapping relationship with the conflict elements, and form a knowledge base; When new question-and-answer data is received, the knowledge base is queried to obtain a matching resolution path. If the query is successful, the matching resolution path is directly output. If the query fails, the preferred path is selected from the decision tree and the response text is output.
2. The method according to claim 1, characterized in that, Based on entity features in semantic representation, the mutual exclusion relationships of cross-departmental rules are identified in a pre-defined government affairs rule base. Conflict elements and constraints are extracted to generate a conflict set, including: Entity features are extracted from semantic representations, and the subject and items of the service in the entity features are combined to construct query key values. Based on the query key values, government rules are retrieved from a preset government rule base to obtain an association rule set. Extract the department identifier and material name of each government rule in the association rule set. Using the department identifier as a node, when the material name required by one government rule is the same as the material name produced by another government rule, establish a directed edge between the corresponding department identifiers to construct a dependency graph. The dependency graph is traversed to detect closed paths. When a closed path exists, it is identified as a circular dependency and mutual exclusion relationship. The department identifier and material name on the closed path are extracted as circular conflict elements. Extract the time constraints of two government rules that do not form a closed path in the dependency graph as constraints, calculate the time difference between the constraints of the preceding and subsequent rules, and treat the corresponding constraints as time conflict elements when the time difference is negative. The cyclical conflict elements and the temporal conflict elements are grouped into conflict elements, which are then associated with the service subject and the service item to generate a conflict set.
3. The method according to claim 2, characterized in that, Depth-first traversal of the dependency graph to detect closed paths includes: Select the department identifier in the dependency graph as the traversal starting point, create a path stack and push the traversal starting point onto the path stack, and mark the traversal starting point as being visited. Get the outgoing edge of the door icon at the top of the path stack, and extract the target department icon that the outgoing edge points to; When the target department identifier is marked as being visited, extract the consecutive department identifiers from the target department identifier to the top of the stack to form a closed node sequence. When the target department identifier is marked as not visited, mark the target department identifier as being visited and push it onto the path stack. Mark the door icon at the top of the path stack as visited and pop it from the path stack. Continue to obtain the outgoing edges of the door icons at the top of the stack while the path stack is not empty. When the path stack is empty and there are unvisited department icons, select a new department icon as the starting point for traversal.
4. The method according to claim 1, characterized in that, For each conflict element in the conflict set, calculate the time difference between the validity period of the user's qualification and the deadline for completing the task. When the time difference is less than a preset priority threshold, set a time priority flag for the current conflict element, including: Iterate through each conflict element in the conflict set, extract the constraints associated with each conflict element, and extract the time limits in each constraint as the deadline for completing the task corresponding to each conflict element. Extract the validity period of user qualifications from the Q&A data submitted by users, and calculate the time difference between the validity period of user qualifications and the deadline for completing the task for each conflicting element. Extract conflicting elements whose time difference is less than a preset priority threshold and their corresponding time differences to form a set of urgent conflicting elements. For each conflict element in the set of urgent conflict elements, the ratio of the time difference corresponding to each conflict element to the preset priority threshold is calculated, and the ratio is used as the time urgency coefficient of each conflict element. By embedding the timeliness urgency coefficient into the timeliness priority identifier, a timeliness priority identifier carrying the timeliness urgency coefficient is generated for each conflicting element.
5. The method according to claim 1, characterized in that, Based on the constraints and time-priority indicators in the conflict set, and combined with the user's completed tasks, a decision tree containing multiple resolution paths is constructed. The resolution paths with time-priority indicators are then adjusted to be the preferred paths, including: The constraints bound to each conflicting element are compared with the tasks completed by the user. Uncovered constraints in each conflicting element are extracted. The ratio of the number of uncovered constraints to the total number of bound constraints is used as the progress weight of each conflicting element. The time priority indicator is marked to the corresponding uncovered constraint. Uncovered constraints that belong to two or more conflicting elements are marked as shared constraints. A decision tree is constructed using all uncovered constraints as nodes, each node carrying the time priority identifier of the corresponding constraint, and the order dependency relationship between constraints as directed edges. The path completion degree is calculated based on the average progress weight of the conflict elements to which the nodes belong on each resolution path, and the path reuse degree is calculated based on the ratio of the number of shared constraints on each resolution path to the total number of nodes on the path. The timeliness density is the ratio of the number of nodes carrying timeliness priority markers on each resolution path to the total number of nodes on the path. The comprehensive priority index of each resolution path is obtained by weighting and integrating the timeliness density, path completion degree and path reuse degree according to the preset weights. Resolution paths with non-zero timeliness density are arranged in descending order of comprehensive priority index and adjusted to be the preferred selection paths.
6. The method according to claim 1, characterized in that, Extract resolution records containing the same conflict elements from historical question-and-answer data, statistically analyze the resolution paths corresponding to each resolution record, and establish a mapping relationship between resolution paths used more than a threshold and the conflict elements to form a knowledge base including: Filter resolution records containing the same conflict elements from historical Q&A data, and extract the resolution path and the responsible party for each resolution record; For each resolution path, the material name produced by the preceding department is identified as the transmission relationship of the input material of the subsequent department, a material transmission chain is established, and the ratio of the number of department identifiers covered by the material transmission chain to the total number of department identifiers in the resolution path is calculated as the path connectivity. The number of times each resolution path is used is counted, and the resolution paths whose usage exceeds a preset threshold and whose path connectivity is greater than a preset connectivity threshold are selected to construct a training set. The service entities in the training set are converted into input feature vectors, the resolution paths are converted into output label vectors, and the path connectivity is used as the sample weights to train the path recommendation model. The relevant entities corresponding to the conflict elements are converted into query feature vectors, which are then input into the trained path recommendation model to obtain recommended resolution paths. Extract the material transfer chain from the recommended resolution path, match and verify the material transfer chain with the constraints bound to the conflict element, and when the matching verification is successful, select the recommended resolution path that has been used more than a preset threshold number of times and establish a mapping relationship with the conflict element to form a knowledge base.
7. The method according to claim 6, characterized in that, Path recommendation models trained using path connectivity as sample weights include: A neural network structure containing an input layer, a hidden layer, and an output layer is constructed as a path recommendation model, and a material transport chain attention mechanism is embedded in the hidden layer. The input feature vector is input into the input layer of the path recommendation model and passed from the input layer to the hidden layer. The material transfer chain attention mechanism calculates the association weight of the material transfer relationship between department identifiers based on the input feature vector received by the hidden layer. The hidden layer feature representation is weighted and adjusted based on the association weights to obtain the adjusted hidden layer feature representation. The adjusted hidden layer feature representation is then passed to the output layer to generate the predicted label vector. Extract the path connectivity corresponding to each solution record in the training set as the training sample weight, calculate the loss value between the predicted label vector and the output label vector, and sum the loss values of each training sample using the training sample weight to obtain the weighted total loss. The path recommendation model parameters are updated based on the associated weights output by the weighted total loss and the material transport chain attention mechanism. The trained path recommendation model is obtained when the weighted total loss converges.
8. The method according to claim 1, characterized in that, When new question-and-answer data is received, the knowledge base is queried to obtain a matching resolution path. If the query is successful, the matching resolution path is directly output. If the query fails, the preferred path is selected from the decision tree, and the output response text includes: Receive new question and answer data, extract the service subject and conflict elements from the new question and answer data, and convert the service subject into a query feature vector; Input the query feature vector into the path recommendation model in the knowledge base. The path recommendation model outputs the recommended resolution path and the path confidence. Compare the path confidence with a preset confidence threshold. When the path confidence is greater than the preset confidence threshold, it is determined that the query of the knowledge base is successful. The recommended resolution path is used as the matching resolution path and the matching resolution path is directly output. When the path confidence is less than the preset confidence threshold, the query to the knowledge base is deemed to have failed. Based on the conflicting elements in the new question and answer data, the preferred path with the highest comprehensive priority index is selected from the decision tree. The selected preferred path is converted into a path label vector. The query feature vector and the path label vector are combined to construct an update sample. The update sample is input into the path recommendation model to update the model parameters. The path recommendation model with updated parameters is reprocessed with the query feature vector to output an updated and resolved path. Extract the department identifier sequence and material name sequence from the update resolution path, organize the department identifier sequence and material name sequence into a structured text description according to the processing order, and output the response text.
9. An intelligent learning question-and-answer analysis system based on government services, used to implement the method described in any one of claims 1-8, characterized in that, The system includes: The semantic parsing module is used to acquire user-submitted question and answer data and perform semantic parsing to extract intent features and entity features to obtain semantic representations. The conflict identification module is used to identify mutually exclusive relationships between cross-departmental rules in a pre-set government affairs rule base based on entity features in semantic representation, extract conflict elements and constraints, and generate a conflict set. The timeliness identification module is used to calculate the time difference between the validity period of the user's qualification and the deadline for completing the task for each conflict element in the conflict set. When the time difference is less than the preset priority threshold, a timeliness priority identification is set for the current conflict element. The decision tree construction module is used to construct a decision tree containing multiple resolution paths based on the constraints and time priority indicators in the conflict set, combined with the user's completed task nodes, and to adjust the resolution paths with time priority indicators to the preferred selection paths; The knowledge base construction module is used to extract resolution records containing the same conflict elements from historical question and answer data, count the resolution paths corresponding to each resolution record, select resolution paths that have been used more than a threshold to establish a mapping relationship with the conflict elements, and form a knowledge base. The path output module is used to query the knowledge base to obtain a matching resolution path when new question and answer data is received. If the query is successful, the matching resolution path is directly output. If the query fails, the preferred path is selected from the decision tree and the response text is output.
10. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the method as described in any one of claims 1 to 8.