Text generation method, system and apparatus

By analyzing the initial prompt text to determine the text generation intent and target text scenario, and selecting reference prompt words to generate the target text, the problem of insufficient targeting and personalization of content generated by large pre-trained language models is solved, and higher quality text generation is achieved.

WO2026016623A1PCT designated stage Publication Date: 2026-01-22ALIBABA (CHINA) CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/095871
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-07-15
Filing Date
2025-05-20
Publication Date
2026-01-22

AI Technical Summary

Technical Problem

In existing technologies, when using large pre-trained language models to create text content, the generated content lacks relevance and personalization, making it difficult to accurately control the direction and style of the content, especially when targeting specific audiences.

Method used

By parsing the initial prompt text sent by the client, the text generation intent and target text scenario are determined, target reference prompt words are selected, and the target text is generated using a text generation model, thereby reducing the input of irrelevant information and improving the generation quality.

Benefits of technology

It improves the accuracy of the text generation model in understanding and executing user needs, resulting in more targeted text that better meets user requirements and enhances the relevance and personalization of the content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025095871_22012026_PF_FP_ABST
    Figure CN2025095871_22012026_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present disclosure are a text generation method, system and apparatus. The text generation method comprises: parsing an initial prompt text sent by a client, so as to determine a text generation intent of the initial prompt text, determining a target text scenario on the basis of the text generation intent, and determining a target text category of a reference prompt text on the basis of the target text scenario; determining a plurality of reference prompt words corresponding to the target text category, and returning the plurality of reference prompt words to the client; in response to a target reference prompt word sent by the client, on the basis of the target reference prompt word and the initial prompt text, determining the reference prompt text, wherein the target reference prompt word is selected from among the plurality of reference prompt words; and using a text generation model to perform text processing on the reference prompt text, so as to generate a target text, and returning the target text to the client. The target text better meets user requirements and has better quality.
Need to check novelty before this filing date? Find Prior Art

Description

Text generation methods, systems and devices Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a text generation method. This disclosure also relates to a text generation system, a text generation device, a computing device, and a computer-readable storage medium. Background Technology

[0002] With the rapid development of artificial intelligence and large models, especially in the fields of Natural Language Processing (NLP) and machine learning, large pre-trained language models have demonstrated powerful capabilities in multiple aspects such as text generation, language understanding, and content creation. The emergence of these models has provided new possibilities for automated content creation, especially in areas such as news writing, marketing copywriting, creative writing, educational resources, and entertainment content.

[0003] Users can use large pre-trained language models to create text content. However, when users impose too many requirements and style controls on large pre-trained language models at once, allowing them to freely choose based on the content, it increases the difficulty of generating content. This makes it difficult for large pre-trained language models to accurately generate content that meets the user's current requirements. Especially when creating text content for a specific audience, it is often difficult to accurately control the direction and style of the content, resulting in insufficient targeting and personalization of the generated content. Summary of the Invention

[0004] In view of this, embodiments of this disclosure provide a text generation method. One or more embodiments of this disclosure also relate to two other text generation methods, a text generation system, a text generation apparatus, a computing device, a computer-readable storage medium, and a computer program product, to address the technical deficiencies in the prior art where the generated content lacks specificity and personalization when using large pre-trained language models for text content creation.

[0005] According to a first aspect of the present disclosure, a text generation method is provided, comprising:

[0006] The initial prompt text sent by the client is parsed to determine the text generation intent of the initial prompt text, and the target text scenario is determined based on the text generation intent. The target text category of the reference prompt text is determined based on the target text scenario.

[0007] Identify multiple reference prompt words corresponding to the target text category, and return the multiple reference prompt words to the client;

[0008] In response to a target reference prompt word sent by the client, a reference prompt text is determined based on the target reference prompt word and the initial prompt text, wherein the target reference prompt word is selected from the plurality of reference prompt words;

[0009] The reference prompt text is processed using a text generation model to generate the target text, which is then returned to the client.

[0010] According to a second aspect of the present disclosure, another text generation method is provided, comprising:

[0011] Parse the initial prompt text, determine the text generation intent of the initial prompt text, determine the target text scenario based on the text generation intent, and determine the target text category of the reference prompt text based on the target text scenario;

[0012] Identify and display multiple reference prompt words corresponding to the target text category;

[0013] Determine the target reference prompt word, and determine the reference prompt text based on the target reference prompt word and the initial prompt text, wherein the target reference prompt word is selected from the plurality of reference prompt words;

[0014] The reference prompt text is processed using a text generation model to generate the target text, which is then displayed.

[0015] According to a third aspect of the present disclosure, another text generation method is provided, applied to a text generation system, the system including a client and a server, wherein...

[0016] The client sends an initial prompt text to the server, wherein the initial prompt text is determined by the user's interactive operation on the client's user interface;

[0017] The server parses the initial prompt text sent by the client, determines the text generation intent of the initial prompt text, determines the target text scenario based on the text generation intent, determines the target text category of the reference prompt text based on the target text scenario, determines multiple reference prompt words corresponding to the target text category, and returns the multiple reference prompt words to the client.

[0018] The client sends the target reference prompt to the server, wherein the target reference prompt is selected from the plurality of reference prompts;

[0019] The server, in response to the target reference prompt word sent by the client, determines the reference prompt text based on the target reference prompt word and the initial prompt text, wherein the target reference prompt word is selected from the plurality of reference prompt words; the server uses a text generation model to process the reference prompt text to generate the target text, and returns the target text to the client.

[0020] According to a fourth aspect of the present disclosure, a text generation system is provided, the system comprising a client and a server, wherein...

[0021] The client is configured to send an initial prompt text to the server, wherein the initial prompt text is determined by the user's interactive operation on the user interface of the client;

[0022] The server is configured to parse the initial prompt text sent by the client, determine the text generation intent of the initial prompt text, determine the target text scenario based on the text generation intent, determine the target text category of the reference prompt text based on the target text scenario, determine multiple reference prompt words corresponding to the target text category, and return the multiple reference prompt words to the client.

[0023] The client is configured to send a target reference prompt to the server, wherein the target reference prompt is selected from the plurality of reference prompts;

[0024] The server is configured to respond to the target reference prompt word sent by the client, determine the reference prompt text based on the target reference prompt word and the initial prompt text, wherein the target reference prompt word is selected from the plurality of reference prompt words; process the reference prompt text using a text generation model to generate the target text, and return the target text to the client.

[0025] According to a fifth aspect of the present disclosure, a text generation apparatus is provided, comprising:

[0026] The parsing module is configured to parse the initial prompt text sent by the client, determine the text generation intent of the initial prompt text, determine the target text scenario based on the text generation intent, and determine the target text category of the reference prompt text based on the target text scenario.

[0027] The return module is configured to determine multiple reference prompt words corresponding to the target text category and return the multiple reference prompt words included in the target text category to the client;

[0028] The determination module is configured to, in response to a target reference prompt word sent by the client, determine the reference prompt text based on the target reference prompt word and the initial prompt text, wherein the target reference prompt word is selected from the plurality of reference prompt words;

[0029] The generation module is configured to use a text generation model to process the reference prompt text, generate target text, and return the target text to the client.

[0030] According to a sixth aspect of the present disclosure, another text generation apparatus is provided, comprising:

[0031] The parsing module is configured to parse the initial prompt text, determine the text generation intent of the initial prompt text, determine the target text scenario based on the text generation intent, and determine the target text category of the reference prompt text based on the target text scenario;

[0032] The prompt word determination module is configured to determine multiple reference prompt words corresponding to the target text category and display the multiple reference prompt words;

[0033] The prompt text determination module is configured to determine a target reference prompt word, and determine the reference prompt text based on the target reference prompt word and the initial prompt text, wherein the target reference prompt word is selected from the plurality of reference prompt words;

[0034] The text display module is configured to use a text generation model to process the reference prompt text, generate target text, and display the target text.

[0035] According to a seventh aspect of the present disclosure, a computing device is provided, comprising:

[0036] Memory and processor;

[0037] The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions, which, when executed by the processor, implement the steps of the above-described text generation method.

[0038] According to an eighth aspect of the present disclosure, a computer-readable storage medium is provided that stores a computer program / instructions that, when executed by a processor, implement the steps of the text generation method described above.

[0039] According to a ninth aspect of the present disclosure, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement the steps of the text generation method described above.

