Official document writing method, device and storage medium based on big model

By entering user needs into the big model to generate a document outline and introducing materials, the problem of the big model not being specific in the official document creation is solved, and the professionalism and quality of the official document is improved.

CN119761312APending Publication Date: 2025-04-04GRG BANKING EQUIPMENT CO LTD
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202411724534.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

When the existing technology applies large models to official document creation, the output content of the model often seems to be not specific enough, lacks industry depth, and fails to fully demonstrate its professionalism.

Method used

By inputting the official document writing requirements information entered by the user into the preset large model, a document outline is generated, and document materials and data materials are introduced when needed, and calling the big model to generate detailed official document content based on the user's prompt words.

Benefits of technology

The quality of official document writing content has been improved, the generated official document is more in line with the needs of users, and more specific and industry-wide content is provided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119761312A_ABST
    Figure CN119761312A_ABST
Patent Text Reader

Abstract

The present application discloses a method, device and storage medium for writing official documents based on a big model, and belongs to the field of artificial intelligence technology. The method includes: inputting the demand information of official document writing input by the user into a preset big model, and obtaining the official document outline output by the big model; when analyzing that the user's writing intention needs to introduce document materials and data materials, obtaining the target document material selected by the user from the preset document material library, and obtaining the target data material selected by the user from the preset data material database; using the target document material and the target data material as input, calling the big model to generate the official document article corresponding to the official document outline according to the user's prompt words. The present application deeply integrates the big model with the actual needs of official document writing, analyzes the user's writing intention, selects specific document materials and data materials, and generates detailed official document content according to the materials and the user's prompt words, thereby improving the quality of the official document writing content.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of artificial intelligence technology, and in particular relates to a document writing method, device and storage medium based on a large model. Background Art

[0002] At present, the widespread application of big models has greatly promoted the advancement of text generation technology. Big models can independently complete the creation of poems, stories and articles according to user instructions, effectively improving the author's writing speed and work quality.

[0003] In the scenario of official document writing, with the help of the deep semantic understanding and text generation technology of the big model, intelligent tools can be introduced for the drafting, review and verification, search and query of official documents, thus significantly improving the efficiency of office processes. However, when the big model is applied to the actual creation of official documents, the output content of the model often appears to be not specific enough, lacks industry depth, and fails to fully demonstrate its professionalism. Summary of the invention

[0004] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes a document writing method, device and storage medium based on a large model to improve the quality of the content of the document writing.

[0005] In a first aspect, the present application provides a document writing method based on a large model, comprising:

[0006] Inputting the document writing requirement information input by the user into a preset macro model, and obtaining the document outline output by the macro model;

[0007] When analyzing that the writing intention of the user needs to introduce document materials and data materials, the target document material selected by the user is obtained from a preset document material library, and the target data material selected by the user is obtained from a preset data material database;

[0008] The target document material and the target data material are used as input, and the large model is called to generate an official document article corresponding to the official document outline according to the user's prompt words.

[0009] According to the official document writing method based on the big model of the present application, the official document writing requirement information input by the user is input into the preset big model to obtain the official document outline output by the big model; when it is analyzed that the user's writing intention needs to introduce document materials and data materials, the target document material selected by the user is obtained from the preset document material library, and the target data material selected by the user is obtained from the preset data material database; the target document material and the target data material are used as input, and the big model is called to generate the official document article corresponding to the official document outline according to the user's prompt words. The embodiment of the present application deeply integrates the big model with the actual needs of official document writing, first generates a structured official document outline, provides a clear framework for writing, and analyzes the user's writing intention. When it is necessary to enrich the content, the user can select specific document materials and data materials, and the big model will generate detailed official document content according to these materials and the user's prompt words, so that the generated official document is more in line with the user's needs and improves the quality of the official document writing content.

[0010] According to an embodiment of the present application, before the document writing requirement information input by the user is input into the preset macro model, the following steps are included:

[0011] Build a knowledge base of official documents;

[0012] Analyzing and annotating the contents of official documents in the official document knowledge base to form a training data set;

[0013] Constructing an instruction data set based on the writing task; the instructions in the instruction data set include at least one of outline generation, paragraph generation, abbreviation, expansion, polishing, and keyword extraction;

[0014] The preset large model is trained according to the training data set and the instruction data set to obtain a trained large model.

[0015] In this embodiment, by collecting official document data and constructing a training data set, high-quality writing instruction data is constructed based on writing tasks, including outline generation, paragraph generation, continuation, expansion, polishing, etc., so that the big model can learn knowledge in the official document generation scenario and enhance the official document writing ability of the big model.

[0016] According to an embodiment of the present application, the step of obtaining the target document material selected by the user from a preset document material library includes:

[0017] Calling the material retrieval interface to retrieve material information from the preset document material library according to the query information input by the user;

[0018] The large model is called to organize the material information to obtain the target document material.

[0019] In this embodiment, by calling the material retrieval interface, relevant material information is retrieved from the preset document material library according to the query information input by the user, and the retrieved material information is intelligently sorted using a large model, so that the obtained material meets the user's needs and provides accurate material support for the generation of official documents.

[0020] According to an embodiment of the present application, calling the large model to organize the material information to obtain the target document material includes:

[0021] Obtaining question information from the user based on the material information;

[0022] Calling the large model to answer the question information and obtain answer information;

[0023] When the user determines to use the answer information as material, the large model is called to sort the material information and the answer information to obtain the target document material.

[0024] In this embodiment, by introducing a dynamic interactive process into the official document generation process, users are supported to communicate with the big model through material dialogues. This not only helps users to better understand the material content and make the material organization more in line with the actual needs of users, but also enables users to participate in the writing process in real time, retrieve and integrate the latest information and data, and improve the timeliness and accuracy of the generated document content.

[0025] According to an embodiment of the present application, before calling the material retrieval interface to retrieve material information from a preset document material library according to the query information input by the user, the following steps are included:

[0026] Obtain documents uploaded by users and / or crawl documents related to the material from data sources based on the user's writing behavior;

[0027] A document material library is constructed according to the document.

[0028] In this embodiment, through documents uploaded by users, or according to the writing habits and needs of users, relevant documents are automatically crawled from the Internet or other data sources, and these documents are analyzed and processed to extract key information and data to build a document material library. This document material library not only contains rich material information, but also can perform intelligent retrieval based on the user's query information to provide accurate material support. In addition, the construction process of the document material library can be dynamic, and can be continuously updated and expanded based on new documents uploaded by users or new documents crawled from data sources, so that the content of the document material library is always kept up to date and most relevant. In this way, the system can provide continuous, high-quality material support for official document writing, greatly improving the efficiency and quality of writing.

[0029] According to an embodiment of the present application, constructing a document material library according to the document includes:

[0030] Parsing the document and dividing the document into multiple levels; the multiple levels include at least two of the full text, summary, slice, and sentence of the document;

[0031] Document material libraries are constructed according to the multiple levels respectively to obtain document material libraries of multiple levels.

