A text generation method, device, computer equipment and readable storage medium

By introducing a text quality assessment step and a multi-agent framework into the large language model, the problems of low text generation efficiency and poor consistency in existing technologies are solved, achieving efficient and automated text generation to meet users' professional needs.

CN122154634APending Publication Date: 2026-06-05GLODON CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GLODON CO LTD
Filing Date
2024-12-05
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing technologies struggle to meet users' specific needs when generating highly specialized and demanding texts in vertical fields, and their reliance on manual operation leads to low efficiency and poor content consistency and objectivity.

Method used

This paper introduces a text quality assessment step into the text generation model, generates high-quality text in a large language model through an iterative self-improvement algorithm, and achieves automated and optimized text generation by combining a multi-agent framework.

Benefits of technology

It improves the efficiency and accuracy of text generation, reduces the input of manpower and resources, and generates text that meets diverse needs and has high quality and consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122154634A_ABST
    Figure CN122154634A_ABST
Patent Text Reader

Abstract

The application discloses a text generation method and device, computer equipment and a readable storage medium. The text generation method comprises the following steps: obtaining an original text; inputting the original text into a pre-trained text generation model to obtain a text generation result; wherein the text generation result comprises a polished text of the original text and a text evaluation result of the polished text; inputting the text generation result into the text generation model to obtain a new text generation result; and generating a target text based on the polished text contained in the new text generation result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a data acquisition method, apparatus, computer device, and computer-readable storage medium. Background Technology

[0002] In current practice, text generation primarily relies on manual operation, which not only leads to low efficiency but also risks compromising the consistency and objectivity of the text content due to individual subjectivity. With the continuous advancement of artificial intelligence technology, especially in the field of natural language processing, large language models are increasingly being applied to automated text generation tasks to improve efficiency and reduce costs. While large language models excel at handling general-domain content, they often struggle to meet the specific needs of users when dealing with highly specialized and demanding texts in vertical domains.

[0003] To address the aforementioned issues, there is an urgent need to provide a universal, efficient, and flexible text generation solution that adapts to user needs. Summary of the Invention

[0004] The purpose of this invention is to provide a text generation method, apparatus, computer device, and computer-readable storage medium that can flexibly and efficiently generate text that meets user needs.

[0005] According to one aspect of the present invention, a text generation method is provided, the method comprising: Get the original text; The original text is input into a pre-trained text generation model to obtain a text generation result; wherein, the text generation result includes: the polished text of the original text and the text evaluation result of the polished text; The text generation result is input into the text generation model to obtain a new text generation result; The target text is generated based on the polished text contained in the new text generation result.

[0006] Optionally, generating the target text based on the polished text contained in the new text generation result includes: Get the current iteration conditions; If the current iteration condition reaches the preset stopping condition, the polished text contained in the new text generation result will be determined as the target text; If the current iteration condition does not meet the preset stopping condition, the new text generation result continues to be input into the text generation model until the preset stopping condition is met, and the latest polished text output by the text generation model is determined as the target text.

[0007] Optionally, obtaining the original text includes: Receive raw text input from the outside; or, The system receives text writing requirements from external sources and generates the original text based on these requirements and the text generation model.

[0008] Optionally, generating the original text based on the text writing requirements and the text generation model includes: A text table of contents outline is generated based on the aforementioned text writing requirements; wherein, the text table of contents outline includes a text table of contents and a content writing outline under each hierarchical heading in the text table of contents; The text generation model is used to generate initial drafts of content under corresponding hierarchical headings based on the outline described in the text generation model. The initial draft of the content under the hierarchical headings is polished to obtain the text content under the hierarchical headings; The original text is generated based on the text directory and the text content under each hierarchical heading in the text directory.

[0009] Optionally, refining the initial draft of the content under the hierarchical headings to obtain the text content under the hierarchical headings includes: Obtain a text sample that matches the text writing requirements; Each text sample is split into multiple first text blocks according to the preset first splitting rule; The first text block is split into multiple second text blocks according to the preset second splitting rule; The first draft of the content under the hierarchical heading is polished based on the second text block to obtain the text content under the hierarchical heading.