[0040] This disclosure provides a text generation method in one embodiment. By parsing the initial prompt text sent by the client, the method can understand the text generation intent of the initial prompt text. Based on the text generation intent, it returns multiple reference prompt words for the target text category in the target text scenario to the client. By using the target reference prompt words sent by the client and the initial prompt text, a reference prompt text that meets the user's needs can be determined. When there are multiple reference prompt words for the target text category, and the target reference prompt word is selected from multiple reference prompt words, the target reference prompt word can more clearly clarify the user's content creation needs. Furthermore, by inputting the reference prompt text into the text generation model and using the text generation model to generate the target text, the input of the text generation model can be reduced, and the text generation model can be reduced from understanding information that is irrelevant to the current user needs. This allows the text generation model to more accurately understand and execute the user's requirements, improving the quality of the generated target text, and making the target text more in line with the user's needs. Attached Figure Description

[0041] Figure 1 is a schematic diagram of a scenario of a text generation method provided in an embodiment of this disclosure;

[0042] Figure 2 is a flowchart of a text generation method provided in an embodiment of this disclosure;

[0043] Figure 3 is a flowchart of a text generation method for story picture book creation provided in an embodiment of this disclosure;

[0044] Figure 4a is a schematic diagram of a set of prompt words related to story picture book creation provided in an embodiment of this disclosure;

[0045] Figure 4b is a schematic diagram of a reference prompt text provided in an embodiment of this disclosure;

[0046] Figure 4c is a schematic diagram of a generated outline and story synopsis provided in an embodiment of this disclosure;

[0047] Figure 4d is a schematic diagram illustrating the specific content and screen description generated according to an embodiment of this disclosure.

[0048] Figure 5 is a flowchart of a text generation method applied to a text generation system according to an embodiment of the present disclosure;

[0049] Figure 6 is a structural diagram of a text generation system provided in an embodiment of this disclosure;

[0050] Figure 7 is a schematic diagram of the structure of a text generation device provided in an embodiment of this disclosure;

[0051] Figure 8 is a structural block diagram of a computing device provided in an embodiment of this disclosure. Detailed Implementation

[0052] Numerous specific details are set forth in the following description to provide a full understanding of this disclosure. However, this disclosure can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this disclosure. Therefore, this disclosure is not limited to the specific implementations disclosed below.

[0053] The terminology used in one or more embodiments of this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this disclosure. The singular forms “a,” “the,” and “the” as used in one or more embodiments of this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this disclosure refers to and includes any or all possible combinations of one or more associated listed items.

[0054] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this disclosure, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this disclosure, and similarly, second may also be referred to as first. Depending on the context, the word “if” as used herein may be interpreted as “when”, “in response to a determination”, or “when…”.

[0055] Furthermore, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this disclosure are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0056] First, the terms and concepts involved in one or more embodiments of this disclosure will be explained.

[0057] Multi-level Prompts: During the content generation process, keywords or phrases at different levels are used to guide the model to generate content in a specific direction and style. The different levels of prompts reflect the different stages and depths of content creation, helping the model to more accurately capture the user's intent.

[0058] Large-scale pre-trained language models: In the field of AI (Artificial Intelligence), this specifically refers to deep learning models with a huge number of parameters, such as GPT-3 and BERT (Bidirectional Encoder Representations from Transformers, pre-trained language models). These models are usually trained on large-scale data and are able to understand and generate natural language content.

[0059] Personalized customization refers to the system's ability to provide tailored services or content based on each user's specific needs and preferences. In this embodiment of the disclosure, users can customize the structure and content of prompts according to their content creation needs.

[0060] Content Generation: Using artificial intelligence technologies, especially Natural Language Processing (NLP) models, to automatically generate content in various forms such as text, images, audio, and video.

[0061] Model Collaboration: Multiple AI models or systems share information and resources and work together to achieve a common goal. In content creation, different models may have different advantages in text understanding, sentiment analysis, style generation, etc., and collaboration can produce higher quality content.

[0062] Natural Language Processing (NLP) is a branch of artificial intelligence that aims to enable computers to understand, interpret, and generate human language. In content creation systems, NLP enables models to understand the meaning of prompt words and generate corresponding natural language text accordingly.

[0063] The text generation method provided in this disclosure aims to solve problems such as insufficient content personalization, creative exhaustion, low efficiency, and poor interactivity.

[0064] In addition, users often need to be able to interact with the model and guide it to create in a specific direction, but the black-box nature of the model makes such fine-grained control difficult; and although large models are powerful, their operation requires expensive computing resources, and the model generation process may be relatively slow when the input length is too long.

[0065] This disclosure provides a text generation method, and also relates to a text generation system, a text generation apparatus, a computing device, a computer-readable storage medium, and a computer program product, which will be described in detail in the following embodiments.

[0066] Referring to Figure 1, Figure 1 shows a scenario diagram of a text generation method provided according to an embodiment of the present disclosure.

[0067] Specifically, the text generation method is implemented using a terminal device 102 and a server 104. The terminal device 102 is used to send an initial prompt text to the server 104, such as "Generate a fairy tale". In practical applications, users can input the initial prompt text into the terminal device 102 via text or voice. If voice is used, the terminal device 102 will also include a corresponding voice processing component, such as a voice parsing, voice-to-text, and voice synthesis module, to convert the user's voice into text. This disclosure does not impose any restrictions on this.

[0068] A text generation model is trained in server 104. When the multi-level prompt word guidance module of server 104 receives the initial prompt text sent by the terminal device 102, it parses the initial prompt text, determines the text generation intent of the initial prompt text, determines the target text scene based on the text generation intent, and determines the target text category of the reference prompt text based on the target text scene. It determines multiple reference prompt words corresponding to the target text category and returns the multiple reference prompt words to the terminal device 102. In response to the target reference prompt words sent by the terminal device 102, it determines the reference prompt text based on the target reference prompt words and the initial prompt text, inputs the reference prompt text into the text generation model, uses the text generation model to process the reference prompt text, generates the target text, and returns the target text to the terminal device 102.

[0069] The edge device 102 may include a browser, an app (application), or a web application such as an H5 (Hypertext Markup Language 5) application, a lightweight application (also known as a mini-program), or a cloud application. The edge device can be developed based on a software development kit (SDK) provided by the server, such as a real-time communication (RTC) SDK. The edge device can be deployed in an electronic device and depends on the device's operation or certain apps within the device to run. The electronic device may have a display screen and support information browsing, such as a personal mobile terminal like a mobile phone, tablet, or personal computer. Various other types of applications can also be configured in the electronic device, such as human-computer interaction applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, and social media platform software.

[0070] Server 104 can be understood as a server providing various services, including physical servers and cloud servers. Examples include servers providing communication services to multiple clients, servers supporting backend training of models used on clients, and servers processing data sent by clients. It's important to note that Server 104 can be implemented as a distributed server cluster composed of multiple servers, or as a single server. Server 104 can also be a server in a distributed system, or a server integrated with blockchain. Server 104 can also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.

[0071] It is worth noting that the text generation method provided in this embodiment can be executed by server 104. In other embodiments of this disclosure, the text processing model can be deployed on the terminal device 102, so that the terminal device 102 can also have similar functions to server 104, thereby executing the text generation method provided in this embodiment. In other embodiments, the text generation method provided in this embodiment can also be jointly executed by terminal device 102 and server 104.

[0072] The text generation method provided in this disclosure, by parsing the initial prompt text sent by the client, can understand the text generation intent of the initial prompt text. Based on this intent, it returns multiple reference prompt words for the target text category within the target text scenario to the client. This allows for the determination of reference prompt text that meets the user's needs using the target reference prompt words sent by the client and the initial prompt text. When multiple reference prompt words exist for the target text category, and the target reference prompt word is selected from these multiple reference prompt words, the user's content creation needs can be more clearly defined using the target reference prompt word. Furthermore, by inputting the reference prompt text into the text generation model and using the model to generate the target text, the input to the text generation model can be reduced, as can the model's understanding of information irrelevant to the current user needs. This allows the text generation model to more accurately understand and execute the user's requirements, improving the quality of the generated target text, and making the target text more aligned with the user's needs.

[0073] Referring to Figure 2, which shows a flowchart of a text generation method provided in an embodiment of this disclosure, the method specifically includes the following steps.

[0074] Step 202: Parse the initial prompt text sent by the client, determine the text generation intent of the initial prompt text, determine the target text scenario based on the text generation intent, and determine the target text category of the reference prompt text based on the target text scenario.

