A fine-grained character, action and emotion controllable story generation method

By using the FCG story generation model and employing techniques such as the BART pre-trained model and special prompts, fine-grained control over characters, actions, and emotions is achieved, generating logically coherent, thematically consistent, and diverse stories, thus solving the problem of insufficient control in existing technologies.

CN115617982BActive Publication Date: 2026-03-24TONGJI UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-22
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing story generation methods struggle to achieve fine-grained control over characters, actions, and emotions, resulting in stories lacking logical coherence, thematic consistency, and content diversity. Furthermore, coarse-grained control fails to meet user needs.

Method used

We designed an FCG story generation model, using the BART pre-trained model as the main framework. Through fine-tuning with special prompts, attention copying mechanisms for characters and actions, and multi-task learning of emotion control, we achieved fine-grained control.

Benefits of technology

The generated stories are richer and more controllable, capable of generating logically coherent, thematically consistent, and highly granular stories based on custom conditions to meet user needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115617982B_ABST
    Figure CN115617982B_ABST
Patent Text Reader

Abstract

A fine-grained controllable character, action and emotion story generation method is disclosed.The step 1 is that the context of the story and the artificially specified character, action and emotion conditions are input into the story generation model, and the special prompt fine-tuning method designed for fine-grained control is used for learning.The step 2 is that the story generation model copies the input condition information through the attention copy mechanism designed for character and action control, and the controllability of the characters and actions in the input conditions is improved.The step 3 is that the story generation model uses the character-level emotion loss designed for emotion control, so that the output sentence can reflect the emotions of different characters in the input conditions.The step 4 is that the story generation model outputs the final output sentence, i.e., the generated story sentence.The step 5 is that the generated story sentence is spliced with the story context as a new input context, and the above steps are repeated until the ideal story length set by the artificial is reached.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the field of computer artificial intelligence, and mainly relates to the application in the natural language generation aspect in natural language processing, in particular, to a fine-grained character, action and emotion controllable story generation method. BACKGROUND

[0002] Natural language processing is a research direction widely concerned in the field of artificial intelligence, aiming to enable machines to understand and create human-like natural language. Among them, natural language generation is committed to creating the creativity of machines, mainly including machine translation, dialogue system, automatic abstract generation and other applications.

[0003] Story generation is an important branch of natural language generation task, which requires more creativity of the model compared with machine translation and automatic abstract generation. It can also be used as a high-difficulty test to verify the level of artificial intelligence. The story generation task usually takes the beginning of the story as the input and generates the subsequent story as the output. Since it is only guided by the information of the beginning of the story, the subsequent generated content often cannot be properly controlled, and there are problems such as lack of logic or application value. This task requires high logical thinking ability and language organization ability for humans, so it is more difficult for machines. Generally speaking, story generation faces the following challenges: context coherence, theme consistency, content diversity, controllability, etc.

[0004] Most traditional story generation methods focus on solving the coherence of story generation, such as introducing keywords, story outlines, common sense knowledge and other external information to increase the input content, thereby improving the coherence of the story. However, these works are lacking in controllability. In addition, some methods have been proposed to control the overall emotion, style and theme of the story, but these methods can only control at a coarse-grained level and cannot control the details of story generation. Therefore, there is an urgent need to invent a fine-grained controllable story generation method that can control multiple aspects to meet people's use needs. SUMMARY

[0005] The purpose of the present application is to overcome the shortcomings of the prior art, and disclose a fine-grained character, action and emotion controllable story generation method, characterized in that an FCG story generation model is built for generating stories.

[0006] In order to meet the needs of fine-grained controllable story generation, the present application proposes a fine-grained controllable story generation method of characters, actions and emotions, and the designed model is called FCG (Fine-Grained Controllable Story Generation). The FCG model can generate a more controllable and rich story according to the self-defined story characters, actions and emotions of the characters. Characters are the core of a story, the actions of characters drive the development of a story, and the emotions of characters make a story more lively and interesting. Therefore, the FCG model can take the characters, actions and emotions of a story as controllable conditions to guide the generation of a more fine-grained story.