[0032] In this embodiment, the uploaded document is parsed and divided into multiple levels such as full text, summary, slice, sentence, etc. Such hierarchical processing not only retains the integrity of the document, but also facilitates more detailed management and retrieval of the document content. Based on these levels, multiple levels of document material libraries are constructed respectively. When meeting different writing needs, the required information can be quickly retrieved through keywords, phrases, and semantic vectors, greatly improving the efficiency of information retrieval. In addition, different levels of material selection can be provided for different needs, which helps to improve the reuse rate and creation efficiency of the material.

[0033] According to an embodiment of the present application, obtaining the target data material selected by the user from a preset data material database includes:

[0034] Calling a database query interface to retrieve structured data information from the data material database according to query information input by a user;

[0035] The large model is called to organize the data information and output the target data material in the form of natural language.

[0036] In this embodiment, by calling the database query interface, relevant data information is retrieved from the preset data material database according to the query information input by the user, and the retrieved data information is intelligently sorted using a large model, so that the obtained data information meets the user's needs and provides accurate data support for the generation of official documents.

[0037] According to one embodiment of the present application, the method further includes:

[0038] Calling a chart generation tool to draw the data information into a visual chart;

[0039] When it is confirmed that the user needs the visual chart, the visual chart is inserted into the official document.

[0040] In this embodiment, since in some specific types of official documents, the use of text alone for explanation often cannot fully meet the requirements, it is necessary to use various types of charts to display the changes and distribution of data. By calling a chart generation tool to draw the data information into a visual chart, the feasibility and diversity of the official document can be increased, and the quality of document generation can be further improved.

[0041] According to an embodiment of the present application, the step of taking the target document material and the target data material as input and calling the large model to generate an official document article corresponding to the official document outline according to the user's prompt words includes:

[0042] Get the user's input in the target prompt template;

[0043] Parsing the user's input in the target prompt template to obtain prompt words, reference document materials selected from the target document materials, and reference data materials selected from the target data materials;

[0044] An official document article corresponding to the official document outline is generated according to the prompt word, the reference document material and the reference data material.

[0045] In this embodiment, the user's input is obtained through the target prompt template, and the prompt words and the materials that the user hopes to quote or refer to in the official document can be accurately extracted. The user's needs and intentions can be accurately grasped, and combined with the powerful language generation capabilities of the large model, an official document article that conforms to both the official document specifications and the user's actual needs can be created, further improving the quality of the official document writing content.

[0046] According to one embodiment of the present application, before obtaining the user's input in the target prompt template, the following steps are included:

[0047] Constructing a prompt template corresponding to the scenario requirements; the scenario requirements include at least one of outline generation, paragraph generation, abbreviation, expansion, polishing, and continuation;

[0048] Evaluate the content of the official document generated by the large model based on the prompt template;

[0049] The prompt template is optimized according to the evaluation result.

[0050] In this embodiment, by constructing prompt templates corresponding to scenario requirements, such as outline generation, paragraph generation, etc., the user's writing intentions and requirements can be expressed more accurately, and by evaluating the content of the official document generated based on the prompt template, the prompt template is further optimized according to the evaluation results. This evaluation and optimization cycle allows the prompt template to be continuously optimized, so that the generated official document is more in line with the needs and standards of actual work, and the quality of the official document writing content is further improved.

[0051] In a second aspect, the present application provides a document writing device based on a large model, comprising:

[0052] An input module, used to input the document writing requirement information input by the user into a preset macro model, and obtain the document outline output by the macro model;

[0053] The acquisition module is used to acquire the target document material selected by the user from the preset document material library and acquire the target data material selected by the user from the preset data material database when analyzing that the writing intention of the user needs to introduce document material and data material;

[0054] A generation module is used to take the target document material and the target data material as input, and call the large model to generate an official document article corresponding to the official document outline according to the user's prompt words.

[0055] According to the official document writing device based on the big model of the present application, the official document writing requirement information input by the user is input into the preset big model to obtain the official document outline output by the big model; when it is analyzed that the user's writing intention needs to introduce document materials and data materials, the target document material selected by the user is obtained from the preset document material library, and the target data material selected by the user is obtained from the preset data material database; the target document material and the target data material are used as input, and the big model is called to generate the official document article corresponding to the official document outline according to the user's prompt words. The embodiment of the present application deeply integrates the big model with the actual needs of official document writing, first generates a structured official document outline, provides a clear framework for writing, and analyzes the user's writing intention. When it is necessary to enrich the content, the user can select specific document materials and data materials, and the big model will generate detailed official document content according to these materials and the user's prompt words, so that the generated official document is more in line with the user's needs and improves the quality of the official document writing content.

[0056] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the document writing method based on a large model as described in the first aspect above is implemented.

[0057] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the document writing method based on a large model as described in the first aspect above.

[0058] In a fifth aspect, the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the large model-based document writing method as described in the first aspect above.

[0059] In a sixth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the document writing method based on a large model as described in the first aspect above.

[0060] The above one or more technical solutions in the embodiments of the present application have at least one of the following technical effects:

[0061] According to the official document writing method based on the big model of the present application, the official document outline output by the big model is obtained by inputting the official document writing demand information input by the user into the preset big model; when it is necessary to introduce writing materials, the target document material selected by the user is obtained; the big model is called to generate the official document article corresponding to the official document outline according to the user's prompt words and the target document material. The embodiment of the present application deeply integrates the big model with the actual needs of official document writing, first generates a structured official document outline, and provides a clear framework for writing. When it is necessary to enrich the content, the user can select specific writing materials, and the big model will generate detailed official document content based on these materials and the user's prompt words, so that the generated official document is more in line with the user's needs and improves the quality of the official document writing content.

[0062] Furthermore, in some embodiments, by collecting official document data and constructing a training data set, high-quality writing instruction data is constructed based on writing tasks, including outline generation, paragraph generation, continuation, expansion, polishing, etc., so that the big model can learn knowledge in the official document generation scenario and enhance the official document writing ability of the big model.

[0063] Furthermore, in some embodiments, by calling the material retrieval interface, relevant material information is retrieved from the preset document material library according to the query information input by the user, and the retrieved material information is intelligently sorted using a large model, so that the obtained material meets the user's needs and provides accurate material support for the generation of official documents.

[0064] Furthermore, in some embodiments, by introducing a dynamic interactive process into the official document generation process, users are supported to communicate with the big model through material dialogues. This not only helps users to better understand the material content and make the organization of the materials more in line with the actual needs of users, but also enables users to participate in the writing process in real time, retrieve and integrate the latest information and data, and improves the timeliness and accuracy of the generated document content.

[0065] Furthermore, in some embodiments, through documents uploaded by users, or according to the writing habits and needs of users, relevant documents are automatically crawled from the Internet or other data sources, and these documents are analyzed and processed to extract key information and data to build a document material library. This document material library not only contains rich material information, but also can perform intelligent retrieval based on the user's query information to provide accurate material support. In addition, the construction process of the document material library can be dynamic, and can be continuously updated and expanded based on new documents uploaded by users or new documents crawled from data sources, so that the content of the document material library is always kept up to date and most relevant. In this way, the system can provide continuous, high-quality material support for official document writing, greatly improving the efficiency and quality of writing.