[0075] The initial prompt text can be understood as the prompt text sent by the user through the client for generating text content. The initial prompt text may include various generation requirements of the user for the target text (the text to be generated). The initial prompt text may include, but is not limited to, the following aspects: the generation theme, generation style, output structure, etc. of the target text.

[0076] The text generation intent can be understood as the user's desired purpose or goal, obtained through analysis of the initial prompt text. This intent reflects the user's need for the generated text content. The target text scenario guides the generation of the target text, determining the specifications, structure, and other content that the generated target text must follow. The reference prompt text can be understood as the prompt text that the user needs to input into the text generation model when generating the target text. The text generation model generates the target text based on the reference prompt text.

[0077] Specifically, by parsing the initial prompt text sent by the user through the client, the text generation intent corresponding to the initial prompt text is determined, that is, what kind of target text the user wants to generate. The text type of the target text can be determined based on the text generation intent, and thus the target text scenario can be determined based on the text generation intent and the specific text type. For example, if the text generation intent is "the user wants to generate a fairy tale", the text type of the target text is a story type, so the target text scenario is a story generation scenario. Based on the story generation scenario, it can be determined that the generated target text needs to contain the basic elements of a story, such as characters, plot, and ending. Furthermore, if a reference prompt text is input to the text generation model to generate a story, the reference prompt text needs to contain different categories of content such as the applicable age of the generated story and the specific story style. In other words, the target text category of the reference prompt text needs to be determined based on the target text scenario.

[0078] In one or more embodiments of this disclosure, before the server parses the initial prompt text sent by the client, the client needs to send the initial prompt text to the server so that the server can parse and process the received initial prompt text. The specific implementation is as follows:

[0079] Before parsing the initial prompt text sent by the client, the following is also included:

[0080] The system receives the initial prompt text sent by the client, wherein the initial prompt text is determined through user interaction on the client's user interface.

[0081] Interactive operations include, but are not limited to, clicking and inputting on the user interface; for example, a user can click the voice input button on the user interface of the client to determine the initial prompt text by voice, or a user can directly input text on the user interface of the client to determine the initial prompt text.

[0082] Specifically, the initial prompt text is determined through the user's interactive operation on the client's user interface, and then the client sends the initial prompt text to the server, so that the server receives the initial prompt text sent by the client and parses the initial prompt text.

[0083] The text processing method provided in this disclosure can greatly improve the convenience of user interaction through the interaction between the client and the server, as well as the interaction between the user and the user interface of the client, thereby improving the user's interactive experience and enhancing the user's enthusiasm for use.

[0084] In one or more embodiments of this disclosure, when a user wants to generate target text, there are some preset text categories required to generate the target text. For example, when generating a story, the preset text categories required to generate the story may include story type, applicable age, word count, etc. However, the initial prompt text may not contain all of these preset text categories. Therefore, it is necessary to identify the target text categories that are inconsistent with the initial text categories among the preset text categories, so as to guide the user to supplement the relevant content of the target text categories. The specific implementation method is as follows:

[0085] The step of determining the target text scene based on the text generation intent, and determining the target text category of the reference prompt text based on the target text scene, includes:

[0086] The target text scene is determined based on the text generation intent, and a preset text category corresponding to the target text scene is determined, wherein the preset text category is the text category corresponding to the generated target text;

[0087] Determine whether the initial text category contained in the initial prompt text is consistent with the preset text category.

[0088] If the initial text category is inconsistent with the preset text category, then a target text category is determined based on the initial text category and the preset text category, wherein the target text category is the text category in the preset text category that is inconsistent with the initial text category.

[0089] The initial text category can be understood as the text in the initial prompt text and the corresponding text category. For example, if the initial prompt text contains texts such as "3 years old" or "fairy tale", the initial text category includes text categories such as age and story type.

[0090] Using the previous example, if the initial prompt text is "Generate a fairy tale that a 3-year-old can understand", the target text scene is determined to be the story generation scene based on the text generation intent. Based on this story generation scene, the preset text categories corresponding to the story generation scene can be determined, including age, story type, story length, etc., and the initial text categories contained in the initial prompt text can be determined, including age category and story type category. Therefore, based on the initial text category and the preset text categories, the target text category that cannot be determined among the preset text categories can be determined as the story length category.

[0091] After determining that the target text category is the story length category, and after obtaining the user's specific needs regarding story length through user guidance, the reference prompt text can be determined based on the user's specific needs regarding story length and the information contained in the initial prompt text.

[0092] In one or more embodiments of this disclosure, if the initial text category in the user's initial prompt text matches the preset text generation category, and the initial prompt text contains all the preset text generation categories required to generate the target text, that is, the initial prompt text contains all the information of the categories required to generate the target text, then the target text can be generated based on the initial prompt text using a text generation model. The specific implementation is as follows:

[0093] After determining whether the initial text category contained in the initial prompt text is consistent with the preset text generation category, the method further includes:

[0094] If the initial text category is consistent with the preset text category, then the initial prompt text is input into the text generation model;

[0095] The initial prompt text is processed using the text generation model to generate the target text, and the target text is returned to the client.

[0096] Specifically, if the initial text category contained in the initial prompt text is consistent with the preset text generation category, it indicates that the initial prompt text contains the text content of each text category required to generate the target text. Therefore, the initial prompt text can be directly input into the text generation model, and the text generation model can be used to process the initial prompt text, generate the target text, and return the target text to the client.

[0097] In practical applications, when the initial text category contained in the initial prompt text is consistent with the preset text generation category, since the content of the initial prompt text may contain information unrelated to the current user's needs, the reference prompt words under the corresponding preset text generation category can be determined based on the text content of the initial text category contained in the initial prompt text. The reference prompt text corresponding to the reference prompt words is then input into the text generation model, and the text generation model is used to process the reference prompt text to generate the target text.

[0098] Continuing with the previous example, in a story generation scenario, if the user's initial prompt text is "Generate a fairy tale that a 3-year-old can understand, with a word count of no more than 100 words," it can be determined that the initial text category (age, story type, story length) contained in the initial prompt text is consistent with the preset text category corresponding to the story generation scenario. At this time, based on the text content in the initial prompt text that corresponds to the initial text category (3 years old, fairy tale, no more than 100 words), the reference prompt words and corresponding reference prompt text under the corresponding preset text generation category are determined. For example, the reference prompt word corresponding to 3 years old is "3-year-old child," and the reference prompt text is "basically understands some simple language, can conduct some simple communication, and the story chapters can include two or three sentences." Thus, the reference prompt text corresponding to the reference prompt words is input into the text generation model, and through more specific generation requirements, a higher quality target text is generated.

[0099] The text generation method provided in this embodiment can directly generate target text based on the initial prompt text if the initial text category contained in the initial prompt text is consistent with the preset text generation category. This allows for rapid generation of target text even when the information provided by the user is already very detailed.

[0100] Step 204: Determine multiple reference prompt words corresponding to the target text category, and return the multiple reference prompt words to the client.

[0101] Specifically, if the target text category is a text category that is inconsistent with the initial text category but is within the preset text category, it indicates that the initial text category does not contain the target text category within the preset text category. Therefore, it is necessary to guide the user to understand their needs within the target text category.

[0102] In practical applications, multiple reference prompts corresponding to the target text category can be returned to the client so that they can be displayed in the client's user interface. This allows the user to select the target prompt from the displayed prompts and understand their specific needs for the target text category when generating the target text. For example, if the target text category is age, multiple reference prompts such as 0-3 years, 3-6 years, and 6+ can be returned to the client. By allowing the user to select the appropriate prompt on the client, the user's needs for the target text age range can be determined.

[0103] It should be noted that, given different initial prompt texts, each preset text category may serve as the target text category. Consequently, each preset text category corresponds to multiple reference prompt words. For example, as mentioned above, the age category corresponds to multiple reference prompt words: 0-3 years old, 3-6 years old, and 6+. Through such multi-level prompt words, user needs can be accurately determined, rather than vaguely defining a user's "story generation" requirement. This allows for precise guidance in content generation, satisfying the user's specific needs.

[0104] Step 206: In response to the target reference prompt word sent by the client, determine the reference prompt text based on the target reference prompt word and the initial prompt text, wherein the target reference prompt word is selected from the plurality of reference prompt words.

[0105] Specifically, when a user selects a target reference word from multiple reference words, the client returns the target reference word to the server. The server then uses the target reference word and the initial prompt text to determine the reference prompt text.

