Program determination method and device
By constructing a document outline scoring method based on hierarchical content and user needs, the problem of inaccurate outline generation in the existing technology is solved, and efficient and accurate document outline generation is achieved.
Patent Information
- Application Number
- CN202510730540.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-03
- Publication Date
- 2025-09-19
AI Technical Summary
It is difficult for existing technologies to effectively solve the document outline generation method. It is difficult for existing technologies to take into account the outline extraction requirements of both standardized catalogs and non-standard documents, and the quality of the outline cannot be guaranteed.
By obtaining the hierarchical content of the document to be processed, the first document outline is constructed, and the second document outline is generated based on user needs. Finally, the target outline is determined based on the two, and evaluation is performed using the number of nodes and weight scores.
It achieves more efficient and accurate generation of document outlines that meet user needs, improving the efficiency and quality of outline generation.
Smart Images

Figure CN120671640A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method and device for determining an outline. Background Art
[0002] In an era of information explosion, documents, as crucial carriers of knowledge and information, are experiencing explosive growth in number. Document outlines clearly display a document's structure and core content, making them crucial for users to quickly understand the document's main purpose and grasp its logical flow. Therefore, accurately extracting document outlines is crucial for document management, retrieval, and analysis.
[0003] However, the current traditional outline extraction method has limitations. It is difficult to take into account the outline extraction requirements of both standardized and non-standard documents, and it is also unable to fully guarantee the quality of the outline. Therefore, a new outline determination method is urgently needed to generate a document outline that meets the requirements more efficiently and accurately. Summary of the Invention
[0004] To address the aforementioned technical problem of urgently needing a new outline determination method to more efficiently and accurately generate a document outline that meets the requirements, the present application provides an outline determination method, device, electronic device, and storage medium. The specific technical solution is as follows:
[0005] In a first aspect of an embodiment of the present application, a method for determining an outline is first provided, the method comprising:
[0006] Obtaining a document to be processed, and parsing hierarchical content with directory attributes in the document to be processed;
[0007] Constructing a first document outline corresponding to the document to be processed according to the hierarchical content with directory attributes;
[0008] Obtaining a user requirement statement, and generating a second document outline based on the user requirement statement and the original document content of the document to be processed;
[0009] A target outline is determined according to the first document outline and the second document outline.
[0010] In an optional implementation, determining the target outline according to the first document outline and the second document outline includes:
[0011] Determining a first number of nodes in the first document outline and a second number of nodes in the second document outline;
[0012] Determining a first outline score corresponding to the first document outline based on the first node number;
[0013] Determining a second outline score corresponding to the second document outline according to the number of the second nodes;
[0014] The first outline score and the second outline score are compared, and a target outline is determined from the first document outline and the second document outline according to the comparison result.
[0015] In an optional implementation, determining the number of first nodes in the first document outline and the number of second nodes in the second document outline includes:
[0016] Determine the number of first leaf nodes and the number of first parent nodes in the first document outline, where the first leaf nodes and the first parent nodes constitute the first node number;
[0017] The second leaf node quantity and the second parent node quantity in the second document outline are determined, where the second leaf node quantity and the second parent node quantity constitute the second node quantity.
[0018] In an optional implementation, determining the number of first parent nodes in the first document outline includes:
[0019] For any first leaf node in the first document outline, determining a first parent node of the first leaf node;
[0020] Deduplicating all first parent nodes, determining the number of the deduplicated first parent nodes, and obtaining the number of the first parent nodes in the first document outline;
[0021] or,
[0022] Determine a first total number of nodes in the first document outline, obtain a difference between the first total number of nodes and the first number of leaf nodes, and obtain a first number of parent nodes in the first document outline;
[0023] Determining the number of second parent nodes in the second document outline includes:
[0024] For any second leaf node in the second document outline, determining a second parent node of the second leaf node;
[0025] Deduplicating all the second parent nodes, determining the number of the second parent nodes after deduplication, and obtaining the number of the second parent nodes in the second document outline;
[0026] or,
[0027] Determine a second total number of nodes in the second document outline, obtain a difference between the second total number of nodes and the second number of leaf nodes, and obtain a second number of parent nodes in the second document outline.
[0028] In an optional implementation, determining a first outline score corresponding to the first document outline based on the first number of nodes includes:
[0029] Determining a first leaf node weight corresponding to a first leaf node in the first document outline, and a first parent node weight corresponding to a first parent node, wherein the first parent node weight is greater than the first leaf node weight;
[0030] A weighted sum is performed on the number of the first leaf nodes, the number of the first parent nodes, the weight of the first leaf node, and the weight of the first parent node to obtain a first outline score corresponding to the first document outline.
[0031] In an optional implementation, determining the second outline score corresponding to the second document outline based on the second node quantity includes:
[0032] Determining a second leaf node weight corresponding to the second leaf node and a second parent node weight corresponding to the second parent node in the second document outline, wherein the second parent node weight is greater than the second leaf node weight;
[0033] A weighted sum is performed on the number of the second leaf nodes, the number of the second parent nodes, the weight of the second leaf nodes, and the weight of the second parent nodes to obtain a second outline score corresponding to the second document outline.
[0034] In an optional embodiment, performing a weighted sum of the number of the first leaf nodes, the number of the first parent nodes, the weight of the first leaf nodes, and the weight of the first parent nodes to obtain a first outline score corresponding to the first document outline includes:
[0035] determining the number of first outline levels in the first document outline and first outline level weights corresponding to the first number of outline levels;
[0036] Performing a weighted summation on the number of the first leaf nodes, the number of the first parent nodes, the weight of the first leaf nodes, and the weight of the first parent nodes to obtain a first weighted sum;
[0037] Multiply the first outline level number by the first outline level weight, and add the product to the first weighted sum to obtain a first outline score corresponding to the first document outline.
[0038] In an optional embodiment, performing a weighted sum of the number of second leaf nodes, the number of second parent nodes, the weight of the second leaf nodes, and the weight of the second parent nodes to obtain a second outline score corresponding to the second document outline includes:
[0039] determining the number of second outline levels in the second document outline and second outline level weights corresponding to the second number of outline levels;
[0040] Performing a weighted sum on the number of the second leaf nodes, the number of the second parent nodes, the weight of the second leaf nodes, and the weight of the second parent nodes to obtain a second weighted sum;
[0041] Multiply the second outline level number by the second outline level weight, and add the product to the second weighted sum to obtain a second outline score corresponding to the second document outline.
[0042] In an optional implementation, determining the target outline according to the first document outline and the second document outline includes:
[0043] Determining at least one first leaf node and at least one first parent node in the first document schema;
[0044] Determining a first outline score corresponding to the first document outline according to at least one of the first leaf nodes and at least one of the first parent nodes;
[0045] Determining at least one second leaf node and at least one second parent node in the second document schema;
[0046] Determining a second outline score corresponding to the second document outline according to at least one second leaf node and at least one second parent node;
[0047] The first outline score and the second outline score are compared, and a target outline is determined from the first document outline and the second document outline according to the comparison result.
[0048] In an optional implementation, determining at least one first parent node in the first document outline includes:
[0049] For any first leaf node in the first document outline, determining a first parent node of the first leaf node;
[0050] Deduplicating all first parent nodes to obtain at least one first parent node in the first document outline;
[0051] or,
[0052] Determine all first nodes in the first document outline, remove first leaf nodes from all first nodes, and obtain at least one first parent node in the first document outline;
[0053] Determining at least one second parent node in the second document outline includes:
[0054] For any second leaf node in the second document outline, determining a second parent node of the second leaf node;
[0055] Deduplicating all the second parent nodes to obtain at least one second parent node in the second document outline;
[0056] or,
[0057] All second nodes in the first document outline are determined, and second leaf nodes are removed from all second nodes to obtain at least one second parent node in the second document outline.
[0058] In an optional implementation, determining the first outline score corresponding to the first document outline based on at least one first leaf node and at least one first parent node includes:
[0059] For any of the first leaf nodes, determining a first outline level at which the first leaf node is located;
[0060] For any of the first parent nodes, determining a second outline level at which the first parent node is located;
[0061] A first outline score corresponding to the first document outline is determined according to the first outline level and the second outline level.
[0062] In an optional implementation, determining a first outline score corresponding to the first document outline according to the first outline level and the second outline level includes:
[0063] Determining a first score corresponding to the first outline level and a first leaf node weight corresponding to the first leaf node;
[0064] Multiplying the first score by the first leaf node weight to obtain a first weighted score;
[0065] Determining a second score corresponding to the second outline level and a first parent node weight corresponding to the first parent node;
[0066] Multiplying the second score by the first parent node weight to obtain a second weighted score;
[0067] All of the first weighted scores and all of the second weighted scores are added together to obtain a first outline score corresponding to the first document outline.
[0068] In an optional implementation, determining the second outline score corresponding to the second document outline based on at least one second leaf node and at least one second parent node includes:
[0069] For any second leaf node, determining the third outline level where the second leaf node is located;
[0070] For any second parent node, determining the fourth outline level where the second parent node is located;
[0071] A second outline score corresponding to the second document outline is determined according to the third outline level and the fourth outline level.
[0072] In an optional implementation, determining the second outline score corresponding to the second document outline according to the third outline level and the fourth outline level includes:
[0073] Determining a third score corresponding to the third outline level and a second leaf node weight corresponding to the second leaf node;
[0074] Multiplying the third score by the second leaf node weight to obtain a third weighted score;
[0075] Determining a fourth score corresponding to the fourth outline level and a second parent node weight corresponding to the second parent node;
[0076] multiplying the fourth score by the second parent node weight to obtain a fourth weighted score;
[0077] All of the third weighted scores and all of the fourth weighted scores are added together to obtain a second outline score corresponding to the second document outline.
[0078] In an optional embodiment, determining the target outline from the first document outline and the second document outline according to the comparison result includes:
[0079] If the first outline score is greater than the second outline score, determining the first document outline as a target outline;
[0080] When the first outline score is less than or equal to the second outline score, the second document outline is determined as the target outline.
[0081] In a second aspect of the embodiments of the present application, a device for determining an outline is further provided, the device comprising:
[0082] A document parsing module, configured to obtain a document to be processed and parse hierarchical content with directory attributes in the document to be processed;
[0083] An outline construction module, configured to construct a first document outline corresponding to the document to be processed according to the hierarchical content having directory attributes;
[0084] An outline generation module, configured to obtain a user requirement statement and generate a second document outline based on the user requirement statement and the original document content of the document to be processed;
[0085] An outline determining module is configured to determine a target outline according to the first document outline and the second document outline.
[0086] In an optional implementation, the outline determination module specifically includes:
[0087] a quantity determination submodule, configured to determine the number of first nodes in the first document outline and the number of second nodes in the second document outline;
[0088] A first score determination submodule, configured to determine a first outline score corresponding to the first document outline based on the first number of nodes;
[0089] A second score determination submodule, configured to determine a second outline score corresponding to the second document outline based on the number of the second nodes;
[0090] The outline determination submodule is configured to compare the first outline score with the second outline score, and determine a target outline from the first document outline and the second document outline according to the comparison result.
[0091] In an optional embodiment, the quantity determination submodule specifically includes:
[0092] A first quantity determining unit, configured to determine the number of first leaf nodes and the number of first parent nodes in the first document outline, where the number of the first leaf nodes and the number of the first parent nodes constitute the first node number;
[0093] The second quantity determining unit is configured to determine the second leaf node quantity and the second parent node quantity in the second document outline, where the second leaf node quantity and the second parent node quantity constitute the second node quantity.
[0094] In an optional embodiment, the first quantity determining unit is specifically configured to:
[0095] For any first leaf node in the first document outline, determining a first parent node of the first leaf node;
[0096] Deduplicating all first parent nodes, determining the number of the deduplicated first parent nodes, and obtaining the number of the first parent nodes in the first document outline;
[0097] or,
[0098] Determine a first total number of nodes in the first document outline, obtain a difference between the first total number of nodes and the first number of leaf nodes, and obtain a first number of parent nodes in the first document outline;
[0099] The second quantity determining unit is specifically configured to:
[0100] For any second leaf node in the second document outline, determining a second parent node of the second leaf node;
[0101] Deduplicating all the second parent nodes, determining the number of the second parent nodes after deduplication, and obtaining the number of the second parent nodes in the second document outline;
[0102] or,
[0103] Determine a second total number of nodes in the second document outline, obtain a difference between the second total number of nodes and the second number of leaf nodes, and obtain a second number of parent nodes in the second document outline.
[0104] In an optional embodiment, the first score determination submodule specifically includes:
[0105] a first weight determination unit, configured to determine a first leaf node weight corresponding to a first leaf node in the first document outline, and a first parent node weight corresponding to a first parent node, wherein the first parent node weight is greater than the first leaf node weight;
[0106] The first score determination unit is configured to perform weighted summation on the number of the first leaf nodes, the number of the first parent nodes, the weight of the first leaf nodes, and the weight of the first parent nodes to obtain a first outline score corresponding to the first document outline.
[0107] In an optional embodiment, the second score determination submodule specifically includes:
[0108] A second weight determination unit, configured to determine a second leaf node weight corresponding to the second leaf node and a second parent node weight corresponding to the second parent node in the second document outline, wherein the second parent node weight is greater than the second leaf node weight;
[0109] The second score determination unit is used to perform weighted summation on the number of the second leaf nodes, the number of the second parent nodes, the weight of the second leaf nodes, and the weight of the second parent nodes to obtain a second outline score corresponding to the second document outline.
[0110] In an optional embodiment, the first score determination unit is specifically configured to:
[0111] determining the number of first outline levels in the first document outline and first outline level weights corresponding to the first number of outline levels;
[0112] Performing a weighted summation on the number of the first leaf nodes, the number of the first parent nodes, the weight of the first leaf nodes, and the weight of the first parent nodes to obtain a first weighted sum;
[0113] Multiply the first outline level number by the first outline level weight, and add the product to the first weighted sum to obtain a first outline score corresponding to the first document outline.
[0114] In an optional implementation, the second score determination unit is specifically configured to:
[0115] determining the number of second outline levels in the second document outline and second outline level weights corresponding to the second number of outline levels;
[0116] Performing a weighted sum on the number of the second leaf nodes, the number of the second parent nodes, the weight of the second leaf nodes, and the weight of the second parent nodes to obtain a second weighted sum;
[0117] Multiply the second outline level number by the second outline level weight, and add the product to the second weighted sum to obtain a second outline score corresponding to the second document outline.
[0118] In an optional implementation, the outline determination module specifically includes:
[0119] A first node determination submodule, configured to determine at least one first leaf node and at least one first parent node in the first document outline;
[0120] A first score determination submodule, configured to determine a first outline score corresponding to the first document outline based on at least one of the first leaf nodes and at least one of the first parent nodes;
[0121] A second node determination submodule, configured to determine at least one second leaf node and at least one second parent node in the second document outline;
[0122] A second score determination submodule, configured to determine a second outline score corresponding to the second document outline based on at least one second leaf node and at least one second parent node;
[0123] The outline determination submodule is configured to compare the first outline score with the second outline score, and determine a target outline from the first document outline and the second document outline according to the comparison result.
[0124] In an optional implementation, the first node determination submodule is specifically configured to:
[0125] For any first leaf node in the first document outline, determining a first parent node of the first leaf node;
[0126] Deduplicating all first parent nodes to obtain at least one first parent node in the first document outline;
[0127] or,
[0128] Determine all first nodes in the first document outline, remove first leaf nodes from all first nodes, and obtain at least one first parent node in the first document outline;
[0129] The second node determination submodule is specifically configured to:
[0130] For any second leaf node in the second document outline, determining a second parent node of the second leaf node;
[0131] Deduplicating all the second parent nodes to obtain at least one second parent node in the second document outline;
[0132] or,
[0133] All second nodes in the first document outline are determined, and second leaf nodes are removed from all second nodes to obtain at least one second parent node in the second document outline.
[0134] In an optional embodiment, the first score determination submodule specifically includes:
[0135] a first outline level determining unit, configured to determine, for any first leaf node, a first outline level at which the first leaf node is located;
[0136] a second outline level determining unit, configured to determine, for any first parent node, a second outline level at which the first parent node is located;
[0137] The first score determining unit is configured to determine a first outline score corresponding to the first document outline according to the first outline level and the second outline level.
[0138] In an optional embodiment, the first score determination unit is specifically configured to:
[0139] Determining a first score corresponding to the first outline level and a first leaf node weight corresponding to the first leaf node;
[0140] Multiplying the first score by the first leaf node weight to obtain a first weighted score;
[0141] Determining a second score corresponding to the second outline level and a first parent node weight corresponding to the first parent node;
[0142] Multiplying the second score by the first parent node weight to obtain a second weighted score;
[0143] All of the first weighted scores and all of the second weighted scores are added together to obtain a first outline score corresponding to the first document outline.
[0144] In an optional embodiment, the second score determination submodule specifically includes:
[0145] a third outline level determining unit, configured to determine, for any second leaf node, a third outline level at which the second leaf node is located;
[0146] a fourth outline level determining unit, configured to determine, for any second parent node, a fourth outline level at which the second parent node is located;
[0147] The second score determining unit is configured to determine a second outline score corresponding to the second document outline according to the third outline level and the fourth outline level.
[0148] In an optional implementation, the second score determination unit is specifically configured to:
[0149] Determining a third score corresponding to the third outline level and a second leaf node weight corresponding to the second leaf node;
[0150] Multiplying the third score by the second leaf node weight to obtain a third weighted score;
[0151] Determining a fourth score corresponding to the fourth outline level and a second parent node weight corresponding to the second parent node;
[0152] multiplying the fourth score by the second parent node weight to obtain a fourth weighted score;
[0153] All of the third weighted scores and all of the fourth weighted scores are added together to obtain a second outline score corresponding to the second document outline.
[0154] In an optional embodiment, the outline determination submodule is specifically configured to:
[0155] If the first outline score is greater than the second outline score, determining the first document outline as a target outline;
[0156] When the first outline score is less than or equal to the second outline score, the second document outline is determined as the target outline.
[0157] In a third aspect of the embodiments of the present application, an electronic device is further provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0158] Memory for storing computer programs;
[0159] The processor is configured to implement any one of the outline determination methods described in the first aspect above when executing a program stored in the memory.
[0160] In a fourth aspect of the embodiments of the present application, a storage medium is further provided, wherein instructions are stored in the storage medium, which, when executed on a computer, enables the computer to execute any outline determination method described in the first aspect above.
[0161] In a fifth aspect of the embodiments of the present application, a computer program product comprising instructions is further provided, which, when executed on a computer, enables the computer to execute any of the above-mentioned outline determination methods.
[0162] The technical solution provided by the embodiment of the present application obtains the document to be processed, and parses the hierarchical content with directory attributes in the document to be processed, constructs a first document outline corresponding to the document to be processed based on the hierarchical content with directory attributes, obtains the user demand statement, generates a second document outline based on the user demand statement and the original document content of the document to be processed, and determines the target outline based on the first document outline and the second document outline.
[0163] The first document outline is constructed through the hierarchical content with directory attributes in the document to be processed. The second document outline is generated through the user's demand expression and the original document content of the document to be processed. The target outline is determined based on the first document outline and the second document outline. In this way, a document outline that meets the requirements can be generated more efficiently and accurately. BRIEF DESCRIPTION OF THE DRAWINGS
[0164] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0165] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0166] One or more embodiments are exemplarily illustrated by pictures in the corresponding drawings. These exemplifications do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements. Unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0167] Figure 1 Schematic diagram of an implementation flow of an outline determination method shown in an embodiment of the present application;
[0168] Figure 2 This is a schematic diagram of a tree structure corresponding to a first document outline shown in an embodiment of the present application;
[0169] Figure 3 This is a schematic diagram of a tree structure corresponding to a second document outline shown in an embodiment of the present application;
[0170] Figure 4 Schematic diagram of an implementation flow of another outline determination method shown in an embodiment of the present application;
[0171] Figure 5 Schematic diagram of an implementation flow of another outline determination method shown in an embodiment of the present application;
[0172] Figure 6 Schematic diagram of the structure of an outline determination device shown in an embodiment of the present application;
[0173] Figure 7 This is a schematic structural diagram of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION
[0174] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0175] The disclosure below provides many different embodiments or examples for implementing different structures of the present application. In order to simplify the disclosure of the present application, the components and settings of specific examples are described below. Of course, these are merely examples and are not intended to limit the present application. In addition, the present application may repeat reference numbers and / or letters in different examples. Such repetition is for the purpose of simplicity and clarity and does not in itself indicate the relationship between the various embodiments and / or settings discussed.
[0176] like Figure 1FIG. 1 is a schematic diagram of an implementation flow of a method for determining an outline provided in an embodiment of the present application. The method is applied to an electronic device and may specifically include the following steps:
[0177] S101: Obtain a document to be processed, and parse the hierarchical content with directory attributes in the document to be processed.
[0178] In the embodiment of the present application, a document to be processed is obtained. For example, the document to be processed can be long text data, such as academic papers, research reports, legal documents, etc., or short text data, which is not limited in the embodiment of the present application.
[0179] For the document to be processed, the hierarchical content with directory attributes in the document to be processed is parsed. The specific parsing process focuses on the hierarchical content with directory attributes in the document. First, advanced text recognition technology should be used to accurately locate all elements with hierarchical characteristics in the document. These elements often appear in the form of titles and are divided into different levels based on the logical relationship of the content. For example, in an academic paper, a large title such as "Chapter 1" is usually a first-level title and is at a higher level; and the "1.1 Research Background" below it is a second-level title, which is slightly lower in level, and so on.
[0180] During the parsing process, it is necessary not only to identify the text content of these titles themselves, but also to accurately determine the hierarchical relationship between them through a comprehensive analysis of font formats (such as font size, bold, color, etc.), paragraph formats (such as indentation, line spacing, paragraph spacing, paragraph spacing, etc.), and numbering rules (such as digital numbering, alphabetical numbering, chapter numbering system, etc.). For example, some documents may use a numerical numbering system such as "1, 1.1, 1.1.1" to clearly show the subordinate relationship of titles at all levels; some documents also imply the hierarchy of titles through different font sizes and indentations. Through the detailed analysis of these hierarchical contents with directory attributes, a solid foundation is laid for the subsequent construction of a clear and accurate document outline.
[0181] S102: Construct a first document outline corresponding to the document to be processed according to the hierarchical content with directory attributes.
[0182] In the embodiment of the present application, after the above steps complete the detailed analysis of the hierarchical content with directory attributes in the document to be processed, the key step of constructing the first document outline is immediately entered. In the construction process, the hierarchical content obtained by the analysis is used as the basic material.
[0183] Starting from the top of the hierarchy, set the highest-level title as the first-level item of the outline. For example, if there is a top-level title such as "Chapter 1 Introduction" in the document, place it at the first level of the outline. Then, expand downward step by step based on the resolved hierarchical relationship. For the second-level titles subordinate to the first-level title, such as "1.1 Research Background", set it as a sub-item of the first-level item, that is, the second-level item of the outline, and so on. While incorporating the titles of all levels into the outline structure in turn, the format attributes of each title will also be appropriately adjusted to make it present a clear and standardized visual effect in the outline. For example, the first-level title can be highlighted in a larger font and bold format; the second-level title font is slightly smaller, and through appropriate indentation, its subordinate relationship with the first-level title is intuitively reflected.
[0184] S103: Obtain a user requirement statement, and generate a second document outline according to the user requirement statement and the original document content of the document to be processed.
[0185] In the embodiment of the present application, in today's digital information processing scenario, in order to accurately meet users' diverse needs for document outlines, a series of coherent and detailed operational processes are required.
[0186] First, capture user needs through a specially designed interactive interface. This crucial step can be achieved through a variety of methods. Users can express their needs in detail by entering a text field, such as "I need a document outline that prioritizes experimental results, detailing the analysis for each experimental result." Alternatively, users can express their needs by selecting specific options or checking preset requirement templates, such as "an outline focused on application cases" from a drop-down menu. Regardless of the method used, ensure that the user's intent is fully and accurately captured.
[0187] Next, focus on the original document content. This document can come from a variety of fields and formats, ranging from lengthy academic research reports, complex technical manuals, to comprehensive project planning documents, all containing a wealth of information to mine. The original document content includes not only the main text but also various elements within the document, such as headings, charts, and annotations, all of which may play a key role in generating the outline.
[0188] Then, based on the user's needs and the original document content to be processed, the large language model's prompt words are constructed. Constructing prompt words is a very skillful process. The user needs and the original document content must be organically integrated and organized in a way that the large language model can understand and effectively process. For example, if the user's need is to highlight the part of the document about the product's advantages, and the original document is a product introduction document, the prompt words may be constructed like this: "Please generate an outline based on the following product introduction document, focusing on the product advantages, and listing in detail the specific description, application scenarios, and comparative analysis with competitor products for each advantage. The original document content is as follows: [insert relevant content of the original document here]". When constructing prompt words, attention is also paid to the accuracy, conciseness, and logic of the language to ensure that the key points of the needs can be clearly conveyed to the large language model.
[0189] After constructing the prompt word, it is input into the large language model. Upon receiving the prompt word, the large language model deeply analyzes and processes the input information based on its extensive pre-trained knowledge system and powerful natural language processing capabilities. The model performs complex internal calculations and reasoning, extracting key information from the original document content and organizing and integrating it according to user needs.
[0190] Ultimately, the large language model outputs a second document outline. This outline fully considers the user's individual needs while closely aligning with the core content of the original document. Its structure may better align with the user's desired focus, while its content may more accurately capture the key points of interest. For example, if the user is focused on product advantages, the outline might prioritize the product advantages section, detailing each of these advantages. Under each advantage point, supporting content, such as technical principles and real-world examples, can be further broken down, providing the user with a highly customized and practical document outline.
[0191] S104: Determine a target outline according to the first document outline and the second document outline.
[0192] In the embodiment of the present application, after completing the series of complex and critical steps described above, the first document outline and the second document outline are successfully obtained. These two outlines play an extremely important role in the entire document processing process, and they carry different dimensions of information and value.
[0193] The first document outline is constructed through a rigorous analysis of the hierarchical content within the document being processed. Like a precise navigation map, it intuitively and comprehensively reflects the inherent structure and logical flow of the original document. During the construction process, the headings at all levels are systematically incorporated into the outline system based on the format characteristics, hierarchical relationships, and content coherence of the document's headings, forming a coherent and clearly structured document structure.
[0194] The second document outline is generated by carefully constructing prompt words from the large language model based on the user's needs and cleverly combining them with the original document content to be processed. It incorporates the user's personalized needs and expectations, and is a targeted reshaping and refinement of the original document content, aiming to provide users with a document outline that meets their specific needs.
[0195] After having these two outlines, the next step is to enter a key determination link in order to more efficiently and accurately generate a document outline that meets the requirements. To this end, the target outline is determined based on the first document outline and the second document outline. The target outline comes from the first document outline or the second document outline, or the target outline is obtained by integrating the first document outline and the second document outline.
[0196] Through the above description of the technical solution provided in the embodiment of the present application, the document to be processed is obtained, and the hierarchical content with directory attributes in the document to be processed is parsed. According to the hierarchical content with directory attributes, a first document outline corresponding to the document to be processed is constructed, and the user demand statement is obtained. According to the user demand statement and the original document content of the document to be processed, a second document outline is generated, and the target outline is determined based on the first document outline and the second document outline.
[0197] The first document outline is constructed through the hierarchical content with directory attributes in the document to be processed. The second document outline is generated through the user's demand expression and the original document content of the document to be processed. The target outline is determined based on the first document outline and the second document outline. In this way, a document outline that meets the requirements can be generated more efficiently and accurately.
[0198] In addition, in the embodiment of the present application, the document outline is usually embodied in a tree structure. For example, for the first document outline, its corresponding tree structure is as follows Figure 2 As shown, for the second document outline, its corresponding tree structure is as follows Figure 3 As shown, the corresponding number of nodes in the document outline can be determined to calculate the outline score, thereby obtaining two outline scores, which are then compared and a target outline is determined from the first document outline and the second document outline based on the comparison results.
[0199] Based on this, Figure 4 FIG. 1 is a schematic diagram of an implementation flow of another outline determination method provided in an embodiment of the present application. The method is applied to an electronic device and may specifically include the following steps:
[0200] S401: Obtain a document to be processed, and parse the hierarchical content with directory attributes in the document to be processed.
[0201] In the embodiment of the present application, this step is similar to the above-mentioned step S101, and the embodiment of the present application will not be described in detail here.
[0202] S402: Construct a first document outline corresponding to the document to be processed according to the hierarchical content with directory attributes.
[0203] In the embodiment of the present application, this step is similar to the above-mentioned step S102, and the embodiment of the present application will not be repeated here.
[0204] S403: Obtain a user requirement statement, and generate a second document outline according to the user requirement statement and the original document content of the document to be processed.
[0205] In the embodiment of the present application, this step is similar to the above-mentioned step S103, and the embodiment of the present application will not be repeated here.
[0206] S404: Determine the number of first nodes in the first document outline and the number of second nodes in the second document outline.
[0207] In the embodiment of the present application, the document outline is generally represented in a tree structure, thereby determining the number of first nodes in the first document outline and the number of second nodes in the second document outline.
[0208] Among them, the nodes can be subdivided into leaf nodes and parent nodes, thereby determining the number of first leaf nodes and the number of first parent nodes in the first document outline, and the number of first leaf nodes and the number of first parent nodes constitute the number of first nodes, and determining the number of second leaf nodes and the number of second parent nodes in the second document outline, and the number of second leaf nodes and the number of second parent nodes constitute the number of second nodes.
[0209] A leaf node is a node without child nodes, that is, a node at the very end of a tree structure that cannot extend to any lower-level content. In the document outline, a leaf node is a bottom-level title (such as "1.1.1 Specific Content"), which is no longer subdivided into smaller titles. A parent node is a node with child nodes, that is, an upper-level node that directly "contains" or "governs" the next-level node. In the document outline, a parent node is an upper-level title (such as "1.1 Chapter Title"), which can be subdivided into sub-titles such as "1.1.1" and "1.1.2".
[0210] For example, the first document outline in a tree structure is as follows Figure 2 As shown, i1, i2, and i3 are all leaf nodes, and p1 and p2 are both parent nodes. Then, the first leaf node number Tree1LeaveCount in the first document outline is determined to be 3, and the first parent node number Tree1LeaveParentCount is determined to be 2. The first leaf node number and the first parent node number constitute the first node number.
[0211] For another example, the second document outline represented by the tree structure is as follows Figure 3 As shown, i1, i2, and i3 are all leaf nodes, and p1 is the parent node. Then, the second leaf node number Tree2LeaveCount in the second document outline is determined to be 3, and the second parent node number Tree2LeaveParentCount is determined to be 1. The second leaf node number and the second parent node number constitute the second node number.
[0212] Among them, for determining the number of first leaf nodes in the first document outline, or determining the number of second leaf nodes in the second document outline, for example, a recursive traversal method can be used, that is, recursively traversing each node starting from the root node, if the current node has no child nodes, then the count is increased by 1, otherwise the child nodes are recursively traversed. For another example, an iterative traversal method can be used, that is, using a queue to traverse the tree nodes hierarchically, and during the traversal process, it is determined whether each node is a leaf node (no child node), and if so, the count is increased by 1. Of course, other methods can also be used, and the embodiments of the present application are not limited to this.
[0213] Among them, to determine the number of first parent nodes in the first document outline, you can first find the parent node of the leaf node, then deduplicate the parent node, and then determine the deduplicated parent node to obtain the number of first parent nodes in the first document outline, or directly determine the number of all nodes, and then subtract the number of leaf nodes, and the remainder is the number of first parent nodes in the first document outline.
[0214] Based on this, for any first leaf node in the first document outline, determine the first parent node of the first leaf node, deduplicate all first parent nodes, determine the number of first parent nodes after deduplication, and obtain the number of first parent nodes in the first document outline, or determine the first total node number in the first document outline, obtain the difference between the first total node number and the first leaf node number, and obtain the number of first parent nodes in the first document outline.
[0215] Similarly, to determine the number of second parent nodes in the second document outline, you can first find the parent node of the leaf node, then deduplicate the parent node, and then determine the deduplicated parent node to obtain the number of second parent nodes in the second document outline, or directly determine the number of all nodes, and then subtract the number of leaf nodes. The remainder is the number of second parent nodes in the second document outline.
[0216] Based on this, for any second leaf node in the second document outline, determine the second parent node of the second leaf node, deduplicate all second parent nodes, determine the number of second parent nodes after deduplication, and obtain the number of second parent nodes in the second document outline, or determine the second total number of nodes in the second document outline, obtain the difference between the second total number of nodes and the number of second leaf nodes, and obtain the number of second parent nodes in the second document outline.
[0217] S405: Determine a first outline score corresponding to the first document outline according to the first node quantity.
[0218] In an embodiment of the present application, after the above steps, the number of first nodes in the first document outline is determined, and the first outline score corresponding to the first document outline is determined based on the first node number.
[0219] Among them, the nodes are subdivided into leaf nodes and parent nodes, so the number of first nodes is essentially the number of first leaf nodes and the number of first parent nodes. That is, the first outline score corresponding to the first document outline is determined based on the number of first leaf nodes and the number of first parent nodes.
[0220] Specifically, for each leaf node in the first document outline, there is a corresponding quality weight M, and the corresponding parent node in the first document outline also has a corresponding quality weight N. Usually, N is set to be greater than M, for example, N is 3 and M is 1. The determination of the quality weight M and quality weight N requires comprehensive consideration of multiple factors. The following are some common determination methods and considerations:
[0221] Based on the complexity of the document structure and content: If the document structure is complex, with multiple levels and numerous subtopics, the parent node needs to assume more organizational and summarizing functions. In this case, N can be relatively large to highlight the parent node's importance within the overall structure. For example, in an encyclopedic document, its chapters (parent nodes) need to cover a wide range of knowledge areas, and each chapter contains numerous specific knowledge points (leaf nodes). To emphasize the chapters' role in structuring the overall content, N might be set to 4 or 5, while M can be set to 1 or 2. For documents with relatively simple content and a clear structure, the difference in importance between parent nodes and leaf nodes is relatively small, and the gap between N and M can be appropriately narrowed. For example, a short news report may have only a few main sections (parent nodes) and few specific details (leaf nodes) within each section. In this case, N can be set to 3 and M to 2. This allows the parent node to play a certain leading role without overstating its importance relative to the leaf nodes.
[0222] Based on user needs and usage scenarios: If users are more focused on the document's overall framework and main points, the parent node's weight N should be appropriately increased. For example, in a business report, decision makers typically focus first on parent node content such as the project's overall objectives, key milestones, and major achievements. In this case, N can be set to a higher value, such as 4, to highlight this key information when developing the document outline. Leaf node weights M, on the other hand, can be set to 1, as specific details may only be discussed in depth later. If the usage scenario focuses on detailed analysis and research, the leaf node weight M can be appropriately increased, but the parent node weight N should remain relatively high to ensure the integrity of the overall structure. For example, in academic research, while researchers may deeply analyze leaf node content such as specific experimental data and case details, the overall research framework and chapter structure (parent node) are equally important. In this case, N can be set to 3 and M to 2. This ensures that the document outline process prioritizes the parent node's control over the research direction and structure while not neglecting the quality of the specific content in the leaf nodes.
[0223] Refer to industry standards or empirical values: Certain specific industries or fields may have general standards or empirical values for setting document outline weights. For example, in the writing of technical documents, certain specifications are usually followed based on the type and purpose of the document. For system design documents, the weight N of the parent node (such as system architecture, module division, etc.) may be set to 3 or 4 according to convention, and the weight M of the leaf node (such as specific interface definition, algorithm details, etc.) is set to 1 or 2. These standards or empirical values are summarized through long-term practice and can reflect the general importance distribution of document structure and content in the field. They can serve as an important reference for determining the N and M values.
[0224] Through multiple rounds of determination and adjustment: You can first set an initial value for N and M based on preliminary judgment and experience. Then, during the process of determining the outline, observe whether the results meet expectations and accurately reflect the quality and structural characteristics of the document. If it is found that the importance of certain parent nodes or leaf nodes is underestimated or overestimated in the actual determination, the values of N and M can be adjusted accordingly. After multiple rounds of determination and adjustment, the values of N and M are gradually optimized to achieve the most appropriate weight distribution for the document. For example, after the first determination, if it is found that the content of a certain leaf node is crucial to the understanding of the entire document, but its low weight means that it was not given enough attention in the determination, the value of M can be appropriately increased, and the value of N can be adjusted accordingly to maintain a reasonable gap between the two and an overall weight balance.
[0225] In addition, it should be noted that in the context of outline determination, the parent node quality weight N is set greater than the leaf node quality weight M, for example, N is 3 and M is 1. The main reasons are as follows:
[0226] Reflecting structural importance: Parent nodes usually represent more macro and general topics or chapters in the document. They cover the contents of multiple leaf nodes and play a key supporting role in the overall structure and content framework of the document. When determining the outline, the accuracy and completeness of the parent node are crucial to grasping the main theme of the document. For example, in the outline of an academic paper, "research methods" is the parent node, and the subordinate leaf nodes may include "experimental design", "data collection methods", "data analysis methods", etc. The accuracy of the parent node "research methods" is directly related to the scientific nature and reliability of the entire research. Its importance is obviously higher than that of specific leaf nodes, so it needs to be given a higher quality weight.
[0227] Reflecting content relevance: The parent node is more closely related to the content of other parts and has a greater impact on the logical coherence of the document. It not only needs to organize and command the leaf nodes under it, but also needs to echo and connect with other parent nodes and related content. The leaf nodes are relatively more focused on specific details. For example, in a project planning document outline, the parent node "project goals" is closely related to other parent nodes such as "project background" and "project implementation plan", and together they build the overall blueprint of the project. Although the leaf nodes under it, such as "short-term goals" and "long-term goals", are also very important, they are mainly specific details centered around the parent node, and are not as extensively related to other parts of the document as the parent node. Therefore, the parent node should have a higher quality weight to highlight its key role in the overall content relevance.
[0228] Guiding the determination of key points: When determining the target outline based on the first document outline and the second document outline, a higher quality weight can guide the determiner to pay more attention to the accuracy and completeness of the parent node. Because once the parent node is wrong or missing, it may have a greater impact on the structure and understanding of the entire outline, while the influence of the leaf node is relatively limited. For example, if there is a deviation in the parent node "Conclusion and Outlook" in the second document outline, it may lead to a misunderstanding of the core point of the entire document. In contrast, a leaf node such as "a specific idea of future research direction" has some minor problems, which has a much smaller impact on the overall situation. Therefore, by setting different weights, it can help determiners to prioritize the parent node parts that have a greater impact on the quality of the outline within limited time and energy, thereby improving the efficiency and accuracy of determination.
[0229] Therefore, the first leaf node weight corresponding to the first leaf node in the first document outline and the first parent node weight corresponding to the first parent node are determined, wherein the first parent node weight is greater than the first leaf node weight, and the number of first leaf nodes, the number of first parent nodes, the first leaf node weight and the first parent node weight are weighted and summed to obtain the first outline score corresponding to the first document outline.
[0230] For example, it is determined that the first leaf node weight corresponding to the first leaf node in the first document outline is M, and the first parent node weight corresponding to the first parent node is N, then the number of first leaf nodes Tree1LeaveParentCount, the number of first parent nodes Tree1LeaveCount, the first leaf node weight and the first parent node weight are weighted summed to obtain the first outline score evalTree1 corresponding to the first document outline, as shown in the following formula: evalTree1 = Tree1LeaveCount*N+Tree1LeaveParentCount*M.
[0231] It should be noted that the higher the outline score calculated by the above formula, the higher the quality of the corresponding document outline. The reason is:
[0232] Parent nodes support the overall framework of the document: Parent nodes play a role in outlining the main points of the document, representing the main parts and core structure of the document. The parent node weight N is assigned a higher value because the integrity and rationality of the parent node are crucial to the overall quality of the document. The calculation of Tree1LeaveCount*N reflects the contribution of the parent node to the outline score. The more parent nodes there are and the higher the weight, the richer and more complete the overall framework of the document, and the more comprehensive the topics and content covered. It can provide a solid structural foundation for the document, help readers quickly grasp the core points and logical context of the document, and thus improve the quality of the document outline.
[0233] Leaf nodes refine and enrich the content: Leaf nodes further refine and expand upon their parent nodes, encompassing the document's specific details and rich content. Although leaf nodes have a relatively small weight, M, they are a crucial indicator of the document's richness and depth. The calculation of Tree1LeaveParentCount*M reflects the influence of leaf nodes on the outline score. A greater number of leaf nodes indicates a more detailed explanation of each topic, providing readers with more specific information and examples, making the document's content more substantial and persuasive, and ultimately improving the quality of the document's outline.
[0234] Overall Tradeoff and Quality: The formula considers both the structural integrity and content richness of the document outline by multiplying the number of parent nodes and leaf nodes by their respective weights. A higher parent node weight ensures the importance of the document's overall framework is fully reflected, while leaf nodes, while less heavily weighted, can also significantly impact the score through their accumulation. The two complement and constrain each other. A higher outline score indicates a well-developed overall framework and rich, detailed content, thus increasing the quality of the document outline.
[0235] Through such a weighted summation formula, the quality of the document outline can be reflected more comprehensively and objectively. It is encouraged to pay attention to both the construction of the overall structure and the enrichment of specific content when constructing the document outline, so as to achieve high-quality document organization and presentation.
[0236] In addition, in the embodiment of the present application, there are corresponding outline levels for the document outline, such as Figure 2 As shown, p1 belongs to one outline level, p2 and i1 belong to one outline level, i2 and i3 belong to one outline level, and the corresponding first document outline has three outline levels. The number of outline levels also affects the score of the document outline. For example, the more outline levels there are, the higher the score of the corresponding document outline should be.
[0237] Based on this, determine the number of first outline levels in the first document outline, and the first outline level weight corresponding to the number of first outline levels (wherein different numbers of outline levels correspond to different outline level weights), perform weighted summation on the number of first leaf nodes, the number of first parent nodes, the first leaf node weight, and the first parent node weight to obtain a first weighted sum, multiply the number of first outline levels by the first outline level weight, add the product to the first weighted sum, and obtain the first outline score corresponding to the first document outline.
[0238] S406: Determine a second outline score corresponding to the second document outline according to the second node quantity.
[0239] In the embodiment of the present application, after the above steps, the number of second nodes in the second document outline is determined, and the second outline score corresponding to the second document outline is determined based on the number of second nodes.
[0240] Among them, the nodes are subdivided into leaf nodes and parent nodes, so the number of second nodes is essentially the number of second leaf nodes and the number of second parent nodes. That is, the second outline score corresponding to the second document outline is determined based on the number of second leaf nodes and the number of second parent nodes.
[0241] Specifically, for the leaf node in the second document outline, there is a corresponding quality weight M, and the corresponding parent node in the second document outline also has a corresponding quality weight N. Usually, N is set to be greater than M, for example, N is 3 and M is 1.
[0242] Therefore, the second leaf node weight corresponding to the second leaf node in the second document outline and the second parent node weight corresponding to the second parent node are determined, wherein the second parent node weight is greater than the second leaf node weight, and the number of second leaf nodes, the number of second parent nodes, the second leaf node weight and the second parent node weight are weighted and summed to obtain the second outline score corresponding to the second document outline.
[0243] For example, it is determined that the second leaf node weight corresponding to the second leaf node in the second document outline is M, and the second parent node weight corresponding to the second parent node is N, then the second leaf node number Tree2LeaveParentCount, the second parent node number Tree2LeaveCount, the second leaf node weight and the second parent node weight are weighted summed to obtain the second outline score evalTree2 corresponding to the second document outline, as shown in the following formula: evalTree2 = Tree2LeaveCount*N+Tree2LeaveParentCount*M.
[0244] In addition, in the embodiment of the present application, there are corresponding outline levels for the document outline, such as Figure 3 As shown, p1 belongs to one outline level, i1, i2, and i3 belong to one outline level, and the corresponding second document outline has two outline levels. The number of outline levels also affects the score of the document outline. For example, the more outline levels there are, the higher the score of the corresponding document outline should be.
[0245] Based on this, determine the number of second outline levels in the second document outline, and the second outline level weights corresponding to the number of second outline levels (where different numbers of outline levels correspond to different outline level weights); perform weighted summation on the number of second leaf nodes, the number of second parent nodes, the second leaf node weights, and the second parent node weights to obtain a second weighted sum; multiply the number of second outline levels by the second outline level weight, and add the product to the second weighted sum to obtain a second outline score corresponding to the second document outline.
[0246] S407 , comparing the first outline score with the second outline score, and determining a target outline from the first document outline and the second document outline according to the comparison result.
[0247] In an embodiment of the present application, after completing the series of complex and critical steps described above, the first outline score and the second outline score are successfully obtained. The first outline score and the second outline score can be compared, and the target outline can be determined from the first document outline and the second document outline based on the comparison results.
[0248] Specifically, when the first outline score is greater than the second outline score, the first document outline is determined as the target outline, that is, the best document outline is the first document outline; when the first outline score is less than or equal to the second outline score, the second document outline is determined as the target outline, that is, the best document outline is the second document outline.
[0249] In addition, for the first outline score and the second outline score, if both the first outline score and the second outline score are less than the preset score, it means that the outline quality of both the first document outline and the second document outline is poor. In this case, you can choose to fuse the first document outline and the second document outline to obtain the target outline. Among them, when fusing the first document outline and the second document outline, the core principle is to complement the advantages of the two outlines and avoid their respective shortcomings, thereby generating a more comprehensive, accurate and demand-oriented target outline. And the fusion method can be designed from multiple dimensions to achieve complementary advantages. The specific fusion method and principle are as follows:
[0250] 1. Complementary and integrated content
[0251] The first document outline is constructed based on the hierarchical content of the document directory attributes. It has the advantages of standardization and structure, and can accurately present the original framework of the document. The second document outline is generated based on the user's needs and the original document content, which can highlight the user's focus and explore the deep logic not reflected in the directory. Therefore, the complementary integration of content can be divided into the following steps:
[0252] 1.1 Content Extraction and Classification: The content of the first and second document outlines is broken down one by one, and the titles, key points, and other content in the outlines are extracted. These content is then classified according to dimensions such as themes and chapters. For example, for an academic paper, content related to research methods is grouped into one category, and content related to research conclusions is grouped into another.
[0253] 1.2 Deduplication and Merging: Compare the content within the same category in the two outlines and remove any duplicates. Merge any non-duplicate content. For example, for example, the first outline document only contains a description of the experimental process under "Research Methods - Experimental Design," while the second outline document includes key points for experimental variable control under the same category. Merge the two to make this section more complete.
[0254] 1.3 Supplementation and optimization: Check the merged content. If you find that some content is missing in one outline but is important for the integrity of the overall outline, supplement it from the other outline and optimize the sentences to ensure the content is coherent and the logic is clear.
[0255] 2. Structural optimization and integration
[0256] The two outlines may have differences in hierarchical structure and logical order. Through structural optimization and integration, the target outline structure can be made more reasonable. Structural optimization and integration can be divided into the following steps:
[0257] 2.1 Hierarchical Alignment: Analyze the hierarchical relationship between the two outlines and align the hierarchies of the same topics or related content. For example, if "Research Background" is a first-level heading in the first document outline, and the sub-points under "Research Background" in the second document outline are similar to the same-level content in the first document outline, then promote "Research Background" in the second document outline to a first-level heading to align its hierarchy with the first document outline.
[0258] 2.2 Logical Arrangement: Adjust the order of the outline content based on the document's theme and logical thread. For example, for a product introduction document, rearrange the combined content of the two outlines according to the logical order of product development, functional features, and market application to enhance the outline's logic and readability.
[0259] 2.3 Refinement and merging of levels: If a part of the content is too coarse in one outline and has a more detailed division in another outline, the detailed content should be added to the corresponding level; if it is found that some levels are too detailed and the content is highly related, the levels can be appropriately merged to simplify the outline structure.
[0260] 3. Weight distribution fusion
[0261] Based on the importance of the first document outline and the second document outline in different scenarios, different weights are assigned to them to calculate the fused target outline. The weight distribution fusion can be divided into the following steps:
[0262] 3.1 Weighting: By analyzing factors such as document type and user needs, weights are assigned to the two outlines. For example, for official documents with standard formatting and a complete table of contents, the weight of the first outline can be set to 0.7, and the weight of the second outline to 0.3. For literary works with strong creativity and a concise table of contents, the weight of the first outline can be set to 0.4, and the weight of the second outline to 0.6.
[0263] 3.2 Weighted Content Fusion: For identical or similar content in two outlines, a weighted calculation is performed. For example, if a key point in the first document outline has a score of 8 and a weight of 0.7, and the corresponding key point in the second document outline has a score of 6 and a weight of 0.3, the fused score for that key point will be 8 × 0.7 + 6 × 0.3 = 7.4. Content is sorted and filtered based on the weighted scores, retaining high-scoring content to form the target outline.
[0264] 3.3 Dynamically adjust weights: In actual application, the weights of the two outlines can be dynamically adjusted based on user feedback, fusion effect evaluation, etc., to continuously optimize the quality of the target outline.
[0265] A first document outline is constructed using hierarchical content with directory attributes in the document to be processed, and a first outline score of the first document outline is calculated. A second document outline is generated using the user's requirement expression and the original document content of the document to be processed, and a second outline score of the second document outline is calculated. The first outline score is compared with the second outline score, and a target outline is determined from the first document outline and the second document outline based on the comparison results. This allows a document outline that meets the requirements to be generated more efficiently and accurately.
[0266] In addition, in an embodiment of the present application, you can also choose to determine the leaf nodes and parent nodes in the document outline to calculate the outline score. In this way, you will get two outline scores, which are then compared. According to the comparison results, the target outline is determined from the first document outline and the second document outline.
[0267] Based on this, Figure 5 FIG. 1 is a schematic diagram of an implementation flow of another outline determination method provided in an embodiment of the present application. The method is applied to an electronic device and may specifically include the following steps:
[0268] S501: Obtain a document to be processed, and parse the hierarchical content with directory attributes in the document to be processed.
[0269] In the embodiment of the present application, this step is similar to the above-mentioned step S101, and the embodiment of the present application will not be described in detail here.
[0270] S502: Construct a first document outline corresponding to the document to be processed according to the hierarchical content with directory attributes.
[0271] In the embodiment of the present application, this step is similar to the above-mentioned step S102, and the embodiment of the present application will not be repeated here.
[0272] S503: Obtain a user requirement statement, and generate a second document outline according to the user requirement statement and the original document content of the document to be processed.
[0273] In the embodiment of the present application, this step is similar to the above-mentioned step S103, and the embodiment of the present application will not be repeated here.
[0274] S504: Determine at least one first leaf node and at least one first parent node in the first document outline.
[0275] In the embodiment of the present application, the document outline is generally embodied in a tree structure, thereby determining at least one first leaf node and at least one first parent node in the first document outline.
[0276] For example, the first document outline in a tree structure is as follows Figure 2 As shown, i1, i2, and i3 are all leaf nodes, and p1 and p2 are both parent nodes. Thus, the first leaf nodes i1, i2, and i3, and the first parent nodes p1 and p2 in the first document outline can be determined.
[0277] Among them, to determine at least one first parent node in the first document outline, you can first find the parent node of the leaf node, then deduplicate the parent node to obtain at least one first parent node in the first document outline, or directly determine all nodes, then eliminate the leaf nodes, and the remaining ones are at least one first parent node in the first document outline.
[0278] Based on this, for any first leaf node in the first document outline, determine the first parent node of the first leaf node; deduplicate all first parent nodes to obtain at least one first parent node in the first document outline; or, determine all first nodes in the first document outline, remove the first leaf node from all first nodes, and obtain at least one first parent node in the first document outline.
[0279] S505 : Determine a first outline score corresponding to the first document outline according to the at least one first leaf node and the at least one first parent node.
[0280] In an embodiment of the present application, after the above steps, at least one first leaf node and at least one first parent node in the first document outline can be determined, and the first outline score corresponding to the first document outline can be determined based on the at least one first leaf node and the at least one first parent node.
[0281] Among them, for any first leaf node, the first outline level where the first leaf node is located is determined; for any first parent node, the second outline level where the first parent node is located is determined; based on the first outline level and the second outline level, the first outline score corresponding to the first document outline is determined.
[0282] Specifically, for any first leaf node, determine the first outline level where the first leaf node is located, determine the first score corresponding to the first outline level, and the first leaf node weight corresponding to the first leaf node; multiply the first score by the first leaf node weight to obtain a first weighted score; for any first parent node, determine the second outline level where the first parent node is located, determine the second score corresponding to the second outline level, and the first parent node weight corresponding to the first parent node, multiply the second score by the first parent node weight to obtain a second weighted score; add all first weighted scores and all second weighted scores to obtain the first outline score corresponding to the first document outline. It should be noted that calculating the first outline score in the above manner has the following advantages:
[0283] The hierarchical structure of the outline is taken into consideration: outline nodes at different levels have different importance and functions in the document. This hierarchical difference can be reflected by determining the scores corresponding to the first outline level and the second outline level. Generally speaking, outline nodes at higher levels (such as the second outline level where the first parent node is located) usually represent more macro and more important topics or parts in the document. Giving them higher scores can highlight their leading role in the overall structure and content of the document; while outline nodes at lower levels (such as the first outline level where the first leaf node is located) focus more on specific details and content supplements. Their scores are relatively low, but they are also an indispensable part of the document. Such a setting can fully reflect the structural characteristics of the document outline from macro to micro, making the scoring more hierarchical and reasonable.
[0284] Combined with the weight factors of the nodes: corresponding weights are set for the first leaf node and the first parent node respectively, further refining the consideration of the importance of different nodes. The setting of the first leaf node weight and the first parent node weight can be determined according to the specific nature of the node and its actual importance in the document. For example, some leaf nodes may contain key detailed information or core ideas, and their weights can be appropriately increased; while some parent nodes may play a key supporting role in the overall structure and logic of the document, and can also be given a higher weight. Multiplying the score corresponding to the outline level with the node weight, the weighted score obtained can more accurately reflect the actual value of each node in the document outline, avoiding the one-sidedness of evaluation based only on the level or only on the node type.
[0285] Comprehensively determine the quality of the document outline: Add all the first weighted scores and all the second weighted scores to get the first outline score. This method takes into account multiple factors such as the hierarchy and weight of each node in the document outline, and can comprehensively and objectively determine the quality of the document outline. Through this comprehensive score, you can get an overall understanding of the performance of the document outline in terms of structural integrity, content richness, and the balance of importance of each part. A higher score usually means that the document outline performs well in all aspects, with a reasonable hierarchical structure, clear focus, and rich details, which can provide a good framework and guidance for document writing; conversely, a lower score can help discover possible problems in the document outline, such as the content of certain levels is too thin, the weight setting of important nodes is unreasonable, etc., so as to make targeted improvements and optimizations.
[0286] S506: Determine at least one second leaf node and at least one second parent node in the second document outline.
[0287] In the embodiment of the present application, the document outline is generally embodied in a tree structure, thereby determining at least one second leaf node and at least one second parent node in the second document outline.
[0288] For example, the second document outline in a tree structure is as follows Figure 3 As shown, i1, i2, and i3 are all leaf nodes, and p1 is the parent node. Then, the second leaf nodes i1, i2, and i3 and the second parent node p1 in the second document outline can be determined.
[0289] Among them, to determine at least one second parent node in the second document outline, you can first find the parent node of the leaf node, then deduplicate the parent node to obtain at least one second parent node in the second document outline, or directly determine all nodes, then eliminate the leaf nodes, and the remaining ones are at least one second parent node in the second document outline.
[0290] Based on this, for any second leaf node in the second document outline, determine the second parent node of the second leaf node; deduplicate all second parent nodes to obtain at least one second parent node in the second document outline; or, determine all second nodes in the first document outline, remove the second leaf nodes from all second nodes, and obtain at least one second parent node in the second document outline.
[0291] S507: Determine a second outline score corresponding to the second document outline according to the at least one second leaf node and the at least one second parent node.
[0292] In an embodiment of the present application, after the above steps, at least one second leaf node and at least one second parent node in the second document outline can be determined, and the second outline score corresponding to the second document outline can be determined based on the at least one second leaf node and the at least one second parent node.
[0293] Among them, for any second leaf node, the third outline level where the second leaf node is located is determined; for any second parent node, the fourth outline level where the second parent node is located is determined; based on the third outline level and the fourth outline level, the second outline score corresponding to the second document outline is determined.
[0294] Specifically, for any second leaf node, determine the third outline level where the second leaf node is located, determine the third score corresponding to the third outline level, and the second leaf node weight corresponding to the second leaf node, and multiply the third score by the second leaf node weight to obtain a third weighted score; for any second parent node, determine the fourth outline level where the second parent node is located, determine the fourth score corresponding to the fourth outline level, and the second parent node weight corresponding to the second parent node, and multiply the fourth score by the second parent node weight to obtain a fourth weighted score; add all third weighted scores and all fourth weighted scores to obtain the second outline score corresponding to the second document outline.
[0295] S508 , comparing the first outline score with the second outline score, and determining a target outline from the first document outline and the second document outline according to the comparison result.
[0296] In the embodiment of the present application, this step is similar to the above-mentioned step S407, and the embodiment of the present application will not be repeated here.
[0297] A first document outline is constructed using hierarchical content with directory attributes in the document to be processed, and a first outline score of the first document outline is calculated. A second document outline is generated using the user's requirement expression and the original document content of the document to be processed, and a second outline score of the second document outline is calculated. The first outline score is compared with the second outline score, and a target outline is determined from the first document outline and the second document outline based on the comparison results. This allows a document outline that meets the requirements to be generated more efficiently and accurately.
[0298] Corresponding to the above method embodiment, the embodiment of the present application also provides an outline determination device, such as Figure 6 As shown, the apparatus may include: a document parsing module 610 , an outline building module 620 , an outline generating module 630 , and an outline determining module 640 .
[0299] The document parsing module 610 is used to obtain a document to be processed and parse the hierarchical content with directory attributes in the document to be processed;
[0300] An outline construction module 620 is configured to construct a first document outline corresponding to the document to be processed according to the hierarchical content having directory attributes;
[0301] An outline generation module 630 is configured to obtain a user requirement statement and generate a second document outline based on the user requirement statement and the original document content of the document to be processed;
[0302] The outline determining module 640 is configured to determine a target outline according to the first document outline and the second document outline.
[0303] In an optional implementation, the outline determination module specifically includes:
[0304] a quantity determination submodule, configured to determine the number of first nodes in the first document outline and the number of second nodes in the second document outline;
[0305] A first score determination submodule, configured to determine a first outline score corresponding to the first document outline based on the first number of nodes;
[0306] A second score determination submodule, configured to determine a second outline score corresponding to the second document outline based on the number of the second nodes;
[0307] The outline determination submodule is configured to compare the first outline score with the second outline score, and determine a target outline from the first document outline and the second document outline according to the comparison result.
[0308] In an optional embodiment, the determining submodule specifically includes:
[0309] A first quantity determining unit, configured to determine the number of first leaf nodes and the number of first parent nodes in the first document outline, where the number of the first leaf nodes and the number of the first parent nodes constitute the first node number;
[0310] The second quantity determining unit is configured to determine the second leaf node quantity and the second parent node quantity in the second document outline, where the second leaf node quantity and the second parent node quantity constitute the second node quantity.
[0311] In an optional embodiment, the first quantity determining unit is specifically configured to:
[0312] For any first leaf node in the first document outline, determining a first parent node of the first leaf node;
[0313] Deduplicating all first parent nodes, determining the number of the deduplicated first parent nodes, and obtaining the number of the first parent nodes in the first document outline;
[0314] or,
[0315] Determine a first total number of nodes in the first document outline, obtain a difference between the first total number of nodes and the first number of leaf nodes, and obtain a first number of parent nodes in the first document outline;
[0316] The second quantity determining unit is specifically configured to:
[0317] For any second leaf node in the second document outline, determining a second parent node of the second leaf node;
[0318] Deduplicating all the second parent nodes, determining the number of the second parent nodes after deduplication, and obtaining the number of the second parent nodes in the second document outline;
[0319] or,
[0320] Determine a second total number of nodes in the second document outline, obtain a difference between the second total number of nodes and the second number of leaf nodes, and obtain a second number of parent nodes in the second document outline.
[0321] In an optional embodiment, the first score determination submodule specifically includes:
[0322] a first weight determination unit, configured to determine a first leaf node weight corresponding to a first leaf node in the first document outline, and a first parent node weight corresponding to a first parent node, wherein the first parent node weight is greater than the first leaf node weight;
[0323] The first score determination unit is configured to perform weighted summation on the number of the first leaf nodes, the number of the first parent nodes, the weight of the first leaf nodes, and the weight of the first parent nodes to obtain a first outline score corresponding to the first document outline.
[0324] In an optional embodiment, the second score determination submodule specifically includes:
[0325] A second weight determination unit, configured to determine a second leaf node weight corresponding to the second leaf node and a second parent node weight corresponding to the second parent node in the second document outline, wherein the second parent node weight is greater than the second leaf node weight;
[0326] The second score determination unit is used to perform weighted summation on the number of the second leaf nodes, the number of the second parent nodes, the weight of the second leaf nodes, and the weight of the second parent nodes to obtain a second outline score corresponding to the second document outline.
[0327] In an optional embodiment, the first score determination unit is specifically configured to:
[0328] determining the number of first outline levels in the first document outline and first outline level weights corresponding to the first number of outline levels;
[0329] Performing a weighted summation on the number of the first leaf nodes, the number of the first parent nodes, the weight of the first leaf nodes, and the weight of the first parent nodes to obtain a first weighted sum;
[0330] Multiply the first outline level number by the first outline level weight, and add the product to the first weighted sum to obtain a first outline score corresponding to the first document outline.
[0331] In an optional implementation, the second score determination unit is specifically configured to:
[0332] determining the number of second outline levels in the second document outline and second outline level weights corresponding to the second number of outline levels;
[0333] Performing a weighted sum on the number of the second leaf nodes, the number of the second parent nodes, the weight of the second leaf nodes, and the weight of the second parent nodes to obtain a second weighted sum;
[0334] Multiply the second outline level number by the second outline level weight, and add the product to the second weighted sum to obtain a second outline score corresponding to the second document outline.
[0335] In an optional implementation, the outline determination module specifically includes:
[0336] A first node determination submodule, configured to determine at least one first leaf node and at least one first parent node in the first document outline;
[0337] A first score determination submodule, configured to determine a first outline score corresponding to the first document outline based on at least one of the first leaf nodes and at least one of the first parent nodes;
[0338] A second node determination submodule, configured to determine at least one second leaf node and at least one second parent node in the second document outline;
[0339] A second score determination submodule, configured to determine a second outline score corresponding to the second document outline based on at least one second leaf node and at least one second parent node;
[0340] The outline determination submodule is configured to compare the first outline score with the second outline score, and determine a target outline from the first document outline and the second document outline according to the comparison result.
[0341] In an optional implementation, the first node determination submodule is specifically configured to:
[0342] For any first leaf node in the first document outline, determining a first parent node of the first leaf node;
[0343] Deduplicating all first parent nodes to obtain at least one first parent node in the first document outline;
[0344] or,
[0345] Determine all first nodes in the first document outline, remove first leaf nodes from all first nodes, and obtain at least one first parent node in the first document outline;
[0346] The second node determination submodule is specifically configured to:
[0347] For any second leaf node in the second document outline, determining a second parent node of the second leaf node;
[0348] Deduplicating all the second parent nodes to obtain at least one second parent node in the second document outline;
[0349] or,
[0350] All second nodes in the first document outline are determined, and second leaf nodes are removed from all second nodes to obtain at least one second parent node in the second document outline.
[0351] In an optional embodiment, the first score determination submodule specifically includes:
[0352] a first outline level determining unit, configured to determine, for any first leaf node, a first outline level at which the first leaf node is located;
[0353] a second outline level determining unit, configured to determine, for any first parent node, a second outline level at which the first parent node is located;
[0354] The first score determining unit is configured to determine a first outline score corresponding to the first document outline according to the first outline level and the second outline level.
[0355] In an optional implementation, the first score determination unit is specifically configured to:
[0356] Determining a first score corresponding to the first outline level and a first leaf node weight corresponding to the first leaf node;
[0357] Multiplying the first score by the first leaf node weight to obtain a first weighted score;
[0358] Determining a second score corresponding to the second outline level and a first parent node weight corresponding to the first parent node;
[0359] Multiplying the second score by the first parent node weight to obtain a second weighted score;
[0360] All of the first weighted scores and all of the second weighted scores are added together to obtain a first outline score corresponding to the first document outline.
[0361] In an optional embodiment, the second score determination submodule specifically includes:
[0362] a third outline level determining unit, configured to determine, for any second leaf node, a third outline level at which the second leaf node is located;
[0363] a fourth outline level determining unit, configured to determine, for any second parent node, a fourth outline level at which the second parent node is located;
[0364] The second score determining unit is configured to determine a second outline score corresponding to the second document outline according to the third outline level and the fourth outline level.
[0365] In an optional implementation, the second score determination unit is specifically configured to:
[0366] Determining a third score corresponding to the third outline level and a second leaf node weight corresponding to the second leaf node;
[0367] Multiplying the third score by the second leaf node weight to obtain a third weighted score;
[0368] Determining a fourth score corresponding to the fourth outline level and a second parent node weight corresponding to the second parent node;
[0369] multiplying the fourth score by the second parent node weight to obtain a fourth weighted score;
[0370] All of the third weighted scores and all of the fourth weighted scores are added together to obtain a second outline score corresponding to the second document outline.
[0371] In an optional embodiment, the outline determination submodule is specifically configured to:
[0372] If the first outline score is greater than the second outline score, determining the first document outline as a target outline;
[0373] When the first outline score is less than or equal to the second outline score, the second document outline is determined as the target outline.
[0374] The present application also provides an electronic device, such as Figure 7 As shown, it includes a processor 71, a communication interface 72, a memory 73 and a communication bus 74, wherein the processor 71, the communication interface 72, and the memory 73 communicate with each other through the communication bus 74.
[0375] Memory 73, for storing computer programs;
[0376] The processor 71 is configured to execute the program stored in the memory 73 to implement the following steps:
[0377] Obtain a document to be processed and parse the hierarchical content with directory attributes in the document to be processed; construct a first document outline corresponding to the document to be processed based on the hierarchical content with directory attributes; obtain a user requirement statement, and generate a second document outline based on the user requirement statement and the original document content of the document to be processed; determine a target outline based on the first document outline and the second document outline.
[0378] The communication bus mentioned in the electronic device mentioned above may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.
[0379] The communication interface is used for communication between the above electronic device and other devices.
[0380] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.
[0381] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
[0382] In another embodiment provided by the present application, a storage medium is further provided, in which instructions are stored. When the storage medium is run on a computer, the computer executes the outline determination method described in any one of the above embodiments.
[0383] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the outline determination method described in any one of the above embodiments.
[0384] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a storage medium or transmitted from one storage medium to another. For example, the computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0385] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0386] Each embodiment in this specification is described in a related manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiment is generally similar to the method embodiment, so the description is relatively simple. For related parts, refer to the description of the method embodiment.
[0387] The above description is only a preferred embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the scope of protection of the present application.
Claims
1. A method for determining an outline, characterized in that: The method comprises: Obtaining a document to be processed, and parsing hierarchical content with directory attributes in the document to be processed; Constructing a first document outline corresponding to the document to be processed according to the hierarchical content with directory attributes; Obtaining a user requirement statement, and generating a second document outline based on the user requirement statement and the original document content of the document to be processed; A target outline is determined according to the first document outline and the second document outline.
2. The method according to claim 1, characterized in that The determining of the target outline according to the first document outline and the second document outline includes: Determining a first number of nodes in the first document outline and a second number of nodes in the second document outline; Determining a first outline score corresponding to the first document outline based on the first node number; Determining a second outline score corresponding to the second document outline according to the number of the second nodes; The first outline score and the second outline score are compared, and a target outline is determined from the first document outline and the second document outline according to the comparison result.
3. The method according to claim 2, characterized in that The determining the first number of nodes in the first document outline and the second number of nodes in the second document outline includes: Determine the number of first leaf nodes and the number of first parent nodes in the first document outline, where the first leaf nodes and the first parent nodes constitute the first node number; The second leaf node quantity and the second parent node quantity in the second document outline are determined, where the second leaf node quantity and the second parent node quantity constitute the second node quantity.
4. The method according to claim 3, characterized in that Determining the number of first parent nodes in the first document outline includes: For any first leaf node in the first document outline, determining a first parent node of the first leaf node; Deduplicating all first parent nodes, determining the number of the deduplicated first parent nodes, and obtaining the number of the first parent nodes in the first document outline; or, Determine a first total number of nodes in the first document outline, obtain a difference between the first total number of nodes and the first number of leaf nodes, and obtain a first number of parent nodes in the first document outline; Determining the number of second parent nodes in the second document outline includes: For any second leaf node in the second document outline, determining a second parent node of the second leaf node; Deduplicating all the second parent nodes, determining the number of the second parent nodes after deduplication, and obtaining the number of the second parent nodes in the second document outline; or, Determine a second total number of nodes in the second document outline, obtain a difference between the second total number of nodes and the second number of leaf nodes, and obtain a second number of parent nodes in the second document outline.
5. The method according to claim 3, characterized in that Determining a first outline score corresponding to the first document outline according to the first number of nodes includes: Determining a first leaf node weight corresponding to a first leaf node in the first document outline, and a first parent node weight corresponding to a first parent node, wherein the first parent node weight is greater than the first leaf node weight; A weighted sum is performed on the number of the first leaf nodes, the number of the first parent nodes, the weight of the first leaf node, and the weight of the first parent node to obtain a first outline score corresponding to the first document outline.
6. The method according to claim 3, characterized in that Determining a second outline score corresponding to the second document outline according to the second node quantity includes: Determining a second leaf node weight corresponding to the second leaf node and a second parent node weight corresponding to the second parent node in the second document outline, wherein the second parent node weight is greater than the second leaf node weight; A weighted sum is performed on the number of the second leaf nodes, the number of the second parent nodes, the weight of the second leaf nodes, and the weight of the second parent nodes to obtain a second outline score corresponding to the second document outline.
7. The method according to claim 5, characterized in that The step of performing weighted summation on the number of the first leaf nodes, the number of the first parent nodes, the weight of the first leaf nodes, and the weight of the first parent nodes to obtain a first outline score corresponding to the first document outline includes: determining the number of first outline levels in the first document outline and first outline level weights corresponding to the first number of outline levels; Performing a weighted summation on the number of the first leaf nodes, the number of the first parent nodes, the weight of the first leaf nodes, and the weight of the first parent nodes to obtain a first weighted sum; Multiply the first outline level number by the first outline level weight, and add the product to the first weighted sum to obtain a first outline score corresponding to the first document outline.
8. The method according to claim 6, characterized in that The step of performing a weighted summation on the number of the second leaf nodes, the number of the second parent nodes, the weight of the second leaf nodes, and the weight of the second parent nodes to obtain a second outline score corresponding to the second document outline includes: determining the number of second outline levels in the second document outline and second outline level weights corresponding to the second number of outline levels; Performing a weighted sum on the number of the second leaf nodes, the number of the second parent nodes, the weight of the second leaf nodes, and the weight of the second parent nodes to obtain a second weighted sum; Multiply the second outline level number by the second outline level weight, and add the product to the second weighted sum to obtain a second outline score corresponding to the second document outline.
9. The method according to claim 1, characterized in that The determining of the target outline according to the first document outline and the second document outline includes: Determining at least one first leaf node and at least one first parent node in the first document schema; Determining a first outline score corresponding to the first document outline according to at least one of the first leaf nodes and at least one of the first parent nodes; Determining at least one second leaf node and at least one second parent node in the second document schema; Determining a second outline score corresponding to the second document outline according to at least one second leaf node and at least one second parent node; The first outline score and the second outline score are compared, and a target outline is determined from the first document outline and the second document outline according to the comparison result.
10. The method according to claim 9, characterized in that Determining a first outline score corresponding to the first document outline according to at least one first leaf node and at least one first parent node includes: For any of the first leaf nodes, determining a first outline level at which the first leaf node is located; For any of the first parent nodes, determining a second outline level at which the first parent node is located; A first outline score corresponding to the first document outline is determined according to the first outline level and the second outline level.
11. The method according to claim 10, characterized in that Determining a first outline score corresponding to the first document outline according to the first outline level and the second outline level includes: Determining a first score corresponding to the first outline level and a first leaf node weight corresponding to the first leaf node; Multiplying the first score by the first leaf node weight to obtain a first weighted score; Determining a second score corresponding to the second outline level and a first parent node weight corresponding to the first parent node; Multiplying the second score by the first parent node weight to obtain a second weighted score; All of the first weighted scores and all of the second weighted scores are added together to obtain a first outline score corresponding to the first document outline.
12. The method according to claim 9, characterized in that Determining a second outline score corresponding to the second document outline according to at least one second leaf node and at least one second parent node includes: For any second leaf node, determining the third outline level where the second leaf node is located; For any second parent node, determining the fourth outline level where the second parent node is located; A second outline score corresponding to the second document outline is determined according to the third outline level and the fourth outline level.
13. The method according to claim 12, characterized in that Determining a second outline score corresponding to the second document outline according to the third outline level and the fourth outline level includes: Determining a third score corresponding to the third outline level and a second leaf node weight corresponding to the second leaf node; Multiplying the third score by the second leaf node weight to obtain a third weighted score; Determining a fourth score corresponding to the fourth outline level and a second parent node weight corresponding to the second parent node; multiplying the fourth score by the second parent node weight to obtain a fourth weighted score; All of the third weighted scores and all of the fourth weighted scores are added together to obtain a second outline score corresponding to the second document outline.
14. The method according to claim 2 or 9, characterized in that Determining a target outline from the first document outline and the second document outline according to the comparison result includes: If the first outline score is greater than the second outline score, determining the first document outline as a target outline; When the first outline score is less than or equal to the second outline score, the second document outline is determined as the target outline.
15. An outline determination device, characterized in that: The device comprises: A document parsing module, configured to obtain a document to be processed and parse hierarchical content with directory attributes in the document to be processed; An outline construction module, configured to construct a first document outline corresponding to the document to be processed according to the hierarchical content having directory attributes; An outline generation module, configured to obtain a user requirement statement and generate a second document outline based on the user requirement statement and the original document content of the document to be processed; An outline determining module is configured to determine a target outline according to the first document outline and the second document outline.