Method for generating legal documents based on legal data and context and system using the same

The legal document generation system addresses inefficiencies in legal drafting by analyzing case information and user requests to generate structured documents with verified legal grounds and citations, enhancing productivity and quality.

KR103047107B1Active Publication Date: 2026-11-11LAW COMPANY
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
KR1020260090685
Authority / Receiving Office
KR · KR
Patent Type
Patents
Current Assignee / Owner
Filing Date
2026-05-19
Publication Date
2026-11-11
Estimated Expiration
2046-05-19

AI Technical Summary

Technical Problem

Existing legal document drafting systems require significant time and expertise, struggle to reflect case-specific context, document-type structure, and accuracy of legal information, leading to issues like inaccurate grounds and unclear citations, and repetitive tasks for legal professionals.

Method used

A legal document generation method and system that analyzes case information and user requests to identify document type and purpose, generates structured legal documents using a large-scale language model, and verifies legal grounds and citations, reducing repetitive tasks and improving productivity.

Benefits of technology

Enhances efficiency and quality of legal document drafting by reducing time and effort, ensuring accurate legal information integration, and minimizing inaccurate citations, thereby improving productivity and consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 112026060753676-PAT00334_ABST
    Figure 112026060753676-PAT00334_ABST
Patent Text Reader

Abstract

A method for generating a legal document based on legal data and context according to one embodiment comprises, in a method for generating a legal document based on legal data and context performed by a server, a step of receiving input information including at least one of a document type, case overview, factual relationship, and argument direction of a legal document to be created from a user terminal; a step of generating case context information including case information and document information by analyzing the input information; a step of searching for reference materials to be used for generating the legal document from a database in which legal data is stored based on the case context information; a step of generating an overall structure of the legal document based on the case context information and the reference materials; a step of generating a prompt to be input into a large-scale language model based on the overall structure of the legal document and the reference materials; a step of obtaining a draft document from the large-scale language model using the prompt; a step of generating or editing the legal document using the draft document; and a step of generating a verified legal document by verifying the correspondence between the legal grounds, citation information, and the reference materials included in the legal document.
Need to check novelty before this filing date? Find Prior Art

Description

Technology Field

[0001] The present invention relates to a method for generating legal documents based on legal data and context, and a system utilizing the same. More specifically, it relates to a legal artificial intelligence-based document processing technology that processes information necessary for drafting legal documents based on case information input by a user, the type of document to be drafted, and the purpose of drafting, and supports the generation or editing of the structure and content of legal documents. Background Technology

[0002] In legal practice, various types of legal documents are drafted, including complaints, preparatory briefs, opinions, contract reviews, and legal review reports. These legal documents are not merely the result of writing sentences; rather, they are specialized documents that combine the facts of a case, the claims of the parties, applicable laws, relevant precedents, evidence, and legal judgments according to a specific logical structure. Therefore, drafting legal documents requires a process of reviewing case records, identifying key issues, researching relevant laws and precedents, and organizing the researched content into a format suitable for the purpose of drafting.

[0003] Traditionally, legal professionals performed most of the document drafting manually. For example, after receiving a case overview from a client or internal member, a legal professional would review relevant materials, organize the issues, and investigate necessary legal information using statute and precedent search systems. Subsequently, based on the investigation results, the legal professional would design the table of contents and logical flow of the document, and draft a new legal document by directly writing sentences suitable for each item or modifying parts of existing documents.

[0004] However, the process of drafting legal documents requires a significant amount of time and expertise. When the volume of case records is large or the issues are complex, substantial time is spent on organizing the facts, researching legal information, and designing the document structure. Furthermore, even for documents concerning the same case, the composition and presentation style can vary depending on the purpose of drafting, the submitting agency, the opposing party's arguments, and the procedural stage. Accordingly, document forms, search systems, document editing tools, and auto-completion tools are being utilized in the legal field to enhance the efficiency of document preparation.

[0005] Meanwhile, general document creation support tools often focus on supplementing sentences entered by users or providing standardized formats. Furthermore, while general-purpose AI-based text generation tools can generate natural language sentences, they struggle to adequately reflect the case-specific context, document-type structure, accuracy of legal information, appropriateness of citations, and the unique logical flow characteristic of legal documents that are necessary for drafting legal papers. Therefore, to efficiently draft the lengthy legal documents used in legal practice, document creation support technology capable of considering the expertise of the legal document, its purpose, factual circumstances, and the characteristics of supporting materials is required. The problem to be solved

[0006] The problem that the present invention aims to solve is to provide a legal data and context-based legal document generation method and a system utilizing the same, which can identify the purpose of drafting a legal document and the document type based on case information and drafting requests input by a user, and efficiently generate the structure and content of the legal document corresponding thereto.

[0007] Another problem that the present invention aims to solve is to provide a method and system that can reduce the time and effort required for a user to draft a long legal document by configuring the logical flow of the case overview, facts, key issues, legal judgments, and conclusions required in the process of drafting legal documents to suit the document type.

[0008] Another problem that the present invention aims to solve is to provide a method and system that does not merely list precedents, statutes, legal books, theories, or other legal data, but processes them into information corresponding to user requests and case contexts, and utilizes this information for the generation of legal documents.

[0009] Another problem that the present invention aims to solve is to provide a method and system capable of generating or editing long legal documents suitable for legal work by configuring input information provided to a large-scale language model according to the type of document to be drafted, procedural steps, purpose of drafting, and user input information during the process of generating a draft of a legal document.

[0010] Another problem that the present invention aims to solve is to provide a method and system that can mitigate problems such as the use of inaccurate grounds, unclear citations, or deterioration of document quality that may occur during the process of drafting legal documents using generative artificial intelligence, by supporting the review of legal grounds, citation information, or reference information included in the generated legal documents.

[0011] Another problem that the present invention aims to solve is to provide a legal document generation support technology that can reduce the burden of repetitive work invested by legal professionals in designing the overall structure of legal documents, reviewing logic, verifying grounds, and drafting sentences, and improve the productivity of legal work and the consistency of document drafting.

[0012] 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

[0013] A method for generating a legal document based on legal data and context according to an embodiment of the present invention for solving the above problem comprises, in a method for generating a legal document based on legal data and context performed by a server, a step of receiving input information including at least one of a document type, case overview, factual relationship, and argument direction of a legal document to be created from a user terminal; a step of generating case context information including case information and document information by analyzing the input information; a step of searching for reference materials to be used for generating the legal document from a database in which legal data is stored based on the case context information; a step of generating an overall structure of the legal document based on the case context information and the reference materials; a step of generating a prompt to be input into a large-scale language model based on the overall structure of the legal document and the reference materials; a step of obtaining a draft document from the large-scale language model using the prompt; a step of generating or editing the legal document using the draft document; and a step of generating a verified legal document by verifying the correspondence between the legal grounds, citation information, and the reference materials included in the legal document.

[0014] In the step of generating case context information, case information including at least one of the parties relationship, key facts, type of dispute, legal relationship, procedural stage, direction of claim, direction of defense, and candidate issues may be generated from input information, and document information including at least one of the type of document to be written, purpose of writing, institution to be submitted, output format, stylistic conditions, and volume conditions may be generated.

[0015] After the step of receiving input information, the server determines a subsequent processing flow based on at least one of the fidelity of the input information, the specificity of the document type, the specificity of the facts, and the clarity of the direction of the argument, and if the input information does not meet a preset criterion, it may provide additional questions to the user terminal.

[0016] In the step of searching for reference materials, case information and document information are converted into a search query, and reference materials including at least one of case law, statutes, adjudication precedents, legal forms, legal literature, legal books, academic papers, previously written documents, and documents uploaded by a user are searched, and the searched reference materials can be sorted based on at least one of relevance, recency, legal authority, document type suitability, and consistency with case context information.

[0017] The step of searching for reference materials can be performed by combining at least two of keyword-based search, semantic-based search, embedding-based search, and metadata-based search.

[0018] In the step of generating the overall structure of the legal document, if the document type is a complaint, a structure including at least one of the claim, cause of action, relationship between parties, factual circumstances, legal basis, method of proof, and conclusion is generated; if the document type is a preparatory brief, a structure including at least one of the opposing party's argument, rebuttal by issue, supplementation of factual circumstances, legal basis, correspondence with evidence, and conclusion is generated; and if the document type is a legal review report, a structure including at least one of the background of review, factual circumstances, issues of review, relevant laws and precedents, judgment by issue, risk assessment, and conclusion is generated.

