Intelligent cataloging method and device for legal document pages

By calculating the comprehensive score of the candidate title set of legal document pages and the pseudo-title rules, and combining precise matching and semantic matching, the problem of misidentification of pseudo-titles in cross-institutional and low-quality scanning scenarios is solved, thereby improving the accuracy and consistency of electronic case file catalogs.

CN123159332APending Publication Date: 2026-11-24贵州中汇科技发展有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611663736.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-27
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing technologies cannot accurately determine whether a legal document page has a valid main title in cross-institutional, cross-template, and low-quality scanning scenarios, leading to false titles being misidentified as document names and affecting the accuracy and consistency of electronic case file catalogs.

Method used

By acquiring images of legal document pages and standard directory mapping rules, a candidate set of titles is identified and a comprehensive score is calculated. The valid main title of the document is determined by combining pseudo-title rules, non-document type components are stripped off, and a structured cataloging result is generated and a review mark is attached by using a mapping method of precise matching and semantic matching.

Benefits of technology

It improves the accuracy and consistency of electronic case file catalogs, reduces the probability of pseudo-titles being misidentified, ensures that the output standard document names conform to the standard catalog, and facilitates manual review and rule optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123159332A_ABST
    Figure CN123159332A_ABST
Patent Text Reader

Abstract

This invention provides an intelligent cataloging method and apparatus for legal document pages, relating to the field of document image processing technology. The method includes: acquiring an image of the legal document page and standard directory mapping rules; identifying a candidate title set and calculating a comprehensive score; if the comprehensive score is greater than a title validity threshold and does not match any pseudo-title rules, it is determined to be a valid document main title; otherwise, a "no title" state is output; the valid document main title is stripped of place names, unit names, and personal names to obtain the document type name; precise matching and wildcard matching are performed first, and if no match is found, semantic matching is performed within the candidate name set to obtain the standard document name; related parties and the closing date are extracted, and the structured cataloging results are summarized and a review identifier is generated. This invention improves the ability to reject "no title" pages and the controllability of directory mapping.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of document image processing technology, and in particular to an intelligent cataloging method and apparatus for legal document pages. Background Technology

[0002] With the advancement of information technology in judicial operations, paper case files are scanned to form electronic case files. The images of legal documents within these electronic case files need to be cataloged by document type to create a material catalog for review, retrieval, archiving, and subsequent intelligent case-handling assistance. The accuracy and consistency of the catalog directly impact the efficiency of case file utilization.

[0003] The conventional approach to cataloging electronic case files involves performing text recognition on page images, analyzing the layout based on text position and style, determining document titles using predefined rules or natural language processing methods, and then classifying them according to a standard catalog. Alternatively, a common approach is to use a general layout analysis model to divide the page into areas such as titles, body text, and tables, and then identify each area separately.

[0004] Mainstream existing technologies use text recognition results and the title area in the page layout as entry points, extracting the title text page by page, determining the catalog name according to predefined rules and language processing algorithms, and processing multiple pages of images in a loop. This approach assumes that each page has an extractable title and directly uses the text in the title area as the basis for the catalog name.

[0005] The aforementioned existing technology has the following technical problems: It lacks a mechanism to determine whether a page contains a valid document title. Many middle pages, last pages, and table of contents pages in case files do not contain document titles, while chapter titles, table of contents items, headers and footers, case numbers, and institutional headings appear on the page as centered or large short lines of text, just like titles. When extracting title text page by page in isolation, these pseudo-titles are easily mistaken for document names, leading to untitled pages being forcibly given titles. Furthermore, the thresholds for accepting or rejecting titles are mostly adjusted based on experience, and the proportion of incorrectly accepted titles lacks a basis, making it difficult to maintain stability across institutions and templates. Summary of the Invention

[0006] The technical problem this invention aims to solve is: how to accurately determine whether a legal document page has a valid main title in electronic case file scenarios involving cross-institutional, cross-template, low-quality scanning, and seal obscuring.

[0007] To address the aforementioned technical problems, this invention provides an intelligent cataloging method for legal document pages, comprising:

[0008] The process involves: acquiring legal document page images and standard directory mapping rules; identifying a candidate title set for the legal document page images; calculating a comprehensive score for the candidate title set based on its position, visual salience score, and the relationship to the beginning of the main text; determining the candidate title set as a valid document main title if the comprehensive score is greater than the title validity threshold and does not match any pseudo-title rules; otherwise, outputting a "no title" state and determining the title validity determination result; stripping place names, unit names, and personal names from the valid document main title to obtain the document type name; performing exact matching and wildcard matching on the document type name according to the standard directory mapping rules; semantic matching within the candidate name set expanded by the standard directory mapping rules if no match is found to obtain the standard document name; identifying the main text sequence of the legal document page images, extracting related parties, and extracting the date of signature from the legal document page images; summarizing the standard document name, related parties, and date of signature to obtain a structured cataloging result; and generating a review identifier based on the title validity determination result.

[0009] This invention also provides an intelligent cataloging device for legal document pages, comprising: an acquisition module for acquiring images of legal document pages and standard directory mapping rules; an identification module for identifying a set of candidate titles for the legal document page images, and calculating a comprehensive score for the candidate titles based on their position, visual salience score, and text start relationship; a judgment module for determining that the candidate titles are valid document main titles when the comprehensive score of the candidate titles is greater than a title validity threshold and no pseudo-title rule is hit; otherwise, outputting a no-title state and determining the title validity judgment result; and a stripping module for stripping the valid document main titles. The system extracts place names, organization names, and personal names to obtain document type names. A matching module performs precise and wildcard matching on the document type names according to the standard directory mapping rules. If no match is found, semantic matching is performed within the candidate name set expanded by the standard directory mapping rules to obtain a standard document name. An extraction module identifies the main text sequence of the legal document page image, extracts related parties, and extracts the date of signature from the legal document page image. A generation module summarizes the standard document name, related parties, and date of signature to obtain structured cataloging results and generates a review identifier based on the title validity determination result.

[0010] By employing a judgment method that combines comprehensive scoring of the title candidate set with pseudo-title rules, and treating the untitled state as a valid output state, the problem of pseudo-titles being misidentified as document main titles and untitled pages being forcibly assigned titles is resolved. This reduces the probability of chapter titles, table of contents items, headers and footers, case numbers, and institutional headings being mistakenly accepted. Since the title validity threshold can be calibrated based on the null hypothesis scoring set, the probability of untitled pages being misjudged as valid document main titles has an interpretable upper bound, and the judgment of each page in a multi-page file can maintain overall consistency by leveraging document transfer probability and page number distribution. The mapping method, which first removes non-document type components, then prioritizes rules, and finally performs candidate-restricted semantic matching, solves the problems of redundant title components and unstable directory mapping, ensuring that the output standard document names always belong to the standard directory. Mapping failures and semantic conflicts are recorded in the review flag, facilitating manual review and allowing the review conclusions to be fed back to the rule base, thus improving the consistency and retrieval usability of the electronic file directory. Attached Figure Description

[0011] Figure 1 A flowchart illustrating the intelligent cataloging method for legal document pages provided in this embodiment of the invention;

[0012] Figure 2 A schematic diagram illustrating the calculation process of the comprehensive score for the title candidate set provided in an embodiment of the present invention;

[0013] Figure 3 A schematic diagram illustrating the calculation process of pseudo-title risk score provided in an embodiment of the present invention;

[0014] Figure 4 A schematic diagram illustrating the process of obtaining standard document names as provided in embodiments of the present invention;

[0015] Figure 5 A schematic diagram illustrating the process of calculating semantic similarity and determining semantic matching results provided in an embodiment of the present invention;

[0016] Figure 6 A schematic diagram of the module structure of the intelligent cataloging device for legal document pages provided in an embodiment of the present invention. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described below with reference to the accompanying drawings and embodiments. It should be understood that the embodiments described herein are for illustrative purposes only and are not intended to limit the invention.

[0018] Before describing the various embodiments, the following explanations are given for some of the technical terms involved in this invention.

[0019] Legal document page images refer to single-page images of paper legal documents in electronic case files obtained by scanning or photographing them. These images can come from single-page input or from a sequence of images arranged in page order in a multi-page case file.

[0020] The title candidate set refers to the collection of text blocks on the same page image that are identified as having the appearance of a title. Each member of the set is called a title candidate. Page position score, visual salience score, structural score, title word form score, and pseudo-title risk score are calculated for each title candidate individually. The overall score of the title candidate set is the maximum value among the overall scores of all title candidates in the set, denoted as . The corresponding title candidates are used as representative candidates for the set; determining that the title candidate set is a valid document main title means determining that the representative candidate is a valid document main title. When the set is empty, Record it as 0.

[0021] Visual salience refers to the degree to which a title candidate is visually distinguished from ordinary body text on a page. It is reflected by the degree of centering, font size, font weight, and spacing from the text block below. The visual salience score is a value between 0 and 1 obtained by normalizing the above visual factors.

[0022] The text start relationship refers to the position and layout relationship of whether the text block immediately following the title candidate begins a paragraph of text, such as whether it begins with a paragraph with an indented first paragraph.

[0023] A pseudo-title is a text block on a page that resembles a title but is not the main title of the legal document to which the page belongs. This includes chapter titles, table of contents items, headers and footers, case numbers, and organization headings. Pseudo-title rules are a set of matching rules used to identify the above pseudo-titles. Title candidates that match any of the rules are excluded and cannot be used as valid document main titles.

[0024] A valid document title refers to the title located on the first page of a legal document that indicates the document type. An "untitled" state refers to a legal cataloging state where there is no valid document title on the page. This state applies to middle pages, last pages, table of contents pages, and pages containing only pseudo-titles; in this state, the system does not guess the title.

[0025] The document type name refers to the name that represents the document type after removing non-document type components such as place names, unit names, and personal names from the main title of a valid document.

[0026] Standard directory mapping rules refer to the set of standard directory rules pre-configured by the business system. Each rule contains a standard document name, a list of possible document names corresponding to the standard document name, and wildcard rules. The standard document name is the standard name in the archive directory, and the possible document names are the aliases, abbreviations, and historical spellings of the same document.

[0027] Exact matching refers to matching a document type name that, after removing whitespace and unifying full-width and half-width characters, is exactly the same as the standard document name. Wildcard matching refers to matching a document type name against a name pattern containing wildcards. The wildcard "*" represents any string of any length, used to accommodate aliases, abbreviations, and different spellings of the same document across institutional templates. Semantic matching refers to matching based on the semantic similarity of the text rather than whether the characters are identical. The candidate name set is the set of names formed by expanding the possible document names corresponding to each standard document name in the standard directory mapping rules. Each candidate name belongs to a unique standard document name.

[0028] Related parties refer to parties or related persons who are involved in the case as recorded in legal documents, including related persons, applicants, clients, etc.

[0029] Structured cataloging results refer to cataloging output organized in key-value format, containing fields such as original title, standard document name, related parties, date of signature, file name, main text content, and review identifier, which can be displayed in the catalog, retrieved, and directly parsed by downstream programs.

[0030] The review indicator is a record indicating whether the cataloging results on the page require manual review and the reason for such review. The value is either "to be reviewed" or "no review required".

[0031] First-page emission score, in a segmentation model for multi-page dossiers, refers to the logarithmic score given by the evidence of a page itself when it serves as the first page of a document named with a standard document title. Continuation page emission score, on the other hand, refers to the logarithmic score given by the evidence of a page itself when it serves as a continuation page of a previous document. Both are observational scores for single pages within the segmentation model.

[0032] The null hypothesis score set refers to the set of comprehensive scores of the title candidate sets obtained from pages with a true value of "no title" in the calibration page set. It is used to provide an upper bound on the probability of a valid decision being falsely accepted. A template cluster refers to a group of pages with similar layouts clustered according to the layout fingerprint of the top area of ​​the page. The layout fingerprint is a vector obtained by feature extraction from the thumbnail of the top area of ​​the page.

[0033] Difficult page samples refer to page samples marked as pending review; fixed regression sets refer to a pre-saved set of page samples with established cataloging conclusions, used to test whether rule updates introduce new misjudgments.

[0034] Example 1