[0106] In one or more embodiments of this disclosure, a question can also be posed to the user by generating target guidance text, thereby determining target reference prompts from the user's guidance feedback text, and then determining the reference prompt text. The specific implementation is as follows:

[0107] After determining the target text category of the reference prompt text based on the target text scenario, the method further includes:

[0108] Based on the target text category, generate target guidance text and return the target guidance text to the client;

[0109] In response to the guidance feedback text sent by the client that corresponds to the target guidance text, a target reference prompt word is determined based on the guidance feedback text, and a reference prompt text is determined based on the target reference prompt word and the initial prompt text.

[0110] The target guidance text can be understood as the text that guides the user to generate the corresponding answer; the guidance feedback text can be understood as the text in which the user answers the target guidance text.

[0111] Specifically, when the target text category is age, the generated target guidance text can be "Which age group do you want to generate a story for?" When the target guidance text is returned to the client, the user can answer based on the target guidance text. The client returns the user's answer guidance feedback text (e.g., guidance feedback text for 3-6 years old) to the server. The server determines the target reference prompt word (3-6 years old) from the user's answer guidance feedback text, and then determines the corresponding target reference prompt text based on the target reference prompt word. Based on the target reference prompt text corresponding to the target reference prompt word and the text information already contained in the initial prompt text (or, as mentioned in the above embodiment, determining the reference prompt word and corresponding reference prompt text under the corresponding preset text generation category based on the text content in the initial prompt text corresponding to the initial text category), the server determines the reference prompt text to be input into the text generation model.

[0112] In practical applications, the purpose of target guidance text is to guide users to answer with text corresponding to the target text category. In this case, the guidance feedback text of the user's answer contains text corresponding to the target text type. Therefore, the target reference prompt words of the target text category can be determined from the guidance feedback text.

[0113] The text generation method provided in this disclosure generates target guidance text corresponding to a target text category, guides the user to generate guidance feedback text related to the target text category, and thus accurately determines the user's needs based on the guidance feedback text, generating personalized content that meets the user's needs.

[0114] In one or more embodiments of this disclosure, the initial text category and corresponding initial reference prompt word contained in the initial prompt text are determined, thereby determining the reference prompt text for the input text generation model based on the target reference prompt word and the initial reference prompt word. The specific implementation is as follows:

[0115] The step of responding to the target reference prompt word sent by the client, and determining the reference prompt text based on the target reference prompt word and the initial prompt text, includes:

[0116] In response to the target reference prompt word sent by the client, determine the target reference prompt word and the initial reference prompt word corresponding to the initial text category contained in the initial prompt text;

[0117] The reference prompt text is determined based on the initial reference prompt word and the target reference prompt word.

[0118] Specifically, since the initial prompt text may contain information unrelated to the current user's needs, the initial reference prompt word corresponding to the initial text category can be determined based on the initial text category contained in the initial prompt text, and the target reference prompt word can be determined by responding to the target reference prompt word sent by the client; the reference prompt text can be determined based on the initial reference prompt word and the target reference prompt word.

[0119] Using the previous example, the user's initial prompt text is "Generate a fairy tale that a 3-year-old can understand." We can determine the initial text category (age, story type) contained in the initial prompt text. Based on the text content in the initial prompt text that corresponds to the initial text category (3 years old, fairy tale), we can determine the initial reference prompt words. Then, based on the target reference prompt words (e.g., the word count is controlled within 100) and the initial reference prompt words, we can determine the reference prompt text.

[0120] The text generation method provided in this disclosure determines the initial reference prompt words corresponding to the initial text category based on the initial text category contained in the initial prompt text. This avoids inputting the initial prompt text into the text generation model when there is information in the initial prompt text that is irrelevant to the current user's needs, which would increase the processing burden of the text generation model and reduce the quality of the generated content.

[0121] In one or more embodiments of this disclosure, when target reference prompts and initial reference prompts exist, target reference prompt text and initial reference prompt text can be determined separately. To enable the text generation model to better process the input text, the target reference prompt text and initial reference prompt text can be integrated according to a preset text structure. The specific implementation method is as follows:

[0122] The step of determining the reference prompt text based on the target reference prompt word and the initial prompt text includes:

[0123] The target reference prompt text is determined based on the target reference prompt words, and the initial reference prompt text is determined based on the initial reference prompt words corresponding to the initial text category contained in the initial prompt text;

[0124] Based on a preset text structure, text processing is performed on the target reference prompt text and the initial reference prompt text to obtain the reference prompt text.

[0125] The preset text structure can be understood as a basic structural framework set by the reference prompt text. The preset text structure determines the organization of the reference prompt text, the presentation order of information, and the logical relationship between each part.

[0126] Specifically, the target reference prompt text can be determined based on the target reference prompt word, and the initial reference prompt text corresponding to the initial reference prompt word can be determined based on the initial reference prompt word corresponding to the initial text category contained in the initial prompt text. The target reference prompt text and the initial reference prompt text can be understood as further explanations or limitations on the target reference prompt word or the initial reference prompt word, such as limiting the abilities possessed by children in age group A, or further explanations of story type B.

[0127] Given the target reference text and the initial reference text, a preset text structure can be used to determine the order of the reference texts in the target reference text and the initial reference text, and appropriate connection statements can be used to connect the reference texts to make the obtained reference text logical.

[0128] The text generation method provided in this disclosure obtains reference prompt text by pre-setting a text structure and concatenating the reference prompt texts corresponding to the reference prompt words under each text category. This ensures that the reference prompt texts input to the text generation model have a consistent text structure, making it easier for the text generation model to process the reference prompt texts quickly.

[0129] Step 208: Use a text generation model to process the reference prompt text, generate the target text, and return the target text to the client.

[0130] The text generation model can be understood as a large model, specifically a large natural language processing model, used for generating natural language text; the target text is the text output by the text generation model that meets the user's needs.

[0131] Specifically, when a reference prompt text is obtained, it is input into a text generation model. The text generation model processes the reference prompt text, such as performing encoding and decoding, to generate the target text. The target text is then returned to the client so that it can be displayed to the user through the client's user interface.

[0132] In one or more embodiments of this disclosure, to generate text using a text generation model, it is necessary to invoke the text generation model. Specifically, when invoking the text generation model, the model is invoked through its interface information. The specific implementation method is as follows:

[0133] The step of processing the reference prompt text using a text generation model to generate target text and returning the target text to the client includes:

[0134] Based on the interface information of the text generation model, the text generation model is invoked;

[0135] The reference prompt text is input into the text generation model, the text generation model is used to process the reference prompt text to generate the target text, and the target text is returned to the client.

[0136] The interface information can be understood as the protocols and conventions that the text generation model must follow when interacting with external systems or components. This interface information ensures that the text generation model can be correctly integrated with other software components, enabling the invocation of the text generation model.

[0137] Specifically, the text generation model is invoked through its interface information, and the reference prompt text is input into the text generation model. The text generation model then generates the target text based on the reference prompt text and returns the target text to the client.

[0138] The text generation method provided in this disclosure can correctly call the corresponding text generation model through the interface information of the text generation model, ensuring the reliability of generating target text using the text generation model.

[0139] In one or more embodiments of this disclosure, when generating text using a text generation model, a target summary text can be generated first and returned to the client. Upon receiving a confirmation instruction for the target summary text, the target text can then be generated based on the target summary text. The specific implementation is as follows:

[0140] The step of using a text generation model to process the reference prompt text and generate target text includes:

[0141] The reference prompt text is processed using the text generation model to generate the target summary text, and the target summary text is returned to the client.

[0142] Upon receiving a confirmation instruction from the client regarding the target summary text, the target summary text is processed using the text generation model to generate the target text.

[0143] The target summary text can be understood as a more refined form of text extracted from the target text to be generated. The core points of the target summary text are consistent with those of the target text to be generated. When the target text is a story, the target summary text can be the outline or synopsis of the story.

[0144] Specifically, when the target text is longer than the target summary text, in order to save the processing resources of the text generation model, the text generation model can first process the reference prompt text to generate the target summary text, and then return the target summary text to the client. If the user confirms the target summary text, it is considered that the user approves of the target summary text, and then the text generation model is used to process the target summary text to generate the target text.

[0145] The text generation method provided in this disclosure can avoid situations where the generated target text does not meet user needs and multiple updates to the target text are required. However, when the length of the target summary text is shorter than the target text, updating the target summary text multiple times can reduce the running speed of the text processing model and increase the probability that the generated target text meets user needs compared to updating the target text multiple times.

