A document intelligent generation system and method for the judicial field

By structurally analyzing judicial documents and constructing logical chains, relevant legal provisions are generated and confidence levels are assessed. This solves the problems of logical gaps and insufficient reliability in the judicial document generation system, and achieves more efficient and reliable document generation.

CN122240696APending Publication Date: 2026-06-19JIANGSU XINSHIYUN TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JIANGSU XINSHIYUN TECH CO LTD
Filing Date
2026-05-25
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing document generation systems in the judicial field have shortcomings in understanding case facts, constructing logical chains of legal argumentation, and assessing the credibility of generated content, resulting in logical gaps and difficulty in ensuring reliability.

Method used

By performing structured analysis on historical judicial documents, establishing the relationships and logical chains between elements, identifying exclusionary elements, generating relevant legal provisions, and conducting confidence assessments and risk warnings, an initial document is formed.

Benefits of technology

It has improved the level of intelligence in understanding cases, effectively identified logical contradictions in judgments, enhanced the logical rigor and reliability of documents, and ensured the professional quality of documents and judicial security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122240696A_ABST
    Figure CN122240696A_ABST
Patent Text Reader

Abstract

This invention discloses an intelligent document generation system and method for the judicial field, relating to the field of document analysis technology. The generation method includes the following steps: performing structured analysis on historical judicial documents and extracting elements from the documents; establishing relationships between different elements; constructing a logical chain for the document based on the relationships between elements in any judicial document; comparing the logical chains of different judicial documents and identifying elements that exclude logical chains; generating relevant legal provisions matching the elements based on real-time collected case elements and logical chains; identifying the most applicable provisions and generating an initial document based on the exclusion of logical chains; evaluating the confidence level of each element in the initial document; optimizing the text of the initial document based on the evaluation results and providing risk warnings for potential elements; thereby improving efficiency while ensuring the professional quality and judicial security of the final document.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of document analysis technology, specifically a document intelligent generation system and method for the judicial field. Background Technology

[0002] In judicial practice, drafting legal documents is a core part of the work, but it relies heavily on the professional knowledge and practical experience of judicial personnel; although some auxiliary tools have emerged with existing technology, there are still situations where they are difficult to meet actual needs. Currently, such systems typically suffer from the following shortcomings: First, at the level of understanding the case, they lack the ability to deeply extract and analyze the core elements of the case, as well as the ability to automatically construct and constrain the internal logical chain of legal arguments, which can easily lead to logical gaps or contradictions. Furthermore, the accuracy of recommendations is insufficient in the stages of legal citation and initial text generation. Second, existing systems generally lack an evaluation mechanism for the credibility of their own generated content, and cannot proactively alert to risks and assist in optimization, making it difficult to guarantee the reliability and standardization of the final documents. Summary of the Invention

[0003] The purpose of this invention is to provide a document intelligent generation system and method for the judicial field, so as to solve the problems raised in the prior art.

[0004] To achieve the above objectives, the present invention provides the following technical solution: a document intelligent generation method for the judicial field, the generation method comprising the following steps: Step S100: Perform structured analysis on historical judicial documents and extract elements from the documents; based on the element extraction of different judicial documents, establish relationships between different elements; Step S200: Based on the correlation of elements in any judicial document, construct the logical chain of the document; compare the logical chains of different judicial documents, and identify the elements that exclude logical chains; Step S300: Based on the real-time collected case elements and logical chains, generate relevant legal provisions for element matching; based on the exclusion of logical chains, identify the most applicable provisions and generate the initial document; Step S400: Conduct confidence assessment on each element of the initial document; optimize the text of the initial document based on the assessment results, and provide risk warnings for potential elements.