[0019] In the step of generating a prompt, a set of items constituting the overall structure of the legal document, a set of context units extracted from case information, and a set of reference materials are defined, and for the i-th item, the combined importance of the j-th context unit and the l-th reference material can be calculated using an embedding vector transformation function, a similarity calculation function, a relevance score between the context unit and the reference material, the legal authority or source reliability of the reference material, and a risk score indicating the possibility of conflict or lack of basis between the context unit and the reference material.

[0020] In the step of generating prompts, context-unit reflection weights and reference reflection weights for each item are calculated based on combination importance, and prompt segments corresponding to each item can be generated using a function that combines items, event contexts, references, user requests, and generation constraints to convert them into prompt segments.

[0021] In the step of generating a prompt, a final prompt can be generated by an operation that combines multiple prompt segments according to document order using multiple prompt segments, document templates or item-specific writing rules corresponding to items, and connection contexts or logical transition conditions between items.

[0022] The weighting parameter is determined based on at least one of the document type, case overview, facts, direction of argument, type of reference material, and user-set conditions, and if the document type corresponds to a legal document for submission requiring an argument and proof structure, at least one of the weight corresponding to the relevance score and the weight corresponding to legal authority or source reliability may be relatively increased.

[0023] In the stage of generating or editing a legal document, a set of candidate paragraphs constituting the document draft and a set of items constituting the overall structure of the legal document are defined, and an optimal paragraph placement result can be calculated by considering the item suitability of the candidate paragraph, the degree of support from reference materials, the consistency of case information, the stylistic suitability, the logical connectivity between adjacent paragraphs, and the degree of redundancy and contradiction using a selection variable indicating whether a candidate paragraph is placed in an item.

[0024] The weight parameter is determined differently depending on whether the legal document is a document for submission, a document for internal review, or a document for general user explanation, and if the legal document is a document for submission, at least one of the weight corresponding to the degree of support by the set of reference materials, the weight corresponding to the degree of consistency with case information, and the weight corresponding to the logical connectivity between adjacent paragraphs may be relatively increased.

[0025] In the step of generating a verified legal document, a set of sentences or paragraphs constituting the legal document and a set of reference materials are defined, and a basis correspondence score for each sentence or paragraph can be calculated using the semantic similarity between the sentences or paragraphs and the reference materials, the degree of logical support, the degree of consistency of quoted expressions, the legal authority or reliability of the reference materials, the degree of conflict, and the degree of reduced timeliness.

[0026] In the stage of generating verified legal documents, citation materials can be determined by considering both suppression of repetitive citations and citation diversity together by using the correspondence score, the degree of repeated citation of the same reference material, and the citation diversity or issue complementarity provided by the reference material in the set of cited materials of the entire document.

[0027] In the step of generating a verified legal document, the appropriateness of grounds for each sentence or paragraph constituting the legal document, the consistency with the case context, and the risk of hallucination are combined to calculate an overall verification score. If the overall verification score is greater than or equal to a preset threshold value, the legal document is output as a verified legal document, and if the overall verification score is less than a preset threshold value, a "review required" mark may be applied to at least a part of the legal document. Effects of the invention

[0028] According to the present invention, the context for drafting a legal document can be identified based on case information, drafting requests, and document types input by a user, and a document structure and content suitable for the document can be generated, thereby improving the efficiency of drafting legal documents.

[0029] In addition, according to the present invention, since a draft reflecting the writing flow for each document type can be provided for various legal documents such as complaints, preparatory briefs, opinions, contract explanation documents, and legal analysis reports, the user can reduce the time required for initial document layout design.

[0030] In addition, according to the present invention, legal data corresponding to the facts, issues, and purpose of the case can be utilized in the process of generating legal documents, so that a draft document that is appropriate to the context of legal work can be provided, rather than a simple sentence generation result.

[0031] Furthermore, according to the present invention, since prompts input into a large-scale language model can be configured based on case information and legal data, the logical flow, item structure, and sentence development of legal documents can be organized to suit the purpose of writing. Accordingly, users can review, modify, and finalize legal documents more quickly based on the generated draft.

[0032] In addition, according to the present invention, since it is possible to support the review of citation information, reference information, or legal grounds included in generated or edited legal documents, it is possible to mitigate the problem of using inaccurate grounds or unclear citations that may be an issue in generative AI-based document creation.

[0033] Furthermore, according to the present invention, the burden of repetitive tasks such as material review, document structure design, reflection of legal information, and sentence drafting during the process of drafting legal documents can be reduced, thereby improving the work productivity of legal professionals. Moreover, it enhances the quality and formal consistency of legal documents and can more systematically support the legal document drafting process required for each user or case.

[0034] 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

[0035] FIG. 1 is a diagram illustrating the components of a legal document generation system according to one embodiment of the present invention. FIG. 2 is a diagram illustrating functional elements of a server according to one embodiment of the present invention. FIG. 3 is a flowchart illustrating a method for generating a legal document according to an embodiment of the present invention. Figure 4 is a diagram illustrating step S310 of Figure 3. Figure 5 is a diagram illustrating steps S330 and S340 of Figure 3. Figure 6 is a diagram illustrating steps S350 and S360 of Figure 3. Figure 7 is a diagram illustrating steps S370 and S380 of Figure 3. FIG. 8 is a drawing illustrating hardware elements of a server according to one embodiment of the present invention. Specific details for implementing the invention

[0036] 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.

[0037] 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.

[0038] 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.

[0039] FIG. 1 is a diagram illustrating the components of a legal document generation system according to one embodiment of the present invention.

[0040] In this specification, “legal document” refers to a document prepared in relation to legal rights and obligations, legal relationships, disputes, transactions, or proceedings, and includes at least one of the facts of a case, claims of the parties, legal issues, applicable laws, relevant precedents, evidence, legal judgments, and conclusions. For example, a legal document may include at least one of a complaint, an answer, a preparatory brief, an opinion, a petition for judgment, a contract review, a legal review report, a legal advisory document, a draft settlement, or a legal analysis document.

[0041] Unlike general documents, legal documents are not limited to the simple transmission of information or narrative; they are intended to support judgment, arguments, defenses, explanations, or decision-making regarding specific legal relationships or events. Therefore, legal documents need to be drafted by considering not only the naturalness of the sentences but also the consistency of the facts, the specificity of legal issues, the correspondence with statutes and precedents, the accuracy of citation grounds, the logical connection between arguments and conclusions, formal requirements specific to the document type, and procedural purposes. For example, while general documents may be drafted with a focus on explanations to aid the reader's understanding, the structure, manner of expression, and legal emphasis of legal documents may vary depending on the recipient, the stage of the procedure, the opposing party's arguments, or the direction of the claim or defense, even regarding the same facts.

[0042] Referring to FIG. 1, a legal document generation system according to one embodiment of the present invention includes a server (10) and a user terminal (30). The server (10) is a component that receives input information from a user terminal (30), including at least one of a request for legal document generation, a document type, a case overview, a factual relationship, a direction of argument, or reference materials, and performs a series of processes to generate or edit a legal document based on the received input information.

[0043] The server (10) may include a large-scale language model server (11) and a database (12). The large-scale language model server (11) is an artificial intelligence processing component that performs the generation of drafts of legal documents, sentence rewriting, supplementation of content by item, generation of paragraphs according to document structure, or editing processing according to user requests. The large-scale language model server (11) may be physically included inside the server (10), or it may be implemented as a separate artificial intelligence computing server, cloud server, or external model providing server capable of communicating with the server (10). The database (12) is a component that stores legal data and processing data used for generating legal documents. The database (12) may store case precedents, statutes, legal forms, legal literature, case-related input information, user-specific writing history, document type templates, search indexes, or result data of generated legal documents.

[0044] A user terminal (30) is a component that connects to a server (10) to request the creation of a legal document and receives a legal document created or edited from the server (10). The user terminal (30) may be implemented as an electronic device capable of running a desktop computer, a laptop computer, a tablet terminal, a smartphone, or a web browser. The user of the user terminal (30) may be a legal expert such as a lawyer, a patent attorney, a legal officer, or a public institution official, or may be a general user who requires assistance in drafting legal documents.