[0066] Furthermore, in some embodiments, the uploaded documents are parsed and divided into multiple levels such as full text, abstract, slice, sentence, etc. Such hierarchical processing not only retains the integrity of the document, but also facilitates more detailed management and retrieval of the document content. Based on these levels, multiple levels of document material libraries are constructed respectively. When meeting different writing needs, the required information can be quickly retrieved through keywords, phrases, and semantic vectors, greatly improving the efficiency of information retrieval. In addition, different levels of material selection can be provided for different needs, which helps to improve the reuse rate and creation efficiency of the materials.

[0067] Furthermore, in some embodiments, by obtaining user input through a target prompt template, prompt words and materials that the user hopes to quote or refer to in the official document can be accurately extracted, and the user's needs and intentions can be accurately grasped. Combined with the powerful language generation capabilities of the large model, official documents that meet both official document specifications and user actual needs can be created, further improving the quality of official document writing content.

[0068] Furthermore, in some embodiments, by constructing prompt templates corresponding to scenario requirements, such as outline generation, paragraph generation, etc., the user's writing intentions and requirements can be expressed more accurately, and by evaluating the content of the official document generated based on the prompt template, the prompt template is further optimized according to the evaluation results. This evaluation and optimization cycle allows the prompt template to be continuously optimized, so that the generated official document is more in line with the needs and standards of actual work, and the quality of the official document writing content is further improved.

[0069] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0071] Figure 1 It is a flowchart of a method for writing official documents based on a large model provided in an embodiment of the present application;

[0072] Figure 2 It is a flowchart of the model training process provided in the embodiment of the present application;

[0073] Figure 3 It is a flowchart of the interaction process between the user and the large model provided in the embodiment of the present application;

[0074] Figure 4 is a schematic diagram of a document material library provided in an embodiment of the present application;

[0075] Figure 5 is a schematic diagram of a visualization chart provided in an embodiment of the present application;

[0076] Figure 6 is a schematic diagram of a scenario example provided in an embodiment of the present application;

[0077] Figure 7 It is a structural schematic diagram of a document writing device based on a large model provided in an embodiment of the present application;

[0078] Figure 8 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0079] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0080] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0081] In the scenario of official document writing, the types of documents are complex and diverse, covering a wide range of knowledge. Whether it is the drafting, review, management, or retrieval process of documents, it still mainly relies on manpower and existing experience, which is not only inefficient but also prone to errors. With the deep semantic understanding and text generation technology of the big model, intelligent tools can be introduced for the drafting, review and verification, search and query of official documents, achieving a significant improvement in the efficiency of office processes.

[0082] Applying big model technology to official document writing, the big model is guided by prompt words to automatically generate document content based on the writing topic, greatly improving writing efficiency. However, the big model is trained through a large amount of general corpus on the Internet and can only generate general articles. It lacks understanding and learning of specific fields, and the generated official documents are difficult to truly provide effective help for users' work.

[0083] In order to solve at least one of the above technical problems, the embodiments of the present application provide a method, device and storage medium for writing official documents based on a large model. The following is a detailed description of the method, device and storage medium for writing official documents based on a large model provided by the embodiments of the present application through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0084] Among them, the official document writing method based on the big model can be applied to the terminal, and can be specifically executed by the hardware or software in the terminal.

[0085] The terminal includes, but is not limited to, a portable communication device such as a mobile phone or tablet computer with a touch-sensitive surface (e.g., a touch screen display and / or a touch pad). It should also be understood that in some embodiments, the terminal may not be a portable communication device, but a desktop computer with a touch-sensitive surface (e.g., a touch screen display and / or a touch pad).

[0086] In the following various embodiments, a terminal including a display and a touch-sensitive surface is described. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, a mouse and a joystick.

[0087] The embodiment of the present application provides a method for writing official documents based on a big model. The execution subject of the method for writing official documents based on a big model can be an electronic device or a functional module or functional entity in the electronic device that can implement the method for writing official documents based on a big model. The electronic devices mentioned in the embodiment of the present application include but are not limited to mobile phones, tablet computers, computers, cameras, and wearable devices. The method for writing official documents based on a big model provided in the embodiment of the present application is described below using an electronic device as an example of the execution subject.

[0088] like Figure 1 As shown, the official document writing method based on the big model includes: step 110, step 120 and step 130.

[0089] Step 110: input the document writing requirement information input by the user into a preset large model to obtain the document outline output by the large model.

[0090] Large Language Model (LLM) is a deep learning model trained with a large amount of text data, which can generate natural language text or understand the meaning of language text. Large models can handle a variety of natural language tasks, such as text classification, question answering, dialogue, etc. In some embodiments, the large model used can be Tongyi Qianwen, ChatGLM, LLaMA, GPT (Generative Pre-trained Transformer), etc., which is not limited in this specification embodiment.

[0091] Official documents, or official documents, are written materials that are formed and used by legal agencies and organizations in their official activities in a specific format and through a certain processing procedure. Official documents are legal, normative, and practical, and are used to convey policies, instructions, decisions, communicate information, coordinate actions, etc.

[0092] The demand information may be the demand for the official document that the user needs to generate. For example, the demand information may include the type of official document, optional information related to the type of official document, writing theme, keywords, main content, highlights, business data and other information.

[0093] In the embodiment of the present application, the document writing requirement information input by the user can be obtained in any manner, for example, a user interface can be provided, the user can input or select in the text box or tab of the user interface, and the requirement information is generated according to the user's input and selection. The document writing requirement information input by the user can also be obtained in other ways, for example, the user can upload a document containing the requirement information, and the requirement information is extracted according to the document containing the requirement information uploaded by the user, etc., and the embodiment of the present application is not limited to this.

[0094] In an embodiment of the present application, the user's demand information can be input into a preset large model, which can parse and understand the demand information and automatically generate a document outline with a complete structure and standardized content. The document outline meets the user's demand information and the standards for document writing. Among them, the generated document outline may include an introduction (introducing the topic, explaining the background, purpose or reason for the document), a main body (elaborating on the main content of the document, including policies, instructions, decisions, requests, reports, etc.), and an ending (summarizing the full text, making requests, hopes or suggestions).

[0095] Step 120: When it is analyzed that the user's writing intention needs to introduce document materials and data materials, the target document material selected by the user is obtained from the preset document material library, and the target data material selected by the user is obtained from the preset data material database.

[0096] In actual writing scenarios, writers often need to rely on a wealth of materials to obtain necessary information and inspiration. The use of materials is to provide necessary information support and enhance the persuasiveness and authority of official documents. Of course, the selection and use of materials need to consider their relevance, accuracy, reliability and legality.

[0097] Materials are a general term for various types of information, data, text, pictures, sounds, videos and other resources used in the creation process. Materials can include text materials such as books, articles, reports, research papers, historical records, legal documents, and can include statistical data such as survey results, market research, demographics, economic indicators, and can also include other official documents, official statements, expert opinions, historical quotations and other documents, and can also include pictures, charts, diagrams, etc. used to illustrate and enhance the text content, including detailed descriptions and analysis of specific events, projects, and research cases, including web page content, blog posts, online databases, social media posts, etc. Of course, materials can also include other content, which is not limited in the embodiments of this application.

[0098] In the embodiment of the present application, the material can be divided into document material and data material. The document material can be material expressed through documents, and the data material can be some material related to data.

