Text generation method and apparatus, and device and storage medium

By generating the text content of chapter blocks and assembling it into the target text, the problem of text generation being limited by the number of tokens was solved, enabling continuous output and high-quality generation of long texts, thus improving the user experience.

WO2026085670A1PCT designated stage Publication Date: 2026-04-30BAIDU ONLINE NETWORK TECH (BEIJIBG) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
BAIDU ONLINE NETWORK TECH (BEIJIBG) CO LTD
Filing Date
2024-10-21
Publication Date
2026-04-30

AI Technical Summary

Technical Problem

In existing technologies, text generation relies on the quality of prompt words, resulting in a poor user experience, and is limited by the number of tokens, leading to the failure of long text generation.

Method used

By acquiring initial input information, a target outline containing multiple chapter blocks is generated, and the text content of each chapter block is generated concurrently. Finally, the target text is assembled, avoiding the token quantity limit.

Benefits of technology

It enables continuous output of long texts, meeting users' diverse and personalized text generation needs and improving user experience and text quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024126230_30042026_PF_FP_ABST
    Figure CN2024126230_30042026_PF_FP_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of data processing, and in particular to the technical fields such as artificial intelligence, deep learning and large models. Provided are a text generation method and apparatus, and a device and a storage medium. The specific implementation solution comprises: acquiring initial input information; on the basis of the initial input information, obtaining a target outline, wherein the target outline comprises at least N section blocks, and N is an integer greater than or equal to 2; obtaining textual content of each of the N section blocks; and on the basis of the textual content of each of the N section blocks, obtaining target text.
Need to check novelty before this filing date? Find Prior Art

Description

Text generation methods, apparatus, devices, and storage media Technical Field

[0001] This application relates to the field of data processing technology, and in particular to the fields of artificial intelligence, deep learning, and large models. Background Technology

[0002] In current text generation scenarios, the quality of input prompts is often crucial, which is costly for ordinary users. Furthermore, directly generating long text based on input prompts is limited by the number of tokens available, potentially leading to long text generation failures and a degraded user experience.

[0003] Summary of the Invention

[0004] This disclosure provides a text generation method, apparatus, device, and storage medium.

[0005] According to one aspect of this disclosure, a text generation method is provided, comprising:

[0006] Obtain the initial input information;

[0007] Based on the initial input information, a target outline is obtained; wherein the target outline contains at least N chapter blocks; N is an integer greater than or equal to 2;

[0008] Obtain the text content of each chapter block in the N chapter blocks;

[0009] The target text is obtained based on the text content of each chapter block in the N chapter blocks.

[0010] According to another aspect of this disclosure, a text generation apparatus is provided, comprising:

[0011] The acquisition unit is used to acquire initial input information;

[0012] A text processing unit is configured to obtain a target outline based on the initial input information; wherein the target outline contains at least N chapter blocks; N is an integer greater than or equal to 2; obtain the text content of each chapter block in the N chapter blocks; and obtain the target text based on the text content of each chapter block in the N chapter blocks.

[0013] According to another aspect of this disclosure, an electronic device is provided, comprising:

[0014] At least one processor; and

[0015] The memory is communicatively connected to the at least one processor; wherein,

[0016] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform any of the methods described in the present disclosure.

[0017] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform any of the methods according to embodiments of this disclosure.

[0018] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements any of the methods according to embodiments of this disclosure.

[0019] In this way, the present solution can use the obtained initial input information to obtain a target outline containing N chapter blocks, and first generate the text content of the chapter blocks. For example, it can generate the text content of each chapter block concurrently, and then assemble the target text based on the text content of each chapter block. Since the present solution can first generate the text content of each chapter block and then assemble the target text based on the text content of each chapter block, it can effectively avoid the problem of token quantity limitation. In other words, the present solution can make text generation no longer limited by the number of tokens. Thus, it effectively realizes the continuous output of long text, meets the diverse and personalized text generation needs of users, and effectively improves the user experience.

[0020] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0021] Figure 1 is a schematic flowchart of a text generation method according to an embodiment of this application.

[0022] Figure 2 is a schematic diagram of a scenario in a specific example of a text generation method according to an embodiment of this application.

[0023] Figure 3 is a schematic flowchart of a text generation method according to an embodiment of this application.

[0024] Figure 4 is a schematic diagram illustrating the effect of the target outline according to an embodiment of this application.

[0025] Figure 5 is a schematic diagram showing the effect of the target outline according to an embodiment of this application.

[0026] Figure 6 is a schematic illustration of the regeneration operation of the target outline according to an embodiment of this application.

[0027] Figure 7 is a schematic illustration of further operations for a target outline according to an embodiment of this application.

[0028] Figure 8 is a schematic illustration of the regeneration operation of the target outline according to an embodiment of this application.

[0029] Figure 9 is a schematic flowchart of a text generation method according to an embodiment of this application.

[0030] Figure 10 is a schematic flowchart of a text generation method according to an embodiment of this application.

[0031] Figure 11 is a schematic flowchart of a text generation method according to an embodiment of this application.

[0032] Figure 12 is a schematic diagram of the text generation process of a chapter block according to an embodiment of this application.

[0033] Figure 13 is a schematic flowchart of a text generation method according to an embodiment of this application.

[0034] Figure 14(a) is a schematic illustration of an embodiment of the present application where block segmentation is not required.

[0035] Figure 14(b) is a schematic illustration of the block segmentation process required according to an embodiment of this application.

[0036] Figure 15 is a flowchart illustrating a text generation method according to an embodiment of this application in a specific example.

[0037] Figure 16 is a schematic diagram of the structure of a text generation device according to an embodiment of this application.

[0038] Figure 17 is a block diagram of an electronic device used to implement the text generation method of the present disclosure. Detailed Implementation

[0039] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0040] In this document, the term "and / or" merely describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. The term "at least one" in this document indicates any combination of at least two of a plurality of elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C. The terms "first" and "second" in this document refer to and distinguish between multiple similar technical terms, not to restrict the order or to limit there to only two. For example, "first feature" and "second feature" refer to two categories / two features; the first feature can be one or more, and the second feature can also be one or more.

[0041] Furthermore, to better illustrate this disclosure, numerous specific details are set forth in the following detailed description. Those skilled in the art will understand that this disclosure can still be practiced even without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of this disclosure.

[0042] The following describes the related technologies of the embodiments of this disclosure. The following related technologies are optional solutions and can be combined with the technical solutions of the embodiments of this disclosure in any way, and they all fall within the protection scope of the embodiments of this disclosure.

[0043] This disclosure provides a text generation method that frees text generation from the limitations of the number of tokens, thus enabling the continuous output of high-quality long text, meeting users' actual needs for long text generation, and thereby improving user experience.

[0044] Specifically, Figure 1 is a schematic flowchart of a text generation method according to an embodiment of this application. This method can be optionally applied to electronic devices, such as personal computers, servers, server clusters, and other electronic devices.

[0045] Furthermore, the method includes at least a portion of the following. As shown in Figure 1, it includes:

[0046] Step S101: Obtain initial input information.

[0047] In one example, the initial input information may at least include the core content of the text to be generated and the text requirements, so that the target text that meets the user's needs can be generated based on the initial input information.

[0048] Step S102: Based on the initial input information, obtain the target outline.

[0049] Here, in one example, the target outline contains at least N chapter blocks, where N is an integer greater than or equal to 2.

[0050] Furthermore, in another example, the target outline also includes the initial topic of the text to be generated. That is, in one example, the present disclosure can obtain a target outline containing an initial topic and N chapter blocks based on the initial input information input by the target object, thus providing strong support for subsequent long text generation.

[0051] Step S103: Obtain the text content of each chapter block in the N chapter blocks.

[0052] For example, in one example, the text content of each chapter block can be obtained concurrently. In this way, compared with directly generating long text, this method can effectively avoid the problem of token quantity limitation.

[0053] Step S104: Obtain the target text based on the text content of each chapter block in the N chapter blocks.

[0054] For example, in one example, the outline structure of the target outline assembles the text content of each chapter block to obtain the target text.

[0055] In this way, the present solution can use the obtained initial input information to obtain a target outline containing N chapter blocks, and first generate the text content of the chapter blocks. For example, it can generate the text content of each chapter block concurrently, and then assemble the target text based on the text content of each chapter block. Since the present solution can first generate the text content of each chapter block and then assemble the target text based on the text content of each chapter block, it can effectively avoid the problem of token quantity limitation. In other words, the present solution can make text generation no longer limited by the number of tokens. Thus, it effectively realizes the continuous output of long text, meets the diverse and personalized text generation needs of users, and effectively improves the user experience.

[0056] In addition, since this disclosed solution first obtains a target outline containing multiple chapter blocks, and then generates target text based on the target outline, it effectively ensures that the generated text has a clear organizational structure, and the generated content is more organized and systematic, thereby improving the text quality of the generated text and further enhancing the user experience.

[0057] For example, as shown in Figure 2, the initial input information is first obtained and displayed. For instance, the initial text information entered by the target object is obtained from the text prompt input box. This initial text information can serve as the "topic" of the text to be generated subsequently. It should be noted that this initial text information can be directly entered by the target object or obtained from a file imported by the target object; this disclosure does not impose any restrictions. Secondly, a target outline containing an initial topic, chapter block 1, chapter block 2, chapter block 3, and chapter block 4 is generated based on the initial input information and displayed. Finally, the text content of each chapter block in the target outline is generated to obtain the target text, which is then displayed. As shown in Figure 2, a visual progress indicator for "topic-outline-text generation" can also be displayed on the interface. This allows the target object to perceive the current progress in real time, effectively improving the user's sense of control and thus enhancing the user experience.

