DEIM Forum 2020 G2-1

Response Generation based on the Big Five Personality Traits
Wanqi WU† and Tetsuya SAKAI†† Department of Computer Science and Engineering, Waseda University
3–4–1 Okubo, Shinjuku-ku, Tokyo 169–8555, Japan
E-mail: †wwwangi@moegi.waseda.jp, ††tetsuyasakai@acm.org
Abstract Personality is one’s intrinsic property that is hard to change and closely tied with one’s natural language expression, so it is a potential key to make a dialogue system consistent. While there exist many studies on
generating responses conditioned on certain profiles, little work has been done on incorporating real personalities in
dialogue systems. In this study, we firstly constructed a personality identifier by using the myPersonality dataset
for detecting trait values from utterances. We then used the constructed identifier to label all the conversationsin the Cornell Movie-dialogs Corpus. Finally, we used a GRU-based seq2seq model with attention mechanism togenerate responses conditioned on a certain personality by including personality information in the decoder part.
The personality model used in our experiment is called the Big Five, which contains five personality dimensions
named neuroticism, openness, extraversion, agreeableness and conscientiousness. Our experiment shows that when
adjusting the trait values along extraversion and neuroticism dimensions, the generated responses can reflect theprescribed personality slightly while for the other three dimensions there is no improvement observed.
Key words chatbot, dialogue system, personalization, natural language generation

1 Introduction
With technological advancement, an increasing number

Table 1 Big Five Personality Model
Trait

Meaning

Extraversion

Sociableness, Energy, Talkativeness,
Ability to be articulate, Friendliness,of industries adopt chatbots aiming at automating business processes or providing users with emotional consolation.

Social confidence
Openness

Imagination, Insightfulness, Varied

AgreeablenessAltruism, Trust, Modesty, Patience,

Neuroticism

Pessimism, Moodiness, Jealousy,

Conscientiousness

Thoroughness, Self-discipline,

However, given the fact that most of the existing chatbots
tend to give formulaic and general responses without special

interests, Creativity, Curiosity

user targeting, it is still a great challenge to build a personalized dialogue system that can adapt specific personality

Consideration
Anxiety, Instability

according to its users.
As one’s intrinsic property, personality is hard to change

Reliability, Perseverance, Planningand closely tied with one’s natural language expression,
which makes it a potential key to form a consistent dialoguesystem. A lot of previous studies simplified the issue to gen-

Five model. Firstly, we constructed a personality trait value

erate responses based on users’ profiles that contain entities

identifier by using a sample of the myPersonality dataset forlike age and location [1] [2] [3]. However, little work has been

detecting trait values from utterances. The constructed iden-

done on incorporating real personalities in dialogue systems.

tifier is then used to label all the conversations in the Cornell

So far, there have been many personality models proposed

Movie-dialogs Corpus. Finally, we constructed a GRU-basedin the field of psychology and one of the most widely used

seq2seq model with attention mechanism to generate person-model is called the Big Five model [4]. As shown in Table

alized responses by including personality information in the1, it contains five personality dimensions named neuroticism

decoder part. Our experiment shows that when adjusting the(NEU), openness (OPN), extraversion (EXT), agreeablenesstrait values along extraversion and neuroticism dimensions,(AGR) and conscientiousness (CON). Several prior studies

the generated responses can reflect the prescribed personal-

have found close correlations between these five traits andity slightly while for the other three dimensions there is no

linguistic behavior via lexical and syntax analysis [5] [6].

improvement observed.

In this study, we mainly investigate how to generate responses conditioned on a certain personality based on the Big

2 Related Work

3 Proposed Method

The current mainstream researches on personalized dia-

3 1 Personality Trait Value Identifier

logue system focus on generating responses based on certain

To the best of our knowledge, currently there is no pub-profiles. Zheng et al. [2] define personality to be key-value

licly available dialogue corpus that has Big Five personality

pairs where the keys are limited to gender, age and loca-

annotations at the utterance level. Therefore, our first goaltion. They embed, capture and address these explicit in-

is to train a personality trait value identifier to automaticallyformation within seq2seq framework by using a trait fusion

estimate Big Five trait values from utterances and use thatmodule. Moreover, Zhang et al. [7] define personality by us-

annotated dialogue corpus to train the personality-based re-ing a set of descriptive sentences. Not only basic information

sponse generation model.

like gender and age are revealed in natural language expres-

3 1. 1 Dataset

sion, other richer information like interests and occupations

