A document outline generation method, system, terminal and medium
By constructing a structured hierarchical relationship in the document library and using a large language model to generate document outlines, the problems of multimodal information processing and keyword capture are solved, and efficient and automated document outline generation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG-HONG KONG-MACAO GREATER BAY AREA DIGITAL ECONOMY RESEARCH INSTITUTE (INTERNATIONAL ADVANCED TECHNOLOGY APPLICATION PROMOTION CENTER (SHENZHEN)
- Filing Date
- 2025-07-18
- Publication Date
- 2026-04-10
AI Technical Summary
Existing technologies cannot effectively handle multimodal information when generating document outlines, cannot dynamically capture non-explicit keywords, and lack the ability to expand contextual hierarchy, resulting in low generation efficiency and reliance on manual intervention.
By processing the original documents in the preset document library, a structured hierarchical relationship of paragraphs, tables and images is constructed. A large language model is used to determine the document keywords and target paragraph set, and a target document outline is generated.
It achieves automated multimodal parsing and the construction of structured hierarchical relationships, improving the logical standardization and data accuracy of document outline generation, reducing manual intervention, and increasing generation efficiency.
Smart Images

Figure CN120911406B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and in particular to a document outline generation method, system, terminal and medium. BACKGROUND
[0002] Currently, in the process of generating a document outline, the processing of multi-modal information such as natural paragraphs, tables and pictures in the document is isolated, and unstructured text is disconnected from the data source. At the same time, when generating a document outline, it is not possible to dynamically capture non-explicit keywords in natural paragraphs, and there is a lack of context level expansion capability. In addition, the existing technology mainly relies on artificial experience when generating a document outline, and cannot accurately obtain the required data for generating a report document, etc. A large amount of manual intervention is required to complete the acquisition and screening of data, which affects the efficiency of generating a report document, etc. SUMMARY
[0003] The technical problem to be solved by the present application is to provide a document outline generation method, system, terminal and medium to solve the above-mentioned defects of the prior art.
[0004] To solve the above technical problems, the technical scheme adopted by the present application is as follows:
[0005] In a first aspect, the present application provides a document outline generation method, wherein the method comprises:
[0006] processing the original documents in the preset document library to obtain all original natural paragraphs, table sets and document keywords of all the original documents;
[0007] constructing a structured hierarchical relationship between the original natural paragraphs according to the all original natural paragraphs, the table sets and the document keywords;
[0008] determining a target natural paragraph set based on the obtained target document name and the document keywords;
[0009] obtaining a target descriptive paragraph corresponding to the target natural paragraph according to the structured hierarchical relationship between the target natural paragraph set and the original natural paragraphs;
[0010] generating a target document outline according to the target natural paragraph set, the target descriptive paragraph corresponding to the target natural paragraph and the target document name.
[0011] In an implementation manner, the original documents in the preset document library are processed to obtain all original natural paragraphs and table sets of all the original documents, comprising:
[0012] dividing the documents of the original documents to obtain all original natural paragraphs, original tables and data visualization pictures;
[0013] Based on the multi-modal large model, the content of the data visualized picture is converted into a first table, and based on the first table and the original table, a table set is obtained;
[0014] Based on the large language model, the original natural paragraph and the table set are matched one by one, and the table corresponding to each original natural paragraph is obtained.
[0015] In an implementation, the original documents in a preset document library are processed to obtain document keywords of all the original documents, including:
[0016] The fixed keywords of the original documents are obtained;
[0017] According to each original natural paragraph and the fixed keywords of the original documents, the fixed keywords contained in each original natural paragraph are determined;
[0018] Based on the large language model and the each original natural paragraph, the open keywords of the each original natural paragraph are obtained, wherein the open keywords of the each original natural paragraph are different from the fixed keywords;
[0019] According to the fixed keywords and the open keywords, the document keywords of the each original natural paragraph are obtained.
[0020] In an implementation, the structured hierarchical relationship between the original natural paragraphs is constructed according to the all original natural paragraphs, the table set and the document keywords, including:
[0021] The structured hierarchical relationship between the original natural paragraphs is constructed by the large language model according to the all original natural paragraphs, the table set and the document keywords, wherein the structured hierarchical relationship between the original natural paragraphs contains a total introductory natural paragraph, a table corresponding to the total introductory natural paragraph, each hierarchical descriptive paragraph corresponding to the total introductory natural paragraph and a table corresponding to the each hierarchical descriptive paragraph.
[0022] In an implementation, based on the input target document name and the document keywords, a target natural paragraph set is determined, including:
[0023] The user keywords contained in the target document name are determined;
[0024] The user keywords are matched with the document keywords of the original documents to determine a first natural paragraph set corresponding to the user keywords;
[0025] The similarity between the target document name and each original natural paragraph is calculated by the large language model to determine a second natural paragraph set;
[0026] Based on the first natural paragraph set and the second natural paragraph set, a target natural paragraph set corresponding to the target document name of the input is obtained.
[0027] In an implementation manner, according to the structural hierarchical relationship between the target natural paragraph set and the original natural paragraph, a target descriptive formula paragraph corresponding to each target natural paragraph is obtained, including:
[0028] According to the structural hierarchical relationship between the target natural paragraph set and the original natural paragraph, a plurality of target descriptive formula paragraphs corresponding to each target natural paragraph and a table corresponding to the plurality of target descriptive formula paragraphs are determined by using a breadth-first search algorithm, wherein a hierarchical difference between the each target natural paragraph and the target descriptive formula paragraph does not exceed a preset value.
[0029] In an implementation manner, the target document outline is generated according to the target natural paragraph set, the target descriptive formula paragraph corresponding to the target natural paragraph, and the target document name, including:
[0030] According to the structural hierarchical relationship between the target natural paragraph set, the target descriptive formula paragraph, and the target document name, the structural hierarchical relationship of the target natural paragraph set is expanded level by level based on a large language model to obtain an outline framework of the target document name.
[0031] According to the outline framework, the target natural paragraph set, the target descriptive formula paragraph, and the table set, the target document outline is generated by the large language model, wherein the target document outline includes a plurality of chapter names and index data contained in each chapter name.
[0032] In an implementation manner, after the target document outline is generated, the method further includes:
[0033] An interaction requirement is received.
[0034] According to the interaction requirement, a chapter name of the target document outline is selected, the selected chapter name is operated, and the target document outline is updated.
[0035] In an implementation manner, the target document outline is generated according to the target natural paragraph set, the target descriptive formula paragraph corresponding to the target natural paragraph, and the target document name, including:
[0036] If the interaction requirement is deletion, the index data contained in the selected chapter name, all lower-level chapter names contained in the selected chapter name, and the index data contained in the all lower-level chapter names are deleted.
[0037] In an implementation manner, the selecting the chapter name of the target document outline according to the interaction requirement, operating the selected chapter name, and updating the target document outline comprise:
[0038] If the interaction requirement is adding / modifying, an added / modifying chapter name is obtained, a first target natural paragraph set of the added / modifying chapter name is determined, and a first target descriptive paragraph corresponding to the first target natural paragraph set is determined;
[0039] The added / modifying chapter name is verified according to the first target natural paragraph set, the first target descriptive paragraph, and the outline framework;
[0040] If the verification passes, a hierarchical relationship of the first target natural paragraph set is expanded level by level based on the large language model according to the first target natural paragraph set, the first target descriptive paragraph, and the added / modifying chapter name, to obtain an outline framework of the added / modifying chapter name;
[0041] A hierarchical outline of the added / modifying chapter name is generated by the large language model according to the outline framework of the added / modifying chapter name, the first target natural paragraph set, the first target descriptive paragraph, and a table set corresponding to the first target descriptive paragraph, wherein the hierarchical outline of the added / modifying chapter name comprises a plurality of sub-chapter names and index data contained in each sub-chapter name;
[0042] The target document outline is updated based on the hierarchical outline of the added / modifying chapter name.
[0043] In a second aspect, an embodiment of the present application further provides a document outline generation system, wherein the system is used to implement the steps of the document outline generation method in any of the above-mentioned schemes, and the system comprises:
[0044] An original document processing module is configured to process original documents in a preset document library to obtain all original natural paragraphs, table sets, and document keywords of all the original documents;
[0045] A hierarchical structure establishing module is configured to construct a structured hierarchical relationship between the original natural paragraphs according to the all original natural paragraphs, the table sets, and the document keywords;
[0046] A target natural paragraph analysis module is configured to determine a target natural paragraph set based on a target document name and the document keywords;
[0047] A target descriptive paragraph analysis module is configured to obtain a target descriptive paragraph corresponding to a target natural paragraph according to the structured hierarchical relationship between the target natural paragraph set and the original natural paragraphs.
[0048] a target document outline generation module configured to generate a target document outline according to the target natural paragraph set, the target natural paragraph corresponding target descriptive paragraph, and the target document name.
[0049] In a third aspect, an embodiment of the present application further provides a terminal, wherein the terminal comprises a memory, a processor, and a document outline generation program stored in the memory and executable on the processor, and the processor implements the steps of the document outline generation method of any one of the above solutions when executing the document outline generation program.
[0050] In a fourth aspect, an embodiment of the present application further provides a computer readable storage medium, wherein the computer readable storage medium stores a document outline generation program, and the steps of the document outline generation method of any one of the above solutions are implemented when the processor executes the document outline generation program.
[0051] Advantages: Compared with the prior art, the present application provides a document outline generation method, which first processes the original documents in the preset document library to obtain all original natural paragraphs, table sets, and document keywords of all the original documents. Then, a structured hierarchical relationship between the original natural paragraphs is constructed according to the all original natural paragraphs, the table sets, and the document keywords. Next, a target natural paragraph set is determined based on the obtained target document name and the document keywords. Then, a target natural paragraph corresponding target descriptive paragraph is obtained according to the target natural paragraph set and the structured hierarchical relationship between the original natural paragraphs. Finally, a target document outline is generated according to the target natural paragraph set, the target natural paragraph corresponding target descriptive paragraph, and the target document name.
[0052] From the technical solutions of the present application, the original document is processed to obtain the original natural paragraph, the table set and the document keyword, and the structured hierarchical relationship between the original natural paragraphs is further determined, the problem of the existence of fragmented data such as natural paragraphs, tables and pictures is solved, the foundation for subsequent automatic multi-modal analysis, paragraph semantic analysis and construction of structured hierarchical relationship of the target document name outline is laid, and the modular material library of the target document outline which can trace the context of the target document name is beneficial to the construction of the target document. And the present application determines the document keyword of the original document, which is beneficial to extracting the main content of the original document, and is convenient for determining the semantic relevance of each original natural paragraph in the original document and the target document name based on the target document name and the document keyword, so as to facilitate the determination of the target natural paragraph set, and further determine the target descriptive paragraph corresponding to the target natural paragraph according to the structured hierarchical relationship between the original natural paragraphs, strengthen the relevance between the target document name and the target natural paragraph set, and facilitate the accurate positioning of the context logical chain. The present application automatically generates the target document outline, which is beneficial to ensuring the logical specification and data accuracy of the target document outline generation, and the whole process does not need manual intervention, and the generation efficiency of the target document outline is improved. BRIEF DESCRIPTION OF DRAWINGS
[0053] Figure 1 The flow chart of the preferred embodiment of the document outline generation method provided by the embodiment of the present application.
[0054] Figure 2 The architecture schematic diagram of the document outline generation system provided by the embodiment of the present application.
[0055] Figure 3 The principle block diagram of the terminal provided by the embodiment of the present application. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solutions and effects of the present application more clear and explicit, the present application is further described in detail below with reference to the drawings and examples. It should be understood that the specific examples described herein are only used to explain the present application, and are not used to limit the present application.
[0057] The flow chart shown in the drawings is only an example description, and does not necessarily include all contents and operations or steps, and does not necessarily be executed in the described order. For example, some operations or steps can be decomposed, combined or partially combined, so that the actual execution order may be changed according to the actual situation.
[0058] It is to be understood that the terms used in the specification of the present application are only for the purpose of describing specific embodiments of the present application and are not intended to limit the present application. As used in the specification and the appended claims of the present application, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise.
[0059] It should be understood that, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the terms "first", "second", etc. are used to distinguish the same or similar items with basically the same function and role. For example, the first control information and the second control information are only used to distinguish different control information, and do not limit the order.
[0060] It should be understood that the terms "first", "second", etc. do not limit the quantity and execution order, and the terms "first", "second", etc. also do not necessarily mean different.
[0061] It should also be understood that the term "and / or" used in the specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.
[0062] In order to solve the problems in the prior art, the present application provides a document outline generation method. Based on the method of the present embodiment, the generation of the target document outline can be automatically realized, the required data can be accurately obtained, and no manual intervention is required in the process of generating the target document outline, thereby improving the generation efficiency of the target document outline. In specific applications, the present application first processes the original documents in a preset document library to obtain all original natural paragraphs, table sets and document keywords of all the original documents. Then, according to the all original natural paragraphs, the table sets and the document keywords, a structured hierarchical relationship between the original natural paragraphs is constructed. Next, based on the obtained target document name and document keywords, a target natural paragraph set is determined. Then, according to the structured hierarchical relationship between the target natural paragraph set and the original natural paragraphs, a target descriptive formula paragraph corresponding to the target natural paragraph is obtained. Finally, according to the target natural paragraph set, the target descriptive formula paragraph corresponding to the target natural paragraph and the target document name, a target document outline is generated.
[0063] The document outline generation method of the present embodiment can be applied to a terminal, which is a computer, a mobile phone, a smart television and the like. As shown in FIG. Figure 1 The document outline generation method of the present embodiment includes the following steps:
[0064] In step S100, the original documents in the preset document library are processed to obtain all original natural paragraphs, table sets and document keywords of all the original documents.
[0065] Since the processing of the original natural paragraphs, original tables and data visualization pictures and other multi-modal data in the original documents in the prior art is isolated, the fine-grained semantic association between the paragraphs and the tables cannot be established. By processing the original documents in the preset document library to obtain all original natural paragraphs, original tables and document keywords of all the original documents, the structured hierarchical relationship between the original natural paragraphs can be determined in the subsequent steps, the modular material library with traceable context and data source can be established, and the data reuse efficiency and intelligent analysis capability for subsequent generation of the document outline of the target document name are improved.
[0066] Specifically, the embodiment first divides each original document in the preset document library by using a document tool to obtain all original natural paragraphs, original tables and data visualization pictures in each original document. The data visualization pictures include but are not limited to line charts, column charts and pie charts. Then, based on a multi-modal large model, the content of the data visualization pictures is converted into a first table, and based on the first table and the original table, a table set is obtained. Therefore, the table set includes the original table and the first table converted from the content of the data visualization pictures. By converting the content of the data visualization pictures into the first table, the content of the data visualization pictures can be reused and analyzed, and the association between the content of the data visualization pictures and the original natural paragraphs can be established, so as to avoid missing the content of the data visualization pictures. That is, by using the large language model to associate the natural paragraphs and the tables and to associate the hierarchical relationship between the natural paragraphs, the hierarchical and fine-grained management of all the original documents in the preset document library is facilitated, so that the unstructured text is converted into the modular data with traceable context and associable data source, which provides strong support for the logical arrangement, data reference and content refinement when the document outline of the target document name is intelligently generated subsequently. In actual application, taking the generation of the economic operation report outline as an example, the preset document library includes a plurality of original documents, wherein the original documents are historical economic reports. When the multi-modal large model is used to convert the content of the data visualization pictures in the historical economic reports into the first table, the following prompt words can be input: you are an economic analyst, please convert the data in the following pictures into a table, and output in markdown format. By using the multi-modal large model, the data visualization pictures can be automatically recognized, and the content thereof can be extracted and converted into a table for output, so that the first table is obtained.
[0067] After obtaining the table set, the embodiment based on the large language model matches the original natural paragraph with the table set one by one to obtain the table corresponding to each original natural paragraph, that is, to determine which data in the table is referred to in each original natural paragraph. When matching, each original natural paragraph may match multiple tables, indicating that the original natural paragraph refers to data in multiple tables. After matching, the embodiment can store the original natural paragraph and the successfully matched table, which is convenient for data calling in the subsequent steps. For example, each original natural paragraph is stored in the form of a data structure of {“text content in the original natural paragraph”:“xxxxxx”,“successfully matched table number”:[“table 1”,“table 2”]}. In actual application, taking the generation of the economic operation report outline as an example, the original document is the historical economic report, and when the large language model is used, the following prompt words can be input (the data in the braces indicates the data to be filled in):
[0068] “table title or table number”: {table title or table number}
[0069] Table data:
[0070] {data in the table}
[0071] Content of the original natural paragraph:
[0072] {content of the original natural paragraph}
[0073] Requirement: You are an economic analyst, please answer whether the content in the given original natural paragraph uses the data in the given table with “yes” and “no”.
[0074] Based on the above prompt words, the large language model can automatically retrieve the content of each original natural paragraph and the content of each table in the table set, and match them one by one to obtain the table corresponding to each original natural paragraph.
[0075] Further, the embodiment also determines the document keywords in the original document. Since the prior art has a single way of determining the document keywords, it cannot dynamically capture the non-explicit keywords in the natural paragraph, such as emerging industry terms, personalized descriptions and other keywords, and lacks the context level expansion capability, resulting in the search result being limited to the horizontal matching, and being difficult to cover the implicit associated content of the user demand. Therefore, the embodiment first determines the fixed keywords in the original document, which are the common keywords in the original document. Taking the historical economic report as an example, the embodiment can first collect and sort the common keywords in the historical economic report, thereby determining the fixed keywords of the economic operation report, such as any one or more of the industry keywords, the index keywords, and the region keywords. For example, the industry keywords can be “industrial above designated size” and “profitable service industry”; the index keywords can be “GDP” and “operating income”; and the region keywords can be “XX region”. The embodiment can form a fixed keyword library with the determined fixed keywords, so as to be directly called in the subsequent steps. Then, the embodiment can determine the fixed keywords contained in each original natural paragraph according to each original natural paragraph and the fixed keywords of the original document. Specifically, the embodiment can match each original natural paragraph with the fixed keywords based on the string matching method, to judge whether the fixed keywords appear in a certain original natural paragraph, so as to determine the fixed keywords contained in each original natural paragraph.
[0076] Further, the embodiment can further obtain an open keyword of each original natural paragraph based on the large language model and each original natural paragraph. Specifically, the embodiment can randomly extract a plurality of open keywords from each original natural paragraph based on the large language model. The open keywords of each original natural paragraph are different from the fixed keywords. Finally, the document keywords of each original natural paragraph are obtained according to the fixed keywords and the open keywords. That is, for each original natural paragraph, the fixed keywords contained and the open keywords extracted are taken as the document keywords of the original natural paragraph. Therefore, the document keywords of each original natural paragraph include the fixed keywords and the open keywords, and the open keywords are different from the fixed keywords. Moreover, in actual application, the document keywords cannot include numbers or specific dates. It can be seen that the embodiment can determine the document keywords in two dimensions, so that the main content of each original natural paragraph in the original document can be accurately reflected, and it is convenient to determine the semantic relevance between each original natural paragraph in the original document and the target document name in the subsequent step based on the input target document name and the document keywords through keyword matching, find the associated original natural paragraph, and thus determine the target natural paragraph set. In actual application, taking the generation of the economic operation report outline as an example, when the original document is a historical economic report, the prompt words input to the large language model when determining the open keywords are as follows:
[0077] “Paragraph text: {text of the original natural paragraph}
[0078] Extracted keywords: {fixed keywords}
[0079] You are an economic analyst, please extract a plurality of open keywords from the text of the original natural paragraph above, which cannot be repeated with the extracted fixed keywords. Please note that the keywords cannot include numbers or specific dates.
[0080] Step S200, constructing a structured hierarchical relationship between the original natural paragraphs according to the all original natural paragraphs, the table set and the document keywords.
[0081] The embodiment is also based on a large language model to perform hierarchical analysis on the original natural paragraphs and determine the structured hierarchical relationship between the original natural paragraphs. Specifically, the embodiment can determine, through a large language model, the total introductory natural paragraph in the original natural paragraphs, the table corresponding to the total introductory natural paragraph, the hierarchical descriptive paragraph corresponding to the total introductory natural paragraph, and the table corresponding to the hierarchical descriptive paragraph according to the all original natural paragraphs, the table set, and the document keywords. Then, a tree structure is constructed based on the total introductory natural paragraph, the table corresponding to the total introductory natural paragraph, the hierarchical descriptive paragraph corresponding to the total introductory natural paragraph, and the table corresponding to the hierarchical descriptive paragraph, so as to obtain the structured hierarchical relationship, wherein the root node of the tree structure can be the total introductory natural paragraph, the child node can be the hierarchical descriptive paragraph and / or the table corresponding to the hierarchical descriptive paragraph, and the child node can also be the table corresponding to the total introductory natural paragraph. Since there is a reference relationship between the original natural paragraph and the table in the table set, and the document keywords can accurately reflect the main content of each original natural paragraph in the original document, the large language model can comprehensively analyze the original natural paragraph, the table set, and the document keywords, determine the content association relationship between the original natural paragraphs, and analyze which are the total introductory natural paragraph and the table corresponding to the total introductory natural paragraph, and which are the hierarchical descriptive paragraph corresponding to the total introductory natural paragraph and the table corresponding to the hierarchical descriptive paragraph. In this way, the structured hierarchical relationship between the original natural paragraphs is obtained. For example, if it is determined that the original natural paragraph A is the total introductory natural paragraph and the original natural paragraph B is the descriptive paragraph of the original natural paragraph A, a structured hierarchical relationship is formed between the original natural paragraph A and the original natural paragraph B. Similarly, all total introductory natural paragraphs, tables corresponding to the total introductory natural paragraphs, hierarchical descriptive paragraphs corresponding to the total introductory natural paragraphs, and tables corresponding to the hierarchical descriptive paragraphs are determined, so as to construct a tree structure, which can be a json format tree graph, and thus the structured hierarchical relationship between all original natural paragraphs can be obtained. The embodiment is advantageous in refining and enriching the corpus of the subsequent generated target document outline, and improving the generation efficiency and accuracy of the target document outline. In actual application, taking the generation of an economic operation report as an example, the prompt words input by the large language model when analyzing the structured hierarchical relationship can be:
[0082] “original natural paragraph [1]: {text content of original natural paragraph 1}
[0083] original natural paragraph [2]: {text content of original natural paragraph 2}
[0084] ……
[0085] Requirements: You are an economic analyst. Extract the writing structure from the original paragraphs of an article, ignoring specific dates and data, and return a JSON-formatted tree diagram. Each node in the tree diagram must contain the paragraph range of the original paragraphs corresponding to that node, such as [10-13] representing the 10th to the 13th original paragraphs.
[0086] After inputting the above prompts, the large language model analyzes each original paragraph, table set, and document keywords, and the output of the structured hierarchical relationship is shown in the following example:
[0087] {
[0088] “node”: “Industry development status”
[0089] "paragraphs": [10, 17],
[0090] “children”:[
[0091] {
[0092] “node”: “Industry”
[0093] "paragraphs": [10, 12],
[0094] “children”:[
[0095] {
[0096] “node”: “The rebound performance of leading companies”
[0097] "paragraphs": [10, 10],
[0098] },
[0099] {
[0100] “node”: “Small Business vs. Mezzanine Business”
[0101] "paragraphs":[11,11],
[0102] },
[0103] {
[0104] “node”: “Analysis of the rise and fall of major industries”
[0105] "paragraphs":[12,12],
[0106] } ]
[0108] },
[0109] {
[0110] “node”: “Key service industries”
[0111] "paragraphs": [13, 15],
[0112] “children”:[
[0113] {
[0114] “node”: “Development Status of XX Group”
[0115] "paragraphs":[13,13],
[0116] },
[0117] {
[0118] “node”: “Internet + economic effect”
[0119] "paragraphs":[14,14],
[0120] },
[0121] {
[0122] “node”: “The phenomenon of enterprise differentiation”
[0123] "paragraphs":[15,15],
[0124] } ]
[0126] }
[0127] This embodiment processes the original document and uses a large language model to analyze the relationship between the original paragraphs and tables, as well as the structured hierarchical relationship between the original paragraphs. This facilitates hierarchical and refined management of the original document, transforming unstructured text into a modular material library with traceable context and associative data sources. This provides strong support for the logical arrangement, data referencing, and content refinement when intelligently generating outlines for target document names.
[0128] Step S300: Based on the obtained target document name and the document keywords, determine the target paragraph set.
[0129] The target document name of the embodiment can be input by the user. After obtaining the target document name, the embodiment can first retrieve the target paragraph set associated with the target document name, which is the key content for generating the target document outline. Specifically, the embodiment first determines the user keywords from the target document name. The determination of the user keywords can be achieved in the same way as the determination of the fixed keywords and open keywords in step S100 described above, and will not be described here. After determining the user keywords, the embodiment matches the user keywords with the document keywords of the original document to determine the first paragraph set corresponding to the user keywords. Specifically, the embodiment can match the determined user keywords with the document keywords (i.e., fixed keywords and open keywords) of each original paragraph in the original document to obtain the matching degree between the user keywords and each original paragraph, and then filter out the top N original paragraphs with the highest matching degree to obtain the first paragraph set. Then, the embodiment calculates the similarity between the target document name and each original paragraph based on the large language model to determine the second paragraph set. Specifically, after calculating the similarity between the target document name and each original paragraph, the embodiment filters out the top M original paragraphs with the highest similarity to obtain the second paragraph set. The large language model used in this step can be a general large language model or the same as the large language model used in step S100. In this embodiment, the similarity can be the probability predicted by the large language model that the word "yes" needs to be output. The higher the probability of the word "yes", the more similar the target document name and the original paragraph. Further, the embodiment takes the first paragraph set and the second paragraph set as the target paragraph set corresponding to the target document name.
[0130] As can be seen, the embodiment can filter out the required target paragraph set from two dimensions of the matching degree between the user keywords and the document keywords and the similarity between the target document name and the original paragraph, which is beneficial to refine and enrich the corpus for generating the target document outline subsequently, and improves the generation efficiency and accuracy of the target document outline.
[0131] In actual application, taking the generation of an economic operation report as an example, when outputting the target paragraph set, the prompt words input to the large language model by the embodiment are as follows:
[0132] "Paragraph content: {content of the original paragraph}
[0133] Target document name: {user input target document name}
[0134] Requirement: You are an economist, please judge whether the content of the original paragraph is related to the target document name, please answer "yes" or "no".
[0135] In this way, the large language model analyzes whether the target document name is related to each original natural paragraph based on the input target document name, and outputs the first natural paragraph set and the second natural paragraph set, and finally obtains the target natural paragraph set.
[0136] In step S400, a target descriptive formula paragraph corresponding to the target natural paragraph is obtained according to the structured hierarchical relationship between the target natural paragraph set and the original natural paragraph.
[0137] The embodiment can also determine the target descriptive formula paragraph corresponding to the target natural paragraph set based on the structured hierarchical relationship between the original natural paragraphs determined in step S200. The determined target descriptive formula paragraph is also a key data indicator for generating the target document outline.
[0138] Specifically, after determining the target natural paragraph set, the embodiment can use a breadth-first search algorithm to determine a plurality of target descriptive formula paragraphs corresponding to each target natural paragraph and tables corresponding to the plurality of target descriptive formula paragraphs based on the structured hierarchical relationship between the original natural paragraphs determined in step S200 in combination with the target natural paragraph set, wherein the hierarchical difference between the target natural paragraph and the target descriptive formula paragraph does not exceed a preset value. The breadth-first search algorithm of the embodiment is a graph traversal algorithm that traverses all reachable nodes layer by layer starting from the starting node, and preferentially accesses nodes closer to the starting node. For example, if the structured hierarchical relationship between the original natural paragraphs obtained based on step S200 is: A city economic development→industrial development→manufacturing development→computer manufacturing development. If the paragraph of “A city economic development” is the target natural paragraph, and the preset value is set to 3, then the paragraphs with a hierarchical difference of less than or equal to 3 from the paragraph of “A city economic development” need to be obtained as the target descriptive formula paragraph. As can be seen, the paragraphs of “industrial development”, “manufacturing development”, and “computer manufacturing development” have a hierarchical difference of less than or equal to 3 from the paragraph of “A city economic development”, so the paragraphs of “industrial development”, “manufacturing development”, and “computer manufacturing development” are the target descriptive formula paragraphs of the paragraph of “A city economic development”.
[0139] The embodiment can efficiently and accurately match the target document name with the original document content by combining the multi-dimensional retrieval strategy of keyword matching, semantic association analysis, and structured hierarchical relationship expansion, and references the logic of the original document (such as document keywords, structured hierarchical relationship, etc.). In addition, the embodiment expands the target natural paragraph to its associated content (such as from “A city economic analysis” to “B district industrial growth”) based on the breadth-first search, avoids the isolation defect of single-level retrieval, ensures that the user not only obtains the surface matching paragraph of the keywords, but also contains the implicit associated data in the context logic chain, and improves the information integrity.
[0140] Step S500, generating a target document outline according to the target natural paragraph set, the target natural paragraph corresponding target descriptive formula paragraph and the target document name.
[0141] After analyzing the target natural paragraph set and the target natural paragraph corresponding target descriptive formula paragraph, the embodiment can obtain a large language model based on the determined target natural paragraph set, target descriptive formula paragraph and target document name, and expand the structured hierarchical relationship of the target natural paragraph set level by level to obtain the outline framework of the target document name. Then, according to the outline framework, the target natural paragraph set, the target descriptive formula paragraph and the table set, the target document outline is generated by the large language model, wherein the target document outline contains multiple chapter names and index data contained in each chapter name. The embodiment realizes automatic generation of the target document outline, and the entire process does not require manual intervention, thereby improving the generation efficiency of the target document outline.
[0142] Specifically, the step-by-step expansion of the embodiment is to use a large language model to expand the chapter name in the target document name to the next level according to the target natural paragraph and the target descriptive formula paragraph, and obtain the outline framework. For example, the chapter name is "A city economic development situation", and the large language model expands it to "A city industrial development situation", "A city service industry development situation", "A city commercial development situation" and other sub-chapter names. In actual application, the prompt words input into the large language model are as follows:
[0143] "Chapter name: {Chapter name in target document name}
[0144] Target natural paragraph set: {Text of target natural paragraph set}
[0145] Request: You are an economic analysis expert, please expand the chapter name in the target document name input by the user according to the expansion logic (such as industry classification, time trend, regional comparison, etc.) in the target natural paragraph set to obtain the expanded sub-chapter name".
[0146] The large language model of the embodiment can automatically learn the data indicators and context logic required for each chapter from the target natural paragraph set, target descriptive formula paragraph and table set according to the outline framework to generate the target document outline. In addition, when generating the target document outline, it is necessary to avoid repeated or highly similar index data. In actual application, the prompt words input into the large language model are as follows:
[0147] "Target document name: {User input target document name}
[0148] Outline framework: {Outline framework}
[0149] Reference Passage: {Text content of target paragraph set}
[0150] Table Data: {Data in each paragraph corresponding table}
[0151] Requirement: As an economic analysis expert and data engineer, analyze the current outline framework with reference passages and table data, and generate a target document outline that includes the following structured data requirement list. Each index data needs to be accurate to the sub-section level, reflecting contextual relevance.
[0152] Output format:
[0153] Index data name (e.g., total output value of industries above a certain scale, proportion of tertiary industry)
[0154] Purpose explanation (explain how the index supports the core argument of the corresponding chapter)
[0155] Priority (high / medium / low, based on the analysis focus mentioned in the reference passage)
[0156] Additional requirements:
[0157] Avoid repeating or highly similar indicators (e.g., if "GDP growth" is already included, do not repeat "regional production value growth rate")
[0158] Mark special needs for cross-year comparison or industry segmentation (e.g., 2015-2024 cross-border e-commerce import and export data by quarter)
[0159] Further, the embodiment can also receive interaction requirements, including deletion, addition, and modification. Then, according to the interaction requirements, select the chapter name of the target document outline, and operate the selected chapter name, and update the target document outline.
[0160] Specifically, if the interaction requirement is deletion, the selected chapter name can be deleted from the target document outline. The user can select the chapter name to be deleted (e.g., "A city industrial development situation") in the interaction interface. Moreover, the embodiment also deletes the index data contained in the selected chapter name, all sub-chapter names contained in the selected chapter name, and all sub-chapter names contained in the index data.
[0161] If the interaction requirement is addition / modification, the user can input the added / modified chapter name through the preset operation button, and then determine the position of the added / modified chapter name in the target document outline, which can insert the outline frame of the added / modified chapter name. Then, the added / modified chapter name is obtained, the first target natural paragraph set of the added / modified chapter name and the first target descriptive paragraph corresponding to the first target natural paragraph set are determined. Then, the added / modified chapter name is verified according to the first target natural paragraph set, the first target descriptive paragraph and the outline frame. Specifically, the added / modified chapter name can be verified for logical correctness and content redundancy by a large language model. If the large language model judges that there is logical inconsistency or content redundancy, the corresponding reason is returned, and a pop-up window of an interaction interface is prompted to ensure the logical correctness and simplicity of the subsequently generated target document outline. In actual application, if the target document outline is an economic operation report outline, the prompt words input to the large language model are as follows:
[0162] “Current target document name: {parent chapter name}
[0163] Current target document name under other chapter names: {other sub-chapter names under the parent chapter}
[0164] Added / modified chapter name: {user input added / modified chapter name}
[0165] Reference paragraph: {target natural paragraph set}
[0166] Requirement: As an economist, judge whether the added / modified chapter name is consistent with the expansion logic of the parent chapter, and whether there is conflict or repetition with other sub-chapters. Output format:
[0167] Reasonableness: [Yes / No]
[0168] Reason: [1-2 sentences]
[0169] If both the logical correctness and the content repeatability are verified, the newly added / modified chapter name can be inserted at the end of the existing chapter list. Of course, the user can also adjust the position of the newly added / modified chapter name in the existing chapter list. Then, since the chapter name is newly added or modified, the embodiment based on the large language model expands the structured hierarchical relationship of the first target natural paragraph set according to the first target natural paragraph set, the first target descriptive paragraph and the newly added / modified chapter name, and obtains the outline framework of the newly added / modified chapter name, which can be inserted at the position of the newly added / modified chapter name. In this way, the core paragraph associated with the newly added / modified chapter name can be obtained, which is beneficial to refine and enrich the corpus of the generated target document outline, and improve the generation efficiency and accuracy of the target document outline. Then, the embodiment can generate the hierarchical outline of the newly added / modified chapter name according to the outline framework of the newly added / modified chapter name, the first target natural paragraph set, the first target descriptive paragraph and the table set corresponding to the first target descriptive paragraph through the large language model, wherein the hierarchical outline of the newly added / modified chapter name comprises a plurality of sub-chapter names and index data contained in each sub-chapter name. Finally, the target document outline is updated based on the hierarchical outline of the newly added / modified chapter name.
[0170] The embodiment realizes intelligent mapping from user demand to structured outline framework and accurately anchors the required data through the hierarchical generation of the target document outline and the optimization mechanism of interactive demand (such as deleting, adding and modifying chapter names), forming a two-way closed loop of “outline framework-index data”. The embodiment learns the writing paradigm of the target document outline based on the large language model (such as the granularity level of industry classification and the expansion rule of comparison dimension), combines the target natural paragraph set retrieved by the user as a reference paragraph, automatically deduces the chapter expansion path conforming to the industry specification, and allows the user to manually intervene in the target document outline generated by the large language model through the dynamic optimization mechanism of interactive demand, and carries out the process of verification and audit based on the large language model.
[0171] In summary, the target document outline generation method of the present application automatically segments the original natural paragraphs, original tables and data visualization pictures in the original document, converts the unstructured picture data into structured tables using a multi-modal large model, and realizes semantic association matching between the original natural paragraphs and the tables using a large language model. At the same time, through the combination of pre-defined fixed keywords and open keywords freely extracted by the large language model, and the combing of the structured hierarchical relationship of the tree structure, the target document outline of the target document name can trace the context and associate the data source of the modular material library, and improve the efficiency of structured processing of unstructured documents and the context management ability.
[0172] Secondly, the application uses a keyword matching algorithm to preliminarily match the target document name input by the user with the document keywords in each original natural paragraph, and then judges the semantic relevance of the paragraph and the target document name through a large language model, and finally expands the upper and lower associated content of the target natural paragraph set from the structured hierarchical relationship of the tree structure in combination with the breadth-first search algorithm, avoids the information isolation of a single retrieval mode, realizes the accurate positioning from the surface keyword matching to the context logical chain, and improves the integrity and robustness of information retrieval.
[0173] In addition, the application analyzes the writing logic of the target document name input by the user through a large language model to generate an outline framework, supports interactive addition, deletion, modification and recursive expansion of the user, and at the same time, based on the structure of the final outline framework and the content of the associated target natural paragraph set and the target descriptive paragraph, automatically generates the target document outline, forms a "outline framework-target data" two-way closed loop, and ensures the logical specification and data adaptability of the target document outline generation.
[0174] Based on the above embodiment, the application further provides a document outline generation system, which is used to realize the steps in the above method embodiment. Specifically, as shown in Figure 2 the document outline generation system of the present embodiment includes an original document processing module 10, a hierarchical structure establishing module 20, a target natural paragraph analysis module 30, a target descriptive paragraph analysis module 40 and a target document outline generation module 50. The original document processing module 10 is used to process the original documents in a preset document library to obtain all original natural paragraphs, table sets and document keywords of all the original documents. The hierarchical structure establishing module 20 is used to construct the structured hierarchical relationship between the original natural paragraphs according to the all original natural paragraphs, the table sets and the document keywords. The target natural paragraph analysis module 30 is used to determine a target natural paragraph set based on the obtained target document name and the document keywords. The target descriptive paragraph analysis module 40 is used to obtain a target descriptive paragraph corresponding to a target natural paragraph according to the target natural paragraph set and the structured hierarchical relationship between the original natural paragraphs. The target document outline generation module 50 is used to generate the target document outline according to the target natural paragraph set, the target descriptive paragraph corresponding to the target natural paragraph and the target document name.
[0175] The working principles of each module in the document outline generation system of the present embodiment are the same as those of each step in the above method embodiment, which will not be repeated here.
[0176] The various modules in the above document outline generation system can be implemented in whole or in part by software, hardware, and combinations thereof. The various modules can be embedded in or independent of a processor in the terminal in hardware form, or stored in a memory in the terminal in software form, so as to be invoked and executed by the processor to perform the operations corresponding to the various modules.
[0177] Based on the above embodiments, the present application further provides a terminal, a principle block diagram of which can be shown as Figure 3 The terminal can include one or more processors 100 (only one is shown in Figure 3 The one or more processors 100 can implement the various steps in the sleep analysis method embodiment based on multi-sensor data when executing the computer program 102. Alternatively, the one or more processors 100 can implement the functions of the various modules / units in the sleep analysis system embodiment based on multi-sensor data when executing the computer program 102, which is not limited here.
[0178] In an embodiment, the processor 100 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0179] In an embodiment, the memory 101 can be an internal storage unit of the electronic device, such as a hard disk or a memory of the electronic device. The memory 101 can also be an external storage device of the electronic device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the memory 101 can include both the internal storage unit and the external storage device of the electronic device. The memory 101 is used to store the computer program and other programs and data required by the terminal. The memory 101 can also be used to temporarily store data that has been output or will be output.
[0180] Those skilled in the art can understand that Figure 3 The principle block diagram shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the terminal to which the scheme of the present application is applied. The specific terminal can include more or less components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0181] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing relevant hardware. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiments. Any reference to memory, storage, operating database or other medium used in the embodiments provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM) and memory bus dynamic RAM (RDRAM) and the like.
[0182] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method of generating an outline of a document, characterized by, The method includes: Extract fixed keywords from the original document; Based on each original paragraph and the fixed keywords of the original document, determine the fixed keywords contained in each original paragraph; Based on the large language model and each original natural paragraph, open keywords for each original natural paragraph are obtained, wherein the open keywords for each original natural paragraph are different from the fixed keywords; Based on the fixed keywords and the open keywords, the document keywords for each original natural paragraph are obtained; Based on all original paragraphs, the set of tables, and the document keywords, a structured hierarchical relationship between the original paragraphs is constructed using a large language model. This structured hierarchical relationship includes a general introduction paragraph, a table corresponding to the general introduction paragraph, sub-paragraphs at each level corresponding to the general introduction paragraph, and tables corresponding to each sub-paragraph. Based on the obtained target document name and the document keywords, a target paragraph set is determined. Based on the structured hierarchical relationship between the target paragraph set and the original paragraphs, a breadth-first search algorithm is used to determine several target descriptive paragraphs corresponding to each target paragraph and a table corresponding to the several target descriptive paragraphs, wherein the hierarchical difference between each target paragraph and the target descriptive paragraph does not exceed a preset value. Based on the large language model, a target document outline is generated according to the target paragraph set, the target descriptive paragraphs corresponding to the target paragraphs, and the target document name.
2. The document outline generation method according to claim 1, characterized by, The original documents in the preset document library are processed to obtain a set of all original paragraphs and tables from all the original documents, including: The original document is divided into sections to obtain all original paragraphs, original tables, and data visualization images; Based on a multimodal large model, the content of the data visualization image is converted into a first table, and a set of tables is obtained based on the first table and the original table; Based on the large language model, the original natural paragraphs are matched one by one with the set of tables to obtain the table corresponding to each original natural paragraph.
3. The document outline generation method according to claim 1, characterized by, Based on the input target document name and the document keywords, a set of target paragraphs is determined, including: Determine the user keywords contained in the target document name; The user keywords are matched with the document keywords of the original document to determine the first set of natural paragraphs corresponding to the user keywords; The similarity between the target document name and each original paragraph is calculated using a large language model to determine the set of second paragraphs; Based on the first set of natural paragraphs and the second set of natural paragraphs, the target set of natural paragraphs corresponding to the input target document name is obtained.
4. The document outline generation method according to any one of claims 1 to 3, characterized by, The step of generating a target document outline based on the target paragraph set, the target descriptive paragraphs corresponding to the target paragraphs, and the target document name includes: Based on the large language model, the structured hierarchical relationship of the target paragraph set is expanded step by step according to the target paragraph set, the target descriptive paragraphs, and the target document name to obtain the outline framework of the target document name; According to the outline framework, the target natural section set, the target descriptive paragraph, and the table set, the target document outline is generated by the large language model, wherein the target document outline comprises a plurality of chapter names and index data contained in each chapter name.
5. The document outline generation method according to claim 4, characterized by, After the target document outline is generated, the method further comprises: receiving an interaction requirement; selecting a chapter name of the target document outline according to the interaction requirement, operating the selected chapter name, and updating the target document outline.
6. The document outline generation method according to claim 5, characterized by, The selecting a chapter name of the target document outline according to the interaction requirement, operating the selected chapter name, and updating the target document outline comprises: if the interaction requirement is deletion, deleting the index data contained in the selected chapter name, all sub-chapter names contained in the selected chapter name, and the index data contained in the sub-chapter names.
7. The document outline generation method according to claim 5, characterized by, The selecting a chapter name of the target document outline according to the interaction requirement, operating the selected chapter name, and updating the target document outline comprises: if the interaction requirement is addition / modification, obtaining an added / modified chapter name, determining a first target natural section set of the added / modified chapter name and a first target descriptive paragraph corresponding to the first target natural section set; verifying the added / modified chapter name according to the first target natural section set, the first target descriptive paragraph, and the outline framework; if the verification is passed, based on the large language model, the structure hierarchical relationship of the first target natural section set is expanded level by level according to the first target natural section set, the first target descriptive paragraph, and the added / modified chapter name, to obtain an outline framework of the added / modified chapter name; generating a hierarchical outline of the added / modified chapter name by the large language model according to the outline framework of the added / modified chapter name, the first target natural section set, the first target descriptive paragraph, and a table set corresponding to the first target descriptive paragraph, wherein the hierarchical outline of the added / modified chapter name comprises a plurality of sub-chapter names and index data contained in each sub-chapter name; updating the target document outline based on the hierarchical outline of the added / modified chapter name.
8. A document outline generation system characterized by comprising: The system is used to implement the steps of the document outline generation method of any one of claims 1-7, and the system comprises: an original document processing module, configured to obtain fixed keywords of an original document, determine fixed keywords contained in each original natural section according to each original natural section and the fixed keywords of the original document, obtain open keywords of the each original natural section based on a large language model and the each original natural section, wherein the open keywords of the each original natural section are different from the fixed keywords, and obtain document keywords of the each original natural section according to the fixed keywords and the open keywords; The hierarchical structure establishing module is configured to establish a structured hierarchical relationship among the original natural paragraphs, the table set and the document keyword by using a large language model, wherein the structured hierarchical relationship among the original natural paragraphs comprises a total introductory natural paragraph, a table corresponding to the total introductory natural paragraph, a hierarchical descriptive paragraph corresponding to the total introductory natural paragraph, and a table corresponding to the hierarchical descriptive paragraph. The target natural paragraph analysis module is configured to determine a target natural paragraph set based on the obtained target document name and the document keyword. The target descriptive paragraph analysis module is configured to determine a number of target descriptive paragraphs corresponding to each target natural paragraph and a table corresponding to the target descriptive paragraph by using a breadth-first search algorithm based on the structured hierarchical relationship between the target natural paragraph set and the original natural paragraph, wherein a hierarchical difference between the target natural paragraph and the target descriptive paragraph is not more than a preset value. The target document outline generation module is configured to generate a target document outline based on the target natural paragraph set, the target descriptive paragraph corresponding to the target natural paragraph, and the target document name by using a large language model.
9. A terminal, characterized by comprising: The terminal comprises a memory, a processor, and a document outline generation program stored in the memory and executable on the processor, and the processor implements the steps of the document outline generation method according to any one of claims 1-7 when executing the document outline generation program.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a document outline generation program, and the document outline generation program implements the steps of the document outline generation method according to any one of claims 1-7 when executed by the processor.
Citation Information
Patent Citations
Article outline generation method and device and storage medium
CN117633214A
Document generation method and device, equipment and medium
CN117725895A