[0035] like Figure 1 As shown, this embodiment of the invention provides an intelligent cataloging method for legal document pages, including:

[0036] S1. Obtain legal document page images and standard directory mapping rules;

[0037] The legal document page image can be a single-page image or a page from a multi-page case file arranged in page order. During acquisition, the filename, page number, case number, and a marker indicating whether it is the first page are read simultaneously. For multi-page case files, a page task queue is generated page by page. The standard directory mapping rules are loaded in the form of a configuration table. Each rule contains a standard document name, a list of possible document names, and wildcard rules. The loading method adopts a conventional configuration reading method in the art, and this invention does not limit this.

[0038] It should be noted that input data can be organized in key-value pairs, including a list of page image files, filenames, page numbers, case numbers, a flag indicating whether it is the first page, and a standard directory mapping rule consisting of a standard document name and a list of possible document names. In one example, an input contains a page image file "page_001.png", page number 1, case number "Example Case Number", a flag indicating whether it is the first page (yes), and a standard directory mapping rule containing the standard document name "Interrogation Record" and its possible document names "Interrogation Record" and "Record (Interrogation)". For case files containing multiple pages of images, the page task queue dispatches pages one by one in page number order. Each page task executes S2 to S7 independently, but shares the same standard directory mapping rule, ensuring that the mapping scope of each page remains consistent.

[0039] S2. Identify the title candidate set of the legal document page image, and calculate the comprehensive score of the title candidate set based on the position, visual salience score and the relationship with the beginning of the text;

[0040] Specifically, a multimodal document understanding model or an equivalent layout detection component is used to perform layout analysis on the legal document page image. Text blocks with title-like appearances in the top area of ​​the page are output as title candidates, forming the title candidate set. The coordinates, font size, and text content of each text block are preserved. Subsequently, page position score, visual salience score, structural score, title word form score, and pseudo-title risk score are calculated for each title candidate. These scores are then weighted to synthesize a comprehensive score for each title candidate, and the maximum value is taken as the comprehensive score for the title candidate set. The specific calculation process is detailed in Examples 2 and 3. The reason for not judging the title solely based on the text content is that chapter titles, table of contents items, etc., are presented as short sentences, just like the document title, and their roles on the page cannot be distinguished by text alone. Position, visual prominence, and the relationship to the beginning of the main text describe the role of the text block on the page. Combined with the pseudo-title risk score, the question of whether the main title of the document exists on the page can be quantitatively determined, rather than assuming that every page must have a title.

[0041] Furthermore, the generation of the title candidate set can be broken down into three steps. First, text recognition obtains the text, coordinates, font size, and recognition confidence of each text block. Then, the multimodal document understanding model takes the page image and the aforementioned text block information as input and outputs the probability that each text block has the appearance of a title. Text blocks with a probability of not less than 0.5 and located within the first 35% of the page from top to bottom are included in the title candidate set. Finally, adjacent text lines with the same font size are merged into the same title candidate based on line spacing to avoid splitting a single title into two candidates due to line breaks. The multimodal document understanding model can be trained on historical dossier pages that have been manually cataloged in the collaborative business system. The training samples are labeled with whether each text block has the appearance of a title. The loss function uses binary classification cross-entropy, and the convergence condition is that the classification accuracy on the validation set no longer improves. Since the title candidate set only undertakes the task of "finding text blocks that may be titles," its effectiveness is determined by subsequent scores and pseudo-title rules. Therefore, this step should be biased towards high recall, as the real titles that are missed cannot be recovered in subsequent steps.

[0042] S3. When the comprehensive score of the title candidate set is greater than the title validity threshold and does not hit the pseudo-title rule, the title candidate set is determined to be a valid document main title; otherwise, the state of no title is output, and the title validity determination result is determined.

[0043] Let the title validity threshold be... , The value of can be determined by adjusting the validation set, or it can be obtained according to the calibration method described in Example 7. When Greater than If a candidate does not match the pseudo-title rule, it is determined to be the valid document main title; otherwise, a "no title" state is output. The "no title" state is a valid cataloging result; in this case, subsequent title stripping and table of contents mapping are no longer performed, and the system does not guess the title for this page, thus preventing middle pages, end pages, and table of contents pages from being forcibly assigned document names. The title validity determination result includes two values: valid document main title and "no title" state, and proceeds to subsequent steps along with the page. When each score is normalized to between 0 and 1, The commonly used value range is 0.5 to 0.8. If the value is too small, the false title may be mistakenly accepted; if the value is too large, the real title may be missed.

[0044] For example, a middle page of a case file has only a header "Case File No. 7," a page number "Page 7," and a line "II. Fact Determination" at the top, with the main text continuing from the previous page. The candidate title set contains these three text blocks. While "II. Fact Determination" is centered and slightly larger, its chapter title matching score is 1. The header and page number appear repeatedly in the same position on adjacent pages, resulting in a header / footer matching score of 1. All three are not less than the pseudo-title exclusion threshold, thus matching the pseudo-title rule and being excluded, resulting in an output of "No Title," and the system does not perform semantic guessing. As a contrast, a homepage has a separate line of "Interrogation Record" at the top, with a comprehensive score of 0.87, which is... greater than Furthermore, since the pseudo-title rule was not met, it was determined to be a valid document title.

[0045] S4. Extract the place name, organization name, and personal name from the main title of the valid document to obtain the document type name;

[0046] Specifically, named entity recognition is performed on the main title of the valid documents to identify place names, organization names, and personal names. The identified segments are then deleted, retaining only the portion at the end that reflects the document type as the document type name. For example, if the page title text consists of a place name, an organization name, and a document type name in sequence, only the document type name is retained after stripping. This ensures that subsequent directory mappings use standardized document type names, avoiding mapping failures or title distortion caused by redundant components. In other implementations, dictionary matching combined with sequence labeling models can also be used to identify the aforementioned non-document type components.

[0047] In this embodiment of the invention, title ontology normalization refers to the process of separating the core name reflecting the document type, i.e., the document type name, from the original text of the main title of the valid document, and removing components such as place names, unit names, and personal names that vary depending on the institution, case, and personnel. The document type name is a normalized name that is unrelated to a specific institution or case and is a direct input to the standard directory mapping. This process, while inheriting the general named entity recognition technology, limits the use of the recognition result to "stripping away non-document type components" rather than extracting the entity itself.

[0048] The underlying principle is that for the same legal document, the document type portion remains stable across different institutions, regions, and cases, while the place name, organization name, and personal name vary depending on the issuing institution and parties involved, with virtually unlimited variation. If the original title containing these components is directly fed into the directory mapping, exact and wildcard matching require configuring rules for every prefix combination, and the semantic similarity is diluted by redundant components, leading to unstable mapping results for the same document. After this separation, the value space of the mapping input shrinks from "the product of prefix combination and document type" to "document type," becoming comparable in size to the standard directory, thus making the mapping controllable.

[0049] Specifically, the process involves three steps. First, the main title of a valid document is segmented by character and fed into a named entity recognition component to obtain three types of fragments: place name, unit name, and personal name, along with their positions. Then, dictionary correction is applied, such as using a document type suffix dictionary to protect the document type portion at the end, preventing misidentification of the document type term as part of the unit name. Finally, the identified fragments are deleted, and redundant whitespace and connectors are removed; the remaining part is the document type name. The named entity recognition component can employ a sequence labeling model, with training data taken from historical titles manually confirmed in the collaborative business system, labeling the three types of entities and the document type portion. Alternatively, it can combine a place name dictionary, a unit name dictionary, and rules, activating when labeled data is lacking. The original main title of the valid document is also retained for use in the original document name field in S7, and for backfilling in case of mapping failure.

[0050] S5. According to the standard directory mapping rules, the document type name is first matched precisely and then matched wildcard. If no match is found, semantic matching is performed within the candidate name set expanded by the standard directory mapping rules to obtain the standard document name.

[0051] Specifically, this step employs a rule-first, semantic-backup hierarchical mapping approach, detailed in Examples 4 and 5. The standard directory mapping rules are a finite and predetermined set of rules. First, exact matching and wildcard matching are used to process the vast majority of titles it can cover; this part of the result is deterministic and reproducible. Only titles not matched by the deterministic rules enter semantic matching, and the output of semantic matching is limited to the candidate name set. Because the output space of semantic matching is a finite set of candidates rather than freely generated text, the output names necessarily belong to the standard directory, avoiding the problem of outputting names outside the standard directory when relying solely on the semantic model. Since the deterministic rules come first, semantic matching only processes a few difficult titles, also avoiding the problem of insufficient coverage of aliases and abbreviations when relying solely on rules.

[0052] It is worth noting that the mapping process can uniformly characterize the confidence relationship of the three types of matching using mapping scores: a mapping score of 1 for exact matching, 0.9 for wildcard matching, and the maximum value of the semantic similarity for semantic matching. The mapping process prioritizes the two deterministic results of exact matching and wildcard matching, and only calculates the semantic matching mapping score when neither of them is found. This priority ensures that the deterministic results are not overwritten by the output of the semantic model. The mapping score is used both to determine whether a mapping failure has occurred and as a matching score in the joint segmentation of multi-page dossiers, as shown in Example 8.

[0053] S6. Identify the text sequence of the legal document page image, extract the related parties, and extract the date of signature of the legal document page image;

[0054] Specifically, the main text sequence is obtained through character recognition, the related party is extracted from the main text sequence, and the signature date is extracted from the signature area of ​​the page. See Example 6 for details. The two types of elements each use information channels suitable for their respective sources: the related party appears in the main text in natural language form and is suitable for extraction by text sequence; the signature date is often located in the lower right corner of the page and may be covered by a seal, requiring image processing before recognition.

[0055] In terms of effectiveness, processing related parties and the signature date separately through the text channel and image channel avoids two common omissions that occur with a single channel: when relying solely on the layout image, it is difficult to locate related parties scattered throughout the text; and when relying solely on text recognition, the signature date obscured by the seal is often recognized as garbled text or is missed entirely. The results from the two channels are merged in S7, with missing fields filled with empty strings without blocking the output of other fields.

[0056] S7. Summarize the standard document name, the related party, and the date of signature to obtain the structured cataloging result, and generate a review identifier based on the title validity determination result.

[0057] Specifically, the standard document name, the associated party, and the date of signature, along with the original title, file name, and body text, are assembled into a key-value structured cataloging result, with missing fields filled with empty strings. The review flag is generated based on the title validity determination result: if the determination result is a valid document main title, the review flag is set to "No review required" by default; if a mapping failure or semantic conflict occurs in the aforementioned directory mapping, it is set to "Pending review" and the corresponding reason is recorded; if the determination result is "No title" and the input "Whether it is the first page" flag indicates that the page is the first page, it means that the page should have a title according to the layout but it was not recognized, and the review flag is set to "Pending review"; if the determination result is "No title" and the page is not the first page, the review flag is set to "No review required".

[0058] It should be noted that the "review pending" flag can originate from multiple sources, summarized as follows: the title validity determination result is "no title" and the page is the homepage; the directory mapping fails; the semantic matching results in a semantic conflict; the position is less than 1 when calibrated according to Example 7; the edge posterior probability is less than the boundary posterior threshold when jointly segmented according to Example 8, or the homepage determination and title validity determination results conflict; in addition, if the structured cataloging result still cannot be parsed after the following repairs, it is also set to "review pending". If any of the above sources occur, the review flag will be set to "review pending", and all sources will be specified in the review reason, allowing reviewers to see all the suspicious points on the page at once without having to check each item individually.

[0059] In this embodiment of the invention, the structured cataloging results are output in key-value format, containing fields such as original document name, standard document name, related party, date of signature, file name, main text content, review identifier, and review reason. During assembly, the results are standardized and repaired: missing fields are filled with empty strings, and empty values ​​are uniformly represented as empty strings rather than empty objects; if the standard document name is empty but the original document name is not empty, it is filled back with the original document name; and abnormal control characters introduced by text recognition are removed. Subsequently, the entire key-value structure is format-validated. If the validation fails, it is first repaired according to the above rules. If it still fails after repair, the review identifier is set to pending review, and "structured repair failed" is recorded in the review reason. Because the repair rules are deterministic, the same input always yields the same output, facilitating project deployment and database entry.