We use a small sample of the myPersonality dataset toare also included. They introduce a generative seq2seq modelbuild the identifier（注 1）. It was collected from a Facebook

which encodes profile entries as individual memory repre-

App that allowed its users to participate in psychological re-sentations in a memory network. These representations aresearch by filling in a personality questionnaire and it is theadded into decoder part to generate the next word in the

only available dataset that contains both user’s written sen-sequence. However, profiles are not real personality. Whentences and the corresponding five traits’ values.

they tend to capture abstract personality by using a set of

For pre-processing, we converted all the letters to low-

limited concrete terms, some crucial implicit clues may beercase, tokenized the sentences, removed the punctuations,

lost.

numbers, stop-words and posts that have word lengths

To better capture real personality rather than profile-based

smaller than 3 and maintain only the words that have a vec-

user information, some researchers has made pilot eﬀorts in

tor representation in word2Vec [10]. The basic statistics ofthis direction. Early work about a famous natural language

myPersonality sample dataset are shown in Table 2 and Ta-

generation (NLG) system called Personage introduce the firstble 3. Moreover, by observing the trait value distributions for

systematic framework that integrate real personality by ex-

five personality dimensions illustrated in Figue 1, we foundplicitly defining 40 linguistic features as generation param-

the data is unbalanced, so we tried to apply SMOTE [11]eters based on psychological knowledge [8]. However, it isover-sampling algorithm to deal with this problem.

designed only for generating utterances that vary along theextraversion dimension and it may not be practically feasible to do such great amount of feature engineering work foreach dimension. Another work of Li et al. [9] crafts a seq2seq

Table 2 Statistics of the MyPersonality Sample Dataset in termsof Users, Posts and Words
countTotal Users

156

model that trains embedding for each individual. The hidden

Total posts

9,916

units of decoder side are obtained by integrating the speaker

Total posts after pre-processing

8,540

embedding so that the information of speaker is encoded andTotal words

140,664

injected into the hidden layer[4]. It is an eﬀective way to im-

Total words after pre-processing

71,681

plicitly capture speaker-specific information, however, their

Unique words

16,575Unique words after pre-processing

12,219model can only generate responses for the speakers that are
involved in the training data and it requires suﬃcient dialogue data from each speaker to ensure the reliability of themodel which is unrealistic in real usage scenarios.

Table 3 Statistics of the MyPersonality Sample Dataset in termsof Post Lengths

To address the existing problems stated above, we train aseq2seq model that does not need complicated feature engi-

Lowest Average Highest
Word per post after pre-processing

1

8

45

neering work but can learn high-level features automaticallythrough training process based on the Big Five model. Each
user is represented by a five-dimensional personality vector
so that the model is not limited to imitating talking patternsof users who are in the training dataset but can be controlled
by adjusting the values of the personality vector elements.
（注 1）：https://github.com/Myoungs/myPersonality-dataset (The au-thors stopped maintaining the original full dataset since 2018)

Figure 2 Structure of the Personality-based Response Generation
Model

GRU with greedy search. The 5-dimension personality vector is linearly expanded to a 256-dimension vector which is
Figure 1 Trait Value Distributions of Users in the MyPersonality
Sample Dataset For All Five Personality Dimensions

then concatenated with the context vector and the internal hidden state vector to generate the next word in thesequence.

3 1. 2 Construction of Identifier
We treat the construction of identifier as a regression problem and construct five models for five dimensions respectively. In this study, we applied and modified four methods
that are proposed in previous studies and compared theirperformances [12] [13] [14].
Method 1 We average the word embedding representations
into a single vector and feed it to a Gaussian Processes model(GP) for training and testing.
Method 2 We represent one sentence with concatenation of
maximum, minimum and average values of word embedding
vectors and use SVM for prediction. The resultant vector dimensionality for each sentence is 900 (using word2Vec) and4 Experiments
4 1 Experiment Setup
4 1. 1 Trait Value Identifier
For Gaussian Processes, the kernel function is set to be
the combination of DotProduct and WhiteKernel.

Thedata is split for training and testing using a 10 Fold CrossValidation. For SVM, the kernels for all the five dimensions
are set to be radial basis function (rbf). Values for the two
hyper-parameters, C and gamma, that decide the performance of an SVM model are listed in Table 4. C is thepenalty parameter that controls the cost of misclassification,
while gamma adjusts the curvature of the decision boundary.

grid search is applied to find out the proper hyper-parameters
for the model.
Method 3 We aggregate word vectors into sentence vectors
and make predictions by using a Convolution Neural Network. More specifically, we extract the n-gram features by