[0010] Optionally, splitting the first text block into multiple second text blocks according to a preset second splitting rule includes: Filter out the first text block that matches the content writing outline after splitting the first text block; Each selected first text block is split into multiple second text blocks according to the preset second splitting rule.

[0011] Optionally, the step of refining the initial draft of the content under the hierarchical heading based on the second text block to obtain the text content under the hierarchical heading includes: Extract keywords from the initial draft of the content; Filter out the second text blocks that match any one or more keywords after splitting the second text blocks; The first draft of the content under the selected second text block is polished to obtain the text content under the selected second text block.

[0012] To achieve the above objectives, the present invention further provides a text generation apparatus, characterized in that the apparatus comprises: The acquisition module is used to acquire the raw text; The first generation module is used to input the original text into a pre-trained text generation model to obtain a text generation result; wherein, the text generation result includes: the polished text of the original text and the text evaluation result of the polished text; The second generation module is used to input the text generation result into the text generation model to obtain a new text generation result; The third generation module is used to generate target text based on the polished text contained in the new text generation result. To achieve the above objective, the present invention also provides a computer device, the computer device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the steps of the text generation method described above.

[0013] To achieve the above objectives, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is used to implement the steps of the text generation method described above.

[0014] The text generation method of this invention introduces a text quality assessment process into the text generation model, enabling the model to have a self-assessment function. It can evaluate the generated draft according to preset evaluation dimensions and automatically revise the content based on this evaluation. By employing an iterative improvement algorithm, it ensures that after multiple rounds of self-assessment and revision, the text output by the model reaches a higher quality standard, meeting diverse writing needs while significantly reducing the input of human resources and materials. Attached Figure Description

[0015] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 A flowchart of the text generation method provided in Embodiment 1; Figure 2 A schematic diagram of the text generation model provided in Example 1; Figure 3 A flowchart of the semi-automated text generation scheme provided in Example 1; Figure 4 This is a functional diagram of each module in the text generation process provided in Example 1; Figure 5 A block diagram of the text generation apparatus provided in Embodiment 2; Figure 6 A block diagram of a computer device suitable for implementing the text generation method, provided in Embodiment 3. Detailed Implementation

[0016] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without inventive effort are within the scope of protection of this invention.

[0017] Current Large Language Models (LLMs) can generate coherent output, but they often fall short in tasks such as long text output and writing. Against this backdrop, a simple solution is to first have the LLM generate an understandable initial draft, and then iteratively improve it to ensure the final draft reaches the expected quality, thus serving as a text correction tool. Iterative improvement is a fundamental feature in problem-solving. Iterative self-improvement is a process that involves creating an initial draft and then refining it based on self-provided feedback. For example, when writing code, programmers might implement an initial "quick and dirty" solution, and after reflection, refactor their code into a more efficient and readable solution. This invention provides iterative self-improvement through LLM without additional training, thereby generating higher quality output across a wide range of tasks. Specifically, this invention introduces a text quality assessment step based on the text generation framework concept SELF-REFINE (an iterative self-improvement algorithm that alternates between two generation steps—feedback and improvement). These steps work together to generate high-quality output. Detailed implementation steps are described in the following embodiments.

[0018] Example 1 This invention provides a text generation method, such as... Figure 1 As shown, the method includes steps S1 to S5, wherein: Step S1: Obtain the original text.

[0019] The original text is in need of polishing and improvement.

[0020] Step S2: Input the original text into a pre-trained text generation model to obtain the text generation result; wherein, the text generation result includes: the polished text of the original text and the text evaluation result of the polished text.

[0021] The text generation model is a large language model, featuring text polishing and text quality assessment functions. The text polishing function modifies and refines the input text; the text quality assessment function evaluates the text quality based on predefined text evaluation rules. These rules specifically include: rules for evaluating text syntax, rules for evaluating text semantics, rules for evaluating text context coherence, and so on. The polished text is the text obtained after modifying and polishing the input text of the text generation model, and the text evaluation result is the result of assessing the quality of the polished text.

[0022] Step S3: Input the text generation result into the text generation model to obtain a new text generation result.