[0045] The server (10) and the user terminal (30) can transmit and receive data bidirectionally through a wired or wireless communication network. For example, the user terminal (30) transmits the type of legal document to be drafted and case information to the server (10), and the server (10) can generate a draft or edited version of the legal document using legal data stored in the database (12) and the generation results of the large-scale language model server (11), and then provide it to the user terminal (30). In this way, the system of the present invention can support the creation and editing of legal documents corresponding to the case context by combining user input, legal data, and artificial intelligence generation processing.

[0046] FIG. 2 is a diagram illustrating functional elements of a server according to one embodiment of the present invention.

[0047] Referring to FIG. 2, the server (10) may include a context analysis unit (210), a legal information search unit (220), a prompt generation unit (230), a legal document generation unit (240), and a basis verification unit (250). Each functional unit illustrated in FIG. 2 may be implemented by a combination of a processor, memory, storage device, and program instructions included in the server (10), and some functional units may be implemented as software modules linked with a large-scale language model (LLM) server or an external search server. Additionally, although each functional unit is illustrated separately in FIG. 2 for convenience of explanation, two or more functional units may be integrated into a single module, or a single functional unit may be implemented by being separated into multiple sub-modules.

[0048] The context analysis unit (210) is a component that analyzes legal document creation requests and case information input from the user terminal (30). The context analysis unit (210) can analyze at least one of the document type, purpose of creation, case overview, factual circumstances, party information, procedural stage, direction of argument, and reference materials provided by the user for the legal document that the user intends to create. For example, the context analysis unit (210) can determine whether the user's input is for drafting a complaint, for drafting a preparatory brief, or for drafting an opinion or legal review report. In addition, the context analysis unit (210) can extract key facts, legal issues, direction of argument or defense, necessary document items, and information requiring further verification from the input information. Accordingly, the server (10) can perform legal document creation corresponding to the case context and document type, rather than simple sentence creation.

[0049] The legal information search unit (220) is a component that searches for legal data necessary for generating legal documents based on the case context analyzed by the context analysis unit (210). The legal information search unit (220) can search for at least one of the following: case law, statutes, legal forms, legal literature, examples of contract clauses, internal document templates, or reference materials uploaded by the user, which are stored in the database (12). The legal information search unit (220) can convert case information and document information into search queries, extract legal data corresponding to the search queries, and select reference materials that can be used for generating legal documents from the extracted legal data. At this time, the legal information search unit (220) can use keyword search, semantic-based search, embedding-based search, metadata-based search, or a combination thereof. The legal data searched by the legal information search unit (220) is provided to the prompt generation unit (230) and the legal document generation unit (240) and can be utilized for the logical composition and basis formation of legal documents.

[0050] The prompt generation unit (230) is a component that generates prompts to be input into a large-scale language model using the case context analyzed by the context analysis unit (210) and legal data searched by the legal information search unit (220). The prompt generation unit (230) can generate prompts that include document type, purpose of writing, factual circumstances, issues, direction of argument, reference statutes, relevant precedents, and output format conditions. For example, the prompt generation unit (230) can generate prompts that reflect the order of the claim, cause of action, factual circumstances, and evidentiary materials for a complaint, and for a preparatory brief, it can generate prompts that reflect the structure of rebuttal to the opposing party's argument, and the structure of presenting arguments and grounds by issue. Additionally, the prompt generation unit (230) can reflect the writing style, volume, item structure, citation format, method of presenting conclusions, or editing conditions specified by the user of the legal document to be generated in the prompts.

[0051] The legal document generation unit (240) is a component that generates or edits legal documents using prompts generated by the prompt generation unit (230). The legal document generation unit (240) can generate drafts, itemized paragraphs, summaries, supplements, revisions, or rewritten text of legal documents using a large-scale language model. The legal document generation unit (240) can sequentially generate content corresponding to the overall structure of the legal document by reflecting the case context derived by the context analysis unit (210) and legal data retrieved by the legal information search unit (220). For example, the legal document generation unit (240) can generate a draft of legal documents including a case overview, facts, legal issues, a review of relevant statutes and precedents, judgments on application, conclusions, or requests. Additionally, the legal document generation unit (240) can edit the legal document by supplementing some paragraphs of the generated draft, adjusting the writing style, or strengthening arguments regarding specific issues based on subsequent input from the user.

[0052] The basis verification unit (250) is a component that reviews the suitability of legal grounds, citation information, and reference information included in a legal document generated or edited by the legal document generation unit (240). The basis verification unit (250) can verify whether the statute name, provision, precedent, literature, or other reference material included in the generated legal document corresponds to legal data searched by the legal information search unit (220). Additionally, the basis verification unit (250) can assign citation tags corresponding to specific sentences or paragraphs of the legal document, generate reference information, or indicate parts requiring verification of grounds. In one embodiment, the basis verification unit (250) can identify content in the generated legal document that does not correspond to searched legal data, content with unclear citation grounds, or content requiring further review by the user.

[0053] In this way, the server (10) can identify the case context from user input through the context analysis unit (210), search for legal data necessary for drafting legal documents through the legal information search unit (220), configure input conditions reflecting the case context and legal data through the prompt generation unit (230), create or edit legal documents through the legal document generation unit (240), and support verification of the basis of the creation result through the basis verification unit (250). Accordingly, the server (10) can perform legal document creation processing that goes beyond simple automatic completion of legal documents and considers the case context, legal data, and the drafting structure by document type.

[0054] FIG. 3 is a flowchart illustrating a method for generating a legal document according to an embodiment of the present invention. FIG. 4 is a diagram illustrating step S310 of FIG. 3. FIG. 5 is a diagram illustrating steps S330 and S340 of FIG. 3. FIG. 6 is a diagram illustrating steps S350 and S360 of FIG. 3. FIG. 7 is a diagram illustrating steps S370 and S380 of FIG. 3.

[0055] Referring to FIG. 3, a method for generating a legal document according to one embodiment of the present invention may include a user request and case information input step (S310), a workflow control step (S320), an intent and context analysis step (S330), a legal information search step (S340), a document structure design step (S350), a prompt configuration and generation step (S360), a legal document generation and editing step (S370), a basis verification and citation processing step (S380), and a user provision and subsequent supplementation step (S390). Each step illustrated in FIG. 3 may be performed by a server (10), and some steps may be performed through data transmission and reception with a large-scale language model server (11), a database (12), or a user terminal (30) that is included in or linked with the server (10). Additionally, although each step is illustrated sequentially in FIG. 3 for convenience of explanation, depending on the embodiment, some steps may be performed in parallel, performed repeatedly, or some steps may be omitted or integrated.

[0056] First, in the user request and case information input step (S310), the server (10) receives input information for creating a legal document from the user terminal (30). FIG. 4 is a diagram illustrating the user request and case information input step (S310) of FIG. 3. Referring to FIG. 4, the user terminal (30) may transmit input information to the server (10) that includes at least one of a document type (411), a case overview (412), a factual relationship (413), and a direction of argument (414). The document type (411) is information indicating the type of legal document that the user intends to create, and may be information indicating, for example, a complaint, a response, a preparatory brief, an opinion, a request for judgment, a contract review, a legal advisory document, a legal review report, or other legal analysis documents. The case overview (412) may include the overall background of the case to be created, the relationship between the parties, the circumstances of the occurrence of the dispute, the progress of the proceedings, or a general outline of the legal relationship that the user intends to explain. The factual circumstances (413) may include specific facts, dates, acts, contract details, evidence, claims of the opposing party, or case-related data entered by the user that form the basis of claims or judgments in the legal document. The direction of the argument (414) may include claims, defenses, rebuttals, conclusions of review, favorable legal principles, or drafting directions corresponding to the user's intentions that are to be emphasized in the legal document.

[0057] A user terminal (30) can access the server (10) through a web browser, a dedicated application, a mobile application, or an API call interface. The user terminal (30) can provide the server (10) with a document type (411), a case overview (412), facts (413), and a direction of claim (414) through text input, file upload, document selection, checkbox selection, question-and-answer type input, or an interactive interface. For example, the user can input the contract date, lease period, amount of deposit, reason for refusal of return, evidence, and direction of claim along with a request to "prepare a complaint for the return of a lease deposit," and the server (10) can receive this as input information for creating a legal document.

