A Deep Learning-Based Method for Detecting the Normative Nature of Legal Documents
By extracting a set of standardized detection nodes in legal document detection, establishing a character boundary mapping table and a binary state set, and utilizing tensor mapping rules and conflict detection algorithms, the problems of inconsistent data representation and unclear detection results in existing technologies are solved, achieving stable and efficient legal document standardization detection.
Patent Information
- Application Number
- CN202611229734.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-13
- Publication Date
- 2026-11-10
AI Technical Summary
Existing methods for detecting the standardization of legal documents suffer from problems such as inconsistent expression of semantic relationship data, unstable handling of intermediate confidence relationships, large amount of repetitive calculations after partial modifications, and insufficient clarity in tracing the original text of the detection results.
By extracting the set of standard detection nodes from legal document texts, establishing a character boundary mapping table, analyzing the association confidence probability and generating a binary state set, calling tensor mapping rules and mutual exclusion conflict formulas to process the target constraint tensor, combining Boolean closure formulas and strongly connected component algorithms to perform conflict detection and loop closure determination, and using local change data to generate a standard detection report.
It achieves a unified data representation of subject entities, object entities, reference relationships, and exclusive relationships, stably handles intermediate confidence relationships, reduces the amount of repetitive calculations after local modifications, and clarifies the original source traceability capability of the detection results.
Smart Images