[0007] The FCG model is mainly based on the popular BART pre-training model in the natural language generation model as the main framework of story generation. The framework is a model based on the Encoder-Decoder architecture of the Transformer, which can generate high-quality text content. In order to enable the model to conveniently receive the control mode in the form of human natural language and the control of different aspects of characters, actions and emotions, a special prompt for fine-grained control is designed. That is, a variety of controllable information can be organized into a sequence that can be input into the model through a variety of different special prompt characters. After fine-tuning and training of the model, the model can well recognize different input information. In addition, an attention copy mechanism for character and action control is designed for different aspects of control. The input information can be copied to provide controllability of characters and actions. A character-level emotion loss for emotion control is also designed. The method of multi-task learning is used to enable the model to distinguish and generate the emotions of different characters in a story.

[0008] Compared with the existing story generation methods, the FCG model first considers the characters, actions and emotions of a story as input conditions, and can generate a more controllable and fine-grained story with more rich content and more practicality.

[0009] Advantages

[0010] The present application designs a fine-grained controllable story generation method of characters, actions and emotions that can be artificially specified conditions to address the controllability challenge in the story generation task. A special prompt for fine-grained control is designed to control multiple conditions of characters, actions and emotions at the same time. An attention copy mechanism for character and action control is designed to copy the input information, thereby improving the control effect of characters and actions. A character-level emotion loss for emotion control is designed, and multiple emotion classification heads are added to better identify the emotions of different characters in the input and generate story sentences with accurate emotions. The method of iterative generation is used to continuously generate subsequent story sentences until the ideal story length set by the human is reached. Attached Figure Description

[0011] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:

[0012] Figure 1 FCG Story Generation Model Overall Framework Diagram

[0013] Figure 2 FCG Story Generation Model Input Format Diagram Detailed Implementation

[0014] A method for generating stories with fine-grained control over characters, actions, and emotions, characterized by building an FCG story generation model for generating stories.

[0015] Construction of the FCG story generation model:

[0016] The main component is a BART pre-trained language model, including a BART encoder, BART decoder, sentiment classification head, sentiment labels, linear layers, a softmax function, and a gated soft switch p. gen ,in:

[0017] The BART pre-trained language model learns through a special cue fine-tuning method for fine-grained control, achieving multi-condition fine-grained controllability. K sentiment classification heads are connected after the BART decoder, and the loss is backpropagated through sentiment labels to control the model to accurately generate story sentences with multiple characters' emotions. When the FCG story generation model inputs words, the final output word probability distribution is partly derived from the probability distribution output by the BART decoder after a linear layer and a Softmax function, and partly from the attention distribution of the BART encoder to the input condition Chae, controlled by a gated soft switch p. gen Control the weights of the two parts.

[0018] The process of generating the story is as follows:

[0019] Step 1, set the preceding context of the story as Context = {x1, x2, ..., x...} p The character, action, and emotion conditions specified by the user are input into the FCG model, and the model learns by fine-tuning the model using a special prompting method designed for fine-grained control.

[0020] Step 2: The FCG model replicates the input conditional information through an attention copying mechanism for character and action control, thereby improving the controllability of characters and actions in the input conditions.

[0021] Step 3, the FCG model enables the output sentence to reflect the emotions of different characters in the input conditions by introducing a character-level emotion loss for emotion control;