[0060] For example, the output of a valid first page is: original document name "Interrogation Record of a Certain Unit in a Certain Location", standard document name "Interrogation Record", related party "Party A", date of signature "20260101", file name "page_001.png", the main text content is the text obtained from the character recognition, the review indicator is "No review required", and the review reason is empty. The output of an intermediate page in the same file is: original document name, standard document name, related party, and date of signature are all empty strings, file name "page_002.png", the review indicator is "No review required"; if this page is marked as the first page in the input, the review indicator is "Pending review", and the review reason is "No title recognized for the first page". For pages where mapping fails, the original document name is "Conversation Minutes", the standard document name is refilled as "Conversation Minutes", the review indicator is "Pending review", and the review reason is "Mapping failed".

[0061] Example 2

[0062] like Figure 2 As shown, based on Example 1, the calculation process for the comprehensive score of the title candidate set is as follows:

[0063] S2. Identify the candidate title set of the legal document page image, and calculate a comprehensive score for the candidate title set based on its position, visual salience score, and relationship to the beginning of the main text, including:

[0064] S2.1. Calculate the page position score of the title candidate set located in the top area of ​​the page;

[0065] The top area of ​​the page refers to the first 25% of the page image's height from top to bottom, and this percentage can range from 20% to 35%. When the top edge of the title candidate's text block falls within this area, the page position score is calculated. The value is set to 1; when located outside this region, the value decreases linearly with increasing distance from the lower boundary of the region, until it decreases to 0. Here... Indicates the first Page position score for each title candidate The title candidate is the index of the title candidate in the title candidate set.

[0066] It should be noted that the aforementioned decreasing distance is 10% of the page height; exceeding this distance results in a page position score of 0. Taking two text blocks as an example: if the top edge of one text block is located at 8% of the page height from top to bottom, within the top area of ​​the page... Take 1; the top edge of the other text block is located at 30%, 5% from the bottom boundary of that area. We assign a score of 0.5. This way, the title at the very top of the page receives the highest position score, while short lines of text in the middle of the page receive virtually no position score.

[0067] S2.2. Calculate the visual saliency score based on the centering degree, font size, font weight, and spacing between the candidate title set and the text block below it;

[0068] Visual salience score The following values ​​are obtained by averaging four visual factors after normalization: Centering level is calculated as 1 minus the absolute value of the difference between the left and right margins of the text block, divided by the page width; Font size is calculated as the ratio of the text block height to the average text height on the page, truncated to 2 if this ratio exceeds 2, and then divided by 2; Font weight is calculated as the ratio of the average stroke width of the text block to the average stroke width of the text page, also truncated to 2 and then divided by 2; Spacing is calculated as the ratio of the blank space between the text block and the text block below it to the line spacing of the text page, truncated to 3 if this ratio exceeds 3, and then divided by 3. This method yields the following results. It is between 0 and 1, and the closer it is to 1, the more prominent the text block is on the page. Indicates the first Visual salience scores for each title candidate.

[0069] In one scenario, a candidate title has a centering score of 0.98; a font size ratio of 1.6, with the font size item at 0.8; a weight ratio of 1.4, with the weight item at 0.7; and a spacing ratio from the text block below of 2.4, with the spacing item at 0.8. The average of these four factors constitutes the visual saliency score. It is 0.82.

[0070] S2.3. Calculate the structure score based on whether the text block following the candidate title set is the beginning of a body paragraph;

[0071] Structure score Reflecting the beginning of the main text: If the text block immediately below the title candidate is smaller in font size and has a two-character first-line indent, or begins with a narrative opening phrase such as "upon review," "now ascertained," or "based on," then that text block is determined to be the beginning of a main text paragraph. Select 1; if the text block below is still short text of the same font size, it indicates that the title candidate is in a heading group or table of contents. Take 0; for cases in between, take 0.5. Indicates the first The structure score of each title candidate.

[0072] It should be understood that the body text start relationship is used to distinguish between "headings on a separate line" and "short headings in the body text". As an example, when the text block immediately below a heading candidate is smaller than the heading candidate, has a two-character first-line indent, and begins with "After review", Select 1; when the text immediately below the title candidate is still a short line of text of the same font size, Take 0.

[0073] S2.4. Calculate the title word form score based on whether the title candidate set matches the document type word ending pattern;

[0074] Title word form score The determination method is as follows: the string at the end of the title candidate is compared with a dictionary of document type suffixes. The dictionary contains suffixes such as "book," "table," "letter," "notice," "record," "explanation," "decision," "opinion," and "report," which can be automatically generated from the last words of each standard document name in the standard directory mapping rules; when a match is found... Select 1 if the value ends in 1, otherwise select 0. The document type term ending pattern is the name form that ends with a document type term as represented by the above dictionary. Indicates the first Title word form score for each title candidate.

[0075] It is worth noting that the final string "record" in the title candidate "interrogation record" matches the dictionary of document type suffixes. Select 1; the last string of the title candidate "II. Fact Determination" did not match the dictionary. Set to 0. The document type suffix dictionary can be updated synchronously with the standard directory mapping rules, so that newly added standard document names can also receive word form scores.

[0076] S2.5. Calculate the pseudo-title risk score based on the matching of the candidate titles with the chapter titles, table of contents items, headers and footers, case numbers and organization headings;

[0077] False title risk score Indicates the first The degree to which a title candidate is a pseudo-title is determined, with a value between 0 and 1. See Example 3 for specific calculations.

[0078] S2.6. Multiply the page position score, the visual salience score, the structure score, and the title word form score by the non-negative position weight, visual salience weight, structure weight, and title word form weight, respectively, and sum them. Then subtract the product of the pseudo-title risk score and the pseudo-title penalty weight to obtain the comprehensive score of the title candidate set.

[0079] The page position score refers to the page position score obtained for the currently processed legal document page image. "Current" simply indicates that all scores are taken from the same page image, and are the same as the page position score obtained in S2.1. The overall score is calculated according to formula (1):

[0080] (1)

[0081] in, Indicates the first The overall score of the title candidates; , , , In order, they are non-negative positional weights, visual salience weights, structural weights, and title word form weights; Weighting is applied to false headlines. The weighting of each headline candidate... The maximum value in the score is the overall score of the title candidate set. Because the first four items accumulate evidence of title appearance through a weighted summation, while the pseudo-title risk score is deducted, the score of text blocks that look like titles but hit the pseudo-title pattern is suppressed. As a result, the overall score of pseudo-titles such as chapter titles and table of contents items is lower than that of the real document main title, which solves the problem of pseudo-titles being mistaken for document names when extracting titles page by page. to The sum is taken as 1, with typical values ​​being 0.3, 0.25, 0.2, and 0.25 respectively; has a value range of 0.3 to 1. An excessively small value leads to insufficient suppression of the pseudo-title risk score, while an excessively large value may mistakenly penalize genuine titles with individual pseudo-title features. The above weights can be preset or fitted based on reviewed samples using non-negative constrained logistic regression. In one example, the page position score, visual saliency score, structure score, title morphological score, and pseudo-title risk score of a certain title candidate are 0.95, 0.9, 0.8, 1.0, and 0.1, respectively, taking , the weighted summation terms are 0.285, 0.225, 0.16, and 0.25, respectively. Subtracting the pseudo-title penalty term of 0.05 results in a comprehensive score of 0.87. For a certain section title candidate, the above scores are 0.4, 0.5, 0.3, 0, and 0.9, respectively, so the weighted summation terms are 0.12, 0.125, 0.06, and 0, respectively. Subtracting the pseudo-title penalty term of 0.45 results in a comprehensive score of -0.145, showing a significant difference between the two.

[0082] Embodiment 3

[0083] As Figure 3 shows, based on Embodiment 2, the calculation process of the pseudo-title risk score is as follows:

[0084] S2.5. Calculate the pseudo-title risk score according to the matching status of the title candidate set with section titles, table of contents entries, headers and footers, case numbers, and institutional headings, including:

[0085] S2.5.1. Perform pattern matching between the text of the title candidate set and section numbering to obtain the section title matching degree;

[0086] Section numbering patterns include: the form of "第" followed by Arabic numerals or Chinese numerals and then "章", "节", "条", or "款"; the form of Chinese numerals followed by an enumeration comma; the form of Chinese numerals enclosed in parentheses; and the form of Arabic numerals followed by a period, matched using regular expressions. When the entire text of a title candidate hits any of the above patterns, the section title matching degree takes 1; if hit only at the beginning of the text, it takes 0.6; otherwise, it takes 0. Here, to are sequentially the section title matching degree, table of contents entry matching degree, header and footer matching degree, case number matching degree, and institutional heading matching degree of the i-th title candidate, with values ranging from 0 to 1.

[0087] For example, the title candidate "Chapter 2 Fact Finding" hits the section numbering pattern as a whole, so takes 1; the title candidate "2. After examination..." hits the pattern only at the beginning of the text, so takes 0.6.

[0088] ​S2.5.2. Detect whether the text line containing the title candidate set contains a dotted line leader character and a line end page number, and output the table of contents item matching degree;

[0089] Dotted-line leaders refer to consecutive ellipses, consecutive periods, or consecutive underscores; line-end page numbers refer to Arabic numerals located at the end of text lines. When both appear simultaneously, the table of contents item matching score is high. Take 1; take 0.5 if only one appears; take 0 if neither appears. The typical form of a table of contents item is the document title followed by a dotted line leader and page number. The difference between this and the actual main title of the document is that the latter is on a separate line and does not have a page number at the end of the line.

[0090] Taking a certain line of text as an example, "Interrogation record...3" contains both a dotted line leader and a page number at the end of the line. Take 1; the text line "interrogation record" has neither of these. Take 0.

[0091] S2.5.3. Determine whether the title candidate set is located on the upper or lower edge of the legal document page image and appears repeatedly in the same position on the adjacent page of the case file to which the legal document page image belongs, and obtain the header and footer matching degree;

[0092] The top and bottom edge bands refer to the horizontal strips at the very top and bottom of the page image, each occupying 8% of the page height. If a title candidate is located within either edge band, and there are text blocks with a text content similarity of at least 0.9 and a positional overlap ratio of at least 0.8 on adjacent pages of the same volume, it is considered a duplicate. (Header / footer matching score...) Take 1; take 0.5 if it is only located within the edge band and there is no duplicate evidence; otherwise take 0. Headers and footers are repeated page by page in the same file, while the main title of the document only appears on the first page; this distinguishes the two.

[0093] In one scenario, the header "Case File No. X" is located at the top edge, and the same text appears in the same position on an adjacent page. The text content similarity is 1, and the positional overlap ratio is 0.95. This is determined to be a duplicate occurrence. Take 1.

[0094] S2.5.4. Match the text of the title candidate set with the case number pattern to obtain the case number matching degree;

[0095] The case number pattern is described using a regular expression, and its form consists of the year, agency code, type code, "No.", serial number, and "Number" in parentheses, such as "(20XX) No. XXX of a certain case", where "X" is a placeholder. When the candidate title text as a whole conforms to this pattern, the case number matching degree is [percentage missing]. Set to 1; if the text contains the pattern fragment but there are other texts, set to 0.6; otherwise, set to 0.

[0096] As an example, the title candidate "(20XX) No. XXX" conforms to the case number pattern. Select 1; the title candidate "Interrogation Record (20XX) No. XXX" contains a fragment of the case number but other text. Take 0.6.

[0097] S2.5.5. Determine whether the title candidate set is an organization name and whether the text block below the title candidate set contains document type suffixes, so as to determine the organization header matching degree;

[0098] The identification of organization names employs a combination of an organization name dictionary and named entity recognition. The dictionary includes names ending with an organization-type suffix. If a title candidate is identified as an organization name, and the immediately following text block contains a document type suffix, it indicates that the title candidate is an organization header located above the document title. The organization header matching score is... Take 1; if it is judged as an organization name but the text block below does not contain the suffix of document type, take 0.5; otherwise, take 0.

[0099] For example, the title candidate "A Certain Organization" was judged as the name of an organization, and the text block immediately below it was "Interrogation Record," containing the suffix of document type. Take 1.