[0023] The new text generation results include: new polished text and new text evaluation results; wherein, the new polished text is the text obtained after polishing the original text, and the new text evaluation results are the results obtained after evaluating the quality of the new polished text.

[0024] Step S4: Generate the target text based on the polished text contained in the new text generation result.

[0025] If the new polished text meets the requirements, then the new polished text is directly used as the target text; otherwise, the new polished text continues to be modified and polished based on the text generation model.

[0026] In this embodiment, the original text is used as the initial output of the text generation model, and the original text is passed back to the text generation model to obtain feedback. This feedback is then passed back to the text generation model to improve the previously generated draft. This process is repeated until a specified number of iterations is reached or the text generation model determines that no further improvement is needed. The specific idea is as follows: Figure 2 As shown, this embodiment introduces a quality assessment step into the original SELF-REFINE framework, specifically a text quality assessment step after the model generates the initial output. Subsequently, the text assessment result is combined with the initial output and input into the process. This improvement aims to further enhance text quality. Experimental results also confirm that, after adding the text quality assessment step, the text quality generated by the improved SELF-REFINE is significantly better than the original process, which did not include a text quality assessment step.

[0027] As an optional embodiment, generating the target text based on the polished text contained in the new text generation result includes: Get the current iteration conditions; If the current iteration condition reaches the preset stopping condition, the polished text contained in the new text generation result will be determined as the target text; If the current iteration condition does not meet the preset stopping condition, the new text generation result continues to be input into the text generation model until the preset stopping condition is met, and the latest polished text output by the text generation model is determined as the target text.

[0028] The current iteration conditions include: the current iteration number and / or the text evaluation result of the latest polished text. Preset stopping conditions include: the current iteration number has reached the preset iteration number and / or the quality of the latest polished text has met the preset quality requirements.

[0029] This embodiment uses few-shot prompts to guide the text generation model in generating feedback and incorporates the feedback into the improved draft, thereby achieving the goal of providing iterative self-improvement without additional training of the text generation model, and thus producing higher quality output in a wide range of tasks.

[0030] As an optional embodiment, obtaining the original text includes: Receive raw text input from the outside; or, The system receives text writing requirements from external sources and generates the original text based on these requirements and the text generation model.

[0031] This invention employs a semi-automated text generation method, whereby the user pre-generates original text, and this invention modifies the original text to obtain the target text desired by the user. For example... Figure 3 As shown, after receiving the original text, it is broken down into sections according to the chapter outline. Then, the model's retrieval, generation, and dialogue understanding capabilities are used to assist humans in efficiently completing the task. This generation method is highly efficient, and humans can calibrate the content generated by the model in real time, reducing the possibility of errors. Furthermore, the document structure and content can be dynamically adjusted according to actual needs, making the generated document more suitable for specific requirements. Simultaneously, it can be integrated with other management tools to achieve data interoperability, further improving writing efficiency.

[0032] This invention also employs a fully automated text generation method, which automatically generates raw text based on text writing requirements through a text generation model. These requirements include the text title and the user's specific needs for the text content. The entire workflow of this fully automated text generation method is constructed collaboratively by multiple intelligent agents, each with its own function: Agent A is responsible for refining and breaking down the outline, Agent B is responsible for collecting and retrieving external information, and Agent C focuses on creating specific text paragraphs. The entire process is fully automated, requiring no human intervention; AI can efficiently complete the writing of the construction plan, and humans only need to perform final verification and adjustments.

[0033] As an optional embodiment, generating the original text based on the text writing requirements and the text generation model includes: A text table of contents outline is generated based on the aforementioned text writing requirements; wherein, the text table of contents outline includes a text table of contents and a content writing outline under each hierarchical heading in the text table of contents; The text generation model is used to generate initial drafts of content under corresponding hierarchical headings based on the outline described in the text generation model. The initial draft of the content under the hierarchical headings is polished to obtain the text content under the hierarchical headings; The original text is generated based on the text directory and the text content under each hierarchical heading in the text directory.

[0034] The content writing outline is used to limit the scope of text content writing under the corresponding hierarchical headings; the original text includes the text headings, text table of contents, and text content under each hierarchical heading in the text table of contents as specified in the text writing requirements; the text content under each hierarchical heading is the content obtained after polishing the initial draft of the content under that hierarchical heading.