[0058] It should be noted that this disclosed solution does not impose specific restrictions on the initial input information entered by the target object. In other words, this disclosed solution does not restrict the text type of the generated target text. This enriches the usage scenarios and further meets the personalized and customized needs of users, thereby further improving the user experience.

[0059] In a specific example of the disclosed solution, the initial input information is obtained based on the form input box displayed on the display interface.

[0060] Furthermore, in a specific example, the form input box displays at least one of the following:

[0061] The first prompt area is used to guide the target user to input the core content of the text to be generated (such as the text topic);

[0062] The second prompt area is used to guide the target object to input the text requirements (such as word count, font, and other text constraints) to generate the desired text.

[0063] For example, in one example, the shown form input boxes include input box 1 (corresponding to the first prompt area above) for guiding the target object to input the core content of the text to be generated (corresponding to the core content mentioned above), and input box 2 (corresponding to the second prompt area above) for guiding the target object to input the text constraints of the text to be generated (corresponding to the text requirements mentioned above). Thus, by prompting the target object to input relevant information about the text to be generated from different dimensions through form input boxes, compared to directly inputting a complete prompt message, the target object can input based on the guidance of the form input boxes. This effectively reduces the requirements for the target object and lays the foundation for the subsequent generated text to meet the user's needs.

[0064] It should be noted that the dimensions of information required for form input boxes can be determined based on actual needs. For example, they can be set based on the degree to which the quality of the generated text depends on the dimensions of the input information. For instance, information dimensions with a higher degree of dependence than a preset value can be used as the input items required by the form input box. This can further lay the foundation for improving the quality of the generated text.

[0065] In this way, the disclosed solution can obtain key information for text generation using form input boxes, thereby obtaining the target text required by the target object. This simplifies the input process for the target object and effectively improves the efficiency of information collection, laying the foundation for improving the quality of the generated text in the future, and also laying the foundation for ensuring that the generated text content better meets the user's needs.

[0066] Furthermore, in a specific example, the text requirements include at least one of the following: word count requirements, and citation requirements used to constrain the way references are cited.

[0067] For example, text constraints can be further subdivided into word count and citation requirements. In one example, besides input box 1 (guiding the target user to input the core content of the generated text), the form input boxes also display input box 21 (guiding the target user to input citation requirements) and input box 22 (requiring a specific word count for the generated text). This satisfies the user's customized text generation needs, further improves information collection efficiency, and lays the foundation for improving the quality of the generated text, thus ensuring that the generated text content better meets the user's needs.

[0068] It should be noted that the word count requirement in this public proposal may specifically refer to no less than 1,500 words, or, more specifically, no less than 3,000 words.

[0069] It should be noted that the term "character" as used above can specifically refer to "word" or "Chinese character," and this public scheme does not impose any specific restrictions on it.

[0070] Furthermore, in another specific example, the word count requirement in this disclosed solution may also specifically include word count ranges. For example, in one example, multiple word count ranges can be provided through a "menu," such as: [1000, 1500], [1500, 3000], [3000, 7000], [7000, 10000], [10000, 12000], etc. Or, to further meet the needs of generating long texts, the word count ranges may also include: [12000, 14000], [14000, 16000], [16000, 18000], [18000, 20000], etc. This allows users to select based on their text generation needs of different lengths, thereby further improving the user experience.

[0071] It should be noted that the above word count range is only an example. In actual applications, it can be set according to actual needs, and this disclosure does not impose any restrictions on it.

[0072] Furthermore, in a specific example, after obtaining the target text, corresponding operations can be performed on the target text; for example, in response to at least one of the following operations on the target text, the content after the operation is displayed: format adjustment operation, query operation, intelligent question and answer operation.

[0073] For example, the display interface showing the generated target text can be equipped with at least one of the following buttons: "Smart Q&A", "Search", and "Format Template".

[0074] Furthermore, if the target clicks the "Format Template" button, pre-set paper format templates, research report format templates, and journal format templates will be displayed. At this time, the target can select the corresponding format template according to its actual needs, and after clicking the "Apply" button, the target text will be adjusted to the selected template format. Alternatively, the target can click the "Preview" operation to preview the adjustment effect.

[0075] Alternatively, if the target user clicks the "Search" button, a corresponding search can be performed based on the target text; or, if the target user clicks the "Smart Q&A" button, intelligent Q&A can be performed based on the complete content of the target text. In this way, different user needs can be met, thereby further improving the user experience.

[0076] Understandably, in practical applications, a "text editing bar" can also be displayed in the interface showing the generated target text, allowing for corresponding font processing such as "bold" or "italic" to the selected content in the currently displayed target text, thus meeting different user needs.

[0077] It should be noted that the above adjustments to the target file are merely illustrative examples. In practical applications, adjustments can be made based on actual needs, and this disclosure does not impose any restrictions on this.

[0078] This provides strong support for meeting users' personalized needs (such as format requirements for specific scenarios) and customized needs, thereby further enhancing the user experience.

[0079] It should be noted that in practical applications, the general formatting adjustment area can also be set with bold, italic, and other operations to adjust the formatting of details in the target text. This disclosure does not impose specific restrictions on the operations in the general formatting adjustment area.

[0080] Figure 3 is a schematic flowchart of a text generation method according to an embodiment of this application. This method can be optionally applied to electronic devices, such as personal computers, servers, server clusters, and other electronic devices. It is understood that the relevant content of the methods shown in Figures 1 and 2 above can also be applied to this example; however, the related content will not be described again in this example.

[0081] Furthermore, the method includes at least a portion of the following. As shown in Figure 3, it includes:

[0082] Step S301: Obtain initial input information.

[0083] For examples of initial input information, please refer to the above explanation; they will not be repeated here.

[0084] Step S302: Input the initial input information into the first model to obtain the target outline.

[0085] Here, in one example, the target outline contains at least N chapter blocks, where N is an integer greater than or equal to 2. Further, in another example, the target outline also includes the initial topic of the text to be generated.

[0086] Here, in one example, each of the N chapter blocks can contain at least: a chapter topic and a chapter description. For instance, taking the target outline shown in the outline section of Figure 2 as an example, as shown in Figure 4, chapter block 1 contains chapter topic 1 and chapter description 1, chapter block 2 contains chapter topic 2 and chapter description 2, chapter block 3 contains chapter topic 3 and chapter description 3, and chapter block 4 contains chapter topic 4 and chapter description 4.

[0087] It should be noted that in practical applications, the first model can be a large language model, such as a generative large language model, or it can be other models with text generation capabilities. This disclosure does not impose any specific restrictions on this.

[0088] Step S303: Obtain the text content of each chapter block in the N chapter blocks.

[0089] Step S304: Obtain the target text based on the text content of each chapter block in the N chapter blocks.

[0090] In this way, the disclosed solution uses a model to generate target outlines, which effectively improves the efficiency of text generation. At the same time, by utilizing the reasoning ability of the model, it can also ensure that the structure of the generated target outlines is more reasonable, the content is richer, and the logic is stronger, thus providing strong support for ensuring the coherence and integrity of the generated text, and laying the foundation for improving the text quality of the generated text.

[0091] Furthermore, since this disclosed solution can first generate a target outline and then obtain the text content of each chapter block contained in the target outline, compared with the solution that directly obtains the target text based on the initial input information, this disclosed solution can effectively avoid the problem of token quantity limitation. In other words, this disclosed solution can make text generation no longer limited by the number of tokens. Thus, it effectively realizes the continuous output of long text, meets the diverse and personalized text generation needs of users, and effectively improves the user experience.

[0092] Furthermore, in a specific example, the number of chapter blocks is related to the text requirements contained in the initial input information; that is, the number of chapter blocks in this disclosure can be determined based on the text requirements contained in the initial input information.

[0093] Alternatively, in another example, the number of chapter blocks is related to the word count requirement contained in the initial input information. That is, the number of chapter blocks in this disclosure can be determined based on the word count requirement contained in the initial input information. Further, in one example, the number of chapter blocks is positively correlated with the word count requirement in the initial input information. For example, the more words required, the more chapter blocks are included in the generated target outline. For instance, if the requirement is to generate 3000 words of text, the generated target outline can contain a total of 6 chapter blocks. Further, if the requirement is to generate 30000 words of text, the generated target outline contains more than 6 chapter blocks, for example, 20. This effectively improves the efficiency of text generation and reduces user waiting time, thus laying the foundation for further improving the user experience.

[0094] It should be noted that there is no limit to the number of chapter blocks included in the target outline generated by this disclosed solution; in practical applications, the number can be determined based on actual needs. Furthermore, it should be noted that in practical applications, an upper limit can be set for the total number of chapter blocks. For example, the total number of chapter blocks should not exceed this upper limit. This avoids the problem of reduced text quality in the generated target text due to an excessive number of chapter blocks.