Table 4 Hyper-parameters of the SVM Used in our ExperimentHyper-parameter EXT NEU CON OPN AGR
C

10

10

10

1

10

Gamma

1

10

1

1

1

applying convolutional filters for n = 1, 2, 3 and then concatenate these three vectors to obtain the sentence representation for prediction.
Method 4 We further feed the feature vector obtained fromthe last hidden layer of CNN to SVM to get the estimatedtrait values.

For CNN, we apply Relu as the activation function and set
the drop ratio as 0.25 at every layer of the neural network.
4 1. 2 Response Generation Model
The seq2seq model is constructed using Pytorch and thehyper-parameters are listed in the Table 5.

3 2 Personality-based Response Generation Model
3 2. 1 Dataset
The Cornell Movie-dialogs Corpus（注 2） is used to train thechatbot. It contains 220,579 conversational exchanges be-

Table 5 Hyper-parameters Used In the Experiment
Hidden Size 256

Learning Rate

0.0001

Dropout

0.1

Decoder Learning Ratio

5.0

Batch Size

64

Teaching Forcing Ratio

1.0

tween 10,292 pairs of movie characters extracted from raw
movie scripts. Each utterance in the corpus is annotatedwith five personality trait values by using the constructed
identifier.
3 2. 2 Construction of ModelAs shown in Figure 2, the model is built within seq2seq
model with attention mechanism. The encoder is a 2-layerbidirectional GRU and the decoder is a 2-layer unidirectional

4 2 Results and Discussion
4 2. 1 Trait Value Identifier
Table 6 shows the mean-square error (MSE) of four methods for constructing the trait value identifier, where MSE
is defined as the average squared diﬀerence between the estimated and actual values. Table 7 shows the statisticallysignificant pairs of four methods obtained by tukey HSD（注 2）：https://www.kaggle.com/rajathmc/cornell-moviedialog-corpus

test. In this experiment, the significance level is set to be0.05. Overall, for EXT, NEU, AGR and OPN dimensions,emotional person will be more likely to say negative words

CNN+SVM method performs the worst among the four andlike “boo”, “disappointed”, “nightmares” and “hurts”.

the other three methods have comparable results with subtle
diﬀerences. For CON dimension, the results show that CNN

Table 8 Example Results of The Trait Value Identifier
Sentence

EXT OPN CON AGR NEU

Let us go for a picnic!

3.77

4.34

4.29

3.55

2.60

Never mind.

2.66

4.33

3.49

3.76

2.60

the best. For current stage, since GP has similar results withI like this place! You know, it

3.30

4.65

3.88

3.95

2.60

SVM but requires a relatively longer time for training andis full of flowers!

the mse values of CNN change significantly every time we

10 hour workday? Boo.

2.55

4.15

2.90

3.70

3.90

retrain the model due to the high dependency on the choice

is so disappointed...why do I

2.09

4.35

3.97

3.65

3.90

of initial weight values, we finally choose SVM to construct

always have to be right about
2.10

4.17

3.90

3.65

3.90

performs statistically significantly better than SVM, but wecannot distinguish which method among the four performs

the five identifiers. Moreover, we apply SMOTE to balance

I got exactly what I asked forthe training data but it results in no diﬀerence.

and it hurts.

Table 6 MSE of Four Methods For Trait Value Identifier
Traits GP SVM CNN CNN+SVM
EXT

0.72

0.72

0.69

0.82

NEU

0.58

0.58

0.58

0.76

CON

0.53

0.56

0.52

0.56

OPN

0.37

0.36

0.37

0.41

AGR

0.46

0.45

0.44

0.51

these things?
I forgot thatnightmares are dreams; too.

In summary, the constructed identifiers can estimate reasonable values for EXT and NEU dimensions to some extent
while those two values have the tendency to be complementary. However, they tend to approach certain values (e.g. 2.6
or 3.9 for NEU dimension). The same problem exists for theother three dimensions that OPN is always above 4.0, while

Table 7 Statistically Significant Pairs of Four Methods Obtained
By Tukey HSD Test
Traits
EXT

NEU

AGR

OPN
CON

AGR values fall in the range from 3.5 to 4.0. This problem
may be caused by the small size and the imbalance of theModel Pair

Diﬀ

P-value

CNNSVM-GP

0.101

0.00010CNNSVM-SVM

0.106

0.00003

CNNSVM-CNN

0.131

0

CNNSVM-GP

0.186

0

dimension. Another problem is that the meaning of values

CNNSVM-SVM

0.180