[0035] In this embodiment, for each hierarchical heading, the following steps are performed: "Generate a draft of the content under the corresponding hierarchical heading using the text generation model according to the content writing outline; polish the draft of the content under the hierarchical heading to obtain the text content under the hierarchical heading".

[0036] The specific steps for automatically generating the original text are as follows: First, a text outline is generated based on the text writing requirements. Specifically, the system receives core writing information from the user, such as the topic and specific needs. This key data is accurately transmitted to the task planning module, whose core responsibility is to meticulously conceive and write a detailed article outline based on the user's personalized requirements. Considering the complexity and hierarchy of the article structure, the outline will not simply be a series of titles, but a hierarchical structure containing nested subheadings. Therefore, the task planning module transforms this outline information into a tree structure, ensuring that the content at each level is clearly and orderly presented, thus providing a well-organized and logically clear framework for subsequent text generation. This structured processing not only facilitates collaboration between agents but also greatly improves the efficiency and quality of article creation, resulting in an article that not only meets user needs but also possesses good readability and structure.

[0037] Secondly, the system responsible for coordinating task scheduling will first add first-level headings to the cache queue. When processing first-level headings containing second-level headings, the system will adopt a "general-to-specific" writing pattern. Specifically, the system will first outline the overall writing logic under the first-level heading, providing readers with a macro perspective. Subsequently, for each second-level heading, the system will elaborate on its writing guidelines, ensuring that the content of each sub-topic closely revolves around the core idea of ​​the first-level heading, while maintaining the coherence and logic of the article. This hierarchical scheduling method not only optimizes the clarity of the article structure but also improves the efficiency and quality of the writing process.

[0038] Secondly, the text content for each hierarchical heading needs to be generated based on the retrieved text samples. Specifically, the retrieval module first performs a preprocessing stage for the text samples. This stage includes coarsely dividing the text samples into n larger text blocks, and then further subdividing these text blocks into multiple smaller text blocks. Next is query relevance analysis. This stage compares the content outline under the hierarchical heading with the coarse-grained text blocks. The text generation model traverses each coarse-grained text block to determine its relevance to the content outline. If it is relevant, it is marked as true; otherwise, it is marked as false. For text blocks marked as true, they are divided into smaller-grained text blocks. The text generation model generates a draft of the content under the corresponding hierarchical heading based on the content outline, extracts Chinese and English keywords from the draft, and filters matching results from the fine-grained text blocks based on these keywords. Finally, these results and the draft content are combined to form the text content for the corresponding hierarchical heading. The specific steps for generating the text content under each hierarchical heading can be found in the following embodiments.

[0039] As an optional embodiment, refining the initial draft of the content under the hierarchical headings to obtain the text content under the hierarchical headings includes: Obtain a text sample that matches the text writing requirements; Each text sample is split into multiple first text blocks according to the preset first splitting rule; The first text block is split into multiple second text blocks according to the preset second splitting rule; The first draft of the content under the hierarchical heading is polished based on the second text block to obtain the text content under the hierarchical heading.

[0040] Among them, text samples matching the text writing requirements can be obtained from a local database, and / or obtained from the Internet.

[0041] When splitting the first text block, each first text block can be split into multiple second text blocks, or some first text blocks can be split into multiple second text blocks. As an optional embodiment, splitting the first text block into multiple second text blocks according to a preset second splitting rule includes: selecting first text blocks from the split first text blocks that match the content writing outline; and splitting each selected first text block into multiple second text blocks according to the preset second splitting rule. The first splitting rule and the second splitting rule can be the same rule or different rules. For example, the first splitting rule may be to split by paragraph, and the second splitting rule may be to split by whole sentence.

[0042] When refining the initial draft of content, the second text block can be directly merged with the initial draft, and the merged content can be used as the text content under the hierarchical heading; or the initial draft can be modified based on the second text block, and the modified content can be used as the text content under the hierarchical heading. As an optional embodiment, refining the initial draft of content under the hierarchical heading based on the second text block to obtain the text content under the hierarchical heading includes: Extract keywords from the initial draft of the content; Filter out the second text blocks that match any one or more keywords after splitting the second text blocks; The first draft of the content under the selected second text block is polished to obtain the text content under the selected second text block.