[0095] In this way, the disclosed solution can determine a reasonable number of chapter blocks based on the text requirements or word count requirements input by the target audience, making the outline structure of the generated target outline more in line with actual needs. This makes the overall structure of the subsequently generated text more reasonable. At the same time, since the number of chapter blocks is determined based on the input text requirements or word count requirements, the disclosed solution can also effectively control the efficiency of text generation based on the number of chapter blocks, thereby laying the foundation for effectively reducing user waiting time and further improving user experience.

[0096] It should be noted that in one example, the generated target text can contain multiple chapters. Correspondingly, a chapter (i.e., a first-level chapter) can include one or more chapter blocks. In other words, the chapter blocks in the target outline can also have a hierarchical relationship. For example, as shown in Figure 5, taking the target outline in Figure 4 as an example, the currently displayed target outline contains two chapters (also called two first-level chapters), which can be the first chapter and the second chapter. The first chapter contains chapter block 1. Further, chapter topic 1 in chapter block 1 can serve as the topic of the first chapter, and correspondingly, chapter description information 1 in chapter block 1 can serve as the chapter description information of the first chapter. Further, the second chapter includes chapter blocks 2, 3, and 4. Correspondingly, chapter topic 2 in chapter block 2 can serve as the topic of the second chapter, and chapter description information 2 in chapter block 2 can serve as the chapter description information of the second chapter. Furthermore, chapter block 3 and chapter block 4 serve as second-level chapters under the second chapter. In other words, the second chapter includes two second-level chapters. The chapter topic 3 of chapter block 3 can serve as the topic of the first second-level chapter under the second chapter (e.g., 2.1), and the chapter description information 3 of chapter block 3 can serve as the chapter description information of the first second-level chapter (i.e., 2.1) under the second chapter. Furthermore, the chapter topic 4 of chapter block 4 can serve as the topic of the second second-level chapter (e.g., 2.2) under the second chapter, and the chapter description information 4 of chapter block 4 can serve as the chapter description information of the second second-level chapter (i.e., 2.2) under the second chapter.

[0097] Understandably, in practical applications, the target outline also includes the hierarchical relationship between chapters and blocks. For example, the hierarchical relationship between chapters and blocks can be reflected through a structural hierarchy diagram (such as the vertical axis shown in Figure 5). This effectively ensures that the generated text better meets user needs, has a better text structure and logic, and also ensures higher text quality.

[0098] In a specific example of the disclosed solution, to ensure that the generated text meets user needs, after obtaining the target outline, the target object directly adjusts the target outline. Specifically, after obtaining the target outline, for example, after step S302 or step S102, the following is also included:

[0099] In response to the first regeneration operation for the target outline, the target outline is regenerated.

[0100] For example, as shown in Figure 6, a "Regenerate" button can be set in the display interface. The target object can then click the "Regenerate" button to regenerate a new target outline. For instance, the initial input information can be re-entered into the first model to regenerate the target outline. This ensures that the generated target outline meets the user's needs, thus laying the foundation for improving the quality of subsequently generated text and obtaining target text that meets the user's requirements. Simultaneously, it further enhances the user experience.

[0101] It should be noted that in practical applications, other buttons can be set on the display interface based on actual needs. For example, a page-turning operation can be set to allow users to turn pages between the target outline before and after regeneration. This allows the target user to compare the effects of the target outline before and after regeneration, select the target outline that meets their needs, and thus improve the text quality of the subsequently generated text. This lays the foundation for obtaining target text that meets the user's needs and further enhances the user experience.

[0102] Furthermore, in a specific example, at least one of the following two methods can be used to adjust parts of the target outline; specifically, after obtaining the target outline, for example, after step S302 or step S102, the following steps are also included:

[0103] Method 1: Regenerate the chapter block in response to a second regeneration operation targeting the chapter topic and / or chapter description information in the chapter block.

[0104] For example, in one example, in response to a second regeneration operation on the chapter topic in a chapter block, the chapter topic of the chapter block is regenerated; or in another example, in response to a second regeneration operation on the chapter description information in a chapter block, the chapter description information of the chapter block is regenerated; or in yet another example, in response to a second regeneration operation on the chapter block (including the chapter topic and the chapter description information), the chapter block is regenerated.

[0105] For example, as shown in Figure 7, a "More" button can be placed around each chapter block in the display interface. This "More" button can further include buttons for "Regenerate Chapter Block," "Regenerate Chapter Topic," and "Regenerate Chapter Description Information." In this way, the target user can select one of these buttons to regenerate the corresponding content, thus laying the foundation for improving the text quality of the subsequently generated target outline, obtaining a target file that satisfies the user, and enhancing the user experience.

[0106] Method 2: If the target outline still contains the initial topic, regenerate the initial topic in response to the third regeneration operation for the initial topic.

[0107] For example, as shown in Figure 8, a "Regenerate Theme" button can be set in the area surrounding the initial theme in the display interface. At this time, the initial theme can be regenerated by using the "Regenerate Theme" button.

[0108] In this way, the disclosed solution can provide the target audience with adjustment operations for the target outline (such as regeneration operations), thereby improving the overall quality of the target outline, providing a basis for the subsequent generation of high-quality text content, and laying the foundation for obtaining target files that satisfy users and thus improving the user experience.

[0109] Furthermore, in a specific example, at least one of the following two methods can be used to modify a portion of the target outline; specifically, after obtaining the target outline, for example, after step S302 or step S102, the following steps are also included:

[0110] Method 1: Update the chapter block in response to the first modification operation on the chapter topic and / or chapter description information in the chapter block.

[0111] Method 2: If the target outline still contains the initial topic, update the initial topic in response to the second modification operation on the initial topic.

[0112] For example, the target can select the content to be modified, such as the "Chapter Topic," "Chapter Description Information," or "Initial Topic" displayed on the interface, and then edit the selected content. This further improves the overall quality of the target outline, provides a basis for generating high-quality text content, and lays the foundation for obtaining a target file that satisfies the user, thereby improving the user experience.

[0113] Figure 9 is a schematic flowchart of a text generation method according to an embodiment of this application. This method can be optionally applied to electronic devices, such as personal computers, servers, server clusters, and other electronic devices. It is understood that the relevant content of the methods shown in Figures 1 to 8 above can also be applied to this example; however, the related content will not be described again in this example.

[0114] Furthermore, the method includes at least a portion of the following. As shown in Figure 9, it includes:

[0115] Step S901: Obtain initial input information.

[0116] For examples of initial input information, please refer to the above explanation; they will not be repeated here.

[0117] Step S902: Input the initial input information into the first model to obtain the target outline.

[0118] Here, in one example, the target outline contains at least N chapter blocks, where N is an integer greater than or equal to 2. Further, in another example, the target outline also includes the initial topic of the text to be generated.

[0119] Furthermore, in one example, each of the N chapter blocks can contain at least: a chapter title and a chapter description.

[0120] It should be noted that examples related to the target outline, chapter blocks, and the first model can be found in the above explanation, and will not be repeated here.

[0121] Step S903: Based on the feature information of the chapter description information contained in the current chapter block (e.g., the total number of words in the chapter description information), determine whether the current chapter block needs text expansion to obtain a first result. Further, if the first result indicates that text expansion is needed, proceed to step S904; otherwise, proceed to step S905.

[0122] For example, for the i-th chapter block (an integer greater than or equal to 1 and less than or equal to N), we can determine whether the i-th chapter block needs to be expanded based on the feature information of the chapter description information contained in the i-th chapter block (such as the total number of words in the chapter description information) to obtain the first result corresponding to the i-th chapter block.

[0123] It should be noted that the logic for determining whether text expansion is needed in this example can be set according to the user's actual situation. For example, in one example, it is determined whether the total number of characters of the chapter description information contained in the chapter block exceeds the preset number of characters, and then the first result is obtained.

[0124] Here, the first result indicates that the total number of words in the chapter description information exceeds the preset number of words, or the total number of words in the chapter description information does not exceed the preset number of words.

[0125] Furthermore, if the preset word count is exceeded, the chapter description information of the current chapter block can be considered sufficiently informative to clearly guide the generation of subsequent text, without the need for text expansion (also known as text extension). Otherwise, if the preset word count is not exceeded, the chapter description information of the current chapter block can be considered insufficient to clearly guide the generation of subsequent text, requiring text expansion. This provides strong support for generating high-quality target text later.

[0126] Step S904: Expand the text of the current chapter block using the second model to obtain the expanded chapter block. Proceed to step S905.

[0127] It should be noted that in practical applications, the second model can be a large language model, such as a generative large language model, or it can be other models with text generation capabilities. This disclosure does not impose any specific restrictions on this.

[0128] Furthermore, the first model and the second model can be the same or different, and this disclosure does not impose any specific restrictions on this.

[0129] Furthermore, in one example, the target outline can also be updated based on the expanded chapter blocks of text.

[0130] For example, in one instance, the text expansion of the chapter block using the second model described above (i.e., step S904 above) can specifically include: using the second model to expand the text of at least the chapter description information contained in the chapter block. This effectively enhances the guiding instructions of the target outline and provides strong support for improving the text quality of the subsequently generated target text.

[0131] For example, in one example, for a chapter block that needs text expansion, such as the i-th chapter block that needs text expansion, the chapter description information of the i-th chapter block can be directly input into the second model so that the second model can expand the text of the chapter description information.