[0022] Step 4, the FCG model outputs the final output sentence Y = {y1, y2, …, y q , i.e., the generated story sentence;

[0023] Step 5, using the iterative generation method, the generated story sentence is spliced with the story context as a new input context, and the above steps are repeated to iteratively generate new story sentences until the desired story length is reached;

[0024] x1, x2, …, x p represent the input story context, y1, y2, …, y q output story sentence, and p is the length of the output sentence.

[0025] wherein the manually specified character, action, and emotion conditions Chae in step 1 represent a sequence of fine-grained control for the next generated sentence; the Chae includes k manually specified conditions, wherein each condition is composed of a story character name Char i , n actions Act i1 , Act i2 , …, Act in of the character, and the emotion Emo i of the character; k represents the number of specified conditions, i represents the index of the ith character in the kth condition, and n represents the number of character actions; the special prompt character is added between the character, action, and emotion conditions, and is used to guide the model to generate story sentences with corresponding characters, actions, and emotions after pre-training language model fine-tuning training.

[0026] wherein the special prompt for fine-grained control includes <sep> , <soc> , <soa> , <soe> , <sep><no_action> respectively represent the condition start character, the character name start character, the action start character, the emotion start character, the single action start character and the no action character.

[0027] The attention copy mechanism for character and action control in the step 2 comprises the following steps:

[0028] The average attention distribution of h heads of the cross-attention block in the pre-trained language model decoder as the attention degree of the input information, and according to the decoder hidden layer state h dec , the context vector h con , and the decoder input word vector e y A soft switch p is calculated by using a Sigmoid function gen The model generates a word P in the word table according to the soft switch with a probability of p gen , and generates a word P in the word table according to the soft switch with a probability of (1-p voc ). gen The probability distribution is copied from the input condition Chae.

[0029] The character-level emotion loss step for emotion control in the step 3 comprises the following steps:

[0030] k emotion classification heads are added to the output layer of the pre-trained language model decoder, the labels correspond to the emotions of different characters in the input condition Chae, and k is equal to the number of input conditions Chae.

[0031] The embodiments of the present application will be described in detail below with the accompanying drawings and examples, so that the realization process of how the present application applies technical means to solve technical problems and achieve technical effects can be fully understood and implemented.

[0032] The present application discloses a fine-grained character, action and emotion controllable story generation method, and the designed model is called FCG (Fine-Grained Controllable Story Generation). The content of the generated story is more rich and controllable according to the self-defined story characters, actions of the characters and emotions of the characters. Figure 1 The FCG model is shown in the following figure.

[0033] The formal definition of the FCG model is given below. The input of the model contains two parts. One part is the context of the story, which is represented as Context=(x1,x2,…,x p ), where p is the length of the input context. Another part is the input condition Chae, which represents a sequence of fine-grained control for the next sentence to be generated. Chae includes k manually specified conditions, where each condition is composed of a character name Char i , n actions of the character Act i1 , Act i2 ,…, Act in , and the emotion of the character Emo i , where k denotes the number of specified conditions, i denotes the index of the ith character in the k conditions, and n denotes the number of actions of the character. The FCG model generates the next sentence based on the conditional probability P(Y|Context, Chae) each time, denoted as Y = (y1, y2, …, y q ). The FCG model uses an iterative generation method based on the idea of autoregression to generate stories, i.e., the generated sentence is constantly concatenated to the input sentence as the context to generate the next sentence. In the training phase, the FCG model uses the concatenated label sentence, similar to the idea of teacher forcing. The purpose of the FCG model is to create a story that meets the input character, action, and emotion conditions for each sentence, thereby improving the quality of the generated content and meeting people's controllable needs.

[0034] The FCG model technology will be introduced in three parts as follows, the first part is the main framework of the story generation model, the second part is the special prompt fine-tuning for fine-grained control, the third part is the attention copy mechanism for character and action control, and the fourth part is the character-level emotion loss for emotion control.

[0035] First part, main framework of FCG story generation model

[0036] In terms of the main framework of the story generation model, as described above, the FCG model uses an iterative generation strategy based on the idea of autoregression. On the one hand, the iterative update of the input condition Chae can better control the story content in detail. On the other hand, this way can constantly let the model see the generated story context. However, this iterative generation method will cause the input context to increase constantly, which brings certain challenges to the encoding of the context.

[0037] To solve this problem, the FCG model uses a pre-trained model BART to build. BART is a Transformer-based sequence-to-sequence pre-training model, which has a bidirectional encoder similar to BERT and an autoregressive decoder similar to GPT, and has good performance in natural language generation tasks. In the story generation task, GPT-2 is also widely used, which is an autoregressive model built by a Transformer decoder and can be well applied to story generation, which generates the next context step by step according to the beginning. However, according to the characteristics of the FCG model, it is necessary to encode the long context, so the present application selects BART to build the FCG model. The main framework BART will receive two inputs, namely the input context Context and the input condition Chae. First, the word vectors of Context and Chae are spliced into a long sequence, encoded by the bidirectional encoder of BART, and the encoded intermediate hidden layer representation is obtained, and then the autoregressive decoder of BART is used to generate each word, thereby obtaining the next sentence. The formula for BART to process story generation is as follows:

[0038] P voc (y)=P(y t |y <t ,Context,Chae)=softmax(W voc h dec ) (1)

[0039] h dec =Dec(e y<t ,h enc ) (2)

[0040] h enc =Enc(e c ) (3)

[0041] In the above formula, e c represents the word vector spliced by Context and Chae, Enc represents the BART encoder, h enc is the encoded intermediate hidden layer representation, e y<t represents the word vector of the word generated before t, Dec represents the BART decoder, h dec represents the decoded hidden layer representation, and W voc is a learnable parameter of the word output layer.

[0042] According to the story generation main framework built by BART, long text input can be well understood and the next coherent sentence can be generated.

[0043] The second part is the special prompt fine-tuning for fine-grained control

[0044] The present application first considers characters, actions and emotions as input conditions for story generation, and can make the model generate a story with the expected content by manually specifying conditions. There are two challenges in this task: 1) how to process the character, action and emotion input conditions so that they can be input into the model for generation; 2) how to make the model recognize which one of the input conditions corresponds to the character, action and emotion so that the generated content can be better controlled.

