Ai-based method for structuring non-standard judgment documents and method for training ai model therefor
The AI-based method for structuring unstructured judgments addresses format and notation variations by enhancing metadata extraction and classification, improving search accuracy and reducing operational costs through page-by-page image generation and OCR post-processing.
Patent Information
- Application Number
- KR1020260112700
- Authority / Receiving Office
- KR · KR
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2026-06-19
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2046-02-24
AI Technical Summary
Existing legal document processing systems face challenges in standardizing and efficiently searching and classifying unstructured judgments due to variations in format, notation, and metadata extraction issues, leading to inaccuracies and increased operational costs.
An AI-based method for structuring unstructured judgments involves page-by-page image generation, OCR post-processing, and metadata extraction with input quality management, including orientation correction and dictionary-based substitutions, to enhance consistency and reliability.
This approach improves the reproducibility and stability of metadata extraction, reduces OCR errors, and enables advanced search functions by classifying case types and court levels, while minimizing duplicate exposures and enhancing service reliability through automated processing and citation analysis.
Smart Images

Figure 112026075083724-PAT00129_ABST
Abstract
Description
Technology Field
[0001] The present invention relates to an AI-based method for structuring unstructured judgments and a method for training an AI model for the same. Background Technology
[0002] In the fields of legal practice and legal tech, a large volume of documents—including judgments, decisions, adjudication precedents, administrative interpretations, contracts, and written opinions—is continuously being generated and accumulated. While these documents need to be searched and analyzed from various perspectives, such as case type, level of court, status of parties, key issues, and conclusions (orders), their utilization is difficult due to the lack of standardization in actual collection channels and formats. In particular, public documents are frequently provided in PDF format; these PDFs contain a mix of documents based on scanned images as well as text, and the inclusion of layout elements such as tables, footnotes, headers, footers, and page numbers can hinder comprehension. Furthermore, document writing practices and notation methods vary by institution and time period, leading to a tendency for diverse expressions even for the same concept.
[0003] From a document search perspective, existing systems often rely on indexing centered on keyword matching or limited metadata (e.g., case number, judgment date, court name). However, since information such as case names, parties, issues, and cited statutes and precedents is scattered throughout the document body, it is difficult to simultaneously ensure search recall and accuracy through simple keyword searches alone. Furthermore, issues may arise where the same subject is recognized differently due to variations in notation, such as individuals with the same name, abbreviations or misspellings, differences in spacing or line breaks, and the use of special characters. These problems can lead to omissions in search results, duplicate exposures, and incorrect related recommendations, thereby lowering user trust and work efficiency.
[0004] From a document classification perspective, a certain level of standardization is required to reliably apply classification systems based on case types or procedural distinctions (civil, criminal, administrative; appeal, cassation, etc.). However, documents often exhibit complex patterns, such as varying order of entries and terminology, as well as instances where cases are merged or multiple party statuses are listed. Consequently, manual labeling or simple rule-based classification can lead to increased costs or vulnerability to exceptions. Therefore, in environments involving the massive accumulation of legal documents, there is a growing need for document processing technologies that can reduce operational burdens while maintaining the quality of search and classification. The problem to be solved
[0005] The problem that the present invention aims to solve is to automatically generate a case law database processed into a form suitable for search, analysis, and service provision, by receiving an unstructured PDF of a judgment as input, restoring the structure through page-by-page image generation and post-processing of text that has undergone OCR, and reliably extracting core metadata such as case number, parties, representatives, date of judgment, and judge. In particular, since it is difficult to guarantee consistent results using only the same processing rules for judgments due to scan quality, page orientation, margins, internal document components (tables, images, footnotes, etc.), text blurring, and misrecognition, the invention aims to include input quality management functions such as orientation correction, margin removal, duplicate checking, and encryption processing during the image generation stage, and to enhance the consistency of the header and body structures through dictionary-based substitution for misrecognition of characters, line break errors, and typos, as well as tag restoration, during the text post-processing stage.
[0006] Furthermore, the present invention aims to go beyond simply extracting metadata and automate processing necessary for service operation, such as classifying case types and levels, normalizing merged case numbers, linking court codes, generating standard expressions, linking statute citations and precedent citations, determining judgment results, and processing duplicate precedents as non-service. Moreover, it aims to provide search results in a form that users can practically trust by analyzing citation relationships between judgments to generate follow-up precedent data, and by grouping first-instance, appellate, and supreme court judgments to track the progress of cases.
[0007] In addition, the purpose is to provide an AI model training method for structuring non-standardized judgments for this purpose.
[0008] The problems of the present invention are not limited to those mentioned above, and other unmentioned technical problems will be clearly understood by a person skilled in the art from the description below. means of solving the problem
[0009] A method for training an AI model for structuring an unstructured judgment document according to an embodiment of the present invention for solving the above problem comprises: a step of generating a training sample in which a server includes an unstructured judgment document file and an authority validity indicator, and optionally further includes at least one of authority information, a page-by-page preview image, a correct answer text, a correct answer metadata, and a rendering / preprocessing parameter label; a step of setting the authority validity indicator to indicate whether viewing or decryption authority is verified based on the authority information; a step of generating an input feature vector using at least one of the PDF header feature, encryption flag, number of objects, font / image ratio, number of pages, and page-by-page preview image feature of the unstructured judgment document file; a step of training an access / procedure selection model that selects a processing path based on the input feature vector and the authority validity indicator; a step of training a rendering / preprocessing parameter selection policy that selects a page-by-page rendering / preprocessing parameter combination based on the page state and the rendering / preprocessing parameter label; a step of generating a decrypted image or a page-unit rendering image according to the rendering / preprocessing parameter combination; a step of generating a structure restoration input including at least one of a token sequence, a layout feature, and an additional style feature from an OCR intermediate result for the image; and the structure The method includes the step of training a labeling model that predicts a range label of a token or line unit based on a restoration input, and the step of training a restoration model that restores at least one of a line break, paragraph, structural tag, and field-value match based on the prediction result of the labeling model, wherein the access / procedure selection model is not trained to estimate a decryption key or an access authority token for a training sample in which the authority validity indicator is a second value, but is trained to output a processing denial or an authority request.
[0010] The step of generating the above-mentioned training sample may include setting an unstructured judgment file as an input PDF, setting the above-mentioned authority information as information input or provided to a server to verify viewing or decryption authority, generating page-by-page preview images at a lower resolution than the original page when the above-mentioned unstructured judgment file is viewable by the above-mentioned authority information, and connecting the correct answer text, correct answer metadata, or rendering / preprocessing parameter labels to the above-mentioned training sample.
[0011] The step of setting the above authority validity indicator may include verifying whether the authority information is a user-provided password, key handle, organization token, access authority token, or decryption key identifier, and setting the authority validity indicator to a first value if the viewing or decryption authority is confirmed, and to a second value if it is not confirmed.
[0012] The step of training the above access / procedure selection model may include training it to classify any one of an access authority token-based decryption path, a password-based decryption path, an immediate rendering path, a processing denial path, and an authority request path as a processing path, and applying an authority restriction penalty so that if the authority validity indicator is a second value, it is selected as a processing denial path or an authority request path.
[0013] The step of training the above rendering and preprocessing parameter selection policy may include taking a page state as input, which includes at least one of the features of a page-by-page preview image, page tilt, contrast, character density, and noise index, and training to output a parameter combination including at least one of DPI, color space, binarization threshold, tilt correction angle, margin removal range, and noise removal intensity.
[0014] The step of training the above-mentioned rendering and preprocessing parameter selection policy may include applying a plurality of candidate parameter combinations to generate at least one of a rendered image, an OCR result, and a postprocessing result, calculating a quality criterion for each candidate parameter combination that includes at least one of an OCR character error rate, metadata extraction performance, processing time, and image size to generate a rendering and preprocessing parameter label, and training to reduce the difference between the label and the prediction parameter.
[0015] The step of training the above rendering and preprocessing parameter selection policy may include calculating the output quality of the pipeline to which the parameter combination is applied as a reward, and updating the above rendering and preprocessing parameter selection policy so as to increase the reward, which reflects at least one of a reduction in OCR character error rate, an increase in metadata extraction performance, a success or failure of decoding, a reduction in processing time, and a reduction in image size.
[0016] The step of generating the above-mentioned structure restoration input may include generating an OCR token sequence from an OCR intermediate result, generating for each OCR token a layout feature including bounding box coordinates and an additional style feature including at least one of character size, line spacing, and font feature, and the step of training the above-mentioned labeling model may include training the model to predict at least one of segment boundaries, metadata candidate regions, and citation expression regions on a token or line basis using the above-mentioned features.
[0017] The step of training the above labeling model may include training using labeling loss so that the predicted label matches the correct label, and training using inter-label transition consistency to reflect the typical segment transition sequence in which at least some of the case indicator, party indicator, order, reason, and conclusion appear in the judgment.
[0018] The step of training the above restoration model may include training to predict whether adjacent line pairs are combined into the same paragraph based on text representations and geometric difference features, training to restore JSON or XML structural tags from a training corrupted input including at least one of line break deletion, special character loss, and tag omission, imposing structural consistency loss in the event of missing required fields or section order violations, and training using pseudo-labels generated from regular expression, dictionary, or heuristic-based processing results together with confidence weights. Effects of the invention
[0019] According to an embodiment of the present invention, orientation correction, margin removal, duplicate checking, and encryption processing can be performed during the process of converting a PDF of a judgment into a page-by-page image, thereby reducing subsequent OCR errors and reprocessing costs caused by variations in the quality of the input document. Furthermore, by performing corrections for misrecognition of characters, correction of line break errors, batch replacement based on a typo dictionary, correction of XML tag errors, and context-aware line break correction on the OCR results, the header and body structure of the judgment are restored and text consistency is improved, which can increase the reproducibility and stability of metadata extraction.
[0020] Furthermore, by combining the automatic extraction of metadata through over 108 regular expression patterns with service-grade data processing—such as classifying case types and court levels and normalizing merged case numbers—a foundation can be laid for advanced search functions. This includes not only basic searches based on case number, parties, and judgment date, but also filtering based on case type and court level, as well as sorting and aggregation based on standardized codes. Additionally, by generating follow-up precedent data through the analysis of citation relationships and providing case progress through the grouping of upper and lower court history, users can be aided in contextually understanding relevant precedents. Moreover, by automatically assigning reliability flags based on judgment analysis (e.g., indications of original judgments overturned, cancelled, or modified by higher courts, and sequential cautionary notes), converting duplicate registered precedents to non-service status, and managing the provision of only those precedents that satisfy service distribution conditions, the risk of duplicate exposure and misleading information can be reduced, and service reliability can be enhanced.
[0021] The effects according to the embodiments are not limited to those exemplified above, and a wider variety of effects are included in this specification. Brief explanation of the drawing
[0022] FIG. 1 is a schematic diagram illustrating the elements constituting a judgment structuring system according to one embodiment of the present invention. FIG. 2 is a flowchart schematically showing the overall flow of a method for structuring an atypical judgment document according to one embodiment of the present invention. FIG. 3 is a diagram illustrating an AI model according to an embodiment of the present invention. Figure 4 is a flowchart illustrating the detailed steps constituting the decoding and image conversion steps of Figure 2. FIG. 5 is a diagram illustrating an AI model according to an embodiment of the present invention. Figure 6 is a flowchart illustrating the detailed steps constituting the structural restoration and alignment improvement steps of Figure 2. FIG. 7 is a diagram illustrating an AI model according to an embodiment of the present invention. Figure 8 is a flowchart illustrating the detailed steps constituting the classification and normalization steps of Figure 2. FIG. 9 is a block diagram schematically showing the hardware components of a server according to one embodiment of the present invention. Specific details for implementing the invention
[0023] The advantages and features of the present invention and the methods for achieving them will become clear by referring to the embodiments described below in detail together with the accompanying drawings. However, the present invention is not limited to the embodiments disclosed below but may be implemented in various different forms. These embodiments are provided merely to ensure that the disclosure of the present invention is complete and to fully inform those skilled in the art of the scope of the invention, and the present invention is defined only by the scope of the claims.
[0024] Although terms such as "first," "second," etc., are used to describe various components, it goes without saying that these components are not limited by these terms. These terms are used merely to distinguish one component from another. Therefore, it goes without saying that the first component mentioned below may be the second component within the technical scope of the present invention. A singular expression includes a plural expression unless the context clearly indicates otherwise.
[0025] A non-standardized judgment refers to a judgment in which, even though the document type itself—the judgment—is identical, the format, layout, notation, and file structure of the document are not standardized, making it difficult for a computer to reliably extract, classify, or search for the same information in the same location using only certain rules. For example, this includes cases where (i) text-containing PDFs and scanned image-based PDFs are mixed, requiring OCR; (ii) the order of listing, such as case number, parties, order, and reasons, differs from judgment to judgment; (iii) party statuses are listed together, such as "plaintiff (appellant)" and "defendant (appellee)," or where merged or counterclaim case numbers are displayed together; (iv) headers / footers / page numbers / footnotes / tables are mixed with the main text, causing line breaks and fragmented words; or (v) spacing, separators, and date notations vary, such as "date of judgment," "date of judgment," and "judgment May 13, 2021," making it difficult to normalize the same item.
[0026] Hereinafter, embodiments of the present invention will be described in detail with reference to the attached drawings. Identical or similar reference numerals are used for identical components in the drawings.
[0027] FIG. 1 is a schematic diagram illustrating the elements constituting a judgment structuring system according to one embodiment of the present invention.
[0028] Referring to FIG. 1, the judgment structuring system may include a server (10), a database (20), and a user terminal (30), and these may be connected to each other so as to be able to transmit and receive data through a communication network.
[0029] The server (10) is a central entity that performs the functions of structuring judgments and generating metadata by including an AI model (11) as needed or linking the AI model (11) as a separate module.
[0030] The server (10) receives a judgment document (e.g., PDF, image-based PDF, text-containing PDF, etc.) as input and performs processing to convert the judgment document into serviceable structured data. For example, the server (10) may collect judgment documents from a database (20) or receive judgment documents uploaded from a user terminal (30). The server (10) may perform page-by-page image conversion, quality correction (e.g., orientation correction, margin removal), OCR execution, error correction and structure restoration of the OCR result text (e.g., line breaks, paragraph breaks, organization of layout elements such as tables and footnotes), and extraction of various metadata such as case number, parties, representatives, court, and date of judgment on the received judgment document.
[0031] Additionally, the server (10) can classify judgments based on extracted metadata into case types or levels of court, and normalize items with uneven notation into a standard form to generate a data structure suitable for searching and services. The results of such processing can be stored in a database (20) or reflected on a service screen provided to a user terminal (30).
[0032] The AI model (11) is a learning-based component that can be utilized in at least some stages of the processing of the server (10). For example, the AI model (11) can be used for functions such as restoring the structure based on the layout characteristics of the judgment, error correction to improve the consistency of OCR results, or calculating the reliability of metadata extraction. Additionally, the AI model (11) can be used to predict standard codes / standard labels or to select the optimal candidate among multiple candidates during the document classification and normalization process.
[0033] The AI model (11) may be executed by being included within the server (10), or the server (10) may use a model executed on a separate external computing resource by calling it in the form of an API. In this case, the server (10) may reflect the output results of the AI model (11) (e.g., prediction labels, normalization results, confidence scores) in subsequent processing logic and perform correction procedures, such as reprocessing, holding, or requesting user verification, for results below a certain threshold.
[0034] The database (20) is a storage facility that stores original judgment data and / or structured results generated by the server (10). For example, the database (20) may store associated data such as judgment PDF files, page images, OCR text, structured text (e.g., in JSON / XML format), extracted metadata, classification and normalization results, citation relationships, or case history.
[0035] The database (20) may be provided within the same device or network as the server (10), or it may be a remote database existing on an external server. The server (10) can perform tasks such as querying judgment processing targets, checking for duplicates, managing processing status, storing structured results, and updating search indexes in conjunction with the database (20).
[0036] The user terminal (30) is a terminal that serves as the primary user of the judgment search, viewing, and analysis service provided by the server (10). The user terminal (30) may be in various forms, such as a PC, laptop, tablet, or smartphone, and can communicate with the server (10) to perform functions such as requesting the upload of a judgment, transmitting a search query, viewing results, setting sorting and filtering conditions, and checking detailed metadata of a specific judgment. A dedicated program (or application) for providing the server's (10) service may be installed on the user terminal (30), or the service may be provided by accessing a webpage provided by the server (10) through a web browser.
[0037] FIG. 2 is a flowchart schematically showing the overall flow of a method for structuring an atypical judgment document according to one embodiment of the present invention.
[0038] Referring to FIG. 2, the entire processing flow from receiving an unstructured judgment document as input to converting it into structured data suitable for search, analysis, and service provision is illustrated step by step. The method for structuring the unstructured judgment document may include a judgment document file acquisition step (S100), a decoding and image conversion step (S200), a structure restoration and consistency enhancement step (S300), a classification and normalization step (S400), a citation analysis step (S500), and a systematization step into a regular expression pattern set (S600). Each step is performed by the server (10), and the output data between steps (e.g., images, OCR text, structured text, metadata, citation links, pattern sets) operates in a pipeline form that is linked as input to subsequent steps. Some steps may be performed by the server (10) using an AI model (11).
[0039] The judgment file acquisition step (S100) is a step of acquiring a judgment file. The server (10) can obtain the judgment file to be structured through various channels. For example, the server (10) can (i) download a judgment file stored in a database (20) or external storage by querying it, (ii) collect it from an external provider or affiliate server via API / file transfer, and (iii) receive a judgment file uploaded by a user through a user terminal (30).
[0040] Additionally, the server (10) may be configured to periodically check a repository where new judgments are generated and updated in a regular batch manner, and to selectively acquire only documents that have not been previously processed. At this time, the server (10) may generate unique identification information using at least one of a filename, upload time, source identifier, document hash value, case number candidate, etc., for document identification, and may perform a duplicate check to prevent duplicate processing of the same document (re-collection of the same file, re-registration of the same version of the same case, etc.).
[0041] In particular, since there may be differences in versions such as scanned / text versions or public / edited versions even for the same case, the server (10) can be configured to manage by distinguishing between “identity of the original file itself” and “substantial identity of the document content.” That is, even if the file hashes are simply different, if the content similarity is above a threshold, it can be controlled to classify it as a duplicate candidate and withhold reprocessing, or to select a representative version according to priority rules.
[0042] Furthermore, the server (10) can store preliminary check information, such as whether the file is damaged, whether the number of pages is abnormal, or whether encryption is indicated during the acquisition stage, and use it as basic data to determine the processing path of subsequent stages.
[0043] The decryption and image conversion step (S200) is a step that makes the judgment file processable and converts the judgment into page-unit images when the judgment file is encrypted or there are restrictions on page rendering. In this embodiment, the decryption and image conversion step (S200) may be configured to be performed using an AI model (11). The detailed method of applying the AI is specifically explained in the drawings described later.
[0044] The structure restoration and consistency enhancement step (S300) is a step that reduces errors and noise that may occur in the OCR result and restores the paragraph / section structure to improve text consistency. In this embodiment, the structure restoration and consistency enhancement step (S300) may be configured to be performed using an AI model (11). A detailed method of applying AI is described in detail in the drawings that follow.
[0045] The classification and normalization step (S400) is a step of classifying document attributes such as case type, level of appeal, and procedure, and normalizing items with inconsistencies in notation into a standard form. In this embodiment, the classification and normalization step (S400) may be configured to be performed using an AI model (11). A detailed method of applying AI is specifically described in the drawings that follow.
[0046] The citation analysis step (S500) is a step of identifying “reference targets” scattered throughout the body of the judgment and converting them into machine-processable link / relationship data. The server (10) receives the text of the judgment (e.g., text with improved consistency after undergoing the structure restoration and consistency improvement step (S300) and the classification and normalization step (S400)) as input and detects at least one citation or reference expression, such as (i) citation of a statute, (ii) citation of a precedent, (iii) mention of the original / upper court case number related to the progress of the case. In the case of a statute citation, the server (10) can convert it into a reference value in the form of “standard statute identifier + article identifier” by considering the statute name, article (article / paragraph / subparagraph), whether the supplementary provisions apply, variations of abbreviations / full names, and the possibility of typographical errors.
[0047] In addition, since the content of the provisions of a statute may change depending on the time, the server (10) may refer to a reference date, such as the date of pronouncement of the judgment or the date of conclusion of the trial of the factual hearing recorded in the judgment, and assign reference date information to the reference value so as to be linked to a version of the statute valid at that time. This is a measure to increase the accuracy of searching and viewing by distinguishing between cases where the revision and the citation of the same provision are different.
[0048] In one embodiment, in the case of citing a case, the server (10) may specify the subject of the citation by considering variations in the court name notation (e.g., Supreme Court / High Court / District Court, etc.), the date of judgment, the case number, and the method of citing the judgment (e.g., “Supreme Court Judgment 20XX. XX XXXXdaXXXXX”), and may generate a link connected to the specified case record (e.g., a case ID stored in the database (20)). In this case, if the expression of the case citation is incomplete or some elements are missing, the server (10) may be configured to generate multiple candidates and apply a reliability score or priority rule to determine or defer the final link.
[0049] Furthermore, the server (10) can not end the citation relationship with a simple link, but can generate and store a directed graph relationship (follow-up case relationship) indicating “which judgment cited which judgment.” This relationship data can be extended in the future service to functions such as recommending related cases, searching citation networks, and deriving important cases.
[0050] Additionally, the server (10) can use the results of the citation analysis to identify references to the original case number within the judgment document as clues for connecting the upper and lower courts, or to combine them with case history information provided externally to form a history group. Consequently, the citation analysis step (S500) is a step of replacing “reference expressions existing in the text” with “normalized link and relationship data,” which substantially improves search accuracy and context-based viewing quality.
[0051] The regular expression pattern set systematization step (S600) is a step of organizing regular expression patterns used for metadata extraction and verification into a “pattern set” and systematically managing them in order to reliably process expressions that appear repeatedly in the structuring of the judgment. Here, the pattern set is not a set of a single regular expression, but can be viewed as an operational asset that includes (i) a group of patterns by extraction target field (case number, party, agent, court, date of judgment, judge, etc.), (ii) priority and order of application, (iii) conflict resolution rules (selection criteria when multiple matches occur in the same field), (iv) exception handling rules (merged case number, co-labeling of party status, abbreviation / typo, etc.), and (v) criteria for calculating the reliability of the matching result. The server (10) can utilize the judgment text and extraction results accumulated during the processing up to the citation analysis step (S500) to expand the coverage of the pattern set or adjust overfitted patterns. For example, if a notation variation that frequently appears in a specific court form is found, a pattern that encompasses that variation can be added, and conversely, patterns that frequently cause false positives can be updated by strengthening the application conditions or lowering the priority.
[0052] Additionally, the server (10) can be configured to perform version control of the pattern set to track “which version of the pattern was applied to documents of which period” and to evaluate the difference from the existing result when a new pattern is applied. Through this, the quality of the structure can be operationally stabilized, and performance fluctuations can be controlled even in a large-scale document processing environment. Furthermore, the server (10) may include control logic that if the result of applying the pattern set does not meet consistency criteria (existence of required fields, format matching, etc.), it marks the document as a target for reprocessing or branches it to a pending / inspection target in a subsequent stage. Ultimately, the systematization step (S600) with the regular expression pattern set is a step that ensures both reproducibility and maintainability of processing unstructured judgments by managing the regular expression pattern as a “systematized extraction and verification asset” rather than a “one-time rule.”
[0053] The flow of the method for structuring unstructured judgment documents can be understood as a structure in which the processing target is reliably secured in the judgment file acquisition step (S100), the input document is converted, restored, and normalized into a processable form through AI-based processing in the decoding and image conversion step (S200), the structure restoration and consistency enhancement step (S300), and the classification and normalization step (S400); then, value is added by interpreting citation relationships as link / graph data in the citation analysis step (S500); and finally, the quality of the pipeline is continuously stabilized by systematically managing the pattern set that serves as the basis for metadata extraction and verification in the regular expression pattern set systematization step (S600).
[0054] FIG. 3 is a diagram illustrating an AI model according to an embodiment of the present invention. FIG. 4 is a flowchart illustrating detailed steps constituting the decoding and image conversion steps of FIG. 2.
[0055] Referring to FIG. 3, in one embodiment, the “decoding and image conversion” function performed by the AI model (11) is functionally broken down into input-processing-output perspectives.
[0056] In one embodiment, the input value of the AI model (11) is an original judgment file (201) (e.g., a judgment PDF), and the original judgment file (201) may be a text-based PDF or a scanned image-based PDF. Additionally, the original judgment file (201) may be in an encrypted state with restricted viewing and editing rights, and the resolution, rotation, margins, noise, etc. may vary from page to page. The AI model (11) is configured to interpret the attribute information of these input values and generate an output value converted into a form favorable for subsequent OCR and metadata extraction, namely a decrypted image (202) (or page-by-page rendering image).
[0057] The AI model (11) may functionally include an access / procedure selection model (310) and a rendering / preprocessing parameter selection policy (320).
[0058] The access / procedure selection model (310) selects “which processing path to use to view and process the document” based on features such as header / meta information, encryption flags, authorization status, and document structure statistics (number of pages, number of objects, font / image ratio, etc.) of the input judgment PDF. An important premise here is that the AI model (11) of this embodiment is not trained to unlock the password in a manner such as password estimation or bypass, but is constrained to select a decryption path only when legitimate authorization (password provided by the user, institution token, legitimate key handle, etc.) is provided. Therefore, if authorization is not verified, the access / procedure selection model (310) does not perform a decryption attempt and can select a safe output such as processing suspension, administrator request, or refusal.
[0059] The rendering / preprocessing parameter selection policy (320) selects parameters (e.g., DPI, color space, binarization threshold, disquee angle, crop margin, denoise intensity, etc.) to maximize the quality of the page-by-page image conversion result while the document is in a state where it can be decoded or viewed. That is, since OCR performance may vary depending on the scan state or layout of each page even for the same document, the rendering / preprocessing parameter selection policy (320) can output a rendering / preprocessing combination that is “optimal for the corresponding page” by taking the page-by-page state (low-resolution preview features, tilt, contrast, character density, noise index, etc.) as input.
[0060] This output consequently improves the readability and consistency of the decoded image (202) which is the output value, and provides the effect of reducing the OCR error rate and the possibility of metadata mis-extraction in subsequent steps.
[0061] In summary, the AI model (11) receives a judgment PDF as input and combines (i) a function to select a legal access procedure and (ii) a function to optimize image conversion quality to finally generate a decrypted image (202).
[0062] Referring to FIG. 4, in one embodiment, the decoding and image conversion step (S200) may include a decoding capability determination step (S210), a decoding path selection step (S220), and an image conversion parameter optimization step (S230). For example, the decoding and image conversion step (S200) may be configured as a control procedure to create an image output that is advantageous for OCR and subsequent structuring, by selecting a legal and secure processing path considering the document-specific authorization status and document quality, rather than from the perspective of “unconditionally processing the encrypted PDF.”
[0063] First, in the decryption capability determination step (S210), the server (10) determines whether the input judgment PDF is encrypted, and if so, what type of permission restriction (viewing restriction, copying restriction, printing restriction, etc.) it has, and whether permission information for processing the document is provided. This determination can be viewed as a step of calculating the minimum state variables necessary for selecting a subsequent procedure, rather than merely checking "whether it is encrypted." For example, the server (10) can check (i) whether an encryption flag or security-related object exists in the document header, (ii) whether a password / token / key handle provided with the processing request exists, and (iii) whether the provided permission information is in a format applicable to the document.
[0064] In addition, the server (10) can determine the “need for rendering optimization” through page preview or document structure statistics, as there may be cases where the scan quality is low or there is severe page rotation, margins, or noise even if the document is not encrypted. The result of this step can be used as an input to determine in subsequent steps whether to “attempt decryption itself,” “process with which engine / protocol,” and “render with which quality target.”
[0065] In the decryption path selection step (S220), the server (10) selects a specific processing path for decryption or viewing based on the result of the decryption feasibility determination step (S210). At this time, the server (10) may be configured to select one of a plurality of candidate paths according to document attributes and authorization status by utilizing an access / procedure selection model (310). For example, (a) a token-based viewing path when an authorization token is provided, (b) a password-based viewing path when a user-provided password exists, (c) an immediate rendering path when the document is unencrypted, and (d) a processing hold / administrator request / rejection path when authorization is not verified or processing is prohibited by policy may be selected.
[0066] This embodiment may be restricted to selecting a decryption or viewing path only when legitimate authority is verified, rather than automating the “method of unlocking the password.”
[0067] Therefore, the decryption path selection step (S220) functions as a safeguard from a security and compliance perspective, reducing indiscriminate attempts when authority is unclear and lowering the failure and retry costs of the entire pipeline. Additionally, since the decryption path selection step (S220) can be designed to “prioritize the selection of a path with a high probability of success,” it provides the effect of minimizing errors that occur depending on the environment (engine, library, policy), even for the same document.
[0068] Next, in the image conversion parameter optimization step (S230), the server (10) converts the document into page-unit images according to the selected path, and optimizes rendering and preprocessing parameters for each page. This step can be performed by the rendering and preprocessing parameter selection policy (320) of FIG. 3, and the goal of the result is to produce a “decoded image that maximizes OCR and subsequent structuring performance.”
[0069] Specifically, the server (10) may have a set of parameters as candidates for each page, including DPI (resolution), color space (gray / color), whether binarization is applied and threshold, disque (tilt correction) angle, crop margin (whitespace removal), denoise intensity, etc., and select the optimal combination according to the page condition (preview-based features, character density, contrast, noise index, etc.). At this time, the optimal criterion may be a combination of objectives rather than a single metric. For example, it is possible to strike a balance in a way that lowers the OCR character error rate (CER), increases the possibility of extracting key fields such as case number and sentencing date, while not excessively increasing processing time and image capacity. To achieve this, it is possible to configure the policy in the form of reinforcement learning by (i) generating “good parameter labels” through offline search and then training the policy using supervised learning, or (ii) defining the output quality of the renderer-OCR-post-processing pipeline as a reward.
[0070] Additionally, the decoding path selection step (S220) may include a loop that performs re-rendering based on the quality score, rather than ending with a one-time conversion. For example, the server (10) performs OCR on the first rendered image, calculates a quality score Q based on header pattern matching rate, presence of required fields, text length / character density, CER estimate, etc., and if Q is below a threshold, it may select a different combination of parameters to perform re-rendering and re-OCR. This structure has a significant practical effect in absorbing the frequent “page-by-page quality variation” in unstructured judgments, and consequently, can increase the overall structuring success rate by stabilizing the input quality in the subsequent structure restoration and consistency improvement step (S300) and the classification and normalization step (S400).
[0071] Meanwhile, the server (10) may utilize an AI model (11) to perform at least one of the steps of a decoding possibility determination step (S210), a decoding path selection step (S220), and an image conversion parameter optimization step (S230).
[0072] The AI model (11) can be trained to determine whether decryption is possible + select a legitimate decryption path + optimize image conversion parameters. For example, the AI model (11) can be advanced to an AI-based controller that performs the following functions, rather than simply handling the “encrypted PDF processing” as a simple exception (failure / retry). For example, the AI model (11) can include a function that receives the encryption / authorization status as input and selects a legitimate decryption procedure (e.g., user password / owner password / institution key / token-based viewing depending on the provided key type), a function that maximizes OCR and subsequent metadata extraction performance by selecting rendering / preprocessing parameters (DPI, color space, binarization, diskue, crop, etc.) for each page after successful decryption, and a function that scores the result quality and performs a re-rendering loop if necessary (simultaneously optimizing success rate / accuracy / processing time / capacity).
[0073] In one example, the training samples of the AI model (11) are defined as follows.
[0074] - Input PDF:
[0075] - Permission information (legitimately provided values only): (e.g., password, key handle, token)
[0076] - Page-by-page low-resolution preview (only upon successful decryption):
[0077] - Answer Text / Answer Metadata:
[0078] - "Optimal" rendering parameter label (generated via offline exploration):
[0079] - Permission Validation Indicator:
[0080]
[0081] AI model (11) It can be designed to output a process interruption / request / isolation without being trained to “estimate the key”.
[0082] Access and procedure selection model (310) is the input feature vector Create, and the procedure (workflow result) Classify / select. Here is a parameter regarding PDF header features (encryption flag, number of objects, font / image ratio, number of pages, etc.) + (if available) low-resolution preview features, and ∈ {decrypt_with_token, decrypt_with_pw, reject, manual_request} may be an index of an optional procedure (class).
[0083] In one embodiment, a classification loss function ( ) is equal to Equation 1, the authority constraint function is equal to Equation 2, and these are the penalty term of the objective function( It can be inserted into )(mathematical formula 3).
[0084] [Mathematical Formula 1]
[0085]
[0086] [Mathematical Formula 2]
[0087]
[0088] [Mathematical Formula 3]
[0089]
[0090] is the input feature vector Receives and outputs the probability or score of "which procedure / path to process". is an index of selectable procedures (classes). is a value representing the correct answer label. It can be viewed as a one-hot label where 1 is the correct answer procedure for the i-th document if it is c, and 0 is the correct answer procedure otherwise. is an indicator function. It returns 1 if the condition inside the square brackets is true, and 0 if it is false.
[0091] Rendering and preprocessing parameter selection policy (320) (Learning parameters (weight set)) is page Action about Select . For example, ={dpi, colorspace, binarize_thr, deskew_angle, crop_margin, denoise_level} can be
[0092] - dpi: Rendering resolution
[0093] - colorspace: color space (gray / color, etc.)
[0094] - binarize_thr: binarization threshold
[0095] - deskew_angle: tilt correction angle
[0096] - crop_margin: margin removal range
[0097] - denoise_level: noise reduction strength
[0098] Supervised learning (labels Regression loss function in (when there is) ) is equal to Equation 4, and the objective of the reinforcement learning objective function (Equation 5), which is suitable as it includes a non-differential renderer, OCR, and post-processing pipeline, is to maximize the expected reward.
[0099] [Mathematical Formula 4]
[0100]
[0101] [Mathematical Formula 5]
[0102]
[0103] is a parameter (action) predicted by the policy or regression model, and is the "optimal" parameter label obtained from offline exploration or ground truth data. is the regression loss in supervised learning, and prediction A is the correct answer. It can be trained to be close to.
[0104] The policy gradient is given by Equation 6, where b is the baseline for reducing variance.
[0105] [Mathematical Formula 6]
[0106]
[0107] is policy is the expected reward obtained, and it learns to maximize it. Is It is the gradient for and indicates the direction in which the parameters will be updated during training. The policy is action It is the log probability of choosing.
[0108] The purpose of rendering is a multi-purpose optimization of "improving OCR / metadata performance, minimizing time and capacity, and minimizing failures." The compensation function (R) can be set as in the following Equation 7.
[0109] [Mathematical Formula 7]
[0110]
[0111] The parameter used in mathematical formula 7 is "OCR Character Error Rate (CER): ", "Extract metadata F1: (Based on key fields such as case number / parties / date of judgment, etc.)", processing time , total image size , authorization / decryption success indicator (Opened with a valid key = 1, otherwise 0). α, β, γ, δ, ε are the weights (hyperparameters) of the reward function.
[0112] For supervised learning The process of creating a set of candidate parameters for each page You can create and design it as in mathematical formula 8.
[0113] [Mathematical Formula 8]
[0114]
[0115] Candidate set Among them, the quality function You can select action a that maximizes .
[0116] In mathematical formula 8 am.
[0117] At this time It can be composed of discrete grids or Bayesian optimizations such as "DPI candidate, binarization threshold candidate, crop candidate...".
[0118] In other words, the AI model (11) defines encryption flags, PDF structure statistics, page preview embeddings, quality indicators (noise / slope), etc. as input features, and (i) the result of selecting a legitimate decryption procedure , (ii) page-specific rendering parameters can be defined as the output. The AI model (11) includes legality constraints, and If so, decryption attempts are prohibited and only "Request / Reject" can be output.
[0119] In addition, the learning objective function can be designed as shown in Equation 9.
[0120] [Mathematical Formula 9]
[0121]
[0122] is a weight (hyperparameter) that controls the weight of each term. Here is the weight of the parameter regression (or policy learning) term, It adjusts the weight of authority restriction penalty protests.
[0123] Compensation / evaluation metrics may include CER, metadata F1, time, capacity, success rate, etc., and a reprocessing loop, such as re-selecting parameters and re-rendering, may be performed if the quality score falls below a threshold.
[0124] FIG. 5 is a diagram illustrating an AI model according to an embodiment of the present invention. FIG. 6 is a flowchart illustrating detailed steps constituting the structure restoration and consistency improvement steps of FIG. 2.
[0125] Referring to FIG. 5, the input value of the AI model (11) is a decoded image (202), which corresponds to a judgment image that has been rendered and preprocessed on a page-by-page basis through the preceding decoding and image conversion step (S200). Even if the decoded image (202) is the same “judgment,” layout elements such as resolution, tilt, margins, print quality, watermarks, headers / footers, page numbers, and the insertion of tables and shapes may differ from page to page. Such deviations may lead to line break breakdown, paragraph merging / splitting errors, section boundary errors, and missing tags during the OCR and metadata extraction process. Accordingly, the AI model (11) of this embodiment is configured to interpret the character and layout signals included in the input value (202) and to generate a restored judgment (203) as an output value in a form that can be utilized in subsequent steps (e.g., classification and normalization, citation analysis).
[0126] In one embodiment, the AI model (11) may further include a functionally labeling model (330) and a restoration model (340).
[0127] First, the labeling model (330) receives the decoded image (202) or the OCR intermediate result (token, line, bounding box, etc.) generated therefrom as input and labels the text fragments constituting the judgment as “which semantic unit they belong to.” For example, the labeling model (330) can predict the reading order within the page, line-by-line sections, section boundaries (e.g., case indicator, party indicator, order, reason, etc.), metadata candidate areas (case number / date of judgment / court name / trial division / judge / party, etc.), and citation expression areas (areas where statutes / precedents can be cited). This labeling can go beyond mere “character recognition” and provide a reference point for restoring the structure of the document.
[0128] That is, the output of the labeling model (330) becomes a control signal used by the restoration model (340) to restore line breaks and paragraph boundaries, separate non-body elements such as headers / footers and page numbers, and stably establish the hierarchical structure of the document.
[0129] The restoration model (340) combines the labeling result of the labeling model (330) with the OCR text to reconstruct the body of the judgment into a “human-readable form” and at the same time a “machine-structured processing form.” Specifically, the restoration model (340) can determine whether lines are combined to restore broken line breaks, split excessively merged paragraphs, or conversely merge incorrectly segmented sentences. Additionally, the restoration model (340) can organize the text by section to generate structured representations (e.g., structural tags such as JSON or XML) for each section, or correct missing or erroneous tags.
[0130] As a result, the restored judgment (203), which is the output value, is in a form with improved consistency, unlike a simple OCR result string, in which section boundaries, paragraph boundaries, reading order, and metadata candidate areas are organized.
[0131] The AI model (11) can take the decrypted image (202) as input, identify document components in the labeling model (330), and recover line breaks / paragraphs / tags in the recovery model (340) to output the recovered judgment (203).
[0132] Meanwhile, the AI model (11) can be trained to restore structure and improve consistency. The strength of the OCR result is that it includes not only "strings" but also layout signals such as page / line / token unit location information (bounding boxes), character size, line spacing, and font characteristics. Therefore, the input for training is set as follows.
[0133] - Token sequence on page j of document d:
[0134] - Layout characteristics of each token and additional style features
[0135] The output of the AI model (11) is a structured representation (e.g., JSON / XML) that satisfies (i) structural tags / section boundaries, (ii) line breaks / paragraph merging / splitting, and (iii) field-value consistency constraints.
[0136] The learning task of the AI model (11) may include section division + token / line labeling. A judgment typically has sections such as “case / parties / order / reason / conclusion,” and the fields differ for each section. This is labeled as token or line-level, and a layout-aware encoder (e.g., layout-aware Transformer) is used to create a hidden representation Makes
[0137] Label parameters (e.g., header, case number, parties, order, reason, statute citation, precedent citation, etc.), prediction parameters It can be defined as.
[0138] The labeling loss can be fixed as cross-entropy (Equation 10).
[0139] [Mathematical Formula 10]
[0140]
[0141] labeling loss is a loss function that makes the token / line label prediction match the correct label.
[0142] To more strongly reflect transitions between labels (e.g., typical flows such as "case number → party → order"), a CRF can be added and defined in the form of Equation 11 to include "interval transition consistency" itself in the learning objectives.
[0143] [Mathematical Formula 11]
[0144]
[0145] Another learning task of the AI model (11) is line break / paragraph merging / split restoration (Adjacency Decision). The most practically fatal errors in OCR are "broken line breaks" and "paragraphs merged / split." This refers to adjacent lines The connection status between them is treated as a binary classification.
[0146] - Adjacent line representation
[0147]
[0148] - Combined Answer (If 1, combine into the same paragraph)
[0149]
[0150] Merger and split losses here Predict whether adjacent lines are combined A is the correct answer. It is a binary cross-entropy loss that makes it approach. is a layout-based signal such as y-spacing between lines, left alignment difference, and indentation change amount.
[0151] Another learning task of the AI model (11) may be structure tag (JSON / XML) restoration (Seq2Seq Denoising). Tag restoration can be viewed as the problem of "rewriting text into structured sentences." Damaged input Create (remove line breaks, lose special characters, omit tags, etc.), and the model creates the answer structure It can be trained to output (Equation 12).
[0152] [Mathematical Formula 12]
[0153]
[0154] Tag restoration loss is the correct answer structure It is a sequence generation loss (negative log-likelihood) that generates with a high probability.
[0155] At this time Generation can be created using rules to massively augment training data. For example, methods such as removing line breaks with "probability p", removing parentheses / quotation marks with "probability q", and replacing delimiters (':', '-') with "probability r".
[0156] The key to structural restoration may be "consistency" rather than "correct form." For example, violating constraints such as case number format, date format, the existence of 'plaintiff / defendant' pairs, or the order of the order-reason section causes subsequent steps to collapse. These are fixed as penalty clauses.
[0157] Example: Set of required fields Predicted field extraction function for (case number, court, sentencing date, etc.) Consistency violations can be set as a cost as in mathematical formula 13.
[0158] [Mathematical Formula 13]
[0159]
[0160] extraction function is a prediction structure In the field It is a function that extracts the value of. Empty set symbol means that the corresponding field value does not exist.
[0161] The output of existing pipelines (regular expressions / dictionaries / heuristics) is not perfect, but it can be useful as an "initial label." This is confidence weight Learning can be achieved with a weak-weak map loss (Equation 14).
[0162] [Mathematical Formula 14]
[0163]
[0164] Loss of the ring map is the loss term that trains the model using pseudo-labels generated as rule-based results. Pseudo-labels is a temporary ground truth label generated by a rule / regular expression / heuristic-based system. Predicted label is the label prediction result produced by the model. Confidence weight is a doctor's label It is a value expressing the reliability in the range of 0 to 1. Reliability function reliability weights based on matching strength, collision status, etc. It is a function that produces .
[0165] Here, conf can be calculated based on regular expression matching strength, duplicate match rate, rule conflicts, etc.
[0166] If the above tasks are grouped into a multitask and defined as the total loss as shown below, it can be expressed as Equation 15.
[0167] [Mathematical Formula 15]
[0168]
[0169] (λ i is the weight.)
[0170] FIG. 7 is a diagram illustrating an AI model according to an embodiment of the present invention. FIG. 8 is a flowchart illustrating detailed steps constituting the classification and normalization steps of FIG. 2.
[0171] Referring to FIG. 7, the input value of the AI model (11) is a restored judgment (203), which means a document representation in which section boundaries, line breaks / paragraph boundaries, structure tags (JSON / XML), etc., have been restored to a certain level through the preceding structure restoration and consistency enhancement step (S300). That is, the input value is not a simple OCR original text string, but is data in a state of improved consistency in which the semantic units and document structure within the judgment are organized so that subsequent inference is possible.
[0172] The AI model (11) may functionally further include a classification model (350) and a normalization model (360). The classification model (350) predicts case-related attributes based on text, structural tags, content by section, and document context included in the restored judgment (203). For example, the classification model (350) may be configured to produce categorical metadata that is directly used for searching and filtering, such as case type (civil / criminal / administrative, etc.), procedure type (appeal / retrial / reconsideration, etc.), level of court (first / second / third instance), document type (judgment / decision / order), and result type (citation / rejection / remand, etc.). Additionally, since judgments often have multiple attributes simultaneously within a single document, the classification model (350) may adopt not only single-label classification but also multi-label classification or a hierarchical classification structure.
[0173] The normalization model (360) maps the fluctuations in notations (mentions) extracted from the category predicted by the classification model (350) or the restored judgment (203) to standard codes / standard entities. For example, it is possible to normalize various notations such as “Seoul Central District Court,” “Seoul Central District Court,” and “Seoul Central” into a single standard court code, normalize statute names and article notations (e.g., “Article 750 of the Civil Act,” “Civil Act 750”) into standard statute / article entities, or correct and normalize the case number, court division, and judgment date formats into a standard format. In this case, the normalization model (360) can be implemented from an entity linking perspective that goes beyond simple rule substitution and considers context and structural information together to reduce conflicts between homonyms / homonyms and selects the optimal candidate from the standard set.
[0174] The output value metadata (204) is structured data that combines the above classification and normalization results. The metadata (204) may include case attribute labels (e.g., case type, level of court, procedure), standard codes (e.g., court code, case type code), standard strings (e.g., standard name of statute), reliability scores for each item, creation time and version, and quality control information such as “pending / unknown” flags if necessary. Additionally, the metadata (204) can be used as a reference axis for document clustering, citation pattern comparison, and template derivation in the subsequent citation analysis step (S500) and the systematization step (S600) with a regular expression pattern set.
[0175] Referring to FIG. 8, the normalization step (S400) may include a multi-label classification step (S270), a mapping step to standard codes / standard entities (S280), and a combined learning step of classification and normalization (S290).
[0176] In the multi-label classification step (S270), the server (10) predicts category information of the case and document using the restored judgment (203) as input. Since the restored judgment (203) may include consistency information such as section division information, paragraph boundaries, and structural tags (JSON / XML), the server (10) utilizes this structural information to construct the classification input. For example, it is possible to encode text for each section, such as the case display section, party display section, order, and reason, and to construct a document representation that integrates the importance of each section.
[0177] In reality, since multiple attributes are often assigned to a single document simultaneously, the server (10) can simultaneously generate event types, levels of appeal, procedures, document types, result types, etc., in the form of multiple labels. Additionally, since event types often have a hierarchical structure such as major classification, medium classification, and detailed classification, the server (10) can generate predicted values in a hierarchical classification by placing a header for each hierarchy. At this time, considering that misclassification is likely to occur due to class imbalance (bias in some event type data), the server (10) can be configured to strengthen the learning contribution of sparse classes by adjusting the loss function or sample weights.
[0178] Furthermore, for items with high misclassification costs (e.g., court code, procedure type), the system can be designed to output “Pending / Unknown” using a predicted probability distribution or uncertainty score.
[0179] Next, in the mapping step (S280) to standard codes / standard entities, the server (10) normalizes the notation variations (mentions) observed in the prediction results of the classification step and the restored judgment (203) into a standard set. The subjects of normalization can be extended to include court names, judicial divisions, case type codes, order result expressions, statute names / articles, party statuses, and cited precedent / statute identifiers. Normalization can be modeled not as a simple string substitution, but as an entity linking problem that selects the most consistent standard candidate by considering context and structure.
[0180] For example, the notation “Seoul Central District Court” can be more reliably selected as a standard court code when considered together with the case number format of the document, the jurisdictional proviso, and other expressions in the header at the top of the document. The server (10) can generate candidates by referring to a standard candidate set (e.g., court code table, standard statute dictionary, result code dictionary) and determine the final standard entity by calculating a similarity score or re-ranking score between the candidates. In cases where the candidate pool is very large, a two-stage configuration is possible in which the top k candidates are narrowed down first using a rule / dictionary / approximate search, and then accuracy is increased by re-ranking using a context-combining model.
[0181] In addition, for items with insufficient label data (e.g., rare court notations, rare statute aliases), it is possible to configure the model to lower training costs by utilizing rule-based mapping results as pseudo-labels and applying weak map normalization with confidence weights.
[0182] In the combined learning step (S290) of classification and normalization, the server (10) combines the learning so that the classification model (350) and the normalization model (360) share document representations and produce mutually consistent results. Specifically, the server (10) places the classification head and the normalization head respectively on a shared encoder (which converts text and structural information of the restored judgment (203) into an integrated representation) and can learn by combining the classification loss and the normalization loss as a weighted sum. At this time, the combined learning can be designed to go beyond simple simultaneous learning, such that the classification result acts as a prior for the normalization candidate group, or the normalization result acts as a post-processing constraint for the classification label.
[0183] For example, if the classification result is strongly predicted to be “administrative,” the candidate selection can be stabilized during the normalization stage by assigning weights to standard candidates that frequently appear in administrative courts / administrative cases. Conversely, if the normalization result is confirmed to be “Supreme Court,” mutual consistency can be strengthened by increasing the likelihood of a third trial in the classification of court levels.
[0184] Additionally, in the combined learning step (S290), the server (10) can be configured to learn uncertainty-based hold together so that predictions with low confidence are not forcibly confirmed but are left in a hold state or passed on to a subsequent verification step. This can reduce the propagation of misclassification in a structure where classification and normalization are directly combined with the search index.
[0185] The metadata (204) generated through the flow of the normalization step (S400) is not a simple list of labels, but a structured result consistently expressed based on standard codes / standard entities. As a result, the problem of missing searches due to inconsistencies in notation, even for the same case type or court, can be reduced, and the comparison of statistical, analysis, and citation patterns at the case group level can be stabilized. In addition, since classification and normalization are jointly optimized by sharing the same document representation through the combined learning step (S290), the effect of reducing the disconnect where only the classification is correct but the normalization is inconsistent, or only the normalization is correct but the classification is inconsistent, is expected.
[0186] Meanwhile, the AI model (11) can be trained to predict categories such as case type / level / procedure / court code (classification learning) and map notation shake to standard code / standard string (normalization learning).
[0187] Explains classification learning.
[0188] Input document representation Set as such, event types generally have a hierarchical structure (major category-medium category-detailed category). This is learned using head-by-head cross-entropy.
[0189] Major categories , medium category Regarding classification loss It can be expressed as in mathematical equation 16. Answer label is the correct class at the l-th classification layer.
[0190] [Mathematical Formula 16]
[0191]
[0192] If class imbalance is severe, switching to Focal Loss (Equation 17) often improves practical performance.
[0193] [Mathematical Formula 17]
[0194]
[0195] Focal Loss is the predicted probability for the correct class in sample i. is a hyperparameter that controls the contribution of easy samples to be lowered and the focus to be on difficult samples.
[0196] In addition, if the prediction is uncertain, an energy-based score (Equation 18) can be used to generate "Pending / Unknown".
[0197] [Mathematical Formula 18]
[0198]
[0199] Logit is the model's denormalization score indicating that the input belongs to class c. Hold threshold is a threshold value for determining whether to withhold predictions based on energy.
[0200] Explains normalization learning.
[0201] Normalization is the standard set of “representations m”. This is a problem of connecting to one of the following. For example, standardization is required for court names, party statuses, ruling outcomes (acceptance / rejection / remand, etc.), and statute names. A bi-encoder method can be used.
[0202] Mention embeddings , candidate standard entity embeddings , similarity If so, the correct answer For this, an InfoNCE (contrastive learning) loss can be applied (Equation 19).
[0203] [Mathematical Formula 19]
[0204]
[0205] If labels are insufficient, weakly supervised contrast learning can be performed by making “repeated notations within the same document” or “rule-based mapping results” into positive pairs and other entities into negative pairs (Equation 20). In this case, confidence weights w can also be applied.
[0206] [Mathematical Formula 20]
[0207]
[0208] Depending on the size of the candidate pool, it can be split into two stages. In the first stage, the top k candidates are generated using rule / dictionary / approximate search, and in the second stage, re-ranking is performed using cross-encoder. Re-ranking can be defined by the margin ranking loss (Equation 21).
[0209] [Mathematical Formula 21]
[0210]
[0211] Even if classification accuracy is good, service quality deteriorates if normalization is unstable, and conversely, even if normalization is done well, search / filtering breaks down if the event type is incorrect. Therefore, a shared encoder can be used and combined as in Equation 22.
[0212] [Mathematical Formula 22]
[0213]
[0214] Here It can be designed as a term that provides a coverage-risk trade-off allowing "hold" for fields with high misclassification costs (e.g., a method that penalizes not forcing predictions on uncertain samples).
[0215] According to the embodiment, a "feedback loop in which restoration quality improves classification / normalization performance" can be designed. For example, if the consistency score Q (Equation 23) calculated after structure restoration is below a threshold, re-restoration can be performed, and classification / normalization can be performed only when re-restoration is successful.
[0216] [Mathematical Formula 23]
[0217]
[0218] Header Matching It is an indicator showing how well header patterns, such as case numbers and court names, match within a document. Field satisfaction It is an indicator representing the percentage of required fields that exist or formats that are satisfied. Estimated character error rate is a character error rate indicator that estimates the level of OCR errors without correct answers.
[0219] FIG. 9 is a block diagram schematically showing the hardware components of a server according to one embodiment of the present invention.
[0220] Referring to FIG. 9, the server (10) may be configured to include a processor (110) for controlling overall operations, a memory (120) for temporarily storing program and work data, a transmission / reception device (130) for transmitting and receiving data with the outside, an input interface device (140) for receiving input from a user or an external system, an output interface device (150) for displaying and transmitting processing results, a storage device (160) for storing judgment files and learning / inference results, etc., and a bus (170) for transmitting data / control signals between these components.
[0221] The processor (110) executes instructions stored in memory (120) and storage device (160) to perform a series of processes such as obtaining a judgment file, decoding and image conversion, restoring structure and improving consistency, classification and normalization, citation analysis, and systematizing a regular expression pattern set. The memory (120) includes, for example, ROM and RAM, where boot / basic routines or core control codes are stored in the ROM, and intermediate outputs generated during the judgment processing (e.g., page images, OCR results, labeling results, structure tags, etc.) and work buffers required for inference are loaded in the RAM. The storage device (160) can be used as an area to non-volatilely store the original judgment (PDF), restored judgment, metadata, index, regular expression pattern set, model parameters, and logs.
[0222] The transmitting and receiving device (130) communicates with an external database or external server via a network to receive a judgment file or transmit processing results (e.g., restored judgment, metadata, citation analysis results) to the outside. The input interface device (140) can be used as a path to receive upload requests, search conditions, processing options, permission information, etc. from a user terminal, and the output interface device (150) can be used as a path to provide results in the form of a web / app screen, file download, API response, etc. The bus (170) is an internal transmission path that performs data movement and control signal transmission between the processor (110), memory (120), transmitting and receiving device (130), input interface device (140), output interface device (150), and storage device (160).
[0223] In addition, the AI model (11) in FIG. 9 can be implemented as a software module running within the server (10) and, if necessary, can be configured to be combined with dedicated computing resources (e.g., GPU, NPU, etc.) to improve inference speed and throughput. That is, the server (10) functions as the entity that structures unstructured judgments and generates standardized metadata and highly consistent document representations by running the AI model (11) based on hardware resources (110 to 170).
[0224] Although embodiments according to the technical concept of the present invention have been described above with reference to the attached drawings, those skilled in the art will understand that the present invention may be implemented in other specific forms without changing its technical concept or essential features. The embodiments described above should be understood as illustrative in all respects and not restrictive. Explanation of the symbols
[0225] 10: Server 11: AI Model 20: Database 30: User terminal
Claims
Claim 1 A method for training an AI model for structuring unstructured judgment documents performed by a server, comprising: generating a training sample including an unstructured judgment document file and an authority validity indicator corresponding to said unstructured judgment document file, optionally further including at least one of authority information provided to verify the viewing or decryption authority of said unstructured judgment document file, a page-by-page preview image generated at a lower resolution than the original page, correct text, correct metadata, and a rendering / preprocessing parameter label; setting said authority validity indicator to indicate whether the viewing or decryption authority for said unstructured judgment document file is verified based on said authority information; generating an input feature vector using at least one of the PDF header feature, encryption flag, number of objects, font / image ratio, number of pages, and the feature of said page-by-page preview image of said unstructured judgment document file; training an access / procedure selection model that selects a processing path of said unstructured judgment document file based on said input feature vector and said authority validity indicator; and a rendering / preprocessing parameter selection policy that selects a page-by-page rendering / preprocessing parameter combination based on the page state of said unstructured judgment document file and said rendering / preprocessing parameter label. A step of training; a step of generating a decoded image or a page-unit rendered image as an intermediate output for training according to the combination of rendering and preprocessing parameters; a step of generating a structure reconstruction input including at least one of a token sequence, a layout feature of a token, and an additional style feature from the OCR intermediate result for the decoded image or the page-unit rendered image; and a step of training a labeling model that predicts a token or line-unit segment label based on the structure reconstruction input.A method for training an AI model for structuring unstructured judgment documents, comprising the step of training a restoration model that restores at least one of line breaks, paragraphs, structural tags, and field-value consistency based on the prediction result of the labeling model, wherein the authorization information includes at least one of a user-provided password, a key handle, an institution token, an access authorization token, and a decryption key identifier, wherein the authorization validity indicator is set to a first value when the viewing or decryption authorization is confirmed and is set to a second value when the viewing or decryption authorization is not confirmed, and wherein the access / procedure selection model is not trained to estimate a decryption key or an access authorization token for a training sample in which the authorization validity indicator is the second value, but is trained to output a processing refusal or an authorization request, and wherein the AI model includes at least one of the access / procedure selection model, the rendering / preprocessing parameter selection policy, the labeling model, and the restoration model. Claim 2 A method for training an AI model for structuring an unstructured judgment, wherein, in claim 1, the step of generating the training sample comprises: setting the unstructured judgment file as an input PDF; setting the authorization information as information input or provided to a server to verify the access or decryption authority of the unstructured judgment file; generating a page-by-page preview image with a lower resolution than the original page when the unstructured judgment file is accessible by the authorization information; and connecting the correct answer text, correct answer metadata, or rendering / preprocessing parameter labels corresponding to the unstructured judgment file to the training sample. Claim 3 A method for training an AI model for structuring an unstructured judgment, wherein, in claim 1, the step of setting the authority validity indicator comprises: a step of verifying whether the authority information is a user-provided password, key handle, institution token, access authority token, or decryption key identifier corresponding to the unstructured judgment file; a step of setting the authority validity indicator to the first value if the authority to view or decrypt the unstructured judgment file is confirmed as a result of the verification step; and a step of setting the authority validity indicator to the second value if the authority to view or decrypt the unstructured judgment file is not confirmed as a result of the verification step. Claim 4 A method for training an AI model for structuring unstructured judgments according to claim 1, wherein the step of training the access / procedure selection model comprises: training the access / procedure selection model to classify any one of an access authority token-based decryption path, a password-based decryption path, an immediate rendering path, a processing refusal path, and an authority request path as the processing path using the input feature vector; and, when the authority validity indicator is the second value, applying an authority constraint penalty so that the processing path is selected as the processing refusal path or the authority request path. Claim 5 A method for training an AI model for structuring an unstructured judgment, wherein, in claim 1, the step of training a rendering / preprocessing parameter selection policy includes taking a page state as input and training the rendering / preprocessing parameter selection policy to output a combination of rendering / preprocessing parameters including at least one of DPI, color space, binarization threshold, tilt correction angle, margin removal range, and noise removal intensity, and the page state includes at least one of the features of the page-specific preview image, page tilt, contrast, character density, and noise index. Claim 6 In claim 5, the step of training the rendering / preprocessing parameter selection policy comprises: a step of applying a plurality of candidate parameter combinations to a page of the unstructured judgment file to generate at least one of a rendering image, an OCR result, and a post-processing result; a step of calculating a quality standard for each candidate parameter combination, including at least one of an OCR character error rate, metadata extraction performance, processing time, and image capacity; a step of generating the rendering / preprocessing parameter label based on the quality standard; and a step of training the rendering / preprocessing parameter selection policy so as to reduce the difference between the rendering / preprocessing parameter label and the prediction parameter of the rendering / preprocessing parameter selection policy, thereby providing an AI model training method for structuring unstructured judgments. Claim 7 A method for training an AI model for structuring unstructured judgments according to claim 5, wherein the step of training the rendering / preprocessing parameter selection policy comprises: a step of calculating the output quality of a renderer, OCR, and post-processing pipeline to which the combination of the rendering / preprocessing parameters is applied as a reward; and a step of updating the rendering / preprocessing parameter selection policy so as to increase the reward, wherein the reward reflects at least one of a reduction in the OCR character error rate, an increase in metadata extraction performance, whether decoding is successful based on the authority validity indicator of the first value, a reduction in processing time, and a reduction in image capacity. Claim 8 A method for training an AI model for structuring unstructured judgments according to claim 1, wherein the step of generating the structure restoration input comprises: generating an OCR token sequence from the OCR intermediate result; generating a layout feature including bounding box coordinates for each OCR token; and generating an additional style feature including at least one of character size, line spacing, and font feature for each OCR token, wherein the OCR intermediate result includes at least one of text generated by OCR, an OCR token, a line, a bounding box, and character recognition confidence, and the step of training the labeling model comprises training the labeling model to predict at least one of segment boundaries, metadata candidate regions, and citation expression regions on a token or line basis using at least one of the OCR token sequence, the layout feature, and the additional style feature. Claim 9 A method for training an AI model for structuring an unstructured judgment, wherein, in claim 8, the step of training the labeling model comprises: a step of training the labeling model using labeling loss such that the predicted label of the token or line unit matches the correct label; and a step of training the labeling model using inter-label transition consistency to reflect a typical segment transition sequence in which at least some of the case indicator, party indicator, order, reason, and conclusion appear in the judgment. Claim 10 A method for training an AI model for structuring unstructured judgments according to claim 1, wherein the step of training the restoration model comprises: training the restoration model to predict whether the adjacent line pairs will be combined into the same paragraph based on text representations and geometric difference features of the adjacent line pairs; training the restoration model to restore JSON or XML structure tags from a training corrupted input generated from the original structured text to include at least one of line break deletion, special character loss, and tag omission; assigning a structural consistency loss when a required field is omitted or a section order violation occurs in the predicted structure tag result; and training the restoration model using pseudo-labels generated from a regular expression, dictionary, or heuristic-based processing result together with confidence weights, wherein the field-value consistency includes consistency regarding at least one of the existence, format, and section order between at least one required field among case number, court name, and judgment date and an extracted value corresponding to the required field.
Citation Information
Patent Citations
Method and server for automatic document processing for privacy protection based on artificial intelligence
KR1020220121223A
Digital content system supporting document management using meta data and integrated search based on artificial intelligent
KR102540944B1
System for providing legal technology based case searching service
KR102785954B1
System and method for digital archival document extraction service using machine learning-based OCR and automatic labeling technology
KR102888843B1