[0058] Next, in the workflow control step (S320), the server (10) controls the legal document generation procedure corresponding to the input information. The server (10) can determine the order and scope of subsequent processing based on the type of received input information, the document type (411), the complexity of the case summary (412), the amount of factual relationship (413), the specificity of the direction of argument (414), the existence of reference materials, or user authority. For example, if the input information is sufficient, the server (10) can sequentially perform the intent and context analysis step (S330), the legal information search step (S340), the document structure design step (S350), and the prompt configuration and generation step (S360). On the other hand, if the input information is insufficient, the server (10) can provide additional questions to the user terminal (30) and perform subsequent steps after receiving additional input. Additionally, the server (10) can set the scope of legal data to be searched, the document structure, the method of creation, and the strength of verification of grounds differently depending on whether the document type (411) is a simple legal review report or a complaint or preparatory brief scheduled to be submitted in the procedure.

[0059] In one embodiment, the fidelity of the input information may be calculated by scoring at least one of the following: whether the document type (411) is specified, whether the case overview (412) is entered, whether the date, amount, party, and action information included in the factual relationship (413) is included, the clarity of the direction of the claim (414), whether reference materials are attached, and whether essential items are omitted. If the calculated fidelity score is less than a preset threshold value, the server (10) may provide additional questions corresponding to the missing items to the user terminal (30).

[0060] Next, in the intent and context analysis step (S330), the server (10) analyzes user requests and case information to generate context information necessary for drafting legal documents. FIG. 5 is a diagram illustrating the intent and context analysis step (S330) and the legal information search step (S340) of FIG. 3. Referring to FIG. 5, the server (10) can perform a search for reference materials using case information (421) and document information (422). The case information (421) may include information regarding the case overview, relationship between parties, key facts, type of dispute, legal relationship, subject of claim or defense, candidate issues, and procedural stage extracted from user input. The document information (422) may include information regarding the type of document to be drafted, purpose of drafting, target institution, expected structure of the document, required writing style, volume, item composition, or output conditions specified by the user.

[0061] In the intent and context analysis step (S330), the server (10) can analyze user input using at least one of natural language processing, document classification, named entity recognition, issue extraction, case type classification, or semantic analysis. Even if the document type (411) is not explicitly entered, the server (10) can infer the document type of the legal document to be drafted based on the expression of the user request, the case overview (412), the facts (413), or the direction of the argument (414). For example, if the user request includes the expression "a document refuting the opposing party's argument," the server (10) can infer the document type (411) as a document in the form of a preparatory brief or a response brief. Additionally, the server (10) can estimate the legal field of contract, damages, intellectual property, criminal, administrative, labor, family relations, or other legal fields from the case overview (412) and the facts (413), and set a legal information search strategy suitable for the field.

[0062] Next, in the legal information search step (S340), the server (10) searches for reference materials stored in the database (12) based on the case information (421) and document information (422) generated in the intent and context analysis step (S330). Referring to FIG. 5, the server (10) converts the case information (421) and document information (422) into a search query and can search for reference materials necessary for drafting legal documents from the database (12). The reference materials may include at least one of the following: precedents, statutes, enforcement decrees, enforcement rules, administrative rules, adjudication precedents, decision precedents, legal forms, legal literature, legal books, academic papers, internal templates, previously written documents, or documents uploaded by a user.

[0063] In the legal information search step (S340), the server (10) may use keyword-based search, semantic-based search, embedding-based search, metadata-based search, or a combination thereof. The server (10) may use key facts and legal issues extracted from case information (421) as search terms, and may use document types and purposes of creation included in document information (422) as filtering conditions. Additionally, the server (10) may sort or select search results based on the relevance, recency, legal authority, document type suitability, or consistency with the user's request of the searched reference materials. At this time, the server (10) may distinguish between materials that can be directly used for creating legal documents and materials for background review among the searched reference materials, and may store identifiers, sources, article numbers, case number, summaries, or related paragraphs together for each reference material or transmit them to a subsequent step.

[0064] Next, in the document structure design step (S350), the server (10) designs the overall structure (431) of the legal document based on the analyzed case context and the retrieved legal data. FIG. 6 is a diagram illustrating the document structure design step (S350) and the prompt configuration and generation step (S360) of FIG. 3. Referring to FIG. 6, the server (10) generates the overall structure (431) of the legal document, configures a prompt (432) using the overall structure (431) of the legal document, and can provide the prompt (432) to the large-scale language model server (11). The overall structure (431) of the legal document may refer to a document drafting plan that arranges the type of document to be drafted, case overview, facts, major issues, applicable laws, relevant precedents, direction of arguments or rebuttals, conclusions, and requests in a specific order.

[0065] For example, if the document type (411) is a complaint, the server (10) can generate an overall structure (431) of a legal document that includes the purpose of the claim, the cause of the claim, the relationship between the parties, the facts, the legal basis, the method of proof, and the conclusion. If the document type (411) is a preparatory brief, the server (10) can generate an overall structure (431) of a legal document that includes the gist of the opposing party's argument, rebuttals by issue, supplementation of the facts, the legal basis, the relationship with the evidence, and the conclusion. If the document type (411) is a legal review report, the server (10) can generate an overall structure (431) of a legal document that includes the background of the review, the facts, the issues of the review, relevant laws and precedents, judgments by issue, risk assessment, and the conclusion. In this way, even if the same case information (421) is input, the server (10) can design different overall structures (431) of legal documents according to the purpose of creation and the document type based on the document information (422).

[0066] Next, in the prompt configuration and generation step (S360), the server (10) generates a prompt (432) to be input into the large-scale language model server (11) using the overall structure (431) of the legal document, case information (421), document information (422), and retrieved reference materials. Referring to FIG. 6, the server (10) configures the prompt (432) based on the overall structure (431) of the legal document, provides the configured prompt (432) to the large-scale language model server (11), and can receive a draft document (433) from the large-scale language model server (11). The prompt (432) may not be a simple natural language query, but may be structured input information including document type, case context, item-by-item writing instructions, retrieved legal data, citation conditions, stylistic conditions, and output format conditions.

[0067] The prompt generation unit (230) can generate prompts (432) by separating writing instructions for each item included in the overall structure (431) of the legal document. For example, the server (10) can define each item included in the overall structure (431) of the legal document as a node and map necessary case facts, searched legal data, direction of argument, and output format to each node. Accordingly, instead of generating a single long document in bulk, the large-scale language model server (11) can generate a draft document (433) that reflects the purpose of writing and supporting materials for each item. Additionally, the server (10) can include constraints in the prompt (432), such as "do not arbitrarily generate case numbers not included in the searched reference materials," "assign a 'review needed' indication if the basis for citation is unclear," and "write the conclusion in accordance with the user's direction of argument, but also review unfavorable factual relationships in a separate item."

[0068] In one embodiment, the server (10) may represent the overall structure (431) of the legal document as a graph or a hierarchical vector, and construct a prompt (432) by calculating the importance of the case context and legal data corresponding to each structural unit. Specifically, the set of items constituting the overall structure (431) of the legal document , a set of context units extracted from event information (421) , the set of reference materials retrieved in the legal information search step (S340) It can be said that. At this time, the server (10) each item Regarding context unit and reference materials The joint importance of can be calculated by the following mathematical formula 1.

[0069] [Mathematical Formula 1]

[0070]

[0071] In mathematical formula 1, The i-th item included in the overall structure (431) of the legal document Regarding the j-th context unit Wow, the lth reference material This is the importance reflected in this prompt (432). is a function that converts text or document units into embedding vectors, and is a function that calculates the similarity between two embedding vectors. is a context unit and reference materials It is a correlation score between, is reference material It is a score indicating the legal authority, recency, or reliability of the source. is a context unit and reference materials It is a risk score indicating the degree to which there is a possibility of conflict, ambiguity, or lack of evidence between them. is a weighting parameter that controls the degree of reflection of each item. Mathematical formula 1 is intended to quantitatively select case information and reference materials to be included in the prompt (432) for each item of the legal document.