[0100] S2.5.6. Take the maximum value among the chapter title matching degree, the table of contents matching degree, the current header and footer matching degree, the case number matching degree, and the organization header matching degree as the pseudo-title risk score, and determine that the pseudo-title rule is matched when any one of the chapter title matching degree, the table of contents matching degree, the current header and footer matching degree, the case number matching degree, and the organization header matching degree is not less than the pseudo-title exclusion threshold.

[0101] Take five matching degrees to The maximum value in the value is used as the pseudo-header risk score. The reason for using the maximum value instead of a weighted average is that if a text block is indeed a pseudo-heading in any aspect, it should not be used as the main title of the document. A weighted average would dilute the certainty of a single aspect by the zero matching scores of the others. Let the pseudo-heading exclusion threshold be... Any one of the five matching degrees is not less than If the pseudo-title rule is met, the candidate title is directly excluded, even if its overall score is high, and it will not be used as a valid document title. The value ranges from 0.8 to 0.95: a value that is too small will mistakenly exclude true titles with only weak evidence, while a value that is too large will make the exclusion criteria for false titles too strict.

[0102] In this embodiment of the invention, the title existence determination refers to: for each page of a legal document image, first determining whether the page contains a valid main title that should be cataloged as the document name, and then deciding whether to proceed to subsequent title normalization and directory mapping. The output of the determination is a valid main title or no title, where no title is a legitimate result alongside a valid main title, rather than a fallback after recognition failure. Compared with the existing method of extracting title text page by page, this determination inherits the foundation of layout analysis and text recognition, the difference being that it treats "whether the page has a title" as a problem to be determined and sets a rejection exit point for it.

[0103] In specific implementation, the page sequentially undergoes text recognition, layout detection, calculation of five candidate scores, synthesis of a comprehensive score according to formula (1), taking the maximum value to obtain the comprehensive score of the title candidate set, comparison with the title validity threshold, and verification of the five matching degrees using the pseudo-title exclusion threshold. Finally, the title validity judgment result is output. Each score is written into the page processing record while retaining the original value, including the five matching degrees, five scores and the comprehensive score, which facilitates the reviewers to trace the reasons when the page is set to be reviewed, and also provides data for calibration according to Example 7. The sum of position weight, visual salience weight, structural weight and title word form weight is 1. The pseudo-title penalty weight, pseudo-title exclusion threshold and title validity threshold can be determined by grid search of the F1 value of the title existence judgment on the validation set. The validation set must contain both a valid homepage and various types of untitled pages. Untitled pages should cover middle pages, end pages, table of contents pages and pages containing only pseudo-titles to avoid the threshold biased towards a single page type.

[0104] Let's take a case file as an example. The top of a valid first page contains, in order, a header "Case File X", an organizational header "Organization X", and a separate line for "Interrogation Record". The header's header-footer match score is 1, and the organizational header's organizational header match score is 1; both are above the pseudo-title exclusion threshold (0.9) and are therefore excluded. The page position score, visual salience score, structure score, title word form score, and pseudo-title risk score for "Interrogation Record" are 0.95, 0.9, 0.8, 1.0, and 0.1 respectively, with a comprehensive score of 0.87, which is greater than... (Taking 0.6), it is therefore determined to be a valid document title. Middle pages of the same file only have a header, page number, and chapter title "II. Fact Findings" at the top; all three match the aforementioned pseudo-title rule and are therefore excluded, resulting in an output of "No Title".

[0105] Example 4

[0106] like Figure 4 As shown, based on Example 1, the process of obtaining the standard document name is as follows:

[0107] S5. Based on the standard directory mapping rules, the document type name is first subjected to exact matching and wildcard matching. If no match is found, semantic matching is performed within the candidate name set expanded by the standard directory mapping rules to obtain the standard document name, including:

[0108] S5.1. Match the document type name with each standard document name in the standard directory mapping rule one by one, and output the corresponding standard document name when a match is found;

[0109] Before matching, whitespace and punctuation are removed from the document type name, and full-width and half-width characters are standardized. Then, the string is compared with each standard document name one by one. If they are completely identical, it is an exact match, and the standard document name is output. The result of an exact match is deterministic and reproducible, without introducing any model uncertainty.

[0110] For example, the document type name "Interrogation Record" after removing spaces is exactly the same as the standard document name "Interrogation Record", a perfect match.

[0111] S5.2. When an exact match is not found, the document type name is matched with each wildcard rule in the standard directory mapping rules. If a match is found, the corresponding standard document name is output.

[0112] Wildcard rules are represented by name patterns containing the wildcard character "*", such as "*Inquiry*Registration Form", which can cover formats like "Inquiry Status Registration Form" and "Inquiry Personnel Registration Form". A wildcard match is achieved when the document type name matches any wildcard rule, and the standard document name to which that wildcard rule belongs is output. If multiple wildcard rules are matched, the pattern with the most non-wildcard characters is used. Wildcard matching is used to accommodate aliases, abbreviations, and different organizational templates for the same document.

[0113] S5.3. When wildcard matching fails, expand the possible document names corresponding to each standard document name in the standard directory mapping rules to form the candidate name set;

[0114] The list of possible document names consists of aliases, abbreviations, and historical spellings corresponding to each standard document name. All possible document names corresponding to the standard document names are merged and expanded, and the affiliation between each candidate name and its corresponding standard document name is preserved, forming the candidate name set.

[0115] As an example, the possible document names corresponding to the standard document name "Interrogation Record" are "Interrogation Record", "Record (Interrogation)" and "Interrogation Situation Record". When expanded, these three candidate names all belong to the standard document name "Interrogation Record".

[0116] S5.4. Calculate the semantic similarity between the document type name and each candidate name in the candidate name set, and take the standard document name to which the candidate name corresponding to the maximum semantic similarity is located as the semantic matching result;

[0117] Semantic matching is performed only when neither exact matching nor wildcard matching is found, and comparisons are made only within the set of candidate names. See Example 5 for specific calculations.

[0118] S5.5. When the maximum value of the semantic similarity is less than the mapping validity threshold, the main title of the valid document or the preset catch-all item in the standard directory mapping rule is used as the standard document name, and the mapping failure status is set so that the review identifier records the mapping failure status; otherwise, the semantic matching result is used as the standard document name.

[0119] Let the mapping validity threshold be... , The value of varies depending on the size of the standard directory, with a common range of 0.6 to 0.85. The maximum value of the semantic similarity is less than 0.6. If the candidate name set does not contain a sufficiently close item, it will not be forcibly assigned to a standard document name. Instead, the effective document title (preserving the original text) or the preset catch-all item in the standard directory mapping rules (such as "other materials") will be used as the standard document name, and the mapping failure status will be set. The review identifier will record this status, and the new writing can be incorporated into the list of possible document names after manual confirmation; otherwise, the semantic matching result will be taken. Values ​​that are too small can cause irrelevant names to be misclassified, while values ​​that are too large can cause more normal titles to fall into mapping failures, increasing the workload of review. In one example, The document type is named "Inquiry Record Form". Neither exact match nor wildcard match was found. The maximum semantic similarity is 0.88, which is not less than... Therefore, the standard document name to which the candidate name with the similarity corresponds is output.

[0120] In another scenario, the document type name is "Conversation Minutes," and neither exact matching nor wildcard matching yields a match. The maximum semantic similarity is 0.41, which is less than... (Take 0.7), the system does not classify it into any standard document name, but uses the main title of the valid document as the standard document name and sets the mapping failure status; after the reviewer confirms that the name is a new way of writing the standard document name "conversation record", it can be added to the list of possible document names, and thereafter, similar titles will be directly matched by exact match.

[0121] Example 5

[0122] like Figure 5As shown in Example 4, the process for calculating semantic similarity and determining semantic matching results is as follows:

[0123] S5.4. Calculate the semantic similarity between the document type name and each candidate name in the candidate name set, and take the standard document name to which the candidate name with the maximum semantic similarity corresponds as the semantic matching result, including:

[0124] S5.4.1. Assign a unique number to each candidate name in the candidate name set;

[0125] The candidate names are assigned values ​​1, 2, 3, ... sequentially, and each number corresponds one-to-one with the candidate name and the corresponding standard document name, forming a numbering table. This numbering table is the unique value space for subsequent semantic matching output.

[0126] S5.4.2. Use a text encoder to encode the document type name and each candidate name in the candidate name set into semantic vectors, respectively, to obtain the document type semantic vector and the candidate semantic vector;

[0127] The text encoder can employ a pre-trained Chinese sentence vector model to encode the document type name and each candidate name into a fixed-length semantic vector. The vector dimension can be 768, etc., and this invention does not limit this. The document type semantic vector is denoted as... Number The candidate semantic vector of the candidate name is denoted as .

[0128] S5.4.3. Calculate the cosine similarity between the document type semantic vector and the candidate semantic vector to obtain the semantic similarity;

[0129] The semantic similarity is calculated according to formula (3):

[0130] (3)

[0131] in, Document type semantic vector With number Candidate semantic vectors The cosine similarity, i.e., the semantic similarity; superscript Indicates vector transpose; The Euclidean norm of a vector is denoted by .

[0132] S5.4.4. Take the difference between the maximum and the second largest semantic similarity values ​​to obtain the similarity interval;

[0133] All Sort by value from largest to smallest, with the largest value denoted as . The second largest value is denoted as Similarity interval for and difference.

[0134] S5.4.5. When the similarity interval is less than the interval threshold, the semantic matching result is set to a semantic conflict state, and the candidate name numbers corresponding to the maximum value and the second maximum value are recorded respectively;

[0135] Let the interval threshold be , The commonly used value range is 0.02 to 0.1. Less than When the two closest candidate names are difficult to distinguish, the standard document name to which the candidate name corresponding to the maximum value belongs is still retained as the semantic matching result. However, the semantic matching result is set to a semantic conflict state, and the numbers of the candidate names corresponding to the maximum value and the second largest value are recorded, so that the reviewer can directly choose between the two candidates. If the value is too small, some difficult-to-distinguish cases will be missed; if the value is too large, the number of pages to be reviewed will increase.

[0136] S5.4.6. The semantic matching result is limited to the standard document name to which the candidate name corresponding to the maximum semantic similarity belongs.

[0137] Semantic matching results can only take the standard document name corresponding to the number with the highest similarity in the numbering table; text outside the numbering table is not allowed to be output. Therefore, even if the text encoder encounters a title format it has never seen before, the output will only be an item in the standard directory or a mapping failure state, and will not generate a name not in the standard directory. In one example, the document type name is "Query Record Table," and the semantic similarities of candidate names numbered 1 to 4 are 0.88, 0.79, 0.52, and 0.40 respectively. The difference between the maximum value of 0.88 and the second largest value of 0.79 is 0.09. , Not less than Therefore, the standard document name to which number 1 belongs is output, and no semantic conflict is set.

[0138] In this embodiment of the invention, the rule-priority plus candidate-restricted semantic mapping refers to organizing the process of mapping document type names to standard document names into a hierarchical structure: the first layer is exact matching, the second layer is wildcard matching, both of which are deterministic mappings driven by standard directory mapping rules; the third layer is semantic matching within the candidate name set, which is only initiated when the first two layers fail, and the output is restricted to the standard document names corresponding to the candidate name set. In addition to these three layers, mapping failure and semantic conflict states are set as controllable exits that can be verified and identified. This structure inherits two known methods: rule mapping and semantic similarity mapping, the difference being that the order of these two methods and the output space are explicitly constrained.

[0139] The definition of the hierarchical mapping is as follows: the standard directory is a finite, known set. For correspondences that can be explicitly expressed by rules, rule-based processing is both accurate and reproducible, without incurring model uncertainty. Long-tailed expressions not covered by rules are handled by semantic similarity. However, if semantic processing allows free text generation, it may output names outside the standard directory, disrupting archiving consistency. By limiting the output space of semantic processing to a numbered table, the output is structurally constrained within the standard directory, eliminating the need for post-processing filtering. The interval between the maximum and second-largest values ​​measures whether the closest candidate is significantly better than the second-closest candidate. A small interval means the two candidates are difficult to distinguish. In this case, the numbers of both candidates are recorded together, and manual selection between the two known options is performed, thus reducing the review cost to a single choice between two options.