[0132] Alternatively, in another example, to improve the quality of the expanded text and prevent the model's inference results from becoming overly divergent, the chapter topics of the chapter blocks to be expanded can be input into the second model. This guides the second model to expand the text within the scope of the chapter topics. For example, for the i-th chapter block that needs text expansion, all the information contained in the i-th chapter block, namely the chapter topic and chapter description information, can be directly input into the second model. The second model can then expand the text of the chapter block to meet preset requirements, such as ensuring that the expanded chapter description information exceeds a preset number of characters.

[0133] Furthermore, in a specific example, to further enhance the user experience, the expanded chapter blocks can undergo further alignment processing (also known as chapter alignment processing). This includes: after text expansion is complete, aligning the expanded chapter blocks with the original chapter blocks to ensure that the themes of the expanded chapters match those of the original chapters. For example, ensuring that the themes of the expanded chapters are consistent with those of the original chapters.

[0134] For example, for the i-th chapter block that needs to be expanded, the i-th chapter block after expansion can be aligned with the i-th chapter block before expansion, using the i-th chapter block before expansion as a reference. For example, by using vector similarity or other processing methods, the i-th chapter block after expansion can be aligned with the i-th chapter block before expansion. In this way, the content after expansion can be effectively prevented from becoming too divergent and deviating from its original meaning.

[0135] For example, in a scenario where all the information contained in the i-th chapter block is directly input into the second model, the chapter topic contained in the i-th chapter block before text expansion can be replaced with the chapter topic contained in the i-th chapter block after text expansion. In other words, the chapter topic remains unchanged before and after text expansion. This effectively avoids the shift in chapter topic caused by the model's divergent reasoning, thereby ensuring the consistency of the chapter topic before and after text expansion. This provides accurate guidance for the generation of text content in subsequent chapter blocks, and lays the foundation for improving the text quality of the target text.

[0136] Step S905: Determine the next chapter block in the target outline and return to step S903.

[0137] At this point, all chapter blocks in the target outline have been traversed to complete the update of the chapter blocks in the target outline that require text expansion. Proceed to step S906.

[0138] Step S906: Obtain the text content of each chapter block in the N chapter blocks.

[0139] Step S907: Obtain the target text based on the text content of each chapter block in the N chapter blocks.

[0140] In this way, the disclosed solution can reasonably expand the chapter blocks, thereby further improving the text content of the chapter blocks, and effectively improving the guiding quality of the entire target outline in text generation. This provides strong support for improving the overall text quality of the subsequently generated target text and obtaining long texts that satisfy users.

[0141] Figure 10 is a schematic flowchart of a text generation method according to an embodiment of this application. This method can be optionally applied to electronic devices, such as personal computers, servers, server clusters, and other electronic devices. It is understood that the relevant content of the methods shown in Figures 1 to 9 above can also be applied to this example; however, the related content will not be described again in this example.

[0142] Furthermore, the method includes at least a portion of the following. As shown in Figure 10, it includes:

[0143] Step S1001: Obtain initial input information.

[0144] For examples of initial input information, please refer to the above explanation; they will not be repeated here.

[0145] Step S1002: Input the initial input information into the first model to obtain the target outline.

[0146] Here, in one example, the target outline contains at least N chapter blocks, where N is an integer greater than or equal to 2. Further, in another example, the target outline also includes the initial topic of the text to be generated.

[0147] Furthermore, in one example, each of the N chapter blocks can contain at least: a chapter title and a chapter description.

[0148] It should be noted that examples related to the target outline, chapter blocks, and the first model can be found in the above explanation, and will not be repeated here.

[0149] Step S1003: Determine whether the current chapter block needs to cite references to obtain a second result. If the second result indicates that references need to be cited, proceed to step S1004; otherwise, proceed to step S1006.

[0150] For example, in one instance, the rules for determining whether to cite a reference may include, but are not limited to, one of the following:

[0151] The first method is keyword matching, which determines whether a preset keyword exists in the current chapter block. For example, it checks whether the current chapter block contains at least one of the preset keywords such as "Background," "Introduction," or "Literature Review." It is understood that in practical applications, preset keywords can be set based on actual needs, and this disclosed solution does not impose any restrictions on this.

[0152] The second approach is to customize the order based on chapters; for example, setting all sub-chaps and lower-level chapters in the second chapter and subsequent chapters to cite references. Understandably, in practice, this can be customized based on actual needs, and this publicly available solution does not impose any restrictions on this.

[0153] Step S1004: Extract keywords from the current chapter block to obtain the target keywords corresponding to the current chapter block. Then proceed to step S1005.

[0154] Step S1005: Based on the target keywords, determine the target literature to be cited in the current chapter block. Then proceed to step S1006.

[0155] Step S1006: Determine the next chapter block in the target outline. Then return to step S1003 until all chapter blocks in the target outline have been traversed.

[0156] Thus, by using steps S1003 to S1006, all chapter blocks that require references are identified, and the target references required for each chapter block are obtained.

[0157] Step S1007: Obtain the text content of each chapter block in the N chapter blocks.

[0158] It should be noted that for chapter blocks that cite target literature, the text content of that chapter block can be obtained based on the target literature cited. This ensures the reliability and authenticity of the chapter block's text content, thereby enhancing its depth and breadth and laying the foundation for obtaining high-quality target text subsequently.

[0159] Step S1008: Obtain the target text based on the text content of each chapter block in the N chapter blocks.

[0160] In this way, the disclosed solution can reasonably and based on actual needs cite literature in chapter blocks, and then generate accurate and reliable text content according to the citation situation of chapter blocks, so as to ensure that the text content of the final generated target text is more authentic and reliable. This effectively improves the text quality of the target text, and at the same time, lays the foundation for further meeting the different needs of users and improving the user experience.

[0161] Figure 11 is a schematic flowchart of a text generation method according to an embodiment of this application. This method can be optionally applied to electronic devices, such as personal computers, servers, server clusters, and other electronic devices. It is understood that the relevant content of the methods shown in Figures 1 to 10 above can also be applied to this example, and the related content will not be described again in this example.

[0162] Furthermore, the method includes at least a portion of the following. As shown in Figure 11, it includes:

[0163] Step S1101: Obtain initial input information.

[0164] For examples of initial input information, please refer to the above explanation; they will not be repeated here.

[0165] Step S1102: Input the initial input information into the first model to obtain the target outline.

[0166] Here, in one example, the target outline contains at least N chapter blocks, where N is an integer greater than or equal to 2. Further, in another example, the target outline also includes the initial topic of the text to be generated.

[0167] Furthermore, in one example, each of the N chapter blocks can contain at least: a chapter title and a chapter description.

[0168] It should be noted that examples related to the target outline, chapter blocks, and the first model can be found in the above explanation, and will not be repeated here.

[0169] Step S1103: Obtain the target prompt information corresponding to each chapter block.

[0170] Step S1104: Generate the text content of each chapter block based on the target prompt information corresponding to each chapter block.

[0171] For example, in one example, the target prompt information corresponding to each chapter block can be used to generate the text content of each chapter block. In this way, compared with directly generating long text, this method can effectively avoid the problem of token quantity limitation.

[0172] Furthermore, in one example, the text content of each chapter block can be obtained in the following way; specifically, the above-described method of generating the text content of each chapter block based on the target prompt information corresponding to each chapter block (e.g., step S1104) specifically includes:

[0173] Step S1104-1: Determine the target model to be called for each chapter block.

[0174] Step S1104-2: Utilize the target model required by each chapter block and generate the text content of each chapter block based on the target prompt information corresponding to each chapter block.

[0175] It should be noted that, in one example, the generation process of the text content for each of the above chapter blocks can be processed in parallel. In other words, the target model required by each chapter block can be utilized, and the text content for each chapter block can be generated based on the target prompt information corresponding to each chapter block. For example, as shown in Figure 12, the following steps can be executed concurrently:

[0176] Input the target prompt information 1 for chapter block 1 into the target model (e.g., model 1) that chapter block 1 needs to call;

[0177] Input the target prompt information 2 for chapter block 2 into the target model (e.g., model 2) that chapter block 2 needs to call;

[0178] Input the target prompt information 3 of chapter block 3 into the target model (e.g., model 3) that chapter block 3 needs to call.

[0179] It should be noted that for Model 1, Model 2, or Model 3, the three can be the same, partially the same, or different from each other, and this disclosed solution does not impose any restrictions on this.

[0180] Accordingly, the text content 1 of chapter block 1, the text content 2 of chapter block 2, and the text content 3 of chapter block 3 can be obtained concurrently. This significantly improves the efficiency of text generation, reduces user waiting time, and further enhances the user experience.

[0181] Furthermore, in one example, the target model to be invoked for each chapter block can be determined in the following way: based on a second result of whether the chapter block needs to cite literature, the target model to be invoked for each chapter block can be determined.

[0182] For example, in one example, if the second result indicates that the chapter block needs to cite references, the third model is used as the target model to be called by the chapter block; or, if the second result indicates that the chapter block does not need to cite references, the fourth model is used as the target model to be called by the chapter block.

[0183] For example, for the i-th chapter block, if the i-th chapter block needs to cite literature, the third model can be used as the target model to be called by the i-th chapter block; conversely, if the i-th chapter block does not need to cite literature, the fourth model can be used as the target model to be called by the i-th chapter block.

[0184] It should be further noted that the fourth model has fewer model parameters than the third model. This saves on the overall computational resources required to generate text content for each chapter / block, further improving text generation efficiency, reducing user waiting time, and ultimately enhancing the user experience.