[0072] In addition, the server (10) each item prompt segment corresponding to It can be constructed by the following mathematical formula 2.

[0073] [Mathematical Formula 2]

[0074]

[0075]

[0076] In mathematical formula 2, is the i-th item It is a prompt segment corresponding to, and is a function that combines item names, event contexts, references, user requests, and generation constraints to convert them into natural language or structured prompts. is the i-th item The j-th context unit for It is the reflected weight of, and is the i-th item The lth reference material regarding It is the reflected weight. is information indicating a user request or the purpose of creation, and is a constraint regarding the style, length, citation format, prohibited expressions, or output format applied to the i-th item. Mathematical formula 2 is intended to generate item-specific prompts corresponding to the overall structure (431) of the legal document.

[0077] The server (10) has a plurality of prompt segments generated by mathematical formula 2. Combine according to the logical order of the entire document to final prompt It can generate.

[0078] [Mathematical Formula 3]

[0079]

[0080] In mathematical formula 3, is the final prompt entered into the large-scale language model server (11), and It is an operation that combines multiple prompt segments according to document order. is the i-th item It is a document template or item-specific writing rule corresponding to, and is the i-th item and the previous item It is a connection context or logical transition condition between them. is a parameter that controls the reflection weight of the prompt, template, and connection context for each item. Mathematical formula 3 is intended to construct a prompt (432) that reflects logical connectivity between items while maintaining the overall structure (431) of the legal document.

[0081] In one embodiment, the weight parameters used in Equations 1 to 3 It may be determined based on at least one of the document type (411), case overview (412), facts (413), direction of argument (414), type of retrieved reference material, and user-configured conditions. For example, if the document to be drafted is a document where the structure of the argument and proof is important, such as a complaint or a preparatory brief, the server (10) determines the relevance score between the case context and the reference material. The weight corresponding to and legal authority score of reference materials The weight corresponding to It can be set relatively high. On the other hand, if the document to be created is a general legal review report or a contract explanation document, the server (10) items and context unit Weights corresponding to the semantic similarity between and writing rules by item The weight corresponding to You can set it relatively high.

[0082] In addition, the server (10) has a context unit as the argument direction (414) entered by the user becomes more specific. Reflection weights So that it is produced in large quantities or It can be adjusted, and in cases where the retrieved reference materials are materials of high legal authority, such as precedents, statutes, or official literature or It can be set so that the weight of reflection increases. Conversely, if there is a possibility of factual inconsistency, legal conflict, or reduced timeliness between the reference material and the context of the event, the server (10) has a risk score The weight corresponding to By increasing the value, the reference material can be suppressed from being excessively reflected in the prompt (432).

[0083] In one embodiment, the server (10) sets an initial weight using a pre-stored basic weight table for each document type and can update the weight by reflecting user feedback, revision history of the generated legal document, citation verification results, or document quality conditions selected by the user. This method of determining weight is merely an example, and the present invention is not limited by a specific numerical range or a specific learning method.

[0084] Next, in the legal document creation and editing step (S370), the server (10) creates or edits a legal document (440) using a document draft (433) received from a large-scale language model server (11). FIG. 7 is a diagram illustrating the legal document creation and editing step (S370) and the basis verification and citation processing step (S380) of FIG. 3. Referring to FIG. 7, the document draft (433) is processed into a legal document (440) by the server (10), and the legal document (440) can be created into a verified legal document (450) through subsequent basis verification and citation processing.

[0085] The document draft (433) is an initial output generated by the large-scale language model server (11) and may include item-specific content, case information, retrieved reference materials, and sentences or paragraphs corresponding to user requests included in the overall structure (431) of the legal document. The server (10) may perform item order sorting, removal of duplicate paragraphs, correction of sentence connections, unification of style, application of document format, organization of headings, assignment of item numbers, or rewriting processing according to user requests on the document draft (433). Accordingly, the server (10) may refine the document draft (433) into a legal document (440) in a form suitable for submission or review.

[0086] In the legal document creation and editing stage (S370), the server (10) can modify some items of the legal document (440) according to subsequent instructions from the user. For example, if the user provides subsequent input such as "strengthen the rebuttal to the defendant's defense," "reduce the section on reviewing precedents," "write the conclusion more definitively," or "change it to expressions that are easy for the general public to understand," the server (10) can selectively rewrite only the relevant parts while maintaining the structure of the existing legal document (440). Additionally, the server (10) can adjust the level of expression, degree of explanation, or scope of use of technical terms in the legal document (440) differently depending on whether the user is a legal expert or a general user.

[0087] In one embodiment, the server (10) may perform optimization processing that considers item-by-item consistency, logical connectivity, reflection of grounds, and stylistic consistency together to generate a legal document (440) from a document draft (433) received from a large-scale language model server (11). Specifically, a set of candidate paragraphs constituting the document draft (433) ...and the set of items included in the overall structure (431) of the legal document It can be said that. The server (10) is each item Candidate paragraphs to be placed in selection variable A legal document (440) can be generated using the following mathematical formula 4.

[0088] [Mathematical Formula 4]

[0089]

[0090]

[0091]

[0092] In mathematical formula 4, is the result of the optimal paragraph arrangement for generating a legal document (440), and is a selection variable It is a set of. is candidate paragraph a is the i-th item It is a binary variable indicating whether it is placed in. is candidate paragraph Item A It is to the extent that it meets the purpose of writing, and is candidate paragraph A reference set It is the extent to which it is supported by. is candidate paragraph a context unit set It is to the extent that it corresponds to the incident information included in, is candidate paragraph It is a score indicating the style, sentence length, legal document expression, and formal suitability. is a logical connection diagram between adjacent paragraphs in document order, and is the selected paragraph set It is the degree of redundancy, and is the selected paragraph set It is an internal contradiction. is a weight that adjusts the importance of each evaluation item. Mathematical formula 4 is intended to rearrange the draft document (433) to fit the overall structure (431) of the legal document, reduce duplication and contradiction, and produce a legal document (440) that reflects the grounds and context.

[0093] In addition, the server (10) [describes] each paragraph of the legal document (440) according to the following mathematical formula 5 It can generate.

[0094] [Mathematical Formula 5]

[0095]

[0096] In mathematical formula 5, is the final paragraph or set of paragraphs included in the i-th item of the legal document (440), and is a generating or editing function that refines a final sentence using selected candidate paragraphs, event context, references, and editing conditions. is the i-th item by mathematical formula 4 It is a set of candidate paragraphs placed in, and represents the style, volume, item number, level of legal terminology usage, or user-defined editing conditions applied to the i-th item. Equation 5 is intended to generate a legal document (440) by refining candidate paragraphs of a document draft (433) to fit the overall structure (431) of the legal document, the context of the case, and reference materials, rather than simply combining them.

[0097] The server (10) is each paragraph generated by mathematical formula 5 A legal document (440) can be created by combining them.

[0098] [Mathematical Formula 6]

[0099]

[0100] In mathematical formula 6, represents a legal document (440), is a function that applies item number, title, paragraph spacing, quotation marks, document formatting, and output format. is a formatting condition by document type, and is document metadata that includes the title of the document, the name of the party, the case number, the date of creation, the author, the place of submission, or other metadata. Mathematical formula 6 is intended to format the generated paragraphs into a complete legal document (440) corresponding to the document type.

[0101] In one embodiment, the weights used in Equations 4 to 6 This can be determined according to the document quality standards required when converting a document draft (433) into a legal document (440). The server (10) may set different priorities for each weight depending on whether the purpose of creating the legal document (440) is to submit it to a court, patent office, administrative agency, or arbitration body, or to submit it for internal review or user understanding. For example, in the case of a legal document for submission, candidate paragraphs A reference set The degree to which it is supported by The weight corresponding to , event context set Degree of conformity The weight corresponding to , logical connectivity between adjacent paragraphs The weight corresponding to It can be set relatively high.

[0102] On the other hand, in the case of explanatory legal documents for user understanding or guide documents for the general public, the server (10) is stylistic appropriateness The weight corresponding to It can be set relatively high. In addition, if the case information is complex or there are many entered facts, the server (10) can set the redundancy The weight corresponding to By increasing it, the repetition of the same facts or legal principles can be suppressed. In the case where multiple claims or conflicting factual relationships are included, the server (10) also [can] prevent contradiction The weight corresponding to You can increase the number to remove conflicting sentences within the document draft (433) or give a review-needed indication.