[0140] Specifically, the standard directory mapping rules are maintained in the form of a configuration table. Each record contains a standard document name, a list of possible document names, and wildcard rules. Upon startup, all possible document names are expanded into a set of candidate names, assigned unique numbers to form a numbering table, and the candidate semantic vector for each candidate name is pre-calculated using the text encoder and then cached. During semantic matching, only the document type name needs to be encoded once, and then the cosine similarity is calculated with each cached vector. When the vector dimension is 768, the calculation for thousands of candidates can be completed with a single matrix multiplication. The text encoder can directly use a pre-trained Chinese sentence vector model. When conditions permit, possible document names under the same standard document name in the rule base can be compared and fine-tuned by using positive examples and negative examples of possible document names under different standard document names. The convergence condition is that the mapping accuracy on the validation set no longer improves. and Based on the validation set, the validation set must include titles that can be covered by the rules, titles that are not covered by the rules but are semantically covered, and titles that do not belong to any standard document names, so as to achieve a balance between mapping accuracy and the proportion of titles to be reviewed.

[0141] As a result, the mapping results always belong to the standard directory or fall into the mapping failure state, and the consistency of the archive directory is structurally guaranteed; the partial results of deterministic rule hits can be reproduced, which is convenient for review; two candidate numbers are retained when there is a semantic conflict, which reduces the workload of review; the new writing after review and confirmation is incorporated into the list of possible document names, so that the titles that originally required semantic processing are gradually converted to exact matching hits, and the proportion of semantic processing calls continues to decrease as the running time increases.

[0142] Taking four titles as an example. The document type name "Interrogation Record" is identical to the standard document name string, a perfect match, with a mapping score of 1; the document type name "Interrogation Situation Registration Form" is matched by the wildcard rule "*Interrogation*Registration Form", with a mapping score of 0.9; the document type name "Interrogation Record Table" is not matched by the first two levels, and its maximum semantic similarity is 0.88, which is not less than... (Take 0.7), and the difference between it and the second largest value of 0.79 is 0.09, which is not less than... (Take 0.05), output the corresponding standard document name; the maximum semantic similarity of the document type name "Conversation Minutes" is only 0.41, which is less than... Refill the original title and set the mapping failure status.

[0143] Example 6

[0144] Based on Example 1, the extraction process for the main text sequence, related parties, and closing date is as follows:

[0145] S6. Identify the text sequence of the legal document page image, extract related parties, and extract the date of signature of the legal document page image, including:

[0146] S6.1. Perform text recognition on the image of the legal document page to obtain the text sequence;

[0147] The text recognition uses a conventional text recognition engine in the field to output a sequence of main text while preserving the text block order, paragraph affiliation, coordinates, and recognition confidence.

[0148] S6.2. Locate the related party title guide word in the main text sequence, and extract the name text after the related party title guide word as the related party;

[0149] The associated party title guide word refers to a word located before a name and indicating the person's status in the case, which can be provided by a dictionary. After the guide word is located, continuous Chinese characters from after the guide word to the next punctuation mark or blank space are extracted as name text, and colon and parenthetical explanations in the name text are removed to obtain the associated party. When multiple guide words appear on the same page, they are extracted one by one and saved in the order of appearance. In other embodiments, a sequence labeling model may also be used to extract person name entities. In this embodiment, the name text is illustratively represented as "Mou Jia" and "Mou Yi".

[0150] S6.3. Detect a seal occlusion area in an area of the legal document page image;

[0151] The signature date is usually located in a signature area at the bottom right corner of the page, and the signature area may be a range occupying the right one-third of the page width and the lower one-quarter of the page height, where the "area" mentioned above refers to the signature area. In the signature area, a connected domain with a red pixel proportion exceeding a set ratio and an approximately circular or elliptical contour is detected as the seal occlusion area, and the red criterion may be set in a hue-saturation-value space.

[0152] S6.4. Suppress a seal color channel in the seal occlusion area to obtain a seal-removed image;

[0153] Suppressing the seal color channel means that for pixels in the seal occlusion area, a red component is reduced according to a difference between the red component and a green component and a blue component, or only green channel grayscale is retained, so that a red seal background becomes lighter while black text strokes are retained, to obtain the seal-removed image.

[0154] S6.5. Perform text recognition on the seal-removed image to obtain signature date text;

[0155] Text recognition is performed on the seal-removed image again to obtain the signature date text in a form of "year 二〇XX month X day X" or "year 20XX month X day X", where "X" is a placeholder.

[0156] S6.6. When no date is recognized in the signature date text, extract date text from a last segment of the body text sequence as the signature date text;

[0157] If no fragment conforming to a date format is recognized in the signature date text, it indicates that seal occlusion is severe or the signature area is missing, then date text is extracted from the last segment of the body text sequence according to the same date format pattern, and the extracted date text is used as the signature date text. This fallback ensures that a date can still be supplemented by a body channel when an image channel fails.

[0158] S6.7. Convert the signature date text into a unified date format to obtain the signature date.

[0159] The unified date format adopts the 8-digit year-month-day form, where Chinese numerals are converted digit by digit into Arabic numerals. For example, when the date text indicates January 1, 2026, it is converted to 20260101.

[0160] In the embodiment of the present invention, the collaborative extraction of elements of the associated party and the signature date refers to an extraction method that selects a text recognition text channel and a page image channel for extraction according to the source characteristics of each element in the legal document, and converges in the structured cataloging result. The text recognition text channel is oriented to the associated party, and the page image channel is oriented to the signature date, and the two channels each have their own fallback methods.

[0161] The associated party appears in the main text in the form of a natural sentence of "appellation guide word plus name", and its position is not fixed, so the image coordinates have limited help for its positioning, and the language pattern in the text sequence can just be used as a positioning basis; the signature date appears in the fixed area at the lower right corner of the page, and its position is stable, but it is often covered by a red seal. After being covered, direct text recognition is likely to get garbled characters or missed recognition, and it is necessary to suppress the seal color in the image domain first and then perform recognition. Processing the two types of elements in the same channel will inevitably make one of them fall into an information source that it is not good at.

[0162] During specific implementation, the two channels are executed in parallel without waiting for each other. The text recognition text channel outputs the associated party according to S6.1 and S6.2; the page image channel outputs the signature date text according to S6.3 to S6.5, and converts it into a unified date format by S6.7. When the image channel fails to recognize the date, S6.6 performs fallback extraction from the end of the main text sequence; the results of the two channels are converged in S7, and when a certain element is missing, it is filled with an empty string, which does not affect the output of another element and the standard document name. The red criterion for the seal occluded area is set in the hue-saturation-lightness space, where the hue takes two intervals near red, and lower limits are set for saturation and lightness to exclude light pink background and brown text.

[0163] Thus, the two types of problems of missing extraction of the associated party and missed recognition of the signature date due to seal occlusion are dealt with separately, and the integrity of element extraction is higher than that of the single-channel scheme. For example, the date in the signature area of a certain page is partially covered by a red seal, and the date text obtained by direct recognition is incomplete; after suppressing the red channel for the seal occluded area and re-recognizing, the date text "20XX年X月X日" is obtained, which is converted into the unified date format "20260101"; at the same time, "Mou Jia" after "associated person Mou Jia" in the main text is extracted as the associated party. If the seal occlusion is serious and the image channel still fails to recognize the date, the date text in the end of the main text is used to supplement it.

[0164] Embodiment 7

[0165] On the basis of Embodiment 1, in order to make the title validity threshold have a controllable false acceptance upper bound, the method further includes:

[0166] Step A. Obtain the set of verified calibration pages, which includes pages with a true value of "no title";

[0167] The verified calibration page set consists of pages manually verified from historical files, covering valid first pages, middle pages, last pages, table of contents pages, and pages containing pseudo-titles. Pages with a true value of "no title" include middle pages, last pages, table of contents pages, and pages containing only pseudo-titles. The calibration page set does not overlap with the samples used to adjust the standard directory mapping rules and prompt templates. The calibration process is performed offline and can be re-executed after changes to the layout template or the addition of a sufficient number of verified samples.

[0168] Step B. Cluster the set of calibration pages into template clusters based on the layout fingerprint of the top area of ​​the page;

[0169] The layout fingerprint is obtained by extracting features from the thumbnail of the top area of ​​the page. A clustering method (such as K-means) is used to cluster the calibration page set, with each cluster being a template cluster. The number of clusters is determined by the number of template types for each organization. Calibration is performed separately for each template cluster, so that the title validity threshold adapts to the layout differences of different organizations and templates.

[0170] Step C. For each template cluster, take the maximum value of the comprehensive score of the title candidate set of pages with true values ​​that have no title, and form the null hypothesis score set;

[0171] For each template cluster, a comprehensive score for the title candidate set is obtained for each page within the cluster whose truth value is "no title," following the method described in Example 2. The maximum value among these values, i.e., the score of the text block that most resembles the title, is taken to form the null hypothesis score set. The number of elements in this null hypothesis score set is denoted as . The reason for taking the maximum value is that the system judges a page based on the comprehensive score of the candidate title set for that page, and the quantity used for calibration must be consistent with the quantity used for judgment.

[0172] Step D. Determine the template cluster to which the legal document page image belongs, and sort the null hypothesis score set of the template cluster from largest to smallest score;

[0173] Determine the template cluster to which the page to be cataloged belongs, that is, assign the layout fingerprint of the top area of ​​the page to the template cluster containing the nearest cluster center, take the null hypothesis score set of the template cluster, and sort them in descending order of score.

[0174] Step E. Round down the product of the preset false headline false acceptance rate target level and the number of elements in the null hypothesis scoring set plus 1 to obtain the ranking;

[0175] The target level for false headline acceptance rate is denoted as This refers to the upper limit of the probability that an untitled page is misjudged as the main title of a valid document. The ranking and threshold are determined according to formula (2):

[0176] (2)

[0177] in, Indicates position; Indicates rounding down; This indicates the number of elements in the null hypothesis score set; This represents the set of scores for the null hypothesis, sorted from largest to smallest. One rating; This is the title validity threshold. Under the condition that the calibration page and the page to be cataloged are interchangeable, if the page to be cataloged is an untitled page, the comprehensive score of the title candidate set for that page is greater than [value missing]. If and only if the rating contains the rating itself Among the top-rated items The probability of this position is no more than [number]. and The ratio, and therefore does not exceed Therefore, the judgment condition is " Greater than "To ensure that the probability of an untitled page being mistakenly identified as the main title of a valid document does not exceed..." Furthermore, no assumptions need to be made regarding the distribution of page ratings. The value is typically between 0.01 and 0.1; a smaller value indicates a more conservative approach, resulting in fewer accepted valid titles and more pages awaiting review. In one example, A template cluster The rank is the product of 0.05 and 200, rounded down to 10. Taking the 10th largest score in the hypothetical score set (e.g., 0.62) as the rank... The probability of an untitled page being misjudged is no more than the ratio of 10 to 200, which is 0.05.

[0178] Step F. When the ranking is not less than 1, take the score corresponding to the ranking as the title validity threshold;

[0179] When the rank is not less than 1, proceed according to step E. That is, the title validity threshold used in S3 of Example 1.

[0180] Step G. When the rank is less than 1, the title validity determination result is set to "no title" and the review identifier is set to "pending review".

[0181] A rank less than 1 means the null hypothesis score set is too small, i.e., the number of elements in the null hypothesis score set plus 1 is less than 1. The reciprocal of the result cannot provide a threshold that satisfies the target level. Therefore, no page is accepted as a valid document title; the title validity determination result is set to "no title," and the review flag is set to "pending review" to avoid giving an unreliable judgment when the calibration sample is insufficient. , When the position is 0, the product of 0.05 and 16 is rounded down to 0.