[0005] Furthermore, step S100 includes the following steps: Step S101: A document database is pre-built, storing all historically uploaded judicial documents. One judicial document is randomly retrieved from this database, and natural language processing (NLP) is used to segment and tag the text, resulting in several word groups. A pre-built document entity database is then retrieved, containing several document entities. Any document entity is matched against a corresponding entity recognition rule. Document entities include parties, time, location, criminal acts, amount, punishment, and legal basis. Each entity has corresponding recognition rules. For example, for parties, the name of the person or organization following "defendant" and "plaintiff" can be captured; for criminal acts, relevant keywords such as "theft" and "intentional injury" can be captured; and for amounts, the numbers and currency units following the relevant keywords can be captured. Step S102: Randomly retrieve the entity recognition rules of a document entity and perform entity recognition on each word group. If a word group that matches the rules is identified, set the word group that matches the rules as an element of the retrieved document entity and retrieve a new document entity. If no word group is identified, retrieve a new document entity and perform recognition again until all document entities have been identified, and obtain several elements of the retrieved judicial document to generate an element set. Step S103: Obtain the element sets of each judicial document in the document database, randomly select two elements from the retrieved judicial documents and set them as target element groups; compare the target element groups with the element sets of the remaining judicial documents. If a judicial document's element set contains the target element groups, then set that judicial document as the target document, count the number of target documents as A, and set the total number of judicial documents as A. total The calculated percentage of target documents is η = A / A. total Preset a quantity percentage threshold η th If η≥η th Then, establish a relationship between the two elements of the target element group and set the target element group as a valid element group; construct the relationship between the various elements in the retrieved judicial documents to obtain several valid element groups of the retrieved judicial documents; if the two elements exist simultaneously in most judicial documents, it can be said that there is a certain relationship between the two elements, and the other can be inferred from one of them, thus providing support for the construction of the subsequent logical chain.