[0103] In one embodiment, the server (10) uses a weight based on at least one of predefined quality evaluation criteria for each document type, such as item suitability, degree of reflection of evidence, consistency of facts, logical connectivity, degree of suppression of redundancy, and stylistic consistency. It can calculate the weight. Additionally, the server (10) can use the revision history of legal experts or paragraph information finally adopted by the user as training data to adjust each weight for the same or similar document types in the future. Such weight determination can be performed using a rule-based method, a statistical-based method, a machine learning-based method, or a combination thereof, and the present invention is not limited to a specific weight calculation algorithm.

[0104] Next, in the basis verification and citation processing step (S380), the server (10) verifies the legal basis, citation information, and correspondence with reference materials included in the legal document (440). Referring to FIG. 7, the server (10) can verify the legal document (440) to generate a verified legal document (450). The basis verification and citation processing step (S380) may be a step to mitigate ambiguity of basis, inaccurate citation, reference to non-existent precedents or provisions, and discrepancies between case facts and supporting materials that may occur in generative AI-based document creation.

[0105] The server (10) can divide the legal document (440) into sentences or paragraphs and extract the name of the statute, article number, case number, ruling, legal principle expression, quoted phrase, or mention of factual circumstances included in each sentence or paragraph. The server (10) checks whether the extracted candidate for citation or candidate for basis corresponds to the reference material searched in the legal information search step (S340), and if a corresponding reference material exists, it can assign a citation tag to the corresponding sentence or paragraph. On the other hand, if there is no corresponding reference material or the basis is unclear, the server (10) can mark the relevant part as an item requiring review or provide a request for additional verification to the user terminal (30). In addition, if the same statute or case is repeatedly cited within the same legal document (440), the server (10) can standardize the citation format and generate a list of references or a list of citations.

[0106] In the basis verification and citation processing step (S380), the server (10) can determine whether the claims in the legal document (440) are adequately supported by the searched reference materials. For example, if a specific paragraph explains the requirements for establishing liability for damages, the server (10) can examine whether the paragraph corresponds to relevant statutes, precedents, or legal literature. Additionally, the server (10) can verify whether the factual circumstances included in the legal document (440) match the case information (421) entered by the user, and if facts different from the input information are generated, it can correct them or indicate that review is needed. In this way, the server (10) can provide the reliability information necessary for the user to review and complete the legal document by converting the legal document (440) into a verified legal document (450).

[0107] In one embodiment, the server (10) can calculate a sentence-to-sentence correspondence score for verifying the basis and citing the legal document (440). Specifically, a set of sentences or paragraphs constituting the legal document (440) , the retrieved set of references , a set of event contexts derived from user input It can be said that. The server (10) each sentence or paragraph and reference materials Reasoned correspondence score between It can be calculated by the following mathematical formula 7.

[0108] [Mathematical Formula 7]

[0109]

[0110]

[0111] In mathematical formula 7, is the i-th sentence or paragraph of the legal document (440) A lth reference material It is an evidence-based match score indicating the degree of support provided by. is a function that normalizes scores to a range of 0 to 1. is a sentence or paragraph and reference materials It is the semantic similarity between, is reference material This sentence or paragraph It is the degree to which it logically implies the content of. is a sentence or paragraph Article numbers, case numbers, document titles, or citation expressions included in are reference materials It is the degree to which it matches the identification information. is reference material It is the legal authority or credibility of, is a sentence or paragraph and reference materials It is the degree of collision between, indicates the degree of deterioration in the timeliness or recency of the reference material. is a weight that adjusts the reflection weight of each element. Mathematical formula 7 is intended to quantitatively determine the reference materials that can be cited for each sentence or paragraph included in the legal document (440).

[0112] The server (10) is the basis corresponding score calculated by mathematical formula 7 Use each sentence or paragraph Citation materials to be assigned to can be determined by the following mathematical formula 8.

[0113] [Mathematical Formula 8]

[0114]

[0115]

[0116] In mathematical formula 8, is a sentence or paragraph It is a cited material selected in response to. is the same reference material in previous sentences or paragraphs This is the extent to which it is excessively repeated, and is a set of cited materials for the entire document Reference materials from It indicates the diversity of citations or complementarity of issues provided by this. and are parameters that control the suppression of repeated citations and the degree to which citation diversity is reflected, respectively, and is the minimum grounds match score threshold for adoption as a cited material. Equation 8 is intended to select cited materials by considering the citation balance and repeated citations of the entire document, rather than simply citing the most similar material.

[0117] The server (10) is the total verification score of the legal document (440). Calculate using the following mathematical formula 9, and the total verification score If the value is greater than or equal to the threshold value, the legal document (440) can be printed as a verified legal document (450).

[0118] [Mathematical Formula 9]

[0119]

[0120]

[0121] In mathematical formula 9, is the total verification score of the legal document (440), and is the number of sentences or paragraphs that make up the legal document (440). is the i-th sentence or paragraph It is the highest evidence-based response score for, is a sentence or paragraph A set of event contexts derived from user input It is the degree of consistency with. is a sentence or paragraph It is to the extent that it was created without sufficient reference materials, is a score indicating the possibility of including non-existent or unconfirmed statutes, precedents, facts, or sources. is a parameter that controls the degree of reflection of the case context consistency, lack of grounds, and possibility of hallucination, respectively. Mathematical formula 9 has the purpose of determining whether to generate a verified legal document (450) or indicate whether to review it by comprehensively evaluating the sentence-by-sentence consistency of grounds, case context consistency, and risk of hallucination of the legal document (440).

[0122] In one embodiment, the weights used in Equations 7 to 9 It may be determined based on at least one of the verification strength of the legal document (440), the required level of citation accuracy, and user-configured conditions. For example, if the legal document (440) is a document submitted to a court, patent office, administrative agency, or other public institution, the server (10) is a reference material This sentence or paragraph The degree to which the content of logically implies The weight corresponding to , degree of agreement between citation expressions and reference identification information The weight corresponding to , legal authority of reference materials The weight corresponding to You can set it relatively high.

[0123] On the other hand, in the case of an internal document or a general explanatory document in the draft review stage, the server (10) has semantic similarity The weight corresponding to and event context consistency The weight corresponding to By setting it relatively high, it is possible to prioritize evaluating whether it conforms to the context of the event rather than strict quotation formats. In addition, the server (10) suppresses the generation of sentences lacking evidence by generative artificial intelligence, the degree of lack of evidence The weight corresponding to and potential for hallucinations The weight corresponding to It can be increased depending on the risk of document submission.

[0124] In one embodiment, the repeat citation suppression parameter parameters reflecting citation diversity This may be determined based on document length, the number of issues, the number of references, the frequency of repeated appearance of the same reference, or a custom citation policy. For example, if it is appropriate to intensively cite a single representative precedent regarding a specific issue, It can be set low, and in cases where it is necessary to present various statutes, precedents, and literature regarding multiple issues in a balanced manner can be set high. Also, the server (10) has a verification threshold value You can set different values ​​for each document type, and the threshold for documents for submission is higher than that for documents for internal review. It can be applied.

[0125] The server (10) may update the weights using the verification results calculated in the evidence verification and citation processing step (S380). For example, if a specific sentence or paragraph is deleted or modified by the user, the server (10) may lower the weight for the evidence correspondence score calculation applied to the sentence or paragraph and increase the weight applied to the citation material or paragraph finally adopted by the user. Accordingly, the server (10) can improve the accuracy of the subsequent legal document generation and verification process by reflecting user feedback and document verification results. Such weight updates are merely examples, and the present invention is not limited by a specific update cycle, a specific learning model, or a specific numerical range.