[0146] In one or more embodiments of this disclosure, if a user is dissatisfied with the target summary text, an editing command can be sent through a client to update the target summary text. The specific implementation method is as follows:

[0147] After processing the reference prompt text using the text generation model to generate the target summary text and returning the target summary text to the client, the process further includes:

[0148] Upon receiving an editing instruction from the client regarding the target summary text, the text generation model is used to update the target summary text, generating updated summary text, which is then returned to the client.

[0149] Upon receiving a confirmation instruction from the client regarding the updated summary text, the updated summary text is processed using the text generation model to generate the target text.

[0150] Specifically, after the target summary text is returned to the client, the client will display the target summary text to the user. If the user needs to modify this summary text, they can send an editing instruction to the server through the client. The editing instruction may include adding, deleting, or replacing certain parts of the text. After receiving the editing instruction, the server will use the text generation model to update the target summary text. This update process may include directly modifying the target summary text to the updated summary text according to the editing instruction, or having the text generation model regenerate an updated summary text that better meets the requirements of the instruction.

[0151] The server returns the updated summary text to the client, which then displays it to the user. If the user is satisfied with the updated summary text, they send a confirmation command to the server through the client. Of course, if the user is not satisfied, they can send an edit command to the server again. After receiving the confirmation command, the server will use the text generation model to further process the updated summary text, expanding the more detailed summary text into a more detailed and complete target text.

[0152] The text generation method provided in this disclosure allows users to send editing instructions for the target summary text through a client when they are not satisfied with the target summary text, until they obtain an updated summary text that satisfies them. This updated summary text can then be used to generate the target text, which can greatly improve user satisfaction with the target text.

[0153] In one or more embodiments of this disclosure, the reference prompt text includes multiple prompt texts from multiple text categories; thus, the prompt texts can be input into different text generation models to obtain more accurate and higher-quality target text. The specific implementation is as follows:

[0154] After determining the reference prompt text based on the target reference prompt word and the initial prompt text, the process further includes:

[0155] Determine multiple text categories corresponding to multiple prompt texts in the reference prompt text, and determine multiple text generation models based on the multiple text categories;

[0156] Based on the text category corresponding to each prompt text in the reference prompt text, input each prompt text in the reference prompt text into the text generation model corresponding to each text category;

[0157] Each text generation model is used to process the prompt text, generating candidate texts corresponding to each text generation model, and the target text is obtained based on the candidate texts.

[0158] Specifically, since different text generation models have different advantages in text generation, such as in content creation, different text generation models may have different advantages in text understanding, sentiment analysis, style generation, etc. Therefore, prompt texts of different text categories can be input into the corresponding text generation models with their respective advantages. Then, each text generation model can be used to process each prompt text, generate candidate texts corresponding to each text generation model, and obtain the target text based on the candidate texts corresponding to each text generation model.

[0159] The text generation method provided in this disclosure has different advantages for different text generation models in terms of text understanding, sentiment analysis, style generation, etc. By inputting the corresponding prompt text into a suitable text generation model, multiple text generation models can cooperate to generate higher quality target text.

[0160] The text generation method provided in this disclosure can correspond to multiple reference prompt words under a text category. Through this multi-level prompt word design, different levels of guidance can be provided according to user needs, effectively stimulating the creative potential of large models. Furthermore, by introducing hierarchical prompt words, prompt words of different levels can be given to different large models, thereby realizing multi-model collaborative innovation and integrating their respective capabilities.

[0161] Furthermore, this disclosure also provides another text generation method, including:

[0162] Parse the initial prompt text, determine the text generation intent of the initial prompt text, determine the target text scenario based on the text generation intent, and determine the target text category of the reference prompt text based on the target text scenario;

[0163] Identify and display multiple reference prompt words corresponding to the target text category;

[0164] Determine the target reference prompt word, and determine the reference prompt text based on the target reference prompt word and the initial prompt text, wherein the target reference prompt word is selected from the plurality of reference prompt words;

[0165] The reference prompt text is processed using a text generation model to generate the target text, which is then displayed.

[0166] The text generation method is executed by the client. For details on the implementation method, please refer to the above embodiments, which will not be repeated here.

[0167] Referring to Figure 3, Figure 3 shows a flowchart of a text generation method for story picture book creation provided in an embodiment of this disclosure, which specifically includes the following steps.

[0168] Step 302: The client sends the initial prompt text entered by the user to the server.

[0169] Specifically, the user enters initial prompt text in the user interface of the client, such as "Generate a story picture book"; the initial prompt text is sent to the server to obtain the created story picture book.

[0170] Step 304: The server-side multi-level prompting module receives and parses the initial prompt text.

[0171] Specifically, the multi-level prompt word guidance module is implemented using an agent (intelligent agent). It can obtain the user's text generation intent by parsing the initial prompt text. Based on the text generation intent, it determines the set of prompt words related to the text generation intent from the preset prompt word set. The prompt word set includes multiple text categories and specific prompt words and their corresponding prompt texts. A text category contains multiple prompt words, so it is necessary to select the appropriate prompt word and its corresponding prompt text from the corresponding text category.

[0172] In practical applications, a set of prompt words corresponds to a specific scenario within the pre-set prompt word set. This set includes prompt words from different directions and levels. For example, the prompt word set corresponding to the story picture book generation scenario includes different directions such as the target audience and story type. The target audience direction further includes different age groups such as "0-3", "3-6", and "6+". The story type direction further includes different levels such as "common sense knowledge", "social etiquette", and "fairy tales".

[0173] For example, in the context of story picture book creation, detailed explanations are provided regarding the abilities of children of different age groups and the types of story picture books they need to know. Each time a large model is provided, it will only be an introduction for a specific age group, rather than an introduction for children of all ages, or a relatively simple overview.

[0174] Referring to Figure 4a, Figure 4a shows a schematic diagram of a set of prompts related to story picture book creation provided by an embodiment of this disclosure.