[0182] In this embodiment of the invention, the calibrated title validity threshold refers to the threshold obtained by back-calculating the null hypothesis score set obtained from the set of pages in the verified and calibrated page set whose true value is "no title" according to a preset target level for false title misacceptance rate, i.e., the score corresponding to the position. Unlike a fixed threshold adjusted based on validation set experience, the selection of the calibration threshold is based on an interpretable probabilistic constraint, i.e., the probability that an untitled page is misjudged as a valid document title does not exceed the target level.

[0183] The technical principle is the rank proof in conformal inference: if the page to be cataloged and the calibration page are interchangeable, then the rank of the comprehensive score of the page to be cataloged (assuming it is an untitled page) in all scores including itself is equally likely when there are no tied scores, therefore its score ranks first. The probability of the position does not exceed and The ratio, and the ranking Equation (2) is chosen to ensure that the ratio does not exceed The largest integer. This argument does not require page ratings to follow any specific distribution, nor does it rely on the underlying multimodal model or weight values. Therefore, after the layout analysis model is changed, only the null hypothesis rating set needs to be recalculated, and the constraint on the probability of false acceptance still holds. Calibration by template cluster is to make commutativity more closely approximate: pages within the same template cluster have similar layouts and similar rating distributions. It should be understood that this guarantee addresses the probability of false acceptance of untitled pages, and does not constrain the proportion of valid homepages that are missed; the smaller the target level, the more conservative it is, and the more pages are placed under review.

[0184] In practice, calibration is divided into three stages: data, calculation, and application. In the data stage, pages that have been manually reviewed are selected from historical files, and the true values ​​are marked according to the review conclusions. It is ensured that the calibration page set does not overlap with the samples used in the adjustment rule base and prompt templates to avoid the scoring being contaminated by sample overlap. In the calculation stage, the comprehensive score of the title candidate set is calculated for each page according to Example 2 and Example 3. The page fingerprint is clustered into template clusters, and the null hypothesis score sets are constructed and sorted. The position of each template cluster and the title validity threshold are obtained according to Equation (2). In the application stage, the page to be cataloged is assigned to the template cluster to which the nearest cluster center belongs, and the threshold of that template cluster is adopted. When the cumulative number of newly added reviewed samples reaches the preset number, or the average distance between the page fingerprint of a new page and its corresponding cluster center exceeds the preset distance, the data stage and calculation stage are re-executed so that the threshold is updated rollingly with the template changes.

[0185] The calibration ensures that the determination of the title validity threshold no longer relies on trial and error, and the probability of false acceptance has a clear upper bound; different institutions and different templates each have their own thresholds adapted to their own formats, alleviating the problem of the same threshold failing when crossing templates; when the calibration sample is insufficient, the system does not give an unguaranteed judgment, but instead transfers it to manual review, making the risk explicit.

[0186] Taking two template clusters as an example, take Template cluster A has a null hypothesis scoring set of 199 scores, ranked 10th. The threshold is set to the 10th largest score, 0.62, ensuring a misclassification probability of an untitled page is no more than 0.05. Template cluster B has a null hypothesis scoring set of 99 scores, ranked 5th. The threshold is set to the 5th largest score, 0.58, again ensuring a misclassification probability of no more than 0.05. If a page to be cataloged is assigned to template cluster B, its candidate title score is 0.60, greater than 0.58, thus qualifying it as a valid document title if the pseudo-title rule is not met. If the page were assigned to template cluster A, the score would be no greater than 0.62, resulting in an untitled page.

[0187] Example 8

[0188] Based on Example 1, to ensure that the determination of each page in a multi-page file remains consistent across the entire file, the method further includes:

[0189] Step A. For the current page in the multi-page file, construct the current page as the first page emission score of the document named with each standard document name based on the comprehensive score of the title candidate set and the matching score of the document type name with each standard document name;

[0190] The image of the legal document page is one page from a multi-page file; the current page is the page being processed, and its page number is denoted as [page number missing]. The current page will be scored by combining the candidate titles. After normalization to the range of 0 to 1 using the logistic function, we obtain ; Match the document type name on the current page with the standard document name The matching score is denoted as The value is 1 for an exact match, 0.9 for a wildcard match, and the semantic similarity is taken as the semantic similarity between the candidate names corresponding to the standard document name for semantic matching. The maximum value in the range, which is 0 when the page is in an untitled state. Homepage launch score. Pick and The product plus the smoothing constant Divide by Then take the natural logarithm; The value ranges from 0.001 to 0.01, and is used to avoid taking the logarithm of zero.

[0191] Step B. Based on whether the page number of the current page is consecutive with the page number of the adjacent page, and whether the first text block of the main text sequence of the current page continues from the last sentence of the adjacent previous page, construct the continuation emission segment of the current page;

[0192] Continued page feature score The average of the two pieces of evidence is taken: 1 is recorded if the current page number is consecutive to the page number of the adjacent previous page, otherwise 0; 1 is recorded if the first text block of the current page's main text sequence follows the last sentence of the adjacent previous page, otherwise 0. The criteria for following a sentence are: the last sentence of the previous page has no final punctuation, or the first sentence of the current page begins with a connecting word. (Continue page emission score) Pick and The product plus Divide by Then take the natural logarithm. When the evidence on the homepage is sufficient... When the size decreases and there is sufficient evidence for the continuation of the page. It gets bigger.

[0193] It should be noted that the page numbers here refer to the page numbers printed in the footer of the document itself, which are consecutive pages within the same document. The page numbers of new documents start from 1 again, not the page numbers arranged according to the case file order during scanning; if there are no page numbers printed on the page, this piece of evidence is recorded as 0.

[0194] Step C. Based on historically reviewed case files, calculate the document transfer probability between standard document names and the page number distribution of documents corresponding to each standard document name;

[0195] Document transfer probability Standard document names in the case file The named document is immediately followed by the standard document name. The probability of a named document is obtained by smoothing and normalizing the count of adjacent document pairs in historically reviewed files by adding 1; page number distribution Standard document title The named document occupies exactly The probability of a page is obtained by smoothing the frequency of that type of document page in historical files by adding 1. Not exceeding the maximum number of pages in a single document For example, page 20. Reflecting the conventions of document order in the case file, It reflects the conventions of document length for various types of documents.

[0196] Step D. Using the start and end pages of a document and the standard document name as segmentation units, dynamic programming is used to solve for the segmentation sequence that maximizes the sum of the first page emission points and the subsequent page emission points, the sum of the logarithms of the document transition probabilities, and the sum of the logarithms of the current page number distribution, thus obtaining the start and end pages and the standard document name of each document.

[0197] The current page number distribution refers to the page number distribution corresponding to the standard document name of the last document in the current segment. Using the starting and ending pages of the document and the standard document name as segment units, the solution is obtained recursively according to formula (4):

[0198] (4)

[0199] in, Indicates the preceding The page has been segmented and the standard document name of the last document is: The optimal cumulative score at that time The page number that has been processed; This indicates the number of pages occupied by the last document, which begins on page 1. End page is ; This represents the standard document name of the previous document; the initial condition is that the score of the virtual starting state preceding the first document is 0. After the recursion ends, take... The largest of them, Given the total number of pages in the file, and tracing back along the recursive path, we obtain the segmentation sequence, which consists of the starting and ending pages of each document and the standard document title. The reason for joint solution is that isolated page-by-page determination cannot utilize context: chapter titles appearing within the main text may receive a high overall score, but if that page is judged as the first page of a new document, it would cut off a document that should be continuous, significantly reducing the document transfer probability and page number distribution terms. The globally optimal segmentation balances the above priors with the emission scores of each page, ensuring that isolated pseudo-titles do not form legitimate segments, while restoring the true first page where the title is missing but the evidence for a continuation page is insufficient. In one example, a file has 5 pages. Page 1 has the highest emission score for the first page of a certain standard document title; page 2's emission score for a continuation page is significantly higher than the first page emission score; page 3 has a high overall score due to the presence of a chapter title at the top, but the page number and continuity evidence indicate that it is a continuation page; page 4 has the highest emission score for the first page of another standard document title. The optimal segmentation sequence is pages 1 to 3 as one document, and pages 4 to 5 as another document.

[0200] Step E. Calculate the marginal posterior probability of each page in the multi-page dossier being the first page of a document using a forward-backward algorithm;

[0201] The forward-backward algorithm uses a sum-product form: the sum of the terms in equation (4) is used as the exponent for the segmented sequence, and the weights of the segments are calculated for each segment containing "the first" term. The weights of all segments in the sequence "Page is the first page of a document" are summed, and then divided by the sum of the weights of all segments to obtain the result. The marginal posterior probability of a page being the first page of a document .

[0202] Step F. When the edge posterior probability is less than the boundary posterior threshold, or when the determination of the homepage of the current page in the segmented sequence conflicts with the determination of the title validity, the verification identifier is set to pending verification;

[0203] Let the boundary posterior threshold be The value ranges from 0.6 to 0.9. The determination of the current page as the first page in the segmented sequence refers to whether the segmented sequence classifies the current page as the first page of a document. A conflict between this determination and the title validity determination result occurs when the segmented sequence classifies the current page as the first page while the title validity determination result is "no title," or when the segmented sequence classifies the current page as a continuation page while the title validity determination result is a valid main title of the document. Less than In the event of the above conflict, the review flag will be set to pending review.

[0204] Step G. Set the standard document name of each page in each document in the segmented sequence as the standard document name of the document.

[0205] Accordingly, the standard document names of the middle and last pages that are in an untitled state are inherited by the documents to which they belong, and the entire volume obtains a catalog of materials with the standard document names as the index and recording the start and end pages of each document.

[0206] Furthermore, the dossier catalog records the starting and ending pages, original document name, standard document name, related parties, closing date, and review status for each document. The related parties section summarizes the results extracted from each page of the document and removes duplicates. The closing date is the date extracted from the last page of the document. The last page, containing only the closing date and signature but no title, also inherits the standard document name from the document it belongs to. The catalog uses the standard document name as an index and can be directly used for catalog display, document location, and element retrieval.

[0207] In this embodiment of the invention, full-volume joint decoding refers to treating the entire volume as a page sequence, using the start and end pages of documents and standard document names as segmentation units, and comprehensively considering the emission scores of the first page, the emission scores of subsequent pages, the document transition probabilities between standard document names, and the page number distribution of various document types. Through dynamic programming, the optimal segmentation sequence is obtained in one go. This is a semi-Markovian sequence segmentation, with segment lengths that are not fixed but constrained by the page number distribution. Its difference from isolated page-by-page determination is that the role of each page is no longer determined solely by the evidence within that page itself, but rather by evidence and prior knowledge across the entire volume.

[0208] The order and length of documents in a case file follow stable conventions; for example, some documents typically follow others, and certain types of documents usually occupy one to several pages. Isolated document segmentation doesn't utilize these conventions; if a pseudo-heading on a page isn't excluded by the rules, it will break up what should be a continuous sequence of documents. Joint decoding represents these conventions as logarithmic transition terms and page number terms, adding them to the emission scores of each page. For a page to be classified as the first page of a new document, the gain in its first-page emission score must be sufficient to offset the losses in the transition and page number terms. Isolated pseudo-headings do not meet this condition and therefore do not form a valid segment. Conversely, a true first page with a missing or obscured title, even with a low first-page emission score, may still be classified as the first page of a new document if its subsequent pages also have low emission scores. The transition probability and page number distribution allow it to be classified as the first page of a new document. The marginal posterior probability provided by the forward-backward algorithm quantifies the certainty of the segmentation, providing a basis for triggering review.

[0209] In practice, each page first obtains the comprehensive score of the title candidate set, document type name, standard document name, and mapping score according to steps S1 to S7. Based on this, the first page emission score and subsequent page emission score are constructed according to steps A and B. The document transfer probability and page number distribution are obtained from offline statistics of historical reviewed files, using a smoothing method with increments of 1 to ensure that document pairs and page numbers not appearing in the history also have non-zero probabilities. The upper limit for the number of pages in a single document is 20 pages, and consecutive pages exceeding this limit are treated as multiple documents. For a fixed standard catalog size and page number upper limit, the computational workload of dynamic programming increases linearly with the number of pages in the file. When historical files are insufficient, the transfer probability and page number distribution can initially be approximately uniform, and segmentation can be completed solely based on the emission score, gradually replacing them as the reviewed files accumulate. After segmentation is completed, the review is triggered according to step F, and the standard document name is passed to each page according to step G.