[0126] Next, in the user provision and subsequent supplementation step (S390), the server (10) provides the verified legal document (450) to the user terminal (30). The verified legal document (450) may include at least one of the following: the main body of the legal document, a table of contents by item, citation tags, a list of reference materials, a notice requiring review, user-editable document data, or a downloadable file format. After providing the verified legal document (450) to the user terminal (30), the server (10) may supplement the legal document (440) or the verified legal document (450) according to the user's subsequent input. For example, the user may request to add arguments regarding specific issues, exclude specific cited materials, adjust the volume of the document, change the writing style, or strengthen the rebuttal to the opposing party's arguments. The server (10) can repeatedly supplement the legal document by forwarding these subsequent requests to the necessary steps among the intent and context analysis step (S330), legal information search step (S340), prompt configuration and generation step (S360), legal document generation and editing step (S370), or grounds verification and citation processing step (S380).

[0127] Meanwhile, the weights and reference values ​​of each mathematical formula described in this specification are parameters for explaining an example of the implementation of a legal document generation method. The server (10) may statically set or dynamically adjust each weight and reference value based on at least one of document type (411), case information (421), document information (422), user authority, purpose of creation, type of reference material, legal field, user feedback, document modification history, and result of verification of grounds. Additionally, the server (10) may determine each weight and reference value using at least one of a table storing default values ​​for each document type, rule-based decision logic, a learned prediction model, user-specific settings, or administrator settings. Therefore, the mathematical formulas used in this invention are examples for explaining the legal document generation and verification process, and the specific numerical values, calculation methods, or update methods of each weight may be varied according to the example.

[0128] Thus, a method for generating a legal document according to one embodiment of the present invention may be performed in a flow that receives input information including a document type (411), a case overview (412), factual circumstances (413), and a direction of argument (414) from a user terminal (30), a server (10) analyzes case information (421) and document information (422) to search for reference materials, configures a prompt (432) based on the overall structure (431) of the legal document, receives a draft document (433) from a large-scale language model server (11), generates or edits it into a legal document (440), and provides a verified legal document (450) through ground verification and citation processing. Accordingly, the present invention can support the generation and editing of legal documents by combining case context, legal data, structure by document type, generative artificial intelligence processing, and ground verification, rather than simple automatic text generation.

[0129] FIG. 8 is a drawing illustrating hardware elements of a server (10) according to one embodiment of the present invention.

[0130] Referring to FIG. 8, the server (10) may include a processor (110), memory (120), a transmission / reception device (130), an input interface device (140), an output interface device (150), a storage device (160), and a bus (170). The hardware elements shown in FIG. 8 are exemplary configurations for implementing the functions of the context analysis unit (210), legal information search unit (220), prompt generation unit (230), legal document generation unit (240), and basis verification unit (250) shown in FIG. 2.

[0131] The processor (110) is a computational processing unit that controls the overall operation of the server (10). By executing program instructions stored in memory (120) or storage device (160), the processor (110) can perform at least one of the following steps: user request and case information input step (S310), workflow control step (S320), intent and context analysis step (S330), legal information search step (S340), document structure design step (S350), prompt configuration and generation step (S360), legal document generation and editing step (S370), grounds verification and citation processing step (S380), and user provision and subsequent supplementation step (S390).

[0132] The memory (120) may temporarily or non-temporarily store instructions executed by the processor (110), intermediate operation data, user input information, search results, prompts, document drafts, or legal document data. The memory (120) may include ROM and RAM, but is not limited thereto.

[0133] The transmitting and receiving device (130) is a communication device that transmits and receives data with a user terminal (30), a large-scale language model server (11), a database (12), or an external server. The transmitting and receiving device (130) may be implemented as a wired communication module, a wireless communication module, a network interface card, or an API communication module. The input interface device (140) is a device that receives commands, settings, or input data from an administrator of the server (10) or an external device, and the output interface device (150) is a device that outputs processing results, status information, error information, or a management screen.

[0134] The storage device (160) can store legal data, search indexes, templates by document type, user-specific writing history, generated legal documents, verification results, or program instructions. The bus (170) is an internal communication path that transmits data, control signals, or instructions between the processor (110), memory (120), transmission / reception device (130), input interface device (140), output interface device (150), and storage device (160).

[0135] In FIG. 8, the server (10) is depicted as a single physical device, but the server (10) may be implemented as a plurality of physical servers, cloud servers, virtual servers, container-based execution environments, or distributed computing environments. Additionally, the large-scale language model server (11) and the database (12) may be implemented as internal components of the server (10) or as external components connected to the server (10) via a network.

[0136] A method for generating legal documents according to one embodiment of the present invention may be implemented in the form of program instructions executable by a computer. Specifically, when the program instructions are executed by a processor (110), the server (10) may receive input information including at least one of a document type (411), a case summary (412), a factual relationship (413), and a direction of argument (414) from a user terminal (30), generate case information (421) and document information (422) based on the received input information, and search for reference materials from a database (12) based on the case information (421) and document information (422).

[0137] Additionally, when the program command is executed by the processor (110), the server (10) may generate the overall structure (431) of the legal document based on the retrieved reference materials and the context of the case, generate a prompt (432) to be input into the large-scale language model server (11) using the overall structure (431) of the legal document, and receive a draft document (433) from the large-scale language model server (11). Additionally, the program command may cause the server (10) to generate or edit the draft document (433) into a legal document (440), generate a verified legal document (450) by verifying the correspondence with the legal grounds, citation information, or reference materials included in the legal document (440), and provide the verified legal document (450) to the user terminal (30).

[0138] These program instructions may be stored in the storage device (160), memory (120) of the server (10), or in an external storage capable of communicating with the server (10). Additionally, the program instructions may be provided by being stored in a computer-readable recording medium. The computer-readable recording medium may include a non-transient recording medium capable of storing data electronically, magnetically, optically, or in a semiconductor manner, and may include, for example, a hard disk, a solid-state drive, a flash memory, a ROM, a RAM, a memory card, an optical disk, or a network storage device.

[0139] A computer-readable recording medium according to one embodiment of the present invention may have a program recorded thereon that, when executed by a processor (110), implements the functions of a context analysis unit (210), a legal information search unit (220), a prompt generation unit (230), a legal document generation unit (240), and a basis verification unit (250) shown in FIG. 2, and performs each step of a legal document generation method shown in FIG. 3. Accordingly, the present invention may be implemented in the form of a server (10), a method performed by the server (10), a program for executing the method, and a computer-readable recording medium on which the program is recorded.

[0140] 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

[0142] 10: Server 11: Large-scale language model server 12: Database 30: User Terminal 210: Context Analysis Department 220: Legal Information Search Department 230: Prompt Generation Section 240: Legal Document Generation Section 250: Evidence Verification Section 411: Document Type 412: Case Overview 413: Facts 414: Argument Direction 421: Case Information 422: Document Information 431: Overall Structure of Legal Documents 432: Prompt 433: Document Draft 440: Legal document 450: Verified legal document

Claims