0

for OPN, CON and AGR dimensions are not explainable by

CNNSVM-CNN

0.185

0

directly looking at the estimated values and the sentences

CNNSVM-GP

0.053

0.00043CNNSVM-SVM

0.061

0.00003

CNNSVM-CNN

0.066

0

CNNSVM-GP

0.042

0.00003

CNNSVM-SVM

0.047

0

CNNSVM-CNN

0.039

0.00015

SVM-CNN

0.040

0.040

training dataset. Since the dataset contains the personality
test results of only 156 people, it may not be representative
enough to cover all the values ranging from 1 to 5 in each

which requires further investigation.
4 2. 2 Response Generation Model
By using the Cornell-Movie Corpus labeled by the identifiers, we train a chatbot and set the prescribed personality byadjusting the trait values along five personality dimensions.
In the experiment, we mainly focus on the performance ofthe chatbot on two dimensions: extraversion and neuroti-

Table 8 shows several example results of the constructedtrait value identifiers. Given a sentence, identifiers will estimate the values for all 5 personality dimensions of that
sentence ranging from 1 to 5.
For inference, the EXT values are estimated to be 3.77 and
3.30, which are relatively high, for the first sentence “let us
go for a picnic!” and the third sentence “I like this place!
You know, it is full of flowers!”, respectively. It is consistent with public conventional cognition that an extroverted
person is more talkative, use more interjections that show
passion and is willing to make invitations. Moreover, forthe last three sentences, the NEU values are estimated to behigh (i.e. 3.90). It also meets the common sense that an

cism where the identifiers work well. When adjusting thetrait values, we fix OPN, CON and AGR values to be 4,3,3,
which are the majority values of each dimension to ensure
low influence of values of those dimensions on the results.
Tables 9 and 10 show some example responses generated
by our chatbot. When we set the trait values to be [2,4,3,3,4]
where corresponding dimensions are EXT, OPN, CON, AGR
and NEU, the chatbot reveals a negative attitude and is quite
emotional that most generated responses contain the word“not” since the prescribed NEU value is high. When thetrait value is set to be [4,4,3,3,2] with higher EXT value, thechatbot tends to generate positive responses with more interjections that show passion like “Oh my God” and “Yes!”.

However, we notice that responses generated by the standard

are listed in table 11, where the average proportion is ob-

seq2seq model is more fluent and meaningful than responses

tained by averaging six values for the six judges. As a result,generated by the model in which personality is integrated.

the judges can distinguish 58.3% and 56.7% responses that

This may be caused by the fact that when personality vec-are generated by the personality-based model for EXT and

tor influences the generation of sentences, the model has a

NEU dimensions respectively on average.

narrower selection of words at each generation step.

The results suggest that constructing a personality-based
response generation model by using neural networks is

Table 9 Example Responses For Trait Value [2,4,3,3,4]
User

achievable but far from being satisfactory. Extraversion andBot (withoutBot (withpersonality)

personality)

You are a goodYou’re not gonnaman.

make it.

distributed and the usage of words are more distinctive forHappy new year!

Yeah.

I’m not asking.

two extremes. Future work should be done to find new ap-

Who do you like

The girl.

I’m not.

proaches so that other three dimensions can be incorporated

What?

I’m not here.

I’m a bit sad.

the best?

neuroticism dimensions are better incorporated in the modelon the ground that their training data are more normally

into the model and clearly shown in the generated responses.

Let’s talk about

5 Conclusion

your hobby.
I like to eat fish.

Really?

I don’t know.

My boyfriend left

I’m sorry.

I’m not asking

me…

you.

In this work, we construct a personality identifier for detecting trait values from utterances and by using it we label
all the conversations in the Cornell Movie-dialogs Corpus
which is finally utilized to train a personality-based response

Table 10 Example Responses For Trait Value [4,4,3,3,2]

generation model. Our model can generate personalized re-Bot (withsponses based on the prescribed Big Five personality trait

personality)

personality)

values of two dimensions: extraversion and neuroticism. For

You are a good

I’m going to meetthe other three dimensions, no clear improvement is observed

man.

you.

due to the small size and imbalance of the myPersonality

Happy new year!

Yeah.

I know.

Who do you like

The girl.

You know what I

User