Figure CN123068645A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent text processing technology, and more specifically, to a method for detecting the standardization of legal documents based on deep learning. Background Technology
[0002] Legal documents typically include the subject, object, definitions, cited clauses, exclusion clauses, and action constraint phrases. To improve the efficiency of legal document review, existing technologies include text recognition methods based on natural language processing. These methods usually utilize named entity recognition, relation extraction, text classification, or rule matching to identify entities, clauses, and cited relationships in legal documents, and provide prompts for formatting or semantic issues based on preset rules.
[0003] With the application of deep learning technology to text analysis, sequence recognition models and relation extraction models can extract entities and relationships from unstructured legal documents, enabling the verification of legal document compliance to gradually shift from simple manual review or keyword matching to a combination of model recognition and rule judgment. For textual relationships such as clause citations, principal obligations, and exceptions, existing methods can output recognition results or confidence results, which can be used to assist reviewers in determining whether there are any omissions or conflicts in the document content.
[0004] However, existing methods for verifying the normative nature of legal documents typically focus more on entity identification or single relationship judgment, lacking a unified data representation method oriented towards node relationships. The subject entities, object entities, citation relationships, and exclusive relationships identified by the model often exist as scattered records. When performing mutual exclusion conflict detection, missing citation screening, or circular reference judgment, separate processing logic needs to be established. The correspondence between data is not stable enough, and it is also not conducive to the unified management of matrix coordinates, node identifiers, and original evidence fragments.
[0005] Meanwhile, the association confidence probabilities output by relation extraction models are usually continuous probability values. If high and low confidence results are directly used, node associations in the intermediate confidence interval are prone to becoming unresolved; if manual confirmation is relied upon, the continuity of the automatic detection process will be affected. Existing methods, when dealing with such intermediate confidence relationships, usually lack a binary state generation mechanism that connects with subsequent structured calculations, resulting in an insufficiently certain data foundation for subsequent conflict detection or loop closure determination.
[0006] Furthermore, legal documents are frequently subject to partial modifications during the review process. Existing methods often employ re-extraction and re-detection after text modifications. Even with minor modifications, this necessitates recalculating a significant range of textual relationships, with the computational load increasing with the number of nodes. The detection results also require explanation within the original text. Without stable character boundary mappings, the correspondence between anomalous nodes and original textual evidence fragments remains unclear. Summary of the Invention
[0007] To address the shortcomings of existing technologies, this invention provides a method for detecting the normative nature of legal documents based on deep learning. This method solves the problems of inconsistent semantic relationship data expression, unstable intermediate confidence relationship processing, large amount of repetitive calculation after local modifications, and unclear source of detection results.
[0008] To achieve the above objectives, the present invention provides the following technical solution: This invention provides a method for detecting the normative nature of legal documents based on deep learning, comprising: Extract the set of normative detection nodes from the legal document text and establish a character boundary mapping table. Analyze the association confidence probability of the set of normative detection nodes and generate a binarized state set through a non-blocking filtering process. Then, call the tensor mapping rule to transform the binarized state set into a target constraint tensor. The mutual exclusion conflict formula is called to process the mutual exclusion slice matrix of the target constraint tensor, generate the conflict detection matrix, and extract the abnormal coordinate points and push them into the error stack. The target constraint tensor is reduced to a two-dimensional adjacency matrix to generate a missing reference warning. Combining the Boolean closure formula and the strongly connected component algorithm, the node identifier sequence that forms a directed closed loop in the two-dimensional adjacency matrix is extracted and pushed onto the error stack. Based on the local changes in the legal document text, a change mask matrix is generated. The perturbation update formula is called to calculate the current adjacency matrix by combining the two-dimensional adjacency matrix and the change mask matrix. Based on the current adjacency matrix, the directed loop is re-determined to extract the new node sequence and push it into the error stack. The abnormal node set in the error stack is retrieved in reverse using the character boundary mapping table to obtain the abnormal boundary index. Combining the abnormal boundary index and the missing reference warning, a standard detection report is generated.
[0009] Furthermore, the steps of extracting the set of normative detection nodes from the legal document text and establishing a character boundary mapping table include: The system receives legal document text and uses a pre-trained sequence recognition model to discretize it, extracting the smallest units with independent legal effect or action constraints to generate a set of normative detection nodes. Each node in this set is assigned a node identifier. The system then extracts the start and end indices of each node in the legal document text and binds them to the corresponding node identifiers, storing them in a character boundary mapping table. Through the node identifiers and the character boundary mapping table, a correspondence is established between the normative detection nodes and the original evidence fragments in the legal document text. This allows the abnormal node set in the subsequent error stack to be reconstructed into abnormal start and end indices.
[0010] Furthermore, the steps for generating a binarized state set by analyzing the association confidence probability of the set of detection nodes and processing it through a non-blocking filtering process include: The relation extraction model is invoked to analyze the set of standardized detection nodes and output the association confidence probability between each node; the connectivity judgment is invoked to process the association confidence probability, the preset upper confidence threshold, and the preset lower confidence threshold; when the association confidence probability is greater than or equal to the upper confidence threshold, the corresponding node is confirmed as a valid connected edge. When the association confidence probability is less than or equal to the lower confidence threshold, the corresponding node association is confirmed as an unassociated state. When the association confidence probability is greater than the lower confidence threshold but less than the upper confidence threshold, the corresponding node association is extracted as an association pair. A static regularization rule engine is used as a non-blocking filtering process to perform deterministic matching on the association pairs. If the match is successful, it is confirmed as a valid connected edge. If the match fails or the matching times out within a preset time period, it is confirmed as an unassociated state. The valid connected edges and unassociated states are summarized to generate a binary state set. This process transforms the continuous confidence results output by the model into deterministic state data that can be used for tensor mapping and performs rule verification on association pairs within the intermediate confidence interval.
[0011] Furthermore, the steps of invoking the tensor mapping rule to transform the binary state set into the target constraint tensor include: Obtain the binarized state set and the standardized detection node set. Utilize the sparse storage format of the coordinate list to construct an initial constraint tensor whose physical dimension corresponds to the total number of nodes and the preset total number of constraint dimensions. Transform the initial constraint tensor according to the tensor mapping rule, traverse the binarized state set to extract source nodes and target nodes. If the source node and target node form a valid connected edge, extract the constraint dimension corresponding to the valid connected edge, and combine the source node, target node, and constraint dimension to generate three-dimensional spatial coordinates. Preset connectivity identifiers are written at the three-dimensional spatial coordinates of the initial constraint tensor. Following a sparse storage format, preset disconnection identifiers are maintained at the coordinates of the initial constraint tensor where no connectivity identifiers have been written, and these are combined with the written connectivity identifiers to generate the target constraint tensor. Thus, the node relationships in the binarized state set are transformed into a tensor structure capable of matrix slicing, dimensionality reduction, and loop closure detection.
[0012] Furthermore, the steps of calling the mutual exclusion conflict formula to process the mutual exclusion slice matrix of the target constraint tensor, generating a conflict detection matrix, and extracting abnormal coordinate points and pushing them onto the error stack include: Based on preset mutually exclusive dimension identifiers, the first slice matrix and the second slice matrix under the corresponding constraint dimension are extracted from the target constraint tensor. These first and second slice matrices are mutually exclusive. The mutual exclusion conflict formula is called to multiply the corresponding coordinate elements of the first and second slice matrices item by item to generate a conflict detection matrix. Abnormal coordinate points corresponding to positive-zero abnormal coordinate elements in the conflict detection matrix are extracted and pushed onto the error stack. This process uses the same source node and the same target node in the target constraint tensor as coordinate references to identify cases where two mutually exclusive constraint dimensions are simultaneously valid.
[0013] Furthermore, the steps to reduce the target constraint tensor to a two-dimensional adjacency matrix to generate a missing reference warning include: The target constraint tensor is dimensionality-reduced along the dimensional constraint axis and diagonalized into blocks according to the physical chapters to generate a two-dimensional adjacency matrix. Based on the total number of nodes in the standard detection node set, a corresponding type mask vector is initialized in memory. The root node and independent definitions in the standard detection node set are extracted, and the elements in the type mask vector corresponding to the root node and independent definitions are set to preset exemption values. Based on the type mask vector, nodes whose corresponding elements are not exemption values are selected as test nodes. The sum of the column elements in the two-dimensional adjacency matrix with the test node as the referenced target node is calculated; if it equals zero, a reference missing warning is generated. This process excludes nodes that do not participate in the reference missing screening through the type mask vector and determines the column element summation for test nodes that require a reference basis.
[0014] Furthermore, combining the Boolean closure formula and the strongly connected component algorithm, the steps for extracting the node identifier sequence that forms a directed closed loop in the two-dimensional adjacency matrix and pushing it onto the error stack include: The Boolean closure formula is applied to perform a transitive closure operation on a two-dimensional adjacency matrix over a Boolean semi-ring domain. The continuous Boolean product state matrices of the two-dimensional adjacency matrix are then logically ORed and summed to exhaustively enumerate directed connected paths, generating a global Boolean reachability matrix. If any element equal to one exists on the main diagonal of the Boolean reachability matrix, a directed loop is identified. A strongly connected component algorithm is then used to extract connected components from the two-dimensional adjacency matrix, generating a sequence of node identifiers constituting the directed loop, which is then pushed onto an error stack. By determining reachability through the Boolean reachability matrix and outputting the node identifier sequence using the strongly connected component algorithm, the directed loop detection results can be transformed into traceable data for subsequent analysis.
[0015] Furthermore, the steps for generating a change mask matrix based on local changes in the legal document text include: Based on the differences in local change data, the changed relationship edges are extracted and divided into newly added relationship edges and deleted relationship edges. Positive increment mask matrices and negative decrement mask matrices are generated for each, respectively. These two mask matrices are then combined to form the change mask matrix. This process transforms local modifications to legal document text into edge state changes in a two-dimensional adjacency matrix, providing data for the subsequent generation of the current adjacency matrix.
[0016] Furthermore, the steps of using the perturbation update formula in conjunction with the two-dimensional adjacency matrix and the changing mask matrix to calculate and generate the current adjacency matrix, and then re-determining the directed loop based on the current adjacency matrix to extract the new node sequence and push it onto the error stack include: The perturbation update formula is invoked, and a logical OR operation is performed between the 2D adjacency matrix and the incremental mask matrix in the changing mask matrix. Then, a logical AND operation is performed between the result of the logical NOT operation and the result of the decrement mask matrix to generate the current adjacency matrix. Based on the current adjacency matrix, the Boolean closure formula is invoked again to perform the decision logic. If a new directed loop is determined, the newly added node sequence constituting the new directed loop is extracted and pushed onto the error stack. This process writes new relational edges while preserving the unchanged edge states and clears deleted relational edges, ensuring that the topological state after local changes is expressed by the current adjacency matrix.
[0017] Furthermore, the steps for generating a canonical detection report include: using a character boundary mapping table to reverse-engineer the set of exception nodes in the error stack to obtain exception boundary indices, and combining these exception boundary indices with missing reference warnings. Using a character boundary mapping table, a reverse search is performed on the set of abnormal nodes extracted from the error stack, restoring them to the abnormal start index and abnormal end index. These are then combined into an abnormal boundary index to highlight the original text evidence fragments that cause logical conflicts in the front-end interactive interface. Combined with the abnormal boundary index and missing reference warnings, a standard detection report is generated.
[0018] Using a character boundary mapping table, the detection results corresponding to matrix coordinates and node identifiers can be mapped to original evidence fragments in legal documents.
[0019] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This invention uses a standardized set of detection nodes, a binary state set, and a target constraint tensor to sequentially handle the node extraction results, relationship determination results, and tensor expression results in legal document texts. This allows subject entities, object entities, reference relationships, and exclusive relationships to be stored in the form of node coordinates and constraint dimensions. The target constraint tensor is used to extract the mutual exclusion slice matrix and can be reduced to a two-dimensional adjacency matrix. Therefore, mutual exclusion conflict detection, missing reference screening, and directed loop determination can be completed based on the same set of node relationship data.
[0020] 2. This invention uses upper and lower confidence thresholds to segment the association confidence probability. High-confidence node associations are confirmed as valid connected edges, while low-confidence node associations are confirmed as unassociated states. Associations located between the two thresholds are entered into the regularization rule engine for deterministic matching, subject to a set time period limit. Through this processing method, the records in the binarized state set can maintain a deterministic state, which is convenient for subsequent tensor mapping rule execution coordinate writing or disconnection marker maintenance.
[0021] 3. This invention processes local change data in legal document texts. After difference comparison, the local change data forms newly added and deleted relation edges, which are written into the incremental mask matrix and the decrement mask matrix, respectively. The perturbation update formula updates the two-dimensional adjacency matrix according to the incremental and decrement mask matrices to generate the current adjacency matrix. The character boundary mapping table is used to restore the abnormal node set in the error stack to the abnormal boundary index, so that the standard detection report can correspond to the original evidence fragment in the legal document text. Attached Figure Description
[0022] Figure 1 This is an architecture diagram of a legal document standardization detection system based on deep learning according to the present invention; Figure 2 This is a flowchart of a method for detecting the standardization of legal documents based on deep learning, according to the present invention. Figure 3 A flowchart for generating a set of standardized detection nodes, a character boundary mapping table, and a binary state set in an embodiment of the present invention; Figure 4 A flowchart for generating the target constraint tensor in an embodiment of the present invention; Figure 5 This is a flowchart illustrating the mutual exclusion conflict detection process according to an embodiment of the present invention. Figure 6 This is a flowchart illustrating the process of performing reference missing screening and directed loop closure determination in an embodiment of the present invention; Figure 7 This is a flowchart illustrating the process of performing local change updates and generating a specification detection report in an embodiment of the present invention. Figure 8 This is a comparison chart of detection time under different specifications and numbers of detection nodes in the application embodiments of the present invention; Figure 9 This is a comparison chart of storage usage under different specifications and the number of detection nodes in the application embodiments of the present invention. Detailed Implementation
[0023] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] Please see the appendix Figure 1 This invention provides a deep learning-based legal document standardization detection system, comprising: The node extraction module is used to acquire unstructured legal document text. It uses a pre-trained sequence recognition model to discretize the legal document text, extracts the smallest unit with independent legal effect or action constraint, generates a set of standardized detection nodes, and establishes a character boundary mapping table between each standardized detection node in the set and the start and end indices. It is also used to call the relation extraction model to analyze the association confidence probability between nodes in the set of standardized detection nodes, and generate a binary state set by combining connectivity judgment with upper confidence threshold, lower confidence threshold and regularization rule engine.
[0025] The tensor construction module is used to construct an initial constraint tensor based on the binary state set and the standardized detection node set, using the sparse storage format of the coordinate list sparsity characteristic. It also extracts the source node, target node and constraint dimension corresponding to the effective connected edges through tensor mapping rules, writes the connected state identifier at the three-dimensional space coordinates corresponding to the initial constraint tensor, and generates the target constraint tensor.
[0026] The conflict detection module is used to extract mutually exclusive slice matrices (including the first slice matrix and the second slice matrix) from the target constraint tensor based on the mutually exclusive dimension identifier, call the mutually exclusive conflict formula to calculate the corresponding coordinates of the first slice matrix and the second slice matrix, generate a conflict detection matrix, extract abnormal coordinate points based on the abnormal coordinate elements in the conflict detection matrix, and push the abnormal coordinate points onto the error stack.
[0027] The loop closure detection module is used to reduce the dimensionality of the target constraint tensor along the dimensional constraint axis and perform diagonalization and block processing according to the physical chapters to generate a two-dimensional adjacency matrix. It filters the nodes to be tested based on the type mask vector, calculates the sum of the column elements in the two-dimensional adjacency matrix with the nodes to be tested as referenced target nodes, and generates a reference missing warning based on the sum of the column elements. It is also used to call the Boolean closure formula to perform transitive closure operation on the two-dimensional adjacency matrix to generate a Boolean reachability matrix. When there is an element equal to one on the main diagonal of the Boolean reachability matrix, it calls the strongly connected component algorithm to generate a node identifier sequence that constitutes a directed closed loop and pushes the node identifier sequence onto the error stack.
[0028] The source tracing report module receives local change data for legal document texts, extracts newly added and deleted relation edges based on the local change data, generates incremental and decrement mask matrices respectively, and calls the perturbation update formula to generate the current adjacency matrix. It is also used to re-execute directed loop closure judgment based on the current adjacency matrix, pushes the new node sequence into the error stack, and uses the character boundary mapping table to perform reverse retrieval of the abnormal node set in the error stack to obtain the abnormal start index and abnormal end index. Based on the abnormal boundary index (including the abnormal start index and abnormal end index), the original text evidence fragment is highlighted and rendered on the front-end interactive interface, and a standard detection report is generated and exported.
[0029] See appendix Figure 2 This invention also provides a method for detecting the normativity of legal documents based on deep learning, comprising the following steps: S1, the node extraction module acquires unstructured legal document text, discretizes the legal document text using a pre-trained sequence recognition model, generates a set of standardized detection nodes, and establishes a character boundary mapping table between each standardized detection node in the set and its start and end indices. The node extraction module calls the relationship extraction model to analyze the association confidence probability between nodes in the standardized detection node set, and generates a binary state set by combining connectivity judgment with upper and lower confidence thresholds and a regularization rule engine.
[0030] S2, the tensor construction module constructs an initial constraint tensor based on the binary state set and the standardized detection node set, utilizing the sparse storage format of the coordinate list's sparsity. It then maps valid connected edges to the 3D spatial coordinates in the initial constraint tensor using tensor mapping rules. The tensor construction module writes connectivity state identifiers at the 3D spatial coordinates to generate the target constraint tensor.
[0031] S3, the conflict detection module extracts the mutually exclusive slice matrix (including the first slice matrix and the second slice matrix) from the target constraint tensor based on the mutually exclusive dimension identifier, and calls the mutually exclusive conflict formula to calculate the corresponding coordinates of the first slice matrix and the second slice matrix to generate the conflict detection matrix. The conflict detection module extracts abnormal coordinate points based on the abnormal coordinate elements in the conflict detection matrix and pushes the abnormal coordinate points onto the error stack.
[0032] S4, the loop closure detection module reduces the dimensionality of the target constraint tensor along the dimensional constraint axis and performs diagonalization and block processing according to the physical chapters to generate a two-dimensional adjacency matrix. It then filters the nodes to be tested based on the type mask vector and generates a missing reference warning by summing the column elements in the two-dimensional adjacency matrix that use the node to be tested as the referenced target node. The loop closure detection module then calls the Boolean closure formula to perform a transitive closure operation on the two-dimensional adjacency matrix, generating a Boolean reachability matrix. Finally, it uses the strongly connected component algorithm to extract the node identifier sequence that constitutes the directed loop and pushes this sequence onto the error stack.
[0033] S5, the source tracing report module receives local change data for the legal document text, extracts newly added and deleted relation edges based on the local change data, generates incremental and decrement mask matrices respectively, and calls the perturbation update formula to generate the current adjacency matrix. Based on the current adjacency matrix, the source tracing report module re-executes the directed loop closure judgment and uses the character boundary mapping table to perform a reverse search on the abnormal node set in the error stack to obtain the abnormal boundary index (including the abnormal start index and abnormal end index). Based on the abnormal start index and abnormal end index, it highlights and renders the original text evidence fragment on the front-end interactive interface, generating and exporting a standard detection report.
[0034] See appendix Figure 3 In this embodiment, step S1 obtains unstructured legal document text through the node extraction module, generating a set of normative detection nodes, a character boundary mapping table, and a binary state set. The set of normative detection nodes provides the node source for the subsequent initial constraint tensor, the character boundary mapping table provides the index basis for subsequent coordinate tracing, and the binary state set provides edge state data for subsequent tensor mapping rules.
[0035] S101, the node extraction module receives unstructured legal document text and uses a pre-trained sequence recognition model to discretize the text, generating a set of standard detection nodes. Legal document text includes contracts, judgments, regulations, responses to review opinions, or other text data with clause structures. The node extraction module preserves the original character order of the legal document text and performs sentence segmentation, word segmentation, punctuation separation, and paragraph boundary recognition to obtain character sequences or word sequences.
[0036] The sequence recognition model comprises a text encoding layer, a context feature extraction layer, and a sequence labeling layer connected in sequence. The text encoding layer receives character or word sequences and converts characters, words, paragraph positions, chapter positions, and character positions into vector sequences. The context feature extraction layer performs context encoding on the vector sequences to obtain context representations for each character or word. The sequence labeling layer outputs node category labels based on the context representations. The text encoding layer employs a converter-based encoding structure, the context feature extraction layer uses a bidirectional long short-term memory network, and the sequence labeling layer uses a conditional random field or a linear classification layer. The aforementioned encoding, backpropagation, and parameter updating are well-known techniques in this field and will not be elaborated upon further.
[0037] The input data for the sequence recognition model includes character sequences or word sequences corresponding to legal document text, paragraph position identifiers, chapter position identifiers, and character position identifiers. The character sequences or word sequences are truncated or segmented according to the model's maximum input length, preserving overlapping context between adjacent segments and recording segment offsets. The output of the pre-trained sequence recognition model is node category labels, including subject entities, object entities, root nodes, independent definitions, independent action constraint phrases, and non-node text.
[0038] The training samples for the sequence recognition model are derived from labeled legal document texts. These samples include text fragments, character positions, and node category labels. The node category labels are generated by manual annotation or rule-based annotations that have been manually verified. During training, the text encoding layer outputs a vector sequence, the context feature extraction layer outputs a context representation, and the sequence labeling layer outputs the probability distribution of each character or word belonging to each node category label. When the sequence labeling layer uses a linear classification layer, the training loss function is the cross-entropy loss function; when the sequence labeling layer uses a conditional random field (CRF), the training loss function is the CRF negative log-likelihood loss function.
[0039] The node extraction module extracts the smallest units with independent legal effect or action constraints from the legal document text based on node category tags, and assigns a node identifier to each unit, generating a set of normative detection nodes. The normative detection nodes in the set encompass subject entities, object entities, root nodes, independent definitions, and independent action constraint phrases. Subject entities are the entities that bear rights or obligations in the legal document; object entities are the recipients of rights or actions; root nodes are the starting point of the hierarchical structure of the legal document; independent definitions are overarching interpretive clauses that do not require citation of other clauses; and independent action constraint phrases are action execution units that specify specific operations or restrictions.
[0040] The node extraction module merges consecutive and consistent label fragments into a single standard detection node. When multiple node category label boundaries exist within the same text fragment, the node extraction module splits them into multiple standard detection nodes according to the label boundaries and assigns a node identifier to each. Node identifiers use sequential numbers, hash numbers, or database primary key numbers to distinguish different standard detection nodes within the same legal document text.
[0041] S102, the node extraction module extracts the start and end indices of each standard detection node in the set of standard detection nodes from the legal document text, and combines the start and end indices into key-value pairs. The start index is the position of the first character of the original evidence fragment corresponding to the standard detection node, and the end index is the position after the last character of the original evidence fragment corresponding to the standard detection node. This indexing method uses left-closed and right-open intervals, which facilitates the front-end interactive interface to extract the original evidence fragment based on the start and end indices.
[0042] The node extraction module establishes a character boundary mapping table and binds key-value pairs with their corresponding node identifiers, storing them in the character boundary mapping table. The character boundary mapping table includes at least node identifiers, start indexes, end indexes, node categories, chapter positions, and paragraph positions. The character boundary mapping table uses a key-value table, a relational data table, or an in-memory dictionary structure; the node identifier serves as the search key, and the start and end indices serve as the search results, which are then used by the subsequent source tracing report module to restore the abnormal node set to its abnormal start and end indices.
[0043] The node extraction module uses the original character sequence of the legal document text as a basis and assigns character positions to newlines, spaces, punctuation marks, and Chinese characters. When the legal document text is input into the pre-trained sequence recognition model in segments, the node extraction module converts the intra-segment index into a global index in the legal document text based on the segment offset, thereby enabling the node identifiers in the standard detection node set to retrieve the original evidence segments in the legal document text.
[0044] In step S103, the node extraction module calls the relationship extraction model to analyze the set of normative detection nodes, outputting the association confidence probability between each node. It then calls the connectivity judgment function, combining the association confidence probability, preset upper confidence threshold, and preset lower confidence threshold to calculate and generate a binary state set. The relationship extraction model processes the set of normative detection nodes, the context text corresponding to each node, the source node position, the target node position, and the node category. The relationship extraction model outputs the association confidence probability and constraint dimension; the association confidence probability represents the confidence level of a constraint relationship between the source node and the target node, and the constraint dimension represents the constraint category between the source node and the target node.
[0045] The relation extraction model comprises a text encoding layer, a node representation layer, a node pair fusion layer, and a relation classification layer, connected sequentially. The text encoding layer receives context text containing source and target nodes and outputs a context vector. The node representation layer extracts source and target node vectors from the context vector based on the source and target node positions. The node pair fusion layer concatenates or fuses the source, target, node category, and relative position vectors using attention techniques to generate a node pair representation. The relation classification layer outputs the probabilities corresponding to each constraint dimension based on the node pair representation, with the highest probability or the probability of a specified constraint dimension used as the association confidence probability.
[0046] The input data for the relation extraction model includes context text, source node boundaries, target node boundaries, node category identifiers, and relative position identifiers. The context text is truncated or segmented according to the model's maximum input length. Source and target node boundaries are provided by a character boundary mapping table. Node category identifiers are derived from the set of normatively detected nodes. Relative position identifiers indicate the order and spacing of source and target nodes within the legal document text. The output of the relation extraction model corresponds to the business meaning of whether the source and target nodes form a valid connected edge under a certain constraint dimension.
[0047] The training samples for the relation extraction model are derived from legal document texts with labeled node relationships. Each training sample includes context text, source node, target node, node category, constraint dimension label, and connectivity state label. The constraint dimension label identifies the constraint category between the source and target nodes, and the connectivity state label identifies whether the source and target nodes form a valid connection edge. During training, the relation extraction model uses node pairs as training units and outputs the classification probability of node pairs under each constraint dimension. The training loss function is the cross-entropy loss function; when training both constraint dimension labels and connectivity state labels simultaneously, the training loss function is a weighted sum of the two cross-entropy loss functions. The weight parameters are determined based on the classification accuracy and recall on the validation dataset; for example, the weight parameters range from 0.2 to 0.8.
[0048] The node extraction module generates association pair processing records based on the association confidence probability. Each association pair processing record includes at least a source node, a target node, an association confidence probability, and a constraint dimension. After entering the connectivity assessment, the association pair processing record generates either a valid connected edge or a non-associative state. The source node is the node that initiates the constraint relationship, the target node is the node that points to the constraint relationship, and the constraint dimension is the constraint category between the source and target nodes. After the association pair processing record enters the connectivity assessment, the connectivity assessment outputs either a valid connected edge or a non-associative state based on the upper and lower confidence thresholds.
[0049] When the association confidence probability is greater than or equal to the upper confidence threshold, the connectivity determination confirms the corresponding node association as a valid connected edge and writes the valid connected edge into the binary state set. A valid connected edge in the binary state set includes at least the source node, target node, constraint dimension, association confidence probability, and connectivity state identifier. The valid connected edge serves as the object of subsequent tensor mapping rules, used to generate three-dimensional spatial coordinates.
[0050] When the association confidence probability is less than or equal to the lower confidence threshold, the connectivity assessment classifies the corresponding node association as an unassociative state and writes the unassociative state into the binary state set. An unassociative state includes at least the source node, target node, constraint dimension, association confidence probability, and disconnection flag. An unassociative state indicates that the corresponding association does not enter the connectivity state flag writing process for the target constraint tensor.
[0051] When the association confidence probability is greater than the lower confidence threshold but less than the upper confidence threshold, the node extraction module extracts the corresponding association pairs and uses a static regular expression rule engine as a non-blocking filtering process to perform deterministic matching on the association pairs, generating matching results. The regular expression rule engine processes the corresponding context text in the association pairs according to preset rule expressions, which are used to identify quoted words, excluded words, equivalent words, chapter pronouns, and clause number formats. Matching results include successful match, failed match, and match timeout.
[0052] When the matching result is successful, the connectivity assessment confirms the associated pair as a valid connected edge. If the regularization rule engine matches a constraint dimension, the constraint dimension matched by the regularization rule engine is written into the valid connected edge. If the regularization rule engine does not match a constraint dimension, the constraint dimension output by the relation extraction model is written into the valid connected edge, and then the valid connected edge is written into the binary state set. When the matching result is a failed match or the matching times out within a preset time period, the connectivity assessment confirms the associated pair as an unassociated state and writes the unassociated state into the binary state set. After the above processing, associated pairs with an association confidence probability between the lower confidence threshold and the upper confidence threshold enter a determined state, avoiding the generation of unresolved records in the binary state set.
[0053] The node extraction module summarizes valid connected edges and unassociated states, generating a binary state set. Records in the binary state set correspond to associated pairs, with the state value being either a valid connected edge or an unassociated state. The tensor construction module receives the binary state set and the set of standardized detection nodes, extracts the source node, target node, and constraint dimensions based on the valid connected edges, and maintains the disconnection markers for the corresponding coordinates based on the unassociated states.
[0054] The upper confidence threshold is set based on the accuracy, false positive rate, and detection requirements of the relation extraction model on the validation dataset, and is used to determine the range of confidence probabilities for associations that can be directly identified as valid connected edges. For example, the upper confidence threshold ranges from 0.80 to 0.95.
[0055] The lower confidence threshold is set based on the recall rate, false negative rate, and detection requirements of the relation extraction model on the validation dataset and legal document text. It is used to determine the confidence probability range of an association that can be directly confirmed as unrelated. For example, the lower confidence threshold ranges from 0.05 to 0.30, and it is less than the upper confidence threshold.
[0056] The time period is set based on the time overhead of the regular expression engine in processing a single association pair and the response time requirements of the detection system. It is used to limit the matching time of a single association pair in the non-blocking filtering process. For example, the value range of the time period can be set from 10ms to 500ms.
[0057] See appendix Figure 4 In this embodiment, the tensor construction module in step S2 constructs an initial constraint tensor based on the binarized state set and the set of standardized detection nodes, and writes connectivity state identifiers based on tensor mapping rules to generate a target constraint tensor. The target constraint tensor is used to record the connectivity state between standardized detection nodes under different constraint dimensions, and provides matrix data for subsequent mutual exclusion conflict detection and directed loop closure determination.
[0058] S201, the tensor construction module obtains the binary state set and the standardized detection node set, and utilizes the sparse storage format of the coordinate list's sparsity to construct a physical dimension of... The initial constraint tensor. Wherein, To standardize the total number of nodes in the detection node set, This represents the preset total number of constraint dimensions; the first dimension of the initial constraint tensor corresponds to the source node, the second dimension corresponds to the target node, and the third dimension corresponds to the constraint dimension.
[0059] The tensor construction module builds a node index table based on the node identifiers in the specification's detection node set, so that each node identifier corresponds to a node index, and the value of the node index ranges from 1 to... The node index table includes at least node identifiers, node indices, and node categories, and is used to convert source and target nodes in the binarized state set into row and column positions in the initial constraint tensor.
[0060] The valid connected edges in the binary state set include the source node, target node, constraint dimension, association confidence probability, and connected state identifier. After reading the valid connected edges, the tensor construction module determines the source node index in the node index table based on the source node, determines the target node index in the node index table based on the target node, and determines the three-dimensional spatial coordinates in the initial constraint tensor using the source node index, target node index, and constraint dimension.
[0061] The sparse storage format of the coordinate list, which leverages its sparsity property, is used to store non-zero coordinate records. Each non-zero coordinate record includes a source node index, a target node index, a constraint dimension, and a connectivity flag. The initial constraint tensor initializes the coordinate list to an empty set in memory. Coordinates without a connectivity flag are interpreted as disconnected by default. Unconnected states are not written to the coordinate list; when reading the 3D spatial coordinates corresponding to an unconnected state, the tensor construction module returns a disconnected flag.
[0062] The remaining coordinate positions are those where the connectivity state identifier was not written in the initial constraint tensor. In this embodiment, these are logical states and are not fully enumerated and stored. Through non-zero coordinate records and default disconnection identifiers, the initial constraint tensor represents valid connected edges and unconnected states.
[0063] The preset total number of constraint dimensions is set based on the number of constraint categories that need to be detected in the legal document text, and is used to limit the value range of the third dimension of the initial constraint tensor. For example, the total number of constraint dimensions can range from 3 to 12. Constraint dimensions include inclusion or reference relationships, exclusion or exclusion relationships, equivalence relationships, and other constraint categories applicable to the normative detection of legal documents. Each constraint dimension uses a fixed number during the same detection process.
[0064] The connectivity flag is set according to the writing requirements of the tensor mapping rules, indicating the existence of a valid connected edge at the 3D spatial coordinates. For example, the connectivity flag is set to 1. The disconnection flag is set according to the default state of the sparse storage format, indicating the absence of a valid connected edge at the 3D spatial coordinates. For example, the disconnection flag is set to 0.
[0065] For the array organization of the Coordinate List (COO) format, those skilled in the art can use coordinate arrays and numerical arrays to store non-zero coordinate records. Indexing compression and coordinate retrieval are well-known techniques in the field and will not be elaborated upon here. In this embodiment, the sparse storage format with the sparsity characteristics of the coordinate list processes the connectivity identifiers in the initial constraint tensor, and the output is sparse tensor data retrieved according to three-dimensional spatial coordinates.
[0066] S202, the tensor construction module transforms the initial constraint tensor according to the tensor mapping rules to generate the target constraint tensor. The tensor mapping rules take the binary state set and the initial constraint tensor as the processing objects, and the tensor data after writing the connected state identifier as the processing result; valid connected edges enter the three-dimensional space coordinate writing process, and unconnected states maintain the disconnection identifier.
[0067] The tensor construction module iterates through the records in the binary state set, reading the source node, target node, constraint dimension, and state identifier from each record. When the state identifier is a valid connected edge, it looks up the source node index and target node index according to the node index table, and combines the source node index, target node index, and constraint dimension into a three-dimensional spatial coordinate. This three-dimensional spatial coordinate represents the connected position of the source node pointing to the target node under the corresponding constraint dimension.
[0068] The tensor construction module writes connectivity identifiers at the 3D spatial coordinates of the initial constraint tensor. When using a sparse storage format with the sparsity of the coordinate list, the writing process involves adding a non-zero coordinate record to the coordinate list; if a non-zero coordinate record already exists for the same 3D spatial coordinate, the connectivity identifier of that 3D spatial coordinate is retained, and duplicate records are merged into a single non-zero coordinate record.
[0069] When the state identifier is "unconnected," the tensor construction module does not write a connectivity identifier to the initial constraint tensor. The 3D spatial coordinates corresponding to an unconnected state belong to the remaining coordinate positions and do not form non-zero coordinate records in the sparse storage format. When reading, the disconnection identifier is returned according to the default state of the initial constraint tensor. Thus, valid connected edges are transformed into connectivity identifiers in the target constraint tensor, and unconnected states are transformed into disconnection identifiers in the target constraint tensor.
[0070] To ensure the closure of tensor mapping rules, the tensor construction module verifies the source node, target node, and constraint dimensions before writing. If a source node or target node cannot be matched with a node index in the node index table, the corresponding record is excluded from the 3D space coordinate writing process, and the connectivity status identifier is not written; if the constraint dimension is not between 1 and 2, the process is considered complete. When the value is within the specified range, the corresponding record is excluded from the 3D spatial coordinate writing process, and the connectivity status identifier is not written. After verification, the valid connected edges entering the writing process correspond to the 3D spatial coordinates in the target constraint tensor.
[0071] The target constraint tensor consists of connectivity and disconnection flags. The three-dimensional coordinates in the target constraint tensor have the following meanings: the source node index represents the node that originates the constraint, the target node index represents the node to which the constraint is directed, the constraint dimension represents the category to which the constraint belongs, the connectivity flag indicates the existence of a corresponding valid connected edge, and the disconnection flag indicates the absence of a corresponding valid connected edge.
[0072] The binary state set is a discrete record of node relationships, and the target constraint tensor is a spatial algebraic representation of node relationships. The tensor construction module converts the source node, target node, and constraint dimension into three-dimensional spatial coordinates through tensor mapping rules, so that the relationship judgment results in legal document texts enter a unified tensor coordinate system; subsequently, the conflict detection module extracts a two-dimensional slice matrix along the constraint dimension, and the loop closure detection module performs dimensionality reduction along the dimension constraint axis and generates a two-dimensional adjacency matrix.
[0073] See appendix Figure 5 In this embodiment, the conflict detection module in step S3 extracts a two-dimensional slice matrix of the target constraint tensor in the mutual exclusion dimension, calls the mutual exclusion conflict formula to generate a conflict detection matrix, and pushes the abnormal coordinate points onto the error stack. The constraint dimension in the target constraint tensor is formed into a two-dimensional matrix after slicing, and the mutual exclusion relationship between the same source node and the same target node is checked according to the coordinate position.
[0074] S301, the conflict detection module extracts the mutually exclusive slice matrix (including the first slice matrix and the second slice matrix) under the corresponding constraint dimension from the target constraint tensor based on the preset mutually exclusive dimension identifiers. The mutually exclusive dimension identifiers are used to record two constraint dimensions that cannot be simultaneously true. The mutually exclusive dimension identifiers include... and .
[0075] The three-dimensional spatial coordinates of the target constraint tensor consist of the source node index, the target node index, and the constraint dimension.
[0076] When extracting the first slice matrix, the conflict detection module has a fixed constraint dimension of 1. Read the constraint dimension of the target constraint tensor equal to The source node index and the target node index; When extracting the second slice matrix, the conflict detection module has a fixed constraint dimension of 1. Read the constraint dimension of the target constraint tensor equal to The source node index and the target node index.
[0077] The number of rows and columns in both the first and second slice matrices are... Row indexes correspond to source node indexes, and column indexes correspond to target node indexes. To standardize the total number of nodes in the detection node set.
[0078] When using a sparse storage format with the sparsity of coordinate lists, the collision detection module does not expand all coordinates in the target constraint tensor. The collision detection module selects coordinates from the non-zero coordinate records of the target constraint tensor whose constraint dimension is equal to... The records form the set of non-zero elements of the first slice matrix; the selection constraint dimension is equal to The records form the set of non-zero elements of the second slice matrix. Matrix coordinates that do not enter the set of non-zero elements are treated as disconnected.
[0079] Mutually exclusive dimension identifiers are set based on the constraint categories that cannot be simultaneously valid in the normative verification of legal documents, and are used to identify the two constraint dimensions participating in the mutual exclusion conflict detection. For example, mutually exclusive dimension identifiers include dimension combinations corresponding to inclusion or reference relationships and exclusive or exclusion relationships, as well as other constraint dimension combinations that cannot be simultaneously valid between the same source node and the same target node.
[0080] The conflict detection module verifies the mutually exclusive dimension identifiers before extracting the slice matrix. or Not in 1 to When the range is within the specified range, slice extraction is not performed, and the mutual exclusion conflict detection corresponding to the mutual exclusion dimension identifier is skipped; and If they are the same, the mutual exclusion conflict formula calculation is not performed, and the mutual exclusion conflict detection corresponding to the mutual exclusion dimension identifier is skipped. This represents the preset total number of constraint dimensions.
[0081] S302, the conflict detection module calls the mutual exclusion conflict formula to calculate the first slice matrix and the second slice matrix, generating the conflict detection matrix. The mutual exclusion conflict formula is: ; In the formula: The first in the collision detection matrix Line 1 Column elements; The first slice matrix is the first slice of the first slice matrix. Line 1 Column elements; For the second slice matrix, the first slice is the first slice. Line 1 Column elements; This is the Hadamard product operator, which represents multiplying the corresponding coordinate elements of a matrix one by one.
[0082] During calculation, the collision detection module uses the same row and column indices to calculate the corresponding coordinates of the first and second slice matrices. The first slice matrix is located in the coordinate... The location is a connectivity indicator, and the second slice matrix is at the same coordinate. When the location is a connectivity identifier, the collision detection matrix is in the coordinate system. Anomaly coordinate elements greater than zero are formed at any point; any slice matrix at coordinates When the location is a disconnection marker, the collision detection matrix is in the coordinate system. The value is zero at that point.
[0083] When the connectivity flag is set to 1 and the disconnection flag is set to 0, the calculation result of the mutual exclusion conflict formula has the following meanings: multiplying 1 by 1 results in 1, indicating that there are two mutually exclusive constraint dimensions for the same source node and the same target node; multiplying 1 by 0, 0 by 1, or 0 by 0 results in 0, indicating that the coordinate does not form a mutual exclusion conflict. The determination of abnormal coordinate elements being greater than zero is based on the value relationship between the connectivity flag and the disconnection flag, and no additional threshold is set.
[0084] When using a sparse storage format with the sparsity of coordinate lists, the collision detection module calculates the mutual exclusion formula by finding the intersection of non-zero coordinate records. The collision detection module matches the non-zero element sets of the first slice matrix and the second slice matrix according to their row and column indices. If records with the same coordinates exist, the coordinates are written into the non-zero coordinate record of the collision detection matrix and treated as an abnormal coordinate element. If no records with the same coordinates exist, they are not written into the collision detection matrix, and the corresponding coordinates are treated as zero.
[0085] The conflict detection module iterates through the non-zero coordinate records in the conflict detection matrix. When an outlier coordinate element greater than zero exists in the conflict detection matrix, the module extracts the outlier coordinate point based on this element. The outlier coordinate point includes at least the row index, column index, and... and In this context, row indexes correspond to the source node, and column indexes correspond to the target node. and Used to represent two constraint dimensions that cause mutual exclusion conflicts.
[0086] The conflict detection module restores the row index of the abnormal coordinate point to the source node and the column index to the target node based on the node index table, and pushes the abnormal coordinate point onto the error stack. The records in the error stack include the abnormal coordinate point, source node, target node, mutual exclusion dimension identifier, and conflict type, which are used by the subsequent source tracing and reporting module to generate the abnormal start index, abnormal end index, and original text evidence fragment in conjunction with the character boundary mapping table.
[0087] When the conflict detection matrix does not contain any abnormal coordinate elements greater than zero, the conflict detection module does not write abnormal coordinate points to the error stack and records the detection result corresponding to the mutual exclusion dimension identifier as "no mutual exclusion conflict detected". When multiple mutual exclusion dimension identifiers exist, the conflict detection module extracts the first slice matrix and the second slice matrix group by group according to the mutual exclusion dimension identifiers, executes the mutual exclusion conflict formula respectively, and merges the abnormal coordinate points detected in each group and writes them to the error stack; when the same abnormal coordinate point appears repeatedly, a record is retained, and the corresponding mutual exclusion dimension identifier is saved in the record.
[0088] The target constraint tensor stores the relationship state between the same set of specification detection nodes under different constraint dimensions. If the same source node and the same target node have connectivity indicators in both mutually exclusive dimensions, then the node pair simultaneously possesses two non-coexistent constraint relationships. The mutual exclusion conflict formula transforms the mutual exclusion conflict into non-zero elements in the conflict detection matrix by multiplying the corresponding coordinate elements one by one. The conflict detection module uses this to extract abnormal coordinate points and complete the error stack writing.
[0089] See appendix Figure 6 In this embodiment, the S4 step closed loop detection module reduces the dimension of the target constraint tensor to generate a two-dimensional adjacency matrix, screens and generates a missing reference warning; the closed loop detection module calls the Boolean closure formula to generate a Boolean reachability matrix, and determines directed closed loops based on the Boolean reachability matrix.
[0090] S401, the closed-loop detection module reduces the dimensionality of the target constraint tensor along the dimensional constraint axis and performs diagonalization block processing according to the physical chapters to generate a two-dimensional adjacency matrix. The three-dimensional spatial coordinates of the target constraint tensor include the source node index, the target node index, and the constraint dimension; the dimensionality reduction process merges the connectivity state identifiers under different constraint dimensions into the same two-dimensional coordinates, so that the two-dimensional adjacency matrix represents whether there is a directed connection relationship between the standard detection nodes.
[0091] Dimensionality reduction uses non-zero coordinate records in the target constraint tensor as data sources. For any source node index and target node index, if at least one constraint dimension corresponds to a connectivity identifier, the connectivity identifier is written into the corresponding positions of the same source node index and target node index in the two-dimensional adjacency matrix; if no connectivity identifier is written into any constraint dimension, the corresponding positions retain the disconnection identifier. The row index of the two-dimensional adjacency matrix corresponds to the source node index, and the column index corresponds to the target node index; when the matrix element is a connectivity identifier, it indicates that the constraint relationship from the source node to the target node is valid.
[0092] The loop closure detection module performs diagonalization and block processing on the two-dimensional adjacency matrix based on the chapter position in the standard detection node set. Standard detection nodes belonging to the same physical chapter are arranged in adjacent rows and adjacent columns, and the rows and columns are permuted using the same node arrangement order, while simultaneously saving the node index mapping relationship before and after the permutation. This process changes the arrangement order of the two-dimensional adjacency matrix but does not change the connectivity state between the source node and the target node; when generating the node identifier sequence subsequently, the loop closure detection module restores the node identifiers based on the node index mapping relationship.
[0093] The loop closure detection module initializes a type mask vector in memory based on the total number of nodes in the specified detection node set. The length of the type mask vector is... , To standardize the total number of nodes in the detection node set, each element in the type mask vector corresponds to a standard detection node, used to record whether the standard detection node participates in the missing reference screening. Elements corresponding to the root node or independent definition are set to preset exempt values, while elements corresponding to standard detection nodes that require references are set to non-exempt values.
[0094] The loop closure detection module uses the type mask vector to filter out nodes whose corresponding elements are not exempt from testing as test nodes, and calculates the sum of the column elements in the two-dimensional adjacency matrix that use the test node as a referenced target node. The column indices of the two-dimensional adjacency matrix correspond to the target node indices, and the sum of the column elements represents the number of source nodes pointing to the test node. When the sum of the column elements equals 0, the loop closure detection module generates a missing reference warning; when the sum of the column elements is not equal to 0, the test node is recorded as having a reference basis.
[0095] A missing citation warning includes at least the node under test, the sum of column elements, the node category, and the chapter position. The node under test indicates the normative node where a missing citation occurs. The sum of column elements records the number of citations of the node under test in the two-dimensional adjacency matrix. The node category and chapter position are used for subsequent normative inspection report display. Root nodes and independent definitions are not included in the column element sum determination to ensure that the hierarchical starting point and overarching interpretative clauses of legal documents are not included in the missing citation screening.
[0096] The exemption value is set according to the node category of the specification detection node, and is used to identify the node type that does not participate in the missing reference screening. For example, the exemption value is 1, and the non-exempt value is 0; the root node and independent definition items correspond to the exemption value, and the subject entity, object entity, and independent action constraint phrase correspond to the non-exempt value. The determination of the cumulative sum of column elements is set according to the value relationship between the connectivity status indicator and the disconnection indicator in the two-dimensional adjacency matrix; for example, the connectivity status indicator is 1, the disconnection indicator is 0, and a missing reference warning is generated when the cumulative sum of column elements equals 0.
[0097] S402, the loop closure detection module calls the Boolean closure formula to perform a transitive closure operation on the two-dimensional adjacency matrix over the Boolean semi-ring domain, exhaustively enumerating directed connected paths and generating a global Boolean reachability matrix. The Boolean closure formula is: ; In the formula: It is a Boolean reachable matrix; This is the logical OR operation for summing consecutive values over a Boolean semi-ring field. The length index of the directed connected path; It is a two-dimensional adjacency matrix; For a two-dimensional adjacency matrix The Boolean product state matrix, where multiplication is a low-level logical AND operation and addition is a logical OR operation; In the Boolean semi-ring domain, a 1 in the two-dimensional adjacency matrix indicates a direct directed connection between two canonical detection nodes, while a 0 indicates no direct directed connection exists. The loop closure detection module calculates... When, if row index The corresponding specification detection node can reach the column index via an intermediate node. The corresponding standard testing nodes, then The Middle Line 1 The column contains only 1 element; calculate When, if row index The corresponding standard inspection node can be through a length of A directed connected path to a column index The corresponding standard testing nodes, then The Middle Line 1 The column contains only 1 element. The loop closure detection module will... to The Boolean product state matrices are logically ORed and combined to generate a Boolean reachability matrix.
[0098] in, represents the row index in the Boolean reachability matrix and the two-dimensional adjacency matrix, corresponding to the source node index in the set of canonical detection nodes; represents the column index in the Boolean reachability matrix and the two-dimensional adjacency matrix, corresponding to the target node index in the set of canonical detection nodes.
[0099] The elements of the Boolean reachability matrix are used to indicate whether a direct or indirect directed connected path exists between nodes in the canonical detection system. The Boolean reachability matrix is... Line 1 When an element in a column is 1, it indicates a row index. The corresponding canonical detection node can reach the column index along the directed connection relationship in the two-dimensional adjacency matrix. The corresponding specification detection node; when this element is 0, it indicates the row index. The corresponding specification check node cannot reach the column index along the directed join relationship. The corresponding specification detection node. The length index of the directed connected path is limited to 1 to... The number of nodes used for coverage is The reachability relationship required for determining a directed closed loop.
[0100] The loop closure detection module performs Boolean closure calculations based on the block-based results of the two-dimensional adjacency matrix. For nodes within a block, Boolean multiplication is performed within the corresponding chapter block; for non-zero connections across chapters, the cross-block connections are preserved and participate in the transitive closure operation. Block processing does not change the connectivity of the two-dimensional adjacency matrix, and the Boolean closure formula still calculates the complete two-dimensional adjacency matrix.
[0101] The underlying implementation of Boolean matrix multiplication can be achieved using bitwise operations, sparse matrix multiplication, or graph traversal. In this embodiment, the Boolean closure formula processes a two-dimensional adjacency matrix, and the result is a Boolean reachability matrix.
[0102] S403, the loop closure detection module extracts the main diagonal elements of the Boolean reachability matrix and traverses the main diagonal elements. The main diagonal elements of the Boolean reachability matrix indicate whether there is a directed connected path of length greater than 0 from the canonical detection node to itself; when there is an element equal to 1 in the main diagonal elements, the loop closure detection module determines that a directed loop exists.
[0103] After determining the existence of a directed loop, the loop closure detection module calls the strongly connected component algorithm to extract connected components from the two-dimensional adjacency matrix, generating a sequence of node identifiers that constitute the directed loop. The strongly connected component algorithm uses the two-dimensional adjacency matrix as its processing object, extracting the set of nodes where any two nodes are mutually reachable as strongly connected components. When a strongly connected component contains more than two nodes, it corresponds to a directed loop; when a strongly connected component contains only one node and the two-dimensional adjacency matrix contains a connected state identifier pointing to that node, that node corresponds to a self-loop.
[0104] The node identifier sequence consists of node identifiers from strongly connected components, and these identifiers are derived from the canonical detection node set. The loop closure detection module arranges the node identifier sequence according to the directed connectivity in the two-dimensional adjacency matrix and pushes the node identifier sequence onto the error stack. The records in the error stack include at least the node identifier sequence, the directed loop closure type, the relevant coordinates in the two-dimensional adjacency matrix, and the chapter position, which are then used by the subsequent source tracing report module to generate original text evidence fragments in conjunction with the character boundary mapping table.
[0105] When all diagonal elements of the Boolean reachability matrix are not equal to 1, the loop closure detection module does not call the strongly connected component algorithm to generate a node identifier sequence, and records the corresponding detection result as no directed loop detected. When multiple diagonal elements are equal to 1, the loop closure detection module performs a strongly connected component extraction on the two-dimensional adjacency matrix once, and pushes the node identifier sequence corresponding to each strongly connected component onto the error stack; when the same node identifier sequence appears repeatedly, the error stack retains one record.
[0106] A two-dimensional adjacency matrix expresses the direct references or constraints between standard detection nodes, while a Boolean reachability matrix expresses the reachability states formed by direct and indirect relationships. When a standard detection node can return to itself along a directed connection, the main diagonal element of the Boolean reachability matrix equals 1, corresponding to a circular reference or circular constraint in legal documents. The strongly connected component algorithm further provides a sequence of node identifiers that constitute a directed closed loop, enabling subsequent standard detection reports to locate specific standard detection nodes.
[0107] See appendix Figure 7 In this embodiment, the S5 step source tracing report module receives local change data, calls the perturbation update formula to generate the current adjacency matrix; the source tracing report module uses the character boundary mapping table to perform coordinate source tracing and generates a standard detection report.
[0108] S501, the source tracing report module receives unstructured local change data for legal document text, performs difference comparison based on the local change data, extracts change relationship edges, and generates a change mask matrix (including an increment mask matrix and a decrement mask matrix) based on the change relationship edges (including added relationship edges and deleted relationship edges). The local change data includes the text fragment before modification, the text fragment after modification, the start position of modification, the end position of modification, and the length of the modified characters, which are used to limit the character range corresponding to this text modification.
[0109] The source tracing report module determines the affected specification detection nodes based on local change data and reads the start and end indices corresponding to the affected specification detection nodes using the character boundary mapping table. When local change data alters the boundary of a specification detection node, the corresponding start and end indices in the character boundary mapping table are updated. When local change data generates new specification detection nodes, the node extraction module is invoked to generate new specification detection nodes within the local area, assigns a node identifier to the new specification detection node, and writes the node identifier, start index, and end index into the character boundary mapping table.
[0110] For comparing differences in locally modified data, those skilled in the art can use processing methods based on the longest common subsequence, edit distance, or text difference. Character-level difference localization is a well-known technique in the field and will not be elaborated here. In this embodiment, the objects of difference comparison are the text fragment before and after modification, and the processing results are the range of newly added text, the range of deleted text, and the affected specification detection nodes.
[0111] The source tracing report module invokes the relation extraction model within the affected standard detection nodes and their adjacent contexts to obtain the effective connected edges after local modifications. This process uses the sequence recognition model, relation extraction model, and connectivity judgment from step S1, without retraining the model or performing a full analysis on the legal document text. Effective connected edges already existing in the two-dimensional adjacency matrix before the local modification are compared with the effective connected edges after the local modification; newly added effective connected edges after the local modification are recorded as newly added relation edges, and effectively connected edges no longer existing after the local modification are recorded as deleted relation edges. Unchanged effective connected edges are not included in the modification mask matrix.
[0112] The scope of impact of the change is determined based on the character range corresponding to the local changed data, the start and end indices of the standard detection node, and the adjacent context window settings, which are used to limit the range of nodes for local re-verification. For example, the value range of the adjacent context window is 1 to 3 paragraphs, or 200 to 1000 characters before and after the modification position.
[0113] The source tracing report module generates a positive incremental mask matrix based on newly added relationship edges and a negative decrement mask matrix based on deleted relationship edges. Both the incremental and decrement mask matrices have the same row and column dimensions as the two-dimensional adjacency matrix, with row indices corresponding to source node indices and column indices corresponding to target node indices. The matrix coordinates corresponding to newly added relationship edges are written as 1 in the incremental mask matrix, and the matrix coordinates corresponding to deleted relationship edges are written as 1 in the decrement mask matrix; all other coordinates remain 0.
[0114] When local data changes cause the set of standard detection nodes to increase or decrease, the source tracing report module adjusts the node index table based on the updated set of standard detection nodes and adjusts the two-dimensional adjacency matrix, incremental mask matrix, and decrement mask matrix to the same dimension. When a node is deleted, the row and column elements associated with the corresponding node index are set to disconnection flags, and the corresponding node identifier is marked as deleted in the node index table, preventing the node from participating in subsequent directed loop closure determinations. When a node is added, the incremental mask matrix is written into the newly added rows and columns according to the newly added relational edges. After the dimension adjustment is completed, the input matrix of the perturbation update formula has a consistent row and column size.
[0115] The source tracing report module calls the perturbation update formula, combining the two-dimensional adjacency matrix, incremental mask matrix, and decrement mask matrix to calculate and generate the current adjacency matrix. The perturbation update formula is: ; In the formula: This is the current adjacency matrix; The time step before the local change The following is a two-dimensional adjacency matrix; It is an incremental mask matrix; For reduction mask matrix; The logical OR operator; For logical AND operator; This is the logical NOT operator.
[0116] The perturbation update formula is calculated item by item for each matrix coordinate. The two-dimensional adjacency matrix is first logically ORed with the incremental mask matrix, writing the matrix coordinates corresponding to newly added edges into the connected state. The result is then logically ANDed with the logical NOT result of the decrement mask matrix, clearing the connected state of the matrix coordinates corresponding to deleted edges. When the same matrix coordinate appears in both the incremental and decrement masks, the decrement mask matrix clears the connected state of that coordinate through logical NOT and logical AND operations.
[0117] The time step index is determined based on the number of modifications to the legal document text and is used to distinguish different detection states. For example, the initial detection corresponds to time step 0, and the first local change corresponds to time step 1. The values of the incremental mask matrix and the decrement mask matrix are set according to the changed relationship edges. For example, the coordinates of newly added or deleted relationship edges are set to 1, and the other coordinates are set to 0.
[0118] The source tracing report module re-invokes the Boolean closure formula to execute the judgment logic based on the current adjacency matrix. The current adjacency matrix replaces the two-dimensional adjacency matrix in the transitive closure operation, generating an updated Boolean reachability matrix. The source tracing report module uses the node identifier sequence recorded in the error stack before the local change as a comparison benchmark, comparing the updated node identifier sequence with the recorded node identifier sequence to identify the new directed loop after the local change. When a new directed loop is determined to exist, the strongly connected component algorithm is called to extract the new node sequence, and the new node sequence is pushed onto the error stack.
[0119] S502, the source tracing report module extracts the set of abnormal nodes from the error stack and uses a character boundary mapping table to perform a reverse search on the set of abnormal nodes, restoring the set of abnormal nodes to the abnormal boundary index that caused the exception (including the exception start index and the exception termination index). The record sources in the error stack include exception coordinate points, node identifier sequences, newly added node sequences, and missing reference warnings; the source tracing report module extracts the corresponding node identifiers according to the record type to form the set of abnormal nodes.
[0120] For abnormal coordinate points, the source tracing report module restores the row index to the source node and the column index to the target node based on the node index table, and adds the source node and target node to the abnormal node set. For node identifier sequences and newly added node sequences, the node identifiers are directly read and added to the abnormal node set; for missing reference warnings, the node to be tested is read and added to the abnormal node set.
[0121] The source tracing report module uses the node identifier in the abnormal node set as the search key to query the corresponding start index and end index in the character boundary mapping table. The start index obtained from the query is recorded as the abnormal start index, and the end index obtained from the query is recorded as the abnormal end index. When the same node identifier corresponds to multiple error records, a set of abnormal start index and abnormal end index is retained, and multiple conflict types are associated in the standard detection report.
[0122] When local data changes cause the character boundary mapping table to be updated, the character boundary mapping table retains valid boundary records of the affected nodes before the specification inspection report is generated. When a node identifier matches an updated boundary record, the updated start and end indices are used; when the text segment corresponding to the node identifier has been deleted, the deleted text range in the local data changes is used as the abnormal start and end indices, and the deletion relationship edge corresponding to the node is recorded in the specification inspection report.
[0123] S503, the source tracing report module highlights the original text evidence fragments that cause logical conflicts on the front-end interactive interface based on the abnormal start index and abnormal end index. The highlighting is based on the original character sequence of the legal document text, and the character range is truncated according to the abnormal start index and abnormal end index; when an error stack record corresponds to multiple standard detection nodes, the front-end interactive interface displays multiple original text evidence fragments in the order of node identifier sequence or newly added node sequence.
[0124] The source tracing report module summarizes the anomaly start index, anomaly end index, error stack, and missing citation warnings, generating and exporting a specification detection report. The specification detection report includes at least the set of anomaly nodes, the anomaly start index, the anomaly end index, fragments of original text evidence, anomaly coordinates, node identifier sequence, newly added node sequence, missing citation warnings, and corresponding conflict types.
[0125] The conflict types in the standard detection report correspond to the records in the error stack. Abnormal coordinate points correspond to mutual exclusion conflicts, node identifier sequences correspond to directed loops, newly added node sequences correspond to directed loops added after local changes, and missing reference warnings correspond to tested nodes lacking a reference basis. The source tracing report module uses the above correspondence to associate matrix coordinates, node identifiers, and character positions in legal document text as detection results.
[0126] Locally modified data alters character fragments in legal document text. A perturbation update formula handles edge state changes in the two-dimensional adjacency matrix, and a character boundary mapping table restores node identifiers to their corresponding character positions within the legal document text. The source tracing report module transforms newly added and deleted relationship edges into incremental and decremental mask matrices, ensuring the modified topological state is expressed in the current adjacency matrix. The character boundary mapping table then traces the abnormal node set back to the original evidence fragment, generating a standardized detection report.
[0127] To further aid in understanding the technical solutions of the embodiments of the present invention, a specific application example is given below.
[0128] In this application example, the input legal document text includes the following semantic content: Party A shall have a confidentiality obligation regarding the materials, and the materials cite the confidentiality obligation, which in turn cites Party A; furthermore, the legal document text contains statements indicating that Party A has exclusive rights to the materials. After processing the legal document text, the node extraction module generates 5 standard detection nodes, denoted as Node 1 to Node 5, where Node 1 represents Party A, Node 2 represents the materials, Node 3 represents the confidentiality obligation, Node 4 represents the exception clause, and Node 5 represents the notification obligation.
[0129] After the relation extraction model and connectivity judgment generate a binary state set, the tensor construction module writes the valid connected edges into the target constraint tensor. Assume the total number of constraint dimensions is 3, where the first dimension represents inclusion or reference relations, the second dimension represents exclusion or exclusion relations, and the third dimension represents equivalence relations. Based on the binary state set, the target constraint tensor contains the following connectivity state identifiers: In the first dimension, node 1 points to node 2, node 2 points to node 3, node 3 points to node 1, and node 4 points to node 2; in the second dimension, node 1 points to node 2.
[0130] The conflict detection module extracts the first and second dimensions of the two-dimensional slice matrix for nodes 1 and 2, and then uses the mutual exclusion conflict formula to perform calculations: ; in, This refers to the element in the 1st row and 2nd column of the collision detection matrix; For the objective constraint tensor, node 1 points to node 2 and the constraint dimension is the first dimension. The element in the target constraint tensor where node 1 points to node 2 and the constraint dimension is the second dimension. Since the calculation result is 1, the conflict detection module extracts the abnormal coordinate point and writes node 1, node 2, and the mutual exclusion dimension identifier into the error stack.
[0131] The loop closure detection module reduces the dimensionality of the target constraint tensor along the dimensional constraint axis to obtain a two-dimensional adjacency matrix: ; In this two-dimensional adjacency matrix, a value of 1 in the first row and second column indicates that node 1 points to node 2; a value of 1 in the second row and third column indicates that node 2 points to node 3; a value of 1 in the third row and first column indicates that node 3 points to node 1; and a value of 1 in the fourth row and second column indicates that node 4 points to node 2. For node 5, the sum of its column elements is 0, and node 5 is neither the root node nor an independent definition. Therefore, the loop closure detection module generates a missing reference warning.
[0132] The loop closure detection module continues to call the Boolean closure formula. Based on the above two-dimensional adjacency matrix, node 1 can reach node 2, node 2 can reach node 3, and node 3 can reach node 1. Therefore, after three Boolean products, the following Boolean product state matrix is obtained: ; because The elements in the first row and first column, the second row and second column, and the third row and third column of the main diagonal are all 1. The corresponding elements in the Boolean reachability matrix on the main diagonal are also 1. The loop closure detection module determines that there is a directed loop between node 1, node 2, and node 3, and calls the strongly connected component algorithm to generate a node identifier sequence. This node identifier sequence is written to the error stack.
[0133] After the user modifies the legal document text, the reference from node 3 to node 1 is deleted, and a new reference from node 3 to node 5 is added. The source tracing report module generates an incremental mask matrix and a decrement mask matrix based on the local change data. The value in row 3, column 5 is 1. The value in row 3, column 1 is 1. Substitute this into the perturbation update formula: ; For the 3rd row and 1st column, the calculation process is as follows: ; For the 3rd row and 5th column, the calculation process is as follows: ; Therefore, the current adjacency matrix removes the connected state from node 3 pointing to node 1 and writes the connected state from node 3 pointing to node 5. The updated directed relationships are node 1 pointing to node 2, node 2 pointing to node 3, node 3 pointing to node 5, and node 4 pointing to node 2, no longer forming a directed closed loop between node 1, node 2, and node 3. The source tracing report module uses a character boundary mapping table to restore the set of abnormal nodes in the error stack to the abnormal start index and abnormal end index, and highlights the original evidence fragments in the front-end interactive interface to generate a standardized detection report.
[0134] Further, in conjunction with the above application embodiments, experimental verification of the embodiments of the present invention was conducted. The experiment selected legal document texts containing clause references, definitions, exclusion clauses, and action constraint phrases as test samples, and formed benchmark data based on manually annotated results.
[0135] The test samples were divided into five groups of 100, 300, 500, 800 and 1000 according to the number of test nodes specified in the standard. The time consumed by re-verification of local changes and the storage usage were recorded for each group.
[0136] See appendix Figure 8 The full recalculation method is represented by a solid line with a hollow circle marker, while the embodiment of the present invention uses a dashed line with a solid square marker. Figure 8 Used to identify the two types of detection time data.
[0137] Regarding detection time, the embodiments of the present invention are compared with the full recalculation method. When the number of standard detection nodes is 100, 300, 500, 800, and 1000, the average detection time of the full recalculation method is 185ms, 920ms, 2380ms, 6040ms, and 9500ms, respectively; while the average detection time of the embodiments of the present invention is 42ms, 85ms, 132ms, 220ms, and 310ms, respectively.
[0138] Experimental results show that when the number of standard detection nodes increases, the embodiments of the present invention reduce redundant calculations by performing local updates through incremental mask matrix, decrement mask matrix and current adjacency matrix.
[0139] See appendix Figure 9 Dense matrix storage is represented by solid lines with hollow circles, while this embodiment of the invention uses dashed lines with solid squares. Figure 9 This is used to identify two types of storage data.
[0140] Regarding storage usage, the embodiments of the present invention are compared with the dense matrix storage method. When the number of standard detection nodes is 100, 300, 500, 800, and 1000, the average storage usage of the dense matrix storage method is 3MB, 27MB, 75MB, 192MB, and 300MB, respectively; while the average storage usage of the embodiments of the present invention is 0.4MB, 1.1MB, 1.8MB, 3.2MB, and 4.6MB, respectively.
[0141] Experimental results show that when the number of effective connected edges is less than the total number of 3D spatial coordinates, the target constraint tensor can reduce storage usage by using a sparse storage format with the sparsity of coordinate lists.
[0142] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely preferred examples and are not intended to limit the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for detecting the normative nature of legal documents based on deep learning, characterized in that, Includes the following steps: Extract the set of standard detection nodes from the legal document text and establish a character boundary mapping table. Analyze the association confidence probability of the set of standard detection nodes and generate a binarized state set through a non-blocking filtering process. The binarized state set is transformed into a target constraint tensor by invoking the tensor mapping rule; The mutual exclusion conflict formula is called to process the mutual exclusion slice matrix of the target constraint tensor, generate a conflict detection matrix, and extract abnormal coordinate points and push them into the error stack. The target constraint tensor is reduced to a two-dimensional adjacency matrix to generate a missing reference warning. Combining the Boolean closure formula and the strongly connected component algorithm, the node identifier sequence that forms a directed closed loop in the two-dimensional adjacency matrix is extracted and pushed into the error stack. A change mask matrix is generated based on the local changes in the legal document text. The perturbation update formula is called to calculate the current adjacency matrix by combining the two-dimensional adjacency matrix and the change mask matrix. The directed loop is re-determined based on the current adjacency matrix to extract the new node sequence and push it into the error stack. The abnormal node set in the error stack is retrieved in reverse using the character boundary mapping table to obtain the abnormal boundary index. The abnormal boundary index and the missing reference warning are combined to generate a standard detection report.
2. The method for detecting the normative nature of legal documents based on deep learning according to claim 1, characterized in that, The steps for extracting the set of standard detection nodes from legal document text and establishing a character boundary mapping table include: The legal document text is received, and the legal document text is discretized using a pre-trained sequence recognition model. The smallest unit with independent legal effect or action constraint in the legal document text is extracted to generate the standard detection node set, and a node identifier is assigned to each node in the standard detection node set. Extract the start index and end index of each node in the set of standard detection nodes in the legal document text, and bind them with the corresponding node identifier to the character boundary mapping table.
3. The method for detecting the normative nature of legal documents based on deep learning according to claim 2, characterized in that, The steps for analyzing the association confidence probabilities of the set of standardized detection nodes and generating a binarized state set through a non-blocking filtering process include: The relationship extraction model is invoked to analyze the set of standardized detection nodes, and the association confidence probability between each node is output. The connectivity judgment is combined with the associated confidence probability, the preset upper confidence threshold, and the preset lower confidence threshold for processing; When the association confidence probability is greater than or equal to the upper confidence threshold, the corresponding node association is confirmed as a valid connected edge; When the association confidence probability is less than or equal to the lower confidence threshold, the corresponding node is confirmed as unassociated. When the association confidence probability is greater than the lower confidence threshold and less than the upper confidence threshold, the corresponding node association is extracted as an association pair. A static regular expression rule engine is used as the non-blocking filtering process to perform deterministic matching on the association pair. If the matching is successful, it is confirmed as a valid connected edge. If the matching fails or the matching times out within the preset time period, it is confirmed as the unrelated state; The effective connected edges and the unrelated states are summarized to generate the binary state set.
4. The method for detecting the normative nature of legal documents based on deep learning according to claim 3, characterized in that, The steps of converting the binarized state set into a target constraint tensor by invoking tensor mapping rules include: Obtain the binarized state set and the standardized detection node set, and use the sparse storage format with the sparsity of the coordinate list to construct an initial constraint tensor whose physical dimension corresponds to the total number of nodes and the preset total number of constraint dimensions. The initial constraint tensor is transformed according to the tensor mapping rule, and the source node and target node are extracted by traversing the binarized state set. If the source node and the target node form the effective connected edge, then the constraint dimension corresponding to the effective connected edge is extracted, and the source node, the target node and the constraint dimension are combined to generate three-dimensional spatial coordinates; At the three-dimensional spatial coordinates of the initial constraint tensor, a preset connectivity state identifier is written; According to the sparse storage format, a preset disconnection flag is maintained at the coordinates where the connectivity flag is not written in the initial constraint tensor, and the target constraint tensor is generated by summing the disconnection flags with the written connectivity flags.
5. The method for detecting the normative nature of legal documents based on deep learning according to claim 1, characterized in that, The steps of processing the mutual exclusion slice matrix of the target constraint tensor by calling the mutual exclusion conflict formula, generating a conflict detection matrix, and extracting abnormal coordinate points and pushing them onto the error stack include: Based on the preset mutually exclusive dimension identifier, extract the first slice matrix and the second slice matrix under the corresponding constraint dimension from the target constraint tensor. The first slice matrix and the second slice matrix are the mutually exclusive slice matrices. The mutual exclusion conflict formula is called to multiply the corresponding coordinate elements of the first slice matrix and the second slice matrix one by one to generate the conflict detection matrix; Extract the abnormal coordinate points corresponding to the abnormal coordinate elements that are greater than zero in the conflict detection matrix, and push them onto the error stack.
6. The method for detecting the normative nature of legal documents based on deep learning according to claim 1, characterized in that, The steps of reducing the target constraint tensor to a two-dimensional adjacency matrix to generate a missing reference warning include: The target constraint tensor is reduced in dimensionality along the dimensional constraint axis and diagonalized into blocks according to the physical chapters to generate the two-dimensional adjacency matrix. Based on the total number of nodes in the detection node set according to the aforementioned standard, initialize the corresponding type mask vector in memory; Extract the root node and independent definition item from the set of standard detection nodes, and set the element in the type mask vector corresponding to the root node and the independent definition item as a preset test exemption value; Based on the type mask vector, nodes whose corresponding elements are not the exempt value are selected as nodes to be tested; Calculate the sum of the column elements in the two-dimensional adjacency matrix with the node under test as the referenced target node. If the sum is equal to zero, generate the missing reference warning.
7. The method for detecting the normative nature of legal documents based on deep learning according to claim 6, characterized in that, Combining the Boolean closure formula and the strongly connected component algorithm, the steps of extracting the node identifier sequence that forms a directed closed loop in the two-dimensional adjacency matrix and pushing it onto the error stack include: The Boolean closure formula is invoked to perform a transitive closure operation on the two-dimensional adjacency matrix in the Boolean semi-ring domain. The continuous Boolean product state matrix of the two-dimensional adjacency matrix is logically ORed and continuously summed. Directed connected paths are enumerated to generate a global Boolean reachability matrix. If there is an element equal to one in the main diagonal elements of the Boolean reachable matrix, then the directed closed loop is determined to exist. The strongly connected component algorithm is invoked to extract connected components from the two-dimensional adjacency matrix, generating the node identifier sequence that constitutes the directed closed loop, and the node identifier sequence is pushed onto the error stack.
8. The method for detecting the normative nature of legal documents based on deep learning according to claim 1, characterized in that, The steps for generating a change mask matrix based on partial changes in the legal document text include: Based on the local change data, difference comparison is performed to extract change relationship edges, which are divided into newly added relationship edges and deleted relationship edges, so as to generate positive incremental mask matrix and negative decrement mask matrix respectively. The incremental mask matrix and the decrement mask matrix are combined into the change mask matrix.
9. The method for detecting the normative nature of legal documents based on deep learning according to claim 8, characterized in that, The steps of calculating the current adjacency matrix by combining the perturbation update formula with the two-dimensional adjacency matrix and the changing mask matrix, and re-determining the directed loop based on the current adjacency matrix to extract the new node sequence and push it onto the error stack include: The perturbation update formula is called, and a logical OR operation is performed between the two-dimensional adjacency matrix and the incremental mask matrix in the changing mask matrix. Then, a logical AND operation is performed between the result of the logical NOT operation with the decrement mask matrix to generate the current adjacency matrix. The Boolean closure formula is invoked again to execute the decision logic based on the current adjacency matrix; If a new directed loop is determined to exist, the newly added node sequence constituting the new directed loop is extracted and pushed onto the error stack.
10. The method for detecting the normative nature of legal documents based on deep learning according to claim 1, characterized in that, The steps for generating a standardized detection report by reverse-searching the set of exception nodes in the error stack using the character boundary mapping table to obtain an exception boundary index, and combining the exception boundary index with the missing reference warning, include: Using the character boundary mapping table, a reverse search is initiated on the set of abnormal nodes extracted from the error stack, restoring them to the abnormal start index and abnormal end index, which are then combined into the abnormal boundary index to highlight and render the original text evidence fragments that cause logical conflicts on the front-end interactive interface. By combining the anomaly boundary index with the missing reference warning, a standardized detection report is generated.
