Text generation method and device, electronic equipment and storage medium
By introducing an external memory database into a large language model and using text-guided information to guide the generation of long texts, the problem of insufficient contextual memory in large language models is solved, enabling the generation of longer texts without increasing computational and storage requirements.
Patent Information
- Application Number
- CN202310822514.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-05
- Publication Date
- 2025-01-10
AI Technical Summary
In existing technologies, large language models cannot handle long texts during text generation due to memory limitations, and using larger models increases computational and storage requirements, making it impossible to generate long texts.
By introducing an external memory database, the textual guidance information in the memory database is used to guide a large language model to generate long texts, thus solving the problem of insufficient contextual memory, avoiding the need to replace the model itself, and reducing computational and storage requirements.
It enables the generation of longer text without increasing computational and storage requirements, ensures contextual consistency during text generation, and breaks through the text length limit.
Smart Images

Figure CN119294375A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of text processing technology, and in particular to a text generation method, device, electronic device, and storage medium. Background Art
[0002] Text generation tasks are an important part of natural language processing tasks. In some business scenarios, long text generation is required, such as results, reports, or articles.
[0003] In related solutions, large language models are usually used to participate in text generation tasks to obtain the desired long text, which can effectively achieve text generation tasks. However, when training a large language model, the entire text needs to be loaded into memory, which limits the length of text that can be processed by the large language model, resulting in the inability to generate long text. Moreover, in order to generate longer texts, a larger language model is chosen. Although this type of language model has a larger context window and can process longer texts, it also has greater requirements for computing and storage, which greatly limits its use. Summary of the invention
[0004] The embodiments of the present disclosure provide a text generation method, device, electronic device, and storage medium, which solve the problem that long text cannot be generated during the text generation process.
[0005] In a first aspect, an embodiment of the present disclosure provides a text generation method, the method comprising:
[0006] Determine current text description information used by the text generation model to perform the current sub-text generation task, wherein the current text description information includes text summary content required for performing the current sub-text generation task to generate text specific content and text specific content inherited before performing the current sub-text generation task;
[0007] Determining current text guidance information used by the current sub-text generation task from a memory database of the text generation model, wherein the current text guidance information is used to guide the generation of specific text content having a reference text feature form when executing the current sub-text generation task to correspond to the specific text content generated by guiding the generation of multiple consecutive text generation tasks;
[0008] Based on the current text description information and the current text guide information, the text generation module of the text generation model is used to perform the current sub-text generation task to generate specific text content, and the text generation module is pre-configured and generated based on a large language model controller.
[0009] In a second aspect, an embodiment of the present disclosure further provides a text generation device, the device comprising:
[0010] A determination unit, used to determine current text description information adopted by the text generation model to perform the current sub-text generation task, wherein the current text description information includes text summary content required for performing the current sub-text generation task to generate text specific content and text specific content inherited before performing the current sub-text generation task;
[0011] A guiding unit, used to determine the current text guiding information used by the current sub-text generation task from the memory database of the text generation model, wherein the current text guiding information is used to guide the generation of specific text content with the reference text feature form when executing the current sub-text generation task to correspond with the specific text content generated by guiding the continuous multiple text generation tasks;
[0012] A generation unit is used to perform a current sub-text generation task based on the current text description information and the current text guide information using a text generation module of the text generation model to generate specific text content, wherein the text generation module is pre-configured and generated based on a large language model controller.
[0013] In a third aspect, an electronic device is also provided in an embodiment of the present disclosure, the electronic device comprising:
[0014] at least one processor; and
[0015] a memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the text generation method described in any one of the above embodiments.
[0017] In a fourth aspect, a computer-readable medium is also provided in an embodiment of the present disclosure, wherein the computer-readable medium stores computer instructions, and the computer instructions are used to enable a processor to implement the text generation method described in any one of the above embodiments when executed.
[0018] The technical solution of the disclosed embodiment, when generating a long text, for each text generation task to be executed, the text description information used by the text generation task will be determined, the text description information includes the text summary content required for executing each text generation task to generate the specific content of the text and the specific content of the text inherited before executing each text generation task, and at the same time, the text guidance information stored in the memory database can be used to guide the generation of the specific content of the text with the reference text feature form and guide the text specific content generated by the continuous multiple text generation tasks to correspond to each other, and the text guidance information stored in the memory database can be used to guide the generation of the specific content of the text with the reference text feature form and guide the text specific content generated by the continuous multiple text generation tasks to correspond to each other, and the problem that the context memory of the text generation module configured based on the large language model controller is relatively short, resulting in the inability to generate long texts, and the text generation module can break through the text length limit by using the text guidance information that can guide the text specific content generated by the continuous multiple text generation tasks to correspond to each other, so that the text generation model can process longer texts. And because the text generation module itself is not replaced, but the externally connected memory data is used to negatively assist the guidance to generate text, the calculation and storage requirements will not be greatly increased.
[0019] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0021] Figure 1 A flowchart of a text generation method provided by an embodiment of the present disclosure;
[0022] Figure 2 A schematic diagram of a text generation architecture applicable to an embodiment of the present disclosure;
[0023] Figure 3 A flowchart of another text generation method provided by an embodiment of the present disclosure;
[0024] Figure 4 A flowchart of another text generation method provided in an embodiment of the present disclosure;
[0025] Figure 5 A schematic diagram of screening and adjusting specific contents of multiple versions of texts applicable to an embodiment of the present disclosure;
[0026] Figure 6 A structural block diagram of a text generation device provided by an embodiment of the present disclosure;
[0027] Figure 7 A structural block diagram of an electronic device for implementing the text generation method of an embodiment of the present disclosure. DETAILED DESCRIPTION
[0028] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0029] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0030] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0031] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0032] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0033] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0034] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0035] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0036] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0037] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0038] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0039] In the following embodiments, each embodiment provides optional features and examples at the same time, and the various features recorded in the embodiments can be combined to form multiple optional solutions, and each numbered embodiment should not be regarded as only one technical solution. In addition, the embodiments in this disclosure and the features in the embodiments can be combined with each other without conflict.
[0040] Figure 1 A flowchart of a text generation method provided in an embodiment of the present disclosure. The technical solution of this embodiment can be applied to the situation of generating long texts in text generation business scenarios, especially the situation of generating long texts such as novels, reports and articles. The method can be executed by a text generation device, which can be implemented by software and / or hardware and is generally integrated on any electronic device with network communication function, including but not limited to computers, personal digital assistants and other devices.
[0041] like Figure 1 As shown, the text generation method of this embodiment may include the following processes S110-S130:
[0042] S110, determining current text description information used by the text generation model to execute the current sub-text generation task, the current text description information including text summary content required to execute the current sub-text generation task to generate text specific content and text specific content inherited before executing the current sub-text generation task.
[0043] See also Figure 2 The text generation model may include a text generation module and a memory database. The text generation module may be a basic module unit of the text generation model that is pre-configured and generated based on a large language model controller. The text generation model usually includes a text generation module. When executing text generation tasks in different orders continuously, the same text generation module may be called cyclically, such as Figure 2 The text generation module 1, the text generation module 2, and the text generation module 3 displayed from left to right in the figure respectively represent the circular call diagram of the text generation module when the text generation task is executed at different time points.
[0044] A complete long text generation task can be divided into multiple text generation tasks. For each text generation task, the text summary content required for executing each text generation task to generate specific text content can be determined. The text summary content can be the central idea, content summary, story outline or general plot of the text to be generated by each text generation task. Optionally, the text generation task includes text expansion, text continuation, text rewriting or text rewriting.
[0045] At the same time, considering that when generating long texts such as novels, reports and articles, the specific content of each part of the long text is progressively developed on the basis of the previous one, and is closely linked, for this reason, for each text generation task, it is also necessary to obtain the specific content of the nearest text inherited before the current text generation task, so that when executing each text generation task, it will be further generated on the basis of the specific content of the previously generated text, realizing the progressive development of the previous and next texts. Among them, the specific content of the text can be a detailed text that is generated based on the text summary content and can present the text summary content after generation.
[0046] As an optional but non-limiting implementation method, the text summary content required to generate the specific text content when executing the current sub-text generation task is the text summary content customized input before the current sub-text generation task is executed, and the text specific content inherited before executing the current sub-text generation task is the text specific content customized input before the current sub-text generation task is executed.
[0047] See also Figure 2 , it is explained above that a complete long text generation task can be divided into multiple text generation tasks. For the same long text generation task, when the text generation task is executed for the first time, the input of the text generation task is an initial text summary content that is customized input through the input interface before executing the text generation task. At the same time, before executing the text generation task, an initial text specific content that is customized input can also be obtained through the input interface.
[0048] As another optional but non-limiting implementation method, the text summary content required to generate the text specific content when executing the current sub-text generation task is the text summary content generated by the previous text generation task before the current sub-text generation task, and the text specific content inherited before executing the current sub-text generation task is the text specific content generated by the previous text generation task.
[0049] See also Figure 2 For the text generation tasks that are executed continuously in different orders in the same long text generation task, text generation module 1, text generation module 2, and text generation module 3 respectively represent the circular call diagrams of the text generation modules when the text generation tasks are executed at different time points, and the internal structure of the text generation module used each time is the same.
[0050] See also Figure 2 , taking the first text generation module 1 on the left as an example, the large language model (LLM) controller in the text generation module will receive the text summary output by the last text generation task when the text generation task was last executed. The content is the internal hidden state of the large language model controller of the text generation module corresponding to the last text generation task, recorded as h t-1 , and can output the text summary content of the last text generation task h t-1 Determine the text summary content of the specific content of the text to be generated for the current text generation task. At the same time, the specific content of the text generated by the previous text generation task is X t-1 As the specific content of the text inherited before executing the current sub-text generation task.
[0051] S120. Determine the current text guidance information used by the current text generation task from the memory database of the text generation model. The current text guidance information is used to guide the generation of text specific content with reference text feature form when executing the current text generation task, and to coordinate with the text specific content generated by guiding consecutive text generation tasks.
[0052] Since large language models need to load text into memory during training, the length of text that can be processed by large language models is limited, resulting in the inability to generate long texts. If a larger language model is chosen to generate longer texts, although longer texts can be processed, the demand for computing and storage will also be greater. To this end, based on the text generation module in the text generation model, a memory database is introduced into the text model, and the text generation module can be associated with the memory database. Among them, the memory database may include a DB database for retrieving and storing the specific content of the text.
[0053] See also Figure 2The memory database may store text guidance information to be used for executing each text generation task. The text guidance information may include prompt guidance words that can be used to guide the generation of specific text content with reference text feature forms when executing the current text generation task. The prompt guidance words can guide the large language model controller in the text generation module to a specific text feature form when generating text.
[0054] See also Figure 2 The text guidance information may also include the specific text content that can guide the text specific content generated by the consecutive multiple text generation tasks to be consistent with each other, which is stored in the memory database and already exists before the current sub-text generation task and belongs to the same long text generation task as the current sub-text generation task, and is recorded as m read from the memory database t-1 .
[0055] It can be understood that correspondence can be the mutual connection between the front and back parts of the text, a kind of writing technique, also known as "echo from beginning to end."
[0056] S130. Based on the current text description information and the current text guidance information, a text generation module of a text generation model is used to perform the current text generation task to generate specific text content. The text generation module is pre-configured and generated based on a large language model controller.
[0057] See also Figure 2 , after obtaining the current text description information and current text guidance information required for executing the current sub-text generation task, they can be input into the text generation module of the text generation model to execute the current sub-text generation task, and obtain the specific text content corresponding to the current sub-text generation task. The generation of long text can be achieved by executing multiple text generation tasks in a loop. It can be seen that the problem of the short context memory of the text generation module configured based on the large language model controller, which leads to the inability to generate long texts, can be solved by introducing an external memory database. The text guidance information that can guide the specific text content generated by multiple consecutive text generation tasks to be consistent can alleviate the problem of insufficient context memory of the text generation module, allowing the text generation module to break through the text length limit, so that the text generation model can process longer texts.
[0058] The technical solution of the disclosed embodiment can solve the problem that the context memory of the text generation module configured based on the large language model controller is relatively short, which leads to the inability to generate long texts, by introducing an external memory database when generating long texts. By using the text guidance information that can guide the specific content of the text generated by multiple consecutive text generation tasks to be consistent, the text generation module can break through the text length limit, so that the text generation model can process longer texts. And because the text generation module itself is not replaced, but the externally connected memory data is used to negatively assist in guiding the text generation, the computing and storage requirements will not be greatly increased. It is particularly noteworthy that the text content corresponding to multiple text generation tasks can be effectively memorized through the memory database, and the specific content of the text generated before will not be forgotten when the new specific content of the text continues to be generated, so that the specific content of the text generated before can be used to generate long texts, so that the text generation module can break through the text length limit.
[0059] Figure 3 A flowchart of another text generation method provided in an embodiment of the present disclosure. The technical solution of this embodiment further optimizes the process of determining the current text guidance information used in the current sub-text generation task from the memory database of the text generation model in the aforementioned embodiment on the basis of the aforementioned embodiment. This embodiment can be combined with various optional solutions in one or more of the above-mentioned embodiments.
[0060] like Figure 3 As shown, the text generation method of this embodiment may include the following processes S310-S350:
[0061] S310, determining the current text description information used by the text generation model to execute the current sub-text generation task, the current text description information including the text summary content required to execute the current sub-text generation task to generate the text specific content and the text specific content inherited before executing the current sub-text generation task.
[0062] S320, selecting a target text embedding vector from the candidate text embedding vectors stored in the memory database of the text generation model, the candidate text embedding vector being a vector generated by transforming the specific content of the text that existed before the current text generation task, and the target text embedding vector and the embedding vector of the current text description information satisfy a preset similarity condition.
[0063] See also Figure 2The specific text content stored in the memory database is the detailed text that the text generation module has generated before the current text generation task, which can be directly read and understood. It can be a sentence, a paragraph, or a complete document. The problem of insufficient memory of the specific content of the context in the text generation module can be alleviated by memorizing data, but when applied, it may only consider the text representation in the text, and there is no effective analysis of the semantics of the specific content of the text, resulting in the text guidance information read from the memory database not matching the text generation task.
[0064] To this end, the existing text content that exists before each text generation task and belongs to the same long text task can be vectorized in the memory database to obtain the candidate text embedding vector of the text content that exists before the current text generation task. The text embedding vector can be converted into a vector form by using the vector database of the language chain. The text embedding vector can capture the semantic information of the text content, so that similar text content has similar embedding vectors.
[0065] Optionally, the memory database may include a text specific content portion and a text embedding vector portion of the text specific content, and the text embedding vector portion may be stored on a disk for subsequent search and retrieval based on the similarity of the embedding vectors.
[0066] See also Figure 2 When querying the embedding vector in the memory database, an embedding vector can be calibrated according to the current text description information corresponding to the current text generation task, and then the candidate text embedding vector stored in the memory database of the text generation model is retrieved and queried, and the candidate text embedding vector that meets the preset similarity condition with the embedding vector of the current text description information is used as the target text embedding vector.
[0067] Using the above method, the memory database is used to store and retrieve the embedded vectors of the specific content of the text, which enables the text generation model to effectively manage and retrieve a large amount of specific text content and support various complex queries, such as semantic search, similarity comparison, etc. In this way, when the memory database is used to alleviate the insufficient context memory of the text generation module, a more suitable text specific content memory can be provided for each text generation, so as to ensure the context consistency in the long text generation process as much as possible.
[0068] As an optional but non-limiting implementation, selecting a target text embedding vector from candidate text embedding vectors stored in a memory database of a text generation model may include steps A1-A3:
[0069] Step A1: determining an embedding vector of current text description information, where the embedding vector of the current text description information is generated by performing vector transformation on text data in the current text description information.
[0070] Step A2: performing embedding vector similarity matching between the embedding vector of the current text description information and the embedding vector of the candidate text stored in the memory database of the text generation model.
[0071] Step A3: based on the embedding vector similarity matching result, a target text embedding vector is selected from the candidate text embedding vectors stored in the memory database of the text generation model, where the target text embedding vector is a preset number of embedding vectors that are sorted in descending order according to the embedding vector similarity.
[0072] By storing the text content generated by each text generation task in the memory database, effective memory management of the context content can be achieved, which enables the text generation to remember enough context content, and will not forget the previously generated text content when continuing to generate new text content, so that the previously generated text content can be used to generate long text. At the same time, when the text embedding vector used to realize the context content is used for memory recovery, the text that meets the similarity condition can be selectively restored to avoid memory overload when the text embedding vector memorized in the memory database is used.
[0073] S330, determining a pre-imported reference prompt guidance template from a memory database of a text generation model, wherein the reference prompt guidance template contains reference text features required for guiding generation of text.
[0074] See also Figure 2 In the lower left corner, an external database E0 is pre-set. When a long text generation operation such as text rewriting or text expansion is required, the reference prompt guidance template in the external database E0 can be imported into the memory database. In this way, when performing a text generation task, the reference prompt guidance template can be extracted from the reference prompt guidance template to guide the generation of reference texts. For example, the reference prompt guidance template can be some text examples or initial text data carrying reference text features, and the reference text features can be the style of text expansion or rewriting.
[0075] S340, based on the target text embedding vector and the reference prompt guidance template, determine the current text guidance information used in the current sub-text generation task.
[0076] Among them, the current text guidance information is used to guide the generation of text specific content with reference text feature form when executing the current text generation task and to coordinate with the text specific content generated by guiding consecutive multiple text generation tasks.
[0077] See also Figure 2, the target text embedding vector can be transformed to obtain the specific text content that guides the text generated by multiple consecutive text generation tasks, and the reference text features to be guided to be generated when performing the current text generation task can be extracted from the reference prompt guidance template, and then the obtained content can be used as the current text guidance information adopted by the current text generation task.
[0078] S350. Based on the current text description information and the current text guidance information, a text generation module of a text generation model is used to perform the current text generation task to generate specific text content. The text generation module is pre-configured and generated based on a large language model controller.
[0079] The technical solution of the disclosed embodiment, while ensuring the technical effects that can be achieved by the aforementioned embodiments, can achieve effective memory management of the context text by storing the specific content of the text generated by each text generation task in a memory database when generating a long text, so that the text generation can remember enough of the context text, and will not forget the previously generated text content when continuing to generate new text content, so that the previously generated text content can be used to generate a long text. At the same time, when the text embedding vector used to realize the context text content is used for memory recovery, the text that meets the similarity condition can be selectively restored to avoid memory overload when the text embedding vector memorized in the memory database is used.
[0080] Figure 4 A flowchart of another text generation method provided for an embodiment of the present disclosure. The technical solution of this embodiment further optimizes the process of performing the current sub-text generation task by the text generation module using the text generation model based on the current text description information and the current text guidance information in the aforementioned embodiment on the basis of the above embodiment. This embodiment can be combined with various optional solutions in one or more of the above embodiments.
[0081] like Figure 4 As shown, the text generation method of this embodiment may include the following processes S410-S440:
[0082] S410, determining the current text description information used by the text generation model to execute the current text generation task, the current text description information including the text summary content required to execute the current text generation task to generate the text specific content and the text specific content inherited before executing the current text generation task.
[0083] S420. Determine the current text guidance information used by the current text generation task from the memory database of the text generation model. The current text guidance information is used to guide the generation of text specific content with reference text feature form when executing the current text generation task, and to coordinate with the text specific content generated by guiding consecutive text generation tasks.
[0084] S430: Input the current text description information and the current text guiding information into a text generation module of a text generation model.
[0085] See also Figure 2 , taking the first text generation module 1 on the left as an example, the large language model (LLM) controller in the text generation module will receive the text summary output by the last text generation task when the text generation task was last executed. The content is the internal hidden state of the large language model controller of the text generation module corresponding to the last text generation task, recorded as h t-1 , and can output the text summary content of the last text generation task h t-1 Determine the text summary content of the specific content of the text to be generated for the current text generation task. At the same time, the specific content of the text generated by the previous text generation task is X t-1 As the specific content of the text inherited before executing the current sub-text generation task.
[0086] See also Figure 2 , the specific content of the text generated by the previous text generation task X t-1 The text summary content h output by the previous text generation task t-1 , and m read from the memory database t-1 And the prompt guide words can be used to guide the generation of text specific content with reference text feature form when executing the current text generation task, and at the same time imported into the text generation module of the text generation model.
[0087] S440: Determine, through the text generation module, the text summary content required for executing the next text generation task to generate the text specific content, and determine, through the text generation module, the text specific content of the current text generation task.
[0088] Among them, the text generation module is pre-configured and generated based on a large language model controller.
[0089] See also Figure 2 , the text generation module of the text generation model will simultaneously output the text summary content h required to perform the next text generation task to generate specific text content t The specific content of the text of the current text generation task X t .
[0090] As an optional but non-limiting implementation, after the text generation module determines the specific content of the text of the current text generation task, the following steps are also included:
[0091] The specific text content of the current text generation task is converted into a vector and written into the memory database.
[0092] See also Figure 2 The write operation is to add the new text content to the memory database, which can be achieved by converting the newly generated text content into a text embedding vector and then storing the text embedding vector on disk. Both read and write operations manage the memory operations of the memory database, so that the text generation model can effectively manage and use the text content memory it has generated. Each read and write is converted into a text form that the memory database can accept.
[0093] As an optional but non-limiting implementation, determining the specific text content of the current sub-text generation task by the text generation module may include steps B1-B2:
[0094] Step B1: Determine the specific contents of at least two candidate versions of text output by the text generation module when executing the current text generation task.
[0095] Step B2: Filter and adjust the specific text contents of at least two candidate versions to obtain the specific text contents of the current sub-text generation task.
[0096] See also Figure 2 When the text generation module of the text generation model outputs the specific text content of the current text generation task, it will also give k outputs O t1 , O t2 , O t3 ...O tk , Figure 2 Only three outputs are shown in FIG. 1 . In fact, there may be k outputs, each of which corresponds to a version of the text content. By screening and adjusting the text content of multiple versions, a satisfactory text content can be obtained. t , that is, the specific content of the text of the current text generation task X t .
[0097] Alternatively, see Figure 2 , the large language model controller is the core of the text generation module. The model parameter of the large language model controller is θ, the reference prompt guidance template used is P1, and the mechanism of the large language model controller can be expressed as follows:
[0098] h t , O t1 , Ot2 , O t3 ...O tk =Large language model controller (h t-1 , X t-1 , m t-1 , P1)
[0099] Among them, h t-1 Indicates the text summary content required to perform the current text generation task to generate the specific text content, which is convenient for guiding the large language model controller in the text generation module to write the specific text content desired by the current text generation task. t-1 Indicates the specific content of the text inherited before executing the current text generation task, m t-1 It indicates the specific text content that exists before the current sub-text generation task and belongs to the same long text generation task as the current sub-text generation task, which is stored in the memory bank that can guide the specific text content generated by multiple consecutive text generation tasks to be consistent.
[0100] See also Figure 2 In the text generation module, the large language model controller wants to write the specific text content of the current text generation task, which requires the text summary content of the current text generation task. At the same time, because the memory of the context of the large language model controller is not that long, in order to keep the long text consistent, it is necessary to remember the m in the database. t-1 In addition, the generation of specific details in the text requires the corresponding output X of the previous text generation task t-1 Given the above input plus the reference prompt guide template P1, the large language model controller can output the text summary h required for the next text generation task t , and the specific contents of the multiple versions of the text corresponding to the current text task O t1 , O t2 , O t3 ...O tk .
[0101] As an optional but non-limiting implementation method, by screening and adjusting the specific text contents of at least two candidate versions, obtaining the specific text contents of the current sub-text generation task may include steps C1-C2.
[0102] Step C1: In response to the version screening operation on the text specific contents of at least two candidate versions, the text specific contents of the target version are screened out.
[0103] See also Figure 5 , the specific contents of the text in the generated multiple text versions O t1 , O t2 , O t3 ...Otk Afterwards, the specific contents of the multiple text versions can be preliminarily screened to select the specific contents of the text corresponding to the version with the best text performance. This preliminary screening process can be based on various criteria, such as accuracy, coherence, and innovation of the content.
[0104] Step C2: in response to the editing operation on the specific content of the text of the target version, the specific content of the text adjusted by the text editing is obtained and determined as the specific content of the text for the current sub-text generation task.
[0105] See also Figure 5 Based on the best version of the text, the text can be reviewed and modified manually or automatically, and any factual errors in the text can be corrected, the coherence of the text can be adjusted, or the text can be modified according to specific needs. After review and modification, a high-quality text that meets the needs is obtained.
[0106] The above method actually introduces user interaction, which ensures that the output text content has both the efficient generation capability of the machine and the detailed review capability of humans, so as to achieve the quality and diversity of the generated text content. By introducing user interaction, users are allowed to select or modify text, which not only improves the quality of the generated text content, but also increases the diversity of the generated text content.
[0107] Optionally, for the text generation model provided in this embodiment, the training sample data used can be long texts such as question and answer text data included on the Internet, as well as publicly available long text data such as various famous novels. By dividing the long text into short texts, the training data required for the text generation model can be constructed.
[0108] Optionally, for the text generation model provided in this embodiment, the training parameters are set as follows: the length of the specific content of each text segment does not exceed 5,000 words, and the size of the memory database is 10,000, which means that the model can remember the most recent 10,000 text embedding vectors; the update frequency of the memory database is 1,000, and the memory database is updated once every time 1,000 words of text specific content are generated, and the dimension of the text embedding vector is 768.
[0109] The technical solution of the disclosed embodiment can solve the problem that the context memory of the text generation module configured based on the large language model controller is relatively short, which leads to the inability to generate long texts, by introducing an external memory database when generating long texts. By using the text guidance information that can guide the specific content of the text generated by multiple consecutive text generation tasks to be consistent, the text generation module can break through the text length limit, so that the text generation model can process longer texts. And because the text generation module itself is not replaced, but the externally connected memory data is used to negatively assist in guiding the text generation, the computing and storage requirements will not be greatly increased. It is particularly noteworthy that the text content corresponding to multiple text generation tasks can be effectively memorized through the memory database, and the specific content of the text generated before will not be forgotten when the new specific content of the text continues to be generated, so that the specific content of the text generated before can be used to generate long texts, so that the text generation module can break through the text length limit.
[0110] Figure 6 This is a structural block diagram of a text generation device provided in an embodiment of the present disclosure. The technical solution of this embodiment can be applied to the situation of generating long texts in text generation business scenarios, especially the situation of generating long texts such as novels, reports and articles. The device can be implemented by software and / or hardware and is generally integrated on any electronic device with network communication function, which includes but is not limited to computers, personal digital assistants and other devices.
[0111] like Figure 6 As shown, the text generation device of this embodiment may include: a determination unit 610, a guiding unit 620 and a generation unit 630. Among them:
[0112] A determination unit 610 is used to determine current text description information used by the text generation model to perform the current sub-text generation task, wherein the current text description information includes text summary content required for performing the current sub-text generation task to generate text specific content and text specific content inherited before performing the current sub-text generation task;
[0113] A guiding unit 620 is used to determine the current text guiding information used by the current sub-text generation task from the memory database of the text generation model, wherein the current text guiding information is used to guide the generation of text specific content with the reference text feature form when executing the current sub-text generation task to correspond with the text specific content generated by guiding the continuous multiple text generation tasks;
[0114] The generation unit 630 is used to perform the current sub-text generation task to generate specific text content using the text generation module of the text generation model based on the current text description information and the current text guidance information, and the text generation module is pre-configured and generated based on a large language model controller.
[0115] On the basis of the above embodiment, optionally, the text summary content required for executing the current sub-text generation task to generate the text specific content is the text summary content generated by the previous text generation task before the current sub-text generation task, and the text specific content inherited before executing the current sub-text generation task is the text specific content generated by the previous text generation task.
[0116] On the basis of the above embodiment, optionally, the text summary content required for executing the current sub-text generation task to generate the text specific content is the text summary content customized input before the current sub-text generation task, and the text specific content inherited before executing the current sub-text generation task is the text specific content customized input before the current sub-text generation task.
[0117] Based on the above embodiment, optionally, the text generation task includes text expansion, text continuation, text rewriting or text rewriting.
[0118] Based on the above embodiment, optionally, determining the current text guidance information used by the current sub-text generation task from the memory database of the text generation model includes:
[0119] Selecting a target text embedding vector from candidate text embedding vectors stored in a memory database of a text generation model, wherein the candidate text embedding vector is a vector generated by transforming the specific content of a text that already existed before the current sub-text generation task, and the target text embedding vector and the embedding vector of the current text description information meet a preset similarity condition;
[0120] Determine a pre-imported reference prompt guiding template from a memory database of a text generation model, wherein the reference prompt guiding template contains reference text features required for guiding generation of text;
[0121] Based on the target text embedding vector and the reference prompt guidance template, current text guidance information adopted by the current sub-text generation task is determined.
[0122] Based on the above embodiment, optionally, selecting a target text embedding vector from candidate text embedding vectors stored in a memory database of a text generation model includes:
[0123] Determine an embedding vector of current text description information, where the embedding vector of the current text description information is generated by performing vector conversion on text data in the current text description information;
[0124] The embedding vector of the current text description information is matched with the embedding vector of the candidate text stored in the memory database of the text generation model;
[0125] Based on the embedding vector similarity matching result, a target text embedding vector is screened out from the candidate text embedding vectors stored in the memory database of the text generation model, and the target text embedding vector is a preset number of embedding vectors that are sorted from large to small according to the embedding vector similarity.
[0126] On the basis of the above embodiment, optionally, based on the current text description information and the current text guide information, the text generation module of the text generation model is used to perform the current sub-text generation task, including:
[0127] Inputting the current text description information and the current text guide information into a text generation module of the text generation model;
[0128] Determine, by means of a text generation module, the text summary content required for executing the next text generation task to generate the specific text content;
[0129] The specific text content of the current text generation task is determined through the text generation module.
[0130] Based on the above embodiment, optionally, after determining the specific content of the text of the current sub-text generation task by the text generation module, the method further includes:
[0131] The specific text content of the current text generation task is converted into a vector and written into the memory database.
[0132] Based on the above embodiment, optionally, determining the specific text content of the current sub-text generation task through a text generation module includes:
[0133] Determine the specific contents of at least two candidate versions of text output by the text generation module when executing the current text generation task;
[0134] The specific text content of the current sub-text generation task is obtained by screening and adjusting the specific text content of the at least two candidate versions.
[0135] On the basis of the above embodiment, optionally, by screening and adjusting the specific text contents of the at least two candidate versions, the specific text contents of the current sub-text generation task are obtained, including:
[0136] In response to the version screening operation on the text specific contents of the at least two candidate versions, screening out the text specific contents of the target version;
[0137] In response to the editing operation on the specific content of the text of the target version, the specific content of the text adjusted by the text editing is obtained and determined as the specific content of the text for the current sub-text generation task.
[0138] The technical solution of the disclosed embodiment can solve the problem that the context memory of the text generation module configured based on the large language model controller is relatively short, which leads to the inability to generate long texts, by introducing an external memory database when generating long texts. By using the text guidance information that can guide the specific content of the text generated by multiple consecutive text generation tasks to be consistent, the text generation module can break through the text length limit, so that the text generation model can process longer texts. And because the text generation module itself is not replaced, but the externally connected memory data is used to negatively assist in guiding the text generation, the computing and storage requirements will not be greatly increased. It is particularly noteworthy that the text content corresponding to multiple text generation tasks can be effectively memorized through the memory database, and the specific content of the text generated before will not be forgotten when the new specific content of the text continues to be generated, so that the specific content of the text generated before can be used to generate long texts, so that the text generation module can break through the text length limit.
[0139] The text generation device provided in the embodiments of the present disclosure can execute the text generation method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects for executing the text generation method.
[0140] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0141] Reference below Figure 7 , which shows a schematic diagram of the structure of an electronic device 800 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0142] like Figure 7As shown, the electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 806 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0143] Typically, the following devices may be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 806 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 809. The communication devices 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 The electronic device 800 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0144] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0145] The electronic device provided by the embodiment of the present disclosure and the text generation method provided by the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0146] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the text generation method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 809, or installed from the storage device 806, or installed from the ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the text generation method of the embodiment of the present disclosure are executed.
[0147] The embodiments of the present disclosure provide a computer storage medium on which a computer program is stored. When the program is executed by a processor, the text generation method provided in the above embodiments is implemented.
[0148] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0149] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0150] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0151] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: determines the current text description information used by the text generation model to execute the current sub-text generation task, the current text description information includes the text summary content required for executing the current sub-text generation task to generate the text specific content and the text specific content inherited before executing the current sub-text generation task; determines the current text guidance information used by the current sub-text generation task from the memory database of the text generation model, the current text guidance information is used to guide the generation of text specific content with a reference text feature form when executing the current sub-text generation task and guide the generation of text specific content by multiple consecutive text generation tasks to correspond to each other; based on the current text description information and the current text guidance information, uses the text generation module of the text generation model to execute the current sub-text generation task to generate text specific content, and the text generation module is pre-configured and generated based on a large language model controller.
[0152] Alternatively, the computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device executes the text generation method described in any one of the above embodiments.
[0153] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0154] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0155] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".
[0156] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0157] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0158] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0159] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0160] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A text generation method, characterized in that: The method comprises: Determine current text description information used by the text generation model to perform the current sub-text generation task, wherein the current text description information includes text summary content required for performing the current sub-text generation task to generate text specific content and text specific content inherited before performing the current sub-text generation task; Determining current text guidance information used by the current sub-text generation task from a memory database of the text generation model, wherein the current text guidance information is used to guide the generation of specific text content having a reference text feature form when executing the current sub-text generation task to correspond to the specific text content generated by guiding the generation of multiple consecutive text generation tasks; Based on the current text description information and the current text guide information, the text generation module of the text generation model is used to perform the current sub-text generation task to generate specific text content, and the text generation module is pre-configured and generated based on a large language model controller.
2. The method according to claim 1, characterized in that The text summary content required for executing the current sub-text generation task to generate the text specific content is the text summary content generated by the previous text generation task before the current sub-text generation task, and the text specific content inherited before executing the current sub-text generation task is the text specific content generated by the previous text generation task.
3. The method according to claim 1, characterized in that The text summary content required for executing the current sub-text generation task to generate the text specific content is the text summary content customized input before the current sub-text generation task, and the text specific content inherited before executing the current sub-text generation task is the text specific content customized input before the current sub-text generation task.
4. The method according to claim 1, characterized in that: The text generation task includes text expansion, text continuation, text rewriting or text rewriting.
5. The method according to claim 1, characterized in that Determine the current text guidance information used in the current text generation task from the memory database of the text generation model, including: Selecting a target text embedding vector from candidate text embedding vectors stored in a memory database of a text generation model, wherein the candidate text embedding vector is a vector generated by transforming the specific content of a text that already existed before the current sub-text generation task, and the target text embedding vector and the embedding vector of the current text description information meet a preset similarity condition; Determine a pre-imported reference prompt guiding template from a memory database of a text generation model, wherein the reference prompt guiding template contains reference text features required for guiding generation of text; Based on the target text embedding vector and the reference prompt guidance template, current text guidance information adopted by the current sub-text generation task is determined.
6. The method according to claim 5, characterized in that Filtering the target text embedding vector from the candidate text embedding vectors stored in the memory database of the text generation model includes: Determine an embedding vector of current text description information, where the embedding vector of the current text description information is generated by performing vector conversion on text data in the current text description information; The embedding vector of the current text description information is matched with the embedding vector of the candidate text stored in the memory database of the text generation model; Based on the embedding vector similarity matching result, a target text embedding vector is screened out from the candidate text embedding vectors stored in the memory database of the text generation model, and the target text embedding vector is a preset number of embedding vectors that are sorted from large to small according to the embedding vector similarity.
7. The method according to claim 1, characterized in that Based on the current text description information and the current text guide information, a text generation module of the text generation model is used to perform a current sub-text generation task, including: Inputting the current text description information and the current text guide information into a text generation module of the text generation model; Determine, by means of a text generation module, the text summary content required for executing the next text generation task to generate the specific text content; The specific text content of the current text generation task is determined through the text generation module.
8. The method according to claim 7, characterized in that After determining the specific text content of the current text generation task through the text generation module, it also includes: The specific text content of the current text generation task is converted into a vector and written into the memory database.
9. The method according to claim 7, characterized in that: The specific text content of the current text generation task is determined through the text generation module, including: Determine the specific contents of at least two candidate versions of text output by the text generation module when executing the current text generation task; The specific text content of the current sub-text generation task is obtained by screening and adjusting the specific text content of the at least two candidate versions.
10. The method according to claim 9, characterized in that By screening and adjusting the specific text contents of the at least two candidate versions, the specific text contents of the current sub-text generation task are obtained, including: In response to the version screening operation on the text specific contents of the at least two candidate versions, screening out the text specific contents of the target version; In response to the editing operation on the specific content of the text of the target version, the specific content of the text adjusted by the text editing is obtained and determined as the specific content of the text for the current sub-text generation task.
11. A text generation device, characterized in that: The device comprises: A determination unit, used to determine current text description information adopted by the text generation model to perform the current sub-text generation task, wherein the current text description information includes text summary content required for performing the current sub-text generation task to generate text specific content and text specific content inherited before performing the current sub-text generation task; A guiding unit, used to determine the current text guiding information used by the current sub-text generation task from the memory database of the text generation model, wherein the current text guiding information is used to guide the generation of specific text content with the reference text feature form when executing the current sub-text generation task to correspond with the specific text content generated by guiding the continuous multiple text generation tasks; A generation unit is used to perform a current sub-text generation task based on the current text description information and the current text guide information using a text generation module of the text generation model to generate specific text content, wherein the text generation module is pre-configured and generated based on a large language model controller.
12. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the text generation method according to any one of claims 1 to 10.
13. A computer readable medium, characterized in that The computer-readable medium stores computer instructions, and the computer instructions are used to enable a processor to implement the text generation method according to any one of claims 1 to 10 when executed.