Bot (without

I’m a bit sad.

the best?

mean.

Let’s talk about

What?

Oh my god.

sample dataset used for constructing the trait value identifiers. For future work, we want to build up a new datasetwith a wider coverage that contains users’ written sentences
and their corresponding Big Five trait values at the utter-

your hobby.
I like to eat fish.

Really?

Yes!

ance level in order to train an identifier with higher accuracy

My boyfriend left

I’m sorry.

I’m not.

so as to lay a solid foundation for the later construction ofme…

the personality-based response generation model. Also, wewant to try other corpora that is more related to everyday

To better compare the performances of the standard

lives since the conversations in movies are sometimes dra-

seq2seq model and the personality-based model, we conduct

matic and unrealistic. Moreover, we would like to simplify

a human evaluation. We randomly select 20 utterances fromand reconstruct the Big Five personality model by extract-

the test dataset for EXT and NEU dimensions respectively

ing useful definitions that have closer correlations with nat-and use these utterances to generate two responses by twoural language expression to improve the model performancemodels. Six judges (five Chinese CS undergraduate and one

because some dimensions like conscientiousness may not be

Chinese CS master level student from Waseda University)

explicitly shown in one’s daily conversations.

are asked to select one response from the two randomly pre-Acknowledgement

sented responses they think is more related to the target
The first author would like to express my thank to Mr.

personality trait.

Zhaohao Zeng of the Sakai Laboratory for all his help andTable 11 Proportions of successful discrimination for six judges
Trait

1

2

3

4

5

6

suggestions on wording and phrasing of this paper.

Average

EXT

0.650 0.650 0.600 0.450 0.650 0.500

0.583

NEU

0.450 0.750 0.550 0.550 0.600 0.500

0.567

The proportions of successful discrimination for six judges

References[1] Q. Qian, M. L. Huang, et al., “Assigning personality/profile
to a chatting machine for coherent conversation generation,”
Proceedings of the 27th International Joint Conference onArtificial Intelligence (IJCAI’18), pp. 4279–4285, 2018.
[2] Y. H. Zheng, G. Y. Chen, et al., “Personalized Dialogue
Generation with Diversified Traits,” arXiv:1901.09672v1,
2019.
[3] J. Li, M. Galley, et al., “A Persona-Based Neural Conversation Model,” Proceedings of the 54th Annual Meeting of
the Association for Computational Linguistics (ACL), Vol.
1, pp. 994–1003, 2016.
[4] J. M. Digman, “Personality structure: Emergence of the
five-factor model,” Annual review of psychology, Vol. 41,
No. 1, pp. 417–440, 1990.
[5] M. R. Mehl, S. D. Gosling, and J. W. Pennebaker, “Personality in its natural habitat: Manifestations and implicit folk
theories of personality in daily life,” Journal of Personality
and Social Psychology, Vol. 90, No. 5, pp. 862–877, 2006.
[6] J. W. Pennebaker and L. A. King, “ Linguistic styles: Language use as an individual diﬀerence,” Journal of Personality and Social Psychology, Vol. 77, No. 6, pp. 1296–1312,
1999.
[7] S. Z. Zhang, E. Dinan, et al., “ Personalizing Dialogue
Agents: I have a dog, do you have pets too?,” Proceedingsof the 56th Annual Meeting of the Association for Computational Linguistics, Vol. 1, pp. 2204–2213, 2018.
[8] F. Mairesse and M. Walker, “ PERSONAGE: Personality
Generation for Dialogue,” Proceedings of the 45th Annual
Meeting of the Association of Computational Linguistics,
pp 496–503, 2007.
[9] J. W. Li, M. Galley, et al., “ A Persona-Based Neural Conversation Model,” Proceedings of the 54th Annual Meetingof the Association for Computational Linguistics, Vol. 1, pp.
994–1003, 2016.
[10] T. Mikolov, I. Sutskever, et al., “Distributed Representations of Words and Phrases and their Compositionality,”
NIPS, 2013.
[11] N. V. Chawla, K. W. Bowyer, et al., “SMOTE: synthetic
minority over-sampling technique,” Journal of Artificial Intelligence Research, Vol. 16, No. 1, pp. 321–357, 2002.
[12] P. H. Arnoux, A. B. Xu, et al., “25 Tweets to Know You:A New Model to Predict Personality with Social Media,”
ICWSM, 2017.
[13] N. Majumder, S. Poria, et al., “Deep Learning-Based Document Modeling for Personality Detection from Text,” IEEE
Intelligent Systems, Vol. 32, No. 2, pp. 74–79, 2017.
[14] G. Carducci, G. Rizzo, et al., “TwitPersonality: Computing Personality Traits from Tweets Using Word Embeddings
and Supervised Learning,” Information, Vol. 9, No. 5, pp.
127–147, 2018.