[0099] In the embodiment of the present application, the user can determine whether to introduce materials into the official document as needed. For example, the user can determine whether to introduce materials according to actual needs; or the user can determine whether to introduce materials according to the official document outline. Of course, the official document outline can also be analyzed through a large model to identify which parts of the official document outline need to introduce external materials to enhance the accuracy, authority or richness of the content.

[0100] In some embodiments, the user's writing intention can be analyzed. For example, the macro model can analyze whether the official document content required by the user needs to introduce text materials and data materials based on the user's demand information. After generating the official document outline, the macro model can also analyze whether the official document content required by the user needs to introduce text materials and data materials based on the content of the official document outline. After generating the official document outline, the user can continue to input some information to the macro model to express the demand for materials.

[0101] When it is analyzed that the user's writing intention needs to introduce document materials and data materials, the target document material selected by the user is obtained from the preset document material library, and the target data material selected by the user is obtained from the preset data material database. Among them, the document material library and the data material library can be pre-established, and the document material library can include a variety of document materials. The data material database can be a structured database, such as a MySQL database, and the data material database stores materials related to statistical data. It should be noted that when the user selects the material, the copyright and compliance of the material can be automatically checked, so that the use and acquisition of the material does not infringe the copyright or violate relevant laws and regulations.

[0102] Step 130: Take the target document material and the target data material as input, and call the large model to generate an official document article corresponding to the official document outline according to the user's prompt words.

[0103] In the embodiment of the present application, prompt words are keywords or phrases provided to the large model by the user when generating specific content, such as articles, reports, official documents, etc. These prompt words help the model understand the theme, style, tone or other specific requirements of the content that the user wants to generate. For example, prompt words include the central topic of the official document, the main discussion point, the audience of the official document, the style, the writing task (such as outline generation, paragraph generation, abbreviation, expansion, polishing, keyword extraction), etc.

[0104] In an embodiment of the present application, the user's prompt words, target document materials, target data materials, official document outlines, etc. can be input into the big model as input data, thereby obtaining the official document article output by the big model.

[0105] According to the official document writing method based on the big model of the present application, the official document writing demand information input by the user is input into the preset big model to obtain the official document outline output by the big model; when it is analyzed that the user's writing intention needs to introduce document materials and data materials, the target document material selected by the user is obtained from the preset document material library, and the target data material selected by the user is obtained from the preset data material database; the target document material and the target data material are used as input, and the big model is called to generate the official document article corresponding to the official document outline according to the user's prompt words. The embodiment of the present application deeply integrates the big model with the actual needs of official document writing, first generates a structured official document outline, provides a clear framework for writing, and analyzes the user's writing intention. When it is necessary to enrich the content, the user can select specific document materials and data materials, and the big model will generate detailed official document content according to these materials and the user's prompt words, so that the generated official document is more in line with the user's needs and improves the quality of the official document writing content.

[0106] In some embodiments, before the document writing requirement information input by the user is input into the preset macro model, the following steps are included:

[0107] Build a knowledge base of official documents;

[0108] Analyze and annotate the official document content in the official document knowledge base to form a training data set;

[0109] Construct an instruction dataset based on the writing task; the instructions in the instruction dataset include at least one of outline generation, paragraph generation, abbreviation, expansion, polishing, and keyword extraction;

[0110] The preset large model is trained according to the training data set and the instruction data set to obtain a trained large model.

[0111] The general large model can complete a variety of tasks such as semantic understanding, text generation, and data analysis, but it cannot focus on specific industries and fields and lacks domain knowledge. In order to strengthen the industry knowledge of the large model, official document data is collected through various channels to help the large model learn. These channels include web crawlers, public data, business accumulation, etc. In order to enhance the model's ability to write official documents, a large number of official documents are collected, including notices, announcements, work plans, implementation plans and other commonly used transactional documents to build an official document knowledge base. With the help of powerful models such as GPT-4, outlines, titles, summaries, key information and other elements in official documents can be automatically extracted, and manual review can be added to build multiple writing instruction data, covering outline generation, paragraph generation, continuation, expansion, abbreviation, title generation, summary generation, keyword extraction and other tasks. Based on high-quality writing instruction data, a language model with a smaller parameter size is trained to avoid excessive resource requirements. The trained writing large model has relevant knowledge of official documents and generates content that better meets the needs of the scene.

[0112] In this embodiment, the official document knowledge base is a systematic database containing various types of official documents and related information, such as policy documents, laws and regulations, notices, reports, etc. Official document samples and related documents can be collected from government departments, industry associations, academic institutions, public databases and other channels. The collected official documents are classified and sorted to ensure that the information is structured for subsequent retrieval and analysis. The sorted data is stored in the database to support fast query and access.

[0113] In this embodiment, natural language processing technology can be used to analyze the content of official documents and extract key information, such as subject, purpose, structure, tone, etc. The content of official documents can be annotated by manual annotation. For example, classification annotation can be performed to annotate according to the type of official document (such as notice, report, decision, etc.); structural annotation can be performed to annotate the various structural parts of the official document, such as title, introduction, body, ending, etc.; content annotation can also be performed to extract and annotate important information in the official document, such as legal terms, data support, citation source, etc. The annotated data is organized into a training data set for the large model to learn.

[0114] In this embodiment, the constructed instruction data set contains instructions for different writing tasks to guide the model to generate the required official document content. Among them, the instructions include at least one of outline generation, paragraph generation, abbreviation, expansion, polishing, and keyword extraction. Outline generation: Generate a structural outline of the official document to clarify the content of each part; paragraph generation: Generate specific paragraphs according to the subject and requirements; abbreviation: abbreviate long text into a concise version; expansion: expand short text to add details and information; polishing: optimize the language and style of the text to improve readability and professionalism; extract keywords: extract important keywords and phrases from the text. Examples and templates related to these instructions can be collected and organized to form an instruction data set.

[0115] In this embodiment, a suitable large model can be selected as a basis, such as GPT. The training data set and the instruction data set are formatted to ensure that the input meets the model requirements. The large model is fine-tuned using the annotated training data set, and the model parameters are adjusted so that the large model can better adapt to the specific needs of official document writing. The model is trained by the instruction data set so that the large model can understand and execute different writing task instructions. After the training is completed, the large model can be tested using an independent validation set to evaluate the performance of the large model in official document generation. Model optimization is performed based on the test results, and hyperparameters or training strategies are adjusted to improve generation quality.

[0116] An example is used to illustrate the training process of the large model in this embodiment. Figure 2 As shown, in this example, the following steps may be included:

[0117] Crawling government websites to obtain large-scale official document data: Use web crawler technology to collect a large amount of official document data from official government websites. This data can be used as a basic resource for training models.

[0118] Conduct text mining and cluster analysis on official documents, and form an official document knowledge base based on the types of official documents: After collecting official document data, conduct text mining to extract useful information. Use cluster analysis methods to classify official documents, and build a structured official document knowledge base based on the types of official documents (such as notices, reports, requests, etc.).

[0119] Extract information and analyze paragraphs of each document, annotate data with manual and automated methods, and build training data sets: Conduct in-depth analysis of different types of documents to extract key information and paragraphs. Annotate data with manual and automated tools, including but not limited to topic annotation, sentiment annotation, structure annotation, etc., to form training data sets that can be used to train models.