[0210] Joint decoding ensures global consistency in the segmentation results of the entire volume: isolated pseudo-headings no longer cut off documents, missing first pages of headings are recovered, the start and end pages and standard document names of each document are directly output, and each segmentation boundary has a posterior confidence level, with low-confidence boundaries being centrally reviewed by humans.

[0211] For example, a case file has 8 pages. Pages 1 to 3 contain one document, and pages 4 to 8 contain another document. The bold, centered subheading "Facts" at the top of page 5 has a composite score of 0.66, which is greater than... (Taking 0.6) and not hitting the aforementioned pseudo-title rule, page-by-page judgment would misclassify it as the first page of a new document; however, the maximum semantic similarity of "factual process" is only 0.41, with a very small mapping score, resulting in a very small first page emission score. At the same time, the page number in the footer of this page is continuous with the previous page, and the first text block follows the last sentence of the previous page, resulting in a larger continuation page emission score. Therefore, the globally optimal segmentation keeps page 5 within the document starting from page 4. Conversely, if the title of page 4 is covered by a stamp and not recognized, its first page emission score and continuation page emission score are similar, determined by the transition probability and page number distribution. The previous document already occupies 3 pages, so it tends to classify page 4 as the first page of a new document. However, due to the lack of title evidence, the marginal posterior probability of this page is insufficient, and it is placed under review.

[0212] Example 9

[0213] Based on Example 1, in order to continuously improve cataloging effectiveness under a limited manual review budget, the method further includes:

[0214] Step A. Obtain the sample pool of difficult pages identified as to be reviewed, and concatenate the multimodal visual features, title text embedding vector and failure type code of each difficult page sample to obtain the sample embedding vector;

[0215] The problematic page sample pool consists of pages marked as pending review within a review cycle. Failure types include mapping failure, semantic conflict, pseudo-title conflict, homepage without title, and insufficient boundary posterior. Failure type encoding uses one-hot encoding. Multimodal visual features are obtained by taking the vector from the top area of ​​the page through a visual encoder, and the title text embedding vector is obtained by taking the vector from the title text through a text encoder. The three are concatenated in order to obtain the sample embedding vector. , This is the serial number of the sample page that is difficult to access.

[0216] Step B. Calculate the sample review risk based on the review status weight corresponding to the failure type of the problematic page sample, the distance between the comprehensive score of the title candidate set and the title validity threshold, and estimate the review cost based on the number of pages in the document where the problematic page sample is located.

[0217] Sample verification risk Take the review status weight The product of 1 and a factor equal to 1 minus "1 and 1". Divide by The smaller of the two values ​​is the quotient. For the sample Overall score of title candidate set With title validity threshold The absolute value of the difference, i.e., the distance, The distance is the normalized width, such as 0.3. The review status weight is determined by the failure type, such as 1 for mapping failure, 0.9 for pseudo-title conflict, 0.8 for semantic conflict, and 0.7 for no title on the homepage. The smaller the distance, the closer the judgment is to the threshold, the more uncertain it is, and the greater the risk. Review cost. Take the page number of the document containing the sample, which reflects the workload required to review the document.

[0218] Step C. Under the review budget constraint, the objective function is the sum of the products of the review risk of each difficult page sample in the difficult page sample pool and the maximum value of the cosine similarity between the difficult page sample and each sample in the selected sample set;

[0219] Reviewing the budget Under the constraint, the sum of the verification costs of the selected samples shall not exceed The objective function is calculated according to equation (5):

[0220] (5)

[0221] in, Represents the set of selected samples The objective function value; This refers to the sample pool of the problematic pages; Indicates the sequence number of the selected sample; Represents the sample embedding vector and The cosine similarity is calculated, and negative values ​​are truncated to 0. This indicates the degree to which the sample pool is covered by the selected samples after risk weighting: the higher the risk of a sample, the more it needs to be covered by similar selected samples, while the gain from repeated inclusion of similar samples diminishes, thus ensuring that the selected samples balance risk and diversity.

[0222] Step D. Greedily select difficult page samples based on the ratio of marginal revenue to the review cost and based on marginal revenue, respectively, and take the sample set with the largest objective function value as the review sample subset;

[0223] Cost-benefit greed refers to each round not exceeding Under the premise of selecting The increment and The sample with the largest ratio; greedy marginal benefit means that in each round of selection, the sample with the largest marginal benefit is selected. The sample with the largest increment. Both greedy algorithms yield a sample set, and we select... The subset with the largest value is selected as the verification sample. Because... With diminishing marginal returns, this method provides a provable approximate guarantee for the optimal value under budget constraints, and the approximate guarantee is further improved when the costs of all samples are the same.

[0224] Step E. Assign the unselected difficult page samples in the difficult page sample pool to the cluster of the verification samples with the highest cosine similarity to the unselected difficult page samples, and generate rule candidates based on the manual verification conclusion of the verification sample subset.

[0225] Unselected samples are assigned to the cluster of a verified sample based on their maximum cosine similarity. Samples in the same cluster then share the manual verification conclusion of that verified sample, eliminating the need for individual verification. For mapping failures, the verified and confirmed writing style is added as a new possible document name to the corresponding standard document name, or the wildcard rules are adjusted accordingly. For pseudo-title conflicts, the confirmed pseudo-title form is added to the pseudo-title rule, and the sample is added as a difficult-to-handle example to the prompt template example library, thus obtaining rule candidates.

[0226] Step F. Repeat the calculation process of the review sample subset on the problematic page samples and the fixed regression set within the cluster. Only when the number of errors in the problematic page samples within the cluster decreases and the number of new misjudgments on the fixed regression set does not exceed the allowed number, the rule candidate is incorporated into the standard directory mapping rule, the pseudo-title rule, the prompt template, or the training sample set.

[0227] The calculation process of the review sample subset, in this embodiment, refers to the process of sequentially performing S2 to S5 of Embodiment 1 on the page samples to obtain the title validity judgment result and the standard document name. After temporarily merging the rule candidates, this process is repeated on the problematic page samples and the fixed regression set within the cluster. The error count of the problematic page samples within the cluster is counted to see if it has decreased compared to before merging, and whether the number of newly added misjudgments on the fixed regression set does not exceed the allowable number. , The value is usually 0. Only when both conditions are met simultaneously will the candidate rule be formally incorporated into the standard directory mapping rule, the pseudo-title rule, the prompt template, or the training sample set for use in the next cycle S2 to S5. This ensures that rule updates do not introduce another type of misjudgment while fixing one type of error.

[0228] In this embodiment of the invention, the coverage-risk selection of review samples refers to selecting a subset from the pool of problematic pages that both covers samples with high risk and has significant differences from each other, under the limited manual review budget of each review cycle, and using its manual review conclusion to represent the remaining samples in the same cluster. The selection is based on the objective function of equation (5), that is, the sum of the degree to which each sample in the sample pool is covered by the most similar sample among the selected samples after being weighted according to the sample review risk. After the selected subset of review samples forms a rule candidate, it must be verified by replay on samples within the cluster and on a fixed regression set before it can be incorporated into the rule base, prompt template or training sample set.

[0229] Its core technology has two key aspects. First, the objective function exhibits diminishing marginal returns: the more samples already selected, the smaller the contribution of new samples to coverage; the gain from repeatedly selecting similar samples is almost zero. Therefore, greedy selection naturally tends to choose samples with significant differences from each other, while risk weighting ensures that samples with higher risk are covered earlier. Due to this property, choosing the better option between cost-benefit greedy and marginal-return greedy approaches yields a solution with a provably approximate guarantee of the optimal value, without exhaustive combinations. Second, replay verification acts as a gatekeeper: the impact of rule updates is not limited to the reviewed samples; performance on similar samples and regression sets with established conclusions is also a criterion. It only takes effect when the number of errors within a cluster decreases and the number of new misclassifications on the regression set does not exceed the allowable number, thus avoiding the introduction of another type of misclassification while correcting one type of error.

[0230] In practice, after each review cycle, pages marked as pending review are collected to form a pool of problematic pages. Step A yields the sample embedding vectors; step B calculates the review risk and cost; and steps C through D select a subset of review samples for manual review. Review status weights are set based on the impact of each failure type on directory quality: mapping failure is assigned 1, pseudo-title conflict 0.9, semantic conflict 0.8, and homepage without a title 0.7. Review conclusions are used to generate rule candidates: mapping failure samples generate new possible document names or wildcard rules; pseudo-title conflict samples generate new pseudo-title patterns and are added to the prompt template example library as difficult-to-handle examples. Rule candidates are incorporated after passing replay verification on in-cluster samples and a fixed regression set; those that fail are returned to the reviewers for revision. The fixed regression set should cover all standard document names and all types of untitled pages and be updated according to the new conclusions after each incorporation.

[0231] The coverage-risk selection method concentrates limited manual review resources on high-risk and diverse samples, and the same type of error only needs to be reviewed once to be repaired in batches; rule updates are verified by replay, and regression risk is controllable; review conclusions are continuously fed back to the rule base, so that the number of difficult samples gradually decreases as the system runs.

[0232] Taking a certain review cycle as an example, the sample pool of problematic pages contains 40 samples, including 15 with mapping failures, 10 with semantic conflicts, 8 with pseudo-title conflicts, and 7 with no title on the homepage. The review budget... A total of 12 pages were selected. Through two greedy selection methods, the resulting subset of samples for review contained 4 samples, with review costs of 3 pages, 4 pages, 2 pages, and 3 pages respectively, totaling 12 pages. This perfectly utilized the budget and covered different failure types. After manual review, 2 new possible document names and 1 new pseudo-title pattern were obtained as rule candidates. During replay verification, the number of errors in the problematic pages within the cluster decreased from 9 to 1, and the number of new misclassifications on the fixed regression set was 0, not exceeding the allowed number. (If the value is 0), the rule candidate is merged into the rule base.

[0233] Example 10

[0234] like Figure 6 As shown, this embodiment of the invention provides an intelligent cataloging device for legal document pages, comprising:

[0235] The acquisition module is used to acquire images of legal document pages and standard directory mapping rules;

[0236] The acquisition module is used to execute S1 of Example 1, read the page image, file name, page number, whether it is the homepage mark and standard directory mapping rule configuration, and generate a page task queue by page.

[0237] The recognition module is used to recognize the title candidate set of the legal document page image, and calculate the comprehensive score of the title candidate set based on the position, visual salience score and the relationship with the beginning of the text.

[0238] The identification module is used to execute S2 of Embodiment 1, including a layout detection unit, a position scoring unit, a visual salience unit, a structure scoring unit, a title word form unit, a pseudo-title risk unit, and a comprehensive scoring unit. The layout detection unit generates the title candidate set; the position scoring unit, the visual salience unit, the structure scoring unit, and the title word form unit calculate the page position score, visual salience score, structure score, and title word form score respectively according to S2.1 to S2.4 of Embodiment 2; the pseudo-title risk unit calculates the pseudo-title risk score according to Embodiment 3; the comprehensive scoring unit synthesizes the comprehensive score of each title candidate according to formula (1), and takes the maximum value to obtain the comprehensive score of the title candidate set.

[0239] The determination module is used to determine that the title candidate set is a valid document main title when the comprehensive score of the title candidate set is greater than the title validity threshold and the pseudo title rule is not hit; otherwise, it outputs a no title status and determines the title validity determination result.

[0240] The determination module is used to execute S3 of Embodiment 1, including a threshold comparison unit and a pseudo-heading rule unit. The former compares the comprehensive score of the headline candidate set with the headline validity threshold, and the latter checks the five matching degrees with the pseudo-headline exclusion threshold. In other embodiments, it may also include a calibration unit, which obtains the headline validity threshold from the null hypothesis score set according to Embodiment 7.

[0241] The stripping module is used to strip place names, organization names, and personal names from the main title of the valid document to obtain the document type name;

[0242] The stripping module is used to execute S4 of Embodiment 1, including a named entity recognition unit and a stripping unit. The former recognizes place names, unit names and person names, while the latter deletes the recognized fragments and outputs the document type name.

