CHAE Fine-Grained Controllable Story Generation with Characters Actions and Emotions Xinpeng Wang1 Han Jiang1 Zhihua Wei1 Shanlin Zhou2_2

2025-04-30 0 0 690.42KB 12 页 10玖币
侵权投诉
CHAE: Fine-Grained Controllable Story Generation with Characters,
Actions and Emotions
Xinpeng Wang1, Han Jiang1, Zhihua Wei1
, Shanlin Zhou2
1Department of Computer Science and Technology, Tongji University, Shanghai, China
2School of Computer Science and Technology, Shanghai University of Electric Power, Shanghai, China
{wangxinpeng, 2230780, zhihua_wei}@tongji.edu.cn
zhoushanlin@mail.shiep.edu.cn
Abstract
Story generation has emerged as an interest-
ing yet challenging NLP task in recent years.
Some existing studies aim at generating flu-
ent and coherent stories from keywords and
outlines; while others attempt to control the
global features of the story, such as emotion,
style and topic. However, these works focus
on coarse-grained control on the story, neglect-
ing control on the details of the story, which
is also crucial for the task. To fill the gap,
this paper proposes a model for fine-grained
control on the story, which allows the gen-
eration of customized stories with characters,
corresponding actions and emotions arbitrar-
ily assigned. Extensive experimental results
on both automatic and human manual eval-
uations show the superiority of our method.
It has strong controllability to generate sto-
ries according to the fine-grained personalized
guidance, unveiling the effectiveness of our
methodology. Our code is available at https:
//github.com/victorup/CHAE.
1 Introduction
Story generation, one of emergent tasks in the field
of natural language generation, requires following
sentences given the beginning of the story. For hu-
man beings, it is believed that storytelling requires
strong logical thinking ability and organizational
competence, and for machines it may be even more
intractable. Nonetheless, works on story generation
can help machines communicate with humans and
drive improvements in natural language processing
(Alabdulkarim et al.,2021).
At present, most works on story generation fo-
cus on the coherence of the story generated ac-
cording to keywords, outlines and commonsense
knowledge (Yao et al.,2019;Guan et al.,2019;
Rashkin et al.,2020;Guan et al.,2020;Ji et al.,
2020). Some other works aim at generating sto-
ries controlled by overall emotion, style, and topic
Corresponding author
(Keskar et al.,2019;Xu et al.,2020;Brahman and
Chaturvedi,2020;Kong et al.,2021). However, in
reality, people often expect more detailed designs
catering to their needs rather than a simple theme or
topic in the generated story. For example, a novel
with more complete elements, i.e., plot, character,
theme, viewpoint, symbol, and setting is usually
preferred to those made up out of thin air.
Taking the control in story generation as the cut-
ting point, GPT-2 (Radford et al.,2019) can fulfill
the story according to the beginning, but the pro-
cess of generation cannot be controlled by people,
resulting in unlogical outputs that lack practical-
ity. CTRL (Keskar et al.,2019) can specify the
generation of articles with different styles through
some style words, but such control stays at the
coarse-grained level, and makes a relatively weak
influence. CoCon (Chan et al.,2020) introduces
natural language to guide text generation. Fang
et al. (2021) propose a new task that guides para-
graph generation through a given sequence of out-
line events. However, the above two studies just
explicitly add some contents to the generated sen-
tences, which is similar to forming sentences with
given phrases, not using the input as a condition
guide for the generative models. SoCP presented by
Xu et al. (2020) can generate stories under change-
able psychological state control, while it does not
govern the detailed contents of the story.
In this paper, we consider more fine-grained
control on story generation, and propose a model,
CHAE
for fine-grained controllable story gen-
eration, allowing the generation of stories with
customized
CH
aracters, and their
A
ctions and
E
motions. Characters are the core of the story.
Their actions drive the story along, and their emo-
tions make the story lively and interesting. Con-
sequently, we take the characters along with their
actions and emotions as the control conditions. It is
a challenge that our model needs to control multiple
characters with their actions and emotions respec-
arXiv:2210.05221v1 [cs.CL] 11 Oct 2022
tively in a story, especially under the guidance in
the form of natural language. To crack the nut, a
novel input form conducive to fine-grained control
on story generation is introduced into CHAE. Con-
cretely, we use various prompts for fine-grained
control conditions in different aspects. Moreover,
we design different methods for different control
conditions to improve the control effect. Inspired
by multi-task learning, we incorporate a character-
wise emotion loss while training, thus enforcing
the relevance between the characters and their emo-
tions respectively.
The contributions of our work can be summa-
rized as follows:
We first take the characters with their actions
and emotions of the story into account to con-
duct more fine-grained controllable story gen-
eration.
We propose a model CHAE with a novel in-
put form that helps the model control the story
in various aspects, and a character-wise emo-
tion loss to relate the characters and the corre-
sponding emotions.
The results of both automatic and human eval-
uation show that our model has strong control-
lability to generate customized stories.
2 Related Work
Story Generation
Story generation has attracted
more and more researchers to explore in recent
years. There are many challenges in the task, such
as context coherence and control. For context co-
herence, some works are devoted to introducing
a series of keywords (Yao et al.,2019), outlines
(Rashkin et al.,2020), or incorporating external
knowledge (Guan et al.,2019,2020;Ji et al.,2020)
into the story. For style and sentiment control,
Kong et al. (2021) generate stories with specified
style given a leading context. However, it only fo-
cuses on the global attributes of the story. Brahman
and Chaturvedi (2020) work on generating stories
with desired titles and the protagonists’ emotion
arcs, and Xu et al. (2020) generate stories consid-
ering the changes in the psychological state, while
they just control the emotion lines instead of the
detailed contents.
Controllable Text Generation
We have wit-
nessed the great performance of SOTA models for
BART
Encoder
BART
Decoder
CLS Head
Softmax
Linear
Input
Context Chae
Context Vector
Attention
Distribution
×(1 − *$%#)×*$%#
Emotion Label
Final Distribution
Output
!!"#
...
k
Figure 1: The architecture of CHAE. The input is the
concatenation of two components, Context and Chae,
which will be further explained in Sec 3. The emotion
labels are used for calculating a character-wise emotion
loss to tie up the characters and their emotions respec-
tively.
text generation these years. Despite the progress
in coherence and rationality of the text generated,
controllability remains to be challenging, which
means generating text with specific attributes, such
as emotion, style, topic, format, etc. CTRL (Keskar
et al.,2019) can control the overall attributes such
as domain, style and topic of the generated text by
adding control codes and prompts. By plugging in
a discriminator, PPLM (Dathathri et al.,2020) can
guide text generation without further training the
language model. CoCon (Chan et al.,2020) fine-
tunes an intermediate block with self-supervised
learning to control high-level attributes i.e., senti-
ment and topic. Compared to the previous works,
our work places the emphasis on more fine-grained,
all-round control on the generating process, includ-
ing the control of characters with their emotions
and actions in the story.
3 Methodology
3.1 Problem Formulation
The process of fine-grained controllable story gen-
eration in this work is defined as follows.
The input of the task has two components. We
refer to the one as
Context
. Let
Context =
(x1, x2, ..., xp)
denote the beginning sentence of
the story, which will be the initial
Context
. The
<soa>
<soc>
<soe>
<sep>
<SEP>
<s> </s>
  

<no_action>
<SEP> <soc> <soa>
<sep>  <soe> 

Figure 2: The input form of CHAE. The input starts with hsiand ends with h/si, comprising Context and Chae.
The latter is a sequence of kcontrol conditions on the next sentence to be generated, and each condition controls a
character. We show two possible forms of the control conditions after the brace. The special tokens in Chae are
further explained in Table 1.
other component is
Chae
, a sequence of
k
fine-
grained control conditions on the next sentence.
Each condition in
Chae
is the combination of the
name
Chari
,
n
actions
Acti1, Acti2, ..., Actin
, and
emotion
Emoi
of a character appearing in the next
sentence to be generated, where
n
is not fixed and
i
is the index of the character. Note that we use Italic
Chae
to distinguish the special input component
from our model CHAE.
The model predicts one sentence denoted as
Y= (y1, y2, ..., yq)
at a time by estimating the con-
ditional probability
P(Y|Context, Chae)
. Here
we embody the idea of auto-regression by adopting
an iterative generation strategy, that is, the sen-
tence generated is then concatenated to
Context
for next prediction. Especially, at training time, we
concatenate the gold sentences instead of generated
sentences to
Context
incrementally like teacher
forcing.
The goal of this task is to generate a story where
each sentence adheres to the input condition
Chae
in terms of character, action, and emotion, through
which elevate the quality of generation in a fine-
grained manner.
3.2 Model Architecture
The architecture of our model CHAE is shown
in Figure 1. CHAE is built upon a BART model
(Lewis et al.,2020). As mentioned, our model em-
bodies the idea of auto-regression by adopting an
iterative generation strategy. On the one hand, the
iteratively updated
Chae
helps control the content
of each sentence at a detailed level of granular-
ity. On the other hand, the strategy ensures that
the model can always see the foregoing. Consid-
ering the incremental
Context
can be extra long,
we employ BART rather than GPT-2. GPT-2 is an
auto-regressive model fully based on transformer
decoder, while BART has a bidirectional encoder,
which might make it better in understanding and
encoding long input sequences. To confirm the
Special tokens Meaning
hSEP iThe start token of a condition.
hsociThe start token of a character’s name.
hsoaiThe start token of actions.
hsoeiThe start token of an emotion.
hsepiThe start token of a single action.
hno_actioniThe token representing no action.
Table 1: The meanings of the special tokens in Chae.
hypothesis, we also compared BART with GPT-2
on the benchmark dataset in Sec 4, and found that
BART outperformed GPT-2 in story generation.
3.3 Generation Based on Fine-Grained
Control Conditions
To generate a story with the characters, their ac-
tions and emotions specified, we need to remind
the BART model of the elements controlled cur-
rently from time to time. Inspired by the practice of
leveraging special tokens for controllable genera-
tion (Fang et al.,2021;Keskar et al.,2019;Tsutsui
and Crandall,2017), we propose a novel form of
input (titled
Chae
), which is a sequence of
k
fine-
grained control conditions on the next sentence to
be generated. Each condition in
Chae
controls a
character, and each segment in the condition con-
trols an element (i.e., character’s name, action, and
emotion) of the corresponding character. Note that
any number of actions can be assigned in a condi-
tion. The nested sequence form of
Chae
facilitates
the neat combination of various fine-grained con-
trol conditions.
We design several special tokens and add them
between each segment as the control prompts (see
Figure 2). In this study, 6 special tokens are used to
prompt the model. They are hSEP i,hsoci,hsoai,
hsoei
,
hsepi
, and
hno_actioni
. The meanings of
the tokens are shown in Table 1.
Then, we encode the input
Context
and
Chae
摘要:

CHAE:Fine-GrainedControllableStoryGenerationwithCharacters,ActionsandEmotionsXinpengWang1,HanJiang1,ZhihuaWei1,ShanlinZhou21DepartmentofComputerScienceandTechnology,TongjiUniversity,Shanghai,China2SchoolofComputerScienceandTechnology,ShanghaiUniversityofElectricPower,Shanghai,China{wangxinpeng,2230...

展开>> 收起<<
CHAE Fine-Grained Controllable Story Generation with Characters Actions and Emotions Xinpeng Wang1 Han Jiang1 Zhihua Wei1 Shanlin Zhou2_2.pdf

共12页,预览3页

还剩页未读, 继续阅读

声明:本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。玖贝云文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知玖贝云文库,我们立即给予删除!
分类:图书资源 价格:10玖币 属性:12 页 大小:690.42KB 格式:PDF 时间:2025-04-30

开通VIP享超值会员特权

  • 多端同步记录
  • 高速下载文档
  • 免费文档工具
  • 分享文档赚钱
  • 每日登录抽奖
  • 优质衍生服务
/ 12
客服
关注