Regulation conflict detection and hierarchical interpretation generation method based on exception priority
By constructing a structured representation of clause quadruples and modal opposition analysis, the problem of lack of logical opposition identification and interpretation paths in the power industry regulation conflict detection is solved, realizing efficient and reliable automatic adjudication and interpretation generation of regulation conflicts.
Patent Information
- Application Number
- CN202511754011.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-02-27
AI Technical Summary
Existing technologies are unable to identify logical conflicts between clauses in the power industry's regulatory conflict detection, especially when dealing with exception clauses and special semantic structures. Furthermore, they lack structured interpretation paths, resulting in low efficiency and credibility of compliance reviews.
An exception-based approach to rule conflict detection and hierarchical interpretation generation is adopted. By constructing a structured representation of clause quadruples, analyzing modal opposition and condition compatibility, a conflict score is calculated, and a traceable hierarchical interpretation including the reference path and effective date is generated.
It enables accurate identification and automatic adjudication of conflicts between regulations and clauses, improving the efficiency of compliance reviews and the credibility of audits, and ensuring the traceability and interpretability of results.
Smart Images

Figure CN121581027A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of natural language processing and knowledge reasoning, in particular to a rule conflict detection and hierarchical explanation generation method based on exception priority. BACKGROUND
[0002] With the development of digitization and intelligence, a huge rule system coexists in multiple levels and versions in highly regulated fields such as the power industry. The traditional compliance review method relying on manual work is inefficient and prone to errors. Although the existing technology has applied natural language processing, semantic retrieval, and retrieval augmented generation (RAG) to realize semantic matching and question answering of rule texts, such methods only stay at the level of relevance retrieval and cannot identify the logical opposite relationship between clauses due to differences in specification modalities (obligation, prohibition, and permission). It is especially difficult to handle special semantic structures such as "excepting clauses and provisos". Existing conflict detection schemes mostly rely on keyword comparison or fixed rule templates, which cannot achieve accurate alignment when facing complex structures such as subject-action-condition in clauses. Moreover, they do not fully consider the key role of the effective / invalid time of different versions of clauses and the rule level (national standards, industry standards, and enterprise rules) in conflict determination. In addition, current systems only output a binary conclusion of whether a conflict exists, lack structured explanation paths containing clause numbers, versions, and time limit information, and cannot clearly show the relationship between general rules and exception clauses, application condition limitations, and decision reasons (special priority, new-old priority, and level priority), resulting in high audit difficulty and low credibility, which seriously restricts the practical application value of automated compliance review systems. Therefore, there is an urgent need for a new method that can model the relationship between clause modalities, combine multi-dimensional priority principles, and generate verifiable explanation paths to meet the urgent needs of the power industry and others for compliance and explainability. SUMMARY
[0003] To overcome the above-mentioned defects, the present application provides a rule conflict detection and hierarchical explanation generation method based on exception priority, which aims to realize accurate identification and automatic adjudication of conflicts between rule clauses by constructing a four-tuple structured representation of clauses, modal opposite and condition compatibility analysis, and a multi-dimensional exception priority scoring mechanism, and to generate traceable hierarchical explanations including reference paths and effective time limit, thereby improving compliance review efficiency and audit credibility.
[0004] To achieve this purpose, the present application adopts the following technical solutions: The rule conflict detection and hierarchical explanation generation method based on exception priority comprises the following steps: S1: Analyze the rule text and extract the four-tuple representation of each clause, wherein the four-tuple includes subject, modality, action, and condition; S2: Perform subject clustering based on the behavior in the quadruple, and construct candidate conflict pairs based on the intersection of the effective time interval of the clause and the query time; S3: For each of the candidate conflict pairs, calculate the conflict score based on the opposite relationship of the modal and the compatibility of the condition, and determine that there is a conflict when the conflict score exceeds the preset threshold; S4: For the clause pair with conflict, calculate the exception priority score of each clause, which is based on the specificity, time priority and hierarchical priority of the clause; S5: Based on the exception priority score, determine the clause with high priority in the conflict clause pair as the applicable clause, and ensure that the applicable clause is valid at the query time combined with the time visibility constraint; S6: Construct an evidence path for the applicable clause and generate a hierarchical explanation, which includes general rules, exception clauses, applicable conditions, ruling reasons and reference paths; S7: Based on the difference of the exception priority score and the consistency of the evidence path, calculate the comprehensive quality score, and output a conservative explanation or mark it for manual review when the comprehensive quality score is lower than the preset threshold.
[0005] Preferably, step S1 comprises: Obtain a syntactic dependency graph by layout analysis and sentence segmentation, combined with part-of-speech tagging and dependency syntax analysis; Determine the modal category of the clause based on trigger word recognition and syntactic dependency relationship; Extract the subject of the clause through named entity recognition method combined with industry ontology backtracking, and identify the behavior of the clause through verbs or object-verb phrases, and normalize the condition fragment into a Boolean expression; Each clause quadruple represents , satisfying the relationship: ; Wherein, represents the clause subject including post, department or equipment, represents the modal category with values of obligation, prohibition or permission, represents the behavior predicate or object-verb phrase, represents the Boolean expression composed of conditions or exceptions.
[0006] Preferably, step S2 comprises: Vectorize the behavior of the clause, and form a subject cluster through clustering algorithm; Within the same subject cluster, construct candidate conflict pairs based on the intersection of the effective time interval of the clause and the query time, and the candidate conflict pairs satisfy the relationship: ; wherein, and denote any two clause quadruples from the same topic cluster, and denote the effective / invalidation time interval of clause and respectively, denotes the intersection operation of time intervals.
[0007] Preferably, step S3 comprises: constructing a modal opposition matrix to identify the modal opposition relationship between clauses, defining the condition compatibility degree, and comprehensively calculating the conflict score; the modal opposition matrix satisfies the relationship: ; the condition compatibility degree satisfies the relationship: ; the conflict score satisfies the relationship: ; wherein, denotes the modal opposition relationship of clause and , denotes the modal category of clause, denotes obligation, denotes prohibition, denotes permission, denotes the incompatibility degree of condition set and , denotes the set cardinality; denotes the conflict score, denotes the subject similarity, denotes the action similarity; when the conflict score exceeds a set threshold , it is determined that clause and are in conflict.
[0008] Preferably, step S4 comprises: calculating the exception priority score of the clause, which is obtained by comprehensively calculating the specificity score, the time priority score, and the hierarchical priority score; the specificity score satisfies the relationship: ; the time priority score satisfies the relationship: ; The hierarchy priority score Satisfying the relation: ; The comprehensive exception priority total score Satisfying the relation: ; in, Terms and Conditions The specificity score, Indicates the coverage area of the main set. Indicates the coverage of the condition set; Terms and Conditions Time priority score, This indicates the difference between the time the terms were published and the current time. Indicates the time decay coefficient. Terms and Conditions Hierarchical priority score, This indicates the regulatory hierarchy to which the clause belongs. The function representing the mapping from hierarchy to numerical weights. Terms and Conditions The overall priority score, , , These represent the weight parameters for specificity score, time priority score, and hierarchy priority score, respectively.
[0009] Preferably, step S5 includes: Decision-making and conflict resolution are based on the exception priority score and time visibility constraints of the clauses; The ruling Satisfying the relation: ; The time visibility constraint Satisfying the relation: ; Integrated processing of multiple clause conflicts Satisfying the relation: ; in, The terms indicate that The ruling result, and Each represents a clause and The overall priority score, This indicates a situation requiring manual review; Terms and Conditions the visibility of the clauses at the time point ,the effective time of the clause, ,the expiration time of the clause, , the query or applicable time point; , the clause finally adopted, , the candidate clause set, , the weight coefficient, , the indicator function; , when the priority score is equal, the time constraint causes all clauses to be invisible, or the multi-clause integration result is tied, output a conservative interpretation and mark it for manual review.
[0010] Preferably, step S6 comprises: constructing an evidence path for the adjudication result clause and generating a hierarchical interpretation; the evidence path satisfies the relationship: ; the hierarchical interpretation satisfies the relationship: ; wherein, the evidence path of the adjudication result clause , the node comprising a clause or version, the edge type, the path length, the hierarchical interpretation, the general rule output, the exception clause output, the applicable condition of the exception clause, the adjudication reason, the cited evidence path; in the interpretation text, the clause number and time limit label are forcibly added in the format .
[0011] Preferably, step S7 comprises: quality assessment of the conflict interpretation result, calculating a comprehensive quality score through a confidence score and a path consistency score; the confidence score satisfies the relationship: ; the path consistency score satisfies the relationship: ; the comprehensive quality score satisfies the relationship: ; wherein, denotes a confidence score of the clause for , and denote a priority score of the clause and , denotes a smoothing factor, denotes a path consistency score of the clause , denotes a number of paths satisfying the shortest path condition, denotes a number of all feasible paths, denotes a comprehensive quality score of the clause conflict explanation, and denote weight parameters of the confidence score and the path consistency score, respectively; when the comprehensive quality score is less than a preset threshold , a conservative explanation is output or marked for manual review.
[0012] One of the technical solutions has the following advantages or beneficial effects: The present application can solve the problem that the traditional method cannot capture the difference of the norm modalities by deeply analyzing the regulatory text, converting the natural language clauses into a four-tuple structured representation containing subject, modal, behavior and condition, and stripping the logical elements of the clauses from the ambiguous text into computable objects; then, by subject clustering based on behavior representation and joint time interval screening to build candidate conflict pairs, the comparison range is reduced from the full set of clauses to the locally relevant and time-effective set, which can avoid invalid calculation and ensure the timeliness and accuracy of conflict judgment; further, by constructing a modal opposition matrix to quantify the norm conflict intensity between clauses and introducing condition compatibility evaluation to avoid misjudgment in different applicable scenarios, the accurate transition from "semantic relevance" to "logical conflict" is realized; on this basis, by fusing the specificity, time priority and hierarchical priority three dimensions to calculate the exception priority score, the legal application principle is converted into a quantifiable basis for ruling, filling the technical gap that the prior art cannot automatically apply the principles of "special law priority, new law priority, and superior law priority"; then, according to the priority score, the clauses are ruled, and the time visibility constraint is introduced to ensure that the selected clauses are indeed effective at the query point, completing the automatic resolution of conflicts; by constructing the evidence path of clause reference relationship and generating hierarchical interpretation covering general rules, exception clauses, application conditions, ruling reasons and reference paths, each conclusion can be traced back to the specific clause number, version number and validity time limit, completely solving the audit dilemma of "black box" output of traditional systems; finally, through the comprehensive quality scoring mechanism, the conflict difference and the consistency of the evidence path are double-checked, and when the result reliability is insufficient, the conservative interpretation is actively output and marked for manual review, forming a closed-loop quality control. BRIEF DESCRIPTION OF DRAWINGS
[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only the embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative labor based on the provided drawings.
[0014] Figure 1 is the flow chart of the regulatory conflict detection and hierarchical interpretation generation method based on exception priority provided by the embodiment of the present application. DETAILED DESCRIPTION
[0015] The embodiments of the present application will be described in detail below, and the examples of the embodiments are shown in the drawings, wherein the same or similar reference signs represent the same or similar elements or elements with the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary and are only used to explain the present application, and cannot be understood as a limitation of the present application.
[0016] In this disclosure, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0017] The rule conflict detection and hierarchical interpretation generation method based on exception priority, as shown in the preferred embodiment of the present disclosure, comprises the following steps: Figure 1 The preferred embodiment of the present disclosure, as shown in the preferred embodiment of the present disclosure, comprises the following steps: S1: Analyzing the rule text and extracting the four-tuple representation of each clause, wherein the four-tuple includes subject, modality, action, and condition; It should be noted that the rule text refers to a set of system documents with binding force in the electric power industry field, including national standards, industry standards, enterprise regulations, and implementation rules, and hierarchical documents, and its physical form is a structured or unstructured electronic document. Clause is the smallest semantic unit with independent specification meaning in the rule text, which is usually presented in the form of numbered paragraphs. The four-tuple representation is a formal data structure that converts natural language clauses into machine-computable symbolic expressions, including four core elements: subject refers to the execution object of the clause specification, which is specific to the post role (such as "operation and maintenance personnel", "dispatcher"), organization (such as "maintenance department"), or equipment (such as "35kV or above transformer"); modality is the classification of the specification nature of the clause, which is identified by three discrete values of obligation (O), forbid (F), and permission (P) to identify the legal effect type of the clause; action is the specific action description required, prohibited, or allowed to be executed by the clause, which is composed of verbs or object-verb phrases (such as "perform switching operation", "arbitrarily release the locking device"); condition is the pre-condition or exception situation applicable to the clause, which is standardized by a Boolean expression guided by conjunctions such as "when, if, unless" (such as "when the equipment is in cold standby state and the voltage level is ≥ 35kV"). This structured extraction relies on natural language processing technology stack, including layout analysis, dependency syntax analysis, and named entity recognition.
[0018] It can be understood that the traditional regulation conflict detection method directly matches the keywords with the original text, which cannot distinguish the modal opposite relationship such as "operation and maintenance personnel shall wear insulating gloves" (obligation) and "operation and maintenance personnel are prohibited from wearing metal ornaments" (prohibition), and cannot identify the legal effect of the exception condition such as "unless in an emergency". Step S1 extracts the logical elements implied in the clauses into computable objects through four-tuple extraction, so that the subsequent conflict judgment can be based on accurate semantic structure rather than fuzzy text similarity. The main role of this step is to establish a mapping bridge from natural language to formal knowledge representation, solve the fundamental defect that the prior art cannot capture the difference between specification modalities, and provide a structured input basis for conflict detection.
[0019] S2: subject clustering based on the action in the four-tuple, and constructing candidate conflict pairs based on the intersection of the effective time interval of the clause and the query time; It should be noted that the action is the Action field in the four-tuple extracted in step S1, which represents the operation action specified by the clause, and its technical essence is a text string of verb phrase or object-verb structure. Subject clustering is an unsupervised learning process that groups a large number of clauses according to the semantic similarity of the action. By mapping the action text into a point in a high-dimensional vector space, similar points are grouped into the same cluster using density or distance measurement. The effective time interval is the time range of the legal effect of the clause, which is a left-closed right-open interval composed of the effective time (eff) and the expiration time (exp), and is stored as a timestamp pair. The query time is the reference time point specified by the user when conducting compliance review or conflict detection, which is usually the current time or a specific audit time point. The candidate conflict pair is a binary tuple composed of two clauses that may constitute a conflict, which is the smallest processing unit for subsequent fine judgment, and the combination complexity of all clauses is reduced from to , wherein is the number of clusters, is the number of clauses in a single cluster.
[0020] It can be understood that the regulation system of the power industry often contains thousands of clauses. If all clauses are compared with each other, the calculation amount is huge and most of the comparisons are meaningless. Step S2 first uses semantic clustering of actions to separate clauses with different topics such as "switching operation", "work ticket issuance", "safety distance verification", etc., to ensure that conflicts are searched only within the same topic cluster, avoiding cross-topic misjudgment. Secondly, through time interval intersection filtering, clauses that have expired or have not taken effect at the query time point are excluded to ensure the timeliness of the conflict judgment. A high-precision candidate set is constructed through semantic pruning and time filtering, solving the defects of low global comparison efficiency and insufficient consideration of timeliness of the prior art.
[0021] S3: For each of the candidate conflict pairs, calculate a conflict score based on the modal opposition and the condition compatibility, and determine that there is a conflict when the conflict score exceeds a preset threshold; It should be noted that the modal opposition refers to the mutual exclusivity between the normative properties of clauses, which is technically quantified by a modal opposition matrix , which is a 3x3 discrete matrix, and is assigned a value of 1 (indicating opposition) when the modal combination is , and a value of 0 for the rest of the combinations. The condition compatibility is an index that measures the degree of overlap between the application conditions of two clauses, which is achieved through set operations and is defined as 1 minus the ratio of the cardinality of the intersection of the conditions to the cardinality of the union of the conditions, with a value range of , and the larger the value, the greater the condition difference and the worse the compatibility. The conflict score is a weighted product of the modal opposition intensity, the condition difference, the subject similarity and the behavior similarity, which is used to quantify the strength of the possibility of clause conflict. The preset threshold is a decision boundary determined by statistical learning, which is usually a floating-point number between 0.6 and 0.8, and exceeding this threshold triggers conflict determination, upgrading the candidate pairs to accurate logical conflict identification.
[0022] It can be understood that the candidate conflict pairs only indicate that the clauses may be related in terms of behavior, subject and time, but not necessarily truly conflicting. Step S3 captures the irreconcilable normative contradictions between "shall" and "prohibited" through the modal opposition matrix, distinguishes the scenario differences between "general rules" and "exception clauses" through the condition compatibility (such as clause A requiring 35kV equipment to be operated with power off, and clause B allowing non-power-off operation in emergency situations, which have large condition differences but are not conflicting), and combines the subject and behavior similarity to ensure the accuracy of conflict determination. The role of this step is to jump from "semantic relevance" to "logical conflict", avoiding misjudgment in different application scenarios, and solving the core defects of the prior art that cannot identify modal opposition and exception structure.
[0023] S4: For the clause pairs that have conflicts, calculate the exception priority score of each clause, which is based on the specificity, time priority and hierarchical priority of the clause; It should be noted that the exception priority score is a quantitative indicator for resolving the application order of conflicting clauses, and the higher the value indicates that the clause should be preferentially applied in the conflict situation. The specificity measures the narrowness of the scope of application of the clause, which is calculated by taking the inverse of the number of scenarios covered by the subject and conditions of the clause. The smaller the coverage (such as only applicable to "220kV transformer maintenance" rather than "all equipment operation"), the higher the specificity. The time priority reflects the age of the clause, which is calculated using an exponential decay function. The closer the publication time to the current time, the higher the score, and the score of the abolished clause tends to zero. The hierarchical priority embodies the principle of legal hierarchy, which is assigned by a pre-defined hierarchical weight mapping function. The weight of national standards is 1.0, the weight of industry standards is 0.8, the weight of enterprise regulations is 0.6, and the weight of local rules is 0.4. The weight of the upper law is always higher than that of the lower law, which converts the legal application principle into a calculable parameter.
[0024] It can be understood that the conflicting clauses are not simply taken one or the other, but need to follow the legal application principle of "special law prior to general law, new law prior to old law, upper law prior to lower law". Step S4 realizes the special priority principle through the specificity score, ensures that the special clause for a specific scene (such as high-voltage equipment maintenance) is prior to the general clause (such as general equipment operation); realizes the new-old priority principle through the time priority score, avoids compliance risks caused by referencing outdated clauses; realizes the hierarchical priority principle through the hierarchical priority score, prevents lower regulations from violating mandatory provisions of upper laws. The role of this step is to convert abstract legal principles into quantifiable and configurable decision-making basis, filling the gap in the prior art that cannot automatically apply the exception priority principle.
[0025] S5: based on the exception priority score, determining that the clause with high priority is the applicable clause, and combining the time visibility constraint to ensure that the applicable clause is valid at the query time; It should be noted that the determination is a decision-making process for conflict resolution, which determines the winner in the conflicting clauses through numerical comparison. The applicable clause is the clause that should be executed in a specific query scene after determination. The time visibility constraint is a mandatory verification mechanism to ensure the legality of the determination result, which filters out clauses that have expired or have not yet come into effect by judging whether the query time falls within the effective interval of the clause. The output of step S5 is a single determined clause reference or a "review" label.
[0026] It can be understood that the priority score only reflects the abstract importance of the clause, but does not consider its actual legal effectiveness at the query point. Step S5 realizes the landing of the exception priority principle by directly comparing and The time visibility function Introducing time validation to avoid misquotation caused by improper regulation version management. When multiple clauses have equal priority or time constraints cause all candidate clauses to be invisible, the system does not make blind decisions but enters a conservative mode to ensure compliance in uncertain scenarios. The role of step S5 is to make a final legal application decision under the dual constraints of priority and timeliness, preventing the AI system from generating legally invalid conclusions.
[0027] S6: Construct an evidence path for the applicable clause and generate a hierarchical explanation, which includes general rules, exception clauses, applicable conditions, ruling reasons, and reference paths; It should be noted that the evidence path is a graph structure link of the reference, replacement, and abrogation relationship between clauses, which is used to trace the complete legal basis of the ruling conclusion. The hierarchical explanation is a natural language text organized according to the logical hierarchy of "general rule → exception clause → applicable condition → ruling reason → reference path", which is forced to embed clause numbers and time labels. The reference path is a textual representation of the evidence path, showing the tracing chain from the applicable clause to its superior basis or exception clause, and the output of step S6 is a verifiable decision statement that meets the audit reading habits.
[0028] It can be understood that only outputting the applicable clause number cannot meet the compliance audit requirements, and the reviewer needs to know why the clause is preferred, its exception conditions, and the legal basis. By modeling clauses and their meta-information as an attribute graph, explicitly capturing "replacement", "abrogation", "exception" and other edge relationships, a visual tracing chain is constructed. Through hierarchical templates, machine decision logic is converted into a narrative structure that humans can understand, and [clause number | effective time | abrogation time] is forced to be annotated after each assertion, so that each conclusion can be checked against the original text. The role of the step is to achieve "white-boxing" of AI decisions, solving the fatal flaw of traditional systems that output conclusions that cannot be audited.
[0029] S7: Based on the difference in exception priority score and the consistency of the evidence path, calculate the comprehensive quality score, and output a conservative explanation or mark for manual review when the comprehensive quality score is below a preset threshold.
[0030] It should be noted that the comprehensive quality score is a single index for quantifying the reliability of the interpretation result, which is obtained by weighting the priority difference confidence and the path consistency score. The priority difference confidence reflects the significant difference of the priority scores of the conflicting clauses, and is calculated as the ratio of the difference value to the sum value. The smaller the difference value, the lower the confidence. The path consistency score measures the clarity of the evidence path, and is defined as the ratio of the number of shortest paths to the total number of paths. The more dispersed the paths, the more ambiguous the legal citation relationship. The conservative interpretation is a safety bottom mechanism that does not output a single conclusion in a low confidence scenario, but rather displays all candidate clauses side by side and adds a "manual review required" label. Manual review is a collaborative process that submits controversial cases that the algorithm cannot decide to legal experts for final review.
[0031] It can be understood that the AI system may produce unstable decisions when facing scenarios with close priority scores, complex evidence chains, or ambiguous conditions. Step S7 identifies "difficult to distinguish" conflict pairs by calculating the relative amplitude of the priority difference (e.g., when the Priority difference is less than 0.05, the confidence approaches 0), and identifies evidence chain contradictions by counting the proportion of shortest paths (e.g., multiple equivalent paths lead to When the comprehensive quality score is below the threshold , the system actively gives up automatic decision-making and outputs a conservative interpretation instead. This step serves to define the system's capability boundary, preventing low-quality decisions from misleading users, and forming a reliable human-machine collaboration mode of "algorithm autonomous decision-making - quality assessment - manual intervention", ensuring the audit credibility in complex legal scenarios.
[0032] Preferably, step S1 includes: Obtaining a syntactic dependency graph through layout analysis and sentence segmentation, combined with part-of-speech tagging and dependency syntax analysis; Identifying the modal category of the clause based on trigger word recognition and syntactic dependency relations; Extracting the subject of the clause through named entity recognition method combined with industry ontology backtracking, and identifying the action of the clause through verbs or object-verb phrases, and normalizing the condition fragment into a Boolean expression; Each clause quadruple represents , satisfying the relationship: ; Wherein, represents the clause subject including positions, departments, or equipment, represents the modal category with values of obligation, prohibition, or permission, represents the action predicate or object-verb phrase, represents the Boolean expression composed of conditions or exceptions.
[0033] It should be noted that layout analysis is the process of converting the physical layout structure of regulatory documents into a logical structure. Through optical character recognition (OCR) technology, elements such as text areas, tables, headers and footers in scanned documents are identified. Regular expression matching is used to match clause number patterns (such as "Article [0-9]+") to achieve clause-level text block segmentation, solving the problem of structural disorder after digitizing paper regulations. Sentence segmentation is the process of splitting long sentences into independent clauses based on punctuation marks and syntactic rules. A syntactic segmentation model based on Transformer is used to identify sentence boundaries, avoiding semantic confusion caused by the adhesion of conditional clauses to main clauses. Part-of-speech tagging is a sequence labeling task that assigns grammatical role labels (such as noun, verb, modal verb) to each word in the text. A BiLSTM-CRF model is fine-tuned on an electric power domain corpus to accurately identify the part-of-speech of modal verbs such as "should" and "prohibit". Dependency parsing is a graph structure construction process that analyzes the grammatical dependency relationships between words (such as subject-predicate relationship nsubj and verb-object relationship dobj). Stanford CoreNLP or Spacy tools are used to generate syntactic dependency graphs, where nodes represent words and directed edges represent dependency types, providing structured syntactic paths for subsequent element extraction. Syntactic dependency graphs are the output of this process, represented as a directed acyclic graph G=(V,E), where V is the set of word nodes and E is the set of dependency edges, stored as an adjacency list structure to support path query operations. Trigger word recognition is a process of string matching or semantic similarity calculation based on a pre-defined modality dictionary. The dictionary contains obligation class trigger words {"should", "must", "shall"}, prohibition class trigger words {"prohibit", "not allowed", "not allowed"}, and permission class trigger words {"can", "have the right to", "can"}. The modality words are located through exact matching or fuzzy matching with a cosine similarity of word vectors greater than 0.85. Named entity recognition is a sequence labeling task that identifies and labels the boundaries of domain-specific entities (such as job title "transformer operator", device type "circuit breaker", and state "cold standby") in text. A BERT-CRF architecture is trained on electric power industry annotation corpus with an accuracy of over 95%. Industry ontology backtracking is an entity disambiguation process that links recognized entities to an electric power industry knowledge ontology library (containing "job responsibilities", "device types", "operation states", etc.). The process is achieved through exact string matching or fuzzy matching based on edit distance to ensure the semantic accuracy of the main body extraction. Verb-object phrase recognition is a process of extracting verbs and their direct objects to form phrases through dependency path templates (such as verb → dobj → object) or constituent syntax analysis. The core action objects in the clause, such as "performing switching operations", are extracted as Action="perform (verb) + switching operations (object)".Condition fragment normalization is a semantic translation process that converts natural language condition clauses (e.g., "when the device is in the maintenance state and the voltage level ≥ 35 kV") into machine executable Boolean expressions (e.g., "((device_status =='maintenance') and (voltage_level >= 35000))"). The formalization of conditional logic is achieved by rule-based template matching (recognizing "when... structure") combined with a symbolic execution engine. The Boolean expression is the normalized representation of conditional logic, supporting Python or JavaScript syntax, containing logical operators , comparison operators and parentheses priority, which can be directly used for subsequent condition compatibility calculation.
[0034] It can be understood that through hierarchical natural language understanding technology, the syntax structure, semantic role and logical relationship in the clause are peeled off layer by layer, and finally the ambiguous natural language text is converted into a computable object with strict mathematical structure. Specifically, layout analysis and sentence segmentation convert unstructured documents into clause-level sentence units. Part-of-speech tagging and dependency syntax analysis upgrade linear text to graph structure, making the modification and domination relationship between words explicit and providing a grammatical path for element positioning. Trigger word recognition combined with dependency relationship accurately identifies modal categories by locking aspectual verbs and their dominated predicates, avoiding misjudgment caused by simply relying on keywords. Named entity recognition combined with ontology backtracking maps terms such as positions, devices and states in the text to a standardized knowledge base, solving the normalization problem of multiple expressions of the same concept. Verb-object phrase recognition accurately extracts core actions using dependency paths, avoiding interference from modifier components. Condition fragment normalization converts exceptional cases into executable Boolean logic through symbolic translation, providing a formal basis for subsequent condition compatibility calculation. Four-tuple extraction no longer relies on simple regular matching, but on deep syntactic and semantic analysis, significantly improving the extraction accuracy and structural integrity of the subject, modal, behavior and condition elements, providing high-quality structured input for subsequent conflict detection.
[0035] Preferably, step S2 comprises: vectorizing the behavior of the clause to form a subject cluster through a clustering algorithm; constructing a candidate conflict pair within the same subject cluster based on the intersection of the effective time interval of the clause and the query time, the candidate conflict pair satisfying the relationship: ; wherein, and represent any two clause four-tuples from the same subject cluster, and represent the clause and effective / invalid time interval, represents the intersection operation of time intervals.
[0036] It should be noted that the action of the clause is the action description represented by the Action field in the four-tuple extracted in step S1, which is usually a verb or an object phrase, such as "perform switching operation" or "wear insulating gloves", and its essence in technology is a text string, which needs to be converted into a numerical vector to calculate the semantic similarity. Vector representation is the process of mapping text behavior into a high-dimensional dense vector. Pre-trained language models such as Sentence-BERT are used to encode each behavior phrase into a 768-dimensional or 1024-dimensional floating-point vector. The distance measure in the vector space (such as cosine similarity) can directly reflect the similarity of the behavior semantics. This technology is the basis for subsequent clustering. The clustering algorithm is an unsupervised learning method. Specifically, the HDBSCAN (Hierarchical Density-Based Spatial Clustering of Applications with Noise) density clustering algorithm is used. This algorithm does not require pre-set cluster number and can automatically identify noise points, which is suitable for the scenario of regulatory clauses with uneven topic distribution and possible isolated clauses. By setting the min_cluster_size parameter to control the minimum size of the cluster, behavior vectors with similar semantics are grouped into the same topic cluster. Topic clusters are the result set output by the clustering algorithm, and each cluster contains several clause four-tuples. The behavior semantics of clauses in the same cluster are highly related (such as the "switching operation" cluster containing all clauses related to switching device operation), while the behavior semantics of different clusters are significantly different (such as the "switching operation" cluster and the "work ticket issuance" cluster). The role of the topic cluster is to divide the total number of clauses into semantically cohesive groups, providing a candidate search space for subsequent conflict detection. The effective time interval is the time range of the legal effect of the clause. In technical implementation, it is stored in the form of , where is the effective time, is the invalid time, stored in Unix timestamp or ISO 8601 date format, supporting efficient interval overlap calculation. Query time is the reference time point specified by the user when conducting compliance review, usually the current system time or a specific historical audit point, in the form of a timestamp input into the system, used to filter clauses valid at the query time. Intersection is a mathematical operation on time intervals, which determines whether a clause is valid at the same time by judging whether there is a timestamp overlap between the two time intervals. The implementation is to compare the start and end times of the two intervals, and satisfy , which means there is an intersection. This operation is the core of the time effectiveness filter. The candidate conflict pair is a set of clause binary tuples that satisfy the time intersection condition, stored as a tuple list in the form of , which is the smallest processing unit for subsequent modal opposition analysis in step S3.
[0037] It can be understood that the power industry regulation system contains thousands of clauses, and if a brute-force pairwise comparison is used to detect conflicts, the computational complexity is as high as , and most cross-topic comparisons (such as comparing "switching operation" clauses with "archive management" clauses) are meaningless, resulting in waste of computing resources and low efficiency. Step S2 first automatically groups a large number of clauses according to semantic topics through behavior vectorization and clustering algorithms, reduces the comparison range from the total number of clauses to the same topic cluster, and reduces the computational complexity to , wherein is the number of topic clusters, is the average number of clauses in a single cluster, significantly improving processing efficiency. Secondly, there are multiple versions of the regulation system, and the abolished clauses and the current clauses exist in the regulation library at the same time. If the conflict is determined without distinction, a serious timeliness error will be introduced. By requiring the intersection condition of , the system only retains the clause pairs that are valid at the query time point, automatically excludes historical invalid clauses, and ensures the timeliness of the candidate conflict pairs. Through semantic pruning and time filtering in two dimensions, the recall rate is guaranteed, and the invalid candidates are greatly reduced, providing a high-quality and high-relevance input set for the accurate conflict identification of step S3, solving the dual defects of low efficiency and lack of timeliness consideration of the prior art.
[0038] Preferably, step S3 comprises: constructing a modal opposition matrix to identify the modal opposition relationship between clauses, defining conditional compatibility, and comprehensively calculating the conflict score; The modal opposition matrix satisfies the relationship: ; The conditional compatibility satisfies the relationship: ; The conflict score satisfies the relationship: ; wherein represents the modal opposition relationship between clauses and , represents the modal category of the clause, represents the obligation, represents the prohibition, represents the permission, represents the permission, represents the incompatibility of the condition set and , and represents the set cardinality; represents the conflict score, represents the subject similarity, Indicates behavioral similarity; When Conflict Scoring Exceeding the set threshold At that time, the judgment clause and There is a conflict.
[0039] It should be noted that the modal opposition matrix is a discrete 3×3 logical judgment table used to quantify the mutual exclusion strength of the canonical properties between clauses. Technically, it is implemented using a hash table or Boolean function, with the input being the modal category enumeration values of the two clauses. ), if and only if the combination is The output is 1 for each rule combination, indicating an irreconcilable normative conflict; otherwise, it outputs 0. This design originates from the principle of mutual exclusion of normative modalities in legal logic, ensuring unambiguous modal determination. Condition compatibility is a continuous variable that measures the degree of difference in the applicable conditions of two clauses, implemented through set theory operations. and It is a set of normalized condition elements for the clause condition field (such as...) ), Calculate the cardinality of the intersection of two sets. The cardinality of the union is calculated, and the compatibility is 1 minus the ratio of the intersection to the union, with a value range of [0,1]. A larger value indicates less overlap in conditions and greater difference in scenarios; this metric distinguishes between general rules and exceptions. Incompatibility is the opposite of compatibility, directly reflected by the Comp value. When Comp=1, the conditions are completely mutually exclusive; when Comp=0, the conditions are completely identical. The conflict score is a product-type evaluation function that integrates four factors: modal opposition strength, conditional difference, subject similarity, and behavioral similarity. Using a product rather than weighted sum ensures that if any factor is zero, the overall conflict strength is zero, conforming to the strict definition of logical conflict. Subject similarity and behavioral similarity measure the proximity of the clause subject and behavioral description in the semantic vector space, respectively. Cosine similarity is calculated after Sentence-BERT encoding, with a value range of [0,1], used to filter mismatches across subjects or behaviors. Threshold. This is the decision boundary for conflict determination. It is set to a floating-point number between 0.6 and 0.8 through statistical learning or domain experience. Values exceeding this threshold are considered conflicts. This threshold directly affects the balance between recall and precision.
[0040] It can be understood that the candidate conflict pair only indicates that the clauses are related in the behavior subject and time limit, but not necessarily constitute a real logical conflict, and the present application strictly captures the legal effect exclusivity among obligations, prohibitions and permissions through the modal antithesis matrix, for example, "the operation and maintenance personnel shall wear insulating gloves" and "the operation and maintenance personnel are prohibited from wearing insulating gloves" cannot coexist under the same conditions, and the binary antithesis value output by the matrix is 1, which ensures that such conflicts are not missed; the difference of the application scene of the clauses is quantified through the condition compatibility, when the general rule requires "voltage >= 35kV shall be operated" and the exception clause provides "emergency=True can not be operated", the intersection of the condition set is non-empty but the union is expanded, and the Comp value is between (0, 1), which reduces the conflict intensity and avoids misjudging the exception clause as a conflict, thereby distinguishing between "logical contradiction" and "scene limitation"; by introducing subject similarity and behavior similarity as multiplicative factors, it is ensured that conflict determination is triggered only when the subject role (such as "operation and maintenance personnel") and the behavior description (such as "wearing insulating gloves") are highly consistent, effectively excluding irrelevant comparisons such as "operation and maintenance personnel shall operate" and "management personnel are prohibited from operating" with different subjects or "wear gloves" and "use tools" with different behaviors. The level of conflict recognition is improved from "text similarity matching" to "logical structure contradiction detection", accurately identifying multi-dimensional conflicts of modal antithesis and condition exclusivity, filtering out false conflicts caused by scene differences, subject misplacement or behavior isomerism, and providing high-quality conflict confirmation results for the priority resolution of S4.
[0041] Preferably, step S4 comprises: calculating an exception priority score of the clause, the exception priority score being obtained by integrating a specificity score, a time priority score and a hierarchy priority score; the specificity score satisfies the relationship: ; the time priority score satisfies the relationship: ; the hierarchy priority score satisfies the relationship: ; the integrated exception priority total score satisfies the relationship: ; wherein, the specificity score of the clause , the coverage of the subject set, the coverage of the condition set; the clause Time priority score, This indicates the difference between the time the terms were published and the current time. Indicates the time decay coefficient. Terms and Conditions Hierarchical priority score, This indicates the regulatory hierarchy to which the clause belongs. The function representing the mapping from hierarchy to numerical weights. Terms and Conditions The overall priority score, , , These represent the weight parameters for specificity score, time priority score, and hierarchy priority score, respectively.
[0042] It should be noted that the exception priority score is a continuous numerical indicator that quantifies the degree to which a clause should be given priority in a conflict situation. It comprehensively reflects the technical implementation of the principle of applicable law, and its value range is typically [0,1], with higher values indicating stronger clause priority. The specificity score measures the exclusivity and narrowness of the clause's scope of application. It is obtained by calculating the reciprocal of the sum of the subject coverage and the condition coverage. The number of positions, departments, or equipment types involved in the main body of the statistics clause is counted. For example, if the main body of the clause is "maintenance personnel", it is counted as 1; if the main body is "maintenance personnel, maintenance personnel, or testing personnel", it is counted as 3. The number of independent constraints in a Boolean expression for statistical conditions, such as "voltage>=35 and maintenance=True" which includes two constraints—voltage level and operation type—is counted as 2. The specificity score essentially encourages clauses with narrower applicability to receive higher priority, reflecting the principle of "special law prevails over general law." The time priority score quantifies the newness and urgency of a clause, using an exponential decay function. Calculation, where This is the time difference (in days) between the date the clause was published (Unix timestamp) and the current query time. is an adjustable decay coefficient (usually set between 0.001 and 0.01), which has the characteristics of the closer the time, the higher the score, and the abandoned clause tends to zero, which is technically implemented by the math.exp function of Python or the exponential operation of NumPy. The hierarchical priority score reflects the legal level of the regulation, and the LevelWeight mapping function is used to map the discrete regulation levels (national standards, industry standards, enterprise procedures, local rules) to fixed weight values. The mapping relationship is usually stored in the form of a hash table, such as {national standards: 1.0, industry standards: 0.8, enterprise procedures: 0.6, rules: 0.4}, which ensures the legal application principle of the upper law constantly lower law. The total score of the comprehensive exception priority is the linear weighted sum of the three sub-scores, and the weight parameter is an adjustable hyperparameter that satisfies In the power industry compliance scenario, it is usually configured as To emphasize specificity priority, this weighted fusion technology converts legal principles into a calculable, configurable quantitative model.
[0043] It can be understood that after identifying the conflicting clauses, it cannot be simply randomly decided or rely on a single factor to determine the applicable clause, but must follow the basic principles of legal application, such as "special law priority, new law priority, and upper law priority". Therefore, these three abstract principles are quantified into calculable numerical indicators: the specificity score is calculated by reversing the applicable scope, so that a special clause that only applies to "220kV transformer maintenance" scores higher than a general clause that applies to "all equipment", achieving automation of the special priority principle; the time priority score gives higher weight to newly published clauses through an exponential decay function, ensuring that the 2022 revised procedure is prior to the 2020 old version, achieving quantization of the new and old priority principle; the hierarchical priority score enforces legal levels through a pre-set weight mapping, ensuring that national standards always score higher than enterprise procedures, and achieving technical landing of the upper law priority principle. After the weighted fusion of the three sub-scores, the legal expert's decision-making experience is encoded into a repeatable mathematical model, enabling the AI system to simulate human experts' value judgments in complex conflict scenarios, providing objective, interpretable, and verifiable decision-making basis for automatic adjudication in S5. The weighting mechanism also supports dynamic adjustment of weights according to the requirements of the power industry supervision, such as increasing to 0.5 to emphasize hierarchical priority, and increasing to 0.5 to emphasize conditional specificity, enhancing the adaptability and flexibility of the system.
[0044] Preferably, step S5 comprises: making decision adjudication and contradiction resolution according to the exception priority score of the clause and the time visibility constraint; the adjudication result satisfies the relationship: ; the time visibility constraint satisfies the relationship: ; the integration processing of the multiple-clause conflict satisfies the relationship: ; wherein, represents the adjudication result of the clause pair, and and respectively represent the comprehensive priority scores of the clauses and , represents the case requiring manual review; represents the visibility of the clause at the time point , represents the effective time of the clause, represents the invalidation time of the clause, represents the query or applicable time; represents the finally adopted clause, represents the candidate clause set, represents the weight coefficient, represents the indicator function; when the priority scores are equal, the time constraint causes all clauses to be invisible, or the integration result of multiple clauses is tied, a conservative interpretation is output and marked as requiring manual review.
[0045] It should be noted that adjudication is the final decision-making process of conflict resolution, which determines which of the conflicting clauses should be adopted and which should be discarded through numerical comparison, and the output result is a clause object or a manual review mark. The time visibility constraint is a mandatory verification mechanism to ensure the legality of legal application, which filters clauses that have been invalidated or have not yet come into effect by judging whether the query time strictly falls within the effective time interval of the clause, preventing AI systems from referencing invalid regulations and causing compliance risks. The integration processing of multiple-clause conflict is a technical means to handle "one-to-many" or "many-to-many" complex conflict situations in reality. When a certain topic involves three or more clauses conflicting with each other, a weighted voting mechanism is used to count the number of wins of each clause in pairwise comparison, and the clause with the highest support is selected as the final result, overcoming the single-point deviation of binary comparison. The weight coefficient is used in the integration processing to adjust the influence of different opponent clauses, which is usually positively correlated with the priority score or condition coverage range of the opponent clause, and can be normalized by the softmax function to ensure that the weight sum is 1. The indicator function is a binary function in mathematics that outputs 1 when the internal condition is true, otherwise outputs 0, used in statistical clauses The number of times of winning in pairwise adjudication. The conservative interpretation is a safety backoff mechanism of the system in low-confidence or boundary scenarios, not outputting a single adjudication conclusion, but listing all candidate clauses at the same time and attaching a "human review required" label, ensuring not to mislead the user in uncertain conditions. Human review is a collaborative process of submitting controversial cases that the algorithm cannot adjudicate to legal experts for final review, and the labeling method is to insert special tags such as [REVIEW_REQUIRED] in the output text and highlight them.
[0046] It can be understood that only comparing priority scores after identifying conflicts is not enough to ensure the legitimacy and integrity of the adjudication result. Therefore, first of all, the Decision function is used to make a binary comparison of single-pair conflicts, and if the priority score difference is significant, the high-score clause is directly selected to achieve fast adjudication; through the mandatory check of the time visibility constraint Visible function, it is ensured that the selected clause is in an effective state at the query point in time, avoiding the timeliness error caused by the chaotic management of regulations version, for example, a clause may have high priority but has been abolished on January 1, 2023, then Visible = 0, the system will exclude it; through the integrated processing of multiple clause conflicts Final function, the complex situation of "multiple regulations contradicting each other in the same scene" in actual scenarios is dealt with, and a weighted voting mechanism is used to count the number of times each clause wins in pairwise comparison, avoiding the circular paradox that a single binary comparison may fall into, for example, in the loop of , the overall optimal solution is selected by weighted score; when the priority score cannot be distinguished, the time constraint causes all candidate clauses to be invisible, or the weighted vote is tied, the system does not make a blind decision, but triggers the conservative interpretation mechanism to transfer the boundary condition to human processing. In general, by combining numerical comparison, timeliness check, integrated voting, and safety backoff, a hybrid decision-making mode of "automatic adjudication as the main and human intervention as the auxiliary" is formed, which not only guarantees the processing efficiency in high-confidence scenarios, but also ensures the compliance and safety in low-confidence scenarios, solving the core defects of the prior art that cannot handle complex conflicts of multiple clauses, lack timeliness check, and no safety backoff mechanism.
[0047] Preferably, step S6 comprises: constructing an evidence path for the adjudicated result clause and generating a hierarchical explanation; the evidence path satisfies the relationship: ; the hierarchical explanation satisfies the relationship: ; wherein, denotes adjudication result clause denotes evidence path, denotes node including clause or version, denotes edge type, denotes path length, denotes hierarchical explanation, denotes general rule of output, denotes exception clause of output, denotes applicable condition of exception clause, denotes adjudication reason, denotes cited evidence path; force additional clause number and time label in the explanation text, format is .
[0048] It should be noted that the evidence path is a traceable representation of the legal association between clauses modeled as a graph structure link. Through the sequence of nodes (clauses, versions, terms) and directed edges (reference, replacement, repeal, exception), the reasoning chain from the applicable clause to its superior law basis or historical evolution is fully presented, supporting auditors to verify the reverse source of the decision conclusion. Hierarchical explanation is a natural language output template organized by logical level, adopting a four-section structure of "general rule → exception clause [applicable condition] → adjudication reason → cited path". Through forced formatting, it ensures that each explanation contains complete decision elements, avoiding information omission. The general rule is a clause statement with a wider scope of application and a higher level of abstraction, usually the superior law or general specification, serving as the basis reference point for the explanation. The exception clause is a special provision that conflicts with the general rule but has priority, usually the subordinate law or proviso content, which is explicitly listed in the explanation to illustrate the "exception priority" basis for the decision. The applicable condition is the prerequisite for the exception clause to take effect, directly referencing the Boolean expression or natural language segment standardized in S1, used to define the applicable boundary of the exception clause. The adjudication reason is the text explanation of the decision logic, including the legal principles (such as "due to the hierarchical priority principle" or "due to the specificity priority") and key evidence, enhancing the readability and persuasiveness of the explanation. The cited path is the textual presentation of the evidence path, connecting clause numbers with arrow symbols to form a traceable chain, such as , which intuitively shows the reference or replacement relationship between clauses. Clause number is the unique identifier assigned to a clause in the regulation text, adopting the format "regulation code-section-clause" (such as ) to ensure global uniqueness. Time label is the time metadata attached to the clause reference, in the format , by forcing the embedding of the effective and repealed time, making each assertion verifiable for its legal validity period, preventing the reference to expired clauses.
[0049] It can be understood that only a single conclusion of "which clause wins" cannot meet the audit compliance requirements under the strong supervision of the power industry, and the reviewer needs to know the logical chain, legal basis and application conditions of the decision completely. Therefore, the clauses and their meta information are constructed into an attribute graph through graph structure modeling, the nodes store clause quadruples, version numbers, effective times and other attributes, and the edges store reference, replacement and abolition relationship types to form a traversable evidence network; Then a hierarchical explanation template is used to decompose the decision-making process into four progressive levels of "general rules" (basic norms), "exception clauses [application conditions]" (special rules and their boundaries), "reasons for the ruling" (legal principle explanation) and "reference path" (evidence traceability), so that the explanation conforms to the narrative habits of human legal thinking, and the clause number and time limit label are forcibly embedded to ensure that each assertion can be traced back to the original text. This step solves the "black box" problem of traditional system output conclusions that cannot be verified by explicitly constructing evidence paths, for example, when the system rules that the national standard clause is preferred, the reviewer can quickly locate the two original clauses and version information through the path (prior to the superior law); Through hierarchical templates and mandatory time limit labels, the problem of fragmented and lack of binding output information is solved, and the explanation text itself becomes a review record with legal effect.
[0050] Preferably, step S7 comprises: quality evaluation of the conflict explanation result, calculating a comprehensive quality score through a confidence score and a path consistency score; The confidence score satisfies the relationship: ; The path consistency score satisfies the relationship: ; The comprehensive quality score satisfies the relationship: ; Wherein, represents the confidence score of clause to and represent the priority scores of clauses and respectively, represents a smoothing factor, represents the path consistency score of clause , represents the number of paths that meet the shortest path condition, represents the number of all feasible paths, represents the comprehensive quality score of clause conflict explanation, and respectively represent the weight parameters of the confidence score and the path consistency score; When the comprehensive quality score is less than a preset threshold , a conservative interpretation or a label of requiring manual review is output.
[0051] It should be noted that the confidence score is a technical indicator for quantifying the certainty of conflict resolution, which is obtained by calculating the ratio of the absolute value of the difference between the priority scores of the two clauses to the sum, the numerator reflects the degree of priority distinction, and the denominator is added for normalization, the smoothing factor is a very small constant (such as 1e-6) to prevent the denominator from being zero, the score value range is [0, 1), the larger the value, the more significant the difference in priority between the two clauses, the more reliable the resolution, and when the value approaches 0, it indicates that the priority scores are close and difficult to distinguish, and the risk of automatic resolution is high. The path consistency score is an indicator for evaluating the clarity of the evidence path, which is achieved by calculating the ratio of the number of shortest paths to the number of all feasible paths, wherein represents the number of paths with the fewest edges from the applicable clause to its legal basis, represents the total number of all possible reference, substitution, and abrogation paths, if there are multiple equivalent shortest paths, it indicates that there are complex cross-references between clauses, and the more dispersed the paths, the lower the consistency, the score value range is [0, 1], the higher the value, the more concentrated the evidence chain and the clearer the logic. Feasible paths refer to all upstream clause node sequences that can be reached from the applicable clause node through directed edges in the graph structure, path calculation uses depth-first search (DFS) or breadth-first search (BFS) algorithm, and edge types include reference, substitution, abrogation, exception, etc. The search depth is usually limited to within 5 hops to avoid combinatorial explosion. The comprehensive quality score is a weighted linear combination of confidence and path consistency, and the weight parameters , are determined through grid search or domain experience, satisfying , the score is used to uniformly quantify the reliability of the interpretation result, as the basis for deciding whether to trigger conservative output. The conservative interpretation is a safety fallback mechanism of the system in the low confidence scenario, which does not output a single resolution conclusion, but displays all candidate clauses side by side and adds a "manual review required" label, ensuring that the user is not misled in uncertain conditions and avoiding compliance risks caused by low-quality automatic decisions. The manual review label is implemented by inserting special tags such as [REVIEW_REQUIRED] or highlighting HTML tags, and the review system can identify the label and automatically assign it to the legal expert workflow.
[0052] It can be understood that even if the conflict resolution is completed in step S5, there are still potential risks such as close priority scores being difficult to distinguish, complex evidence paths leading to logical contradictions, and unstable algorithms in boundary scenarios. Step S7 quantifies the significance of the priority difference through the confidence score. When the difference between the two clauses is less than 0.05, the value tends to 0, indicating that the confidence of the decision is low, and there is a possibility of misjudgment. The clarity of the evidence chain is quantified by the path consistency score. When the shortest path ratio is less than 0.5, it means that there are multiple equivalent reference paths between the clauses, the legal basis is not unique, and the reliability of the explanation is questionable. The integrated quality score combines the two indicators to perform a unified reliability evaluation on the explanation result. When the score is lower than the preset threshold , the system does not output the hierarchical explanation in step S6, but triggers a conservative explanation mechanism to list all candidate clauses and prompt "manual review required". Specifically, by constructing an "evaluation-feedback-control" closed loop, the system rejects low-quality automatic decisions, ensures that it operates within its capability boundary, prevents incorrect conclusions caused by algorithm uncertainty from misleading the examiner, forms a reliable collaborative mode of algorithm autonomous decision and manual expert intervention, and solves the core defects of the prior art, such as lack of quality control and blindly outputting conclusions in low-confidence scenarios.
[0053] In the description of the present specification, the description of the terms "one embodiment", "some embodiments", "exemplary embodiment", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the exemplary description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0054] Although embodiments of the present application have been shown and described, those skilled in the art can understand that various changes, modifications, replacements and variations can be made to these embodiments without departing from the principles and spirit of the present application, and the scope of the present application is defined by the claims and their equivalents.
Claims
1. A method for detecting and hierarchically resolving regulatory conflicts based on exception priority, characterized in that, The method comprises the following steps: S1: parsing the regulatory text, extracting the quadruple representation of each clause, the quadruple comprising a subject, a modality, an action and a condition; S2: subject clustering based on the action in the quadruple, and building candidate conflict pairs based on the intersection of the effective time interval of the clause and the query time; S3: for each of the candidate conflict pairs, calculating a conflict score based on the opposite relationship of the modality and the compatibility of the condition, and determining that there is a conflict when the conflict score exceeds a preset threshold; S4: for the clause pair with a conflict, calculating an exception priority score of each clause, the exception priority score based on the specificity, time priority and hierarchical priority of the clause; S5: based on the exception priority score, ruling that the clause with high priority in the conflict clause pair is the applicable clause, and ensuring that the applicable clause is valid at the query time in combination with the time visibility constraint; S6: building an evidence path for the applicable clause and generating a hierarchical explanation, the hierarchical explanation comprising a general rule, an exception clause, an applicable condition, a ruling reason and a reference path; S7: based on the difference in the exception priority score and the consistency of the evidence path, calculating a comprehensive quality score, and outputting a conservative explanation or marking for manual review when the comprehensive quality score is lower than a preset threshold.
2. The exception-priority-based regulatory conflict detection and hierarchical explanation generation method according to claim 1, characterized in that, Step S1 comprises: Obtaining a syntactic dependency graph through layout analysis and sentence segmentation, combining part-of-speech tagging and dependency syntax analysis; Identifying the modality category of the clause based on trigger word recognition and syntactic dependency relationship; Extracting the subject of the clause through named entity recognition method combined with industry ontology backtracking, identifying the action of the clause through verbs or object-verb phrases, and normalizing the condition fragment into a Boolean expression; Each clause quad represents , satisfying the relation: ; wherein, represents a clause subject that includes a job, department, or equipment, represents a modal category that takes the values obligation, prohibition, or permission, represents an action predicate or a gerund phrase, represents a Boolean expression consisting of conditions or exceptions.
3. The exception-priority-based regulatory conflict detection and hierarchical explanation generation method according to claim 1, characterized in that, Step S2 comprises: Vectorizing the action of the clause, and forming a subject cluster through a clustering algorithm; Within the same subject cluster, candidate conflict pairs are constructed based on the intersection of the clause's effective time interval and the query time, candidate conflict pairs satisfy the relation: ; wherein, and denote any two clause quadruples from the same topic cluster, and denote the effective / invalidation time interval of clause and respectively, denotes the intersection operation of time intervals.
4. The exception-priority-based regulatory conflict detection and hierarchical explanation generation method according to claim 1, characterized in that, Step S3 comprises: Building a modality opposite matrix to identify the modality opposite relationship between clauses, defining the condition compatibility, and comprehensively calculating the conflict score; The modality opposite matrix satisfies the relationship: ; The condition compatibility satisfies the relationship: ; The conflict score satisfies the relationship: ; wherein, represents a clause with modal opposite relation, modal category of a clause, represents an obligation, represents a prohibition, represents a permission, represents a set of conditions and incompatibility degree, represents a set cardinality; represents a conflict score, represents a subject similarity, represents a behavior similarity; When the conflict score exceeds a set threshold , the determining clause is in conflict with the other clause.
5. The exception-priority-based regulatory conflict detection and hierarchical explanation generation method according to claim 1, characterized in that, Step S4 comprises: Calculating the exception priority score of the clause, the exception priority score obtained by comprehensively considering the specificity score, the time priority score and the hierarchical priority score; The specificity score satisfies the relationship: ; the time-first score satisfies the relationship ; The hierarchical preference score satisfies the relationship ; the comprehensive exception priority total score satisfies the relationship: ; in, Terms and Conditions The specificity score, Indicates the coverage area of the main set. Indicates the coverage of the condition set; Terms and Conditions Time priority score This indicates the difference between the time the terms were published and the current time. Indicates the time decay coefficient. Terms and Conditions Hierarchical priority score, This indicates the regulatory hierarchy to which the clause belongs. The function representing the mapping from hierarchy to numerical weights. Terms and Conditions The overall priority score, , , These represent the weight parameters for specificity score, time priority score, and hierarchy priority score, respectively.
6. The exception-priority-based regulatory conflict detection and hierarchical explanation generation method according to claim 1, characterized in that, Step S5 comprises: Making decision ruling and contradiction resolution according to the exception priority score of the clause and the time visibility constraint; The adjudication result satisfies the relationship ; The temporal visibility constraint satisfies the relationship ; The integration processing of the plurality of clauses conflicts satisfies the relation ; wherein, represents the adjudication result of a clause, and respectively represent the comprehensive priority scores of clauses and represents the case that needs manual review; represents the visibility of a clause at a time point represents the effective time of a clause, represents the invalidation time of a clause, represents the query or applicable time; represents the finally adopted clause, represents the candidate clause set, represents the weight coefficient, represents the indicator function; When the priority score is equal, the time constraint causes all clauses to be invisible, or multiple clause integration results are parallel, output a conservative explanation and mark for manual review.
7. The exception-priority-based regulatory conflict detection and hierarchical explanation generation method according to claim 1, characterized in that, Step S6 comprises: Building an evidence path for the ruling result clause and generating a hierarchical explanation; The evidence path satisfies the relationship ; The hierarchical interpretation satisfies the relationship ; wherein, represents a ruling outcome clause represents an evidence path, represents a node comprising a clause or version, represents an edge type, represents a path length, represents a hierarchical explanation, represents a general rule of output, represents an exception clause of output, represents an applicability condition of an exception clause, represents a ruling reason, represents a cited evidence path; In the explanatory text, the additional clause number and the time limit tag are forced to be added, in the format .
8. The exception-priority-based regulatory conflict detection and hierarchical explanation generation method according to claim 1, characterized in that, Step S7 comprises: Quality evaluation of the conflict explanation result, calculating a comprehensive quality score through confidence score and path consistency score; the confidence score satisfies the relationship ; the path consistency score satisfies the relationship ; the overall quality score satisfies the relationship: ; wherein, denotes a confidence score of the clause, and denotes a priority score of the clause and denotes a smoothing factor, denotes a path consistency score of the clause denotes the number of paths satisfying the shortest path condition, denotes the number of all feasible paths, denotes a combined quality score of the clause conflict explanation, and denote weight parameters of the confidence score and the path consistency score, respectively. When the integrated quality score is less than a preset threshold a conservative interpretation is output or flagged for human review.