[0243] The matching module is used to perform exact matching and wildcard matching on the document type name according to the standard directory mapping rules. If no match is found, semantic matching is performed within the candidate name set expanded by the standard directory mapping rules to obtain the standard document name.

[0244] The matching module is used to execute S5 of Embodiment 1, and includes an exact matching unit, a wildcard matching unit, a candidate expansion unit, a semantic matching unit, and a backfilling unit. The semantic matching unit includes a text encoder, a cosine similarity calculation unit, and an interval discrimination unit. As per Embodiment 5, it assigns unique numbers to candidate names, calculates semantic similarity, and determines semantic conflicts. The backfilling unit backfills the standard document name and sets the mapping failure status when the maximum value of the semantic similarity is less than the mapping validity threshold.

[0245] The extraction module is used to identify the text sequence of the legal document page image, extract related parties, and extract the date of signature of the legal document page image;

[0246] The extraction module is used to execute S6 of Embodiment 1, including a text recognition unit, a related party extraction unit, a seal detection unit, a seal suppression unit, and a date conversion unit. According to Embodiment 6, it extracts related parties and the date of signature from the main text sequence and the signature area of ​​the page, respectively, and extracts the date from the end of the main text if the image channel does not recognize the date.

[0247] The generation module is used to summarize the standard document name, the related party, and the date of signature to obtain a structured cataloging result, and generate a review identifier based on the title validity determination result.

[0248] The generation module is used to execute S7 of Example 1, including a summarization unit, a repair unit, and a review identification unit, outputting structured cataloging results and generating review identifications; in other embodiments, it may also include a segmentation unit for jointly segmenting multi-page files according to Example 8, and a reflow unit for selecting review samples and verifying rules according to Example 9.

[0249] The above-mentioned device can be implemented by a processor and a memory, wherein the memory stores a computer program, and the computer program is executed by the processor to implement the functions of the above-mentioned modules. The present invention does not limit this.

Claims

1. A method for intelligent cataloging of legal document pages, characterized in that, include: Retrieve legal document page images and standard directory mapping rules; Identify the title candidate set of the legal document page image, and calculate the comprehensive score of the title candidate set based on the position, visual salience score and the relationship with the beginning of the text; When the overall score of the candidate title set is greater than the title validity threshold and does not hit the pseudo-title rule, the candidate title set is determined to be a valid document main title; otherwise, the state of no title is output, and the title validity determination result is determined. The place name, organization name, and personal name are removed from the main title of the valid document to obtain the document type name; According to the standard directory mapping rules, the document type name is first matched precisely and then matched wildcard. If no match is found, semantic matching is performed within the candidate name set expanded by the standard directory mapping rules to obtain the standard document name. Identify the text sequence of the main body of the legal document page image, extract the related parties, and extract the date of signature of the legal document page image; By summarizing the standard document names, related parties, and closing dates, a structured cataloging result is obtained, and a review identifier is generated based on the title validity determination result.

2. The method according to claim 1, characterized in that, The process of identifying the title candidate set of the legal document page image involves calculating a comprehensive score for the title candidate set based on its position, visual salience score, and relationship to the beginning of the main text, including: Calculate the page position score of the title candidate set located in the top area of ​​the page; The visual saliency score is calculated based on the centering degree, font size, font weight, and spacing from the text block below the title candidate set. Calculate the structure score based on whether the text block following the candidate title set is the beginning of a body paragraph; Calculate the title word form score based on whether the title candidate set matches the document type word ending pattern; Based on the matching of the candidate titles with chapter titles, table of contents items, headers and footers, case numbers, and organization headings, a pseudo-title risk score is calculated. The comprehensive score of the title candidate set is obtained by multiplying the page position score, visual salience score, structural score, and title word form score by non-negative position weights, visual salience weights, structural weights, and title word form weights, respectively, and then subtracting the product of the pseudo-title risk score and the pseudo-title penalty weight.

3. The method according to claim 2, characterized in that, The step of calculating a pseudo-title risk score based on the matching of the candidate titles with chapter titles, table of contents items, headers and footers, case numbers, and organization headings includes: The chapter title matching degree is obtained by matching the text of the candidate title set with the chapter number pattern. Detect whether the text line containing the candidate title contains a dotted line leader character and a line end page number, and output the table of contents item matching degree; Determine whether the title candidate set is located on the upper or lower edge of the legal document page image and appears repeatedly in the same position on the adjacent page of the case file to which the legal document page image belongs, to obtain the header and footer matching degree; The text of the title candidate set is matched with the case number pattern to obtain the case number matching degree; Determine whether the candidate title set is an organization name and whether the text block below the candidate title set contains document type suffixes, in order to determine the organization header matching degree; The maximum value among the chapter title matching degree, the table of contents matching degree, the current header and footer matching degree, the case number matching degree, and the organization header matching degree is taken as the pseudo-title risk score. If any one of the chapter title matching degree, the table of contents matching degree, the current header and footer matching degree, the case number matching degree, and the organization header matching degree is not less than the pseudo-title exclusion threshold, it is determined that the pseudo-title rule is matched.

4. The method according to claim 1, characterized in that, The standard document name is obtained by first performing exact and wildcard matching on the document type name according to the standard directory mapping rules, and then semantically matching within the candidate name set expanded by the standard directory mapping rules if no match is found. This includes: The document type name is matched precisely with each standard document name in the standard directory mapping rule, and the corresponding standard document name is output when a match is found. When an exact match fails, the document type name is matched with each wildcard rule in the standard directory mapping rules. If a match is found, the corresponding standard document name is output. When a wildcard match fails, the possible document names corresponding to each standard document name in the standard directory mapping rules are expanded to form the candidate name set. Calculate the semantic similarity between the document type name and each candidate name in the candidate name set, and take the standard document name to which the candidate name with the maximum semantic similarity value belongs as the semantic matching result; When the maximum value of the semantic similarity is less than the mapping validity threshold, the main title of the valid document or the preset catch-all item in the standard directory mapping rule is used as the standard document name, and the mapping failure status is set so that the review identifier records the mapping failure status; otherwise, the semantic matching result is used as the standard document name.

5. The method according to claim 4, characterized in that, The step of calculating the semantic similarity between the document type name and each candidate name in the candidate name set, and taking the standard document name to which the candidate name with the maximum semantic similarity value belongs as the semantic matching result, includes: Assign a unique number to each candidate name in the candidate name set; A text encoder is used to encode the document type name and each candidate name in the candidate name set into semantic vectors, resulting in a document type semantic vector and a candidate semantic vector. The semantic similarity is obtained by calculating the cosine similarity between the semantic vector of the document type and the candidate semantic vector; The difference between the maximum and the second largest semantic similarity values ​​is used to obtain the similarity interval. When the similarity interval is less than the interval threshold, the semantic matching result is set to a semantic conflict state, and the candidate name numbers corresponding to the maximum value and the second maximum value are recorded respectively. The semantic matching result is limited to the standard document name to which the candidate name corresponding to the maximum semantic similarity belongs.

6. The method according to claim 1, characterized in that, The process of identifying the text sequence of the legal document page image, extracting related parties, and extracting the date of signature from the legal document page image includes: The image of the legal document page is subjected to text recognition to obtain the main text sequence; Locate the related party title guide word in the main text sequence, and extract the name text following the related party title guide word as the related party; Detect the area obscured by the seal in the region of the image of the legal document page; Suppress the color channel of the stamp in the area covered by the stamp to obtain a stamp-free image; The removed seal image is subjected to text recognition to obtain the date text. When the date is not identified in the signature date text, the date text is extracted from the end of the main text sequence and used as the signature date text; The date text is converted into a unified date format to obtain the date.

7. The method according to claim 1, characterized in that, The method further includes: Obtain the set of verified calibration pages, wherein the set of calibration pages contains pages whose true value is "no title"; The calibration page set is clustered into template clusters based on the layout fingerprint of the top area of ​​the page. For each template cluster, the maximum value of the comprehensive score of the title candidate set of pages with true values ​​is taken to form the null hypothesis score set; Determine the template cluster to which the legal document page image belongs, and sort the null hypothesis score set of the template cluster from largest to smallest score; The ranking is obtained by rounding down the product of the preset false headline false acceptance rate target level and the number of elements in the null hypothesis scoring set plus 1. When the ranking is not less than 1, the score corresponding to the ranking is taken as the title validity threshold. When the rank is less than 1, the title validity determination result is set to "no title" and the review identifier is set to "pending review".

8. The method according to claim 1, characterized in that, The legal document page image is one page from a multi-page case file, and the method further includes: For the current page in the multi-page file, based on the comprehensive score of the title candidate set and the matching score between the document type name and each standard document name, the current page is constructed as the first page emission score of the document named with each standard document name; Construct the continuation emission segment of the current page based on whether the page number of the current page is consecutive with the page number of the adjacent page, and whether the first text block of the main text sequence of the current page follows the last sentence of the adjacent previous page; Based on historically reviewed case files, the probability of document transfer between standard document names and the page number distribution of documents corresponding to each standard document name were statistically analyzed. Using the start and end pages of a document and the standard document name as segmentation units, dynamic programming is used to solve for the segmentation sequence that maximizes the sum of the first page emission points and the subsequent page emission points, the sum of the logarithms of the document transition probabilities, and the sum of the logarithms of the current page number distribution, thus obtaining the start and end pages and the standard document name of each document. The forward-backward algorithm is used to calculate the marginal posterior probability of each page in the multi-page dossier being the first page of a document; When the edge posterior probability is less than the boundary posterior threshold, or when the determination of the homepage of the current page in the segmented sequence conflicts with the determination of the title validity, the review identifier is set to pending review. Set the standard document name of each page in each document within the segmented sequence as the standard document name of the document.

9. The method according to claim 1, characterized in that, The method further includes: Obtain the sample pool of difficult pages identified as to be reviewed, and concatenate the multimodal visual features, title text embedding vector and failure type code of each difficult page sample to obtain the sample embedding vector; The review risk is calculated based on the review status weight corresponding to the failure type of the problematic page sample, the distance between the comprehensive score of the title candidate set and the title validity threshold, and the review cost is estimated based on the number of pages in the document where the problematic page sample is located. Under the review budget constraint, the objective function is the sum of the products of the review risk of each difficult page sample in the difficult page sample pool and the maximum value of the cosine similarity between the difficult page sample and each sample in the selected sample set. Based on the ratio of marginal revenue to the review cost and based on marginal revenue, the difficult page samples are greedily selected, and the sample set with the largest objective function value is taken as the review sample subset; Unselected difficult page samples in the difficult page sample pool are assigned to the cluster of the verification samples with the highest cosine similarity to the unselected difficult page samples, and rule candidates are generated based on the manual verification conclusions of the verification sample subset. The calculation process of the review sample subset is repeated on the difficult page samples and the fixed regression set within the cluster. Only when the number of errors in the difficult page samples within the cluster decreases and the number of new misjudgments on the fixed regression set does not exceed the allowable number, the rule candidate is incorporated into the standard directory mapping rule, the pseudo-title rule, the prompt template, or the training sample set.

10. An intelligent cataloging device for legal document pages, characterized in that, include: The acquisition module is used to acquire images of legal document pages and standard directory mapping rules; The recognition module is used to recognize the title candidate set of the legal document page image, and calculate the comprehensive score of the title candidate set based on the position, visual salience score and the relationship with the beginning of the text. The determination module is used to determine that the title candidate set is a valid document main title when the comprehensive score of the title candidate set is greater than the title validity threshold and the pseudo title rule is not hit; otherwise, it outputs a no title status and determines the title validity determination result. The stripping module is used to strip place names, organization names, and personal names from the main title of the valid document to obtain the document type name; The matching module is used to perform exact matching and wildcard matching on the document type name according to the standard directory mapping rules. If no match is found, semantic matching is performed within the candidate name set expanded by the standard directory mapping rules to obtain the standard document name. The extraction module is used to identify the text sequence of the legal document page image, extract related parties, and extract the date of signature of the legal document page image; The generation module is used to summarize the standard document name, the related party, and the date of signature to obtain a structured cataloging result, and generate a review identifier based on the title validity determination result.