[0120] Construct a fine-tuning dataset of various instructions such as outline generation, paragraph generation, abbreviation, expansion, and polishing based on writing tasks: According to the specific tasks of official document writing, design different writing instructions, such as generating official document outlines, generating specific paragraphs, abbreviating official documents, expanding official documents, polishing official documents, etc. Construct an instruction dataset based on these instructions for fine-tuning the model so that the large model can perform specific writing tasks.

[0121] Use efficient parameter fine-tuning methods such as LoRA to train large models and enhance the model's ability to write official documents: Use LoRA (Low-Rank Adaptation) or other efficient parameter fine-tuning techniques to further train the pre-trained large model. Through fine-tuning, the model's specific ability in official document writing is enhanced, allowing the large model to more accurately understand and generate official document content that meets the requirements.

[0122] In this embodiment, by collecting official document data and constructing a training data set, high-quality writing instruction data is constructed based on writing tasks, including outline generation, paragraph generation, continuation, expansion, polishing, etc., so that the big model can learn knowledge in the official document generation scenario and enhance the official document writing ability of the big model.

[0123] In some embodiments, obtaining the target document material selected by the user from a preset document material library includes:

[0124] Calling the material retrieval interface to retrieve material information from the preset document material library according to the query information input by the user;

[0125] The large model is called to organize the material information to obtain the target document material.

[0126] In this embodiment, a document material library containing rich materials can be pre-built. The materials in the document material library can include text, pictures, charts, case studies, etc., covering a variety of topics and fields. The user's query information can be received through the material retrieval interface. For example, the user enters the query information through the interface. This information can be keywords, phrases or sentences, which are used to describe the type or content of the material required by the user. The material retrieval interface can perform a search operation in the preset document material library according to the user's input to retrieve the material related to the query information. For example, a retrieval algorithm, such as full-text search, vector-based similarity search, etc., can be used to match the user query and the items in the document material library, and the matched material information is returned to the user in a list or other form. The user can browse this information and select the required material.

[0127] After obtaining the material information, the material information can be organized through the big model, such as summary generation, key information extraction, content reorganization, etc., to generate target document materials. The target document materials can be directly used for official document writing or as a supplement to the official document content.

[0128] In this embodiment, by calling the material retrieval interface, relevant material information is retrieved from the preset document material library according to the query information input by the user, and the retrieved material information is intelligently sorted using a large model, so that the obtained material meets the user's needs and provides accurate material support for the generation of official documents.

[0129] In some embodiments, calling the large model to sort the material information to obtain the target document material includes:

[0130] Obtain user's question information based on material information;

[0131] Call the big model to answer the question information and get the answer information;

[0132] When the user determines to use the answer information as material, the large model is called to organize the material information and the answer information to obtain the target document material.

[0133] In this embodiment, the entire process of official document writing is a dynamic interactive process. Through the form of material dialogue, it supports users to continuously communicate with the big model, which not only helps users better understand the material content, but also enables users to participate in the writing process in real time, retrieve and integrate the latest information and data, and ensure the timeliness and accuracy of the content of the written official document.

[0134] In this embodiment, a user interface may be provided so that the user can ask questions after browsing the material information. For example, the question information may include the specific content of the material, relevant details, and a summary of the material, etc. The user's question information may be input into the big model, and the big model may generate answers based on the question and the existing material information.

[0135] After checking the answer information, if the user thinks that the information is helpful for writing official documents, he can choose to use the answer information as material. After the user selects and confirms, the big model can be called again to integrate the original material information with the answer information generated by the big model to generate a more complete and targeted target document material.

[0136] Let’s take an example to illustrate the interaction process between the user and the large model. Figure 3 In this example, the following steps may be included:

[0137] User input query questions: Users input the questions they want to query through the interface. Questions can be keywords, phrases, or sentences that describe the type of material or content the user needs.

[0138] Call the retrieval service to obtain the top 5 most relevant articles: By calling the material retrieval interface, search the document material library for the top five most relevant articles based on the user's query.

[0139] Display summary information, AI excerpts, and key content of each article: The retrieved articles are displayed to users in the form of summaries, including key information automatically excerpted by AI (Artificial Intelligence) and the key content of the article, to help users quickly understand the core ideas of the article.

[0140] Do you want to conduct document Q&A? Ask the user whether they want to conduct a more in-depth Q&A interaction based on these documents.

[0141] Based on the current document, the user asks questions, and the big model quickly summarizes and answers: If the user chooses to continue, the user can ask more specific questions based on the currently displayed document. The big model will quickly generate a summary answer based on the user's question and the document content.

[0142] Ask the user whether to use the current answer as material: Ask the user whether he is satisfied with the answer provided by the big model and whether he wants to use this answer as writing material.

[0143] Organize the final materials: If the user decides to use the answers provided by the large model as materials, organize these materials and prepare them for the user's writing task.

[0144] Call the corresponding prompt template to obtain prompt words: Call the preset prompt template to provide necessary prompt words for the writing content generated by the large model to improve the relevance and accuracy of the generated document content.

[0145] Big model writing: Finally, the big model generates the final official document based on the query questions, selected materials and prompt words provided by the user.

[0146] In this embodiment, by introducing a dynamic interactive process into the official document generation process, users are supported to communicate with the big model through material dialogues. This not only helps users to better understand the material content and make the material organization more in line with the actual needs of users, but also enables users to participate in the writing process in real time, retrieve and integrate the latest information and data, and improve the timeliness and accuracy of the generated document content.

[0147] In some embodiments, before calling the material retrieval interface to retrieve material information from a preset document material library according to the query information input by the user, the following steps are included:

[0148] Obtain documents uploaded by users and / or crawl documents related to the material from data sources based on the user's writing behavior;

[0149] Build a document library based on the documents.

[0150] In this embodiment, a user interface may be provided to allow users to upload documents related to the writing task. These documents may be in the format of Word documents, PDF files, PPT slides, etc. It is also possible to crawl relevant documents from the Internet, internal databases, or other data sources based on the user's writing behavior and interests. For example, documents such as news articles, research reports, and academic papers.

[0151] Preprocess the collected documents, including format conversion, text extraction, etc., for subsequent analysis and processing. Use natural language processing technology to analyze the document content and extract key information, such as themes, keywords, summaries, etc. Classify and annotate the documents according to the characteristics of the document content. For example, documents can be classified into different categories according to their subject or purpose. Build an index for the documents in the document library to facilitate quick retrieval. The index can include the document's metadata (such as author, publication date, keywords, etc.) and content features. Store the processed documents and related information in a database, and identify the database as a document library. A management mechanism can also be established to regularly update and maintain the document library.

[0152] In this embodiment, through documents uploaded by users, or according to the writing habits and needs of users, relevant documents are automatically crawled from the Internet or other data sources, and these documents are analyzed and processed to extract key information and data to build a document material library. This document material library not only contains rich material information, but also can perform intelligent retrieval based on the user's query information to provide accurate material support. In addition, the construction process of the document material library can be dynamic, and can be continuously updated and expanded based on new documents uploaded by users or new documents crawled from data sources, so that the content of the document material library is always kept up to date and most relevant. In this way, the system can provide continuous, high-quality material support for official document writing, greatly improving the efficiency and quality of writing.