[0043] Alternatively, the selected second text block can be merged with the initial draft of the content under the hierarchical heading, and the merged content can be used as the text content under the hierarchical heading; or, the selected second text block can be used to modify the initial draft of the content under the hierarchical heading, and the modified content can be used as the text content under the hierarchical heading.

[0044] This invention aims to address the problems of tedious and mechanical manual text writing, the inability of existing models to meet user needs, and the high cost of training specific models. By introducing a professional text generation method, text can be generated with a single click, thereby improving the efficiency and accuracy of text writing and reducing manual workload and training costs. Furthermore, this invention automates and optimizes text generation by employing a multi-agent framework; by encoding standardized operating procedures into prompt sequences, it not only optimizes the workflow but also effectively reduces errors. In addition, this text generation framework adopts a pipeline model, decomposing complex tasks into multiple sub-tasks for collaborative text writing. Through this collaborative writing approach, the multi-agent framework not only improves text writing efficiency but also enhances the accuracy and reliability of reports through standardized operations. Since each revision remembers the previous draft, the entire article flows smoothly and naturally. This innovative method provides a new solution for text generation, contributing to improved efficiency and effectiveness in text generation processing.

[0045] The algorithm proposed in this application consists of three parts: a tool module, a retrieval module, and a large-scale model understanding and generation module. These three modules work together to form a complete system designed to solve specific problems or provide efficient services. The three modules collaborate to create an efficient and intelligent algorithm. The tool module provides basic support, the retrieval module quickly and accurately finds relevant information, and the large-scale model understanding and generation module is responsible for understanding and generating high-quality output. In this way, the entire system can provide efficient and intelligent services to meet user needs. The functions of each module are as follows: Figure 4 As shown: The tools module provides various auxiliary tools and functions to support the efficient operation of the entire algorithm. For example, it includes: a data preprocessing tool for cleaning and organizing input data; this tool performs operations such as cleaning, deduplication, and filling in missing values ​​to improve data quality and provide an accurate and complete data foundation for subsequent algorithm processing. A data storage tool for storing and managing large amounts of data; this tool efficiently stores and manages large amounts of data, supporting various data structures such as databases and file systems to facilitate data retrieval, updating, and deletion operations, while ensuring data security and consistency. A file parsing tool for parsing various local file formats; this tool has the ability to parse various local file formats, such as text, CSV, Excel, and JSON, achieving data format conversion and unification for easier subsequent algorithm processing. A web search tool for mining effective knowledge information from the internet; this tool can mine effective knowledge information from the internet, including but not limited to academic papers, technical blogs, and news reports, providing rich external data support for the algorithm. With these diverse auxiliary tools, this module aims to provide stable and reliable support for other modules, ensuring the smooth operation of the entire system in multiple stages such as data processing, storage, parsing, and searching, and providing users with efficient, easy-to-use, and visualized algorithm services.

[0046] The primary task of the retrieval module is to retrieve and filter relevant information to meet user needs. This may include search engines, database query tools, or other information retrieval technologies. The goal of the retrieval module is to quickly and accurately find the information the user needs from large amounts of data and provide it to subsequent processing modules. To improve retrieval efficiency, the retrieval module may employ various optimization techniques, such as indexing, caching, and parallel processing. In experiments, the multi-agent system demonstrated both advantages and limitations in text generation. It performed well in terms of ethics and safety, producing no biased or harmful content and meeting basic requirements. In terms of content quality, it accurately extracted key information and generated objective and professional text that conformed to standards.

[0047] The large model's understanding and generation module can mimic human writing processes, from initial drafting to evaluation and feedback, then to revision, until the desired quality is achieved.

[0048] Compared to existing technologies, the intelligent writing system of this invention provides a more efficient, flexible, and cost-effective text writing solution. Through an automated writing process and an iterative self-improvement mechanism, this invention can generate high-quality documents, meeting diverse writing needs while significantly reducing the investment of manpower and resources. This invention can also greatly reduce the investment enterprises make in training models. The improved model generates text that fully covers the content provided by the user-input outline, and includes substantial content expansion and reasonable reasoning, achieving the accuracy required by users.