Claim 1 A method for generating legal documents based on legal data and context performed by a server comprises: receiving input information from a user terminal including at least one of a document type, case overview, factual relationship, and direction of argument of a legal document to be created; analyzing the input information to generate case context information including case information and document information; searching for reference materials to be used for generating the legal document from a database storing legal data based on the case context information; generating an overall structure of the legal document based on the case context information and the reference materials; generating a prompt to be input into a large-scale language model based on the overall structure of the legal document and the reference materials; obtaining a draft document from the large-scale language model using the prompt; generating or editing the legal document using the draft document; and verifying the correspondence between the legal grounds, citation information, and the reference materials included in the legal document to generate a verified legal document, wherein the step of generating the prompt comprises a set of items constituting the overall structure of the legal document , a set of context units extracted from the above event information , the set of reference materials above Defined as, and the i-th item Regarding the j-th context unit and the lth reference The importance of the combination Includes a step of calculating according to the following mathematical formula 1, and <Mathematical Formula 1> In the above mathematical formula 1, is an embedding vector transformation function, and is a similarity calculation function, and is a relevance score between the context unit and the reference, and is the legal authority or source reliability of the reference material, and is a risk score indicating the possibility of conflict or lack of evidence between contextual units and references, and A legal document generation method based on legal data and context, which is a weighting parameter. Claim 2 A method for generating legal documents based on legal data and context according to claim 1, wherein the step of generating the case context information comprises: a step of generating the case information from the input information including at least one of the relationship between parties, key facts, type of dispute, legal relationship, procedural stage, direction of claim, direction of defense, and candidate issues; and a step of generating the document information from the input information including at least one of the type of document to be written, purpose of writing, institution to be submitted, output format, stylistic conditions, and volume conditions. Claim 3 A method for generating legal documents based on legal data and context, wherein, after the step of receiving the input information, the server further includes a step of determining a subsequent processing flow based on at least one of the fidelity of the input information, whether the document type is specific, the specificity of the factual relationship, and the clarity of the direction of the argument, and the step of determining the subsequent processing flow includes a step of providing an additional question to the user terminal if the input information does not satisfy a preset standard. Claim 4 A method for generating legal documents based on legal data and context, wherein the step of searching for reference materials in claim 1 comprises: a step of converting the case information and the document information into a search query; a step of searching for reference materials based on the search query, including at least one of case law, statutes, judgments, legal forms, legal literature, legal books, academic papers, previously written documents, and documents uploaded by a user; and a step of sorting the searched reference materials based on at least one of relevance, recency, legal authority, document type suitability, and consistency with the case context information. Claim 5 In paragraph 4, the step of searching for the above-mentioned reference materials is performed by combining at least two of keyword-based search, semantic-based search, embedding-based search, and metadata-based search, in a method for generating legal documents based on legal data and context. Claim 6 A method for generating legal documents based on legal data and context, wherein, in paragraph 1, the step of generating the overall structure of the legal document comprises: generating a structure including at least one of a claim, cause of action, relationship between parties, factual circumstances, legal basis, method of proof, and conclusion when the document type is a complaint; generating a structure including at least one of a summary of the opposing party's argument, rebuttal by issue, supplementation of factual circumstances, legal basis, correspondence with evidence, and conclusion when the document type is a preparatory brief; and generating a structure including at least one of a background of review, factual circumstances, issues of review, relevant laws and precedents, judgment by issue, risk assessment, and conclusion when the document type is a legal review report. Claim 7 delete Claim 8 In claim 1, the step of generating the prompt is the combination importance Based on the i-th item The j-th context unit for Reflection weights and the i-th item The lth reference material regarding Reflection weights Calculate and the above reflected weights and Using the i-th item prompt segment corresponding to Includes a step of generating by the following mathematical formula 2, and <Mathematical Formula 2> In the above mathematical formula 2, is a function that combines items, event context, references, user requests, and generation constraints to convert them into prompt segments, and is for the purpose of user request or creation, is a constraint regarding at least one of the style, length, citation format, and output format applied to the i-th item, and the above is the number of context units included in the above set of context units, and the above is 1 or more The following is a context unit index, and the above is the number of reference materials included in the set of reference materials above, and the above 1 or more The following is a reference index, and the reflected weights above and are each calculated by the following mathematical formulas, , , legal data and context-based legal document generation method. Claim 9 In claim 8, the step of generating the prompt comprises a plurality of prompt segments , i-th item Document templates or item-specific writing rules corresponding to , and the i-th item and the previous item Connection context or logical transition condition between Use the final prompt Includes a step of generating by the following mathematical formula 3, <Mathematical Formula 3> In the above mathematical formula 3, is an operation that combines multiple prompt segments according to document order, and are weight parameters that adjust the reflection weight of prompt segments, document templates or item-specific writing rules, and connection contexts or logical transition conditions, respectively, and the above ... is the number of items constituting the overall structure of the above legal document, and the above is 1 or more A method for generating legal documents based on legal data and context, which is an index of the following items. Claim 10 In claim 1, the weight parameter is determined based on at least one of the above document type, above case overview, above factual circumstances, above direction of argument, above type of reference material, and user-configured conditions, and if the above document type corresponds to a legal document for submission requiring an argument and proof structure, the server [determines] the relevance score The weight corresponding to and the credibility of the aforementioned legal authority or source The weight corresponding to A method for generating legal documents based on legal data and context, which relatively increases at least one of the following. Claim 11 In paragraph 1, the step of generating or editing the legal document comprises a set of candidate paragraphs constituting the draft document. Defined as, and the set of items constituting the overall structure of the above legal document Defined as, the set of context units extracted from the above event information Defined as, and the above set of reference materials Defined as, the above candidate paragraph go The first item A binary selection variable indicating whether it is placed in The set of Defined as, and the optimal paragraph placement result according to mathematical formula 4 below Includes a step of calculating, <Mathematical Formula 4> In the above mathematical formula 4, m is the number of items included in the item set, and the is the number of candidate paragraphs included in the above set of candidate paragraphs, i is an item index from 1 to m, and t is a candidate paragraph index from 1 to s. is the above selection variable It is a set of candidate paragraphs selected according to, and is an order index that identifies the candidate paragraph placed at the i-th position according to the document order of the above legal document, and is candidate paragraph a is the i-th item It is to the extent that it meets the purpose of writing, and is candidate paragraph A reference set It is the extent to which it is supported by, is candidate paragraph a context unit set It is to the extent that it corresponds to the incident information included in, Candidate paragraph It is a score indicating the stylistic or formal appropriateness of, is a logical connection diagram between adjacent paragraphs, and is the redundancy of the selected set of paragraphs, and A legal document generation method based on legal data and context, which is a weighting parameter. Claim 12 In Clause 11, the above weight parameter is determined differently depending on whether the above legal document is a document for submission, a document for internal review, or a document for general user explanation, and if the above legal document is a document for submission, the server [assists] a weight corresponding to the degree to which it is supported by the set of reference materials. , weights corresponding to the degree of consistency with the above event information , and weights corresponding to the logical connectivity between the aforementioned adjacent paragraphs A method for generating legal documents based on legal data and context, which relatively increases at least one of the following. Claim 13 In paragraph 1, the step of generating the verified legal document comprises a set of sentences or paragraphs constituting the legal document. , the set of reference materials above Defined as, the i-th sentence or paragraph Wow, the lth reference material Reasoned correspondence score between Includes a step of calculating according to the following mathematical formula 5, and <Mathematical Formula 5> In the above mathematical formula 5, is a function that normalizes scores, and is a sentence or paragraph and reference materials It is the semantic similarity between, is reference material This sentence or paragraph It is to the extent that it logically supports the content of, and is a sentence or paragraph Citations and references included in The degree to which the identification information matches, is reference material It is the legal authority or credibility of, is a sentence or paragraph and reference materials It is the degree of collision between, is reference material It is the degree of reduced timeliness, and A legal document generation method based on legal data and context, which is a weighting parameter. Claim 14 In Paragraph 13, the step of generating the above-mentioned verified legal document is the above-mentioned basis corresponding score , to the extent that the same reference is repeatedly cited in previous sentences or paragraphs , and references in the set of cited materials throughout the document The diversity of citations or complementarity of issues provided by this Using, the i-th sentence or paragraph Citation materials selected in response to Includes a step of determining by the following mathematical formula 6, <Mathematical Formula 6> In the above mathematical formula 6, is the degree of repeated citation of the same reference material mentioned above. It is a repeat citation penalty weighting parameter that is multiplied to determine the amount of deduction due to repeated citations, and is a parameter that controls the degree to which citation diversity is reflected, and A legal data and context-based legal document generation method, which is the minimum grounds correspondence score threshold value for adoption as citation material. Claim 15 In paragraph 14, the step of generating the verified legal document comprises the total verification score of the legal document. Calculate using the mathematical formula 7 below, and the above total verification score If is greater than or equal to a preset threshold value, the above legal document is output as the above verified legal document, and the above total verification score It includes the step of applying a review requirement indication to at least a part of the legal document if it is less than the above-mentioned preset threshold value, <Mathematical Formula 7> In the above mathematical formula 7, m is the number of sentences or paragraphs constituting the above legal document, i is a sentence or paragraph index between 1 and m, and k is the number of reference materials included in the above set of reference materials, and is a reference index between 1 and k, and is a sentence or paragraph a set of context units derived from the above-mentioned event information It is the degree of consistency with, is a sentence or paragraph It is to the extent that it was created without sufficient reference materials, is a score indicating the possibility of including unverified statutes, precedents, facts, or sources, and A legal document generation method based on legal data and context, which is a weighting parameter. Claim 16 delete

Citation Information

Patent Citations

  • Method for generating document

    KR1020210086849A

  • System for creating a legal document and operating method thereof

    KR1020250087933A

  • Method for simulating legal cases using artificial intelligence agent

    KR102873605B1