[0045] To address the above challenges, the present application designs a special prompt for fine-grained control, such as Figure 2 The FCG model input form of the present application is shown in the dashed box in the schematic diagram. Some special prompt characters are designed to splice characters, actions and emotions into a long sequence, called Chae input conditions, which represent a sequence of fine-grained control conditions for the next generated sentence. The sequence includes k fine-grained controllable condition subsequences, where each condition subsequence is used to control a character and its actions and emotions. By adding these special prompt characters between characters, actions and emotions, the control conditions can be processed and received by the model as text sequences. In addition, after sending the control condition sequence into the model and fine-tuning the training, the model can well learn the meaning represented by the special characters and the correspondence between the conditions after the special characters and the output text, so it can well guide the model to generate story sentences with the corresponding characters, actions and emotions. For a detailed introduction of the special prompt characters, see the table below.

[0046] Special prompt characters Meaning <sep> < / sep> Conditional start character <soc> < / soc> Character name start character <soa> < / soa> Action start character <soe> < / soe> Emotion start character <sep> < / sep> Single action start character <no_action> No action character

[0047] Where the name and emotion of each character are unique, and the action of the character can contain multiple action sequences Act i1 , Act i2 ,…, Act in , or no action, i.e. <no_action>.

[0048] Third part, fine-grained control of characters, actions and emotions

[0049] In order to further improve the controllability of fine-grained character, action and emotion conditions, in addition to the designed input condition Chae, different targeted control methods are designed for different conditions.

[0050] 3.1 Attention copy mechanism for character and action control

[0051] Copy mechanism first appeared in automatic abstract generation system, which can copy partial information of input document to output in the abstract result. In addition, copy mechanism can also generate some words out of the vocabulary through copying, which improves the OOV (Out of Vocabulary) problem to some extent. Based on the copy mechanism in the abstract system, for the control of characters and actions in the task, considering that they are expected to appear in the generated content, a attention copy mechanism for character and action control is designed, which can realize the copying of the expected input content. The FCG model calculates the average attention distribution of the h heads of the cross attention block in the BART decoder as the attention degree of the input information, and according to the decoder hidden layer state h dec con y A soft switch p is calculated by using the Sigmoid function gen The FCG model can generate words in the vocabulary P gen with a probability of p voc , and generate words out of the vocabulary with a probability of 1-p gen according to the probability distribution Copy from the input condition Chae, the formula is as follows:

[0052]

[0053]

[0054]

[0055] In the above formula, W is the learnable parameter of the full connection layer, and a i represents the attention distribution of the i-th head of the cross attention block.

[0056] 3.2 Character-level sentiment loss for sentiment control

[0057] ​​​Emotion classification is a common classification task in natural language understanding tasks, and an emotion classification model can identify which of the input sentences is input into a plurality of emotion labels. Multi-task learning is a learning method that can enable a model to learn multiple specific tasks. For the emotion control of the characters in the task of the present application, the story generation task and the emotion classification task are combined, based on the idea of multi-task learning, a character-level emotion loss for emotion control is designed, which can help the model to generate story sentences while generating in the direction of emotion labels, so as to achieve the purpose of controllable emotion. The difficulty existing in the task of the present application is that the input conditions include a plurality of characters and their corresponding emotions, and the emotions of each character are different. In order to accurately control the emotion of each person, k emotion classification heads equal to the number of input controllable condition subsequences are added to the output layer of the BART decoder, so that the output sentence can reflect the emotions of different characters in the input conditions, and the formula is as follows:

[0058] L EMO =-l e log(P emo ) (7)

[0059] P emo =softmax(W emo h dec ) (8)

[0060] In the above formula, W emo is a learnable parameter of the emotion output layer, h dec is the decoder hidden layer state, P emo is the predicted emotion output probability distribution, and l e is the emotion label.

[0061] The fourth part, the objective function of the FCG story generation model