[0049] Example 2 This invention provides a text generation device, such as... Figure 5 As shown, the text generation device 50 specifically includes the following components: Module 501 is used to acquire raw text; The first generation module 502 is used to input the original text into a pre-trained text generation model to obtain a text generation result; wherein, the text generation result includes: the polished text of the original text and the text evaluation result of the polished text; The second generation module 503 is used to input the text generation result into the text generation model to obtain a new text generation result; The third generation module 504 is used to generate target text based on the polished text contained in the new text generation result.

[0050] Optionally, the third generation module is specifically used for: Get the current iteration conditions; If the current iteration condition reaches the preset stopping condition, the polished text contained in the new text generation result will be determined as the target text; If the current iteration condition does not meet the preset stopping condition, the new text generation result continues to be input into the text generation model until the preset stopping condition is met, and the latest polished text output by the text generation model is determined as the target text.

[0051] Optionally, the acquisition module is specifically used for: Receive raw text input from the outside; or, The system receives text writing requirements from external sources and generates the original text based on these requirements and the text generation model.

[0052] Optionally, when the acquisition module generates the original text based on the text writing requirements and the text generation model, it is specifically used for: A text table of contents outline is generated based on the aforementioned text writing requirements; wherein, the text table of contents outline includes a text table of contents and a content writing outline under each hierarchical heading in the text table of contents; The text generation model is used to generate initial drafts of content under corresponding hierarchical headings based on the outline described in the text generation model. The initial draft of the content under the hierarchical headings is polished to obtain the text content under the hierarchical headings; The original text is generated based on the text directory and the text content under each hierarchical heading in the text directory.

[0053] Optionally, when the acquisition module performs the polishing of the initial draft of the content under the hierarchical heading to obtain the text content under the hierarchical heading, it is specifically used for: Obtain a text sample that matches the text writing requirements; Each text sample is split into multiple first text blocks according to the preset first splitting rule; The first text block is split into multiple second text blocks according to the preset second splitting rule; The first draft of the content under the hierarchical heading is polished based on the second text block to obtain the text content under the hierarchical heading.

[0054] Optionally, when the acquisition module performs the step of splitting the first text block into multiple second text blocks according to a preset second splitting rule, it is specifically used for: Filter out the first text block that matches the content writing outline after splitting the first text block; Each selected first text block is split into multiple second text blocks according to the preset second splitting rule.

[0055] Optionally, when the acquisition module performs the polishing of the initial draft of the content under the hierarchical heading based on the second text block to obtain the text content under the hierarchical heading, it is specifically used for: Extract keywords from the initial draft of the content; Filter out the second text blocks that match any one or more keywords after splitting the second text blocks; The first draft of the content under the selected second text block is polished to obtain the text content under the selected second text block.