[0153] In some embodiments, building a document library according to the document includes:

[0154] Parse the document and divide it into multiple levels; the multiple levels include at least two of the full text, summary, slice, and sentence of the document;

[0155] Document material libraries are constructed according to multiple levels respectively to obtain document material libraries of multiple levels.

[0156] In this embodiment, text content can be extracted from documents, for example, readable text can be extracted from files of different formats such as PDF, Word, PPT, etc. The structure of the document, such as title, subtitle, paragraph, list, table, etc., is identified to understand the organization and content distribution of the document, and the document is divided into multiple levels; the multiple levels include at least two of the full text, summary, slice, and sentence of the document. Among them, the full text: retains the complete content of the original document, and the user can view and retrieve the entire document at any time; summary: according to user settings or automatically generated document summary, provide summary information of the document, help users quickly understand the topic and content points of the document; slice: according to user-specified rules or system automatic analysis, the document is divided into fragments or paragraphs with independent meanings, so that users can browse and manage the document content more conveniently; sentence: decompose the document into independent sentence levels so that users can retrieve and quote information in the document more finely.

[0157] In some embodiments, multiple levels of document libraries can also be integrated. Specifically, associations can be established between document libraries at different levels, so that users can easily navigate from entries at one level to related content at other levels. Indexes are established for document libraries at all levels, and retrieval algorithms are optimized so that users can quickly find the required materials based on keywords, topics, or other criteria. The document library is updated regularly, new documents and information are added, and outdated or no longer relevant materials are removed to ensure the quality and timeliness of the document library. The document library at multiple levels is constructed, such as Figure 4 shown.

[0158] These document library levels are invisible in the user interface. Users can freely switch and search between full text, abstracts, slices, and sentences according to their needs. The search engine optimizes the search algorithm and supports the simultaneous retrieval of relevant information from four levels of document libraries, thereby improving the accuracy and quality of the search. You can use the ES (Elasticsearch) engine, configure a domain-specific vocabulary, and quickly retrieve the required information through keywords, phrases, and semantic vectors, greatly improving the efficiency of information retrieval.

[0159] In this embodiment, the uploaded document is parsed and divided into multiple levels such as full text, summary, slice, sentence, etc. Such hierarchical processing not only retains the integrity of the document, but also facilitates more detailed management and retrieval of the document content. Based on these levels, multiple levels of document material libraries are constructed respectively. When meeting different writing needs, the required information can be quickly retrieved through keywords, phrases, and semantic vectors, greatly improving the efficiency of information retrieval. In addition, different levels of material selection can be provided for different needs, which helps to improve the reuse rate and creation efficiency of the material.

[0160] In some embodiments, obtaining the target data material selected by the user from a preset data material database includes:

[0161] Calling the database query interface to retrieve structured data information from the data material database according to the query information input by the user;

[0162] Call the big model to organize the data information and output the target data material in the form of natural language.

[0163] In this embodiment, a data material database containing rich data materials can be pre-built. The information related to statistical data stored in the data material database includes statistical data and facts that can be quantified and used to support decision-making, analysis and reporting. Such as GDP (Gross Domestic Product) growth rate, inflation rate, fiscal revenue and expenditure, population growth rate, environmental quality indicators, traffic flow, etc. By calling the database query interface, data can be retrieved from the data material database by writing SQL query statements. Since the data information in the data material database is structured data, the data information can be sorted by calling a large model, and the target data material can be output in the form of natural language. For example, according to the query content, the output target data material can be: The total added value of industrial enterprises above designated size in XX City from January to April 2024 is 110.3 billion yuan, with a growth rate of 2%.

[0164] In this embodiment, by calling the database query interface, relevant data information is retrieved from the preset data material database according to the query information input by the user, and the retrieved data information is intelligently sorted using a large model, so that the obtained data information meets the user's needs and provides accurate data support for the generation of official documents.

[0165] In some embodiments, the method further comprises:

[0166] Call the chart generation tool to draw the data information into a visual chart;

[0167] After confirming that the user needs a visual chart, insert the visual chart into the official document.

[0168] In this embodiment, any chart generation tool, such as ChartCool, GraphMaker, Pyecharts, etc., or other chart generation tools can be called. By calling the chart generation tool, the data information can be drawn into a visual chart, such as a bar chart, a line chart, a pie chart, etc.

[0169] In one example, this step can be performed by calling the big model, for example, a prompt template can be given to the big model:

[0170] Prompt:

[0171] You are a helpful assistant whose job is to understand the questions entered by the user and provide the appropriate responses.

[0172] To respond to user needs, you can use the following tools:

[0173] {tool_descs}

[0174] Please follow the following format:

[0175] Input: questions or responses entered by the user;

[0176] Think: You should think about the next steps;

[0177] Action: The action to take, should be one of [{tool_names}];

[0178] Action input: input information for the action;

[0179] Observation: The results of an action;

[0180] ...(this "think / act / action-input / observe" cycle can be repeated zero or more times)

[0181] Reflection: I now know the final answer;

[0182] Final answer: the answer to the original input question;

[0183] start!

[0184] Conversation history: {history}

[0185] Question: {query}

[0186] {tool_descs} refers to the related tools that can be used, including searching document material libraries, querying structured databases, calling chart drawing tools, etc.

[0187] {query} is the question or feedback information entered by the user.

[0188] In one example, according to the user's query, the data information obtained is: the total amount of industrial added value above designated size in XX City from January to October 2023 is 312 billion yuan, with a growth rate of -1%; the total amount from January to November 2023 is 570.6 billion yuan, with a growth rate of 0%; the total amount from January to December 2023 is 587.9 billion yuan, with a growth rate of 1%; the total amount from January to February 2024 is 87.1 billion yuan, with a growth rate of 1%; the total amount from January to March 2024 is 117.4 billion yuan, with a growth rate of 1.5%; the total amount from January to April 2024 is 110.3 billion yuan, with a growth rate of 2%. By calling the chart generation tool, the data information can be drawn into a visual chart, that is, a trend change chart of industrial added value in XX City, such as Figure 5 shown.

[0189] After the visualization chart is generated, prompt information can be fed back to prompt the user whether the visualization chart is needed. If the user is sure that the visualization chart is needed, the visualization chart can be inserted into the official document to enrich the content of the official document.

[0190] In this embodiment, since in some specific types of official documents, the use of text alone for explanation often cannot fully meet the requirements, it is necessary to use various types of charts to display the changes and distribution of data. By calling a chart generation tool to draw the data information into a visual chart, the feasibility and diversity of the official document can be increased, and the quality of document generation can be further improved.

[0191] In some embodiments, the target document material and the target data material are used as input, and the large model is called to generate an official document article corresponding to the official document outline according to the user's prompt words, including:

[0192] Get the user's input in the target prompt template;

[0193] Parsing the user's input in the target prompt template to obtain prompt words, reference document materials selected from the target document materials, and reference data materials selected from the target data materials;

[0194] Generate official document articles corresponding to the official document outline based on prompt words, reference document materials and reference data materials.