[0185] In this way, the disclosed solution can determine the model to be invoked for the current chapter / block for text generation based on whether references are cited. Thus, by accurately matching the text content generation requirements of each chapter / block, it effectively reduces the computational resources required for text generation. This, in turn, improves text generation efficiency and reduces user waiting time while effectively ensuring the overall text quality of the subsequently generated target text, thereby further enhancing the user experience.

[0186] Step S1105: Obtain the target text based on the text content of each chapter block in the N chapter blocks.

[0187] In this way, the present solution can utilize the target prompt information of each chapter block and generate the text content of each chapter block. Then, the target text is assembled based on the concurrently generated text content of each chapter block. In this way, the problem of the number of tokens can be effectively avoided. In other words, the present solution can make full use of the target prompt information of each chapter block to generate the text content of each chapter block, so that the text generation is no longer limited by the number of tokens. It effectively realizes the continuous output of long text, meets the diverse and personalized text generation needs of users, and thus effectively improves the user experience.

[0188] Figure 13 is a schematic flowchart of a text generation method according to an embodiment of this application. This method can be optionally applied to electronic devices, such as personal computers, servers, server clusters, and other electronic devices. It is understood that the relevant content of the methods shown in Figures 1 to 12 above can also be applied to this example, and the related content will not be described again in this example.

[0189] Furthermore, the method includes at least a portion of the following. As shown in Figure 13, it includes:

[0190] Step S1301: Obtain initial input information.

[0191] For examples of initial input information, please refer to the above explanation; they will not be repeated here.

[0192] Step S1302: Input the initial input information into the first model to obtain the target outline.

[0193] Here, in one example, the target outline contains at least N chapter blocks, where N is an integer greater than or equal to 2. Further, in another example, the target outline also includes the initial topic of the text to be generated.

[0194] Furthermore, in one example, each of the N chapter blocks can contain at least: a chapter title and a chapter description.

[0195] It should be noted that examples related to the target outline, chapter blocks, and the first model can be found in the above explanation, and will not be repeated here.

[0196] Step S1303: Determine whether the current chapter block needs to be segmented to obtain a third result; further, if the third result indicates that the current chapter block does not need to be segmented, proceed to step S1304; otherwise, if the third result indicates that the current chapter block needs to be segmented, proceed to step S1305.

[0197] For example, in one instance, whether the current chapter block needs to be segmented is related to the word count of the content text to be generated from that current chapter block. For instance, given a specified word count requirement in the target object input, the total number of chapter blocks contained in the target outline can be determined. Furthermore, the total word count of the text content to be generated from each chapter block within the target outline can be further determined, thus ensuring that the total word count of the target text assembled from the text content of each chapter block meets the specified word count requirement. Furthermore, since each chapter block can independently call the model for text generation, if the total number of characters in the text content to be generated for a chapter block exceeds the preset value, the process of calling the model for text generation will exceed the token limit. In this case, the quality of the generated text will be reduced. Based on this, for cases where the total number of characters in the text content to be generated for a chapter block exceeds the preset value, for example, if the total number of characters in the text content to be generated for the i-th chapter block exceeds the preset value, the i-th chapter block can be divided into multiple text blocks. In this case, the total number of characters in the text content to be generated for each text block will not exceed the preset value. In this way, the problem of the token limit can be further effectively solved, thus providing strong support for the continuous output of long texts. At the same time, it also provides strong support for further improving text generation efficiency and meeting the diverse and personalized text generation needs of users.

[0198] Accordingly, if the total number of characters in the text content to be generated for a chapter block does not exceed a preset value—for example, if the total number of characters in the text content to be generated for the i-th chapter block does not exceed the preset value—then there is no need to perform block segmentation on the i-th chapter block. This minimizes invalid block segmentation and lays the foundation for further improving text generation efficiency. Simultaneously, it also lays the foundation for subsequently improving the overall quality of the text and the user experience.

[0199] It should be noted that the preset value can be set based on the maximum number of tokens, or further, it can be set to balance the efficiency of text generation. This disclosed solution does not impose specific restrictions on the method of determining the preset value.

[0200] Step S1304: Based on at least one of the following, obtain the target prompt information for the current chapter block: target outline, chapter description information for the current chapter block, chapter topic for the current chapter block, and target references (if any) required for the current chapter block. Then proceed to step S1308.

[0201] For example, in one instance, if the above judgment logic determines that the i-th chapter block does not require segmentation, as shown in Figure 14(a), the target outline, the chapter description information i of the i-th chapter block, and the chapter topic i of the i-th chapter block can be directly used as the target prompt information for the i-th chapter block. Furthermore, if the i-th chapter block contains target literature that needs to be cited, then the target outline, the chapter description information i of the i-th chapter block, the chapter topic i of the i-th chapter block, and the target literature that needs to be cited in the i-th chapter block can all be used as the target prompt information for the i-th chapter block.

[0202] This facilitates the accurate generation of chapter block text content within a defined range (such as the range of target prompt information for chapter blocks) during subsequent text generation. It effectively avoids the generated text content deviating from the original topic due to divergent reasoning of the model, thus providing strong support for further improving the text quality of the target text generated subsequently.

[0203] Step S1305: Segment the current chapter block to obtain multiple text blocks corresponding to the current chapter block. Then proceed to step S1306.

[0204] Step S1306: Obtain the text prompt information for each text block corresponding to the current chapter block. Then proceed to step S1307.

[0205] Step S1307: Based on the text prompt information of each text block corresponding to the current chapter block, obtain the target prompt information corresponding to the current chapter block. Then proceed to step S1308.

[0206] For example, as shown in Figure 14(b), if the i-th chapter block needs to be segmented based on the above judgment logic, the i-th chapter block is segmented to obtain multiple text blocks, such as text block i1, text block i2, ..., text block in (n is a positive integer greater than or equal to 2). At this time, the text prompt information of each text block can be determined, such as the text prompt information i1 of text block i1, the text prompt information i2 of text block i2, ..., the text prompt information in of text block in. Then, the text prompt information of each obtained text block is used as the target prompt information of the i-th chapter block.

[0207] It's important to note here that in practical applications, the value of 'n' is related to the total amount of text content to be generated for the current chapter block; for example, the two are positively correlated. This further provides strong support for avoiding the token quantity limit.

[0208] Furthermore, it should be noted that for chapter blocks that undergo segmentation, the text content of each text block can be generated based on the text prompts of the resulting text blocks, and then assembled to obtain the text content of the entire chapter block. For example, for the i-th chapter block, if it needs to be segmented and results in n text blocks, the text content of each of the n text blocks can be generated based on the text prompts of the resulting text blocks, and then assembled to obtain the text content of the i-th chapter block.

[0209] Furthermore, in one example, the model to be invoked for each text block can be further determined. For instance, the model to be invoked can be determined based on whether the current text block needs to cite references. If references are required, the model with a larger number of parameters is invoked; otherwise, the model with a smaller number of parameters is invoked. Alternatively, in another example, the model to be invoked can be determined based on whether the chapter / block to which the current text block belongs needs to cite references. For instance, if references are required, the model with a larger number of parameters is invoked; otherwise, the model with a smaller number of parameters is invoked.

[0210] It should be noted that, in one example, the process of obtaining the text content of a text block is similar to the process of obtaining the text content of a chapter block that does not require segmentation, and will not be repeated here.

[0211] It should be further clarified that the "whether a text block needs to cite a reference" mentioned above refers to the following: if the chapter or block to which the text block belongs contains a reference that needs to be cited, and the location of the reference is within the text block, then the text block is considered to need to cite a reference. Otherwise, if the location of the reference is not within the text block, then the text block is considered not to need to cite a reference.

[0212] Thus, since chapter blocks can be further segmented, the text content generation process of chapter blocks can be guided more meticulously. At the same time, while ensuring that chapter blocks closely revolve around the theme for reasoning, the issue of token quantity limitation is further effectively avoided, thereby laying a foundation for generating long texts. Moreover, since multiple text blocks can also be generated concurrently to produce corresponding text content, this also lays a foundation for further improving text generation efficiency.

[0213] Furthermore, since this disclosed solution can segment chapter blocks, it can achieve continuous output of long text in each chapter block. Moreover, the above process can meet the user's long text generation needs without relying on high-quality prompts, thus satisfying the user's diverse and personalized text generation needs and further improving the user experience.

[0214] Step S1308: Determine the next chapter block in the target outline. Then return to step S1303 until all chapter blocks have been traversed.

[0215] Thus, by using steps S1303 to S1308, the target prompt information corresponding to each chapter block is obtained.

[0216] Step S1309: Generate the text content of each chapter block based on the target prompt information corresponding to each chapter block.

[0217] Step S1310: Obtain the target text based on the text content of each chapter block in the N chapter blocks.

[0218] Furthermore, in a specific example, obtaining the text prompt information for each text block corresponding to the chapter block as described above (e.g., step S1306) can specifically include:

[0219] Based on at least one of the following, obtain the text prompt information for the text block corresponding to the chapter block:

[0220] The target outline, the chapter description of the chapter containing the text block, the chapter topic of the chapter containing the text block, the text content in the chapter containing the text block, and the target references (if any) required for the chapter containing the text block.

[0221] For example, for the j-th text block in the i-th chapter block, the target outline, the chapter description information i of the i-th chapter block, the chapter theme i of the i-th chapter block, and the text content of the j-th text block can be directly used as the text prompt information for the j-th text block.