[0062] The final objective function of the task is the sum of the negative log-likelihood loss and the character-level emotion loss, the former can provide guidance for the model in terms of sentence coherence, and the latter can enable the model to accurately generate sentences containing the emotions corresponding to different characters. The formula is as follows:

[0063]

[0064] L=L NLL +γL EMO (10)

[0065] Wherein γ represents a hyper parameter, used to control the weight of the character-level sentiment loss in the total target. The larger γ is, the more accurate the generated sentence emotion is, but at the same time, it will have a certain impact on the coherence of the sentence; the smaller γ is, the more coherent the generated sentence is, but the emotional expression is not accurate enough. In the method of the application, γ is set to 1 by default, to ensure that the generated sentence is coherent while having rich and accurate emotion.

[0066] Fifth part experiment, conclusion

[0067] Experiment 1

[0068] According to the characteristics of the FCG model of the application, the longer context encoding needs to be encoded, and the BART with a bidirectional encoder can better handle longer inputs than the autoregressive GPT-2 model, so BART is finally selected to build the FCG model. In order to verify this idea, BART and GPT-2 were also compared in the story generation experiment, and it was found that the application of BART to the FCG model was obviously better than GPT-2 in terms of Perplexity, BLEU and Distinct indicators. The experimental results are shown in the following table:

[0069] Model PPL↓ B-1↑ B-2↑ D-1↑ D-2↑ GPT-2 29.21 21.30 6.35 0.744 0.960 BART 14.00 24.15 7.93 0.729 0.964

[0070] Experiment 2

[0071] The application compares the story generation results of the existing model, which shows that the FCG model can generate content coherent and controllable stories according to the artificial specified fine-grained information. Through the story generation experiment of different input conditions Chae, the results show that FCG can generate corresponding content according to different specified conditions, reflecting the controllability of the model. The results are as follows:

[0072] Comparison of story generation results of the model of the application and the existing model:

[0073]

[0074] Story generation examples under different input conditions Chae:

[0075]

[0076] Sixth part application

[0077] The application designs a fine-grained controllable story generation model FCG, which can create stories with more fine-grained conditional content according to the specified characters and corresponding actions and emotions, and is more convenient for practical application, such as can be applied to the creation of novel, script and other genres, can provide inspiration for writers, screenwriters and other literary work creators, and in the future can even completely undertake the creation task.

[0078] The foregoing description demonstrates and describes several preferred embodiments of the present application, but as previously noted, it is to be understood that the application is not limited to the forms described herein, should not be construed as excluding other embodiments, and can be used in various other combinations, modifications, and environments, and can be modified and altered by those skilled in the art based on the teachings and concepts described herein. Any modifications and changes made by those skilled in the art without departing from the spirit and scope of the application shall be within the scope of the appended claims of the present application.

[0079] Summary of innovation points

[0080] Innovation point one: special prompt fine-tuning controllable model for fine-grained control

[0081] Traditional controllable story generation methods either consider the emotional development trend of the specified story or consider the keywords or outline of the specified story to generate the story, but these methods can only control the story generation in some relatively coarse-grained aspects. The present application first considers the characters, actions and emotions as input conditions for story generation, and can generate a story with the expected content by manually specifying the conditions. In order to enable the model to well recognize the manually specified character, action and emotion input conditions, the present application designs a special prompt fine-tuning controllable model for fine-grained control, adopts a BART pre-training language model as the main framework, adds different special prompt characters in front of different conditions respectively, and after model fine-tuning training, the model can well recognize the input condition information and realize the control of the output content. The model generates a story in an iterative generation manner according to the self-recurrence idea, on the one hand, the iterative updated input condition Chae can better control the story content in details; on the other hand, this way can constantly enable the model to see the generated story upper text situation.

[0082] Innovation point two: fine-grained control method for characters, actions and emotions

[0083] In order to further improve the controllability of fine-grained character, action and emotion conditions, in addition to the designed special prompt fine-tuning method for fine-grained control, different targeted control methods are designed for different control conditions. For the control of characters and actions, an attention copy mechanism for character and action control is designed, which can realize the copying of input content and improve the controllability of characters and actions. For the control of character emotions, based on the idea of multi-task learning, a character-level emotion loss for emotion control is designed, which adds an emotion classification head equal to the number of input character information, can identify and enable the output sentence to reflect the emotions of different characters in the input conditions. The purpose of the present application is to create a story that meets the input character, action and emotion conditions in each sentence, thereby improving the quality of the generated content and meeting the controllable needs of people.< / sep> < / soe> < / soa> < / soc> < / sep>