[0056] Example 3 This embodiment also provides a computer device, such as a smartphone, tablet computer, laptop computer, desktop computer, rack server, blade server, tower server, or cabinet server (including a standalone server or a server cluster composed of multiple servers), etc., capable of executing programs. Figure 6 As shown, the computer device 60 in this embodiment includes, but is not limited to, a memory 601 and a processor 602 that are communicatively connected to each other via a system bus. It should be noted that... Figure 6 Only a computer device 60 with components 601-602 is shown; however, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0057] In this embodiment, the memory 601 (i.e., the readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 601 may be an internal storage unit of the computer device 60, such as the hard disk or memory of the computer device 60. In other embodiments, the memory 601 may also be an external storage device of the computer device 60, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 60. Of course, the memory 601 may include both the internal storage unit and the external storage device of the computer device 60. In this embodiment, the memory 601 is typically used to store the operating system and various application software installed on the computer device 60. In addition, the memory 601 may also be used to temporarily store various types of data that have been output or will be output.

[0058] In some embodiments, processor 602 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. This processor 602 is typically used to control the overall operation of the computer device 60.

[0059] Specifically, in this embodiment, the processor 602 is used to execute the program of the text generation method stored in the memory 601. When the program of the text generation method is executed, it performs the following steps: Get the original text; The original text is input into a pre-trained text generation model to obtain a text generation result; wherein, the text generation result includes: the polished text of the original text and the text evaluation result of the polished text; The text generation result is input into the text generation model to obtain a new text generation result; The target text is generated based on the polished text contained in the new text generation result.

[0060] For a detailed description of the above method steps, please refer to Example 1. This example will not be repeated here.

[0061] Example 4 This embodiment also provides a computer-readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, server, app store, etc., which stores a computer program. When the computer program is executed by a processor, it implements the following method steps: Get the original text; The original text is input into a pre-trained text generation model to obtain a text generation result; wherein, the text generation result includes: the polished text of the original text and the text evaluation result of the polished text; The text generation result is input into the text generation model to obtain a new text generation result; The target text is generated based on the polished text contained in the new text generation result.

[0062] For a detailed description of the above method steps, please refer to Example 1. This example will not be repeated here.

[0063] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0064] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0065] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0066] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A text generation method, characterized in that, The method includes: Get the original text; The original text is input into a pre-trained text generation model to obtain a text generation result; wherein, the text generation result includes: the polished text of the original text and the text evaluation result of the polished text; The text generation result is input into the text generation model to obtain a new text generation result; The target text is generated based on the polished text contained in the new text generation result.

2. The method according to claim 1, characterized in that, The step of generating target text based on the polished text contained in the new text generation result includes: Get the current iteration conditions; If the current iteration condition reaches the preset stopping condition, the polished text contained in the new text generation result will be determined as the target text; If the current iteration condition does not meet the preset stopping condition, the new text generation result continues to be input into the text generation model until the preset stopping condition is met, and the latest polished text output by the text generation model is determined as the target text.

3. The method according to claim 1, characterized in that, The process of obtaining the original text includes: Receive raw text input from the outside; or, The system receives text writing requirements from external sources and generates the original text based on these requirements and the text generation model.

4. The method according to claim 3, characterized in that, The process of generating the original text based on the text writing requirements and the text generation model includes: A text table of contents outline is generated based on the aforementioned text writing requirements; wherein, the text table of contents outline includes a text table of contents and a content writing outline under each hierarchical heading in the text table of contents; The text generation model is used to generate initial drafts of content under corresponding hierarchical headings based on the outline described in the text generation model. The initial draft of the content under the hierarchical headings is polished to obtain the text content under the hierarchical headings; The original text is generated based on the text directory and the text content under each hierarchical heading in the text directory.

5. The method according to claim 4, characterized in that, The process of refining the initial draft of the content under the hierarchical headings to obtain the text content under the hierarchical headings includes: Obtain a text sample that matches the text writing requirements; Each text sample is split into multiple first text blocks according to the preset first splitting rule; The first text block is split into multiple second text blocks according to the preset second splitting rule; The first draft of the content under the hierarchical heading is polished based on the second text block to obtain the text content under the hierarchical heading.

6. The method according to claim 5, characterized in that, The step of splitting the first text block into multiple second text blocks according to a preset second splitting rule includes: Filter out the first text block that matches the content writing outline after splitting the first text block; Each selected first text block is split into multiple second text blocks according to the preset second splitting rule.

7. The method according to claim 5, characterized in that, The step of refining the initial draft of the content under the hierarchical heading based on the second text block to obtain the text content under the hierarchical heading includes: Extract keywords from the initial draft of the content; Filter out the second text blocks that match any one or more keywords after splitting the second text blocks; The first draft of the content under the selected second text block is polished to obtain the text content under the selected second text block.

8. A text generation device, characterized in that, The device includes: The acquisition module is used to acquire the raw text; The first generation module is used to input the original text into a pre-trained text generation model to obtain a text generation result; wherein, the text generation result includes: the polished text of the original text and the text evaluation result of the polished text; The second generation module is used to input the text generation result into the text generation model to obtain a new text generation result; The third generation module is used to generate target text based on the polished text contained in the new text generation result.

9. A computer device, the computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it is used to implement the steps of the method according to any one of claims 1 to 7.