[0175] Figure 4a shows the text content: Age {"0-3": "Just learned to speak, can only understand very simple sentences and very simple story plots. Each chapter of the story has at most one or two sentences. The story should be close to the child's life."

[0176] "3-6": "They can basically understand some simple language and can engage in some simple communication. Each chapter of the story can have two or three sentences. This is the stage when they begin formal kindergarten learning. Create more opportunities for them to speak."

[0177] "6+": "Can communicate normally and understand some complex storybooks. The length and depth of the story can be appropriately increased."

[0178] Story type {“Common Sense Learning”: “Aims to help children understand the basic rules and facts of the world around them, such as colors, shapes, numbers, and everyday objects and phenomena. Common sense learning storybooks are usually centered on interaction and exploration, using brightly colored and easy-to-understand illustrations to aid comprehension.”}

[0179] "Social Etiquette": "Dedicated to teaching children basic social skills and polite behaviors, such as greetings, sharing, gratitude, and apologies. These picture books use vivid scenes and character imitations to enable children to learn and practice correct social behaviors in a safe environment."

[0180] "Mind Interpretation": "Focusing on cultivating children's emotional cognition and psychological understanding abilities, teaching them how to identify their own and others' emotions, and how to effectively express and process feelings. The characters in picture books are often placed in various emotional scenarios, guiding children to understand."

[0181] "Fun": "Contains a variety of interesting and engaging stories designed to stimulate children's imagination and creativity while providing a delightful reading experience. These picture books are full of humor, creativity, and surprises that can promote children's language expression and thinking development."

[0182] "Other": "More expansive storytelling can be generated, such as traditional culture, art, music, or special themes. This type of content is typically designed to broaden children's horizons and provide more diverse knowledge and experiences."

[0183] Step 306: Determine the target reference word and the initial reference word.

[0184] The initial prompt text input by the user can contain text content corresponding to the text categories required to generate the story picture book. Based on this text content, the initial reference prompt words are determined, and the initial reference prompt text corresponding to the initial reference prompt words is determined. For target text categories that are inconsistent with the initial text categories contained in the initial prompt text among the multiple text categories included in the prompt word set, it is necessary to guide the user to determine the appropriate target reference prompt words from the corresponding target text categories, and then determine the target reference prompt text.

[0185] Step 308: Determine the reference prompt text and input the reference prompt text into the content creation model.

[0186] The prompt texts corresponding to the determined sub-reference prompt words are hierarchically concatenated to obtain reference prompt texts. These reference prompt texts are then used as prompts for the content creation model and input into the content creation model, which can be a large model capable of generating multimodal data.

[0187] Referring to Figure 4b, Figure 4b shows a schematic diagram of a reference prompt text provided in an embodiment of this disclosure.

[0188] As shown in Figure 4b, the text reads: You are a professional storybook creator who specializes in creating stories that children with autism can understand.

[0189] ## Storybook Age: Picture books are intended for children aged 0-3 years. Below is a breakdown of what children in each age group can understand. Here is the ability range for each age group: 1. Children who have just learned to speak can only understand very simple sentences and simple storylines. 2. Each chapter of the storybook can contain at most one or two sentences. 3. Picture book stories should be relevant to children's lives and can simply introduce some basic life knowledge.

[0190] #Storybook Creation Considerations 1. Text Style: Use declarative sentences to drive the plot, and use words like "ne," "la," "ya," "yo," and "ha" at the end of sentences. 2. Simplicity and Clarity: The theme and plot of the story should be simple and clear, and the language should be vivid and interesting. 3. Educational Value: Excellent bedtime stories should have some educational value, helping children learn correct values ​​and behavioral habits. 4. Imagination: Bedtime stories should be imaginative and fun, capturing children's attention and allowing them to resonate with and feel the stories.

[0191] ## Storybook Theme; The type of picture book you need to create is social etiquette; Social etiquette requirements: Focus on teaching children basic social skills and polite behavior, such as how to greet, share, express gratitude, apologize, etc. This type of picture book story enables children to learn and practice correct social behaviors in a safe environment through vivid scenes and character imitation.

[0192] Story theme: "I am polite"; Main character's name: Lili; Story setting: Kindergarten.

[0193] Step 310: Generate the story outline and details.

[0194] Based on the reference prompts, an outline and synopsis of the story picture book can be generated first. After the outline and synopsis are sent to the client and the user confirms the outline and synopsis through the client's user interface, the content creation model is used to generate specific content and corresponding visual descriptions based on the outline and synopsis.

[0195] Of course, users can edit and modify the outline and story synopsis, or request to regenerate the outline and story synopsis. In practical applications, the system can dynamically adjust the weight and level of prompt words based on user feedback and content generation effects, so as to achieve continuous optimization and learning of the model.

[0196] Referring to Figure 4c, Figure 4c shows a schematic diagram of a generated outline and story synopsis provided by an embodiment of this disclosure.

[0197] Figure 4c shows the following text: {"Story Title": "I Am Polite", "Story Outline": {{"Chapter Title": "Good Morning", "Chapter Summary": "Lili wakes up, and his parents teach him to greet his family, then they go to kindergarten together."}{"Chapter Title": "Sharing Toys", "Chapter Summary": "At kindergarten, Lili learns to share toys with his friends, and everyone has a lot of fun."}{"Chapter Title": "Thank You, Teacher", "Chapter Summary": "The teacher helps Lili tie his shoelaces, and Lili learns to say thank you, expressing his gratitude."}{"Chapter Title": "Waiting in Line", "Chapter Summary": "The children line up to drink water, and Lili waits patiently, learning not to push other children."}{"Chapter Title": "Apologizing", "Chapter Summary": "Lili accidentally knocks over his friend's water cup, but he bravely admits his mistake and apologizes, and his friends forgive him."}}

[0198] Referring to Figure 4d, Figure 4d shows a schematic diagram of a specific generated content and screen description provided by an embodiment of the present disclosure.

[0199] Figure 4d shows the text content: {"Script": {{"Visual Description": "Lili sits on the edge of the bed, his father is beside him, his mother stands by the window, and sunlight streams into the room through the window.", "Story Content": "In the morning, Lili wakes up. His father tells him to say good morning to his family."} {"Visual Description": "Lili is in the kindergarten playground, holding a toy car, and his friends are surrounding him.", "Story Content": "Lili hands the toy car to his friend, and they all play together."}, {"Visual Description": "Lili's teacher bends down to tie his shoelaces, and Lili watches the teacher doing her work attentively, while the other children around him are doing their own things.", "Story Content": "Lili..." Content: "The teacher's shoelace came undone, and Lili said thank you to the teacher." {"Scene Description": "The kindergarten children are all lining up to drink water, and everyone is orderly. Lili is in the middle of the line.", "Story Content": "Everyone takes turns drinking water, and Lili has learned to line up and wait patiently.", {"Scene Description": "Lili stands apologetically next to the spilled water cup, and his friend is sitting on the ground, looking a little sad.", "Story Content": "Lili accidentally knocked over his friend's water cup, and he immediately said 'I'm sorry,' and his friends forgave him."}}, "Main Character": "A little boy with yellow hair and wearing blue clothes."}

[0200] In practical applications, when generating story picture books, the generated target text can be further input into an image generation model to generate corresponding pictures for the specific content, thereby obtaining a story picture book and enhancing the readability of the generated content for users.

[0201] The text generation method provided in this disclosure can also be applied to copywriting and character creation scenarios. Through a multi-level prompt word guidance module, more accurate prompt words can be determined, and more personalized copywriting or characters that better meet user needs can be generated based on these more accurate prompt words.

[0202] The text generation method provided in this disclosure, by using a multi-level prompt word guidance module, can simplify the prompt word information as much as possible compared to a single-level method. For example, in the generation of story picture book content, there are many age groups and different precautions. By using a multi-level and multi-directional approach, the input to the model is greatly reduced, which can greatly improve the speed of content creation. Moreover, it can select appropriate prompt words and style controls according to the needs of different users to generate content that conforms to their specific style and theme. By using prompt words at different levels, the model can reduce the amount of information that is irrelevant to the current user's needs, and also improve the quality of the generated content.

[0203] Referring to Figure 5, Figure 5 shows a flowchart of a text generation method applied to a text generation system according to an embodiment of this disclosure; specifically, it includes the following steps:

[0204] Step 502: The client sends an initial prompt text to the server, wherein the initial prompt text is determined by the user's interactive operation on the user interface of the client;

[0205] Step 504: The server parses the initial prompt text sent by the client, determines the text generation intent of the initial prompt text, determines the target text scenario based on the text generation intent, determines the target text category of the reference prompt text based on the target text scenario, determines multiple reference prompt words corresponding to the target text category, and returns the multiple reference prompt words to the client.

[0206] Step 506: The client sends the target reference prompt to the server, wherein the target reference prompt is selected from the plurality of reference prompts;

[0207] Step 508: The server, in response to the target reference prompt word sent by the client, determines the reference prompt text based on the target reference prompt word and the initial prompt text, wherein the target reference prompt word is selected from the plurality of reference prompt words; the server uses a text generation model to process the reference prompt text to generate the target text, and returns the target text to the client.

[0208] For specific implementation details, please refer to the above embodiments, which will not be repeated here.

[0209] The text generation method provided in this disclosure achieves intelligent guidance through multi-level prompts via user interaction. By combining the intelligent guidance of multi-level prompts with the powerful text generation capabilities of large models, content creation can achieve a higher degree of personalization, customization, interactivity, and innovation while maintaining high efficiency.

[0210] Corresponding to the above method embodiments, this disclosure also provides a text generation system embodiment. Figure 6 shows a schematic diagram of the structure of a text generation system 600 provided in one embodiment of this disclosure. As shown in Figure 6, the system includes a client 602 and a server 604, wherein...

[0211] The client 602 is configured to send an initial prompt text to the server 604, wherein the initial prompt text is determined by the user's interactive operation on the user interface of the client 602;

[0212] The server 604 is configured to parse the initial prompt text sent by the client 602, determine the text generation intent of the initial prompt text, determine the target text scenario based on the text generation intent, and determine the target text category of the reference prompt text based on the target text scenario.

[0213] Determine multiple reference prompt words corresponding to the target text category, and return the multiple reference prompt words to the client 602;

[0214] The client 602 is configured to send a target reference prompt to the server 604, wherein the target reference prompt is selected from the plurality of reference prompts;

[0215] The server 604 is configured to respond to the target reference prompt word sent by the client 602, and determine the reference prompt text based on the target reference prompt word and the initial prompt text, wherein the target reference prompt word is selected from the plurality of reference prompt words;

[0216] The reference prompt text is processed using a text generation model to generate the target text, which is then returned to the client 602.

[0217] One embodiment of this disclosure provides a text generation system that, by parsing the initial prompt text sent by the client, can understand the text generation intent of the initial prompt text. Based on this intent, it returns multiple reference prompt words for the target text category within the target text scenario to the client. This allows for the determination of reference prompt text that meets the user's needs using the target reference prompt words sent by the client and the initial prompt text. When multiple reference prompt words exist for the target text category, and the target reference prompt word is selected from these multiple reference prompt words, the user's content creation needs can be more clearly defined using the target reference prompt word. Furthermore, by inputting the reference prompt text into the text generation model and using the model to generate the target text, the input to the text generation model can be reduced, as can the model's understanding of information irrelevant to the current user needs. This allows the text generation model to more accurately understand and execute the user's requirements, improving the quality of the generated target text, and making the target text more aligned with the user's needs.

[0218] Corresponding to the above method embodiments, this disclosure also provides a text generation apparatus embodiment. Figure 7 shows a schematic diagram of the structure of a text generation apparatus provided in one embodiment of this disclosure. As shown in Figure 7, the apparatus includes:

[0219] The parsing module 702 is configured to parse the initial prompt text sent by the client, determine the text generation intent of the initial prompt text, determine the target text scenario based on the text generation intent, and determine the target text category of the reference prompt text based on the target text scenario.

[0220] The return module 704 is configured to determine multiple reference prompt words corresponding to the target text category and return the multiple reference prompt words included in the target text category to the client;

[0221] The determining module 706 is configured to, in response to a target reference prompt word sent by the client, determine the reference prompt text based on the target reference prompt word and the initial prompt text, wherein the target reference prompt word is selected from the plurality of reference prompt words;

[0222] The generation module 708 is configured to use a text generation model to process the reference prompt text, generate target text, and return the target text to the client.

[0223] Optionally, the parsing module 702 is further configured to:

[0224] The target text scene is determined based on the text generation intent, and the corresponding preset text category is determined based on the target text scene, wherein the preset text category is the text category corresponding to the target text generated in the target text scene;

[0225] Determine whether the initial text category contained in the initial prompt text is consistent with the preset text category.

[0226] If not, then a target text category is determined based on the initial text category and the preset text category, wherein the target text category is a text category in the preset text category that is inconsistent with the initial text category;

[0227] If so, the initial prompt text is input into the text generation model; the text generation model is used to process the initial prompt text to generate the target text, and the target text is returned to the client.

[0228] The device further includes:

[0229] The guidance module is configured to generate target guidance text based on the target text category and return the target guidance text to the client; in response to guidance feedback text sent by the client corresponding to the target guidance text, determine target reference prompt words based on the guidance feedback text, and determine reference prompt text based on the target reference prompt words and the initial prompt text.

[0230] Optionally, the determining module 706 is further configured to:

[0231] In response to the target reference prompt word sent by the client, determine the target reference prompt word and the initial reference prompt word corresponding to the initial text category contained in the initial prompt text;

[0232] The reference prompt text is determined based on the initial reference prompt word and the target reference prompt word.

[0233] Optionally, the determining module 706 is further configured to:

[0234] The target reference prompt text is determined based on the target reference prompt words, and the initial reference prompt text is determined based on the initial reference prompt words corresponding to the initial text category contained in the initial prompt text;

[0235] Based on a preset text structure, text processing is performed on the target reference prompt text and the initial reference prompt text to obtain the reference prompt text.

[0236] Optionally, the generation module 708 is further configured to:

[0237] The reference prompt text is processed using the text generation model to generate the target summary text, and the target summary text is returned to the client.

[0238] Upon receiving a confirmation instruction from the client regarding the target summary text, the target summary text is processed using the text generation model to generate the target text.

[0239] Optionally, the generation module 708 is further configured to:

[0240] Upon receiving an editing instruction from the client regarding the target summary text, the text generation model is used to update the target summary text, generating updated summary text, which is then returned to the client.

[0241] Upon receiving a confirmation instruction from the client regarding the updated summary text, the updated summary text is processed using the text generation model to generate the target text.

[0242] The device further includes:

[0243] The integration module is configured to determine multiple text categories corresponding to multiple prompt texts in the reference prompt text, and determine multiple text generation models based on the multiple text categories; based on the text categories corresponding to each prompt text in the reference prompt text, input each prompt text in the reference prompt text into the text generation model corresponding to each text category; use each text generation model to perform text processing on each prompt text, generate candidate texts corresponding to each text generation model, and obtain the target text based on the candidate texts.

[0244] Optionally, the generation module 708 is further configured to:

[0245] Based on the interface information of the text generation model, the text generation model is invoked;

[0246] The reference prompt text is input into the text generation model, the text generation model is used to process the reference prompt text to generate the target text, and the target text is returned to the client.

[0247] The device further includes:

[0248] The receiving module is configured to receive the initial prompt text sent by the client, wherein the initial prompt text is determined by the user's interactive operation on the user interface of the client.

[0249] One embodiment of this disclosure provides a text generation apparatus that, by parsing the initial prompt text sent by the client, can understand the text generation intent of the initial prompt text. Based on this intent, it returns multiple reference prompt words for the target text category within the target text scenario to the client. This allows for the determination of reference prompt text that meets the user's needs using the target reference prompt words sent by the client and the initial prompt text. When multiple reference prompt words exist for the target text category, and the target reference prompt word is selected from these multiple reference prompt words, the user's content creation needs can be more clearly defined using the target reference prompt word. Furthermore, by inputting the reference prompt text into a text generation model and using the model to generate the target text, the input to the text generation model can be reduced, as can the model's understanding of information irrelevant to the current user needs. This allows the text generation model to more accurately understand and execute the user's requirements, improving the quality of the generated target text, and making the target text more aligned with the user's needs.

[0250] The above is an illustrative scheme of a text generation device according to this embodiment. It should be noted that the technical solution of this text generation device and the technical solution of the above-described text generation method belong to the same concept. For details not described in detail in the technical solution of the text generation device, please refer to the description of the technical solution of the above-described text generation method.

[0251] Figure 8 shows a structural block diagram of a computing device 800 according to an embodiment of the present disclosure. The components of the computing device 800 include, but are not limited to, a memory 810 and a processor 820. The processor 820 is connected to the memory 810 via a bus 830, and a database 850 is used to store data.

[0252] The computing device 800 also includes an access device 840, which enables the computing device 800 to communicate via one or more networks 860. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 840 may include one or more of any type of wired or wireless network interface (e.g., a network interface controller (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, or a Near Field Communication (NFC) interface.

[0253] In one embodiment of this disclosure, the aforementioned components of the computing device 800, as well as other components not shown in FIG. 8, may be interconnected, for example, via a bus. It should be understood that the computing device block diagram shown in FIG. 8 is merely for illustrative purposes and is not intended to limit the scope of this disclosure. Those skilled in the art can add or replace other components as needed.

[0254] The computing device 800 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 800 can also be a mobile or stationary server.

[0255] The processor 820 is used to execute the following computer program / instructions, which, when executed by the processor, implement the steps of the above-described text generation method.

[0256] The various embodiments in this disclosure are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the computing device embodiments are basically similar to the text generation method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the text generation method embodiments.

[0257] An embodiment of this disclosure also provides a computer-readable storage medium storing a computer program / instructions that, when executed by a processor, implement the steps of the above-described text generation method.

[0258] The various embodiments in this disclosure are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the computer-readable storage medium embodiments are basically similar to the text generation method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the text generation method embodiments.

[0259] An embodiment of this disclosure also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described text generation method.

[0260] The above is an illustrative scheme of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the above-described text generation method belong to the same concept. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solution of the above-described text generation method.

[0261] The foregoing has described specific embodiments of this disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0262] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or certain intermediate forms. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.

[0263] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of this disclosure are not limited to the described order of actions, because according to the embodiments of this disclosure, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments of this disclosure.

[0264] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0265] The preferred embodiments disclosed above are merely illustrative of this disclosure. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments of this disclosure. These embodiments are selected and specifically described in this disclosure to better explain the principles and practical applications of the embodiments of this disclosure, thereby enabling those skilled in the art to better understand and utilize this disclosure. This disclosure is limited only by the claims and their full scope and equivalents. Industrial applicability

[0266] This disclosure provides a text generation method in one embodiment. By parsing the initial prompt text sent by the client, the method can understand the text generation intent of the initial prompt text. Based on the text generation intent, it returns multiple reference prompt words for the target text category in the target text scenario to the client. By using the target reference prompt words sent by the client and the initial prompt text, a reference prompt text that meets the user's needs can be determined. When there are multiple reference prompt words for the target text category, and the target reference prompt word is selected from multiple reference prompt words, the target reference prompt word can more clearly clarify the user's content creation needs. Furthermore, by inputting the reference prompt text into the text generation model and using the text generation model to generate the target text, the input of the text generation model can be reduced, and the text generation model can be reduced from understanding information that is irrelevant to the current user needs. This allows the text generation model to more accurately understand and execute the user's requirements, improving the quality of the generated target text, and making the target text more in line with the user's needs.

Claims

1. A text generation method, comprising: parsing an initial prompt text sent by a client, determining a text generation intention of the initial prompt text, and determining a target text scenario according to the text generation intention, determining a target text category of a reference prompt text according to the target text scenario; determining a plurality of reference prompt words corresponding to the target text category, and returning the plurality of reference prompt words to the client; in response to a target reference prompt word sent by the client, determining the reference prompt text according to the target reference prompt word and the initial prompt text, wherein the target reference prompt word is selected from the plurality of reference prompt words; generating a target text by performing text processing on the reference prompt text using a text generation model, and returning the target text to the client.

2. The text generation method of claim 1, wherein, determining a target text scenario according to the text generation intention, and determining a target text category of a reference prompt text according to the target text scenario, comprises: determining a target text scenario according to the text generation intention, and determining a preset text category corresponding to the target text scenario, wherein the preset text category is a text category corresponding to the target text; determining whether an initial text category contained in the initial prompt text is consistent with the preset text category, if the initial text category is inconsistent with the preset text category, determining a target text category according to the initial text category and the preset text category, wherein the target text category is a text category in the preset text category that is inconsistent with the initial text category.

3. The text generation method of claim 2, wherein, after determining whether the initial text category contained in the initial prompt text is consistent with the preset text generation category, further comprising: if the initial text category is consistent with the preset text category, inputting the initial prompt text into the text generation model; generating the target text by performing text processing on the initial prompt text using the text generation model, and returning the target text to the client.

4. The text generation method according to claim 1 or 2, wherein, after determining the target text category of the reference prompt text according to the target text scenario, further comprising: generating a target guide text according to the target text category, and returning the target guide text to the client; in response to a guide feedback text corresponding to the target guide text sent by the client, determining a target reference prompt word according to the guide feedback text, and determining the reference prompt text according to the target reference prompt word and the initial prompt text.

5. The text generation method according to claim 1 or 2, wherein, in response to the target reference prompt word sent by the client, determining the target reference prompt word and an initial reference prompt word contained in the initial prompt text according to the target reference prompt word and the initial prompt text; determining the reference prompt text according to the initial reference prompt word and the target reference prompt word. determining the reference prompt text according to the target reference prompt word and the initial prompt text, comprises:

6. The text generation method of claim 1, wherein, ​ determine a target reference prompt text according to the target reference prompt word, and determine an initial reference prompt text according to an initial reference prompt word corresponding to an initial text category contained in the initial prompt text; perform text processing on the target reference prompt text and the initial reference prompt text according to a preset text structure, and obtain the reference prompt text.

7. The text generation method of claim 1, wherein, The text processing on the reference prompt text by the text generation model to generate a target text includes: perform text processing on the reference prompt text by the text generation model to generate a target summary text, and return the target summary text to the client; In a case where a confirmation instruction sent by the client for the target summary text is received, perform text processing on the target summary text by the text generation model to generate a target text.

8. The text generation method of claim 7, wherein, After the text processing on the reference prompt text by the text generation model to generate a target summary text and the return of the target summary text to the client, the method further includes: In a case where an editing modification instruction sent by the client for the target summary text is received, perform text updating on the target summary text by the text generation model to generate an updated summary text, and return the updated summary text to the client, In a case where a confirmation instruction sent by the client for the updated summary text is received, perform text processing on the updated summary text by the text generation model to generate a target text.

9. The text generation method according to any one of claims 1-8, wherein, The reference prompt text includes multiple prompt texts of multiple text categories; After the reference prompt text is determined according to the target reference prompt word and the initial prompt text, the method further includes: determine multiple text categories corresponding to multiple prompt texts in the reference prompt text, and determine multiple text generation models according to the multiple text categories; input each prompt text in the reference prompt text and each text generation model corresponding to each text category according to a text category corresponding to each prompt text in the reference prompt text; perform text processing on each prompt text by each text generation model to generate a candidate text corresponding to each text generation model, and obtain a target text according to the candidate text.

10. The text generation method of claim 1, wherein, The text processing on the reference prompt text by the text generation model to generate a target text and the return of the target text to the client include: invoke the text generation model according to interface information of the text generation model; input the reference prompt text into the text generation model, perform text processing on the reference prompt text by the text generation model to generate the target text, and return the target text to the client.

11. A text generation method, comprising: parsing an initial prompt text, determining a text generation intention of the initial prompt text, determining a target text scenario according to the text generation intention, and determining a target text category of a reference prompt text according to the target text scenario; determine a plurality of reference prompt words corresponding to the target text category, and display the plurality of reference prompt words; determine the reference prompt text according to the target reference prompt word and the initial prompt text, wherein the target reference prompt word is selected from the plurality of reference prompt words; perform text processing on the reference prompt text by using a text generation model to generate a target text, and display the target text. 12.A text generation method applied to a text generation system, the system comprising a client and a server, wherein the client sends an initial prompt text to the server, wherein the initial prompt text is determined by user interaction on a user interaction interface of the client; the server parses the initial prompt text sent by the client, determines a text generation intention of the initial prompt text, and determines a target text scenario according to the text generation intention, and determines a target text category of the reference prompt text according to the target text scenario; determines a plurality of reference prompt words corresponding to the target text category, and returns the plurality of reference prompt words to the client; the client sends a target reference prompt word to the server, wherein the target reference prompt word is selected from the plurality of reference prompt words; the server, in response to the target reference prompt word sent by the client, determines the reference prompt text according to the target reference prompt word and the initial prompt text, wherein the target reference prompt word is selected from the plurality of reference prompt words; performs text processing on the reference prompt text by using a text generation model to generate a target text, and returns the target text to the client. 13.A text generation system, comprising a client and a server, wherein the client is configured to send an initial prompt text to the server, wherein the initial prompt text is determined by user interaction on a user interaction interface of the client; the server is configured to parse the initial prompt text sent by the client, determine a text generation intention of the initial prompt text, and determine a target text scenario according to the text generation intention, and determine a target text category of the reference prompt text according to the target text scenario; determine a plurality of reference prompt words corresponding to the target text category, and return the plurality of reference prompt words to the client; the client is configured to send a target reference prompt word to the server, wherein the target reference prompt word is selected from the plurality of reference prompt words; the server is configured to, in response to the target reference prompt word sent by the client, determine the reference prompt text according to the target reference prompt word and the initial prompt text, wherein the target reference prompt word is selected from the plurality of reference prompt words; perform text processing on the reference prompt text by using a text generation model to generate a target text, and return the target text to the client. 14.A text generation apparatus, comprising: The parsing module is configured to parse the initial prompt text sent by the client, determine a text generation intention of the initial prompt text, and determine a target text scenario according to the text generation intention, and determine a target text category of the reference prompt text according to the target text scenario; The returning module is configured to determine a plurality of reference prompt words corresponding to the target text category, and return the plurality of reference prompt words included in the target text category to the client; The determining module is configured to determine the reference prompt text according to the target reference prompt word and the initial prompt text in response to the target reference prompt word sent by the client, wherein the target reference prompt word is selected from the plurality of reference prompt words; The generating module is configured to perform text processing on the reference prompt text by using a text generation model, generate target text, and return the target text to the client.

15. A computing device, comprising: a memory and a processor; the memory is configured to store computer programs / instructions, and the processor is configured to execute the computer programs / instructions, and the computer programs / instructions, when executed by the processor, realize the steps of the text generation method in any one of claims 1 to 12.

16. A computer readable storage medium storing computer programs / instructions, and the computer programs / instructions, when executed by a processor, realize the steps of the text generation method in any one of claims 1 to 12.

17. A computer program product comprising computer programs / instructions, and the computer programs / instructions, when executed by a processor, realize the steps of the text generation method in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Prompt word full life cycle management method and system, electronic equipment and storage medium

    CN117494814A

  • Prompt word expansion method and device, computer equipment and storage medium

    CN117764068A

  • Prompt word management method and system based on large language model and computer equipment

    CN117993382A

  • Prompt text generation method and device and reply generation method and device applied to large language model

    CN118171641A

  • Method and system for optimizing cue word

    CN118228838A