[0222] Furthermore, if the i-th chapter block contains target literature that needs to be cited, then the target outline, the chapter description information i of the i-th chapter block, the chapter topic i of the i-th chapter block, the text content of the j-th text block, and the target literature that needs to be cited in the i-th chapter block can all be used as the text prompt information of the j-th text block.

[0223] Here, j is an integer greater than or equal to 1 and less than or equal to n, where n is the total number of text blocks contained in the i-th chapter block.

[0224] This facilitates the generation of text content for subsequent text blocks, while ensuring the coherence and integrity of the text content in chapter blocks, enhancing the logic and organization of chapter content, and thus laying the foundation for improving the text quality of the target text in the future.

[0225] The following provides a more detailed explanation of this disclosed solution with specific examples. As shown in Figure 15, the text generation solution may specifically include:

[0226] Step S1501: Obtain initial input information for text generation.

[0227] For example, in one instance, the target audience can be directly guided to input the required core content and article requirements through the form input box described above, such as the topic, format requirements, citation requirements, word count requirements, and behavioral rules.

[0228] Step S1502: Use the first model (such as a generative model, GPT-4o (Generalized Pre-trained Transformer 4 Omni) model) to process the initial input information to generate a text outline that meets the preset requirements (corresponding to the target outline mentioned above) and display the text outline.

[0229] Here, in one example, as shown in Figure 5, the text outline can contain an initial topic and N chapter blocks. N is an integer greater than or equal to 2.

[0230] Furthermore, in one example, as shown in Figure 5, each chapter block can also specifically include chapter topic and chapter description information.

[0231] It should be noted that in practical applications, chapter blocks correspond to the chapters of the text to be generated. For example, in one example, the chapters of the text to be generated may include one or more chapter blocks. Specific examples of chapter blocks can be found in the above explanation and will not be repeated here.

[0232] Additionally, it should be noted that after generating the text outline, the target object can further edit the text outline, such as modifying the chapter topics and / or chapter descriptions of the chapter blocks. This makes the final generated target article better meet the user's needs. Alternatively, the text outline can be regenerated, or parts of the text outline can be regenerated. Specific examples can be found in the description above and will not be repeated here.

[0233] Step S1503: Determine the chapter block that needs to be processed from the N chapter blocks, for example, determine the i-th chapter block that needs to be processed.

[0234] Step S1504: Determine whether the i-th chapter block needs text expansion. If yes, proceed to step S1505. Otherwise, proceed to step S1507.

[0235] It should be noted that the logic for the judgment can be determined based on user needs. For example, in one example, it can be determined whether the total number of words in the chapter description information of the current chapter block exceeds the word count threshold of the chapter. If it exceeds the threshold, no text expansion is needed; otherwise, text expansion is required.

[0236] Furthermore, it should be noted that the word count thresholds for different chapter blocks can be the same or different, and this public scheme does not impose any restrictions on this.

[0237] Step S1505: Use the contour expansion module (for example, the second model mentioned above, such as the GPT-4o model) to expand the text of the i-th chapter block to obtain the text-expanded i-th chapter block, and proceed to step S1506.

[0238] It should be noted that in practical applications, the chapter description information in the i-th chapter block can be expanded with text, or all the information in the i-th chapter block (including chapter topic and chapter description information) can be expanded with text.

[0239] Step S1506: Based on the i-th chapter block before text expansion, align the i-th chapter block after text expansion to ensure that the chapter title of the i-th chapter block after expansion is consistent with the chapter title of the i-th chapter block before expansion. Proceed to step S1507.

[0240] Step S1507: Determine whether the i-th chapter block needs to be segmented. If yes, proceed to step S1508; otherwise, proceed to step S1509.

[0241] For example, in one example, it can be determined whether the total number of characters of the text content to be generated for the i-th chapter block exceeds the character limit (such as the upper limit of the number of tokens). If it does, the i-th chapter block needs to be segmented; otherwise, no segmentation is required.

[0242] Step S1508: Segment the i-th chapter block to obtain multiple text blocks corresponding to the i-th chapter block. Then proceed to step S1509.

[0243] Step S1509: Determine whether the i-th chapter block needs to cite references; if yes, proceed to step S1510. Otherwise, proceed to step S1511.

[0244] For example, in one instance, the rules for determining whether to cite a reference may include, but are not limited to, one of the following:

[0245] The first method is keyword matching, which determines whether a preset keyword exists in the i-th chapter block. For example, it checks if the i-th chapter block contains at least one of the preset keywords such as "Background," "Introduction," or "Literature Review." If it does, then a reference needs to be cited. Otherwise, no reference is required.

[0246] It is understandable that in practical applications, preset keywords can be set based on actual needs, and this public solution does not impose any restrictions on this.

[0247] The second method is to customize based on the chapter order; for example, you can set the second chapter and subsequent chapters to require references.

[0248] It is understandable that in practical applications, settings can be made based on actual needs, and this public solution does not impose any restrictions on this.

[0249] Step S1510: Extract keywords from the i-th chapter block and perform a literature search based on the extracted keywords. For example, call a compliant academic paper database to perform a literature search to obtain the target documents corresponding to the i-th chapter block. Then proceed to step S1511.

[0250] Step S1511: Determine the target prompt information for the i-th chapter block and the target model to be called for the i-th chapter block; return to step S1503.

[0251] By repeating steps S1504 to S1511, the target prompt information for all chapter blocks contained in the text outline can be obtained. Proceed to step S1512.

[0252] For example, in one scenario, if no segmentation is required for the i-th chapter block and references are needed, the text outline, the chapter description of the i-th chapter block, the chapter topic of the i-th chapter block, and the target references required for the i-th chapter block can all be used as the target information for the i-th chapter block. Alternatively, if no segmentation is required for the i-th chapter block and references are not needed, the text outline, the chapter description of the i-th chapter block, and the chapter topic of the i-th chapter block can all be used as the target information for the i-th chapter block.

[0253] Alternatively, in another example, for the i-th chapter block, if segmentation is required, the text hints for each text block within the i-th chapter block can be obtained first. Then, based on the text hints for each text block, the target hints for the i-th chapter block can be obtained. For example, for the j-th text block within the i-th chapter block, if the i-th chapter block requires citations, the text outline, the chapter description information of the i-th chapter block, the chapter topic of the i-th chapter block, the text content of the j-th text block within the i-th chapter block, and the references to the i-th chapter block can be used. The target references that need to be cited are included as the text prompt information for the j-th text block of the i-th chapter block; or, if no references are required for the i-th chapter block, the text outline, the chapter description information of the i-th chapter block, the chapter topic of the i-th chapter block, and the text content of the j-th text block in the i-th chapter block can all be included as the text prompt information for the j-th text block of the i-th chapter block; in this way, the text prompt information for each text block in the i-th chapter block can be obtained, and then the target prompt information for the i-th chapter block can be obtained based on the text prompt information of each text block.

[0254] Furthermore, in one example, the target model to be invoked for the i-th chapter block can be determined based on whether the i-th chapter block needs to cite references. For example, for chapter blocks that need to cite references, the GPT-4o model can be used as the target model, while for chapter blocks that do not need to cite references, the GPT-4o-mini model can be used.

[0255] Here, the number of model parameters in the GPT-4o-mini model is smaller than that in the GPT-4o model.

[0256] At this point, we have obtained the target prompts for each chapter block, as well as the target models that each chapter block needs to call.

[0257] Step S1512: Perform information assembly, that is, assemble information based on the target model to be called in each chapter block and the target prompt information of each chapter block. Proceed to step S1513.

[0258] For example, in this example, the target prompt information may include system settings and user settings. The system settings contain complete information about the text outline; the user settings contain relevant information about the chapter blocks, relevant information about the references to be called, and model information about the target model to be called. In this way, by assembling the information according to the above rules, the complete information corresponding to each chapter block can be assembled, which provides strong support for subsequent concurrent generation.

[0259] Step S1513: Call the target model required by each chapter block, and combine it with the target prompt information of each chapter block to generate the text content of each chapter block in parallel.

[0260] Step S1514: Based on the structure of the text outline, assemble the text content of each chapter block.

[0261] Step S1515: Clean the format of the assembled text content to obtain the initial text.

[0262] Step S1516: Based on the format template selected by the target object, adjust the format of the initial text to obtain target text that meets the format requirements and matches the initial input information.

[0263] In this way, this disclosed solution generates complete text that meets the needs of the target audience by taking the core information (such as the topic) and text requirements (such as word count, citations, etc.) input by the target audience, combined with text formatting requirements. The specific advantages are as follows:

[0264] First, the user experience is better and the user cost is lower. For example, since the text generation of this disclosed solution does not rely solely on the input prompt words, compared with existing solutions that rely on user-input prompt words, the user cost of this disclosed solution is lower and the user-friendliness is higher.

[0265] Secondly, the citation of references is more standardized. During text generation, this publicly available solution adds the required references to the prompts for chapters that need to be cited. This allows for standardized citation of references according to text requirements without the need for designing high-quality prompts, effectively ensuring the accuracy and objectivity of the information sources needed for the generated text, and providing strong support for improving the quality of the generated text.

