Article title structure generation method and system
Through fine-tuning and model fine-tuning, combined with Prompt prompt word and data enhancement algorithm, the problem of inaccurate identification and extraction of article title structure in the existing technology is solved, the quality and readability of article title structure generation is improved, and efficient , automated article processing.
Patent Information
- Application Number
- CN202411000300.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-12-20
AI Technical Summary
The existing automatic article title structure method cannot accurately identify articles in different formats and extract title structure information, resulting in insufficient quality and readability of the generated results.
By using fine-tuning and model fine-tuning, the title structure information of the article is obtained for labeling, the title hierarchy tree is constructed, and the training sample set is generated through pruning and data augmentation algorithms, combined with the Prompt prompt word optimization generation results, and the large Model generates article structure.
It improves the accuracy and quality of the results generated by the article title structure, realizes automated and efficient article processing, and enhances the user experience. It has higher accuracy and efficiency than traditional manual writing.
Smart Images

Figure CN119166802A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and in particular to a method and system for generating an article title structure. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] In modern article processing, automatically generating article title structures is of great significance. First, the title structure can provide a clear framework for the article, helping readers better understand the content of the article. Second, the title structure can help search engines better index and classify articles and improve search efficiency. However, existing methods for automatically generating article title structures have certain limitations, such as the inability to accurately identify articles of different formats and the inability to accurately extract title structure information. Summary of the invention
[0004] In order to solve the technical problems existing in the above-mentioned background technology, the present invention provides a method and system for generating an article title structure. The present invention can further optimize the result of the article title structure generation through fine-tuning and model fine-tuning, and improve the quality and readability of the result of the article title structure generation.
[0005] In order to achieve the above object, the present invention adopts the following technical solution:
[0006] A first aspect of the present invention provides a method for generating an article title structure.
[0007] A method for generating an article title structure, comprising:
[0008] Obtain the title structure information of the article, and label the title structure of the article according to the title level to obtain the title structure of different levels of the article;
[0009] According to the article title structure label data, a title hierarchy tree is constructed; leaf nodes in the title hierarchy tree are pruned, and leaf nodes of one or more tree branches are removed to obtain the first sub-title hierarchy tree; when the sub-nodes of the tree meet a certain range, all sub-trees under the root node are extracted according to the situation of the middle branch sub-tree of the title hierarchy tree to obtain the second sub-title hierarchy tree; sub-tree branches in the title hierarchy tree are pruned, and one or more tree branches are removed to obtain the third sub-title hierarchy tree; based on the first sub-title hierarchy tree, the second sub-title hierarchy tree and the third sub-title hierarchy tree, a training sample set is constructed; based on the training sample set, a large model for training article structure generation is generated;
[0010] During the training process, the output results are adjusted using prompt words to obtain article structure generation results that meet the requirements and the trained article structure generation model;
[0011] Based on the input article title, the trained article structure is used to generate a large model and output candidate article structure results.
[0012] Furthermore, the tree sub-nodes satisfying a certain range refers to the tree sub-nodes being greater than or equal to 5.
[0013] Furthermore, if the level of the first subtitle hierarchy tree, the second subtitle hierarchy tree or the third subtitle hierarchy tree is greater than 2, the first subtitle hierarchy tree, the second subtitle hierarchy tree or the third subtitle hierarchy tree is pruned, otherwise, no processing is performed.
[0014] Furthermore, if the number of nodes based on the first subtitle hierarchy tree, the second subtitle hierarchy tree or the third subtitle hierarchy tree is greater than or equal to 5, the first subtitle hierarchy tree, the second subtitle hierarchy tree or the third subtitle hierarchy tree is pruned, otherwise, no processing is performed.
[0015] Furthermore, the generation of a large model by training article structure based on the training sample set includes: using the lowest level structure labels and text content as training input data, and using high level structure labels and text content as training output results.
[0016] Furthermore, the process of using the prompt words includes: investigating the prompt words for the article structure generation task and finding the prompt words that meet the article structure generation task in combination with expert suggestions.
[0017] Furthermore, the process of using the prompt word also includes: processing the prompt words of the article structure generation task by using the prompt encoder technology to find the prompt words that are suitable for regenerating the structure level result of the hierarchical content of the subheading.
[0018] Furthermore, the process of using Prompt words also includes: processing the prompt words of the task of supplementing the structural level of the subtitle by using Prompt Embedding technology, and finding the prompt words that are suitable for supplementing the structural level of the subtitle in combination with expert suggestions.
[0019] A second aspect of the present invention provides an article title structure generating system.
[0020] A system for generating article title structure, comprising:
[0021] The data acquisition module is configured to: acquire the title structure information of the article, and label the title structure of the article according to the title level to obtain the title structure of different levels of the article;
[0022] The data enhancement module is configured to: construct a title hierarchy tree according to the article title structure label data; prune the leaf nodes in the title hierarchy tree, remove the leaf nodes of one or more tree branches, and obtain the first sub-title hierarchy tree; when the sub-nodes of the tree meet a certain range, extract all the sub-trees under the root node according to the situation of the middle branch sub-tree of the title hierarchy tree to obtain the second sub-title hierarchy tree; prune the sub-tree branches in the title hierarchy tree, remove one or more tree branches, and obtain the third sub-title hierarchy tree; construct a training sample set based on the first sub-title hierarchy tree, the second sub-title hierarchy tree and the third sub-title hierarchy tree; train the article structure generation model based on the training sample set;
[0023] The model training module is configured to: during the training process, use the prompt word to adjust the output result to obtain the article structure generation result that meets the requirements and the trained article structure generation model;
[0024] The title generation module is configured to: based on the input article title, use the trained article structure to generate a large model and output article structure candidate results.
[0025] A third aspect of the present invention provides a computer-readable storage medium.
[0026] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps in the article title structure generation method as described in the first aspect above.
[0027] A fourth aspect of the present invention provides a computer device.
[0028] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the method for generating an article title structure as described in the first aspect above are implemented.
[0029] Compared with the prior art, the present invention has the following beneficial effects:
[0030] The present invention combines manual labeling and intelligent extraction methods, as well as hierarchical structure disassembly and recursion algorithms to generate structured tag information for article titles. By fine-tuning the article structure generation model, the system can parse the article title input by the user and generate article structure candidate results. Finally, by optimizing the content of the article structure results with the promotion word of some sub-title content in the generated article structure candidate results, the accuracy and quality of the generated article structure can be improved.
[0031] According to the present invention, the user can input the article title and prompt words according to the requirements, and personalize the article title structure generation result, thereby improving the user experience.
[0032] The present invention realizes automated and efficient article processing based on article structure labeling, training data enhancement algorithm, large model training algorithm, structure generation and display algorithm and Promote optimization algorithm. Compared with the traditional manual writing of title structure, the present invention has higher accuracy and efficiency, and can greatly improve the effect and work efficiency of article processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0034] Figure 1 is a flow chart of a method for generating an article title structure shown in the present invention;
[0035] Figure 2 It is a flow chart of data enhancement shown in the present invention. DETAILED DESCRIPTION
[0036] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0037] It should be noted that the following detailed descriptions are all illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0038] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0039] It should be noted that the flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the methods and systems according to various embodiments of the present disclosure. It should be noted that each box in the flowchart or block diagram can represent a module, a program segment, or a part of a code, and the module, program segment, or a part of a code may include one or more executable instructions for implementing the logical functions specified in each embodiment. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, or they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the flowchart and / or block diagram, and the combination of boxes in the flowchart and / or block diagram can be implemented using a dedicated hardware-based system that performs a specified function or operation, or can be implemented using a combination of dedicated hardware and computer instructions.
[0040] Embodiment 1
[0041] like Figure 1 As shown, this embodiment provides a method for generating an article title structure. This embodiment uses the method applied to a server as an example. It can be understood that the method can also be applied to a terminal, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network servers, cloud communications, middleware services, domain name services, security services CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in this application. In this embodiment, the method includes the following steps:
[0042] Step 1: Label the article title structure. Obtain the article title structure information through manual annotation or intelligent extraction, and label the article title structure according to the title level to obtain the title structure of different levels of the article.
[0043] Step 2: Training data enhancement algorithm, through hierarchical structure decomposition and recursion, the original article title structure is decomposed to obtain more substructures and enhance the model training data; then the title and title level are extracted from the content of the book's directory module to obtain the title structure of different levels of the article, such as Figure 2 shown.
[0044] Step 2.1: Construct a title hierarchy tree: Construct a title hierarchy tree based on the article title structure tag data, where the title level tags correspond one-to-one to the levels of the title hierarchy tree;
[0045] Step 2.2: Pruning the leaf nodes of the title hierarchy tree: Use the pruning algorithm to prune the leaf nodes in the title hierarchy tree, remove the leaf nodes of one or more tree branches; and obtain a new sub-title hierarchy tree.
[0046] Step 2.3: Get the branch of the title hierarchy tree: According to the situation of the middle branch subtree of the title hierarchy tree, extract all the subtrees under its root node; get a new subtitle hierarchy tree. If the number of tree branch nodes is less than 5, no processing is performed.
[0047] Step 2.4: Pruning of the hierarchical nodes of the title hierarchy tree: Use a pruning algorithm to prune the subtree branches in the title hierarchy tree, remove one or more tree branches, and obtain a new subtitle hierarchy tree.
[0048] Step 2.5: Recursive processing of title hierarchy tree structure disassembly: The title hierarchy structure can be recursively disassembled only when the subtitle hierarchy tree structure is rich enough. Generally, the title structure is a general-specific structure, so the root node is basically a general description and the leaf node is a sub-item description. Therefore, it is necessary to calculate the hierarchy in the subtitle hierarchy tree. When the hierarchy is equal to 2 layers or the number of nodes in the subtitle hierarchy tree is less than 5, no processing is performed. When the hierarchy is higher than 2 layers and the number of nodes in the subtitle hierarchy tree is greater than or equal to 5, perform steps 2.2 to 2.4 on the subtitle hierarchy tree again. Each of the subtitle hierarchy trees needs to be saved in the training data.
[0049] Step 3: The article title structure generates a large model training algorithm. The enhanced training data set is input into the large model for fine-tuning training. The lowest level structure labels and text content are used as training input data, and high-level structure labels and text content are used as result output data.
[0050] Step 4: Promo optimization algorithm. Prompt is a short text string used to guide the language model to generate responses. Prompt can contain task-related information and context to help the model better understand the requirements and generate correct outputs. By manually adjusting different types of prompts, the article title structure generation results that meet user needs are obtained.
[0051] Step 4.1: Generate Promo Words from Article Structure: Research the prompt words for article structure generation tasks and consult experts to find out the prompt words that meet the requirements of article structure generation. The promo words can be "You are a very experienced document writing expert. Please generate the title outline of the article based on the input article title content. The article title is: xxxxxx" or "Generate a document outline based on the article title, xxxxx;".
[0052] Step 4.2: Regenerate the hierarchical content of subtitles in the article structure generation result: Use the prompt encoder technology to process the prompt words of the article structure generation task, and find the promot prompt words that meet the requirements of regenerating the hierarchical content of subtitles. The promot prompt word of this task can be "Regenerate the hierarchical structure of subtitles in the article title outline generated above. The subtitles are: 2. Existing problems".
[0053] Step 4.3: Supplement the structural hierarchy of subtitles in the article structure generation result: Use Prompt Embedding technology to process the prompt words of the task of supplementing the structural hierarchy of subtitles and consult experts to find the promot prompt words that are suitable for supplementing the structural hierarchy of subtitles. The promot prompt word of this task can be "Supplement the subtitle hierarchy structure in the article title outline generated above. The subtitle is: (III) Distribution network development".
[0054] Step 4.4: Result level results of adding subtitles to the article structure generation results: By analyzing the prompt words of the newly added subtitles and consulting experts, find out the promote prompt words that meet the requirements for regenerating the structure level results of the newly added subtitles. The promote prompt words for this task can be "Add a first-level title to the article title outline generated above. The new title is: Work plan for the second half of the year, and complete the generated title structure to the generated article structure."
[0055] Step 5: The title structure generation and display algorithm calls the trained article title structure generation model to parse the article title input by the user and generate candidate article structure results.
[0056] The scheme of the present invention is described in detail below by an example:
[0057] Step 1: Label the article title structure. Obtain the article title structure information through manual annotation or intelligent extraction, and label the article title structure according to the title level to obtain the title structure of the article at different levels. For example, for the "XXX Notice.doc" file, the article structure is labeled to obtain the "XXX Notice.txt" file that only stores the article title structure and labels. The txt file contains two columns of data, the first column is the title level label, and the second column is the title text content. For example, "0: xxx Notice\n1: 1. Overall Requirements\n...", where the number "0" before the split ':' represents the title level label, and the text content "xxx Notice" behind it is the article name text content; "0" represents the article title, "1" represents the first-level title, "2" is the second-level title, "3" is the third-level title, and so on.
[0058] Step 2: Article title structure training data enhancement algorithm, through hierarchical structure decomposition and recursion methods, the original article structure is decomposed to obtain more substructures and enhance the model training data. Specifically, for the tree-structured directory structure, the subtree recursive algorithm is used to decompose the labeled article structure to obtain more training samples.
[0059] Step 2.1: Construct a title hierarchy tree: Construct a title hierarchy tree based on the article title structure tag data. The title level tags correspond to the levels of the title hierarchy tree one by one. For example, the root node is the article title, the first-level tree node is the first-level title, and so on.
[0060] Step 2.2: Pruning of title tree leaves: Use the pruning algorithm to prune the leaf nodes in the title tree, remove the leaf nodes of one or more tree branches, and obtain a new subtitle tree. For example, a labeled article structure "{0: xxx notice; \n1: 1. Overall requirements; \n2: (1) Overall thinking; \n2: (2) Basic principles; \n2: (3) Overall goals; \n3: First year; \n3: Second year; \n3: Third year; \n1: 2. Key tasks; \n1: 3. Safeguard measures; \n}", after pruning the title tree leaves, a new title tree is obtained as "{0: xxx notice; \n1: 1. Overall requirements; \n2: (1) Overall thinking; \n2: (2) Basic principles; \n2: (3) Overall goals; \n1: 2. Key tasks; \n1: 3. Safeguard measures; \n}"
[0061] Step 2.3: Obtaining the branches of the title hierarchy tree: According to the situation of the middle branch subtree of the title hierarchy tree, extract all the subtrees under its root node; obtain a new subtitle hierarchy tree. For example, a labeled article structure "{0: xxx notice; \n1: I. Overall requirements; \n2: (I) Overall ideas; \n2: (II) Basic principles; \n2: (III) Overall goals; \n3: First year; \n3: Second year; \n3: Third year; \n1: II. Key tasks; \n1: III. Guarantee measures; \n}", after obtaining the branches of the title hierarchy tree, a new title hierarchy tree is obtained as "{1: I. Overall requirements; \n2: (I) Overall ideas; \n2: (II) Basic principles; \n2: (III) Overall goals; \n}". Among them, the tree branches "{1: II. Key tasks;}" and "{1: III. Guarantee measures; \n}" do not meet the rule that the number of nodes is higher than 5, and these tree branches cannot be counted as training data.
[0062] Step 2.4: Pruning of the hierarchical nodes of the title tree: Use the pruning algorithm to prune the subtree branches in the title tree, remove one or more tree branches, and obtain a new subtitle tree. For example, a labeled article structure "{0: xxx notice; \n1: 1. Overall requirements; \n2: (1) Overall thinking; \n2: (2) Basic principles; \n2: (3) Overall goals; \n3: First year; \n3: Second year; \n3: Third year; \n1: 2. Key tasks; \n1: 3. Safeguard measures; \n}", after obtaining the title tree branches, a new title tree is obtained as "{1: 1. Overall requirements; \n2: (1) Overall thinking; \n2: (2) Basic principles; \n2: (3) Overall goals; \n1: 2. Key tasks; \n}"
[0063] Step 2.5: Recursive processing of title hierarchy tree structure disassembly: Calculate the hierarchy in the subtitle hierarchy tree. Do not process when the hierarchy is equal to 2 or the number of nodes in the subtitle hierarchy tree is less than 5. When the hierarchy is higher than 2, rewrite the operations from step 2.2 to step 2.4 for the subtitle hierarchy tree.
[0064] Step 3: Large model training algorithm, input the enhanced training data set into the large model for fine-tuning training article structure generation large model, where the lowest level structure label and text content are used as training input data, and the high level structure label and text content are used as result output data. For example, a training sample "{0: (III) Overall goal; \n1: First year; \n1: Second year; \n1: Third year; \n}", the training input data is "Article structure outline subtitle generation: (III) Overall goal", and the result output data is "1: First year; \n1: Second year; \n1: Third year; \n", where "0: (III) Overall goal;" is the input of the training sample, and "1: First year; \n1: Second year; \n1: Third year; \n}", the training input data is "Article structure outline subtitle generation: (III) Overall goal", and the result output data is "1: First year; \n1: Second year; \n1: Third year; \n" is the output of the training sample.
[0065] Step 4: Promo optimization algorithm. Prompt is a short text string used to guide the language model to generate responses. Prompt can contain task-related information and context to help the model better understand the requirements and generate correct outputs. By manually adjusting different types of prompts, the article title structure generation results that meet user needs are obtained.
[0066] Step 4.1: Generate Promo Words from Article Structure: Research the prompt words for article structure generation tasks and consult experts to find out the prompt words that meet the requirements of article structure generation. The promo words can be "You are a very experienced document writing expert. Please generate the title outline of the article based on the input article title content. The article title is: xxxxxx" or "Generate a document outline based on the article title, xxxxx;". For example, after entering an article title as "XXX Development Department Special Report" and the Prompt prompt, the user enters the content "You are a very senior document writing expert. Please generate the title outline of the article based on the entered article title content. The article title is: XXX Development Department Special Report", and the article structure candidates generated according to the Prompt prompt are "0: XXX Development Department Special Report\n1: First, work results in the first half of the year;\n2: First, power grid planning;\n2: Second, service for new energy development;\n2: Third, early stage of the project;\n2: Fourth, research on the subject;\n1: Second, existing problems;\n2: (I) New energy development; 3: First, the sharp decline in the utilization rate of wind power and photovoltaics;\n3: Second, the difficulty of grid connection of coastal projects;\n3: Third, the disorderly development of distributed photovoltaics;\n2: (II) Power grid planning;\n2: (III) Distribution network development;\n".
[0067] Step 4.2: Regenerate the hierarchical content of subheadings in the article structure generation result: Generate prompt words for the article structure generation task through the prompt encoder technology. The prompt word for this task can be "Regenerate the hierarchical structure of subheadings in the article title outline generated above. The subheadings are: 2. Existing problems". You can continue to input content to supplement the article structure. The input content is "Regenerate the sub-title hierarchy structure in the article title outline generated above. The sub-title is: 2. Existing problems". The article structure generated according to the Prompt prompt is "0: XXX Development Department Special Report\n1: 1. Work results in the first half of the year;\n2: One is grid planning;\n2: Two is service for new energy development;\n2: Three is the early stage of the project;\n2: Four is the research project;\n1: 2. Existing problems;\n2: (a) New energy development; 3: One is the sharp decline in wind power and photovoltaic utilization rate;\n3: Two is the difficulty of grid connection for coastal projects;\n3: Three is the disorderly development of distributed photovoltaics;\n2: (b) Grid planning;\n2: (c) Distribution network development;\n2: (d) Early stage of the project;\n2: (v) Post-evaluation of grid infrastructure projects".
[0068] Step 4.3: Supplement the structural hierarchy of subtitles in the article structure generation result: Use Prompt Embedding technology to analyze the prompt words of the task of supplementing the structural hierarchy of subtitles, and find the promot prompt words that are suitable for supplementing the structural hierarchy of subtitles. The promot prompt word for this task can be "Supplement the subtitle hierarchy structure in the article title outline generated above. The subtitle is: (III) Distribution network development". After the article structure is generated, the subtitles in the article structure can be supplemented hierarchically. For example, if the input content is "Supplement the subtitle hierarchy structure in the article title outline generated above. The subtitle is: (III) Distribution network development", the article structure candidate generated according to the Prompt prompt word is "0: XXX Development Department Special Report\n1: 1. Work results in the first half of the year;\n2: One is the power grid planning;\n2: Two is the service for the development of new energy;\n2: Three is the early stage of the project;\n2: Four is the research on the subject Aspects;\n1: 2. Existing problems;\n2: (I) New energy development;\n3: First, the utilization rate of wind power and photovoltaic power has dropped significantly;\n3: Second, it is difficult to connect coastal projects to the grid;\n3: Third, the disorderly development of distributed photovoltaic power;\n2: (II) Power grid planning;\n2: (III) Distribution network development;\n3: First, there is a certain gap between development indicators and task goals.\n3: Second, the advancement of key demonstration projects is lagging behind.\n3: Third, investment control is not accurate enough, resulting in waste of investment quota.\n".
[0069] Step 4.4: Result level of newly added subtitles in the article structure generation result: Use prompt tuning technology to investigate the prompt words of the newly added subtitles and consult experts to find out the promo words that are suitable for regenerating the structure level results of the newly added subtitles. The promo word of this task can be "Add a first-level title to the article title outline generated above. The new title is: Work plan for the second half of the year, and fill the generated title structure into the generated article structure." After the article structure is generated, the structure of the full article can be adjusted. The input content is "Add a first-level title to the article title outline generated above. The new title is: Work plan for the second half of the year, and fill the generated title structure into the generated article structure." The article structure generated according to the Prompt content is "0: XXX Development Department Special Report\n1: First, the work results in the first half of the year;\n2: First, the power grid planning;\n2: Second, the service for the development of new energy;\n2: Third, the early stage of the project;\n2: Fourth, the research of the subject;\n1: Second, the existing problems;\n2: (I) New energy development;\n3: First, the benefits of wind power and photovoltaic The problem of a sharp decline in utilization rate; \n3: The second is the difficulty of connecting coastal projects to the grid; 3: The third is the disorderly development of distributed photovoltaics; \n2: (II) Grid planning; \n2: (III) Distribution network development; \n1: III. Key tasks in the second half of the year \n2: (I) Grid planning. \n3: First, take the initiative to plan in a forward position. \n3: Second, strengthen planning skills. \n2: (II) New power system. \n3: First, do our best to carry out research on major provincial projects. \n3: Second, give full play to our advantages to study key issues in regional development. \n3: Third, create a new power system demonstration. \n2: (III) Distribution network development. \n2: (IV) New energy. \n".
[0070] Step 5: The title structure generation and display algorithm calls the trained article structure generation model to parse the article title input by the user and generate candidate article structure results. For example, if the user inputs an article title as "XXX Development Department Special Report", the actual input content of the model after Prompt conversion is "0: XXX Development Department Special Report", and the article structure candidate generated according to the content after Prompt conversion is "0: XXX Development Department Special Report\n1: First, work results in the first half of the year;\n2: First, power grid planning;\n2: Second, service for new energy development;\n2: Third, early stage of the project;\n2: Fourth, research on the subject;\n1: Second, existing problems;\n2: (I) New energy development;\n3: First, the sharp decline in wind power and photovoltaic utilization rate;\n3: Second, the difficulty of grid connection of coastal projects;\n3: Third, the disorderly development of distributed photovoltaics;\n2: (II) Power grid planning;\n2: (III) Distribution network development;", the level label value in the generated article structure content text is used to divide the title level hierarchy, and displayed to the user in a tree-like graphic structure. You can also use the Prompt input in step 4.2 to step 4.4 to adjust the article structure display content of the generated article structure candidate results.
[0071] The present invention utilizes large model content generation technology, combined with keywords and subject information in the title, to deduce the general direction and subject scope of the first-level title, and derives a more specific and detailed second-level title based on the general direction of the first-level title. The title of an article is usually a general description of the theme of the entire article, while the first-level title is a more specific division and expansion of the article theme. The first-level title should provide more detailed content and subdivided topics around the title of the article. The first-level title is a specific division of the article theme, while the second-level title is a division of the more detailed content under the first-level title. The relationship between the article title and the first-level title is the relationship between the whole and the specific, and the relationship between the first-level title and the second-level title is the relationship between the general and the specific. The first-level title provides the general scope and direction of the theme, while the second-level title provides more specific and detailed content.
[0072] Embodiment 2
[0073] This embodiment provides a system for generating an article title structure.
[0074] A system for generating article title structure, comprising:
[0075] The data acquisition module is configured to: acquire the title structure information of the article, and label the title structure of the article according to the title level to obtain the title structure of different levels of the article;
[0076] The data enhancement module is configured to: construct a title hierarchy tree according to the article title structure label data; prune the leaf nodes in the title hierarchy tree, remove the leaf nodes of one or more tree branches, and obtain the first sub-title hierarchy tree; when the sub-nodes of the tree meet a certain range, extract all the sub-trees under the root node according to the situation of the middle branch sub-tree of the title hierarchy tree to obtain the second sub-title hierarchy tree; prune the sub-tree branches in the title hierarchy tree, remove one or more tree branches, and obtain the third sub-title hierarchy tree; construct a training sample set based on the first sub-title hierarchy tree, the second sub-title hierarchy tree and the third sub-title hierarchy tree; train the article structure generation model based on the training sample set;
[0077] The model training module is configured to: during the training process, use the prompt word to adjust the output result to obtain the article structure generation result that meets the requirements and the trained article structure generation model;
[0078] The title generation module is configured to: based on the input article title, use the trained article structure to generate a large model and output article structure candidate results.
[0079] It should be noted that the above data acquisition module, data enhancement module, model training module and title generation module are the same as the examples and application scenarios implemented by steps 1 to 5 in Embodiment 1, but are not limited to the contents disclosed in Embodiment 1. It should be noted that the above modules as part of the system can be executed in a computer system such as a set of computer executable instructions.
[0080] Embodiment 3
[0081] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps in the method for generating an article title structure as described in the first embodiment are implemented.
[0082] Embodiment 4
[0083] This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps in the article title structure generation method described in the first embodiment are implemented.
[0084] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0085] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0086] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0087] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0088] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0089] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for generating an article title structure, characterized in that: include: Obtain the title structure information of the article, and label the title structure of the article according to the title level to obtain the title structure of different levels of the article; According to the article title structure tag data, a title hierarchy tree is constructed; leaf nodes in the title hierarchy tree are pruned, and leaf nodes of one or more tree branches are removed to obtain the first sub-title hierarchy tree; when the sub-nodes of the tree meet a certain range, all sub-trees under the root node are extracted according to the sub-tree situation of the middle branch of the title hierarchy tree to obtain the second sub-title hierarchy tree; Prune the subtree branches in the title hierarchy tree, remove one or more tree branches, and obtain a third subtitle hierarchy tree; Based on the first subtitle hierarchy tree, the second subtitle hierarchy tree and the third subtitle hierarchy tree, construct a training sample set; Generate a large model based on the training sample set to train the article structure; During the training process, the output results are adjusted using prompt words to obtain article structure generation results that meet the requirements and the trained article structure generation model; Based on the input article title, the trained article structure is used to generate a large model and output candidate article structure results.
2. The method for generating article title structure according to claim 1, characterized in that: When the tree sub-nodes meet a certain range, the tree sub-nodes are greater than or equal to 5.
3. The article title structure generation method according to claim 1, characterized in that: If the level of the first subtitle hierarchy tree, the second subtitle hierarchy tree or the third subtitle hierarchy tree is greater than 2, the first subtitle hierarchy tree, the second subtitle hierarchy tree or the third subtitle hierarchy tree is pruned, otherwise, no processing is performed; Or, if the number of nodes based on the first subtitle hierarchy tree, the second subtitle hierarchy tree or the third subtitle hierarchy tree is greater than or equal to 5, the first subtitle hierarchy tree, the second subtitle hierarchy tree or the third subtitle hierarchy tree is pruned, otherwise, no processing is performed.
4. The article title structure generation method according to claim 1, characterized in that: The method of generating a large model by training article structure based on a training sample set includes: taking the lowest level structure labels and text content as training input data, and taking the high level structure labels and text content as training output results.
5. The article title structure generation method according to claim 1, characterized in that: The process of using the prompt words includes: investigating the prompt words for the article structure generation task and finding the prompt words that meet the article structure generation task in combination with expert suggestions.
6. The article title structure generation method according to claim 1, characterized in that: The process of using the prompt word also includes: processing the prompt words of the article structure generation task by using the prompt encoder technology to find the prompt words that are suitable for regenerating the structure level result of the hierarchical content of the subheading.
7. The article title structure generation method according to claim 1, characterized in that: The process of using the prompt words also includes: processing the prompt words of the task of supplementing the structural level of the subtitle by using the prompt embedding technology, and finding the prompt words that are suitable for supplementing the structural level of the subtitle in combination with the expert suggestions.
8. A system for generating article title structure, characterized in that: include: The data acquisition module is configured to: acquire the title structure information of the article, and label the title structure of the article according to the title level to obtain the title structure of different levels of the article; The data enhancement module is configured to: construct a title hierarchy tree according to the article title structure label data; Prune the leaf nodes in the title hierarchy tree, remove the leaf nodes of one or more tree branches, and obtain the first sub-title hierarchy tree; when the sub-nodes of the tree meet a certain range, extract all the sub-trees under the root node according to the sub-tree situation of the middle branch of the title hierarchy tree, and obtain the second sub-title hierarchy tree; Prune the subtree branches in the title hierarchy tree, remove one or more tree branches, and obtain a third subtitle hierarchy tree; Based on the first subtitle hierarchy tree, the second subtitle hierarchy tree and the third subtitle hierarchy tree, construct a training sample set; Generate a large model based on the training sample set to train the article structure; The model training module is configured to: during the training process, use the prompt word to adjust the output result to obtain the article structure generation result that meets the requirements and the trained article structure generation model; The title generation module is configured to: based on the input article title, use the trained article structure to generate a large model and output article structure candidate results.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps in the article title structure generation method according to any one of claims 1 to 7 are implemented.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps in the article title structure generation method according to any one of claims 1 to 7 are implemented.
