Program generation method and device based on official document and computer storage medium
Through the outline generation method based on official document, the outline generation method is used to assist the big model in generating outlines with official document genre and historical outline, the problem of template fixation and lack of flexibility in the existing technology is solved, and high-quality outline generation is achieved.
Patent Information
- Application Number
- CN202411116061.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2025-04-15
AI Technical Summary
The existing automatic writing technology of official documents lacks flexibility and the template is fixed. Users need to modify the template on a large scale to adapt to actual scenarios.
A method of outline generation based on official documents is proposed. By entering the target official document title, extracting the official document genre, searching similar outlines from the historical outline library, and inputting the historical outline and target official document titles to generate a large model to generate a hierarchical outline title.
Effectively reduces the situation of topic drift and redundant fields, improves the outline quality of the large model output, and makes the generated outline both closely related to the theme and clear structure.
Smart Images

Figure CN119829755A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of intelligent generation of official documents, and in particular to an outline generation method, an outline generation device and a computer storage medium based on official documents. Background Art
[0002] With the rapid development of artificial intelligence technology, especially the continuous maturity and improvement of natural language generation (NLG) technology, we can use these advanced technologies to assist in the writing of official documents. This application can significantly shorten the time of writing official documents.
[0003] However, the existing automatic document writing technology pre-specifies the templates of various types of documents, that is, directly retrieves the most similar template from the template library based on the parameters provided by the user (such as subject, keywords, etc.), and the user fills in the relevant content according to the template. The disadvantage of this method is that it lacks flexibility and the template is fixed. In actual scenarios, users may need to make large-scale modifications to the template. Summary of the invention
[0004] In order to solve the above technical problems, the present application proposes an outline generation method based on official documents, an outline generation device and a computer storage medium.
[0005] In order to solve the above technical problems, the present application proposes an outline generation method based on official documents, and the outline generation method comprises:
[0006] Enter the target document title;
[0007] Extracting the genre of the official document based on the target official document title;
[0008] Retrieving a historical outline from a historical outline library based on the genre of the official document;
[0009] The historical outline and the target document title are input into a large model to generate an outline title of at least one level in sequence.
[0010] The outline generation method further comprises:
[0011] Extracting keywords based on the target document title;
[0012] The retrieving the historical outline from the historical outline library based on the official document genre includes:
[0013] The historical outline is retrieved from the historical outline library based on the official document genre and the keywords.
[0014] The step of retrieving a historical outline from a historical outline library based on the official document genre includes:
[0015] Obtaining the official document genre and filtering candidate official document titles of the same official document genre from the historical outline library;
[0016] Obtaining title similarity between the target official document title and the candidate official document title;
[0017] Acquire the title of the searched document based on the title similarity;
[0018] The historical outline corresponding to the retrieved document title is extracted from the historical outline library.
[0019] Wherein, the outline generation method further includes:
[0020] Extract target keywords from the target document title;
[0021] Extracting candidate keywords of the candidate official document title;
[0022] Obtaining keyword similarity between the target keyword and the candidate keyword;
[0023] The obtaining of the retrieved document title based on the title similarity comprises:
[0024] Based on the title similarity and the keyword similarity, the search document title is obtained.
[0025] Wherein, the outline generation method further includes:
[0026] Acquire a fine-tuning training set, wherein the fine-tuning training set includes a number of training documents;
[0027] Parsing the training document to obtain a tree structure intermediate file and a document style intermediate file;
[0028] Extracting a training outline based on the tree structure intermediate file;
[0029] Extracting training genres based on the document style intermediate file;
[0030] The training outline and training genre of the training document are stored in the historical outline library.
[0031] The step of parsing the training document to obtain a tree structure intermediate file and a document style intermediate file includes:
[0032] Calling a document parsing package to obtain the style information of the training document;
[0033] Based on a preset extraction rule, obtaining structural information of the training document;
[0034] According to the style information and the structure information, the tree structure intermediate file and the document style intermediate file are extracted.
[0035] Among them, the fine-tuning training set includes a generation instruction training set and a supplementary instruction training set. The generation instruction training set is used to train the generation model to generate a subordinate outline according to the superior outline, and the supplementary instruction training set is used to train the generation model to supplement the intermediate outline according to the superior outline and the subordinate outline.
[0036] In order to solve the above technical problems, the present application also proposes an outline generation device based on official documents, which includes a memory and a processor coupled to the memory; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the outline generation method as described above.
[0037] In order to solve the above technical problems, the present application also proposes a computer storage medium, which is used to store program data. When the program data is executed by a computer, it is used to implement the above outline generation method.
[0038] Compared with the prior art, the beneficial effects of the present application are as follows: the outline generation device inputs the target document title; based on the target document title, the document genre is extracted; based on the document genre, the historical outline is retrieved from the historical outline library; the historical outline and the target document title are input into the generated macro model, and at least one level of outline titles are generated in sequence. Through the above outline generation method, a framework for hierarchical outline generation is proposed, which uses document genres and historical outlines to assist the macro model in generating outlines, which can effectively reduce the situation of topic drift and redundant fields, and improve the outline quality output by the macro model. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0040] in:
[0041] Figure 1 It is a flowchart of an embodiment of a method for generating an outline based on official documents provided by the present application;
[0042] Figure 2 It is a schematic diagram of a framework for generating an official document outline based on a large model provided by this application;
[0043] Figure 3 yes Figure 1 The specific flow chart of step S13 of the outline generation method shown;
[0044] Figure 4 It is a flowchart of another embodiment of the outline generation method based on official documents provided by the present application;
[0045] Figure 5 It is a schematic diagram of the framework of the official document parsing process provided by this application;
[0046] Figure 6 It is a schematic diagram of the design of the large model fine-tuning task provided in this application;
[0047] Figure 7 It is a structural schematic diagram of an embodiment of an outline generation device based on official documents provided by the present application;
[0048] Figure 8 It is a structural schematic diagram of another embodiment of the outline generation device based on official documents provided by the present application;
[0049] Fig. 9 It is a structural diagram of an embodiment of a computer storage medium provided by the present application. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0051] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0052] In order to solve the above-mentioned problems of fixed templates and lack of subject characteristics in the outline, this application proposes a method for automatically generating official document outlines based on a large-scale pre-trained language model (referred to as the big model), which can generate diversified and thematically related official document outlines according to specific genres, themes, levels and other information.
[0053] Specifically, this application aims to combine the large model and Lora (Low-Rank Adaptation of LLMs, large model efficient fine-tuning) fine-tuning technology to achieve efficient title-driven outline generation in the field of official document writing. At the same time, by integrating retrieval enhancement and prompt word engineering technology, it can effectively respond to challenges brought by external factors such as current political updates and user demand evolution, and avoid the tediousness and cost of frequent retraining of models. Furthermore, this application proposes a hierarchical construction strategy for the outline, which fundamentally reduces the problems of topic drift and field redundancy that may occur in the generation process of the large model, so as to ensure that the generated outline is closely related to the theme, clear in structure, and concise in content.
[0054] This application provides a method for automatically generating an outline for official documents. For details, please refer to Figure 1 and Figure 2 . Figure 1 is a flow chart of an embodiment of a method for generating an outline based on official documents provided by the present application. Figure 2 It is a schematic diagram of the document outline generation framework based on the large model provided by this application.
[0055] The outline generation method of the present application is applied to an outline generation device, wherein the outline generation device of the present application can be a server, a terminal device, or a system composed of a server and a terminal device cooperating with each other. Accordingly, the various parts included in the outline generation device, such as various units, sub-units, modules, and sub-modules, can all be set in the server, can all be set in the terminal device, or can be set in the server and the terminal device respectively.
[0056] Furthermore, the above-mentioned server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules, such as software or software modules used to provide distributed servers, or it can be implemented as a single software or software module, which is not specifically limited here.
[0057] like Figure 1 As shown, the specific steps are as follows:
[0058] Step S11: Input the target document title.
[0059] In the embodiment of the present application, the outline generating device obtains the target document title input by the user, such as Figure 2 In the example shown, titles such as "Report on Personnel Assessment and Rating" are shown. In other embodiments, any official document title may be input, which is not listed here.
[0060] Step S12: Extracting the document genre based on the target document title.
[0061] In the embodiment of the present application, the outline generating device uses Figure 2 The element parsing module shown in the figure obtains the document genre involved in or corresponding to the document title. Figure 2 In the example shown, the genre corresponding to the official document title is "Report".
[0062] Specifically, since the official document genres are standardized and can be exhaustively listed, including but not limited to: communiques, opinions, notices, resolutions, announcements, reports, speeches, etc. Therefore, the element parsing module can directly use string matching to identify the official document genre of the target official document title. Figure 2 In the example shown, the element parsing module can successfully match the string of "report" in the target document title as the document genre through string matching.
[0063] Further, Figure 2 The element parsing module shown can also be used to extract keywords from the target document title. Since keywords cannot be exhaustively listed, this application chooses to use the general knowledge of the large model to extract keywords from the target document title for the keyword extraction task. In other embodiments, with the support of a large amount of training data, the element parsing module may also require a language recognition model to directly extract context information from the target document title to extract keywords.
[0064] At the same time, in order to make the output of the large model more readable to the machine, the element parsing module also optimizes the performance of the base large model in extracting keywords by designing prompt words. The specific prompt word design includes but is not limited to the following:
[0065] Output the core words according to the article title. The output format is: "Topic: Core word 1, Core word 2". The core word is the key content in the article title. Avoid including genres such as "speech" and "report". Output at least 2 core words and at most 3 core words. The number must be strictly controlled.
[0066] Here are two examples of using large models to extract keywords:
[0067] Article title: Personnel assessment and rating report.
[0068] Output: "Subject: Personnel Assessment and Rating".
[0069] Article title: Notice on strengthening internal information security management.
[0070] Output: "Subject: Internal Information Security Management, Notice".
[0071] Therefore, the user can enter the following into the large model in the feature parsing module:
[0072] Please output the central word of the following article title:
[0073] Article title: Personnel assessment and rating report.
[0074] The large model can output relevant keywords based on the above prompts.
[0075] The prompt words designed in this application mainly include task definition ("output the central word according to the article title"), output requirements ("the output format is: subject words: central word 1, central word 2. At least 2 central words are output, and at most 3 central words are output, and the number must be strictly controlled"), concept explanation (the central word is the key content in the article title, avoid including genres such as speeches and reports, etc.), learning examples, and questions.
[0076] like Figure 2 In the example shown, the key words extracted by the element parsing module from the target document title include: "personnel assessment" and "rating".
[0077] Step S13: Retrieve the historical outline from the historical outline library based on the official document genre.
[0078] In the embodiment of the present application, in order to ensure that the outline format finally generated by the large model meets the department's requirements and the content is solid and closely linked to reality, this application uses a retriever module, that is, a retrieval enhancement module, to retrieve similar official document outlines from the historical outline library for the large model of the outline generation module to learn.
[0079] Specifically, the search module of the outline generation device retrieves historical outlines from the historical outline library based on the official document genre. By taking the official document genre as a search condition, it is possible to ensure that the large model of the outline generation module learns the official document outline of the same official document genre, so that the generated outline is more in line with the format requirements of the official document genre.
[0080] Furthermore, the search module of the outline generation device can also retrieve historical outlines from the historical outline library based on the official document genre and keywords. On the one hand, it ensures that the retrieved official document outlines belong to the same or similar genres, and on the other hand, it ensures that the retrieved official document outlines have similar contents, which is conducive to generating a more accurate outline.
[0081] Please continue reading Figure 3 , Figure 3 yes Figure 1 The specific flow chart of step S13 of the outline generation method is shown. Figure 3 The basic logic of retrieval by the retriever module is provided in the method shown:
[0082] like Figure 3 As shown, the specific steps are as follows:
[0083] Step S131: Obtain the document genre and filter candidate document titles of the same document genre from the historical outline library.
[0084] In the embodiment of the present application, the retriever module obtains candidate official document corpora of the same genre, including candidate official document titles, through genre filtering.
[0085] Step S132: Obtain the title similarity between the target document title and the candidate document title.
[0086] In the embodiment of the present application, the retriever module calculates the title similarity between the target document title and the candidate document title:
[0087] Sim title =cosine_similarity(emb1,emb2)
[0088] =cosine_similarity(Bert(title1),Bert(title2))
[0089] Among them, emb1 is the semantic vector representation obtained by inputting the target document title into a pre-trained language model such as Bert (Bidirectional Encoder Representations from Transformers), and emb2 is the semantic vector representation obtained by inputting the candidate document title into a pre-trained language model such as Bert. The similarity between the two vectors is then calculated by cosine similarity to measure the similarity between the two titles.
[0090] Step S133: Obtain the retrieved document title based on the title similarity.
[0091] In the embodiment of the present application, the retriever module selects the top k corpora according to the title similarity, that is, retrieves the official document titles and their corresponding official document outlines and adds them to the learning examples of the large model.
[0092] Furthermore, the retriever module can also calculate the keyword similarity between the target document title and the candidate document title. Among them, the keywords of the candidate document title can also be extracted by the element analysis module, or can be preset. The calculation formula of keyword similarity is as follows:
[0093] Sim keywords =Edit_similarity(key1,key2)
[0094] =1-Edit_distance(key1,key2) / LCS(key1,key2)
[0095] Among them, Edit_distance is the edit distance between key1 and key2, LCS represents the longest common subsequence between key1 and key2; key1 is the keyword of the target document title, and key2 is the keyword of the candidate document title.
[0096] Since the length of the keywords in this application is relatively short, the editing similarity can be used to measure the similarity between two keywords.
[0097] The retriever module combines title similarity and keyword similarity and performs a weighted calculation to obtain the final similarity:
[0098] Sim=α*Sim title +(1-α)*Sim keywords
[0099] In addition, in order to avoid introducing irrelevant corpus to disrupt the learning of the large model, this application also sets a minimum threshold, and candidate corpus below this threshold is directly discarded.
[0100] Step S134: Retrieve the historical outline corresponding to the retrieved document title from the historical outline library.
[0101] In the embodiment of the present application, the retriever module continues to retrieve the corresponding historical outlines from the historical outline library according to the several search document titles determined in step S133 as learning materials for the large model.
[0102] Step S14: Input the historical outline and the target document title into the generated model, and generate at least one level of outline title in sequence.
[0103] In an embodiment of the present application, the outline generation module of the outline generation device inputs the historical outline and the target document title into the generation model, so that the generation model automatically generates a document outline similar to the historical outline based on the target document title.
[0104] Specifically, the outline generation module of the present application uses a large generation model that can generate multiple levels of document outlines. Figure 2 Taking the example shown above as an example, when the title of the official document is used as the 0-level outline, the general knowledge and retrieval capabilities of the large model can be used to generate the first-level outline: [1. Basic situation; 2. Work progress; 3. Existing problems; 4. Next step work plan]. Then, the sub-outlines are generated for these four first-level outlines, such as the second-level outline under [1. Basic situation] [(1) Comprehensive changes in personnel reform; (2) Steady growth in the number of personnel; (3) Significant improvement in the corporate environment; (4) Harmony and stability of the enterprise]. Repeat the above steps to finally obtain the overall outline of the official document.
[0105] In the present application, the outline generation device inputs the target document title; based on the target document title, the document genre is extracted; based on the document genre, the historical outline is retrieved from the historical outline library; the historical outline and the target document title are input into the generated macro model, and at least one level of outline titles are generated in sequence. Through the above outline generation method, a framework for hierarchical outline generation is proposed, which uses document genres and historical outlines to assist the macro model in generating outlines, which can effectively reduce the situation of topic drift and redundant fields, and improve the outline quality output by the macro model.
[0106] In order to improve the performance of the base model in the outline generation task in the official document field, this application will also build a fine-tuning dataset for the outline generation task in the official document field, and use the lora framework to fine-tune the base model. Figure 4 and Figure 5 , Figure 4 is a flow chart of another embodiment of the document-based outline generation method provided by the present application. Figure 5 It is a framework diagram of the official document parsing process provided by this application.
[0107] like Figure 4 As shown, the specific steps are as follows:
[0108] Step S21: obtaining a fine-tuning training set, wherein the fine-tuning training set includes a number of training documents.
[0109] In an embodiment of the present application, the outline generation device obtains a fine-tuning training set, wherein the fine-tuning training set includes a number of training documents. The fine-tuning training set of the present application can be designed into the following two types of training sets according to different tasks: a generation instruction training set and a supplementary instruction training set. Figure 6 As shown, Figure 6 It is a schematic diagram of the large model fine-tuning task design provided in this application.
[0110] like Figure 6 As shown, the function of the generation instruction training set is to generate the subordinate outline according to the superior outline catalog. The function of the supplementary instruction training set is to supplement the intermediate outline according to the superior outline and the subordinate outline. The above two training sets are used to train different generation capabilities of the large model.
[0111] Specifically, an example of the design of the prompt words of the large model using the generated instruction training set is as follows:
[0112] Prompt 1: You are proficient in writing various official documents. Now you have a document outline catalogue of the genre "Report" to be prepared. Please write the sub-catalogue for the existing outline catalogue. The titles of each level are enclosed in [ ], and the upper and lower titles are separated by a middle.
[0113] Existing outline directory: [I. Basic Situation] in [Personnel Assessment and Rating Report].
[0114] Specifically, an example of the design of the prompt words of the large model using the supplementary instruction training set is as follows:
[0115] Prompt 2: You are proficient in writing various official documents. Now there is a document with the genre of "report" whose outline is missing. Please complete the outline according to the superior and subordinate outlines at the missing part. The titles of each level are enclosed in [ ]. The superior and subordinate titles are separated by , and the titles of the same level are separated by .
[0116] Superior outline: [Report on personnel assessment and rating].
[0117] Subordinate outlines: [(i) Comprehensive changes in personnel reform], [(ii) Steady growth in staff numbers], [(iii) Significant improvement in the corporate environment], [(iv) Harmony and stability in the enterprise].
[0118] Step S22: Parse the training document to obtain the tree structure intermediate file and the document style intermediate file.
[0119] In the embodiment of the present application, the outline generating device is as follows Figure 5 The document parsing process shown parses the training documents in the fine-tuning training set to obtain a tree structure intermediate file and a document style intermediate file.
[0120] Specifically, the outline generation device inputs the training document into the document parsing module. The document parsing module calls the python-docx parsing package to obtain the style information set in the word document, such as the title is set to the center style; the first line is set to the first-level title, the second line of text is set to left alignment, the third line is set to the second-level title, and the last line of text is set to right alignment.
[0121] Furthermore, the document parsing module sets extraction rules, such as: the second-level title that appears after the first-level title is the subordinate outline of the first-level title; the left-aligned text is the receiving unit of the document, and the right-aligned text is the issuing unit and issuing time of the document.
[0122] The document parsing module parses each word document according to the above logic and constructs Figure 5 A tree structure is shown.
[0123] Step S23: Extract the training outline based on the tree structure intermediate file.
[0124] Step S24: extracting training genres based on the document style intermediate file.
[0125] Step S25: storing the training outline and training genre of the training document into the historical outline library.
[0126] In an embodiment of the present application, the document parsing module further extracts elements from the document style intermediate file, such as the official document genre, and inputs them into the official document outline library and the official document paragraph material library; extracts paragraphs from the tree structure intermediate file and inputs them into the official document paragraph material library, and extracts outlines from the tree structure intermediate file and inputs them into the official document outline library.
[0127] After fine-tuning the large model through the above content, this application directly integrates the currently known information through the prompt word project and inputs it into the large model, allowing it to output the subordinate outline, as shown below:
[0128] You are proficient in writing various official documents. Now you have an outline for a document in the genre of "report" to be prepared. The theme of the document is: Personnel Assessment and Rating Report.
[0129] Here are a few examples for reference. If the examples are not good, you can ignore them:
[0130] Sample 1: [scope and number of people involved in the assessment], [time and method of assessment and rating], [overall distribution of assessment and rating results].
[0131] Sample 2: [Comparison of assessment and rating results of each department / position], [List of outstanding personnel and their main achievements], [List of personnel who need improvement and their main problems].
[0132] Sample 3: [The linkage between assessment rating results and salary, promotion, etc.], [Improvement measures for problems found in the assessment], [Further work plans and goals].
[0133] Sample 4: [Development and implementation of the assessment and rating plan], [Assessment and rating indicator system and scoring criteria], [Highlights and shortcomings of the assessment and rating work].
[0134] In the example, the titles of each level are enclosed in []. The upper and lower level titles are separated by , and the titles of the same level are separated by . Please keep the same format:
[0135] Please write a sub-outline based on the existing outline directory:
[0136] Existing outline directory: [Title: Personnel Assessment and Rating Report].
[0137] In order to improve the quality of the outline output by the large model and reduce the situation of topic drift and redundant fields, this application proposes a framework for hierarchical outline generation.
[0138] This application proposes a title and keyword-based retrieval model to incorporate new knowledge into the output of the large model.
[0139] In order to enable the large model to fully understand the writing habits of domain documents, this application proposes a multi-instruction fine-tuning task.
[0140] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0141] To implement the above outline generation method, this application also proposes an outline generation device, please refer to Figure 7 , Figure 7 It is a structural diagram of an embodiment of an outline generation device based on official documents provided in this application.
[0142] The outline generating device 300 of this embodiment includes a component parsing module 31 , a search enhancement module 32 , and an outline generating module 33 .
[0143] The element parsing module 31 is used to extract the document genre based on the input target document title.
[0144] The search enhancement module 32 is used to retrieve the historical outline from the historical outline library based on the official document genre.
[0145] The outline generation module 33 is used to input the historical outline and the target document title into a generation model, and sequentially generate at least one level of outline titles.
[0146] To implement the above outline generation method, this application also proposes another outline generation device, please refer to Figure 8 , Figure 8 It is a structural diagram of another embodiment of the outline generation device based on official documents provided in the present application.
[0147] The outline generating device 400 of this embodiment includes a processor 41 , a memory 42 , an input / output device 43 , and a bus 44 .
[0148] The processor 41, memory 42, and input / output device 43 are respectively connected to a bus 44. The memory 42 stores program data, and the processor 41 is used to execute the program data to implement the outline generation method described in the above embodiment.
[0149] In the embodiment of the present application, the processor 41 may also be referred to as a CPU (Central Processing Unit). The processor 41 may be an integrated circuit chip having the ability to process signals. The processor 41 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or the processor 41 may also be any conventional processor, etc.
[0150] This application also provides a computer storage medium, please continue to refer to Fig. 9 , Fig. 9 It is a structural diagram of an embodiment of a computer storage medium provided in the present application. The computer storage medium 600 stores a computer program 61. When the computer program 61 is executed by a processor, it is used to implement the outline generation method of the above embodiment.
[0151] When the embodiments of the present application are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.
[0152] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for generating an outline based on official documents, characterized in that: The outline generation method comprises: Enter the target document title; Extracting the genre of the official document based on the target official document title; Retrieving a historical outline from a historical outline library based on the genre of the official document; The historical outline and the target document title are input into a large model to generate an outline title of at least one level in sequence.
2. The outline generation method according to claim 1, characterized in that: The outline generation method also includes: Extracting keywords based on the target document title; The retrieving the historical outline from the historical outline library based on the official document genre includes: The historical outline is retrieved from the historical outline library based on the official document genre and the keywords.
3. The outline generation method according to claim 1, characterized in that: The retrieving the historical outline from the historical outline library based on the official document genre includes: Obtaining the official document genre and filtering candidate official document titles of the same official document genre from the historical outline library; Obtaining title similarity between the target official document title and the candidate official document title; Acquire the title of the searched document based on the title similarity; The historical outline corresponding to the retrieved document title is extracted from the historical outline library.
4. The outline generation method according to claim 3, characterized in that: The outline generation method further includes: Extract target keywords from the target document title; Extracting candidate keywords of the candidate official document title; Obtaining keyword similarity between the target keyword and the candidate keyword; The obtaining of the retrieved document title based on the title similarity comprises: Based on the title similarity and the keyword similarity, the search document title is obtained.
5. The outline generation method according to claim 1, characterized in that: The outline generation method further includes: Acquire a fine-tuning training set, wherein the fine-tuning training set includes a number of training documents; Parsing the training document to obtain a tree structure intermediate file and a document style intermediate file; Extracting a training outline based on the tree structure intermediate file; Extracting training genres based on the document style intermediate file; The training outline and training genre of the training document are stored in the historical outline library.
6. The outline generation method according to claim 5, characterized in that: The step of parsing the training document to obtain a tree structure intermediate file and a document style intermediate file includes: Calling a document parsing package to obtain the style information of the training document; Based on a preset extraction rule, obtaining structural information of the training document; According to the style information and the structure information, the tree structure intermediate file and the document style intermediate file are extracted.
7. The outline generation method according to claim 5, characterized in that: The fine-tuning training set includes a generation instruction training set and a supplementary instruction training set. The generation instruction training set is used to train the generation model to generate a subordinate outline according to the superior outline, and the supplementary instruction training set is used to train the generation model to supplement the intermediate outline according to the superior outline and the subordinate outline.
8. An outline generation device based on official documents, characterized in that: The outline generation device includes an element parsing module, a search enhancement module, and an outline generation module; wherein: The element parsing module is used to extract the genre of the official document based on the input target official document title; The search enhancement module is used to retrieve the historical outline from the historical outline library based on the official document genre; The outline generation module is used to input the historical outline and the target document title into a generation model, and sequentially generate at least one level of outline titles.
9. An outline generation device based on official documents, characterized in that: The outline generating device includes a memory and a processor coupled to the memory; The memory is used to store program data, and the processor is used to execute the program data to implement the outline generation method as described in any one of claims 1 to 7.
10. A computer storage medium, characterized in that: The computer storage medium is used to store program data, and when the program data is executed by a computer, it is used to implement the outline generation method as described in any one of claims 1 to 7.
Citation Information
Cited By
Writing auxiliary method and device fusing semantic retrieval and large model and electronic equipment
CN120492477A