Industrial file generation method and device based on large model
Through the industry file generation method based on big model, combined with user interaction, data management and knowledge retrieval, the industry file problem that existing technology is difficult to generate complex structures and specific domain knowledge is solved, and efficient and excellent quality official documents are achieved, which improves the production of Efficiency and consistency of government affairs work.
Patent Information
- Application Number
- CN202410918590.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2024-12-27
AI Technical Summary
Existing intelligent assisted writing tools fail to make full use of large-scale pre-trained language models, and it is difficult to generate industry files with complex structures and domain-specific knowledge, and cannot meet the efficient and high-quality needs of industry file generation.
Using a large-model-based industry file generation method, the user-side module, control-side module, application algorithm module, large-model module and knowledge base module can achieve efficient and high-quality generation of industry files, combining industry knowledge graph and natural language generation technology , supports the selection of official document types, information filling, retrieval, editing and expansion, and uses dual recall mechanisms and preprocessing technology to ensure the accuracy and consistency of content.
It has improved work efficiency, improved the quality and consistency of official documents, reduced the pressure on human resources, realized real-time information updates and knowledge sharing, met the needs of diversified government document writing, and significantly improved the efficiency of government affairs work.
Smart Images

Figure CN119203961A_ABST
Abstract
Description
Technical Field
[0001] The invention discloses a method and a device, which relate to the field of artificial intelligence technology, and in particular to a method and a device for generating industry documents based on a large model. Background Art
[0002] With the rapid development of artificial intelligence technology, large-scale language models based on deep learning have demonstrated excellent semantic understanding and generation capabilities, and can generate high-quality text content in various scenarios. However, in the industry, there are many challenges such as high standardization requirements and rapid information updates.
[0003] Although there are currently a small number of intelligent assisted writing tools applied in certain industry fields, most solutions do not fully utilize the capabilities of large pre-trained language models to understand and generate industry documents with complex structures and specific domain knowledge. Summary of the invention
[0004] In view of the problems of the prior art, the present invention provides a method and device for generating industry documents based on a large model, which realizes efficient and high-quality generation of industry documents and provides powerful technical support for government affairs.
[0005] The specific scheme proposed by the present invention is:
[0006] The present invention provides an industry file generation method based on a large model, wherein the industry file generation device is used to generate the industry file. The industry file generation device includes a user end module, a control end module, an application algorithm module, a large model module and a knowledge base module.
[0007] The industry document generation process includes the following steps:
[0008] S1: Select the document type through the user-side module, fill in the basic information of the document, trigger the document generation request, and pass the request information to the control-side module;
[0009] S2: The control module matches the corresponding prompt template according to the document type, fills in the basic information of the document, and initiates a search request to the knowledge base module;
[0010] S3: The knowledge base module receives the search request, executes the two-way recall mechanism to find similar documents, forms the search results, and returns the search results to the control end module;
[0011] S4: The control end module receives the search results returned by the knowledge base module, integrates the official document content in the search results into the prompt template, and passes the processed prompt template to the application algorithm module;
[0012] S5: Apply the algorithm module to preprocess the prompt template and then pass it to the large model module;
[0013] S6: The large model module generates official documents based on the prompt template and the embedded industry knowledge graph, and streams them back to the user-side module for display;
[0014] S7: The user-side module supports users to regenerate official documents or edit and adjust generated official documents;
[0015] S8: The user-side module supports the user to expand, continue or refine a certain section of the document, and sends the expansion, continuation or refinement operation request to the control-side module;
[0016] S9: The control end module matches the corresponding prompt template according to the operation type, fills in the selected document content, and passes the processed prompt template to the application algorithm module;
[0017] S10: Apply the algorithm module to pre-process the prompt template and then pass it to the large model module;
[0018] S11: The large model module generates corresponding operation results according to the prompt template and returns them to the user-side module for display;
[0019] S12: The user-side module supports the user to re-execute the above editing operation until the user's expected result is met.
[0020] Furthermore, in the step S1 of the industry document generation method based on a large model, the user terminal module selects the document type and fills in the basic information of the document, including: selecting one type from 15 types including resolutions, decisions, orders, communiques, announcements, circulars, opinions, notifications, reports, requests for instructions, replies, proposals, letters and minutes,
[0021] Fill in the basic information of the document according to the selected document type. The basic information of the document includes title, content keywords, outline, time and location information.
[0022] Furthermore, in step S2 of the industry document generation method based on a large model, in the document type and prompt template mapping dictionary and the operation type and prompt template mapping dictionary, the key value is the document type or the operation type, and the value value is the corresponding prompt template.
[0023] Furthermore, in step S3 of the industry document generation method based on a large model, the knowledge base module executes a two-way recall mechanism to search for similar documents, specifically: the two-way call is through ES retrieval and BGE vector database recall, comparing the ES retrieval results and the BGE vector database recall content, if the two are the same, the ES retrieval results are returned, otherwise the BGE vector database recall content is returned.
[0024] Furthermore, in step S4 of the industry document generation method based on a large model, the control end module receives the search results returned by the knowledge base module, and integrates the official document content in the search results into the prompt template, including: determining whether the official document content in the search results is empty, and if not empty, obtaining the URL information of the official document from the official document content, downloading the official document content, determining the current prompt template length, intercepting the official document content and splicing it into the prompot template, the total length does not exceed the preset number of words, and defining the official document content in the search results as reference content.
[0025] Furthermore, in step S5 of the industry document generation method based on a big model, an algorithm module is applied to preprocess the prompt template, including: normalizing the text format, combing the logical structure and extracting key information points to ensure that the prompt template can be understood and parsed by the big model.
[0026] The present invention also provides an industry document generation device based on a large model, comprising a user end module, a control end module, an application algorithm module, a large model module and a knowledge base module.
[0027] Select the document type through the user-side module, fill in the basic information of the document, trigger the document generation request, and pass the request information to the control-side module;
[0028] The control end module matches the corresponding prompt template according to the document type, fills in the basic information of the document, and initiates a search request to the knowledge base module;
[0029] The knowledge base module receives the search request, executes the two-way recall mechanism to find similar documents, forms the search results, and returns the search results to the control end module;
[0030] The control end module receives the search results returned by the knowledge base module, integrates the official document content in the search results into the prompt template, and passes the processed prompt template to the application algorithm module;
[0031] Apply the algorithm module to preprocess the prompt template and then pass it to the large model module;
[0032] The large model module generates official documents based on the prompt template and the embedded industry knowledge graph, and streams them back to the user-side module for display;
[0033] The user-side module supports users to regenerate official documents or edit and adjust generated official documents;
[0034] The user-side module supports the user to expand, continue or refine a certain section of the document, and sends the expansion, continuation or refinement operation request to the control-side module;
[0035] The control end module matches the corresponding prompt template according to the operation type, fills in the selected document content, and passes the processed prompt template to the application algorithm module;
[0036] Apply the algorithm module to preprocess the prompt template and then pass it to the large model module;
[0037] The large model module generates the corresponding operation results based on the prompt template and returns them to the user-side module for display;
[0038] The user-side module supports the user to re-execute the above editing operations until the user's expected results are met.
[0039] The present invention also provides an electronic device for generating industry documents based on a large model, comprising: at least one memory and at least one processor;
[0040] The at least one memory is used to store a machine-readable program;
[0041] The at least one processor is used to call the machine-readable program to execute the industry document generation method based on a large model.
[0042] The benefits of the present invention are:
[0043] Improve work efficiency: By automatically generating industry documents, the time and energy required for manual document writing is greatly reduced, especially when dealing with a large number of repetitive or highly formatted documents, which greatly improves work efficiency.
[0044] Improve the quality of official documents: The large model module combines rich industry knowledge graphs and advanced natural language generation technology to ensure that the generated official documents have a rigorous structure, accurate content and comply with official writing standards, avoiding human errors and improving the professional level and quality of official document production.
[0045] Enhanced consistency and compliance: It can automatically reference appropriate templates based on different document types and combine existing documents and cases in the knowledge base to ensure high consistency and compliance in style, format and content of documents, which is conducive to the standardized management of government affairs.
[0046] Flexible customization and extensibility: Users can flexibly choose the type of official document according to their own needs, and personalize the continuation, expansion and refinement of the generated content, which enhances the customizability and adaptability of the system and meets the diverse needs of government document writing.
[0047] Real-time information update and knowledge sharing: The construction and maintenance of the knowledge base module can obtain and update the latest information in the industry in real time, help promote information sharing among departments, and promote scientific, open and transparent decision-making.
[0048] Reduce human resource pressure: By replacing some tedious clerical work with intelligent technology, employees can have more time and energy to focus on high value-added work such as strategy formulation and problem solving, thereby optimizing human resource allocation as a whole and improving the service efficiency of the organization. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 It is a schematic diagram of the interaction between modules of the device of the present invention.
[0050] Figure 2 The present invention relates to a schematic diagram of an industry document generation process.
[0051] Figure 3 It is a schematic diagram of the process of continuing, expanding and refining industry documents involved in the present invention. DETAILED DESCRIPTION
[0052] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.
[0053] Example 1
[0054] The present invention provides an industry file generation method based on a large model, wherein the industry file generation device is used to generate the industry file. The industry file generation device includes a user end module, a control end module, an application algorithm module, a large model module and a knowledge base module.
[0055] The industry document generation process includes the following steps:
[0056] S1: Select the document type through the user-side module, fill in the basic information of the document, trigger the document generation request, and pass the request information to the control-side module.
[0057] In step S1, the user terminal module selects the document type on the operation page and fills in the basic information of the document, including: selecting one of 15 types: resolution, decision, order, communique, announcement, notice, opinion, notification, circular, report, request, reply, proposal, letter and minutes.
[0058] Fill in the basic information of the document according to the selected document type, including title, content keywords, outline, time and location information. Trigger the document generation request, and pass the basic information and document type in the request information to the control end module.
[0059] S2: The control end module receives the document generation request and determines which type of document it is based on the type field: resolution, decision, command, communique, announcement, notice, opinion, notification, circular, report, request, reply, proposal, letter, or minutes. Then, the prompt template corresponding to each type of document is matched according to the document type. The document type and the corresponding prompt template data structure are a dictionary, with the key value being the document type and the value being the prompt template corresponding to the document type. The prompt will add placeholders for title, keywords, outline, time, and location. When the document generation request is passed from the user end, the title, keywords, outline, time, and location parameters will be passed, and the corresponding parameter values will be replaced in the corresponding placeholders of the prompt. The control end will splice the title and keywords together and pass them to the knowledge base module.
[0060] S3: The knowledge base module receives the search request, executes the two-way recall mechanism to find similar documents, forms the search results, and returns the search results to the control end module.
[0061] The knowledge base module implements a two-way recall mechanism to search for similar documents. Specifically, the two-way call is through ES retrieval and BGE vector database recall, comparing the ES retrieval results and the BGE vector database recall content. If the two are the same, the ES retrieval results are returned, otherwise the BGE vector database recall content is returned.
[0062] S4: The control end module receives the search results returned by the knowledge base module, integrates the official document content in the search results into the prompt template, and passes the processed prompt template to the application algorithm module.
[0063] The control end module receives the search results returned by the knowledge base module, and integrates the official document content in the search results into the prompt template, including: judging whether the official document content in the search results is empty, if not empty, obtaining the URL information of the official document from the official document content, downloading the official document content, judging the current prompt template length, intercepting the official document content and splicing it into the prompt template, the total length does not exceed the preset number of words, such as 2,000 words, and clearly defining the official document content in the search results as reference content.
[0064] S5: Apply the algorithm module to preprocess the prompt template and then pass it to the large model module.
[0065] The algorithm module is used to preprocess the prompt template, including: standardizing the text format, sorting out the logical structure and extracting key information points, to ensure that the prompt template can be understood and parsed by the large model.
[0066] S6: The large model module generates official documents based on the prompt template and the embedded industry knowledge graph, accurately generates high-quality text that conforms to the characteristics of industry official documents, and streams it back to the application algorithm module through the controller module and then streams it back to the user-end module for document streaming output display until the entire document is generated.
[0067] S7: The user-side module supports users to regenerate official documents or edit and adjust generated official documents.
[0068] S8: The user-side module supports the user to expand, continue or refine a certain section of the official document, and sends the expansion, continuation or refinement operation request to the control-side module.
[0069] S9: The control end module matches the corresponding prompt template according to the operation type, fills in the selected document content, and passes the processed prompt template to the application algorithm module.
[0070] When the control module receives a request related to expansion, abbreviation, or refinement, it determines whether it is an expansion, abbreviation, or refinement operation based on the type field. Then, the prompt template corresponding to each type of operation is matched according to the operation type. The operation type and the corresponding prompt template data structure are a dictionary, where the key value is the operation type and the value value is the prompt template corresponding to the operation type. Placeholders are reserved in the prompt to fill in the selected document content, which is spliced into a prompt and passed to the application algorithm module.
[0071] S10: The algorithm module pre-processes the prompt template and passes it to the large model module. After receiving the expansion, abbreviation, and refinement of the prompt template, the algorithm module standardizes the text format, sorts out the logical structure, extracts key information points, and ensures that the prompt can be effectively understood and parsed by the large model. The prompt is passed to the large model module.
[0072] S11: The large model module generates the corresponding operation results according to the prompt template, and streams them back to the user-end module for display. After receiving the prompt template, the large model fully understands the prompt and, relying on its embedded government industry knowledge graph, begins to accurately generate high-quality text that conforms to the characteristics of government documents, and streams them back to the application algorithm module through the controller module and streams them back to the user-end module for streaming output display until the streaming output ends.
[0073] S12: The user-side module supports the user to re-execute the above S9-S11 editing operations until the user's expected results are met. At the same time, the user can also edit and adjust the content by himself.
[0074] The method of the present invention can realize automatic and intelligent document generation and editing, which can not only meet the standardized document writing standards, but also significantly improve the efficiency of government work and reduce the workload of manual writing, which has become an important topic in the process of informatization. The present invention came into being in this context, aiming to build a comprehensive system integrating user interaction, data management, knowledge retrieval, intelligent algorithms and large models to realize efficient and intelligent creation of official documents.
[0075] Example 2
[0076] The present invention also provides an industry document generation device based on a large model, comprising a user end module, a control end module, an application algorithm module, a large model module and a knowledge base module.
[0077] Select the document type through the user-side module, fill in the basic information of the document, trigger the document generation request, and pass the request information to the control-side module;
[0078] The control end module matches the corresponding prompt template according to the document type, fills in the basic information of the document, and initiates a search request to the knowledge base module;
[0079] The knowledge base module receives the search request, executes the two-way recall mechanism to find similar documents, forms the search results, and returns the search results to the control end module;
[0080] The control end module receives the search results returned by the knowledge base module, integrates the official document content in the search results into the prompt template, and passes the processed prompt template to the application algorithm module;
[0081] Apply the algorithm module to preprocess the prompt template and then pass it to the large model module;
[0082] The large model module generates official documents based on the prompt template and the embedded industry knowledge graph, and streams them back to the user-side module for display;
[0083] The user-side module supports users to regenerate official documents or edit and adjust generated official documents;
[0084] The user-side module supports the user to expand, continue or refine a certain section of the document, and sends the expansion, continuation or refinement operation request to the control-side module;
[0085] The control end module matches the corresponding prompt template according to the operation type, fills in the selected document content, and passes the processed prompt template to the application algorithm module;
[0086] The algorithm module pre-processes the prompt template and then passes it to the large model module;
[0087] The large model module generates the corresponding operation results based on the prompt template and returns them to the user-side module for display;
[0088] The user-side module supports the user to re-execute the above editing operations until the user's expected results are met.
[0089] As the information interaction and execution process between the modules in the above-mentioned device are based on the same concept as the embodiment of the method of the present invention, the specific contents can be found in the description of the embodiment of the method of the present invention and will not be repeated here.
[0090] Likewise, the device of the present invention is beneficial in that:
[0091] Improve work efficiency: By automatically generating industry documents, the time and energy required for manual document writing is greatly reduced, especially when dealing with a large number of repetitive or highly formatted documents, which greatly improves work efficiency.
[0092] Improve the quality of official documents: The large model module combines rich industry knowledge graphs and advanced natural language generation technology to ensure that the generated official documents have a rigorous structure, accurate content and comply with official writing standards, avoiding human errors and improving the professional level and quality of official document production.
[0093] Enhanced consistency and compliance: It can automatically reference appropriate templates based on different document types and combine existing documents and cases in the knowledge base to ensure a high degree of consistency and compliance in style, format and content of documents, which is conducive to the standardized management of government affairs.
[0094] Flexible customization and extensibility: Users can flexibly choose the type of official document according to their own needs, and personalize the continuation, expansion and refinement of the generated content, which enhances the customizability and adaptability of the system and meets the diverse needs of government document writing.
[0095] Real-time information update and knowledge sharing: The construction and maintenance of the knowledge base module can obtain and update the latest information in the industry in real time, help promote information sharing among departments, and promote scientific, open and transparent decision-making.
[0096] Reduce human resource pressure: By replacing some tedious clerical work with intelligent technology, employees can have more time and energy to focus on high value-added work such as strategy formulation and problem solving, thereby optimizing human resource allocation as a whole and improving the service efficiency of the organization.
[0097] Example 3
[0098] The present invention also provides an electronic device for generating industry documents based on a large model, comprising: at least one memory and at least one processor;
[0099] The at least one memory is used to store a machine-readable program;
[0100] The at least one processor is used to call the machine-readable program to execute the industry document generation method based on a large model.
[0101] The above-mentioned electronic device processor performs information interaction, executes readable program processes, etc., which are based on the same concept as the embodiment of the method of the present invention. The specific contents can be found in the description of the embodiment of the method of the present invention and will not be repeated here.
[0102] Likewise, the electronic device of the present invention is beneficial in that:
[0103] Improve work efficiency: By automatically generating industry documents, the time and energy required for manual document writing is greatly reduced, especially when dealing with a large number of repetitive or highly formatted documents, which greatly improves work efficiency.
[0104] Improve the quality of official documents: The large model module combines rich industry knowledge graphs and advanced natural language generation technology to ensure that the generated official documents have a rigorous structure, accurate content and comply with official writing standards, avoiding human errors and improving the professional level and quality of official document production.
[0105] Enhanced consistency and compliance: It can automatically reference appropriate templates based on different document types and combine existing documents and cases in the knowledge base to ensure high consistency and compliance in style, format and content of documents, which is conducive to the standardized management of government affairs.
[0106] Flexible customization and extensibility: Users can flexibly choose the type of official document according to their own needs, and personalize the continuation, expansion and refinement of the generated content, which enhances the customizability and adaptability of the system and meets the diverse needs of government document writing.
[0107] Real-time information update and knowledge sharing: The construction and maintenance of the knowledge base module can obtain and update the latest information in the industry in real time, help promote information sharing among departments, and promote scientific, open and transparent decision-making.
[0108] Reduce human resource pressure: By replacing some tedious clerical work with intelligent technology, employees can have more time and energy to focus on high value-added work such as strategy formulation and problem solving, thereby optimizing human resource allocation as a whole and improving the service efficiency of the organization.
[0109] It should be noted that not all steps and modules in the above-mentioned processes and device structures are necessary, and some steps or modules can be ignored according to actual needs. The execution order of each step is not fixed and can be adjusted as needed. The system structure described in the above-mentioned embodiments can be a physical structure or a logical structure, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or some components in multiple independent devices may be implemented together.
[0110] The above-described embodiments are only preferred embodiments for fully illustrating the present invention, and the protection scope of the present invention is not limited thereto. Equivalent substitutions or changes made by those skilled in the art based on the present invention are within the protection scope of the present invention. The protection scope of the present invention shall be subject to the claims.
Claims
1. A method for generating industry documents based on a large model, characterized by The industry file is generated by an industry file generating device, wherein the industry file generating device includes a user end module, a control end module, an application algorithm module, a large model module and a knowledge base module. The industry document generation process includes the following steps: S1: Select the document type through the user-side module, fill in the basic information of the document, trigger the document generation request, and pass the request information to the control-side module; S2: The control module matches the corresponding prompt template according to the document type, fills in the basic information of the document, and initiates a search request to the knowledge base module; S3: The knowledge base module receives the search request, executes the two-way recall mechanism to search for similar documents, forms the search results, and returns the search results to the control end module; S4: The control end module receives the search results returned by the knowledge base module, integrates the official document content in the search results into the prompt template, and passes the processed prompt template to the application algorithm module; S5: Apply the algorithm module to preprocess the prompt template and then pass it to the large model module; S6: The large model module generates official documents based on the prompt template and the embedded industry knowledge graph, and streams them back to the user-side module for display; S7: The user-side module supports users to regenerate official documents or edit and adjust generated official documents; S8: The user-side module supports the user to expand, continue or refine a certain section of the document, and sends the expansion, continuation or refinement operation request to the control-side module; S9: The control end module matches the corresponding prompt template according to the operation type, fills in the selected document content, and passes the processed prompt template to the application algorithm module; S10: Apply the algorithm module to pre-process the prompt template and then pass it to the large model module; S11: The large model module generates corresponding operation results according to the prompt template and returns them to the user-side module for display; S12: The user-side module supports the user to re-execute the above editing operation until the user's expected result is met.
2. The method for generating industry documents based on a large model according to claim 1 is characterized in that in step S1, the document type is selected through the user-side module and basic document information is filled in, including: Choose one of the 15 types: resolution, decision, order, communique, announcement, notice, opinion, notification, circular, report, request for instructions, reply, proposal, letter and minutes. Fill in the basic information of the document according to the selected document type. The basic information of the document includes title, content keywords, outline, time and location information.
3. According to the large model-based industry document generation method described in claim 1, it is characterized in that in step S2, in the document type and prompt template mapping dictionary, and the operation type and prompt template mapping dictionary, the key value is the document type or the operation type, and the value value is the corresponding prompt template.
4. The method for generating industry documents based on a large model according to claim 1 is characterized in that In step S3, the knowledge base module executes a two-way recall mechanism to search for similar documents. Specifically, the two-way call is to recall through ES retrieval and BGE vector database, compare the ES retrieval results and the BGE vector database recall content, and return the ES retrieval results if they are the same, otherwise return the BGE vector database recall content.
5. The method for generating industry documents based on a large model according to claim 1 is characterized in that in step S4, the control end module receives the search results returned by the knowledge base module, and integrates the official document content in the search results into the prompt template, including: Determine whether the official document content in the search results is empty. If not, obtain the URL information of the official document from the official document content, download the official document content, determine the length of the current prompt template, intercept the official document content and splice it into the prompot template. The total length does not exceed the preset number of words, and the official document content in the search results is clearly defined as reference content.
6. The method for generating industry documents based on a large model according to claim 1 is characterized in that in step S5, the algorithm module is used to pre-process the prompt template, including: Standardize text formats, sort out logical structures, and extract key information points to ensure that prompt templates can be understood and parsed by large models.
7. A device for generating industry documents based on a large model, characterized in that It includes user-side module, control-side module, application algorithm module, large model module and knowledge base module. Select the document type through the user-side module, fill in the basic information of the document, trigger the document generation request, and pass the request information to the control-side module; The control end module matches the corresponding prompt template according to the document type, fills in the basic information of the document, and initiates a search request to the knowledge base module; The knowledge base module receives the search request, executes the two-way recall mechanism to find similar documents, forms the search results, and returns the search results to the control end module; The control end module receives the search results returned by the knowledge base module, integrates the official document content in the search results into the prompt template, and passes the processed prompt template to the application algorithm module; The algorithm module pre-processes the prompt template and then passes it to the large model module; The large model module generates official documents based on the prompt template and the embedded industry knowledge graph, and streams them back to the user-side module for display; The user-side module supports users to regenerate official documents or edit and adjust generated official documents; The user-side module supports the user to expand, continue or refine a certain section of the document, and sends the expansion, continuation or refinement operation request to the control-side module; The control end module matches the corresponding prompt template according to the operation type, fills in the selected document content, and passes the processed prompt template to the application algorithm module; The algorithm module pre-processes the prompt template and then passes it to the large model module; The large model module generates the corresponding operation results based on the prompt template and returns them to the user-side module for display; The user-side module supports the user to re-execute the above editing operations until the user's expected results are met.
8. An electronic device for generating industry documents based on a large model, characterized in that include: at least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is used to call the machine-readable program to execute the industry document generation method based on a large model according to any one of claims 1 to 6.