[0266] Third, text output is unrestricted. This disclosed solution utilizes a pre-generated text outline and concurrently generates the text content of each chapter / block. The target text is then assembled based on the text content of each chapter / block. This removes the limitation on the number of tokens required for text generation, effectively enabling continuous output of long texts and meeting the diverse and personalized text generation needs of users, thereby further enhancing the user experience.

[0267] Fourth, the text format is more standardized. After obtaining the long text content, this public solution also provides a variety of commonly used format templates, such as thesis format templates, research report format templates, and journal format templates, so that the generated text can be formatted using the selected format template, making the generated long text more standardized and thus further improving the user experience.

[0268] This disclosure also provides a text generation apparatus, as shown in Figure 16, including:

[0269] The acquisition unit 1601 is used to acquire initial input information;

[0270] The text processing unit 1602 is configured to obtain a target outline based on the initial input information; wherein the target outline contains at least N chapter blocks; N is an integer greater than or equal to 2; obtain the text content of each chapter block in the N chapter blocks; and obtain the target text based on the text content of each chapter block in the N chapter blocks.

[0271] In a specific example of the disclosed solution, the initial input information is obtained based on a form input box displayed on the interface; wherein the form input box displays at least one of the following:

[0272] The first prompt area is used to guide the target user to input the core content of the text to be generated;

[0273] A second prompt area is used to guide the target object to input the text requirements to be generated.

[0274] In a specific example of the disclosed scheme, the text requirement includes at least one of the following:

[0275] Word count requirements are used to constrain the citation methods used in references.

[0276] In a specific example of the disclosed solution, the text processing unit is specifically used for:

[0277] The initial input information is input into the first model to obtain the target outline, wherein each chapter block in the target outline contains at least chapter topic and chapter description information.

[0278] In one specific example of the disclosed scheme, the number of chapter blocks is related to the text requirements contained in the initial input information;

[0279] or,

[0280] The number of chapter blocks is related to the word count requirement contained in the initial input information.

[0281] In a specific example of the disclosed solution, the text processing unit is further configured to:

[0282] In response to the first regeneration operation for the target outline, the target outline is regenerated.

[0283] In a specific example of the disclosed solution, the text processing unit is further configured to:

[0284] In response to a second regeneration operation targeting the chapter topic and / or chapter description information in the chapter block, the chapter block is regenerated;

[0285] or,

[0286] If the target outline still contains an initial topic, the initial topic is regenerated in response to the third regeneration operation for the initial topic.

[0287] In a specific example of the disclosed solution, the text processing unit is further configured to:

[0288] In response to the first modification operation on the chapter topic and / or chapter description information in the chapter block, update the chapter block;

[0289] or,

[0290] If the target outline still contains an initial topic, the initial topic is updated in response to the second modification operation on the initial topic.

[0291] In a specific example of the disclosed solution, the text processing unit is further configured to:

[0292] Based on the feature information of the chapter description information contained in the chapter block, the first result of whether the chapter block needs to be expanded is obtained;

[0293] If the first result indicates that text expansion is needed, the second model is used to expand the text of the chapter block, resulting in the expanded chapter block.

[0294] In a specific example of the disclosed solution, the text processing unit is specifically used for:

[0295] Using the second model, at least the chapter description information contained in the chapter block is textually expanded.

[0296] In a specific example of the disclosed solution, the text processing unit is further configured to:

[0297] After the text expansion is completed, the expanded chapter blocks are aligned with the original chapter blocks to ensure that the chapter themes of the expanded chapters match the original chapter themes.

[0298] In a specific example of the disclosed solution, the text processing unit is further configured to:

[0299] The second result is obtained to determine whether a chapter block needs to cite references.

[0300] If the second result indicates that references need to be cited, keywords are extracted from the chapter blocks to obtain the target keywords corresponding to the chapter blocks;

[0301] Based on the target keywords, the target literature to be cited in the chapter blocks is determined.

[0302] In a specific example of the disclosed solution, the text processing unit is specifically used for:

[0303] Obtain the target hint information corresponding to each chapter block;

[0304] Based on the target prompt information corresponding to each chapter block, the text content of each chapter block is generated.

[0305] In a specific example of the disclosed solution, the text processing unit is specifically used for:

[0306] Determine the target model to be called for each chapter / block;

[0307] The text content of each chapter block is generated by using the target model that needs to be called for each chapter block and based on the target prompt information corresponding to each chapter block.

[0308] In a specific example of the disclosed solution, the text processing unit is specifically used for:

[0309] Based on the second result of whether a chapter block needs to cite literature, the target model to be called for each chapter block is determined.

[0310] In a specific example of the disclosed solution, the text processing unit is specifically used for:

[0311] If the second result indicates that a section block needs to cite references, then the third model will be used as the target model to be called by the section block.

[0312] or,

[0313] If the second result indicates that the chapter block does not need to cite references, the fourth model will be used as the target model to be called by the chapter block.

[0314] The fourth model has fewer model parameters than the third model.

[0315] In a specific example of the disclosed solution, the text processing unit is specifically used for:

[0316] The third result is whether the chapter block needs to be segmented.

[0317] If the third result indicates that the chapter block does not require segmentation, the target hint information for the chapter block is obtained based on at least one of the following:

[0318] The target outline, chapter description information for each chapter block, chapter topic for each chapter block, and target references required for each chapter block.

[0319] In a specific example of the disclosed solution, the text processing unit is specifically used for:

[0320] The third result is whether the chapter block needs to be segmented.

[0321] If the third result indicates that the chapter block needs to be segmented, the chapter block is segmented to obtain multiple text blocks corresponding to the chapter block;

[0322] Get the text prompt information for each text block corresponding to the chapter block;

[0323] Based on the text prompt information of each text block corresponding to the chapter block, the target prompt information corresponding to the chapter block is obtained.

[0324] In a specific example of the disclosed solution, the text processing unit is specifically used for:

[0325] Obtain the text prompt information for the text block based on at least one of the following:

[0326] The target outline, the chapter description information of the chapter block containing the text block, the chapter topic of the chapter block containing the text block, the text content in the chapter block containing the text block, and the target references required for the chapter block containing the text block.

[0327] In a specific example of the scheme disclosed herein, the text processing unit is further configured to respond to at least one of the following operations on the target text and display the content after the operation:

[0328] Formatting adjustment, querying, and intelligent question-and-answering.

[0329] For a description of the specific functions and examples of each unit of the apparatus in this disclosure embodiment, please refer to the relevant descriptions of the corresponding steps in the above method embodiments, which will not be repeated here.

[0330] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0331] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0332] Figure 17 illustrates a schematic block diagram of an example electronic device 1700 that can be used to implement embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0333] As shown in Figure 17, device 1700 includes a computing unit 1701, which can perform various appropriate actions and processes according to a computer program stored in read-only memory (ROM) 1702 or a computer program loaded from storage unit 1708 into random access memory (RAM) 1703. The RAM 1703 may also store various programs and data required for the operation of device 1700. The computing unit 1701, ROM 1702, and RAM 1703 are interconnected via bus 1704. Input / output (I / O) interface 1705 is also connected to bus 1704.

[0334] Multiple components in device 1700 are connected to I / O interface 1705, including: input unit 1706, such as a keyboard, mouse, etc.; output unit 1707, such as various types of displays, speakers, etc.; storage unit 1708, such as a disk, optical disk, etc.; and communication unit 1709, such as a network card, modem, wireless transceiver, etc. Communication unit 1709 allows device 1700 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0335] The computing unit 1701 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1701 performs the various methods and processes described above, such as text generation methods. For example, in some embodiments, the text generation method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 1708. In some embodiments, part or all of the computer program may be loaded and / or installed on device 1700 via ROM 1702 and / or communication unit 1709. When the computer program is loaded into RAM 1703 and executed by the computing unit 1701, one or more steps of the text generation method described above may be performed. Alternatively, in other embodiments, the computing unit 1701 may be configured to perform the text generation method by any other suitable means (e.g., by means of firmware).

[0336] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0337] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0338] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0339] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0340] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0341] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0342] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0343] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A text generation method, comprising: Obtain the initial input information; Based on the initial input information, a target outline is obtained; wherein the target outline contains at least N chapter blocks; N is an integer greater than or equal to 2; Obtain the text content of each chapter block in the N chapter blocks; The target text is obtained based on the text content of each chapter block in the N chapter blocks.

2. The method according to claim 1, wherein, The initial input information is obtained based on the form input boxes displayed on the interface; wherein the form input boxes display at least one of the following: The first prompt area is used to guide the target user to input the core content of the text to be generated; A second prompt area is used to guide the target object to input the text requirements to be generated.

3. The method according to claim 2, wherein, The text requirement includes at least one of the following: Word count requirements are used to constrain the citation methods used in references.

4. The method according to any one of claims 1-3, wherein, The process of obtaining the target outline based on the initial input information includes: The initial input information is input into the first model to obtain the target outline, wherein each chapter block in the target outline contains at least chapter topic and chapter description information.

5. The method according to claim 4, wherein, The number of chapter blocks is related to the text requirements contained in the initial input information; or, The number of chapter blocks is related to the word count requirement contained in the initial input information.

6. The method according to claim 4, further comprising: In response to the first regeneration operation for the target outline, the target outline is regenerated.

7. The method according to claim 4, further comprising: In response to a second regeneration operation targeting the chapter topic and / or chapter description information in the chapter block, the chapter block is regenerated; or, If the target outline still contains an initial topic, the initial topic is regenerated in response to the third regeneration operation for the initial topic.