[0195] In this embodiment, a prompt template can be pre-designed to guide the user to provide key information required for writing, such as the purpose, subject, style, format requirements, etc. of the official document. The prompt template can also include materials that the user needs to quote. For example, the user can quote the entire content of the target document material and the target data material obtained above, or can quote part of the content of the target document material and the target data material. The user can enter the need to quote materials in the prompt template.

[0196] By parsing the user's input in the target prompt template, prompt words, user-selected reference document materials, and user-selected reference data materials can be extracted. Specifically, keywords or phrases can be extracted from the user input, and these prompt words will guide the writing direction and content of the big model. According to the user's selection, relevant fragments or information are extracted from the target document material, and relevant fragments or information are extracted from the target data material as a reference for writing. The big model can generate official documents corresponding to the official document outline based on the extracted prompt words and reference materials.

[0197] In this embodiment, the user's input is obtained through the target prompt template, and the prompt words and the materials that the user hopes to quote or refer to in the official document can be accurately extracted. The user's needs and intentions can be accurately grasped, and combined with the powerful language generation capabilities of the large model, an official document article that conforms to both the official document specifications and the user's actual needs can be created, further improving the quality of the official document writing content.

[0198] In some embodiments, before obtaining the user's input in the target prompt template, the following steps are included:

[0199] Construct prompt templates corresponding to scenario requirements; scenario requirements include at least one of outline generation, paragraph generation, abbreviation, expansion, polishing, and continuation;

[0200] Evaluate the content of official documents generated by the big model based on the prompt template;

[0201] The prompt template is optimized according to the evaluation results.

[0202] In this embodiment, according to different scenarios and needs of official document writing, such as outline generation, paragraph generation, abbreviation, expansion, polishing, and continuation, the characteristics and requirements of each need can be analyzed, and corresponding prompt templates can be designed for each scenario need. These prompt templates can include a series of preset questions or instructions to help users clarify their needs and provide sufficient information for the large model to generate content.

[0203] Before the prompt template is actually applied, it can be evaluated and optimized. For example, the language understanding ability of the big model can be used to optimize the expression of the prompt words, thereby improving the quality and effect of the prompt template. Using the big model's understanding of the writing task, the prompt words are deeply analyzed and continuously optimized to accurately express the intention of the writing task and have good semantic coherence. Prompt word optimization includes using appropriate vocabulary, phrases and sentence structures, as well as adjusting the tone and context. A manual evaluation and scoring mechanism can be introduced, and the evaluators can score and provide feedback on the content of the official documents generated based on the prompt template. The evaluators comprehensively evaluate the generated content based on a series of standards and indicators, such as language fluency, information accuracy, task completion, etc., to determine the pros and cons of the prompt template and give corresponding scores and suggestions. Finally, a complete set of prompt template libraries is formed to complete multiple writing tasks.

[0204] Specifically, the large model can be used to generate official document content based on the prompt template. A set of evaluation criteria is established in advance to evaluate the quality of the generated content. These criteria may include the relevance, accuracy, completeness, logic, language standardization, etc. of the content. According to the evaluation criteria, professionals evaluate the generated official document content, score it according to the established criteria, and provide feedback. Collect feedback from end users on the generated content to understand user satisfaction and the actual application effect of the generated content.

[0205] Based on the evaluation results and user feedback, identify problems in the prompt template, such as whether it provides sufficient guidance and whether it covers all necessary information points. Then, adjust and optimize the prompt template to solve the identified problems. For example, you can add or modify questions in the template, or adjust the structure and expression of the template.

[0206] In some embodiments, iterative testing can also be performed on the optimized template to verify the optimization effect and make further adjustments based on the test results. Template optimization is an ongoing process, user feedback and evaluation data are regularly collected, and template design is continuously improved to improve the quality of content generated by large models and user satisfaction.

[0207] In one example, the prompt template is shown in the following table.

[0208]

[0209] In this embodiment, by constructing prompt templates corresponding to scenario requirements, such as outline generation, paragraph generation, etc., the user's writing intentions and requirements can be expressed more accurately, and by evaluating the content of the official document generated based on the prompt template, the prompt template is further optimized according to the evaluation results. This evaluation and optimization cycle allows the prompt template to be continuously optimized, so that the generated official document is more in line with the needs and standards of actual work, and the quality of the official document writing content is further improved.

[0210] The following is an example of a scenario to explain the document writing method based on a large model in the embodiment of the present application. Figure 6 As shown, this scenario example includes the following steps:

[0211] The user enters a query question, and the big model agent performs intent recognition and tries to understand the intent and content of the question. When it is recognized that document materials need to be introduced, the material library retrieval interface is called to retrieve the top 5 most relevant document materials from the document material library, and the summary information, AI (Artificial Intelligence) excerpt, important content, etc. of each material are displayed. Users can have a dialogue on each material and obtain the material content summarized by the big model.

[0212] When it is identified that data material needs to be introduced, the database query interface is called to obtain the relevant data of the user's query, and the queried data information is replied to the user in natural language.

[0213] Integrate the document materials and data materials to be retrieved, and call the prompt word template to generate specific document content.

[0214] After querying the data information, you can also call the chart generation tool to draw a chart, and prompt the user whether to insert the generated chart into the official document. If the user chooses no, the chart will be discarded. If the user chooses yes, the chart can be inserted into the official document to obtain an official document that combines text and charts, which can meet the needs of actual scenarios.

[0215] The document writing method based on a big model provided in the embodiment of the present application can be executed by a document writing device based on a big model. In the embodiment of the present application, the document writing device based on a big model is taken as an example to illustrate the document writing method based on a big model provided in the embodiment of the present application.

[0216] The embodiment of the present application also provides a document writing device based on a large model.

[0217] like Figure 7 As shown, the document writing device based on the large model includes:

[0218] An input module 710 is used to input the document writing requirement information input by the user into a preset macro model to obtain the document outline output by the macro model;

[0219] The acquisition module 720 is used to acquire the target document material selected by the user from the preset document material library and acquire the target data material selected by the user from the preset data material database when analyzing that the writing intention of the user needs to introduce document material and data material;

[0220] The generation module 730 is used to take the target document material and the target data material as input, and call the large model to generate an official document article corresponding to the official document outline according to the user's prompt words.

[0221] According to the official document writing device based on the big model of the present application, the official document writing demand information input by the user is input into the preset big model to obtain the official document outline output by the big model; when it is analyzed that the user's writing intention needs to introduce document materials and data materials, the target document material selected by the user is obtained from the preset document material library, and the target data material selected by the user is obtained from the preset data material database; the target document material and the target data material are used as input, and the big model is called to generate the official document article corresponding to the official document outline according to the user's prompt words. The embodiment of the present application deeply integrates the big model with the actual needs of official document writing, first generates a structured official document outline, provides a clear framework for writing, and analyzes the user's writing intention. When it is necessary to enrich the content, the user can select specific document materials and data materials, and the big model will generate detailed official document content according to these materials and the user's prompt words, so that the generated official document is more in line with the user's needs and improves the quality of the official document writing content.

[0222] In some embodiments, the document writing device based on the big model further includes:

[0223] The training module is used to build a document knowledge base; analyze and annotate the document content in the document knowledge base to form a training data set; build an instruction data set based on the writing task; the instructions in the instruction data set include at least one of outline generation, paragraph generation, abbreviation, expansion, polishing, and keyword extraction; train the preset big model according to the training data set and the instruction data set to obtain the trained big model.

[0224] In some embodiments, the acquisition module 720 is further configured to:

[0225] Calling the material retrieval interface to retrieve material information from the preset material library according to the query information input by the user;

[0226] Call the big model to organize the material information to obtain the target document material, including:

[0227] Obtain user's question information based on material information;

[0228] Call the big model to answer the question information and get the answer information;

[0229] When the user determines to use the answer information as material, the large model is called to organize the material information and the answer information to obtain the target document material.

[0230] In some embodiments, the acquisition module 720 is further configured to:

[0231] Obtain documents uploaded by users and / or crawl documents related to the material from data sources based on the user's writing behavior;

[0232] Parse the document and divide it into multiple levels; the multiple levels include at least two of the full text, summary, slice, and sentence of the document;

[0233] The material libraries are constructed according to the multiple levels respectively to obtain material libraries of multiple levels.

[0234] In some embodiments, the acquisition module 720 is further configured to:

[0235] Calling the database query interface to retrieve structured data information from the data material database according to the query information input by the user;

[0236] Call the big model to organize the data information and output the target data material in the form of natural language.

[0237] In some embodiments, the generating module 730 is further configured to:

[0238] Call the chart generation tool to draw the data information into a visual chart;

[0239] After confirming that the user needs a visual chart, insert the visual chart into the official document.

[0240] In some embodiments, the generating module 730 is further configured to:

[0241] Get the user's input in the target prompt template;

[0242] Parsing the user's input in the target prompt template to obtain prompt words, reference document materials selected from the target document materials, and reference data materials selected from the target data materials;

[0243] Generate official document articles corresponding to the official document outline based on prompt words, reference document materials and reference data materials.

[0244] In some embodiments, the generating module 730 is further configured to:

[0245] Construct prompt templates corresponding to scenario requirements; scenario requirements include at least one of outline generation, paragraph generation, abbreviation, expansion, polishing, and continuation;

[0246] Evaluate the content of official documents generated by the big model based on the prompt template;

[0247] The prompt template is optimized according to the evaluation results.

[0248] The document writing device based on the large model in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or it can be other devices other than the terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a car-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0249] The document writing device based on the large model in the embodiment of the present application can be a device with an operating system. The operating system can be a Microsoft (Windows) operating system, an Android (Android) operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0250] In some embodiments, Figure 8 As shown, an embodiment of the present application further provides an electronic device 800, including a processor 801, a memory 802, and a computer program stored in the memory 802 and executable on the processor 801. When the program is executed by the processor 801, each process of the above-mentioned embodiment of the document writing method based on the large model is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0251] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.

[0252] An embodiment of the present application also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned large-model-based document writing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0253] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0254] An embodiment of the present application also provides a computer program product, including a computer program, which implements the above-mentioned large model-based document writing method when executed by a processor.

[0255] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0256] The embodiment of the present application further provides a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned embodiment of the document writing method based on a large model, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0257] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0258] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0259] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0260] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

[0261] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0262] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.

Claims

1. A document writing method based on a large model, characterized in that: include: Inputting the document writing requirement information input by the user into a preset macro model, and obtaining the document outline output by the macro model; When analyzing that the writing intention of the user needs to introduce document materials and data materials, the target document material selected by the user is obtained from a preset document material library, and the target data material selected by the user is obtained from a preset data material database; The target document material and the target data material are used as input, and the large model is called to generate an official document article corresponding to the official document outline according to the user's prompt words.

2. The method according to claim 1, characterized in that Before inputting the document writing requirement information input by the user into the preset large model, it includes: Build a knowledge base of official documents; Analyzing and annotating the contents of official documents in the official document knowledge base to form a training data set; Constructing an instruction data set based on the writing task; the instructions in the instruction data set include at least one of outline generation, paragraph generation, abbreviation, expansion, polishing, and keyword extraction; The preset large model is trained according to the training data set and the instruction data set to obtain a trained large model.

3. The method according to claim 1, characterized in that The step of acquiring the target document material selected by the user from a preset document material library includes: Calling the material retrieval interface to retrieve material information from the preset material library according to the query information input by the user; Calling the large model to sort the material information to obtain the target document material includes: Obtaining question information from the user based on the material information; Calling the large model to answer the question information and obtain answer information; When the user determines to use the answer information as material, the large model is called to sort the material information and the answer information to obtain the target document material.

4. The method according to claim 3, characterized in that Before calling the material retrieval interface to retrieve material information from the preset material library according to the query information input by the user, it includes: Obtain documents uploaded by users and / or crawl documents related to the material from data sources based on the user's writing behavior; Parsing the document and dividing the document into multiple levels; the multiple levels include at least two of the full text, summary, slice, and sentence of the document; Material libraries are constructed according to the multiple levels respectively to obtain material libraries of multiple levels.

5. The method according to claim 1, characterized in that The step of acquiring the target data material selected by the user from a preset data material database includes: Calling a database query interface to retrieve structured data information from the data material database according to query information input by a user; The large model is called to organize the data information and output the target data material in the form of natural language.

6. The method according to claim 5, characterized in that The method further comprises: Calling a chart generation tool to draw the data information into a visual chart; When it is confirmed that the user needs the visual chart, the visual chart is inserted into the official document.

7. The method according to claim 1, characterized in that The step of taking the target document material and the target data material as input and calling the large model to generate an official document article corresponding to the official document outline according to the user's prompt words includes: Get the user's input in the target prompt template; Parsing the user's input in the target prompt template to obtain prompt words, reference document materials selected from the target document materials, and reference data materials selected from the target data materials; An official document article corresponding to the official document outline is generated according to the prompt word, the reference document material and the reference data material.

8. The method according to claim 7, characterized in that Before getting user input in the target prompt template, include: Constructing a prompt template corresponding to the scenario requirements; the scenario requirements include at least one of outline generation, paragraph generation, abbreviation, expansion, polishing, and continuation; Evaluate the content of the official document generated by the large model based on the prompt template; The prompt template is optimized according to the evaluation result.

9. A document writing device based on a large model, characterized in that: include: An input module, used to input the document writing requirement information input by the user into a preset macro model, and obtain the document outline output by the macro model; The acquisition module is used to acquire the target document material selected by the user from the preset document material library and acquire the target data material selected by the user from the preset data material database when analyzing that the writing intention of the user needs to introduce document material and data material; A generation module is used to take the target document material and the target data material as input, and call the large model to generate an official document article corresponding to the official document outline according to the user's prompt words.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Large model writing method and system based on structured meta-knowledge base

    CN120087341A

  • Writing auxiliary method and device fusing semantic retrieval and large model and electronic equipment

    CN120492477A

  • Official document content generation and compliance verification system based on large language model

    CN120873172A

  • Document auxiliary generation method and device, equipment and medium

    CN120930624A

  • Self-adaptive document pushing method and system based on user portrait and storage medium

    CN121502087A