[0006] Furthermore, step S200 includes the following steps: Step S201: Randomly select a judicial document, obtain several effective element groups in the selected judicial document, and randomly select one effective element group. Set two elements in the selected effective element group as the first element and the second element respectively, and obtain the text area of ​​the word group corresponding to the first element and the text area of ​​the second element in the selected judicial document. Step S202: Establish a two-dimensional index coordinate system for the selected judicial documents to obtain the coordinate range corresponding to any text in the selected judicial documents. Obtain the first region coordinate range of the text area where the first element is located and the second region coordinate range of the text area where the second element is located. Randomly select a position coordinate from the first region coordinate range and compare the selected coordinate position with the second region coordinate range. Set the selected position coordinate as (x0, y0) and the minimum coordinate in the second region coordinate range as (x1, y1). When y0=y1 and x0<y1, or when y0>y1, set the association logic in the selected effective element group as the first element influencing the second element. The content in judicial documents often has logic, so elements with association must have a sequential order. Therefore, the logical order between elements can be obtained by observing the position layout of the elements in the text. Step S203: Obtain the internal association logic of all valid element groups in the selected judicial documents. Randomly select two valid element groups and extract the association logic between the two valid element groups. If the affected element in one valid element group is the influencing element of the other valid element group, then establish a logical chain between the two valid element groups. Connect all valid element groups in the selected judicial documents with association logic to obtain several logical chains. Step S204: Obtain all logical chains contained in each judicial document, arbitrarily select two logical chains and set them as target logical chains; count the number of identical elements between the two target logical chains, which is N. sim The number of differential elements is N dif The element similarity between the two target logical chains is calculated to be S=N. sim / (N sim +N dif A similarity threshold S is preset. th If S≥S th Then, the two target logical chains are set as similar chains, and the positional order of the same elements in the two similar chains is extracted. The position of any identical element in each of the two similar chains is obtained among all identical elements. If the position of a certain identical element differs, that identical element is marked, and the number of marks is counted as m. The total number of identical elements is set as N1, and the percentage of marked elements is obtained as δ = m / N1. A preset percentage threshold δ is then set. th If δ≥δ thIf the two similar chains are set as difference similar chains, then the difference similar chains are set as difference similar chains. The difference similar chains are mainly used to capture exclusionary elements. Only on the basis of similar chains can the exclusionary elements that cause the difference be identified more accurately. Step S205: Summarize all target logical chains that are similar to each other to generate several sets of similar chains. Randomly select one set of similar chains, and randomly select two target logical chains from the selected set. If the two target logical chains are differentially similar chains, then set the differential elements in the two logical chains as exclusionary elements to generate a set of exclusionary elements for the selected set of similar chains. If the two target logical chains are not differentially similar chains, then set the differential elements in the two target logical chains as valid elements, and delete the valid elements contained in the set of exclusionary elements to obtain a corrected set of exclusionary elements.

[0007] Furthermore, step S300 includes the following steps: Step S301: Pre-build a legal provisions database and store all legal provisions. Compare each element in any logical chain with each legal provision. If a legal provision is the same as a certain element, then set that legal provision as the legal provision of the logical chain. Step S302: Whenever a new case is collected in real time, extract the text content of the new case to generate several elements; arbitrarily select a set of similar chains, arbitrarily select a logical chain from the selected set of similar chains, and compare several elements with the elements contained in the selected logical chain to obtain N identical elements. ’ Let N be the total number of elements. total The similarity S between several elements and the selected logical chain is calculated. ’ =N ’ / N total ; Obtain the similarity between several elements and the remaining logical chains, and select the maximum similarity S. ’ (max) represents the similarity of the selected similar chain set. If the similarity of the selected similar chain set exceeds the preset similarity threshold, the selected similar chain set will be set as the target chain set. Step S303: Obtain a set of several target chains matching the new case. Randomly select a logical chain from any target chain set. If the similarity between the selected logical chain and several elements exceeds the similarity threshold, extract the legal provisions of the selected logical chain and use it as a relevant legal provision of the new case to generate several relevant legal provisions corresponding to the new case. Step S304: Randomly select a target chain set, extract the set of exclusion elements of the selected target chain set, if a new case has an element that is the same as an exclusion element in the exclusion element set, then exclude the relevant legal provisions corresponding to each logical chain in the selected target chain set, and revise the relevant legal provisions corresponding to the new case; compare the order relationship between the same elements with the remaining logical chains, mark the same elements with different positions and count the number of marks, if the number of marks exceeds the number percentage threshold, then exclude the relevant legal provisions corresponding to the remaining logical chains with different positions, and revise the relevant legal provisions corresponding to the new case a second time; Step S305: Extract the revised relevant legal provisions, extract each logical chain corresponding to any relevant legal provision, select the relevant legal provision corresponding to the logical chain with the highest similarity and set it as the most applicable provision; retrieve the preset text template library, combine several elements and the most applicable provision, automatically fill the element content into the corresponding position of the template, and generate the initial document.

[0008] Furthermore, step S400 includes the following steps: Step S401: Randomly select an element from the initial document, count the number of times the selected element appears in various judicial documents, and calculate the first frequency of occurrence p1 of the selected element; extract the logical chains constructed by each element in the initial document, obtain the legal provisions of the initial document, count the number of times the selected element appears in each logical chain of the same legal provision, and calculate the second frequency of occurrence p2 of the selected element; according to the formula: ; Calculate the confidence level z of the selected elements; preset a confidence level evaluation threshold z. th If z≥z th If z < z th If the selected element is set as a low-confidence element, the confidence level reflects the ratio of the frequency of occurrence of the element in a specific legal provision to the frequency of occurrence in all documents. If the confidence level is high, it means that the element appears frequently in the specific legal provision and is strongly related to the current case. Step S402: Insert editable annotation prompts at the corresponding positions of any low-confidence elements in the initial document, and perform grammatical compliance checks and logical coherence checks on high-confidence elements to form a complete judicial document.

[0009] To better implement the above methods, a document intelligent generation system is also proposed. The generation system includes a historical document parsing module, a document logic analysis module, a clause matching generation module, and a document confidence optimization module. The historical document parsing module is used to perform structured parsing of historical judicial documents and extract elements from the documents; based on the element extraction results of different judicial documents, it establishes relationships between different elements; The document logic analysis module is used to construct the logical chain of a document based on the relationship between elements in any judicial document; compare the logical chains of different judicial documents; and identify the elements that contradict logical chains. The clause matching and generation module is used to generate relevant legal clauses that match the case elements and logical chains collected in real time; based on the exclusion of logical chains, it identifies the most applicable clauses and generates the initial document; The document confidence optimization module is used to assess the confidence level of each element of the initial document; based on the assessment results, it optimizes the text of the initial document and provides risk warnings for potential elements.

[0010] Furthermore, the historical document parsing module includes a document element extraction unit and a document element association unit; The document element extraction unit is used to perform structured analysis on historical judicial documents and extract elements from the documents; the document element association unit is used to establish association relationships between different elements based on the element extraction results of different judicial documents.

[0011] Furthermore, the document logic analysis module includes a document logic construction unit and a document logic constraint unit; The document logic construction unit is used to construct the logical chain of a document based on the relationship between elements in any judicial document; the document logic constraint unit is used to compare the logical chains of different judicial documents and identify the elements that exclude logical chains.

[0012] Furthermore, the clause matching and generation module includes a clause recommendation and matching unit and an initial document generation unit; The clause recommendation and matching unit is used to generate relevant legal clauses that match the case elements and logical chains collected in real time; the initial document generation unit is used to identify the most applicable clauses and generate the initial document based on the exclusion of logical chains.

[0013] Furthermore, the document confidence optimization module includes a recommendation confidence assessment unit and a document generation optimization unit; The recommended confidence assessment unit is used to assess the confidence level of each element of the initial document; the document optimization unit is used to optimize the text of the initial document based on the assessment results and to provide risk warnings for potential elements.

[0014] Compared with the prior art, the beneficial effects of the present invention are: 1. This invention enables in-depth analysis of the inherent legal logic of a case, and can autonomously learn and extract judgment patterns from massive amounts of documents. It breaks through the limitations of traditional document generation tools that rely solely on templates and simple rule matching, and significantly improves the level of intelligence in understanding the case. 2. This invention can effectively identify potential contradictions and conflicts between different judicial logics, thereby automatically avoiding logical gaps in the stages of clause recommendation and document generation; it enhances the logical rigor and persuasiveness of the generated documents, reduces legal risks caused by logical inconsistencies, and improves the reliability of decision support. 3. By establishing a confidence assessment system for document elements and providing risk warnings for low-confidence content, this invention can assist judicial personnel in focusing on uncertain or potential risk points, thereby improving efficiency while ensuring the professional quality and judicial security of the final documents. Attached Figure Description

[0015] Figure 1 This is a schematic diagram of the structure of an intelligent document generation system for the judicial field. Figure 2 This is a schematic diagram illustrating the steps of a document intelligent generation method for the judicial field. Detailed Implementation

[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0017] Example: Figures 1 to 2 As shown, this invention provides a method for intelligent document generation in the judicial field, the method comprising the following steps: Step S100: Perform structured analysis on historical judicial documents and extract elements from the documents; based on the element extraction of different judicial documents, establish relationships between different elements; Step S100 includes the following steps: Step S101: Pre-build a document database to store all historically uploaded judicial documents, and randomly retrieve one judicial document from it. Use natural language processing technology to perform word segmentation and part-of-speech tagging on the document text to obtain several word groups; retrieve the pre-built document entity database, which stores several document entities, among which any document entity matches the corresponding entity recognition rule. Step S102: Randomly retrieve the entity recognition rules of a document entity and perform entity recognition on each word group. If a word group that matches the rules is identified, set the word group that matches the rules as an element of the retrieved document entity and retrieve a new document entity. If no word group is identified, retrieve a new document entity and perform recognition again until all document entities have been identified, and obtain several elements of the retrieved judicial document to generate an element set. Step S103: Obtain the element sets of each judicial document in the document database, randomly select two elements from the retrieved judicial documents and set them as target element groups; compare the target element groups with the element sets of the remaining judicial documents. If a judicial document's element set contains the target element groups, then set that judicial document as the target document, count the number of target documents as A, and set the total number of judicial documents as A. total The calculated percentage of target documents is η = A / A. total Preset a quantity percentage threshold η th If η≥η th Then, establish a relationship between the two elements of the target element group and set the target element group as a valid element group; construct the relationship between the various elements in the retrieved judicial documents to obtain several valid element groups of the retrieved judicial documents; Example 1: Extract a theft judgment from a document database. Use natural language processing (NLP) technology for word segmentation and part-of-speech tagging. For example, the original sentence is "Defendant Zhang San stole 5,000 yuan in cash and was sentenced to six months imprisonment." The word segmentation result is: defendant, Zhang San, theft, cash, 5,000 yuan, sentenced, six months imprisonment. Call the document entity database to identify elements: entity "defendant" corresponds to element "Zhang San," entity "amount of crime" corresponds to element "5,000 yuan," entity "charge" corresponds to element "theft," and entity "sentence" corresponds to element "six months imprisonment." Select the element groups "theft" and "5,000 yuan" from 1,000 historical documents. 800 documents contain both elements, resulting in a proportion η = 80%. Set η... th =60%, because η≥η th Establish connections and form effective element groups.

[0018] Step S200: Based on the correlation of elements in any judicial document, construct the logical chain of the document; compare the logical chains of different judicial documents, and identify the elements that exclude logical chains; Step S200 includes the following steps: Step S201: Randomly select a judicial document, obtain several effective element groups in the selected judicial document, and randomly select one effective element group. Set two elements in the selected effective element group as the first element and the second element respectively, and obtain the text area of ​​the word group corresponding to the first element and the text area of ​​the second element in the selected judicial document. Step S202: Establish a two-dimensional index coordinate system for the selected judicial documents to obtain the coordinate range corresponding to any text in the selected judicial documents. Obtain the first region coordinate range of the text area where the first element is located and the second region coordinate range of the text area where the second element is located. Randomly select a position coordinate from the first region coordinate range and compare the selected coordinate position with the second region coordinate range. Set the selected position coordinate as (x0, y0) and the minimum coordinate in the second region coordinate range as (x1, y1). When y0 = y1 and x0 < y1, or when y0 > y1, set the association logic in the selected effective element group to the first element affecting the second element. Step S203: Obtain the internal association logic of all valid element groups in the selected judicial documents. Randomly select two valid element groups and extract the association logic between the two valid element groups. If the affected element in one valid element group is the influencing element of the other valid element group, then establish a logical chain between the two valid element groups. Connect all valid element groups in the selected judicial documents with association logic to obtain several logical chains. Step S204: Obtain all logical chains contained in each judicial document, arbitrarily select two logical chains and set them as target logical chains; count the number of identical elements between the two target logical chains, which is N. sim The number of differential elements is N dif The element similarity between the two target logical chains is calculated to be S=N. sim / (N sim +N dif A similarity threshold S is preset. th If S≥S th Then, the two target logical chains are set as similar chains, and the positional order of the same elements in the two similar chains is extracted. The position of any identical element in each of the two similar chains is obtained among all identical elements. If the position of a certain identical element differs, that identical element is marked, and the number of marks is counted as m. The total number of identical elements is set as N1, and the percentage of marked elements is obtained as δ = m / N1. A preset percentage threshold δ is then set. th If δ≥δ th If so, then the two similar chains will be set as differentially similar chains; Step S205: Summarize all target logical chains that are similar to each other to generate several sets of similar chains. Randomly select one set of similar chains, and randomly select two target logical chains from the selected set of similar chains. If the two target logical chains are differentially similar chains, then set the differential elements in the two logical chains as exclusion elements to generate a set of exclusion elements for the selected set of similar chains. If the two target logical chains are not differentially similar chains, then set the differential elements in the two target logical chains as valid elements, and delete the valid elements contained in the set of exclusion elements to obtain a corrected set of exclusion elements. Example 2: Locate the elements "good attitude towards admitting guilt" in the first paragraph and "lighter punishment" in the fourth paragraph in the document; establish a two-dimensional coordinate system and determine that "good attitude towards admitting guilt" is located earlier than "lighter punishment" in the text, thus establishing the influence relationship between "good attitude towards admitting guilt" and "lighter punishment"; connect multiple effective element groups to form a logical chain: "Theft → amount of crime 5,000 yuan → good attitude towards admitting guilt → lighter punishment → six months of imprisonment"; Comparing the logical chain of another judgment: "Theft → Amount of crime: 10,000 yuan → Refusal to plead guilty → Aggravated punishment → Two years imprisonment," we find the same elements are "theft," "amount of crime," and "imprisonment," resulting in a similarity S = 3 / 5 = 60%. If S... th If the percentage is 50%, it is considered a similar chain, but "attitude towards admitting guilt" and "refusal to admit guilt" are exclusionary factors.

[0019] Step S300: Based on the real-time collected case elements and logical chains, generate relevant legal provisions for element matching; based on the exclusion of logical chains, identify the most applicable provisions and generate the initial document; Step S300 includes the following steps: Step S301: Pre-build a legal provisions database and store all legal provisions. Compare each element in any logical chain with each legal provision. If a legal provision is the same as a certain element, then set that legal provision as the legal provision of the logical chain. Step S302: Whenever a new case is collected in real time, extract the text content of the new case to generate several elements; arbitrarily select a set of similar chains, arbitrarily select a logical chain from the selected set of similar chains, and compare several elements with the elements contained in the selected logical chain to obtain N identical elements. ’ Let N be the total number of elements. total The similarity S between several elements and the selected logical chain is calculated. ’ =N ’ / N total; Obtain the similarity between several elements and the remaining logical chains, and select the maximum similarity S. ’ (max) represents the similarity of the selected similar chain set. If the similarity of the selected similar chain set exceeds the preset similarity threshold, the selected similar chain set will be set as the target chain set. Step S303: Obtain a set of several target chains matching the new case. Randomly select a logical chain from any target chain set. If the similarity between the selected logical chain and several elements exceeds the similarity threshold, extract the legal provisions of the selected logical chain and use it as a relevant legal provision of the new case to generate several relevant legal provisions corresponding to the new case. Step S304: Randomly select a target chain set, extract the set of exclusion elements of the selected target chain set, if a new case has an element that is the same as an exclusion element in the exclusion element set, then exclude the relevant legal provisions corresponding to each logical chain in the selected target chain set, and revise the relevant legal provisions corresponding to the new case; compare the order relationship between the same elements with the remaining logical chains, mark the same elements with different positions and count the number of marks, if the number of marks exceeds the number percentage threshold, then exclude the relevant legal provisions corresponding to the remaining logical chains with different positions, and revise the relevant legal provisions corresponding to the new case a second time; Step S305: Extract the revised relevant legal provisions, extract each logical chain corresponding to any relevant legal provision, select the relevant legal provision corresponding to the logical chain with the highest similarity and set it as the most applicable provision; retrieve the preset text template library, combine several elements and the most applicable provision, automatically fill the element content into the corresponding position of the template, and generate the initial document.

[0020] Step S400: Conduct confidence assessment on each element of the initial document; optimize the text of the initial document based on the assessment results, and provide risk warnings for potential elements; Step S400 includes the following steps: Step S401: Randomly select an element from the initial document, count the number of times the selected element appears in various judicial documents, and calculate the first frequency of occurrence p1 of the selected element; extract the logical chains constructed by each element in the initial document, obtain the legal provisions of the initial document, count the number of times the selected element appears in each logical chain of the same legal provision, and calculate the second frequency of occurrence p2 of the selected element; according to the formula: ; Calculate the confidence level z of the selected elements; preset a confidence level evaluation threshold z. th If z≥zth If z < z th If so, the selected elements will be set as low-confidence elements; Step S402: Insert editable annotation prompts at the corresponding positions of any low-confidence elements in the initial document, and perform grammatical compliance checks and logical coherence checks on high-confidence elements to form a complete judicial document.

[0021] A document intelligent generation system, comprising a historical document parsing module, a document logic analysis module, a clause matching generation module, and a document confidence optimization module; The historical document parsing module is used to perform structured parsing of historical judicial documents and extract elements from the documents; based on the element extraction results of different judicial documents, it establishes relationships between different elements; The document logic analysis module is used to construct the logical chain of a document based on the relationship between elements in any judicial document; compare the logical chains of different judicial documents; and identify the elements that contradict logical chains. The clause matching and generation module is used to generate relevant legal clauses that match the case elements and logical chains collected in real time; based on the exclusion of logical chains, it identifies the most applicable clauses and generates the initial document; The document confidence optimization module is used to assess the confidence level of each element of the initial document; based on the assessment results, it optimizes the text of the initial document and provides risk warnings for potential elements.

[0022] The historical document parsing module includes a document element extraction unit and a document element association unit; The document element extraction unit is used to perform structured analysis on historical judicial documents and extract elements from the documents; the document element association unit is used to establish association relationships between different elements based on the element extraction results of different judicial documents.

[0023] The document logic analysis module includes a document logic construction unit and a document logic constraint unit. The document logic construction unit is used to construct the logical chain of a document based on the relationship between elements in any judicial document; the document logic constraint unit is used to compare the logical chains of different judicial documents and identify the elements that exclude logical chains.

[0024] The clause matching and generation module includes a clause recommendation and matching unit and an initial document generation unit; The clause recommendation and matching unit is used to generate relevant legal clauses that match the case elements and logical chains collected in real time; the initial document generation unit is used to identify the most applicable clauses and generate the initial document based on the exclusion of logical chains.

[0025] The document confidence optimization module includes a recommendation confidence assessment unit and a document generation optimization unit. The recommended confidence assessment unit is used to assess the confidence level of each element of the initial document; the document optimization unit is used to optimize the text of the initial document based on the assessment results and to provide risk warnings for potential elements.

[0026] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.

Claims

1. A method for intelligent document generation in the judicial field, characterized in that: The generation method includes the following steps: Step S100: Perform structured analysis on historical judicial documents and extract elements from the documents; based on the element extraction of different judicial documents, establish relationships between different elements; Step S200: Based on the correlation of elements in any judicial document, construct the logical chain of the document; compare the logical chains of different judicial documents, and identify the elements that exclude logical chains; Step S300: Based on the real-time collected case elements and logical chains, generate relevant legal provisions for element matching; based on the exclusion of logical chains, identify the most applicable provisions and generate the initial document; Step S400: Conduct confidence assessment on each element of the initial document; optimize the text of the initial document based on the assessment results, and provide risk warnings for potential elements.

2. The intelligent document generation method for the judicial field according to claim 1, characterized in that: Step S100 includes the following steps: Step S101: Pre-build a document database to store all historically uploaded judicial documents, and randomly retrieve one judicial document from it. Use natural language processing technology to perform word segmentation and part-of-speech tagging on the document text to obtain several word groups; retrieve the pre-built document entity database, which stores several document entities, among which any document entity matches the corresponding entity recognition rule. Step S102: Randomly retrieve the entity recognition rules of a document entity and perform entity recognition on each word group. If a word group that matches the rules is identified, set the word group that matches the rules as an element of the retrieved document entity and retrieve a new document entity. If no word group is identified, retrieve a new document entity and perform recognition again until all document entities have been identified, and obtain several elements of the retrieved judicial document to generate an element set. Step S103: Obtain the element sets of each judicial document in the document database, randomly select two elements from the retrieved judicial documents and set them as target element groups; compare the target element groups with the element sets of the remaining judicial documents. If a judicial document's element set contains the target element groups, then set that judicial document as the target document, count the number of target documents as A, and set the total number of judicial documents as A. total The calculated percentage of target documents is η = A / A. total Preset a quantity percentage threshold η th If η≥η th Then, establish a relationship between the two elements of the target element group and set the target element group as a valid element group; construct the relationship between the various elements in the retrieved judicial documents to obtain several valid element groups of the retrieved judicial documents.

3. The intelligent document generation method for the judicial field according to claim 2, characterized in that: Step S200 includes the following steps: Step S201: Randomly select a judicial document, obtain several effective element groups in the selected judicial document, and randomly select one effective element group. Set two elements in the selected effective element group as the first element and the second element respectively, and obtain the text area of ​​the word group corresponding to the first element and the text area of ​​the second element in the selected judicial document. Step S202: Establish a two-dimensional index coordinate system for the selected judicial documents to obtain the coordinate range corresponding to any text in the selected judicial documents. Obtain the first region coordinate range of the text area where the first element is located and the second region coordinate range of the text area where the second element is located. Randomly select a position coordinate from the first region coordinate range and compare the selected coordinate position with the second region coordinate range. Set the selected position coordinate as (x0, y0) and the minimum coordinate in the second region coordinate range as (x1, y1). When y0 = y1 and x0 < y1, or when y0 > y1, set the association logic in the selected effective element group to the first element affecting the second element. Step S203: Obtain the internal association logic of all valid element groups in the selected judicial documents. Randomly select two valid element groups and extract the association logic between the two valid element groups. If the affected element in one valid element group is the influencing element of the other valid element group, then establish a logical chain between the two valid element groups. Connect all valid element groups in the selected judicial documents with association logic to obtain several logical chains. Step S204: Obtain all logical chains contained in each judicial document, arbitrarily select two logical chains and set them as target logical chains; count the number of identical elements between the two target logical chains, which is N. sim The number of differential elements is N dif The element similarity between the two target logical chains is calculated to be S=N. sim / (N sim +N dif A similarity threshold S is preset. th If S≥S th Then, the two target logical chains are set as similar chains, and the positional order of the same elements in the two similar chains is extracted. The position of any identical element in each of the two similar chains is obtained among all identical elements. If the position of a certain identical element differs, that identical element is marked, and the number of marks is counted as m. The total number of identical elements is set as N1, and the percentage of marked elements is obtained as δ = m / N1. A preset percentage threshold δ is then set. th If δ≥δ th If so, then the two similar chains will be set as differentially similar chains; Step S205: Summarize all target logical chains that are similar to each other to generate several sets of similar chains. Randomly select one set of similar chains, and randomly select two target logical chains from the selected set. If the two target logical chains are differentially similar chains, then set the differential elements in the two logical chains as exclusionary elements to generate a set of exclusionary elements for the selected set of similar chains. If the two target logical chains are not differentially similar chains, then set the differential elements in the two target logical chains as valid elements, and delete the valid elements contained in the set of exclusionary elements to obtain a corrected set of exclusionary elements.

4. The intelligent document generation method for the judicial field according to claim 3, characterized in that: Step S300 includes the following steps: Step S301: Pre-build a legal provisions database and store all legal provisions. Compare each element in any logical chain with each legal provision. If a legal provision is the same as a certain element, then set that legal provision as the legal provision of the logical chain. Step S302: Whenever a new case is collected in real time, extract the text content of the new case to generate several elements; arbitrarily select a set of similar chains, arbitrarily select a logical chain from the selected set of similar chains, and compare several elements with the elements contained in the selected logical chain to obtain N identical elements. ’ Let N be the total number of elements. total The similarity S between several elements and the selected logical chain is calculated. ’ =N ’ / N total ; Obtain the similarity between several elements and the remaining logical chains, and select the maximum similarity S. ’ (max) represents the similarity of the selected similar chain set. If the similarity of the selected similar chain set exceeds the preset similarity threshold, the selected similar chain set will be set as the target chain set. Step S303: Obtain a set of several target chains matching the new case. Randomly select a logical chain from any target chain set. If the similarity between the selected logical chain and several elements exceeds the similarity threshold, extract the legal provisions of the selected logical chain and use it as a relevant legal provision of the new case to generate several relevant legal provisions corresponding to the new case. Step S304: Randomly select a target chain set, extract the set of exclusion elements of the selected target chain set, if a new case has an element that is the same as an exclusion element in the exclusion element set, then exclude the relevant legal provisions corresponding to each logical chain in the selected target chain set, and revise the relevant legal provisions corresponding to the new case; compare the order relationship between the same elements with the remaining logical chains, mark the same elements with different positions and count the number of marks, if the number of marks exceeds the number percentage threshold, then exclude the relevant legal provisions corresponding to the remaining logical chains with different positions, and revise the relevant legal provisions corresponding to the new case a second time; Step S305: Extract the revised relevant legal provisions, extract each logical chain corresponding to any relevant legal provision, select the relevant legal provision corresponding to the logical chain with the highest similarity and set it as the most applicable provision; retrieve the preset text template library, combine several elements and the most applicable provision, automatically fill the element content into the corresponding position of the template, and generate the initial document.

5. The intelligent document generation method for the judicial field according to claim 4, characterized in that: Step S400 includes the following steps: Step S401: Randomly select an element from the initial document, count the number of times the selected element appears in various judicial documents, and calculate the first frequency of occurrence p1 of the selected element; extract the logical chains constructed by each element in the initial document, obtain the legal provisions of the initial document, count the number of times the selected element appears in each logical chain of the same legal provision, and calculate the second frequency of occurrence p2 of the selected element; according to the formula: ; Calculate the confidence level z of the selected elements; preset a confidence level evaluation threshold z. th If z≥z th If z < z th If so, the selected elements will be set as low-confidence elements; Step S402: Insert editable annotation prompts at the corresponding positions of any low-confidence elements in the initial document, and perform grammatical compliance checks and logical coherence checks on high-confidence elements to form a complete judicial document.

6. A document intelligent generation system, used to execute the document intelligent generation method for the judicial field according to any one of claims 1-5, characterized in that: The generation system includes a historical document parsing module, a document logic analysis module, a clause matching generation module, and a document confidence optimization module; The historical document parsing module is used to perform structured parsing of historical judicial documents and extract elements from the documents; based on the element extraction of different judicial documents, it establishes correlations between different elements. The document logic analysis module is used to construct a logical chain of a document based on the relationship between elements in any judicial document; compare the logical chains of different judicial documents; and identify elements that exclude logical chains. The clause matching and generation module is used to generate relevant legal clauses for element matching based on the case elements and logical chains collected in real time; and to identify the most applicable clauses and generate the initial document based on the exclusion of logical chains. The document confidence optimization module is used to assess the confidence level of each element of the initial document; optimize the text of the initial document based on the assessment results; and provide risk warnings for potential elements.

7. The document intelligent generation system according to claim 6, characterized in that: The historical document parsing module includes a document element extraction unit and a document element association unit; The document element extraction unit is used to perform structured analysis on historical judicial documents and extract elements from the documents; the document element association unit is used to establish association relationships between different elements based on the element extraction status of different judicial documents.

8. The document intelligent generation system according to claim 6, characterized in that: The document logic analysis module includes a document logic construction unit and a document logic constraint unit; The document logic construction unit is used to construct a logical chain of a document based on the correlation of elements in any judicial document; the document logic constraint unit is used to compare the logical chains of different judicial documents and identify the exclusionary elements that exclude logical chains.

9. A document intelligent generation system according to claim 6, characterized in that: The clause matching and generation module includes a clause recommendation and matching unit and an initial document generation unit; The provision recommendation and matching unit is used to generate relevant legal provisions for element matching based on the case elements and logical chains collected in real time. The initial document generation unit is used to identify the most applicable clause and generate an initial document based on the exclusion of logical chains.

10. A document intelligent generation system according to claim 6, characterized in that: The document confidence optimization module includes a recommendation confidence assessment unit and a document generation optimization unit; The recommendation confidence assessment unit is used to assess the confidence level of each element of the initial document; the document generation optimization unit is used to optimize the text of the initial document based on the assessment results and to provide risk warnings for potential elements.