8. The method according to claim 4, further comprising: In response to the first modification operation on the chapter topic and / or chapter description information in the chapter block, update the chapter block; or, If the target outline still contains an initial topic, the initial topic is updated in response to the second modification operation on the initial topic.

9. The method according to any one of claims 4-8, further comprising: Based on the feature information of the chapter description information contained in the chapter block, the first result of whether the chapter block needs to be expanded is obtained; If the first result indicates that text expansion is needed, the second model is used to expand the text of the chapter blocks, resulting in the text... This is the expanded chapter block.

10. The method according to claim 9, wherein, The text expansion of chapter blocks using the second model includes: Using the second model, at least the chapter description information contained in the chapter block is textually expanded.

11. The method according to claim 9 or 10, further comprising: After the text expansion is completed, the expanded chapter blocks are aligned with the original chapter blocks to ensure that the chapter themes of the expanded chapters match the original chapter themes.

12. The method according to any one of claims 4-11, further comprising: The second result is obtained to determine whether a chapter block needs to cite references. If the second result indicates that references need to be cited, keywords are extracted from the chapter blocks to obtain the target keywords corresponding to the chapter blocks; Based on the target keywords, the target literature to be cited in the chapter blocks is determined.

13. The method according to any one of claims 4-12, wherein, The process of obtaining the text content of each chapter block in the N chapter blocks includes: Obtain the target hint information corresponding to each chapter block; Based on the target prompt information corresponding to each chapter block, the text content of each chapter block is generated.

14. The method according to claim 13, wherein, The process of generating text content for each chapter block based on the target prompt information corresponding to each chapter block includes: Determine the target model to be called for each chapter / block; The text content of each chapter block is generated by using the target model that needs to be called for each chapter block and based on the target prompt information corresponding to each chapter block.

15. The method according to claim 14, wherein, The determination of the target model to be called for each chapter block includes: Based on the second result of whether a chapter block needs to cite literature, the target model to be called for each chapter block is determined.

16. The method according to claim 15, wherein, The process of determining the target model to be invoked for each chapter block based on whether it needs to cite references includes: If the second result indicates that a section block needs to cite references, then the third model will be used as the target model to be called by the section block. or, If the second result indicates that the chapter block does not need to cite references, the fourth model will be used as the target model to be called by the chapter block. The fourth model has fewer model parameters than the third model.

17. The method according to any one of claims 13-16, wherein, The process of obtaining the target prompt information corresponding to each chapter block includes: The third result is whether the chapter block needs to be segmented. If the third result indicates that the chapter block does not require segmentation, the target hint information for the chapter block is obtained based on at least one of the following: The target outline, chapter description information for each chapter block, chapter topic for each chapter block, and target references required for each chapter block.

18. The method according to any one of claims 13-16, wherein, The process of obtaining the target prompt information corresponding to each chapter block includes: The third result is whether the chapter block needs to be segmented. If the third result indicates that the chapter block needs to be segmented, the chapter block is segmented to obtain multiple text blocks corresponding to the chapter block; Get the text prompt information for each text block corresponding to the chapter block; Based on the text prompt information of each text block corresponding to the chapter block, the target prompt information corresponding to the chapter block is obtained.

19. The method according to claim 18, wherein, The obtained text prompt information for each text block corresponding to the chapter block includes: Obtain the text prompt information for the text block based on at least one of the following: The target outline, the chapter description of the chapter containing the text block, the chapter topic of the chapter containing the text block, the text content in the chapter containing the text block, and the target references required for the chapter containing the text block.

20. The method according to any one of claims 1-19, further comprising: Respond to at least one of the following actions on the target text and display the content after the action: Formatting adjustment, querying, and intelligent question-and-answering.

21. A text generation apparatus, comprising: The acquisition unit is used to acquire initial input information; A text processing unit is configured to obtain a target outline based on the initial input information; wherein the target outline contains at least N chapter blocks; N is an integer greater than or equal to 2; Obtain the text content of each chapter block in the N chapter blocks; based on the text content of each chapter block in the N chapter blocks, obtain the target text.

22. The apparatus according to claim 21, wherein, The initial input information is obtained based on the form input boxes displayed on the interface; wherein the form input boxes display at least one of the following: The first prompt area is used to guide the target user to input the core content of the text to be generated; A second prompt area is used to guide the target object to input the text requirements to be generated.

23. The apparatus according to claim 22, wherein, The text requirement includes at least one of the following: Word count requirements are used to constrain the citation methods used in references.

24. The apparatus according to any one of claims 21-23, wherein, The text processing unit is specifically used for: The initial input information is input into the first model to obtain the target outline, wherein each chapter block in the target outline contains at least chapter topic and chapter description information.

25. The apparatus according to claim 24, wherein, The number of chapter blocks is related to the text requirements contained in the initial input information; or, The number of chapter blocks is related to the word count requirement contained in the initial input information.

26. The apparatus according to claim 24, wherein, The text processing unit is also used for: In response to the first regeneration operation for the target outline, the target outline is regenerated.

27. The apparatus according to claim 24, wherein, The text processing unit is also used for: In response to a second regeneration operation targeting the chapter topic and / or chapter description information in the chapter block, the chapter block is regenerated; or, If the target outline still contains an initial topic, the initial topic is regenerated in response to the third regeneration operation for the initial topic.

28. The apparatus according to claim 24, wherein, The text processing unit is also used for: In response to the first modification operation on the chapter topic and / or chapter description information in the chapter block, update the chapter block; or, If the target outline still contains an initial topic, the initial topic is updated in response to the second modification operation on the initial topic.

29. The apparatus according to any one of claims 24-28, wherein, The text processing unit is also used for: Based on the feature information of the chapter description information contained in the chapter block, the first result of whether the chapter block needs to be expanded is obtained; If the first result indicates that text expansion is needed, the second model is used to expand the text of the chapter block, resulting in the expanded chapter block.

30. The apparatus according to claim 29, wherein, The text processing unit is specifically used for: Using the second model, at least the chapter description information contained in the chapter block is textually expanded.

31. The apparatus according to claim 29 or 30, wherein, The text processing unit is also used for: After the text expansion is completed, the expanded chapter blocks are aligned with the original chapter blocks to ensure that the chapter themes of the expanded chapters match the original chapter themes.

32. The apparatus according to any one of claims 24-31, wherein, The text processing unit is also used for: The second result is obtained to determine whether a chapter block needs to cite references. If the second result indicates that references need to be cited, keywords are extracted from the chapter blocks to obtain the target keywords corresponding to the chapter blocks; Based on the target keywords, the target literature to be cited in the chapter blocks is determined.

33. The apparatus according to any one of claims 24-32, wherein, The text processing unit is specifically used for: Obtain the target hint information corresponding to each chapter block; Based on the target prompt information corresponding to each chapter block, the text content of each chapter block is generated.

34. The apparatus according to claim 33, wherein, The text processing unit is specifically used for: Determine the target model to be called for each chapter / block; The text content of each chapter block is generated by using the target model that needs to be called for each chapter block and based on the target prompt information corresponding to each chapter block.

35. The apparatus according to claim 34, wherein, The text processing unit is specifically used for: Based on the second result of whether a chapter block needs to cite literature, the target model to be called for each chapter block is determined.

36. The apparatus according to claim 35, wherein, The text processing unit is specifically used for: If the second result indicates that a section block needs to cite references, then the third model will be used as the target model to be called by the section block. or, If the second result indicates that the chapter block does not need to cite references, the fourth model will be used as the target model to be called by the chapter block. The fourth model has fewer model parameters than the third model.

37. The apparatus according to any one of claims 33-36, wherein, The text processing unit is specifically used for: The third result is whether the chapter block needs to be segmented. If the third result indicates that the chapter block does not require segmentation, the target of the chapter block is obtained based on at least one of the following: Prompt message: The target outline, chapter description information for each chapter block, chapter topic for each chapter block, and target references required for each chapter block.

38. The apparatus according to any one of claims 33-36, wherein, The text processing unit is specifically used for: The third result is whether the chapter block needs to be segmented. If the third result indicates that the chapter block needs to be segmented, the chapter block is segmented to obtain multiple text blocks corresponding to the chapter block; Get the text prompt information for each text block corresponding to the chapter block; Based on the text prompt information of each text block corresponding to the chapter block, the target prompt information corresponding to the chapter block is obtained.

39. The apparatus according to claim 38, wherein, The text processing unit is specifically used for: Obtain the text prompt information for the text block based on at least one of the following: The target outline, the chapter description of the chapter containing the text block, the chapter topic of the chapter containing the text block, the text content in the chapter containing the text block, and the target references required for the chapter containing the text block.

40. The apparatus according to any one of claims 21-39, wherein, The text processing unit is also used for: Respond to at least one of the following actions on the target text and display the content after the action: Formatting adjustment, querying, and intelligent question-and-answering.

41. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-20.

42. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-20.

43. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-20.

Citation Information

Patent Citations

  • Text processing method and device, equipment and storage medium

    CN118228710A

  • Text generation method and device, electronic equipment and storage medium

    CN118468819A

  • Text generation method and device, electronic equipment and computer program product

    CN118798133A

  • Academic Editing Engine(s) For Attribution And Revision Of Scholarly Authoring

    US20240289540A1