A method and system for intelligent pre-approval of government approvals based on a large model
By parsing government approval rules into a directed acyclic graph and retrieving feature value coordinates in a two-dimensional layout space, the problem of information extraction and positioning errors in government documents is solved, achieving higher accuracy and traceability.
Patent Information
- Application Number
- CN202611405229.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-10
- Publication Date
- 2026-11-17
AI Technical Summary
Existing technologies lack constraints on the physical spatial distribution characteristics of text when processing complex government approval documents, leading to errors in information extraction and positioning and low accuracy in logical judgment, thus failing to meet the requirement of certainty in the results of government pre-approval systems.
The government approval rules text is parsed into a directed acyclic graph. The absolute pixel coordinates of feature values are retrieved in a two-dimensional layout space using a large language model. Secondary feature extraction and logical operations are performed by calculating the physical straight-line distance between feature values and constructing local spatial windows, and the final pre-approval result is output.
It improves the reliability of information processing and the traceability of the pre-approval system output, reduces interference from irrelevant text data, and enhances the accuracy and verifiability of government approvals.
Smart Images

Figure CN123118028A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer data processing technology, specifically to an intelligent pre-approval method and system for government approvals based on a large model. Background Technology
[0002] With the popularization of artificial intelligence technology, large language models are gradually being applied to the document pre-review stage of government approval processes to automatically extract information from unstructured documents and assist in rule verification. Existing intelligent pre-review technologies typically convert government documents directly into one-dimensional plain text sequences through optical character recognition, and then rely on the natural language understanding capabilities of large language models to retrieve feature fields that match the approval rules in the global text.
[0003] This approach has limitations when dealing with complex government documents. Government approval documents are often lengthy and have varied layouts, typically containing paragraphs spanning multiple pages and similar clauses with similar wording. Existing methods lose the original two-dimensional spatial information of the text when converting document images into plain text sequences. When approval rules require joint judgments on multiple logically related conditions, language models rely solely on semantic relevance for global retrieval, making it difficult to identify whether the extracted feature fields belong to distinct business blocks in terms of physical layout. This purely semantic processing mechanism, lacking underlying physical spatial distribution constraints, easily leads to the model incorrectly piecing together numerical or textual data with large spatial spans and no substantial connection, causing information extraction and positioning errors. Furthermore, as the length of the input text increases, irrelevant and redundant data in long documents further expands the model's retrieval scope, increasing interference factors in feature extraction and causing a decrease in the system's accuracy when performing complex multi-condition logical judgments, failing to meet the deterministic requirements of government approval processes for data processing results. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides an intelligent pre-approval method and system for government approvals based on a large model. This solves the problem of information extraction and location errors that frequently occur when using large language models to process unstructured government approval documents, due to interference from cross-page or densely similar clauses. Existing methods primarily rely on the model's natural language understanding capabilities for global processing, lacking constraints on the physical spatial distribution characteristics of the underlying data. This results in low accuracy in logical judgments, making it difficult to meet the business requirements of government pre-approval systems for result certainty.
[0005] To address the above problems, the present invention provides the following technical solution: The first aspect of this invention provides an intelligent pre-approval method for government affairs approval based on a large model, comprising: The government approval rules text is parsed into a directed acyclic graph, wherein the non-leaf nodes of the directed acyclic graph contain logical operators, and the leaf nodes contain entity feature extraction tasks. Receive the document to be pre-reviewed, use the large language model to perform the entity feature extraction task in the directed acyclic graph, obtain the corresponding feature value, and retrieve the absolute pixel coordinates corresponding to the feature value in the two-dimensional layout space of the document to be pre-reviewed; The feature value and the absolute pixel coordinate are attached as a joint tuple to the corresponding leaf node. Based on the topology of the directed acyclic graph, multiple leaf nodes that are logically constrained by the same non-leaf node are obtained, and the physical straight-line distance between the multiple leaf nodes is calculated. If the physical straight-line distance is greater than the preset spatial cohesion threshold, it is determined that a spatial span abnormality has been triggered, the corresponding calculation branch is set to a blocked state and written into the manual review queue; if the physical straight-line distance is less than or equal to the spatial cohesion threshold, the operation is performed from the leaf node to the non-leaf node according to the directed acyclic graph to obtain the initial pre-review result. When the initial pre-review result is negative, a local spatial window is constructed in the document to be pre-reviewed, based on the absolute pixel coordinates of the leaf node that outputs a positive state in the same logical branch. A secondary feature extraction is performed within the local spatial window using a large language model. Based on the secondary feature extraction result, the spatial distance verification and the corresponding calculation path are re-executed, and the final pre-review result is output.
[0006] Furthermore, the process of parsing the government approval rule text into a directed acyclic graph includes: Identify conditional related words and feature entity words in the government approval rule text; Map the conditional conjunctions to the non-leaf nodes, and convert the comparison values and Boolean logic contained in the conditional conjunctions into the logical operators; The feature entity words are mapped to the leaf nodes, and directed connections are established between the non-leaf nodes and the leaf nodes.
[0007] Furthermore, the step of retrieving the absolute pixel coordinates corresponding to the feature value in the two-dimensional layout space of the document to be pre-reviewed includes: Optical character recognition and layout analysis are performed on the documents to be pre-reviewed to generate a two-dimensional layout feature matrix; Based on the source text fragments output by the large language model, string similarity matching is performed in the two-dimensional layout feature matrix to locate one or more text data blocks corresponding to the source text fragments and generate corresponding text bounding rectangles. Calculate the coordinates of the center point of the bounding rectangle of the text, and use them as the absolute pixel coordinates corresponding to the feature value.
[0008] Furthermore, calculating the physical straight-line distance between the plurality of leaf nodes includes: Extract the first absolute pixel coordinates corresponding to the first leaf node and the second absolute pixel coordinates corresponding to the second leaf node from the plurality of leaf nodes; Calculate the square of the difference between the abscissa values and the ordinate values between the first absolute pixel coordinates and the second absolute pixel coordinates. Sum the two sets of squared values and take the square root to obtain the planar straight-line distance. Obtain the page number difference between the first absolute pixel coordinate and the second absolute pixel coordinate, and multiply the absolute value of the page number difference by a preset cross-page penalty coefficient to obtain the cross-page penalty distance; The sum of the planar straight-line distance and the page-crossing penalty distance is taken as the physical straight-line distance.
[0009] Furthermore, the step of constructing a local spatial window in the document to be pre-reviewed, based on the absolute pixel coordinates of the leaf nodes that output a positive state in the same logical branch, and performing secondary feature extraction within the local spatial window using a large language model, includes: Extract the leaf nodes that output affirmative states in the same logical branch and use their absolute pixel coordinates as local spatial reference points; The local spatial window is generated by expanding outwards from the local spatial reference point according to a preset pixel radius. Filter out interfering text data located outside the local space window in the document to be pre-reviewed, and reorganize the text data located inside the local space window into a local text subset; The large language model is used to re-extract the feature values corresponding to the leaf nodes that trigger spatial span anomalies in the local text subset, and the joint tuples attached to the leaf nodes are updated.
[0010] Furthermore, after updating the union tuple mounted on the leaf node, the process also includes: Extract the new absolute pixel coordinates from the updated joint tuple; Recalculate the physical straight-line distance between the new absolute pixel coordinates and the local spatial reference point. If the recalculated physical straight-line distance is less than or equal to the preset spatial cohesion threshold, then retain the updated feature value for calculation. If the recalculated physical straight-line distance is still greater than the preset spatial cohesion threshold, the corresponding calculation branch will be set to a review blocking state, and the data of the corresponding leaf node will be written to the manual review queue.
[0011] Furthermore, the calculation process for the preset spatial cohesion threshold is as follows: Obtain the pixel width of the current page of the document to be pre-reviewed; The numerical range of one-third to one-half of the image pixel width is set as the preset spatial cohesion threshold.
[0012] Furthermore, the step of performing calculations from leaf nodes to non-leaf nodes according to the directed acyclic graph to output the pre-review result of the government approval rule text includes: Read the feature values from the joint tuples attached to the leaf nodes; The feature value is input to the non-leaf node of the next higher level, and the corresponding logical calculation is performed according to the logical operator contained in the non-leaf node, and the local logical state of the non-leaf node is output. The local logic state is passed up the topology of the directed acyclic graph for summarization and calculation until the root node of the directed acyclic graph outputs a positive or negative state, which is then used as the preliminary review result. When a necessary input node is in a review blocking state, preventing the root node from completing the operation, output a status pending manual review.
[0013] Furthermore, after outputting the pre-review result of the government approval rule text, the process also includes: Traverse the nodes in the directed acyclic graph whose output state is positive or negative, extract the logical operators of each non-leaf node, and the absolute pixel coordinates of each leaf node. The logical operator and the absolute pixel coordinates are concatenated according to the hierarchical structure of the directed acyclic graph to generate a pre-judgment backtracking path; On the display interface of the document to be pre-reviewed, the text area corresponding to the absolute pixel coordinates is highlighted and displayed according to the pre-review judgment backtracking path.
[0014] A second aspect of this invention provides an intelligent pre-approval system for government approvals based on a large model, comprising: The graph construction module is used to parse government approval rule text into a directed acyclic graph, wherein the non-leaf nodes of the directed acyclic graph contain logical operators, and the leaf nodes contain entity feature extraction tasks. The feature extraction module is used to receive the document to be pre-examined, perform entity feature extraction in the directed acyclic graph using a large language model, obtain the corresponding feature values, and retrieve the absolute pixel coordinates corresponding to the feature values in the two-dimensional layout space of the document to be pre-examined. The distance verification module is used to attach the feature value and the absolute pixel coordinate as a joint tuple to the corresponding leaf node, and based on the topology of the directed acyclic graph, obtain multiple leaf nodes that are logically constrained by the same non-leaf node, and calculate the physical straight-line distance between the multiple leaf nodes. The recall reasoning module is used to determine the triggering of spatial span abnormality when the physical straight-line distance is greater than the preset spatial cohesion threshold, and to construct a local spatial window in the document to be pre-reviewed based on the absolute pixel coordinates of the leaf nodes that output a positive state in the same logical branch, and to perform secondary feature extraction within the local spatial window using a large language model. The graph calculation output module is used to perform calculations from leaf nodes to non-leaf nodes according to the directed acyclic graph, and output the preliminary review results of the government approval rule text.
[0015] This invention provides an intelligent pre-approval method and system for government affairs approvals based on a large-scale model. It has the following beneficial effects: 1. This invention parses government approval rules into a directed acyclic graph and retrieves the absolute pixel coordinates corresponding to feature values in a two-dimensional layout space. Building upon natural language semantic processing, this invention introduces a physical location dimension for verification. This mechanism uses the physical straight-line distance between multiple feature values constrained by the same non-leaf node as the criterion, effectively identifying positioning deviations caused by page breaks or layout misalignments when large language models process long, unstructured documents, thereby improving the reliability of information processing.
[0016] 2. This invention reduces the interference of irrelevant text data on the model's inference process. When the physical linear distance between feature values exceeds a preset spatial cohesion threshold, the system constructs a local spatial window based on the absolute pixel coordinates of leaf nodes that have not triggered anomalies. By filtering text outside this window, the system limits the secondary feature extraction scope of the large language model to a local text subset. This technique physically eliminates the interference of densely similar clauses or redundant paragraphs in the document, improving the effectiveness of secondary feature extraction without changing the underlying network structure of the language model.
[0017] 3. This invention improves the traceability of the pre-screening system's output results. After outputting the final pre-screening result, the system extracts the logical operators of each non-leaf node in the directed acyclic graph and the absolute pixel coordinates of the corresponding leaf nodes, and concatenates them hierarchically to generate a pre-screening determination backtracking path. Based on this backtracking path, the system highlights the corresponding text areas on the display interface of the document to be pre-screened, transforming the internal reasoning process of the model into a visual evidence chain based on two-dimensional coordinates, facilitating accurate review of the automatic pre-screening results by business personnel. Attached Figure Description
[0018] Figure 1 This is a schematic diagram of the government approval pre-review system architecture based on large model and graph space collaboration according to the present invention; Figure 2 This is a schematic diagram of the pre-approval method for government affairs approval based on large model and graph space collaboration according to the present invention; Figure 3 This is a schematic diagram illustrating the logical verification process of constructing a directed acyclic graph and the data structure mapping principle of the present invention. Figure 4 This is a time-series diagram illustrating the document feature matrix parsing and joint feature extraction of the present invention; Figure 5 This is a schematic diagram of the physical coordinate static addressing and data mounting timing process of the present invention; Figure 6 This is a schematic diagram of the topological physical space cooperative distance verification process of the present invention; Figure 7 This is a schematic diagram of the post-order traversal and deterministic graph calculation process of the present invention; Figure 8 This is a schematic diagram of the local re-inference process under the spatial window constraint of the present invention; Figure 9 A bar chart comparing the performance of the three architectures in the experimental verification embodiment of the present invention in terms of pre-screening accuracy and hallucination incidence. Figure 10 This is a graph showing the relationship between the system performance changes under different spatial cohesion threshold parameters in the experimental verification embodiment of the present invention. Detailed Implementation
[0019] 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.
[0020] See attached document Figure 1 This invention provides a government approval pre-review system based on large model and graph space collaboration. The system may include a graph construction module, a feature extraction module, a distance verification module, a graph calculation module, a recall inference module, and a model interaction module.
[0021] The graph construction module is used to parse the approval rule text into structured rule data through the model interaction module, and compile it into a directed acyclic graph for logical verification.
[0022] The feature extraction module is used to parse the layout of two-dimensional unstructured scanned documents, call the model interaction module to obtain target field values and source text fragments, and generate source text bounding boxes through local string matching.
[0023] The distance verification module is used to extract the source text bounding boxes of related leaf nodes in the same logical condition branch, calculate the comprehensive spatial distance, and perform spatial cohesion verification according to the preset cohesion threshold.
[0024] The graph calculation module is used to perform post-order traversal and deterministic operations on the node branches that have passed the spatial distance check, and generate the initial judgment result.
[0025] The recall inference module is used to recall local text based on the source text bounding box of the valid reference node when the initial judgment result is negative. It calls the model interaction module to perform secondary field extraction, and after re-completing the source addressing and spatial distance verification, it re-executes graph calculation on the affected calculation path.
[0026] See attached document Figure 2 This invention provides a method for preliminary review of government approvals based on the collaboration of large models and graph spaces, comprising the following steps: S10, the approval rule text is parsed into structured rule data through the model interaction module and compiled into a directed acyclic graph for logical verification; the directed acyclic graph includes leaf nodes for performing field extraction tasks, as well as Boolean logic nodes and relationship comparison nodes for storing comparison benchmarks.
[0027] S20: Perform optical character recognition and layout analysis on the documents to be reviewed, generate a two-dimensional layout dataset, and call a large language model to obtain the target field values and source text fragments corresponding to each leaf node.
[0028] S30: Perform string similarity matching in the two-dimensional layout dataset based on the source text fragment, generate the source text bounding box, and write the field source tuple composed of the target field value and the source text bounding box into the corresponding leaf node.
[0029] S40: Determine the associated leaf nodes in the same logical condition branch based on the node relationships of the directed acyclic graph, and calculate the comprehensive spatial distance between their source text bounding boxes; if the distance exceeds the limit, block the corresponding branch and write it into the manual review queue; otherwise, allow the corresponding branch to enter the graph calculation.
[0030] S50 performs a post-order traversal on the calculation branches that have passed the spatial distance verification, sequentially completing the target field value formatting, relation comparison, and Boolean operation, and outputting the initial pre-screening results and calculation traceability records from the root node.
[0031] S60: When the initial pre-review result is negative, the key leaf nodes and valid reference nodes are determined based on the calculation traceability records. A local spatial window is generated based on the source text bounding box of the valid reference node, and the text within the window is reorganized into a local text subset. The large language model is called to perform secondary field extraction on the key leaf nodes, and the addressing and field source tuple update are completed again based on the retry source text fragments. If the spatial distance verification passes, the affected path is recalculated and the final pre-review result is output; otherwise, the corresponding branch is written to the manual review queue.
[0032] See attached document Figure 3 The graph construction module receives the approval rule text from external input, performs structured parsing of the approval rule text through the model interaction module, and constructs a directed acyclic graph for logical verification based on the parsing results.
[0033] S111, the map construction module has a pre-set rule-based structured parsing instruction template. The rule-based structured parsing instruction template includes system role setting parameters, task objective parameters, and output format constraint parameters.
[0034] The system role setting parameters include model role identifier and rule parsing boundaries. The model role identifier is used to configure the large language model as an approval rule structure parser; the rule parsing boundaries are used to constrain the large language model to only identify the explicitly stated approval conditions based on the input approval rule text, without supplementing fields, comparison benchmarks, or logical relationships not stated in the approval rule text.
[0035] The task objective parameters include field identification rules, logical relationship identification rules, and comparison relationship identification rules. Field identification rules are used to identify business information in the approval rule text that serves as the basis for approval judgment; logical relationship identification rules are used to identify conditional relationships such as "and", "or", and "not", and map them to the corresponding Boolean logic operators; comparison relationship identification rules are used to identify comparison expressions such as "greater than", "less than", "equal to", "not less than", or "not exceeding", and extract the corresponding comparison benchmark values.
[0036] The output format constraint parameters include preset JSON field names, required fields, field data types, operator enumeration values, and lower-level node reference formats. These parameters are used to constrain the large language model to output structured response data according to the preset JSON field pattern, and not to output rule explanation content outside of the structured response data.
[0037] Structured rule data includes at least a unique node identifier, node type, and hierarchical relationship. Leaf nodes also include a description of the field to be extracted, the expected data type, and the expected unit of measurement. The description of the field to be extracted represents the business information to be obtained from the pre-review document, such as the applicant's name, project investment amount, building area, certificate validity date, or approval status. The expected data type is selected from text, numeric, date, Boolean, and enumerated status types to limit the structural form of the target field value. The expected unit of measurement limits the measurement scale used for numeric fields, including RMB, square meters, percentage, day, month, or year. When the corresponding field does not have a unit of measurement, the expected unit of measurement is set to null.
[0038] Non-leaf nodes also include operator type and lower-level node identifier. Relationship comparison nodes also include comparison benchmark, benchmark data type, and benchmark unit of measurement. The benchmark data type and benchmark unit of measurement are set to be the same as the expected data type and expected unit of measurement of the corresponding leaf node, or can be converted to comparable data type and unit of measurement through preset formatting rules.
[0039] This embodiment employs an existing general-purpose large language model that has been pre-trained on text corpora and possesses instruction-following capabilities. The invoked large language model is at least capable of receiving Chinese natural language instructions and approval rule text, performing text field recognition and logical relationship recognition, and generating a text response conforming to a preset JSON field pattern according to the output format constraint parameters. The model interaction module sends rule-structured parsing instructions and receives text responses through the model call interface. The graph construction module performs JSON syntax validation and field integrity validation on the text responses according to subsequent steps. This embodiment does not involve any improvement to the network structure, model parameters, or training process of the large language model.
[0040] S112, the graph construction module fills the approval rule text into the text placeholder in the rule structured parsing instruction template, generates the rule structured parsing instruction, and sends the rule structured parsing instruction to the large language model through the model interaction module.
[0041] The model interaction module receives the structured response data returned by the large language model and sends the structured response data to the graph construction module.
[0042] S113, the graph construction module performs JSON syntax validation and field integrity checks on the structured response data. If the validation passes, the structured response data is converted into a JSON-formatted rule tree. The JSON-formatted rule tree represents the hierarchical and logical relationships between various approval conditions through the nesting of nodes or the identifiers of subordinate nodes.
[0043] If the structured response data does not conform to the preset JSON syntax, or lacks the fields necessary to build the validation graph, the graph construction module will mark the current rule parsing task as parsing abnormal and will not use the structured response data to build the logical validation directed acyclic graph.
[0044] S121, the graph construction module parses the JSON-formatted rule tree and instantiates validation graph node objects based on the node data in the JSON-formatted rule tree. Validation graph node objects include leaf node objects and non-leaf node objects.
[0045] S122, for leaf node objects, the graph construction module configures them as field-level information extraction tasks. Leaf node objects must include at least a node unique identifier field, a description field for the field to be extracted, a expected data type field, and an expected unit of measurement field.
[0046] The node unique identifier field is used to identify leaf nodes, the field description field to be extracted is used to record business fields, and the expected data type field and expected unit of measurement field are used to limit the data type and unit of measurement of the field value, respectively.
[0047] Leaf node objects are located at the input of data dependencies and do not have references to child nodes.
[0048] S123, for non-leaf node objects, the graph building module configures them as boolean logic nodes or relation comparison nodes according to the node type in the JSON format rule tree.
[0049] A non-leaf node object must include at least a unique node identifier, operator enumeration values, and a set of references to its child nodes; the operator enumeration values include Boolean AND, Boolean OR, Boolean NOT, greater than, less than, or equal to.
[0050] The relationship comparison node also includes the comparison benchmark value, the benchmark value data type, and the benchmark unit of measurement.
[0051] When the validation graph data is loaded as a runtime instance, the system establishes runtime object references between the current non-leaf node and its direct subordinate nodes based on the unique identifiers of the nodes recorded in the subordinate node reference set. The graph calculation module can then read the field values or calculation results of the subordinate nodes based on these runtime object references.
[0052] S131, the graph construction module instantiates leaf node objects and non-leaf node objects based on the hierarchical relationship represented by the JSON format rule tree, and establishes directed edges based on the data dependencies between nodes to generate a directed acyclic graph for logical verification: ; in, This represents a directed acyclic graph for logical verification. Represents a set of nodes. This represents the set of directed edges.
[0053] Node set satisfy: ; in, This represents the set of all leaf nodes. The above formula represents the set of all non-leaf nodes; From the set of leaf nodes non-leaf node set They are jointly constituted, and there are no overlapping nodes between them.
[0054] In this embodiment, the data dependency relationship refers to the following: when a higher-level node performs a corresponding operation, it needs to read the target field value or calculation result output by another lower-level node. Therefore, the higher-level node is data-dependent on the lower-level node. The data dependency relationship has clearly defined data source and data receiving nodes, and determines the order of calculation for the corresponding nodes. That is, only after the lower-level node completes field extraction or logical operations can the higher-level node use its output data to perform subsequent operations.
[0055] For example, when a relation comparison node needs to compare the project investment amount output by a leaf node with a preset comparison benchmark value, the relation comparison node constitutes a data dependency on that leaf node; when a Boolean logic node needs to read the Boolean values output by multiple relation comparison nodes to perform a Boolean AND operation, the Boolean logic node constitutes a data dependency on the multiple relation comparison nodes.
[0056] Directed edge set Each directed edge in the graph points from a lower-level node to its direct parent node, representing the data dependency relationship where the field value or calculation result of the lower-level node is passed to the parent node. The references to lower-level nodes stored in non-leaf nodes are used to locate their lower-level nodes from the parent node, corresponding to the data transmission direction represented by the directed edges.
[0057] S132, the graph construction module performs directed cycle detection on the generated logical verification directed acyclic graph to verify that there are no circular dependencies between nodes.
[0058] Specifically, the graph construction module traverses the node set using a depth-first search approach. and the set of directed edges During the traversal, the nodes that have been visited and the nodes in the current search path are recorded respectively. When a directed edge points to a node in the current search path that has not yet been exited, the logic checks whether a directed acyclic graph contains a directed cycle.
[0059] If a directed cycle is detected, the graph construction module marks the verification graph corresponding to the current approval rule as structurally abnormal and stops generating a read-only verification graph template for that approval rule to avoid loop traversal in subsequent graph calculations. If no directed cycle is detected, the module proceeds to the topology sequence generation step.
[0060] S133, after confirming that the directed acyclic graph does not contain directed cycles, the graph construction module generates a topological sequence based on the data dependencies between nodes. The topological sequence arranges lower-level nodes before higher-level nodes that depend on its computation results, so that subsequent graph computation modules can perform computations according to the order of data dependencies.
[0061] The graph construction module serializes the node's unique identifier, node type, node attributes, lower-level node identifiers, and directed edge dependencies, and writes the serialized verification graph data into the storage area.
[0062] S134, the graph construction module sets the verification graph data obtained through directed cycle detection as a read-only verification graph template. The node types, operator attributes, comparison benchmarks, node connectivity, and topology in the read-only verification graph template remain unchanged during runtime.
[0063] For each unstructured 2D scanned document to be processed, the system creates a corresponding verification graph runtime instance based on the read-only verification graph template. The verification graph runtime instance uses the node types, operator attributes, comparison benchmarks, and topology of the read-only verification graph template, and sets independent runtime data for the current 2D unstructured scanned document.
[0064] The runtime data includes at least the target field value of the leaf node, the source text bounding box, the node's runtime status, and the node's calculation result. The target field value and the source text bounding box are written into the reserved data field of the leaf node; the node's runtime status and calculation result are updated according to the subsequent spatial distance check and graph calculation process.
[0065] Subsequent field data mounting, spatial distance verification, and graph calculation are all performed on the verification graph running instance without modifying the node types, operator attributes, and topology in the read-only verification graph template. This allows different two-dimensional unstructured scanned documents to complete the pre-approval calculations according to the same approval rule structure.
[0066] See attached document Figure 4 The feature extraction module receives the two-dimensional unstructured scanned document to be processed, obtains the text content and page position in the document through optical character recognition and layout analysis, and runs the field-level information extraction task in the current verification graph instance, calling the large language model to extract the target field value and the corresponding source text fragment.
[0067] S211, the feature extraction module acquires the two-dimensional unstructured scanned document to be processed. The two-dimensional unstructured scanned document can be an image format file or a portable document format file consisting of one or more pages.
[0068] For portable document format files, the feature extraction module converts each page into a three-channel RGB page image at a preset resolution in page order. The preset resolution is used to unify the pixel coordinate scale of each page in the current document and keeps it unchanged during the processing of the same document.
[0069] The feature extraction module uses existing optical character recognition and layout analysis processing to identify text regions in the page image, convert their content into corresponding text strings, and obtain the bounding boxes of each text region in the current page's two-dimensional pixel coordinate system.
[0070] After the above processing, each text region has a corresponding page number, bounding box coordinates, and text string, providing a data foundation for subsequently establishing the mapping relationship between text content and document page position.
[0071] S212, the feature extraction module generates a two-dimensional layout dataset corresponding to the current two-dimensional unstructured scanned document based on the results of layout analysis and optical character recognition. .
[0072] Two-dimensional layout dataset representation is Any text data block is represented as: ; in, Page number, and The coordinates of the top left corner of the bounding box. and For the width and height of the bounding box, It is a text string.
[0073] The current page uses a two-dimensional pixel coordinate system with the top-left corner of the page image as the origin. The horizontal coordinate increases to the right along the page width, and the vertical coordinate increases downwards along the page height. , , and All units are pixels.
[0074] S221, in generating a two-dimensional layout dataset Then, the feature extraction module traverses all leaf nodes in the verification graph running instance corresponding to the current two-dimensional unstructured scanned document.
[0075] For any leaf node, the feature extraction module reads the description of the field to be extracted, the expected data type, and the expected unit of measurement recorded in that leaf node, and then sequentially assembles the two-dimensional layout dataset according to the page number and the reading order determined by the layout analysis. Text strings of each text data block This generates the text input context for the current document. When the concatenated text exceeds the maximum input length of the invoked large language model, the text input context is generated in segments according to the page order, and field extraction is performed on each segment.
[0076] The feature extraction module writes the description of the field to be extracted, the expected data type, the expected unit of measurement, and the text input context into a preset field extraction instruction template, and generates a field extraction instruction corresponding to the current leaf node.
[0077] S222, the field extraction instruction template includes output format constraints, which require the large language model to output the target field values and source text fragments in a structured form.
[0078] For the first instance of the verification chart execution Each leaf node's structured extraction result must include at least the target field value. and source text fragments .in, Indicates the index of the current leaf node; This represents the field value extracted by the large language model from the text input context, corresponding to the description of the field to be extracted; This indicates that the large language model extracts the target field value. The original text fragment on which it was based.
[0079] Source text fragment Derived from the text input context, it is used for subsequent text matching and page coordinate positioning.
[0080] S223, the feature extraction module sends field extraction instructions to the large language model through the model interaction module. The large language model performs field information extraction based on the description of the field to be extracted, the expected data type, the expected unit of measurement, and the text input context, and returns a value containing the target field. and source text fragments Structured response data.
[0081] This embodiment does not require the large language model to output page pixel coordinates, but instead requires the large language model to output source text fragments. Then, the corresponding page location is determined by local string similarity matching.
[0082] S231, the model interaction module receives the structured response data returned by the large language model and sends the structured response data to the feature extraction module.
[0083] The feature extraction module checks whether the structured response data contains parsable target field values and source text fragments, and whether the target field values match the expected data type and expected unit of measurement of the leaf nodes.
[0084] After the response format validation passes, the feature extraction module will extract the target field value. and source text fragments The data is temporarily stored in the running data corresponding to the current leaf node and then proceeds to the subsequent source text matching and location steps.
[0085] S232 In the event of failure of the large language model call, call timeout, return of empty response, failure to extract valid field information from the text input context, or failure of structured response data to pass response format validation, the feature extraction module performs abnormal response processing.
[0086] Exception handling includes: setting the target field value of the current leaf node. Setting it to an empty value will trace the source text fragment. Set the text to empty and set the running status of the current leaf node to an extraction exception state.
[0087] Leaf nodes in an extraction anomaly state will not proceed to the subsequent source text matching and graph calculation process. The system records the unique identifier of the current leaf node, the description of the field to be extracted, and the original response data returned by the large language model for re-extraction or manual review.
[0088] See attached document Figure 5 After obtaining the target field value and source text fragment returned by the large language model, the feature extraction module performs local string similarity matching between the source text fragment and the text string in the aforementioned two-dimensional layout dataset to determine the position of the corresponding text in the original document page and generate the source text bounding box.
[0089] After associating the target field value with the source text bounding box, the feature extraction module writes it into the running data of the corresponding leaf node in the verification graph running instance.
[0090] S311, for structured response data that passes response format validation and whose source text fragment is not empty, the feature extraction module extracts the first... The source text fragments corresponding to each leaf node And read the aforementioned two-dimensional format dataset. .
[0091] The feature extraction module reads the two-dimensional dataset sequentially. Chinese text data blocks Corresponding text string And the text strings of a single text data block are used as candidate text sequences.
[0092] For adjacent text data blocks located on the same page and arranged consecutively according to the aforementioned page reading order, the feature extraction module concatenates the corresponding text strings sequentially according to the page reading order, and uses the concatenated text strings as candidate text sequences.
[0093] The text strings of a single text data block and the concatenated text strings of adjacent text data blocks together constitute the candidate text sequence set. The feature extraction module traces the source text fragments. To match the target, the text similarity between it and each candidate text sequence is calculated.
[0094] S312. Considering that similar-looking characters may be misidentified, characters may be missed, or punctuation marks may be misidentified during optical character recognition, this embodiment uses normalized edit distance to calculate the text similarity between the source text fragment and the candidate text sequence.
[0095] Let the first candidate text sequence be in the set of candidate text sequences. The candidate text sequences are Then trace the source text fragment With candidate text sequences The text similarity between them is expressed as: ; in, This indicates a text fragment for tracing the source. With candidate text sequences Text similarity between them; Indicates the index of the current leaf node; Indicates the sequence number of the candidate text sequence.
[0096] This indicates a text fragment for tracing the source. With candidate text sequences Edit distance between and These represent the number of valid characters for each.
[0097] S313, the feature extraction module compares the text similarity of each candidate text sequence with a preset text similarity threshold. Compare them.
[0098] Preset text similarity threshold The threshold is selected between 0.85 and 0.95. Specifically, historical matching samples of similar approval items and similar document formats are obtained, and the target text data blocks in each historical matching sample are manually labeled. Multiple candidate thresholds within the range of 0.85 to 0.95 are used to perform text matching. The proportion of samples whose automatic matching results match the manually labeled results for each candidate threshold is calculated, and the candidate threshold with the highest proportion of matching samples is determined as the preset text similarity threshold. When multiple candidate thresholds have the same proportion of matching samples, the candidate threshold with the larger value is selected. If there are insufficient historical matching samples, 0.90 is set as the initial preset text similarity threshold and updated based on subsequent manual review results.
[0099] The feature extraction module iterates through all candidate text sequences. If the text similarity of one or more candidate text sequences is greater than or equal to a preset text similarity threshold... If the corresponding candidate text sequence is selected, then the corresponding candidate text sequence will be determined as the hit candidate text sequence.
[0100] The feature extraction module sorts the candidate text sequences in descending order of text similarity and determines the candidate text sequence with the highest text similarity as the target matching result.
[0101] When multiple candidate text sequences have the same highest text similarity, the feature extraction module first sorts them by page number from smallest to largest, and then selects the candidate text sequence ranked first as the target matching result according to the page reading order.
[0102] The target text data block is determined by identifying one or more text data blocks corresponding to the target matching result.
[0103] If the text similarity of all candidate text sequences is lower than the preset text similarity threshold... If so, it is determined that the current source text fragment failed to appear in the two-dimensional format dataset. To obtain a valid match result.
[0104] If no valid match is found, the feature extraction module sets the source text bounding box of the current leaf node to an invalid bounding box. The page number, x-coordinate of the center point, y-coordinate of the center point, width, and height of the invalid bounding box are all set to null values, and the running status of the current leaf node is set to the review blocked state.
[0105] The feature extraction module will extract the node's unique identifier, the description of the field to be extracted, and the target field value from the current leaf node. Source text fragment The current document identifier is written to the manual review queue. Leaf nodes in a review blocked state do not enter the subsequent spatial distance checksum graph calculation process.
[0106] After the human reviewer confirms or corrects the target field value and its corresponding page position, the system updates the target field value and traceability text bounding box of the current leaf node according to the review result, and releases the review blocking status of the leaf node.
[0107] S321, The feature extraction module generates the first [function] based on the target matching result. The bounding boxes of the source text corresponding to each leaf node .
[0108] When the target matching result corresponds to a single target text data block When this happens, the page number, center point coordinates, pixel width, and pixel height of the text data block are determined as the corresponding parameters of the source text bounding box.
[0109] When the target matching result corresponds to multiple adjacent text data blocks, the multiple text data blocks are located on the same page. The feature extraction module determines the smallest bounding rectangle that can contain the bounding boxes of all target text data blocks, and determines the page number, center point coordinates, pixel width, and pixel height of the smallest bounding rectangle as the corresponding parameters of the source text bounding box.
[0110] The source text bounding box is represented as: ; in, Indicates the first The source text bounding boxes corresponding to each leaf node; The page number that indicates the page containing the source text bounding box; and These represent the x and y coordinates of the center point of the bounding box of the source text, respectively. and These represent the pixel width and pixel height of the source text bounding box, respectively.
[0111] A single text data block corresponds to its original bounding box, and multiple adjacent text data blocks correspond to the smallest bounding rectangle that can enclose all target text data blocks.
[0112] The field tracing tuple includes the target field value. and source text bounding box This is used to record the business field value corresponding to the current leaf node and its page position in the original document. (Source text fragment) The textual basis for the target field value is stored in the running data corresponding to the current leaf node for result traceability or manual review.
[0113] S331, the feature extraction module determines the corresponding leaf node object in the verification graph running instance based on the node unique identifier of the current leaf node, and writes the field traceability tuple into the running data field of the leaf node.
[0114] After the field tracing tuple is written, a relationship is established between the target field value, the tracing text bounding box, and the corresponding leaf node. The subsequent distance verification module and graph calculation module then read the corresponding field tracing tuple based on the unique node identifier of the leaf node.
[0115] Writing the field traceability tuple only updates the running instance of the verification graph corresponding to the current two-dimensional unstructured scan document, without modifying the node type, operator attributes, comparison benchmark value, node connection relationship and topology in the read-only verification graph template.
[0116] See attached document Figure 6Before the graph calculation begins, the distance verification module performs spatial distance verification on the source text bounding boxes of the corresponding target field values based on the association between the leaf nodes in the verification graph.
[0117] The distance verification module determines whether the corresponding field meets the preset spatial proximity condition by comparing the spatial distance of the text corresponding to the associated leaf node in the document page.
[0118] S411, the distance verification module traverses the verification graph running instance corresponding to the current two-dimensional unstructured scanned document, and determines the associated leaf nodes in the same logical condition branch based on the set of references of the lower-level nodes of the non-leaf nodes.
[0119] Associating leaf nodes includes the following two cases: First, leaf nodes that share a common direct parent node; Secondly, they are connected to the corresponding relation comparison nodes respectively, and the relation comparison nodes are all connected to the leaf nodes of the same Boolean logic node.
[0120] The distance verification module determines multiple leaf nodes that satisfy any of the above association relationships as a set of leaf nodes associated with the same branch.
[0121] If all leaf nodes in the set of leaf nodes associated with the same branch have been written into the field tracing tuple, then proceed to the tracing text bounding box validity check. The field tracing tuple includes the target field value and the corresponding tracing text bounding box.
[0122] S412, the distance verification module reads the source text bounding boxes from each leaf node in the set of leaf nodes associated with the same branch, and extracts the page number, x-coordinate of the center point and y-coordinate of the center point of each source text bounding box.
[0123] If any leaf node has not written a traceable tuple, or its traceable text bounding box is the aforementioned invalid bounding box, the distance verification module will no longer perform spatial distance calculation on the current set of leaf nodes associated with the same branch, and will set the running status of the corresponding leaf node to the verification blocking state.
[0124] If any leaf node is already in a blocked state, the computation branch containing the set of leaf nodes associated with the current branch will remain blocked and will not proceed to the subsequent graph computation process.
[0125] S413, when there is only one leaf node to be verified in a certain logical condition branch, since there is no associated leaf node that can be compared with the leaf node in terms of spatial distance, the distance verification module skips the spatial distance calculation of the leaf node.
[0126] If the leaf node has been written with a complete field trace tuple, the trace text bounding box is valid and it is not in a review blocking state, then the leaf node is allowed to enter the subsequent graph calculation process.
[0127] If the leaf node does not contain a complete field trace tuple, the trace text bounding box is invalid, or it is already in a review blocking state, then the data corresponding to the leaf node is written to the manual review queue.
[0128] S421, For a set of leaf nodes associated with the same branch that contains two or more leaf nodes, the distance verification module calculates the comprehensive spatial distance between each leaf node.
[0129] For any two leaf nodes in the set and The distance verification module reads the page number and center point coordinates of the source text bounding box, and calculates the comprehensive spatial distance according to the following formula: ; in, Represents leaf nodes leaf nodes The overall spatial distance between them, in pixels.
[0130] in, For page span, , , and Here are the coordinates of the center points of the two bounding boxes. This is the cross-page penalty coefficient, and its unit is pixels.
[0131] Cross-page penalty coefficient The pixel dimensions are determined based on the page pixel size of the document currently awaiting pre-review. Let the pixel width and pixel height of the p-th page in the current document be respectively... and Then the diagonal pixel length of the page is... Represented as: ; Select the largest page diagonal pixel length from all pages in the current document. The cross-page penalty coefficient is determined according to the following formula: ; in, This indicates the preset page magnification factor, and In this embodiment, A value between 1.1 and 2.5 can be selected. Therefore, the penalty distance added for any page crossover is greater than the maximum straight-line distance that can be formed within a single page of the current document.
[0132] When the physical size of the page remains constant while the page resolution changes, the page pixel width... and page pixel height As the resolution changes year-on-year, the diagonal pixel length of the page changes. and cross-page penalty coefficient The corresponding year-on-year changes. Therefore, there is no need to set fixed cross-page penalty pixel values for different page resolutions.
[0133] S422, When the set of leaf nodes associated with the same branch includes two leaf nodes, calculate the comprehensive spatial distance between the two leaf nodes. The distance of the branch space of the current set.
[0134] When the set of leaf nodes associated with the same branch includes three or more leaf nodes, the distance verification module calculates the comprehensive spatial distance between all different leaf node pairs in the set and determines the maximum value as the branch spatial distance of the current set.
[0135] S431, Preset spatial distance threshold The threshold is set to one-third to one-half of the page pixel width. Specifically, historical samples of similar approval items and similar document formats are obtained, and the fields in each historical sample are manually annotated to determine whether they belong to the same logical condition branch. Multiple candidate ratio coefficients are set within the specified numerical range, and the product of each candidate ratio coefficient and the page pixel width is used as the candidate spatial distance threshold. The number of misjudgments for each candidate spatial distance threshold based on the manually annotated results is counted. The product of the candidate ratio coefficient with the fewest misjudgments and the current page pixel width is determined as the preset spatial distance threshold. When historical samples are insufficient, 0.4 times the page pixel width is used as the initial preset spatial distance threshold.
[0136] S432, The distance verification module compares the branch spatial distance of the current set of leaf nodes associated with the same branch with the preset spatial distance threshold. Compare them.
[0137] If the branch space distance is less than or equal to the preset space distance threshold If the set of leaf nodes associated with the same branch satisfies the preset spatial proximity condition, the graph calculation module is allowed to read the target field value of each leaf node and perform subsequent relation comparisons and Boolean logic operations.
[0138] After the spatial distance verification is passed, the graph calculation module further determines whether the target field value meets the approval rules.
[0139] S433, if the branch space distance is greater than the preset space distance threshold If so, it is determined that the set of leaf nodes associated with the current branch is in a state of spatial distance exceeding the limit.
[0140] Spatial distance exceeding the limit means that the spatial distance between the text corresponding to the relevant target field values exceeds the preset spatial distance threshold determined in step S431, and the association between the current fields cannot be confirmed based solely on the existing extraction results.
[0141] S434, when the set of leaf nodes associated with the same branch is in a spatial distance exceeding the limit, the distance verification module sets the current calculation branch to a branch calculation blocking state and stops the calculation branch from passing field values or calculation results to its parent node.
[0142] The distance verification module writes the identifiers of the relevant leaf nodes, the target field values, the source text fragments, and the source text bounding boxes into the manual review queue. After the manual review results update the field source tuple, the spatial distance verification is re-executed; if the verification passes, the block is lifted; otherwise, the review remains blocked.
[0143] See attached document Figure 7 After the spatial distance verification is passed, the graph calculation module reads the verification graph running instance corresponding to the current two-dimensional unstructured scanned document, and performs relationship comparison and Boolean logic operations according to the data dependency relationship between each node in the verification graph.
[0144] The graph calculation module reads the target field value from the leaf node, calculates the relation comparison node and Boolean logic node in sequence, until the calculation result of the root node is obtained.
[0145] S511, the graph calculation module reads the running instance of the verification graph corresponding to the current two-dimensional unstructured scanned document, which is created based on the read-only verification graph template.
[0146] The graph computation module uses a post-order traversal approach to process the verification graph execution instances. Specifically, starting from the root node, the module sequentially visits the direct subordinate nodes of non-leaf nodes based on their set of references; after all direct subordinate nodes of the current non-leaf node have completed their computations, the module then executes the operation corresponding to the current non-leaf node.
[0147] The target field value or calculation result of the lower-level node is passed to the direct parent node along the directed edge.
[0148] The graph computation module records the computation status of each node during traversal. For nodes that have already been computed, subsequent visits to the same node directly read the saved computation results, avoiding re-execution of the same operation. For subordinate nodes referenced by multiple parent nodes, the computation results are provided to the respective parent nodes.
[0149] S512, for any non-leaf node, the graph calculation module will only execute the operation corresponding to the non-leaf node after all its direct subordinate nodes have generated valid target field values or calculation results.
[0150] If any direct subordinate node is in a review blocking state, or the corresponding calculation branch is in a branch calculation blocking state, the graph calculation module will not execute the calculation of the current non-leaf node, and will keep the current non-leaf node in a pending calculation state, while marking the running status of the current document as pending manual review.
[0151] Once the data at the corresponding leaf node has been manually reviewed and updated, or once the corresponding branch has passed the spatial distance check again, the graph calculation module continues to perform post-order traversal calculations starting from the affected node.
[0152] Through the above processing, nodes that do not receive valid input data will not participate in relation comparisons or Boolean logic operations.
[0153] S521, when the postorder traversal reaches a leaf node, the graph computation module reads the field tracing tuple in the running data of that leaf node and obtains the target field value from the field tracing tuple.
[0154] The graph computation module first checks whether the field traceability tuple is complete and whether the current leaf node is in a review blocking state. If the field traceability tuple is incomplete or the current leaf node is in a review blocking state, the target field value will not be formatted, and the corresponding computation branch will be prevented from continuing to compute upwards.
[0155] For valid target field values, the graph calculation module performs normalization processing based on the expected data type and unit of measurement: numeric fields extract the value and unit and unify them into a baseline unit of measurement; date fields are converted into comparable date values; and text or status fields undergo character normalization.
[0156] If formatting fails, set the leaf node and its computation branch to a review blocked state, and record the original field values and the reason for failure.
[0157] If the formatting process is successful, the graph calculation module will pass the formatted target field value to the direct parent node corresponding to that leaf node.
[0158] S522, when the post-order traversal reaches the relation comparison node, the graph calculation module reads the formatted target field value passed by its direct subordinate leaf node, and reads the preset comparison benchmark value, benchmark data type, benchmark unit of measurement and operator enumeration value in the relation comparison node.
[0159] The calculation process for relation comparison nodes is represented as follows: ; in, Indicates the Boolean value output by the relation comparison node; This indicates the formatted target field value passed from the direct subordinate leaf node; This indicates the preset comparison benchmark value in the current relationship comparison node.
[0160] Represents relation comparison operations determined by the operator enumeration values of the current relation comparison node, including operations such as greater than, less than, or equal to.
[0161] Before performing relational comparisons, and They have the same or directly comparable data types; for numerical values with units of measurement, they use the same units of measurement.
[0162] like If the relationship is valid, then Take the truth value; if the relation does not hold, then... Take a false value.
[0163] The relation comparison node passes its output Boolean value to the direct parent Boolean logic node; when the relation comparison node itself is the root node of the verification graph, the Boolean value is used as the calculation result of the root node.
[0164] S523, when the postorder traversal reaches a Boolean logic node, the graph computation module reads the Boolean values passed by each of its direct subordinate nodes and performs Boolean operations based on the operator enumeration values of that Boolean logic node.
[0165] The calculation process for a Boolean logic node is represented as follows: ; in, This represents the Boolean value output by the current Boolean logic node; These represent the current Boolean logic nodes. Boolean values passed by each direct subordinate node; This indicates the number of valid inputs to the current Boolean logic node.
[0166] Represents the Boolean operation determined by the operator enumeration value of the current Boolean logic node, including Boolean AND, Boolean OR, or Boolean NOT operations.
[0167] Both relation comparison nodes and Boolean logic nodes perform calculations based on preset operator enumeration values, without calling the large language model again during the above calculation process.
[0168] Boolean logic nodes pass their output Boolean values to their direct parent nodes; when the Boolean logic node is the root node of the verification graph, the Boolean value is used as the calculation result of the root node.
[0169] S531, the graph calculation module calculates and passes the node results layer by layer upwards according to the data dependencies between nodes in the verification graph, until the calculation of the root node is completed.
[0170] The boolean value output by the root node serves as the initial pre-review result of the approval rule corresponding to the current two-dimensional unstructured scanned document.
[0171] When the root node outputs a true value, it means that the target field values that have been extracted and validated in the current document meet the approval rules represented by the validation graph; when the root node outputs a false value, it means that at least one relational comparison condition or Boolean logic condition involved in the current calculation path has not been satisfied.
[0172] The initial pre-review result is only used to indicate the current rule pre-review status of the document in this system, and does not directly constitute a formal approval or rejection decision made by the administrative approval authority.
[0173] S532, during the execution of relation comparison nodes and Boolean logic nodes, the graph calculation module generates calculation traceability records.
[0174] For each non-leaf node that has completed the computation, the computation traceability record includes at least the node's unique identifier, the identifier of its direct subordinate node, the operator type, the input value, the output value, and the computation time.
[0175] For nodes that have not completed calculations due to target field value format conversion failure, node review blocking, or branch calculation blocking, the calculation traceability record also includes the corresponding node running status and the reason for not completing the calculation.
[0176] The calculation traceability record is stored in association with the initial pre-examination results according to the data dependencies between nodes. It is used to query the calculation path of the root node result after the target field value is compared and Boolean logic operation. The corresponding traceability text bounding box is read according to the leaf node identifier in the calculation path, and the corresponding text area is highlighted in the document display interface.
[0177] S533, the graph calculation module associates and stores the initial pre-screening results output by the root node with the corresponding calculation traceability records.
[0178] If the initial pre-review result is true, the pre-review status of the current document will be set to pre-review passed, and the corresponding calculation traceability record will be output.
[0179] If the initial pre-review result is false, the pre-review status of the current document is set to "initial pre-review failed", and the relationship comparison node for outputting false values and its corresponding leaf node are determined based on the calculation traceability record.
[0180] The graph calculation module sends the initial pre-approval failure status, relevant node identifiers, and corresponding calculation backtracking paths to the recall reasoning module to trigger subsequent local text recall and secondary field extraction for relevant target fields.
[0181] If the root node has not completed the calculation due to a necessary input node or calculation branch being blocked in the review process, the current document's pre-review status will be set to pending manual review, and the blocked node identifier and the reason for the blockage will be output.
[0182] See attached document Figure 8 When the initial pre-screening result output by the graph calculation module is a false value, the recall reasoning module determines the leaf node related to the negative result based on the calculation tracing record, and uses the source text bounding box of the leaf node associated with the same branch as the location reference to extract local text in the two-dimensional layout dataset.
[0183] The recall inference module re-extracts the target field values and source text fragments based on local text, and recalculates the affected verification graph path after completing the source text location and spatial distance verification.
[0184] S611, the recall reasoning module receives the initial pre-approval failure status, relevant node identifiers and calculation backtracking path sent by the graph calculation module, and reads the calculation backtracking record associated with the initial pre-approval result.
[0185] The recall inference module starts from the root node of the output false value and traces back the calculation path of the output false value according to the data dependency relationship in the verification graph.
[0186] For a Boolean AND node that outputs a false value, backtrack along the child nodes of the false value; for a Boolean OR node that outputs a false value, backtrack along all child nodes of the false value; for a Boolean NOT node, backtrack along its direct child nodes.
[0187] After tracing back to the relation comparison node that outputs a false value, the recall inference module identifies the leaf node that provides the target field value to that relation comparison node and designates it as the negative result association leaf node. The negative result association leaf node will be referred to as the key leaf node below.
[0188] The recall inference module reconfirms the target field values of key leaf nodes through local secondary extraction.
[0189] When the computation backtracking path includes multiple critical leaf nodes, the recall inference module processes each critical leaf node one by one according to the computation backtracking path. Each processing only updates the current critical leaf node and its corresponding affected computation path; unaffected nodes retain their existing running data and computation results.
[0190] S612, For the current critical leaf node, the recall inference module searches for other related leaf nodes in the same logical condition branch as it in the verification graph running instance.
[0191] Other related leaf nodes include: leaf nodes that share a common direct parent node with the current critical leaf node; and leaf nodes that are respectively connected to the corresponding relation comparison nodes, and the relation comparison nodes are all connected to the same Boolean logic node.
[0192] The associated leaf nodes that have a true relation comparison result, a valid target field value, a valid source text bounding box, and are not in a review blocking state are identified as valid reference nodes.
[0193] If there are one or more valid peer reference nodes, then read the source text bounding box of each valid peer reference node.
[0194] If there is no valid reference node at the same level, but the current key leaf node has generated a valid source text bounding box during the initial field extraction process, then the initial source text bounding box of the current key leaf node will be used as the backup reference bounding box.
[0195] If no valid reference node exists at the same level, and the initial bounding box of the current critical leaf node is an invalid bounding box, then the page location of the local text cannot be determined based on the existing runtime data. The recall inference module stops performing local secondary extraction on the critical leaf node, sets the critical leaf node to a review blocked state, and writes the corresponding data to the manual review queue.
[0196] S621, the recall inference module determines the source text bounding box or the backup reference bounding box of the same level valid reference node as the reference bounding box, and generates a local recall window based on the page where the reference bounding box is located and its center point coordinates.
[0197] When there are multiple valid reference nodes at the same level, the recall inference module uses the source text bounding box of each valid reference node as the reference bounding box and generates a corresponding local recall window for each reference bounding box.
[0198] Each local recall window is located within the page containing the corresponding reference bounding box, and extends by a preset window extension distance along the horizontal and vertical axes, centered on the center point of the reference bounding box, to form a rectangular page area.
[0199] S622, let the x-coordinate and y-coordinate of the center point of the reference bounding box be respectively... and The boundary coordinates of the local recall window are then represented as: ; ; ; ; in, and These represent the x and y coordinates of the top left corner of the local recall window, respectively. and These represent the x and y coordinates of the lower right corner of the local recall window, respectively.
[0200] and These represent the x and y coordinates of the center point of the reference bounding box, respectively. Indicates the preset window expansion distance; and These represent the pixel width and pixel height of the page image containing the reference bounding box, respectively. All coordinates and lengths are in pixels.
[0201] symbol" " indicates taking the larger of the two parameters, the symbol " "" indicates taking the smaller of the two parameters. Through the above maximum and minimum value calculations, the local recall window is limited to the coordinate range of the corresponding page image.
[0202] Window expansion distance The window expansion ratio is set to one-quarter to one-third of the page pixel width. Specifically, manually confirmed reference bounding boxes and their associated target field bounding boxes are obtained from similar approval items and similar format documents. The minimum window expansion distance required to fully cover each associated target field bounding box is calculated, and the minimum window expansion distance is divided by the corresponding page pixel width to obtain the window expansion ratio for each historical sample. The window expansion ratios are arranged in ascending order of value, and the window expansion ratio that can cover 95% of the historical samples is selected and limited to a value range of one-quarter to one-third as the window expansion ratio coefficient. The product of the window expansion ratio coefficient and the current page pixel width is determined as the window expansion distance. When historical samples are insufficient, 0.3 times the page pixel width is used as the initial window expansion distance.
[0203] S631, the recall inference module traverses the two-dimensional layout dataset. The text data block in the local recall window is determined based on the page where the text data block is located and its bounding box coordinates.
[0204] For any local recall window, only text data blocks located on the same page as that local recall window are traversed. If the bounding box of a text data block overlaps with the local recall window, then that text data block is identified as the recall text data block.
[0205] When multiple local recall windows are generated based on multiple reference bounding boxes, the recall inference module merges the recall text data blocks corresponding to each local recall window and determines the text data blocks based on the two-dimensional layout dataset. The serial number in Delete duplicate text data blocks.
[0206] S632, the recall inference module sorts the recall text data blocks according to the page number and page reading order.
[0207] For recall text data blocks within the same page, they are first sorted from smallest to largest according to the y-coordinate of the top-left corner of the text data block's bounding box. If the difference in the y-coordinate of two adjacent text data blocks is less than or equal to a preset line height tolerance threshold, the two text data blocks are determined to be on the same text line, and then further sorted from smallest to largest according to their x-coordinate.
[0208] The preset line height tolerance threshold is set to 0.3 to 0.5 times the average height of the text data block on the current page. When there are insufficient historical samples, 0.4 times is used as the initial value.
[0209] The recall inference module reads the text strings of each recall text data block sequentially according to the sorting results. And concatenate the text strings into a local text subset.
[0210] When the recalled text data blocks are distributed across multiple pages, they are first arranged in ascending order of page number, then arranged according to the page reading order within each page, and page separators are retained between text strings on different pages.
[0211] S641, the recall inference module reads the description of the field to be extracted, the expected data type, and the expected unit of measurement of the current key leaf node, and performs equivalent rewriting on the description of the field to be extracted in the initial field extraction instruction.
[0212] Equivalence rewriting only changes the textual expression of the description of the field to be extracted, without changing the business object, expected data type, expected unit of measurement, and structured output format to which the field to be extracted points.
[0213] The recall reasoning module uses at least two equivalent descriptions that do not change the business meaning of the fields, and combines them with the expected data type, expected unit of measurement, structured output format and local text subset respectively to generate local secondary extraction instructions.
[0214] S642, the recall inference module sends the local secondary extraction instruction to the large language model through the model interaction module.
[0215] The large language model performs two rounds of field extraction. When the normalized target field values from at least two extractions are consistent, the set of results that enables local addressing and has the highest text matching similarity is recorded as the retry target field value. and retry source text fragment If the results are inconsistent, the critical leaf node is set to a review blocking state and written to the manual review queue.
[0216] in, This represents the target field value that is re-extracted from a local text subset by a large language model. This indicates that the target field value for retry is extracted from the large language model. The original text fragment on which it was based.
[0217] The local secondary extraction command only includes the text within the local spatial window.
[0218] S643, The model interaction module receives the retry target field value. and retry source text fragment And send it to the feature extraction module.
[0219] The feature extraction module first checks whether the retry target field value field and the retry source text fragment field are complete according to the aforementioned response format verification method, and checks whether the data type of the retry target field value matches the expected data type of the current key leaf node.
[0220] If the secondary field extraction result fails the response format validation, the current critical leaf node will be set to the review blocking state, and the initial field extraction result, the secondary field extraction result, and the corresponding document information will be written to the manual review queue.
[0221] If the secondary field extraction result passes the response format validation, the feature extraction module will process the retry source text fragments according to the local string similarity matching, source text bounding box generation, and field data mounting methods in S311 to S331. Perform page position matching.
[0222] After obtaining a valid match, the feature extraction module generates a retry source text bounding box. and utilize the target field value for retry. and retry tracing text bounding box Update the field trace tuple of the current critical leaf node.
[0223] in, Indicates the first The key leaf nodes are based on the retry traceback text fragments. The redefined bounding box of the source text.
[0224] If you retry the source text fragment Unable to find in 2D layout dataset If a valid match is obtained, the current critical leaf node is set to the review blocking state, and the corresponding data is written to the manual review queue.
[0225] After the field traceability tuple is updated, the distance verification module re-executes the bounding box validity check and spatial distance verification on the set of related leaf nodes in the same branch where the current key leaf node is located, according to the spatial distance verification methods from S411 to S434.
[0226] If the re-execution of the spatial distance verification fails, the current calculation branch is set to a branch calculation blocked state, and the calculation branch is written to the manual review queue.
[0227] If the re-execution of the spatial distance verification passes, the graph calculation module reads the updated retry target field value. The data type is converted and the unit of measurement is unified according to the target field value formatting method of S521, and the relationship comparison node directly associated with the current key leaf node is re-executed.
[0228] The graph computation module starts from the relation comparison node and, according to the data dependencies of the verification graph, re-performs computations on the nodes between the relation comparison node and the root node that were affected by the update of the field tracing tuple. Unaffected nodes continue to use the already saved computation results.
[0229] If the recalculated root node outputs a true value, then the final pre-approval status of the current document is set to pre-approval passed, and the secondary field extraction results, the re-executed spatial distance verification results, and the updated calculation traceability records are associated and stored.
[0230] If the recalculated root node still outputs a false value, the final pre-approval status of the current document will be set to pre-approval failure, and the target field that does not meet the relation comparison conditions, the corresponding comparison benchmark value, and the calculation backtracking path will be output.
[0231] To illustrate the system and method of this invention, the following explanation uses "enterprise qualification review" as an example.
[0232] Assume the approval rule is: "The company's paid-in capital is greater than or equal to 5 million yuan, and the date of the most recent capital verification report is earlier than January 1, 2025."
[0233] The graph construction module calls the large language model to parse the rule into a directed acyclic graph for logical verification. The root node is a Boolean AND node, and its subordinate nodes include "greater than or equal to" relation comparison nodes and "earlier than" relation comparison nodes, with comparison benchmarks of 5 million yuan and January 1, 2025, respectively. The two relation comparison nodes are connected to the leaf nodes of "paid-in capital" and "verification date", respectively.
[0234] The system receives scanned PDF versions of the capital verification report and parses them into two-dimensional data with a width of 1200 pixels and a height of 1600 pixels. The large language model outputs the target field value "6 million yuan" and the source text fragment "As of this reporting period, the cumulative paid-in registered capital is 6 million yuan" for the "Paid-in Capital" leaf node; and the target field value "March 5, 2025" and the corresponding source text fragment for the "Verification Date" leaf node.
[0235] The feature extraction module performs string similarity matching on the two-dimensional layout data based on the source text fragments, generates source text bounding boxes, and combines the target field value with the source text bounding boxes to form a field source tuple, which is then written to the corresponding leaf node.
[0236] In the case of exceeding the spatial distance limit, assuming the center point coordinates of the bounding boxes corresponding to "Paid-in Capital" and "Verification Date" are (350, 820) and (1050, 1500) respectively, the straight-line distance between them is approximately 976 pixels. The preset spatial distance threshold is half the page width, i.e., 600 pixels. Since 976 pixels is greater than 600 pixels, the distance verification module sets the corresponding calculation branch to a review blocked state and writes it to the manual review queue. This branch will not be included in subsequent graph calculations.
[0237] To illustrate the scenario where an initial negative result triggers local re-inference, assume the center point of the initial source text bounding box for "Verification Date" is (560, 900). The distance between this center point and the center point of the bounding box for "Paid-in Capital" is approximately 225 pixels, less than 600 pixels, thus passing the spatial distance check. The graph calculation module performs a post-order traversal: the comparison result for the relationship "Paid-in Capital is greater than or equal to 5 million yuan" is true, and the comparison result for the relationship "Verification Date is earlier than January 1, 2025" is false. The root node outputs the initial pre-approval status as "Failed".
[0238] The recall inference module determines the "verification date" as the key leaf node based on the calculation and tracing records, and selects the "paid-in capital" leaf node with a true comparison result and a valid bounding box as the valid reference node. Centered on coordinates (350, 820), a local spatial window with the upper left corner at (50, 520) and the lower right corner at (650, 1120) is generated with a window expansion distance of 300 pixels.
[0239] The recall inference module extracts the text within the window and reorganizes it into a local text subset according to the page reading order. A secondary field extraction is performed using the equivalent rewritten field extraction command to obtain the retry target field value "December 20, 2024" and the corresponding retry source text fragment. Through local string similarity matching, the center point of the retry source text bounding box is (380, 850), and its distance from the valid reference node is approximately 42 pixels, less than 600 pixels.
[0240] After the distance verification passes, the system updates the field traceability tuple of the "Verification Date" leaf node and recalculates the affected path from the corresponding relation comparison node to the root node. If both the relation comparison results for "Paid-in capital greater than or equal to 5 million yuan" and "Verification date earlier than January 1, 2025" are true, the root node outputs a pre-approval status and generates the corresponding calculation backtracking path.
[0241] To verify the technical effectiveness of this invention, a test set was constructed using 5,000 scanned historical government approval documents, covering scenarios such as business registration, engineering approval, and environmental qualification issuance. The experiment was set up in three groups: Control group A uses a pure large language model architecture, directly outputting the judgment result based on the full text and approval rules; control group B uses an architecture combining a large language model and a logical rule tree, but does not perform spatial distance verification and local recall; experimental group C uses the logical verification directed acyclic graph, two-dimensional layout data, spatial distance verification and local re-inference mechanism of this invention.
[0242] See attached document Figure 9 The context error rate of control group A was 18.4%, and the pre-screening accuracy rate was 72.5%; the pre-screening accuracy rate of control group B was 84.2%; and the context error rate of experimental group C was 1.5%, with a pre-screening accuracy rate of 96.8%. The experimental results show that spatial distance verification can intercept field combinations with abnormal source locations, and local spatial windows can reduce the interference of irrelevant text on secondary field extraction.
[0243] See attached document Figure 10A comparative test was conducted on the spatial distance threshold. When the threshold was less than 200 pixels, some related fields that were reasonably distributed across different rows or table areas were judged to have exceeded the spatial distance limit; when the threshold was greater than 1000 pixels, the spatial constraint effect weakened, and irrelevant text interference increased. Under the conditions of this test set and page resolution, setting the spatial distance threshold to one-third to one-half of the page pixel width can achieve a better balance between the abnormal interception rate and the false positive rate.
[0244] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A government affair examination and approval intelligent pre-examination method based on a large model, characterized in that, include: The government approval rules text is parsed into a directed acyclic graph, wherein the non-leaf nodes of the directed acyclic graph contain logical operators, and the leaf nodes contain entity feature extraction tasks. Receive the document to be pre-reviewed, use the large language model to perform the entity feature extraction task in the directed acyclic graph, obtain the corresponding feature value, and retrieve the absolute pixel coordinates corresponding to the feature value in the two-dimensional layout space of the document to be pre-reviewed; The feature value and the absolute pixel coordinate are attached as a joint tuple to the corresponding leaf node. Based on the topology of the directed acyclic graph, multiple leaf nodes that are logically constrained by the same non-leaf node are obtained, and the physical straight-line distance between the multiple leaf nodes is calculated. If the physical straight-line distance is greater than the preset spatial cohesion threshold, it is determined that a spatial span abnormality has been triggered, the corresponding calculation branch is set to a blocked state and written into the manual review queue; if the physical straight-line distance is less than or equal to the spatial cohesion threshold, the operation is performed from the leaf node to the non-leaf node according to the directed acyclic graph to obtain the initial pre-review result. When the initial pre-review result is negative, a local spatial window is constructed in the document to be pre-reviewed, based on the absolute pixel coordinates of the leaf node that outputs a positive state in the same logical branch. A secondary feature extraction is performed within the local spatial window using a large language model. Based on the secondary feature extraction result, the spatial distance verification and the corresponding calculation path are re-executed, and the final pre-review result is output.
2. The government affair examination and approval intelligent pre-examination method based on a large model according to claim 1, characterized in that, The process of parsing government approval rule text into a directed acyclic graph includes: Identify conditional related words and feature entity words in the government approval rule text; Map the conditional conjunctions to the non-leaf nodes, and convert the comparison values and Boolean logic contained in the conditional conjunctions into the logical operators; The feature entity words are mapped to the leaf nodes, and directed connections are established between the non-leaf nodes and the leaf nodes.
3. The government affair examination and approval intelligent pre-examination method based on a large model according to claim 1, characterized in that, The step of retrieving the absolute pixel coordinates corresponding to the feature value in the two-dimensional layout space of the document to be pre-reviewed includes: Optical character recognition and layout analysis are performed on the documents to be pre-reviewed to generate a two-dimensional layout feature matrix; Based on the source text fragments output by the large language model, string similarity matching is performed in the two-dimensional layout feature matrix to locate one or more text data blocks corresponding to the source text fragments and generate corresponding text bounding rectangles. Calculate the coordinates of the center point of the bounding rectangle of the text, and use them as the absolute pixel coordinates corresponding to the feature value.
4. The government affair examination and approval intelligent pre-examination method based on a large model according to claim 3, characterized in that, The calculation of the physical straight-line distance between the plurality of leaf nodes includes: Extract the first absolute pixel coordinates corresponding to the first leaf node and the second absolute pixel coordinates corresponding to the second leaf node from the plurality of leaf nodes; Calculate the square of the difference between the abscissa values and the ordinate values between the first absolute pixel coordinates and the second absolute pixel coordinates, sum the two sets of square values and perform a square root operation to obtain the planar straight-line distance; Obtain the page number difference between the first absolute pixel coordinate and the second absolute pixel coordinate, and multiply the absolute value of the page number difference by a preset cross-page penalty coefficient to obtain the cross-page penalty distance; The sum of the planar straight-line distance and the page-crossing penalty distance is taken as the physical straight-line distance.
5. The government affair examination and approval intelligent pre-examination method based on a large model according to claim 1, characterized in that, The step involves constructing a local spatial window in the document to be pre-reviewed, based on the absolute pixel coordinates of the leaf nodes that output a positive state in the same logical branch, and performing secondary feature extraction within the local spatial window using a large language model, including: Extract the leaf nodes that output positive states in the same logical branch and use their absolute pixel coordinates as local spatial reference points; The local spatial window is generated by expanding outwards from the local spatial reference point according to a preset pixel radius. Filter out interfering text data located outside the local space window in the document to be pre-reviewed, and reorganize the text data located inside the local space window into a local text subset; The large language model is used to re-extract the feature values corresponding to the leaf nodes that trigger spatial span anomalies in the local text subset, and the joint tuples attached to the leaf nodes are updated.
6. The government affair examination and approval intelligent pre-examination method based on a large model according to claim 5, characterized in that, After updating the union tuple mounted on the leaf node, the process also includes: Extract the new absolute pixel coordinates from the updated joint tuple; Recalculate the physical straight-line distance between the new absolute pixel coordinates and the local spatial reference point. If the recalculated physical straight-line distance is less than or equal to the preset spatial cohesion threshold, then retain the updated feature value for calculation. If the recalculated physical straight-line distance is still greater than the preset spatial cohesion threshold, the corresponding calculation branch will be set to a review blocking state, and the data of the corresponding leaf node will be written to the manual review queue.
7. The government affair examination and approval intelligent pre-examination method based on a large model according to claim 1, wherein, The calculation process for the preset spatial cohesion threshold is as follows: Obtain the pixel width of the current page of the document to be pre-reviewed; The numerical range of one-third to one-half of the image pixel width is set as the preset spatial cohesion threshold.
8. The government affair examination and approval intelligent pre-examination method based on a large model according to claim 1, wherein, The step of performing calculations from leaf nodes to non-leaf nodes according to the directed acyclic graph, and outputting the preliminary review result of the government approval rule text, includes: Read the feature values from the joint tuples attached to the leaf nodes; The feature value is input to the non-leaf node of the next higher level, and the corresponding logical calculation is performed according to the logical operator contained in the non-leaf node, and the local logical state of the non-leaf node is output. The local logic state is passed up the topology of the directed acyclic graph for summarization and calculation until the root node of the directed acyclic graph outputs a positive or negative state, which is then used as the preliminary review result. When a necessary input node is in a review blocking state, preventing the root node from completing the operation, output a status pending manual review.
9. The government affair examination and approval intelligent pre-examination method based on a large model according to claim 8, characterized in that, After outputting the pre-review results of the government approval rule text, the method further includes: Traverse the nodes in the directed acyclic graph whose output state is positive or negative, extract the logical operators of each non-leaf node, and the absolute pixel coordinates of each leaf node. The logical operator and the absolute pixel coordinates are concatenated according to the hierarchical structure of the directed acyclic graph to generate a pre-judgment backtracking path; On the display interface of the document to be pre-reviewed, the text area corresponding to the absolute pixel coordinates is highlighted and displayed according to the pre-review judgment backtracking path.
10. A government affair examination and approval intelligent pre-examination system based on a large model, according to the government affair examination and approval intelligent pre-examination method based on a large model in any one of claims 1-9, characterized in that, include: The graph construction module is used to parse government approval rule text into a directed acyclic graph, wherein the non-leaf nodes of the directed acyclic graph contain logical operators, and the leaf nodes contain entity feature extraction tasks. The feature extraction module is used to receive the document to be pre-examined, perform entity feature extraction in the directed acyclic graph using a large language model, obtain the corresponding feature values, and retrieve the absolute pixel coordinates corresponding to the feature values in the two-dimensional layout space of the document to be pre-examined. The distance verification module is used to attach the feature value and the absolute pixel coordinate as a joint tuple to the corresponding leaf node, and based on the topology of the directed acyclic graph, obtain multiple leaf nodes that are logically constrained by the same non-leaf node, and calculate the physical straight-line distance between the multiple leaf nodes. The recall reasoning module is used to determine the triggering of spatial span abnormality when the physical straight-line distance is greater than the preset spatial cohesion threshold, and to construct a local spatial window in the document to be pre-examined based on the absolute pixel coordinates of the leaf nodes that output a positive state in the same logical branch, and to perform secondary feature extraction in the local spatial window using a large language model. The graph calculation output module is used to perform calculations from leaf nodes to non-leaf nodes according to the directed acyclic graph, and output the preliminary review results of the government approval rule text.
