Text generation method and device, equipment and storage medium
By using a set of preset algorithms to determine branch nodes and branch options in text generation technology, and using conditional control mechanisms and plot embedding mechanisms to generate detailed plots, the problem of low text quality in the existing technology is solved, and more efficient and diversified text generation is achieved.
Patent Information
- Application Number
- CN202411743652.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-30
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-11-30
AI Technical Summary
The text generated by existing text generation techniques is poor in quality, and there are problems such as insufficient plot and naturalness.
A preset algorithm collection is used to determine the subtext as branch nodes from the original text, multiple branch options are determined based on the subtext, and detailed plots are generated through the conditional control mechanism and plot embedding mechanism.
It improves the efficiency and diversity of text generation, and the generated text quality is higher, and the plot is richer and more natural.
Smart Images

Figure CN119719355A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and specifically, to a text generation method, device, equipment and storage medium. Background Art
[0002] With the rapid development of the online entertainment content market, the demand for fast, diverse and high-quality novels is increasing. In addition, with the development of technologies such as big data, neural networks, and deep learning, artificial intelligence (AI) has made great progress in the fields of natural language processing and text generation. However, the quality of texts generated by existing text generation technologies is poor, and there are problems such as insufficiently rich and natural plots. Summary of the invention
[0003] This application aims to provide a text generation method, device, equipment and storage medium, aiming to improve the efficiency and diversity of AI creation. This application adopts the following scheme:
[0004] In a first aspect, an embodiment of the present application provides a text generation method. The text generation method includes: obtaining an original text; using a preset algorithm set to determine a subtext as a branch node from the original text; based on the subtext, determining multiple branch options; for any branch option, based on a conditional control mechanism and a plot embedding mechanism, generating a detailed plot corresponding to the branch option.
[0005] In a possible embodiment, the preset algorithm set includes a semantic representation model and a part-of-speech recognition model. Accordingly, using the preset algorithm set to determine a sub-text as a branch node from the original text includes: determining at least one first sub-text as a potential branch node from the original text based on the semantic representation model combined with the part-of-speech recognition model; using a sequence labeling algorithm based on an attention mechanism to determine a score corresponding to each first sub-text, the score being used to indicate the importance of the corresponding first sub-text as a potential branch node; and determining a second sub-text in at least one first sub-text whose corresponding score meets a preset condition as a sub-text as a branch node.
[0006] In a possible embodiment, for any branch option, generating a detailed plot corresponding to the branch option based on a conditional control mechanism includes: for a first branch option, controlling a style attribute of the detailed plot corresponding to the first branch option based on the conditional control mechanism.
[0007] In a possible embodiment, the method provided by the embodiment of the present application also includes: determining, for each branch option, the correlation between the detailed plot corresponding to the branch option and the overall generated text; and based on the correlation, using the detailed plot of the target branch option as the content of the text to be generated.
[0008] In a possible embodiment, based on the relevance, taking the detailed plot of the target branch option as the content of the text to be generated includes: determining the score corresponding to each branch option according to the relevance of the detailed plot corresponding to each branch option with the overall generated text; and taking the detailed plot corresponding to the branch option with the highest score as the content of the text to be generated.
[0009] In a possible embodiment, the method provided in the embodiment of the present application also includes: in the process of generating detailed plot content, based on a model adopting a long short-term memory network LSTM architecture, recording prior state information of prior plot content; and based on the prior state information associated with the prior plot content, generating subsequent plot content, wherein the subsequent plot content includes content associated with the prior state information.
[0010] In some embodiments, the method provided by the embodiments of the present application also includes: analyzing the user's interest level in the current text content based on the user's operations during the reading of the generated text content and the user's stay time on the current text content; and adjusting the content of the text to be generated according to the interest level.
[0011] In a second aspect, an embodiment of the present application also provides a text generation device, comprising: an acquisition module for acquiring an original text; a first determination module for determining a sub-text as a branch node from the original text using a preset algorithm set; a second determination module for determining a plurality of branch options based on the sub-text; and a generation module for generating, for any branch option, a detailed plot corresponding to the branch option based on a conditional control mechanism.
[0012] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method in any possible implementation of the first aspect.
[0013] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the method in any possible implementation of the first aspect mentioned above.
[0014] The text generation method, device, equipment and storage medium provided by the present application first obtain the original text; then, a preset algorithm set is used to determine the subtext as the branch node from the original text; then, based on the subtext, multiple branch options are determined; for any branch option, based on the conditional control mechanism, the detailed plot corresponding to the branch option is generated. In this way, for texts with multiple different possible branches, the method provided by the present application can automatically generate multiple plot contents, thereby improving the content richness and diversity of the generated text. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 A schematic diagram of an application scenario of a text generation method of this application;
[0016] Figure 2 A flow chart of a text generation method provided in an embodiment of the present application;
[0017] Figure 3 A flowchart of another text generation method provided in an embodiment of the present application;
[0018] Figure 4 A schematic diagram of the module structure of a text generation device provided in an embodiment of the present application;
[0019] Figure 5 A hardware structure diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0020] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0021] In the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit the difference. It should be noted that words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way. In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more.
[0022] It should be noted that the "at..." in the embodiment of the present application can be the instant when a certain situation occurs, or can be a period of time after a certain situation occurs, and the embodiment of the present application does not specifically limit this. In addition, the text generation method provided in the embodiment of the present application is only used as an example, and the text generation method can also include more or less content.
[0023] At present, AI technology has made great progress in the fields of natural language processing and text generation. In the field of text creation, some researchers have tried to apply deep learning technology to the process of novel creation. However, the quality of text generated by existing methods is poor, and the content of the generated text is relatively monotonous.
[0024] In order to solve the above problems, an embodiment of the present application provides a text generation method, through which high-quality text with rich and natural plots can be generated.
[0025] Figure 1 Schematic diagram of application scenarios of the text generation method provided in the present application. The application scenario includes a terminal 101 and a server 102. The terminal 101 can be any electronic device such as a computer or a mobile phone. In some embodiments, the terminal 101 has a human-computer interaction function and can interact with a user. The terminal 101 can be an electronic device with input and output modules such as a display screen and a keyboard. The user can input the original text through the terminal 101, such as the introduction, background, characters or story outline of the text. In some embodiments, the server 102 can generate a text containing detailed plot content based on the original text input by the user, and the generated text can be, for example, a novel, a play, a game script, etc.
[0026] In some embodiments, the text generation method provided by the embodiments of the present application is applied in an interactive text creation process. That is, the user can participate in the text creation process through the terminal 101 and perform some interactive operations. For example, the user can input the outline, theme or central idea of the text to be generated through the terminal 101, so that the terminal 101 automatically generates the text according to the theme or central idea input by the user. For another example, in the process of generating text, the terminal 101 provides the user with some prompts or some options for the user to choose, so as to generate subsequent text content according to the user's choice.
[0027] Figure 2 A flow chart of a text generation method provided in an embodiment of the present application. Figure 2 As shown in Figure 1 The method is implemented on the server 102 shown. The method specifically includes:
[0028] S210: Obtain original text.
[0029] In some embodiments, the user may input a story outline, theme, central idea, or guide as the original text. For example, the original text input by the user may be "Xiao Li stood at a fork in the forest, with a dark path on the left and a sunny avenue on the right."
[0030] In some embodiments, the user may also input keywords as the original text, and generate a central idea or theme based on the original text input by the user. For example, the user inputs keywords such as "Xiao Li" and "Forest Crossroads". Based on these keywords, one or more story outlines are generated and provided to the user, and the user may select a story outline from them to generate subsequent text content based on the story outline selected by the user.
[0031] In some embodiments, multiple branch options may be generated during the text creation process, and different branch options may correspond to different storylines. In the embodiment of the present application, the following method can be used to identify branch options to further generate subsequent plots.
[0032] S220: Using a preset algorithm set, determine a subtext as a branch node from the original text.
[0033] In some embodiments, the preset algorithm set includes some specific machine learning models or algorithms.
[0034] In some embodiments, the preset algorithm set includes a semantic recognition model and a part-of-speech recognition model. In this way, based on the semantic recognition model combined with the part-of-speech recognition model, at least one first sub-text that can serve as a potential branch node can be determined from the original text obtained in step S210. For example, the semantic representation model can be a bidirectional encoding conversion BERT model, or other models that can represent semantics; the part-of-speech recognition model includes a conditional random field (CRF) model, a sequence labeling model based on LSTM, etc., and can also be other models that can recognize the part of speech of words or phrases in the text.
[0035] In some embodiments, the original text may first be subjected to word segmentation, stop word removal and other processing operations to convert the processed text into an input format acceptable to the BERT model. The pre-trained BERT model is then used to perform bidirectional encoding on the pre-processed text to obtain a context-related vector representation of each word. That is, the word vector in the original text can be represented using the BERT model. Further, a part-of-speech recognition model (such as a sequence tagging model based on LSTM) can be used to tag the text with parts of speech to identify nouns, verbs, and adjectives. Finally, the word vector obtained by BERT encoding can be combined with the part-of-speech tag. For example, a simple splicing or a more complex fusion method can be used. In this way, based on the features after the word vector and the part-of-speech tag are combined, considering the semantic importance, syntactic structure, part of speech, contextual situation and other factors of the word, at least one text that can serve as a potential branch node is identified from the original text. For example, a text containing the semantics of "fork" that may produce branch options can usually be used as a potential branch node.
[0036] Next, a sequence labeling algorithm based on an attention mechanism may be used to determine a score corresponding to each first subtext, which is used to indicate the importance of the corresponding first subtext as a potential branch node.
[0037] In some embodiments, a pre-trained word embedding model (such as a Word2Vec model, or a transformer model (such as BERT) can be used to encode each sub-text to obtain a vector representation of each sub-text. Then, an attention mechanism can be used to calculate the relevance of each first sub-text to the entire text to obtain an attention weight; finally, an importance score can be assigned to each first sub-text based on the attention weight. For example, a query vector (queryvector) can be calculated: the average vector of the entire text or a special [CLS] tag can be used. The similarity score between each sub-text vector and the query vector is calculated. In some embodiments, the score can be further adjusted or standardized according to specific task requirements. The similarity score is normalized using a softmax function to obtain an attention weight. Finally, the attention weight can be used as the importance score of each first sub-text. Further, each first sub-text can be labeled according to the calculated importance score of each first sub-text. Finally, a threshold can be set to mark the second sub-text in the first sub-text whose corresponding score is higher than the threshold as the sub-text of the branch node.
[0038] S230: Determine multiple branch options based on the sub-text.
[0039] Still referring to the above example, based on the subtext of "fork in the road", we can come up with two branch options: "left" and "right".
[0040] S240. For any branch option, generate a detailed plot corresponding to the branch option based on a conditional control mechanism.
[0041] In some embodiments, a machine learning model embedded with a conditional control mechanism and / or a plot embedding mechanism may be used to generate a detailed plot. The machine model may be any model capable of implementing text creation.
[0042] In some embodiments, taking any branch as an example, for the branch (in the embodiments of the present application, the any branch referred to here is referred to as the first branch option), the style attribute of the detailed plot corresponding to the first branch option can be controlled based on a conditional control mechanism. In the embodiments of the present application, the conditional control mechanism refers to setting a specific mechanism, which will be triggered when certain conditions are met. For example, if the text style required by the user is a sad style, in the process of generating text using a machine learning model, if content that is significantly different from the style appears continuously, the corresponding conditional control mechanism is triggered to generate more sad-style content.
[0043] In some embodiments, in order to make the generated text more natural, during the interaction with the user, it is also possible to determine whether to trigger a conditional control mechanism based on the user's operations during the reading of the text and the user's stay time on the current text.
[0044] For example, in the process of generating text, multiple options may be provided for the user to choose from. If it is detected that the user frequently selects the safe option, the conditional control mechanism is triggered, which will gradually increase the frequency of dangerous elements. For another example, if the user always selects the forward branch strategy, the conditional control mechanism may also be triggered, and the proportion of the reverse branch strategy will be automatically added in the subsequent options.
[0045] In some embodiments, the user's interest in the current text can also be analyzed based on the user's interactive operations during the text reading process and the user's stay time on the current text; and the content of the text to be generated can be adjusted according to the interest level.
[0046] For example, if the reader stays at a branch point for a longer time, the machine learning model will generate more relevant clues or explanations later.
[0047] In some embodiments, a plot embedding mechanism may be used to encode the plot content into a vector. In this way, when similar plot content needs to be generated later, the plot similarity is compared based on the vector corresponding to the current text content and the vector corresponding to the generated plot content. If the similarity is high, the plot embedding mechanism is triggered, and the generated associated plot content can be directly called to make fine adjustments to the plot content to meet the current text needs.
[0048] For example, for the identified branch "Choose the left path", the method provided in step S240 can be used to generate the corresponding plot development: "Xiao Li took a deep breath and chose the left path. As she went deeper, the surrounding trees became more and more dense, blocking most of the sunlight. Suddenly, she heard a mysterious sound coming from a distance...". Optionally, the method provided in step S240 can be used to generate another branch plot for "Choose the right avenue".
[0049] like Figure 3 As shown, in some embodiments of the present application, the method provided in the embodiments of the present application further includes the following steps:
[0050] S310: For each branch option corresponding to a detailed plot, determine the relevance of the detailed plot corresponding to each branch option with the entire generated text.
[0051] S320: Based on the correlation, the detailed plot of the target branch option is used as the content of the text to be generated.
[0052] In some embodiments, the score corresponding to each branch option can be determined based on the correlation between the detailed plot corresponding to each branch option and the generated text as a whole; and the detailed plot corresponding to the target branch option with the highest score is used as the content of the text to be generated.
[0053] For example, for any branch option, a sequence labeling algorithm based on the attention mechanism can be used to determine the score of the detailed plot corresponding to the branch option. The score is used to indicate the importance of the corresponding branch option.
[0054] For example, for any branching option, the generated detailed plot can be split into multiple sub-texts, and then each sub-text can be encoded using a pre-trained word embedding model (such as the Word2Vec model, or a transformer model (such as BERT) to obtain a vector representation of each sub-text. Next, the attention mechanism can be used to calculate the relevance of each sub-text to the overall text to obtain the attention weight; finally, an importance score can be assigned to each sub-text based on the attention weight. For example, the query vector (query vector): the average vector of the entire text or a special [CLS] marker is used. The similarity score between each sub-text vector and the query vector is calculated. In some embodiments, the score can be further adjusted or standardized according to the specific task requirements. The similarity score is normalized using the softmax function to obtain the attention weight. Finally, the attention weight can be used as the importance score of each branch option. Furthermore, each branch option can be labeled according to the calculated importance score of each branch option. In some embodiments, a threshold can be set to automatically select the branch option with the highest score among multiple branch options as the final branch option to continue generating subsequent plot content. In some embodiments, the plot contents corresponding to these branch options can also be displayed to the user separately, and the user can select the final branch option. The user's choice and the importance score of each branch option can be recorded to facilitate the subsequent training of the machine learning model.
[0055] In some embodiments, a plot structure analysis model may be used to determine the degree of influence of each branch option on the complete plot to be generated to determine which branch to select as the final plot content. In a possible embodiment, the plot structure analysis model may be a model based on a graph neural network (GNN).
[0056] For example, the original text obtained is, for example, "Xiao Li stands at a fork in the forest, with a dark path on the left and a sunny avenue on the right." The method of the embodiment of the present application can automatically identify the text "fork in the road" as a potential branch node, and generate two branch options corresponding to "left" and "right" respectively. Then, GNN is used to analyze the potential impact of these two branches on the overall plot development and decide whether to use them as actual branches.
[0057] In some embodiments, an adversarial training method can also be used to improve the quality of the detailed plot content through a discriminator network. Adversarial training is a generative adversarial network (GAN), including a generator network and a discriminator network, wherein the generator network is used to generate detailed plot content; the discriminator network is used to judge the authenticity and quality of the content, and the generator is continuously improved based on the feedback of the discriminator. Through this adversarial process, the discriminator becomes more and more adept at identifying low-quality content, and the generator is forced to continuously improve the quality of the generated content. Ultimately, the generator is able to produce high-quality detailed plot content.
[0058] In some embodiments, in the process of generating detailed plot content, the previous state information of the previous plot content may be recorded based on a model using a long short-term memory network (LSTM) architecture; and the subsequent plot content may be generated based on the previous state information associated with the previous plot content, so that the generated subsequent plot content includes the content associated with the previous state information.
[0059] For example, we can record the state changes after Xiao Li chooses the left path, such as the items he carries and the description of the environment. In subsequent generation, the system will take this state information into account to ensure the continuity of the plot. For example, if Xiao Li picks up a flashlight on this road, the system will automatically consider the possibility of using the flashlight in subsequent dark scenes.
[0060] In some embodiments, a "dynamic knowledge graph" is implemented that updates and maintains character relationships, plot developments, and environmental status in real time.
[0061] In some embodiments, a reinforcement learning algorithm is used to optimize the long-term consistency maintenance strategy to ensure output consistency under the same strategy.
[0062] In some embodiments, deep reinforcement learning methods, particularly policy gradient-based algorithms, can be used to dynamically adjust the difficulty and complexity of the story.
[0063] The text generation method provided in the embodiment of the present application obtains the original text and determines the subtext as the branch node and multiple branch options from the original text, thereby generating a detailed plot. It is possible to generate a high-quality text with rich and natural plots in the scenario where there are branch nodes.
[0064] Based on the same inventive concept, the present application embodiment also provides a text generation device. Figure 4As shown, it is a structural schematic diagram of a text generation device 400, which may include: an acquisition module 401, used to acquire original text; a first determination module 402, used to determine a sub-text as a branch node from the original text acquired by the acquisition module 401 using a preset algorithm set; a second determination module 403, used to determine multiple branch options based on the sub-text determined by the first determination module 402; and a generation module 404, used to generate a detailed plot corresponding to any branch option based on a conditional control mechanism.
[0065] In some embodiments, the preset algorithm set includes a semantic representation model and a part-of-speech recognition model. The first determination module 402 is also used to determine at least one first subtext as a potential branch node from the original text based on the semantic representation model combined with the part-of-speech recognition model; use a sequence labeling algorithm based on an attention mechanism to determine the score corresponding to each first subtext, which score is used to indicate the importance of the corresponding first subtext as a potential branch node; and determine the second subtext in at least one first subtext whose corresponding score meets the preset conditions as a subtext as a branch node.
[0066] In some embodiments, the generation module 404 is further configured to control, for the first branch option, a style attribute of the detailed plot corresponding to the first branch option based on a conditional control mechanism.
[0067] In some embodiments, the text generation device 400 also includes a third determination module, which is used to: determine the correlation between the detailed plot corresponding to each branch option and the generated text as a whole, for the detailed plot corresponding to each branch option; and based on the correlation, use the detailed plot of the target branch option as the content of the text to be generated.
[0068] In some embodiments, the third determination module is further used to determine the score corresponding to each branch option based on the correlation between the detailed plot corresponding to each branch option and the generated text as a whole; and to use the detailed plot corresponding to the branch option with the highest score as the content of the text to be generated.
[0069] In some embodiments, generation module 404 is also used to record prior state information of prior plot content in the process of generating detailed plot content based on a model using a long short-term memory network (LSTM) architecture; and to generate subsequent plot content based on the prior state information associated with the prior plot content, wherein the subsequent plot content includes content associated with the prior state information.
[0070] In some embodiments, the text generation device 400 also includes an adjustment module for analyzing the user's interest in the current text content based on the user's operations during the reading of the generated text content and the user's stay time on the current text content; and adjusting the content of the text to be generated according to the interest level.
[0071] The text generation device provided in the embodiment of the present application obtains the original text and determines the subtext as the branch node and multiple branch options from the original text, thereby generating a detailed plot. In the scenario where there are branch nodes, it is possible to generate content including multiple different branches, thereby improving the content diversity of the generated text.
[0072] Based on the same inventive concept, an embodiment of the present application also provides an electronic device. Figure 5 The electronic device shown further includes a communication interface 503 and a communication bus 504 , wherein the processor 501 , the memory 502 and the communication interface 503 communicate with each other via the communication bus 504 .
[0073] The memory 502 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication bus 504 may be an ISA bus, a PCI bus, or an EISA bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one bidirectional arrow is used in the figure, but it does not mean that there is only one bus or one type of communication bus.
[0074] The communication interface 503 is used to connect to at least one user terminal and other network units through a network interface, and send the encapsulated message to the user terminal through the network interface.
[0075] The processor 501 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 501. The above processor 501 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present disclosure can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 502 , and the processor 501 reads the information in the memory 502 and completes the steps of the method of the above embodiment in combination with its hardware.
[0076] The present application embodiment also provides a computer storage medium, in which a computer-readable storage medium stores computer-executable instructions, which are used to implement the text generation method described in any of the above embodiments when executed by a processor, and therefore, will not be described in detail here. In addition, the description of the beneficial effects of the same method will not be described in detail. For technical details not disclosed in the computer storage medium embodiment of the present invention, please refer to the description of the method embodiment of the present invention.
[0077] An embodiment of the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it is used to implement the text generation method described in any of the above embodiments. Therefore, it will not be described in detail here.
[0078] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the above-mentioned program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The above-mentioned storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0079] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A text generation method, characterized in that: include: Get the original text; Using a preset algorithm set, determining a subtext as a branch node from the original text; Based on the subtext, determining a plurality of branch options; as well as For any branch option, a detailed plot corresponding to the branch option is generated based on a conditional control mechanism.
2. The method according to claim 1, characterized in that The preset algorithm set includes a semantic representation model and a part-of-speech recognition model; the method of using the preset algorithm set to determine a subtext as a branch node from the original text includes: Determine at least one first subtext as a potential branch node from the original text based on the semantic representation model combined with the part-of-speech recognition model; Using a sequence labeling algorithm based on an attention mechanism, determining a score corresponding to each of the first subtexts, the score being used to indicate the importance of the corresponding first subtext as the potential branch node; and A second sub-text in the at least one first sub-text, the corresponding score of which satisfies a preset condition, is determined as the sub-text serving as a branch node.
3. The method according to claim 1, characterized in that For any branch option, based on the conditional control mechanism, generating the detailed plot corresponding to the branch option includes: For the first branch option, the style attribute of the detailed plot corresponding to the first branch option is controlled based on the conditional control mechanism.
4. The method according to claim 1, characterized in that The method further comprises: For each branch option corresponding to a detailed plot, respectively determine the relevance of the detailed plot corresponding to each branch option with the generated text as a whole; and Based on the relevance, the detailed plot of the target branch option is used as the content of the text to be generated.
5. The method according to claim 4, characterized in that Based on the relevance, taking the detailed plot of the target branch option as the content of the text to be generated includes: Determine the score corresponding to each branch option according to the relevance of the detailed plot corresponding to each branch option to the generated text as a whole; and The detailed plot corresponding to the target branch option with the highest score is used as the content of the text to be generated.
6. The method according to claim 1, characterized in that The method further comprises: In the process of generating detailed plot content, based on the model using the long short-term memory network LSTM architecture, the prior state information of the prior plot content is recorded; and Based on the previous state information associated with the previous plot content, subsequent plot content is generated, the subsequent plot content including the content associated with the previous state information.
7. The method according to claim 1, characterized in that The method further comprises: Analyzing the user's interest in the current text content based on the user's actions in the process of reading the generated text content and the user's stay time on the current text content; and According to the degree of interest, the content of the text to be generated is adjusted.
8. A text generation device, characterized in that: include: The acquisition module is used to obtain the original text; A first determination module, configured to determine a subtext as a branch node from the original text by using a preset algorithm set; A second determination module, used to determine a plurality of branch options based on the subtext; as well as The generation module is used to generate the detailed plot corresponding to any branch option based on the conditional control mechanism.
9. An electronic device, comprising: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.
Citation Information
Patent Citations
Generation method and device of interactive multimedia content, electronic equipment and storage medium
CN117633258A
Generation method and device of interactive multimedia content and computer readable storage medium
CN117633259A
Stroma phrase generation method and device, electronic equipment and storage medium
CN117972015A
Web novel-specific treatment generation program using natural language processing AI
KR102720229B1