Claims

1. A method for generating stories with fine-grained control over characters, actions, and emotions, characterized in that, Build an FCG story generation model for story generation; Construction of the FCG story generation model: The main component is a BART pre-trained language model, including a BART encoder, BART decoder, sentiment classification head, sentiment labels, linear layers, a softmax function, and a gated soft switch. ,in: The BART pre-trained language model learns through a special cue fine-tuning method for fine-grained control, achieving multi-condition fine-grained controllability. K sentiment classification heads are connected after the BART decoder, and the loss is backpropagated through sentiment labels to control the model to accurately generate story sentences with multiple characters' emotions. When inputting words into the FCG story generation model, the final output word probability distribution is partly derived from the probability distribution output by the BART decoder after a linear layer and a Softmax function, and partly from the BART encoder's handling of input conditions. Chae Attention distribution, and controlled by a gated soft switch. Control the weights of the two parts; The process of generating the story is as follows: Step 1, the above text of the story Context ={x1, x2, ..., x p } and the manually specified characters, actions, and emotional conditions. Chae The input is fed into the FCG model, where it learns through a specially designed fine-tuning method using prompts for fine-grained control. Step 2: The FCG model replicates the input condition information through an attention copying mechanism for character and action control, thereby improving the controllability of characters and actions in the input conditions. Step 3: The FCG model uses character-level emotion loss for emotion control to enable the output sentence to reflect the emotions of different characters in the input conditions. Step 4: The FCG model outputs the final output sentence Y={y1, y2, ..., y...} q }, that is, the generated story statements; Step 5: Using an iterative generation method, concatenate the generated story sentences with the preceding story text to form a new input preceding text. Context And repeat the above steps to iterate and generate new story sentences until the ideal story length set by the human is reached; x1, x2, ..., x p This represents the preceding text of the input story, y1, y2, ..., y q The output story sentences, where p is the length of the output sentences; The manually designated characters, actions, and emotional conditions in step 1 Chae This represents a sequence with fine-grained control over the sentences to be generated next; the... Chae Includes k conditions that can be manually specified, where each condition is represented by a story character name, Char. i The character's n actions (Act) i1 Act i2 , …, Act in And the character's emotions, Emo i Composition; k represents the number of specified conditions, i represents the index of the i-th character in the k-th condition, and n represents the number of character actions; special prompt characters are added between the character, action, and emotion conditions, and after fine-tuning the pre-trained language model, they are used to guide the model to generate story sentences with corresponding characters, actions, and emotions. The attention copying mechanism for character and motion control in step 2 includes the following steps: The average attention distribution of h cross-attention blocks in the pre-trained language model decoder. As a measure of attention to the input information, and based on the decoder hidden layer state h dec Context vector h con and the decoder input word vector e y A soft switch p is calculated using the Sigmoid function. gen The model is based on soft switching with p gen Probabilistically generate word P from the vocabulary list voc , and (1-p gen The probability of ) is based on the probability distribution. From input conditions Chae Copying is performed within the process.

2. The method for generating a story with fine-grained character, action, and emotion controllability according to claim 1, characterized in that: in, The special prompts for fine-grained control include <sep> , <soc> , <soa> , <soe> , <sep> ,<no_action> , respectively represent the start character of a condition, the start character of a character's name, the start character of an action, the start character of an emotion, the start character of a single action, and the character with no action.< / sep> < / soe> < / soa> < / soc> < / sep> 3. The method for generating a story with fine-grained character, action, and emotion controllability according to claim 1, characterized in that: in, The steps regarding the character-level emotional loss in step 3 are as follows: k sentiment classification heads are added to the output layer of the pre-trained language model decoder. The labels correspond to the sentiments of different characters in the input condition Chae, and k is equal to the number of input condition Chaes.

4. The method for generating a story with fine-grained character, action, and emotion controllability according to claim 1, characterized in that, The objective function of the FCG story generation model is: It is the sum of negative log-likelihood loss and character-level emotion loss. The former provides guidance on sentence coherence for the model, while the latter enables the model to accurately generate sentences containing the emotions corresponding to different characters. The formula is shown below: (9) (10) in This represents a hyperparameter used to control the weight of character-level emotional loss relative to the overall objective.

Citation Information

Patent Citations

  • Controllable multi-person psychological guidance story generation method based on deep learning

    CN112183025A