Document generation method based on large model and knowledge graph fusion
By integrating the big model with the knowledge graph, building a knowledge graph and generating law enforcement documents, the problems of irregular generation of Chinese documents and difficulty in traceability of information in the existing technology have been solved, and high accuracy and standardized document generation have been achieved, and intelligent law enforcement has been supported.
Patent Information
- Application Number
- CN202411797534.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-03-28
AI Technical Summary
In the field of document generation, the existing single implementation method based on large models is not ideal in dealing with irregular unstructured documents and the diversity of legal provisions, resulting in irregular document generation and difficulty in traceability of information.
By integrating the big model with the knowledge graph, using the big model to assist in building the knowledge graph, extracting case content from unstructured data, and combining the knowledge graph to generate law enforcement documents. Specific steps include the extraction of knowledge entities, the extraction of unstructured document content, the complex search of case data, and the generation of law enforcement documents.
It improves the accuracy and standardization of the generation of law enforcement documents, solves the problems of long writing cycles, irregular content, and difficult information traceability, and realizes the electronicization of intelligent law enforcement throughout the process.
Smart Images

Figure CN119719386A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a document generation method based on the fusion of large models and knowledge graphs, specifically based on the knowledge extraction capabilities of large and small models, the complex retrieval capabilities of large models, and the document generation capabilities of the fusion of large models and knowledge graphs, and belongs to the field of large models and knowledge graphs. Background Art
[0002] Applications based on big models or knowledge graphs are now relatively mature. However, in the field of document generation, non-standard unstructured documents and the diversity of legal clauses are important factors affecting document generation. The current single implementation method based on big models is not ideal in actual business. Summary of the invention
[0003] The purpose of this invention is to use the technology of integrating big models with knowledge graphs, use big models to assist in the construction of knowledge graphs, extract case content from unstructured data, and combine with knowledge graphs to form law enforcement documents.
[0004] In order to achieve the above object, the technical solution of the present invention is to disclose a document generation method based on the fusion of a large model and a knowledge graph, which is characterized by comprising the following steps:
[0005] Step 1: Knowledge entity extraction:
[0006] Collect structured or unstructured data from various case-related data sources;
[0007] Pre-process the collected structured or unstructured data, and correct or delete the noise data and erroneous data in the data to ensure the quality of the data;
[0008] Use a large model to extract case entities from pre-processed structured or unstructured data;
[0009] Step 2: Extract unstructured document content from structured or unstructured data:
[0010] Step 201: parse the unstructured case text to determine the format and structural characteristics of the text;
[0011] Step 202: input the parsed unstructured case text into the trained large model 2, and use the large model 2 to extract the core content of the parsed unstructured case text;
[0012] Step 203: post-process the core content obtained by the second extraction of the large model, remove redundant information, and further organize and optimize the extraction results;
[0013] Step 3: Complex retrieval of case data:
[0014] Step 301: When case search data is received, the search requirements are understood and analyzed using the big model 3, and case entities are extracted and case-related summaries and labels are generated; case-related entities and information are converted into query statements or query conditions suitable for searching in the knowledge graph;
[0015] Step 302: Optimize the retrieval strategy using the big model 4, and provide an efficient retrieval strategy for the retrieval process based on the dynamic learning of the knowledge graph structure and data distribution by the big model 4;
[0016] Step 303: Use the query statement or query condition obtained in step 301 and the optimized search strategy obtained in step 302 to perform a search in the database storing the knowledge graph;
[0017] Step 304: Use the large model 5 to screen and sort the preliminary results obtained by the search;
[0018] Step 4: Generate law enforcement documents:
[0019] Step 401: Select a corresponding predefined document template according to the case type. Different predefined document templates specify the basic structure and format of law enforcement documents.
[0020] Step 402: Obtain general framework information related to the case type from the knowledge graph, further refine and customize the predefined document template, and ensure that the generated document framework complies with laws, regulations and business specifications;
[0021] Step 403: Integrate the core content extracted from the unstructured case text in step 2 and the relevant information obtained by the knowledge retrieval in step 3, and generate corresponding content at corresponding positions based on the requirements of the predefined document template;
[0022] Step 404: using the relationships and attribute constraints in the knowledge graph, standardize and supplement the content details in the document obtained in step 403;
[0023] Step 405: typeset and integrate the content processed in step 404 according to the format of the predefined document template to generate a complete law enforcement document, and at the same time, add necessary identification information to the generated law enforcement document;
[0024] Step 5: Law enforcement document evaluation:
[0025] Establish an evaluation index system: determine a series of indicators for evaluating the quality of law enforcement documents, including accuracy, completeness, standardization, logic, and language expression quality, among which: accuracy evaluates whether the factual statements and legal clauses in the document are correct; completeness measures whether the document covers all the key information it should have; standardization checks whether the document format and wording conform to the standard specifications of legal documents; logic focuses on whether the reasoning and argumentation of the document content are reasonable and coherent; language expression quality examines the fluency of sentences, richness of vocabulary and appropriateness; set clear quantitative or qualitative evaluation standards for each indicator;
[0026] The law enforcement documents are input into Big Model 6, and are integrated with relevant case background information and some key information in the knowledge graph as input data for Big Model 6. Big Model 6 uses its ability to understand legal knowledge, language norms, and logical reasoning to evaluate various indicators of the law enforcement documents. Big Model 6 outputs the evaluation results of the law enforcement documents.
[0027] Preferably, in step 1, the structured or unstructured data collected includes case files, legal and regulatory databases, and law enforcement records.
[0028] Preferably, in step 1, the preprocessing includes data cleaning and format conversion, wherein the unstructured data is segmented and stop word removal is performed.
[0029] Preferably, in step 201, the unstructured case text includes a case statement in plain text format, a text converted from a scanned paper document, and a complex document containing tables and charts, and corresponding preprocessing operations are performed for different types of unstructured case texts:
[0030] For case statements in plain text format, basic text cleaning including removing extra spaces and line breaks is performed;
[0031] For the converted text of the scanned paper document, further processing is performed on the characters with recognition errors;
[0032] For complex documents containing tables and charts, extract the data in the tables and the key information in the charts and convert them into text format that can be processed by large models.
[0033] Preferably, in step 202, the core content includes the key facts of the case, the main characters involved and their roles, important time nodes and location information, and the controversial focus of the case.
[0034] Preferably, in step 303, during the retrieval process, the large model provides language-related capabilities including exact matching, fuzzy matching, and semantic matching.
[0035] Preferably, in step 304, the sorting criteria include the importance of the node, the degree of matching with the search conditions, and the relevance to the current case or the focus of the user.
[0036] Preferably, the step 404 further includes the following contents:
[0037] Use databases and knowledge graphs to check whether the content of the generated documents is within the scope of the knowledge graph, and avoid statements that conflict with the existing legal knowledge and business rules in the graph;
[0038] Use the big model to optimize the language of the document content to make it clear, accurate, concise and standardized, including: checking whether the sentences are fluent, whether the vocabulary is used appropriately, and avoiding the use of vague, ambiguous or overly colloquial expressions;
[0039] Use the big model to process the logical coherence of the document content to ensure natural transitions between each part and reasonable reasoning.
[0040] Preferably, in step 5, the large model 6 judges the accuracy, completeness, standardization, logic and language expression of the law enforcement document by means of semantic analysis of the content of the law enforcement document, comparison with standard information in the knowledge graph and features of excellent document examples learned by itself.
[0041] Preferably, in step 5, manual evaluation is introduced outside of the large model six, and the law enforcement documents are processed accordingly, appropriately marked or segmented to facilitate the presentation of the document content in an intuitive manner, and manually scored or rated according to the evaluation index system; the evaluation results and analysis are fed back to optimize the law enforcement document generation process, and the quality and level of law enforcement document generation are continuously improved through continuous evaluation, feedback and optimization.
[0042] Based on the existing text generation based entirely on big models, the present invention integrates big models with knowledge graphs, and provides a technical solution for document generation technology based on the integration of big models and knowledge graphs, which is an innovative application of artificial intelligence technology and business scenarios. The present invention uses big models to assist in the construction of knowledge graphs, and uses knowledge graphs to assist big models in the generation of law enforcement documents. Through document generation technology, it assists traditional manual document writing, and solves the problems of long document writing cycles, non-standard content, and difficult information tracing in traditional models. The present invention further increases the accuracy and standardization of law enforcement document generation, while improving the effect of document writing, and realizes the full electronicization of intelligent law enforcement in a true sense. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 This is a core model architecture diagram of the present invention. DETAILED DESCRIPTION
[0044] The present invention will be further described below in conjunction with specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not intended to limit the scope of the present invention. In addition, it should be understood that after reading the content taught by the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms fall within the scope limited by the appended claims of the application equally.
[0045] like Figure 1 As shown, a document generation method based on the fusion of a large model and a knowledge graph disclosed in an embodiment of the present invention specifically includes the following steps:
[0046]
Step 1
[0047] Collect data (structured or unstructured data) from various case-related data sources, including but not limited to case files, legal and regulatory databases, law enforcement records, etc.
[0048] Preprocess the collected data, including data cleaning, format conversion and other operations. For unstructured data, such as text data, perform word segmentation, remove stop words and other processing to improve the accuracy of subsequent knowledge extraction. At the same time, correct or delete the noise data and erroneous data in the data to ensure the quality of the data.
[0049] The big model is used to extract case entities from the preprocessed data. With its powerful language understanding ability, the big model can identify various entities in the case, such as the parties (including investigators, persons under investigation, etc.), case facts, legal clauses involved, time, place, etc.
[0050]
Step 2
[0051] First, parse the unstructured case text to determine the format and structural characteristics of the text. Unstructured case text may include various types, such as case statements in plain text format, text converted from scanned paper documents, complex documents containing tables and charts, etc. Perform corresponding preprocessing operations for different types of text. For plain text, perform basic text cleaning, such as removing extra spaces, line breaks, etc.; for text converted from scanned documents, further processing may be required for problems such as misidentified characters; for text containing tables and charts, try to extract the data in the table and the key information of the chart, and convert it into a text format that can be processed by the large model.
[0052] The prepared text is then input into a trained large model (which can be a language large model or a multimodal large model), and the large model is used to extract the core content from the preprocessed data. The core content includes but is not limited to the key facts of the case (such as the cause, process, result and other main plots of the incident), the main characters involved and their roles (such as the investigator, the person under investigation, etc.), important time nodes and location information, and the focus of the case.
[0053] The core content extracted from the large model is post-processed to remove redundant information and further organize and optimize the extraction results.
[0054]
Step 3
[0055] When case retrieval data is received, the big model is used to understand and analyze the retrieval requirements, extract case entities and generate case-related summaries and labels, etc. The case-related entities and information are converted into query statements or query conditions suitable for retrieval in the knowledge graph.
[0056] Use big models to optimize retrieval strategies, and provide efficient retrieval strategies for the retrieval process based on the dynamic learning of knowledge graph structure and data distribution by big models, including predicting which nodes or relationships.
[0057] Using query statements and optimized retrieval strategies, retrieval is performed in the database storing the knowledge graph. During the retrieval process, the big model provides language-related capabilities such as exact matching, fuzzy matching, and semantic matching.
[0058] The preliminary results obtained from the search are screened and sorted using a large model. The sorting criteria may include the importance of the node, the degree of match with the search criteria, the relevance to the current case or the focus of the user, etc.
[0059]
Step 4
[0060] Select the corresponding predefined document template according to the case type. Different document templates specify the basic structure and format of law enforcement documents, including title, header, body, and footer. Obtain the general framework information related to the case type from the knowledge graph, further refine and customize the document template, and ensure that the generated document framework complies with laws, regulations, and business specifications.
[0061] Integrate the core content extracted from the unstructured case text in step 2 (such as case facts, party information, etc.) and the relevant information obtained from the knowledge retrieval in step 3 (such as the handling process of similar cases, applicable legal provisions and interpretations, etc.). According to the requirements of the document template, use this information to generate corresponding content in the corresponding position.
[0062] Use the relationships and attribute constraints in the knowledge graph to standardize and supplement the content details in the document to ensure the reliability of the large model generation. Use the database and knowledge graph to check whether the generated document content is within the scope of the knowledge graph to avoid statements that conflict with the existing legal knowledge and business rules in the graph.
[0063] Use the big model to optimize the language of the document content to make it clear, accurate, concise and standardized. Check whether the sentences are smooth and the vocabulary is appropriate, and avoid using vague, ambiguous or overly colloquial expressions. Use the big model to process the logical coherence of the document content to ensure that the transition between each part is natural and the argument is reasonable.
[0064] The processed content is typeset and integrated according to the format of the document template to generate a complete law enforcement document. Documents in various formats, such as PDF, Word documents, etc., can be generated to meet different usage requirements. At the same time, necessary identification information is added to the generated document, such as document number, generation date, generation system identification, etc., to facilitate document management and traceability.
[0065]
Step 5
[0066] Establish an evaluation index system: determine a series of indicators for evaluating the quality of law enforcement documents, including but not limited to accuracy, completeness, standardization, logic, and language quality. Accuracy evaluates whether the factual statements and legal clause citations in the document are correct; completeness measures whether the document covers all the key information it should have, such as party information, the full picture of the case facts, the legal basis and the results of the handling; standardization checks whether the document format and wording meet the standard specifications of legal documents; logic focuses on whether the reasoning and argumentation of the document content are reasonable and coherent; language quality examines the fluency of sentences, the richness of vocabulary and appropriateness, etc. Set clear quantitative or qualitative evaluation standards for each indicator so that the document can be evaluated objectively.
[0067] The document is input into the big model, and is integrated with relevant case background information, some key information in the knowledge graph, etc. as input data for the big model, so that the big model can comprehensively consider various factors during evaluation and improve the accuracy and effectiveness of the evaluation. The big model uses its ability to understand legal knowledge, language norms, and logical reasoning to evaluate various indicators of the document. The big model judges the performance of the document in terms of accuracy, completeness, standardization, logic, and language expression by semantic analysis of the content of the document, comparison with standard information in the knowledge graph, and the characteristics of excellent document examples learned by itself. The big model outputs the evaluation results of the law enforcement document, including the scores or ratings of various indicators, as well as detailed comments and suggestions.
[0068] Introduce manual evaluation outside the big model, process the documents accordingly, and make appropriate marks or segmentation to facilitate the presentation of the document content in an intuitive manner, and manually score or rate them based on the evaluation indicator system.
[0069] Feedback the evaluation results and analysis to optimize the document generation process. Through continuous evaluation, feedback and optimization, the quality and level of law enforcement document generation will be continuously improved.
Claims
1. A document generation method based on the fusion of a large model and a knowledge graph, characterized in that: The following steps are involved: Step 1: Knowledge entity extraction: Collect structured or unstructured data from various case-related data sources; Pre-process the collected structured or unstructured data, and correct or delete the noise data and erroneous data in the data to ensure the quality of the data; Use a large model to extract case entities from pre-processed structured or unstructured data; Step 2: Extract unstructured document content from structured or unstructured data: Step 201: parse the unstructured case text to determine the format and structural characteristics of the text; Step 202: input the parsed unstructured case text into the trained large model 2, and use the large model 2 to extract the core content of the parsed unstructured case text; Step 203: post-process the core content obtained by the second extraction of the large model, remove redundant information, and further organize and optimize the extraction results; Step 3: Complex retrieval of case data: Step 301: When case search data is received, the search requirements are understood and analyzed using the big model 3, and case entities are extracted and case-related summaries and labels are generated; case-related entities and information are converted into query statements or query conditions suitable for searching in the knowledge graph; Step 302: Optimize the retrieval strategy using the big model 4, and provide an efficient retrieval strategy for the retrieval process based on the dynamic learning of the knowledge graph structure and data distribution by the big model 4; Step 303: Use the query statement or query condition obtained in step 301 and the optimized search strategy obtained in step 302 to perform a search in the database storing the knowledge graph; Step 304: Use the large model 5 to screen and sort the preliminary results obtained by the search; Step 4: Generate law enforcement documents: Step 401: Select a corresponding predefined document template according to the case type. Different predefined document templates specify the basic structure and format of law enforcement documents. Step 402: Obtain general framework information related to the case type from the knowledge graph, further refine and customize the predefined document template, and ensure that the generated document framework complies with laws, regulations and business specifications; Step 403: Integrate the core content extracted from the unstructured case text in step 2 and the relevant information obtained by the knowledge retrieval in step 3, and generate corresponding content at corresponding positions based on the requirements of the predefined document template; Step 404: using the relationships and attribute constraints in the knowledge graph, standardize and supplement the content details in the document obtained in step 403; Step 405: typeset and integrate the content processed in step 404 according to the format of the predefined document template to generate a complete law enforcement document, and at the same time, add necessary identification information to the generated law enforcement document; Step 5: Law enforcement document evaluation: Establish an evaluation index system: determine a series of indicators for evaluating the quality of law enforcement documents, including accuracy, completeness, standardization, logic, and language expression quality, among which: accuracy evaluates whether the factual statements and legal clauses in the document are correct; completeness measures whether the document covers all the key information it should have; standardization checks whether the document format and wording conform to the standard specifications of legal documents; logic focuses on whether the reasoning and argumentation of the document content are reasonable and coherent; language expression quality examines the fluency of sentences, richness of vocabulary and appropriateness; set clear quantitative or qualitative evaluation standards for each indicator; The law enforcement documents are input into Big Model 6, and are integrated with relevant case background information and some key information in the knowledge graph as input data for Big Model 6. Big Model 6 uses its ability to understand legal knowledge, language norms, and logical reasoning to evaluate various indicators of the law enforcement documents. Big Model 6 outputs the evaluation results of the law enforcement documents.
2. A document generation method based on the fusion of a large model and a knowledge graph as claimed in claim 1, characterized in that: In step 1, the structured or unstructured data collected include case files, legal and regulatory databases, and law enforcement records.
3. The document generation method based on the fusion of a large model and a knowledge graph as claimed in claim 1 is characterized in that: In step 1, the preprocessing includes data cleaning and format conversion, wherein the unstructured data is segmented and stop words are removed.
4. The document generation method based on the fusion of a large model and a knowledge graph as claimed in claim 1 is characterized in that: In step 201, the unstructured case text includes a case statement in plain text format, a text converted from a scanned paper document, and a complex document containing tables and charts. Corresponding preprocessing operations are performed for different types of unstructured case texts: For case statements in plain text format, basic text cleaning including removing extra spaces and line breaks is performed; For the converted text of the scanned paper document, further processing is performed on the characters with recognition errors; For complex documents containing tables and charts, extract the data in the tables and the key information in the charts and convert them into text format that can be processed by large models.
5. The document generation method based on the fusion of a large model and a knowledge graph as claimed in claim 1 is characterized in that: In step 202, the core content includes the key facts of the case, the main characters involved and their roles, important time nodes and location information, and the controversial focus of the case.
6. The document generation method based on the fusion of a large model and a knowledge graph as claimed in claim 1, characterized in that: In step 303, during the retrieval process, the large model provides language-related capabilities including exact matching, fuzzy matching, and semantic matching.
7. The document generation method based on the fusion of a large model and a knowledge graph as claimed in claim 1 is characterized in that: In step 304, the sorting criteria include the importance of the node, the degree of matching with the search criteria, and the relevance to the current case or the focus of the user.
8. The document generation method based on the fusion of a large model and a knowledge graph as claimed in claim 1 is characterized in that: The step 404 further includes the following contents: Use databases and knowledge graphs to check whether the content of the generated documents is within the scope of the knowledge graph, and avoid statements that conflict with the existing legal knowledge and business rules in the graph; Use the big model to optimize the language of the document content to make it clear, accurate, concise and standardized, including: checking whether the sentences are fluent, whether the vocabulary is used appropriately, and avoiding the use of vague, ambiguous or overly colloquial expressions; Use the big model to process the logical coherence of the document content to ensure natural transitions between each part and reasonable reasoning.
9. The document generation method based on the fusion of a large model and a knowledge graph as claimed in claim 1 is characterized in that: In step 5, the large model 6 judges the accuracy, completeness, standardization, logic and language expression of the law enforcement document by means of semantic analysis of the content of the law enforcement document, comparison with the standard information in the knowledge graph and the characteristics of excellent document examples learned by itself.
10. The document generation method based on the fusion of a large model and a knowledge graph as claimed in claim 1, characterized in that: In step 5, manual evaluation is introduced outside of the large model 6. The law enforcement documents are processed accordingly and appropriately marked or segmented to facilitate the presentation of the document content in an intuitive manner. Manual scoring or rating is performed based on the evaluation index system. The evaluation results and analysis are fed back to optimize the law enforcement document generation process. Through continuous evaluation, feedback and optimization, the quality and level of law enforcement document generation are continuously improved.
Citation Information
Cited By
Training method of controllable and credible official document generation model
CN119988648A
A training method for a controllable and trustworthy official document generation model
CN119988648B
Large-model-driven intelligent bidding document generation method and system for petrochemical energy marine transportation industry
CN120508634A
Legal information processing method fusing knowledge graph and large language model
CN121257698A