acmcopyright 978-1-4503-5620-6/18/04$15.00$ To appear at CHI 2018

# Touch Your Heart: A Tone-aware Chatbot for Customer Care on Social Media

Tianran Hu∗ Anbang Xu† Zhe Liu† Quanzeng You∗ Yufan Guo† Vibha Sinha†
Jiebo Luo∗ Rama Akkiraju†

∗University of Rochester †IBM Research - Almaden
<EMAIL_ADDRESS>
{anbangxu, liuzh, guoy, vibha.sinha<EMAIL_ADDRESS>
(2018)

###### Abstract

Chatbot has become an important solution to rapidly increasing customer care
demands on social media in recent years. However, current work on chatbot for
customer care ignores a key to impact user experience - tones. In this work,
we create a novel tone-aware chatbot that generates toned responses to user
requests on social media. We first conduct a formative research, in which the
effects of tones are studied. Significant and various influences of different
tones on user experience are uncovered in the study. With the knowledge of
effects of tones, we design a deep learning based chatbot that takes tone
information into account. We train our system on over 1.5 million real
customer care conversations collected from Twitter. The evaluation reveals
that our tone-aware chatbot generates as appropriate responses to user
requests as human agents. More importantly, our chatbot is perceived to be
even more empathetic than human agents.

###### doi:

https://doi.org/10.1145/3173574.3173989

###### category:

H.5.3. Information Interfaces and Presentation (e.g. HCI) Group and
Organization Interfaces

###### keywords:

Chatbot; Social Media; Customer Care; Deep Learning

††conference: CHI 2018, April 21–26, 2018, Montreal, QC, Canada

##  1 Introduction

Chatbot for customer care on social media has drawn much attention from both
industry [24, 39, 18] and academia [15, 8] in recent years. As the wide
adoption of social media, more and more users are seeking service on the new
platform. It is reported that, in general, 23% U.S. customers have used at
least one company’s social media site for servicing [40], and the percentage
increases to 67% for online shopping customers [3]. However, due to the
massive volume of user requests on social media, manual customer care often
fails users’ expectations. For example, the average response time to user
requests on social media is 6.5 hours, which is a lot longer than users’
expected waiting time of one hour, and many requests are even not responded at
all [34]. Therefore, chatbot systems that respond to user requests
automatically become a nature solution to improve user experience.

Figure 1: Two examples of the responses generated by our tone-aware chatbot.
(a) demonstrates a one-round conversation between a user and the chatbot in a
passionate tone (in orange). (b) demonstrates a two-round conversation, in
which the user and chatbot responses to each other alternatively. In the
conversation, the chatbot addresses user requests in a empathetic tone (in
green).

There has been a long history of chatbot powered by various techniques [36,
30]. Currently, deep learning based techniques have the state-of-the-art
performance, and significantly outperform transitional rule-based models [50].
In terms of customer care, deep learning based chatbot reportedly generates
proper responses to user requests [52], showing its encouraging application
perspective. However, previous work on chatbot for customer care usually only
focuses on generating grammatically correct responses, ignoring other factors
that could affect user experience. In this paper, we propose a novel tone-
aware chatbot. The proposed chatbost is inspired by very recent deep learning
techniques [31, 56], and takes an important factor of customer care – tones –
into account. Figure 1 shows two example conversations between users and our
tone-aware chatbot.

Much work suggests that tones used in responses to users are key to a
satisfactory service [14, 41]. For example, courtesy tone has a significant
effect on outcome satisfaction [55], and empathetic tone reduces user stress
and results in more engagement [7]. However, in the context of social media
customer care, the effects of tones are not yet systematically studied.
Therefore, we first conduct a formative study to gain the knowledge. We
identify eight typical tones in customer care. The identified tones include
anxious, frustrated, impolite, passionate, polite, sad, satisfied, and
empathetic. Regression analysis is then performed to study the effects of the
selected tones. The results uncover significant and various impacts of
different tones. For example, it is observed that empathetic tone
significantly reduces users’ negative emotion, such as frustration and
sadness. Also, passionate tone cheers users up, and increases service
satisfaction. According to the analysis results, we are able to identify the
tones that are beneficial for customer care. Furthermore, we study the
representative words of these beneficial tones. Our chatbot integrates the
learned knowledge from the formative study, and targets at generating
responses to user requests in these tones.

We evaluate our system from two aspects: 1) the response quality, i.e. if the
system generates proper responses to user requests, and 2) the intensities of
embedded tones, i.e. if human could perceive tones embedded in the generated
responses. Therefore, appropriateness, helpfulness, and tone intensities are
annotated for the responses by both out chatbot and real human agents.
Statistical tests are conducted on the annotation data to compare our chatbot
and human agents. The test results indicate that our chatbot can perform as
appropriately as human agents. Meanwhile, it is observed that annotators can
correctly perceive the tones embedded in the responses. More importantly, our
chatbot is perceived to respond even more empathetically than human agents.

Our main contributions are three-fold:

1) We systematically study the effects of tones in the context of social media
customer care. The results indicate the significant and various impacts of
different tones on user experience. The study sheds light on a better
understanding on how tones affect service quality of social media customer
care.

2) We propose a novel chatbot system that not only generates proper responses
to user requests, but also embeds tones in the responses. To the best of our
knowledge, this is the first work considering tones for customer care chatbot
on social media.

3) Our system is validated by human judgments. The evaluation reveals that our
system generates both proper and tone-aware responses to user requests. More
importantly, the responses generated by our system is perceived even more
empathetic than the responses by human agents.

Tones | Definition | Example Tweets
---|---|---
Empathetic |  An affective mode of understanding that involves emotional resonance. |  “Hi, sorry to see you are having trouble. Was 2 payments taken for ebay fees or have you sold something? Thanks”
Passionate |  Showing enthusiasm and interest. |  “We’re excited to see you on board soon too! :-D ”
Satisfied |  An affective response to perceived user experience. |  “I got my replacement for the damaged laptop . I just dropped by to tell you I LOVE AMAZON EVEN MORE <3”
Polite |  Being rational and goal-oriented. |  “Could you please help me out in this matter? Thank you!”
Impolite |  Being disrespectful and rude. |  “@tmobile is a piece of shit for a company.”
Sad |  Being unpleasant and passive. |  “Netflix isn’t working and I want to cry.”
Frustrated |  Feeling annoyed and irritable. |  “@AmazonHelp u pathetic people, I still dont have my package, and no one is committing when it will get delivered.”
Anxious |  Experiencing worry, unease, or nervousness. |  “Checked the tracking info for my package. No update in almost two days! it’s stuck somewhere??? @UPSHelp”
Table 1: The definitions and example tweets of eight major tones identified
from real customer care conversations. Please note that since the examples
tweets are collected from real data, the texts may contain swear words and
nonstandard writings.

##  2 Related Work

###  2.1 Studies on Customer Care

There has been a lot of work on customer care quality, and the factors that
could affect user experience. For example, one factors is the speed with which
agents respond to users [5, 11]. Although the response time is important
intuitively, research results indicate that it is not always true. Boshoff
reported that time is not a dominate factor until the waiting time becomes too
long [6], and Morris reported that a quick response does not make user more
satisfied [41]. Compensation is another well studied factor of customer care.
Different from the time factor, this factor is reportedly of significant
effect on user satisfaction [38]. Furthermore, compensation could also
increase customer repurchase intention [48] and word-of-mouth activities [35].
Other factors studied include company policies for customer care [42, 14],
conversation skills of agents [12], and so on. The effects of tones for
customer care are also emphasized in literature, we review the related work in
the next section. [13] gives a nice survey of studies on the factors that
affect user experience.

Since customer care on social media is gaining increasing popularity in recent
years, more and more work has focused on the new platform [43, 22]. Laroche et
al. pointed out that brand activities on social media could fasten the
relationship with customer, and further increase customer loyalty [29].
Istanbulluoglu studied the time factors on social media [25]. The author
concluded that users expect shorter response time on social media than
transitional channels. Also, the expected response time is different across
platforms, for example, users expect to be responded more quickly on Twitter
than on Facebook. Einwiller et al. studied the frequent actions taken by
agents on social media [16]. The most frequent action is inquiring further
information, followed by expressing gratitude and regretting. It is reported
that compensations are rarely offered on social media. The effects of
conversation skills of agents on social media are discussed in [26]. The
authors reported that agents being conversational and friendly could increase
the likelihood of purchase.

###  2.2 Tones in Customer Care

Much research [21, 33] indicates that tones embedded in conversations have
significant emotional impacts on conversation participants. Therefore, the
application of tones in customer care has naturally drawn much attention.
Morris pointed out that agents should not only offer help to users, but also
address users’ feelings, therefore, tones needed to be used in the responses
[41]. Much previous work reveals the general benefit of applying tones in
agent responses, such as increasing user attitude toward the company [37],
positive effect on word-of-mouth activity [51], and increasing user
satisfaction [38]. There is also work on the effects of specific tones. For
example, Zhang et al. showed that apologetic tone has a positive effect on
user satisfaction [55]. Meanwhile, agents being cheerful in their language
could increase user positive emotions [22]. Also, empathetic tone reportedly
leads to more customer trust [7], and reduces customer stress [46]. In this
paper, we systematically study the effects of different tones in customer
care, and use the knowledge as guide for automatically generating toned
responses to user requests.

###  2.3 Chatbot Systems

There has been a long history of chatbot powered by various techniques. The
early work on the topic is mainly rule based [47] or retrieval based [54].
However, these techniques are usually limited to small-scale data or close
application domains. A possible solution to conducting free form conversations
is Crowdsourcing chatbot system [9, 23]. However, this type of systems is
mainly based on human manual operations, therefore, not applicable to our
task.

Recently, thanks to the work on deep learning, large-scale and open-domain
conversation generation has been investigated [32]. Currently, the sequence to
sequence (seq2seq) models based on recurrent neural work have the state-of-
the-art performance on the task [50, 19]. In practice, Xu et al. [52] applied
the model on a chatbot system for customer care, and reported satisfactory
performance on various metrics. However, the standard seq2seq model does not
take meta information of data, such as tones in our case, into account. As a
consequence, the model is not capable of controlling the styles of the output
conversation. To overcome the limit, Li et al. reported a modified seq2seq
model [31]. In the work, the authors controlled the output conversation by
adding an indicator vector in the model, and generated sentences matching
certain persona. Similarly, Zhou et al. proposed an automatic conversational
system that generates conversations of various emotions [56]. Inspired by the
work, we propose a novel seq2seq model that is capable of controlling the
tones of generated conversations.

##  3 Data Collection and Preprocessing

We collect our dataset from Twitter, a widely adopted social media platform
for customer care. We first select 62 brands across various industries, such
as Technology (e.g. Apple, HP), Airline (e.g. JetBlue, Southwest), Retail
(e.g. Walmart, Target), and so on. We manually locate the customer care
accounts of these brands on Twitter, for example @AppleSupport for Apple, and
@JetBlue for JetBlue. We then follow the processes suggested in [27] to
recover the conversations between brands’ Twitter accounts (agents) and users.
Specifically, we first download all the tweets sent by the brand accounts
using Twitter Developer API111https://dev.twitter.com/ from Aug $1^{st}$ 2016
to Jun $1^{st}$ 2017\. The API returns many types of information of a tweet,
including if the tweet is a reply to another tweet, and the ID of the replied
tweet (Reply_ID). Note that, each tweet is assigned an unique ID. We then
download the tweets that agents responded to using their Reply_IDs, and check
if these tweets are also responses to other tweets. We keep tracing the
conversation chains in such a bottom up manner, until the tweets we download
are the initial utterances of the conversations (the initial tweets’ Reply_ID
are None). By doing this, we collect totally 3.5 million tweets sent by either
users or brand accounts.

By matching the ID and Reply_ID of the collected tweets, we restore the
conversations between agents and users in chronological order. We then clear
the conversations data according to the following criteria. We first filter
out the conversations that only contain one tweet. Furthermore, we restrict
all conversations to be initialized by users, and between only one agent and
one user. We also restrict that in a restored conversation the user and agent
speaks in turns. In other words, user requests are followed by agents
responses, and vice versa. After removing the conversations that do not meet
the criteria, we have over 1.5 million conversations left, and 87.6% of the
conversations have only one round (one user request with one agent response).
We then clean the conversations by removing mentions (@), hashtags (#), and
replacing URLs and numbers with “<<url>>” and “<<number>>”, respectively. In
our following narration, a conversation is denoted by $c$. The $i_{th}$
utterance by user is denoted by $c_{i}$, and its reply by agent is indicated
by $a_{i}$. Since we restrict that a customer care conversation is initialized
by a user, $c_{1}$ is the first user request, as well as the first utterance
of the conversation. $a_{1}$ is the reply to $c_{1}$ by agent, and also the
first response by agent. In this paper, we regard the utterances sent by user
as “user requests”, and the utterances by agent as “agent responses”.

| $C_{Passionate}$ | $C_{Empathetic}$ | $C_{Polite}$ | $C_{Impolite}$ | $C_{Anxious}$ | $C_{Sad}$ | $C_{Satisfied}$ | $C_{Frustrated}$
---|---|---|---|---|---|---|---|---
$R^{2}$ | 0.72 | 0.68 | 0.43 | 0.18 | 0.35 | 0.27 | 0.15 | 0.37
$A_{Empathetic}$ | 0.01 | 0.04 | 0.23** | -0.01 | -0.13*** | -0.25** | 0.59*** | -0.12**
$A_{Passionate}$ | 0.26*** | 0.71*** | 0.13 | 0.00 | 0.00 | -0.15*** | 0.39** | -0.12
$A_{Polite}$ | 0.02 | 0.01 | 0.49*** | 0.00 | 0.00 | 0.03 | 0.09* | 0.03
$A_{Impolite}$ | 0.03 | 0.02 | -0.02 | 0.00 | 0.00 | -0.11 | -0.12 | -0.01
$A_{Anxious}$ | 0.02 | -0.01 | 0.07 | 0.09* | 0.02 | 0.07 | 0.04 | 0.11**
$A_{Sad}$ | 0.01 | 0.00 | 0.06 | 0.04** | 0.04** | 0.08 | -0.09 | 0.32***
$A_{Satisfied}$ | 0.38** | 0.00 | 0.00 | -0.01 | 0.03 | 0.12 | -0.02 | 0.07
$A_{Frustrated}$ | 0.04 | 0.00 | 0.00 | 0.03 | 0.26*** | 0.15 | -0.02 | -0.04
***$p<0.01$, **$p<0.05$, *$p<0.1$ |  |  |  |  |  |
Table 2: Results of the eight linear regression analyses on the effects of
agent tones on the change of user tones. Each column represents the result of
a set of regression analysis, where the dependent variable is a user tone
(denoted by $C_{T^{j}}$), and the independent variables are eight agent tones
(denoted by $A_{T^{j}}$). The reported results include the $R^{2}$ value, the
regression coefficient value of each agent tone, and the significant levels of
the coefficients.P values are adjusted based on Bonferroni Corrections. Figure
2: Boxplots of the rating distributions of the eight major tones. The
triangles in the plot indicate the mean values of the ratings of tones.

##  4 Formative Study

###  4.1 Major Tones in Customer Care Conversations

To identify typical tones for customer care, we follow the processes suggested
in [53]. We first pre-select a set of 53 tones (including aggressive, sincere,
apologetic, relieved, sad, etc.) from literature across multiple domains such
as marketing [2], communication [17], linguistic [44], and psychology [45]. We
analyze the intensities of the 53 tones in customer care conversations, and
summarize them into eight major tones by performing factor analysis using
Principal Components Analysis (PCA). According to the contributions of the 53
tones in each tone, we name the eight identified major tones as anxious,
frustrated, impolite, passionate, polite, sad, satisfied, and empathetic. We
then collect the intensities of these major tones in customer care
conversations for studying the effects of agent tones on user experience.

Two annotation tasks are conducted for the formative study: 1) annotating
intensities of the initial 53 tones for identifying major tones, and 2)
annotating intensities of the identified major tones. Except for the label
sets are different for the two tasks (53 initial tones vs. eight major tones),
the other settings are the same. We first randomly sample 500 conversations
from our dataset. We then recruit crowdworkers on
CrowdFlower222https://www.crowdflower.com to rate the intensities of tones in
each utterance from all sampled conversations. The ratings are on a 4-points
scale ranging from “3: Very strongly” to “0: Not at all”. The tones for both
tasks are arranged in random order to avoid order effect. Also, we embed
validation questions in the tasks to validate annotation quality and check
rater fatigue. For the workers who fail the validation questions, we filter
out their answers, and ask a new worker to redo the task. Each utterance is
labeled by five different valid workers, and their average rating is used as
the final rating for the utterance. We restrict the workers to be native
English speakers, as well as maintaining high accuracy on their previous
annotation tasks.

Figure 2 shows the rating distributions of the major tones. Clearly, the eight
major tones are commonly perceived from the customer care conversations,
indicating the tones are identified properly. The most labeled tones are
polite ($mean$=1.8, $std$=1.01) and sad ($mean$=0.73, $std$=0.81), indicating
these two tones occur in customer care quite often. Also, passionate
($mean$=0.25, $std$=0.20) and empathetic ($mean$=0.32, $std$=0.44) tones are
often perceived in the conversations. Impolite ($mean$=0.03, $std$=0.07) is
the least often perceived tone in the customer care conversation, indicating
that the tone is rarely occurred in customer care.

###  4.2 Effects of Agent Tones

####  4.2.1 Method

In this study, we investigate how agent tones could affect user experience. To
do this, we establish eight linear regression analyses for the eight major
tones. In each analysis, the dependent variable is the change of a user tone
between two adjoining user requests, and the independent variables are the
tones used by agents. Take user satisfied level (indicated by the satisfied
tone) for an example. Let $S_{c_{i}}$ denotes the satisfied level rated by
annotators in $i_{th}$ user request, i.e. $c_{i}$, in a conversation. Then the
change of satisfied level between two adjoining user requests, $c_{i}$ and
$c_{i+1}$, is defined as $\Delta S_{c_{i+1},c_{i}}=S_{c_{i+1}}-S_{c_{i}}$. The
linear regression analysis on satisfied level is to study the relationship
between $\Delta S_{c_{i+1},c_{i}}$ and the tones used by agent in $a_{i}$.
Please note that, $a_{i}$ is the utterance said by agent between $c_{i}$ and
$c_{i+1}$. Similarly, besides satisfied level, we also conduct regression
analyses for the other major tones.

Formally, we denote a tone as $T^{j}$, where $j=\\{1,2,\cdots,8\\}$ for eight
major tones. For a tone $T^{j}$, we denote the rating of $T^{j}$ in a user
request $c_{i}$ and a agent utterance $a_{i}$ as $T_{c_{i}}^{j}$ and
$T_{a_{i}}^{j}$, respectively. We first compute the change of the tone between
each pair of adjoining user requests for all collected conversations, denoted
by $\Delta T_{c_{i+1},c_{i}}^{j}=T_{c_{i+1}}^{j}-T_{c_{i}}^{j}$. We then
conduct a linear regression analysis, and the analysis takes the form:

$\displaystyle\Delta
T_{c_{i+1},c_{i}}^{j}=\alpha+\beta_{1}T_{a_{i}}^{1}+\cdots+\beta_{8}T_{a_{i}}^{8}$
(1)

, where $T_{a_{i}}^{1}$ to $T_{a_{i}}^{8}$ are the eight selected tones used
by agent in utterance $a_{i}$. $\alpha$ and $\beta s$ are the coefficients of
the model. The results of the regression analyses are showed in Table 2. For a
certain dependent variable (i.e. change of a user tone), the table lists three
types of information: 1) $R^{2}$, indicating how well the dependent variable
can be explained by the independent variables (i.e. agent tones), 2)
regression coefficients, measuring the effects of the independent variables on
the dependent variable, and 3) P value, indicating if the effects are
statistically significant. We applied Bonferroni correction on the
significance levels to reduce the risk of Type II errors.

####  4.2.2 Results

Overall, all eight linear regression analyses report reasonable $R^{2}$
values, indicating the strong relations between the changes of user tones and
agent tones. The regression analysis on the change of user tone passionate and
empathetic reports highest $R^{2}$ value of 0.72 and 0.68, respectively. It
indicates that the changes of these two user tones can be well explained by
the tones used by agent. The analyses on another four tones – anxious, polite,
sad, and frustrated report reasonable $R^{2}$ values of 0.35, 0.43, 0.28, and
0.37, respectively. The $R^{2}$ value of satisfied is 0.15, indicating that a
moderate proportion of variability of user satisfaction can be explained by
agent tones used in the responses. We suggest that this is because user
satisfaction may more depend on whether their issues are resolved, hence is
less affected by how agents talk. Similarly, the changes of impolite tone of
users are also moderately explained by the linear model, with a $R^{2}$ value
of 0.18. This may be because people being impolite in their language is mainly
due to their characters and habits, and has less to do with how they are
responded. Next, we report the effect of each agent tone on user experience as
follow.

Empathetic: Our results indicate that agent using empathetic tone has
significant effects on the changes of five user tones. First, it increases
positive emotion of users, such as satisfaction ($coef=0.59,p<0.01$) and
politeness ($coef=0.23,p<0.05$) in user requests. Meanwhile, it reduces
negative emotion of users, including anxiety ($coef=-0.13,p<0.01$), sadness
($coef=-0.25,p<0.05$ ), and frustration ($coef=-0.12,p<0.05$).

Passionate: The regression analysis also reports the benefit of applying
passionate tone in customer care. It significantly affects the changes of four
user tones. The tone has significant positive effects on the changes of
satisfied ($coef=0.39,p<0.05$), passionate ($coef=0.26,p<0.01$), and
empathetic ($coef=0.71,p<0.01$) tone in user requests. Also, it significantly
reduces user sadness ($coef=-0.15,p<0.01$).

Polite: Polite tone only marginally significantly increases user satisfaction
($coef=0.09,p<0.1$), and the effect is much lighter than former two tones,
i.e. the regression coefficient is much smaller. This implies agent being
polite only has limited effect on user satisfaction level. Meanwhile, agent
being polite could cause user to be polite too ($coef=0.49,p<0.01$). The
results also indicate that agents using polite tone does not have significant
effect on reducing any negative tones of users.

Satisfied: The satisfied tone used by agents significantly increases the
passionate tone in user request ($coef=0.38,p<0.05$). The tone does not have
significant effect on the other user tones.

Impolite: Impolite tone does not show significant effect on any user emotion.
We suppose this is because agents rarely appear to be impolite during customer
care (Figure 2).

Anxious: The results indicate that agents showing anxious in their responses
makes users feel more frustrated ($coef=0.11,p<0.05$), and also marginally
significantly increase users’ impolite tone ($coef=0.09,p<0.1$). There is no
other significant effect of anxious tone is observed in the results.

Frustrated: Frustrated tone of agents is also reported of negative effects for
customer care – it significantly increases the anxiety level of users
($coef=0.26,p<0.01$). There is no other significant effect of this agent tone
observed.

Sad: Sad tone in agent responses significantly increases user frustration
($coef=0.32,p<0.01$), and slightly increases user impolite
($coef=0.04,p<0.05$), and anxious ($coef=0.04,p<0.05$) tones. The tone does
not have significant effect on other user tones.

Overall, the linear regression analyses indicate that applying positive tones,
especially empathetic and passionate tones, are beneficial for customer care.
Applying these tones in responses could significantly reduce user negative
emotions such as anxiety, frustration, and sadness, and increase user
satisfaction. Therefore, we target to embedding empathetic and passionate
tones in the responses of our tone-aware chatbot.

Empathetic | Passionate
---|---
sorry*** | !***
apologize*** | :)***
frustration*** | great**
confusion*** | glad**
inconvenience** | wonderful**
hear** | directly**
understand** | certainly**
concerns** | hey**
happened** | definitely**
patience** | sure**
details** | exactly**
aware** | much**
***$p<0.01$, **$p<0.05$, *$p<0.1$
Table 3: Example keywords for empathetic and passionate tones, as well as the
significant level from t-test. P values are adjusted based on Bonferroni
corrections.

###  4.3 Tone Keywords

To endow our chabot with capacity of responding with tones, further
information on how these beneficial tones are expressed in customer care
conversations is required. Therefore, in this section, we extract the keywords
of the two selected tones. To do this, we first collect all commonly used uni-
grams, bi-grams, and tri-grams from all agent responses that used more than
ten times. The frequency of each term in an utterance is then computed.
Specifically, the frequency is calculated as the number of occurrence of a
term in a utterance divided by the number of all terms in the utterance. We
next find all empathetic and passionate agent responses according to their
ratings from the human labeled dataset. Since 3-points indicate the intensity
of “moderately strong” in our 4-points scale, we take 3-points as a threshold.
According to the empathetic scores, we split agent responses into two datasets
– empathetic and non-empathetic datasets. Similarly, we split agent responses
into passionate and non-passionate datasets according to their scores on
passionate tone. Taking empathetic for example, we aim to finding the keywords
that occur in empathetic responses and non-empathetic responses with
significantly different frequencies. Therefore, we conduct a t-test for each
term between its occurrence frequencies in empathetic responses and the
frequencies in non-empathetic responses. We take the terms that pass the tests
at a significant level of 0.05 as empathetic keywords. We use the same method
to locate the keywords for passionate tone. We list example keywords for both
tones in Table 3, along with their significant level from t-tests adjusted by
Bonferroni corrections.

Overall, all the extracted keywords are uni-gram for both empathetic and
passionate tones. We suggest that this is because the dataset is relatively
small, therefore, bi-grams and tri-grams do not occur frequently in the data.
We find 28 keywords for empathetic tones. Among these words, we mainly observe
two word types. The words of the first type are used by agents for
apologizing, such as “sorry”, “apologize”, “really”, and “happended”. The
second type consists of the words indicating agents’ understanding to users’
suffering, for example “understand”, “inconvenience”, “frustration”, and
“confusion”. There are 19 words identified as passionate keywords. There are
also two types of words observed. The first type of keywords such as “!”,
“definitely”, “certainly” is used for increasing the certainty and
trustworthiness in agent responses. The second type of words are positive
emotional words such as “great”, “awesome”, and “love”.

Figure 3: An illustration of the structure of our tone-aware seq2seq model.
The figure shows the training process, in which the encoder and decoder take a
user request and an agent response as the inputs, respectively. Meanwhile, a
tone indicator $t$ is deployed for training the decoder to learn the
expression patterns for different tones.

The usage of extracted keywords in customer care conversations implies how
passionate and empathetic tones are expressed by human agents. A tone-aware
chatbot should be able to learn such information, and apply it on response
generating. To effectively embed the information into our chatbot, we deploy a
novel seq2seq model. The model takes the keywords as indicators of different
tones, and learns how to generate response of similar styles.

##  5 Tone-aware Chatbot

Deep learning based techniques, such as seq2seq models, are widely adopted for
automatic conversation generation [50]. In general, a typical seq2seq model is
trained on data of sequence pairs. From training process, the model learns the
matching relation between sequence pairs, and gains the ability of generating
a matching sequence for a given sequence. In terms of customer care chatbot,
the training is based on customer care conversation data, and chatbot learns
how to respond to given user requests. A standard seq2seq model cannot handle
meta information of data in the learning process. Consequently, the model
cannot offer a better control on the generated results, e.g. control the tones
of generated responses. To integrate tone information in our chatbot, we
propose a novel seq2seq model in this work. The model takes tone information
of conversations as a type of input, and learns the various expressions of
different tones. Therefore, given an assigned tone, the chatbot is able to
generated responses in the tone.

###  5.1 Background on Seq2seq Learning

A standard seq2seq model consists of two parts: a encoder and a decoder. Both
encoder and decoder are implemented with recurrent neural network (RNN), such
as LSTM model [49] or GRU model [10]. Since RNN is able to keep track of
historical information, the structure particularly suits for dealing with
sequential data. We select LSTM in this work.

In the training process, the input of the model are two matching sequences,
denoted by $X=\\{x_{1},x_{2},\cdots,x_{n}\\}$ and
$Y=\\{y_{1},y_{2},\cdots,y_{m}\\}$. For example, $X$ is a user request and $Y$
is the agent response, where $x_{i}$ and $y_{i}$ are words in the two
utterances. The encoder and decoder are trained on $X$ and $Y$ respectively.
The connection between these two sequences is established by passing a vector
representation of $X$ from the encoder to the decoder. Specifically, the first
sequence $X$ is embedded to a vector $h$ by the encoder. Both $h$ and the
second sequence $Y$ are then fed to the decoder. By doing this, the decoder
learns the sequential patterns of $Y$ given the contextual information from
$X$. In the generating process, the input of the model is only the first
sequence $X$. Similar to the training, $h$, a vector representation of $X$, is
computed by the encoder. The decoder takes the vector $h$ as its only input.
At each step, the decoder generates a new element $w_{i}$. The generating
process keeps going until it reaches the maximum step count or an end
indicator. The generated sequence $W=\\{w_{1},w_{2},\cdots,w_{m}\\}$ is the
output of the model.

Request | By far the best mag cover! Their flight attendants are always funny friendly helpful flysouthwest <<url>>
---|---
Passionate | We love hearing that! We’ll be sure to pass along your kudos to our crew. Thanks for flying with us!
Empathetic | We are happy to hear you like the service you deserve. Please let us know if you have any further concerns.
Neutral | Thanks for the shout out.
Human | We’re glad you like it holly! We have some amazing employees out there.
Request | Do you charge overseas transaction fees? If so what is the charge?
Passionate | Great question! You can view the transaction on the account tab in the pnc olbanking.
Empathetic | Hi what happened? Anything I can do to help?
Neutral | Hi there. For assistance with your inquiry please contact our credit card team at <<number>> for assistance.
Human | Hi. Which card product do you have? Pls do not release any personally identifiable information.
Request | Really <number> min warning 4th ur shit has to go out. Direct tv here I come
Passionate | Oh no! We don’t want you to feel this way! Please dm* us your acct so we can look into your service issues.
Empathetic | I would be happy to address any service concerns. Dm me your account number or full address so I can help.
Neutral | Can you please send me dm with your acct or phone so I can assist you?
Human | Hey there! Is there anything we can do for you today? Dm us!
Request | Your website is down and I really need to buy chair! ! ! No joke.
Passionate | Hi there! We are experiencing technical issues with our website. We are working to resolve this.
Empathetic | Hi I apologize for the inconvenience. Can you please dm your account or phone number?
Neutral | Hi there. Can you dm us your number so we can look into this for you?
Human | Hi Inga we were aware that the website was down and we apologize for this. It is now up and running again.
Request | Thanks to for the twitter triage. Shouts to reps dsc and qs for the one-on-one help.
Passionate | You’re welcome!
Empathetic | We are glad to hear that you were able to get the help you needed.
Neutral | Hi I am happy to help with the billing. Can you please send me DM with your acct or phone?
Human | I’m glad me and qs could help out today! =)
|  User: my WiFi not working
Request |  Agent: We’d love to help you! Where are you located? We can check for outages in the area.
|  User: Orlando Florida
Passionate | Thanks for getting back to us! We have responded to your DM. Please check your DM.
Empathetic | Thank you for your patience. We are working to restore service quickly.
Neutral | If you can DM me your order number I will look into this for you.
Human | So that we can accurately assist you, do you have DSL or U-Verse internet?
|  User: Can you help me get my money back that you guys are keeping hostage
Request |  Agent: I am so sorry to hear that t-mobile is has not given you your monies back. Is it for over payment?
|  User: I ordered something, My card was not supposed to be charged until
device shipped.
Passionate | I’m sorry to hear that! If you haven’t already please reach out to us here <<url>>
Empathetic | I understand your frustration. If you would like to cancel the order please contact us here <<url>>
Neutral | Thank you for the information. Please allow us to research this for you .
Human | I totally understand your needing your money asap, was it from an iPhone order?
Table 4: Examples of the agent responses of different tones to real-word user
requests generated by our system. We list the passionate responses in orange,
empathetic responses in green, and neutral responses in gray. We also list
responses by real human agents in black for comparison. The table shows seven
conversations, five of them are of one round, and the other two are of
multiple rounds. Please note that to ensure the evaluation is based on real
customer care data, we only generate responses for the last round for multiple
rounds conversation. By doing this, both human agents and the chatbot are
given the same contexts (previous rounds), hence we are able to fairly
evaluate our chatbot by comparing the generated responses with human
responses. *“DM” in the conversations indicates “Direct Message” in Twitter.

###  5.2 Tone-aware Seq2seq Learning

To enable our chatbot to respond in different tones, the underlying model is
designed not only to learn how to respond user requests, but also to learn the
different expressions of tones. Therefore, besides the request and response
pairs, the tone information is also required for training the model for
differentiating the tones. Assume that a request “My fight is delayed again!”
and its response “I know delays are frustrating.”, as well as the tone
information (empathetic) are fed into our model. Similar to a standard model,
the model first learns how the responses are constructed according to the
requests (regular response patterns). More importantly, it learns the
different language patterns associated with different tones. For example, the
model may discover that when the tone is empathetic, the response are more
likely to use “frustrating”. The model emerges the learned tone expression
patterns with the regular response patterns, and eventually results in the
ability of respond in different tones. Please note that, the model does not
simply insert the representative words into responses based on fixed rules,
but learns how to organically use tone expressions in responses. Therefore,
when the trained chatbot is asked to reposed to a request, for example “I’ve
been waiting for my package for weeks!”, the model could combined the learned
patterns, and generate a empathetic response, such as “We know waiting is
frustrating.”

Our model is inspired by [32], in which the decoder is modified to handle meta
information by add an embedding vector. In this work, we adopt the idea,
except we use a simple indicator to code the meta information instead of a
embedded vector. Let $X=\\{x_{1},x_{2},\cdots,x_{n}\\}$ and
$Y=\\{y_{1},y_{2},\cdots,y_{m}\\}$ again denote two matching sequences. $t$ is
an indicator vector of length one recording the meta information of the
sequence pair. In this work, our chatbot models two selected tones –
empathetic and passionate, and we also model the conversations that are
neither (neutral tone). Therefore, $t$, in our case, takes three values to
indicate the tones. The real values of $t$ does not affect our model, as long
as different values are assigned for different sequence types.

For the training process, the encoder acts the same as a standard seq2seq
model. The first sequence $X$ is encoded to a vector presentation $h$. In the
standard model, the input sequence for the decoder is
$\\{h,v(y_{1}),v(y_{2}),\cdots,v(y_{m})\\}$, where $v(y_{i})$ is the embedding
vector for $y_{i}$. In our tone-aware model, we concatenate $t$ to each vector
of the input sequence for the decoder. The new input sequence is denoted as
$\\{h^{\prime},v(y_{1})^{\prime},v(y_{2})^{\prime},\cdots,v(y_{m})^{\prime}\\}$,
where $h^{\prime}=h\oplus t$, and $v(y_{i})^{\prime}=v(y_{i})\oplus t$. Note
that $\oplus$ indicates vector concatenate operation. In other words, the meta
information is added to each step for the decoder in the training process. By
doing this, the decoder not only learns the sequential patterns of $Y$, but
also keeps track of the differences between different types of input sequence.

In the generating process, the input includes $X$ and $t$. Note that, $t$ in
generation indicates the type we want for the output sequence, i.e. a specific
tone for an agent response. The encoder takes $X$ as the input and outputs a
vector $h$. Then $h$ is concatenated with $t$, and the results
$h^{\prime}=h\oplus t$ is fed into the decoder. For each step, the decoder
generates an element $w_{i}$. The embedding vector of the generated element
$v(w_{i})$ is also concatenated with $t$, and the result
$v(w_{i})^{\prime}=v(w_{i})\oplus t$ is fed into the decoder to generate the
next element $w_{i+1}$. Similarly to a standard seq2seq model, the generating
process stops at the maximum step count or an end indicator, and outputs the
generated sequence $W=\\{w_{1},w_{2},\cdots,w_{m}\\}$. Figure 3 illustrates
the tone-aware seq2seq model introduced in the paper.

Figure 4: Results of human evaluation. Please note that, “HUM” is short for
“Human”, indicates the real human agent response, “PASS” is short for
“Passionate response”, “EMP” is short for “Empathetic responses”, and “NEU”
represents “Neutral responses”.

###  5.3 Implementation

We first preprocess the conversations data into the form of sequence pairs
with tone information for both training and generating. For the conversations
of one round (one user request, $c_{1}$, with one agent response, $a_{1}$),
the sequence pairs are simply these two utterances, where $X=c_{1}$ and
$Y=a_{1}$. For the conversations of multiple turns, we generate a pair of
matching sequences for each round. The first sequence $X$ for $i_{th}$ round
is defined as the user request in this round $c_{i}$, plus all the utterances
by both the user and agent before the round. Formally, $X=c_{1}\oplus
a_{1}\oplus c_{2}\oplus a_{2},\cdots,\oplus c_{i}$. The second sequence $Y$ is
simply the agent response in this round, i.e. $Y=a_{i}$. This method of
generating sequence pairs from multiple turns conversations is to include the
context for each turn as suggested in [32].

The extracted keywords are used for indicating the conversation tone
information. Specifically, for a preprocessed conversation, if one or more
empathetic word occur in the agent response ($a_{1}$ for one round or $a_{i}$
for multiple rounds), $t$ is set to an empathetic indicator. Similarly, $t$ is
set to a passionate indicator, if passionate keywords occur. If no keyword
occurs in the agent response, implying the conversation does not contain tone
information, $t$ is then set to a neutral indication.

From the preprocessed sequence pairs, we randomly sample 500 pairs for
evaluation, and the remaining of the data is used for training. For an
evaluation sequence pair, we fed the user request to the model three times,
each time with a different value for the tone indicator $t$. In other words,
for each evaluation user request, we generate a response in empathetic,
passionate and neutral tone, respectively. Table 4 shows some evaluation user
requests, and the generated responses by our chatbot, as well as the responses
by real human agents.

The configurations of the models are as follow:

1) One layer LSTM models for both encoder and decoder with 512 hidden cells.
Parameters of the model are initialized by sampling from the uniform
distribution [-0.1, 0.1].

2) The vocabulary size is set to 10,000, and the size of word embedding is
256. The tone indicator $t$ is set to -1, 0, +1 for empathetic, neutral, and
passionate tones, respectively.

3) The model is trained using Adam optimization algorithm [28] with an initial
learning rate of 0.001.

##  6 Evaluation

We evaluate our system from two aspects: 1) the response quality, i.e. if the
system generates proper responses to user requests, and 2) the intensities of
embedded tones, i.e. if human could perceive tones embedded in the generated
responses. To assess the response quality, we derive two metrics from previous
work: response appropriateness and helpfulness. Specifically, an appropriate
response should be on the same topic as the request, and should also “make
sense” in response to it [47]. A helpful response should contain useful and
concrete advice that can address the user request [20]. To assess the
intensities of embedded tones, we evaluate passionate level and empathetic
level for the generated response.

Given a user request, three responses are generated by our system for three
different tones (passionate, empathetic, and neutral). We then ask annotators
to rate the appropriateness, helpfulness, passionate level, and empathetic
level for the three generated responses, as well as the real agent response to
the same user request. By comparing the ratings of generated responses with
real agent responses, we validate to what extent our system could generate
human-like responses to user requests, in terms of both response quality and
tone intensity. Meanwhile, by comparing the ratings of three generated
responses, we validate if our system is capable of embedding different tones
in the responses.

Crowdflower is again used to recruit annotators. All 703 participants are
native English speakers, and they are 18 or older. Participants are asked to
fill out at least one gold question in order to participate the survey. 14.1%
of participants fail the check, and their responses are removed. In a survey
task, participants are first instructed to learn the four rating metrics:
appropriateness, helpfulness, passionate and empathetic levels, with
definitions and examples. Then, they are shown a user request and asked to
rate the four responses. The responses are arranged in random order to control
order effects. 500 user requests are sampled, thus 2,000 responses in total
are rated. Each response is rated by five participants according to the four
metrics. The ratings are made on a 7-point scale from strongly disagree (-3)
to strongly agree (+3). The average of five participants’ ratings of a
response are used as the final ratings. Intra-class correlation (ICC) is used
to assess the reliability for our evaluation tasks, where each response is
rated by $k$ workers randomly selected from a population of K workers.
ICC(1,$k$) is ranged from 0.56 to 0.87, indicating moderately high
reliabilities of the workers [4].

###  6.1 Results

For each of the four criteria, we first conduct an ANOVA analysis,
respectively. All four ANOVA analyses reject the null hypothesis, indicating
that scores on different types of responses (passionate, empathetic, neutral,
real human agent response) are significantly different. Therefore, additional
post analysis is then conducted for each metric. To be specific, in the post
tests, we compare the different types in pairs using t-test for each
criterion, and apply Bonferroni correction on the results. We report the post
analysis results as follow.

Appropriateness: Interestingly, there is no statistically significant
difference between human responses and generated passionate responses in terms
of appropriateness ($p=0.33$). This indicates that our chatbot has a similar
ability as human agents to respond appropriately to requests. However, the
appropriateness scores of three types of toned response are significantly
different. Passionate responses are rated significantly higher than empathetic
($p<0.05$) and neutral ($p<0.05$) responses, indicating that passionate tone
is considered more appropriate to address requests by the annotators. We
suggest that this is because passionate tones can address more situations of
user requests than the other two tones. We will discuss the difference among
tones in the next section. Meanwhile, it is observed that empathetic responses
are marginally significantly more appropriate than neutral responses
($p<0.1$).

Helpfulness: Not surprisingly, real human responses are rated higher than
generated empathetic ($p<0.01$), passionate ($p<0.01$), and neutral ($p<0.01$)
responses. This is because helpfulness measures if the responses contains
useful and concrete advice. In other words, to achieve a higher helpfulness
score requires more background knowledge and extra information [52]. It is
reasonable that human agents do a better job than our system, which is trained
on a finite dataset. There is no significant difference reported among the
three generated responses. It implies that using different tones in a response
do not affect the helpful level.

Passionate Level: There is no statistically significant difference observed
between human responses and generated passionate responses in terms of
passionate level ($p=0.15$). The results indicate that our chatbot can perform
as passionate as human agents do. As for the three tone types, empathetic
responses are lower rated than passionate responses ($p<0.01$), and neutral
responses’ rates are lower than empathetic responses ($p<0.01$). The results
imply that our chatbot successfully controls the passionate tone in the
generated responses, and the human annotators are able to perceive the tone.

Empathetic Level: Surprisingly, annotators perceive that our system generates
the most empathetic responses. All three t-tests reveal that empathetic
responses are significantly higher rated comparing with the other response
types ($p<0.01$ for all three tests). Passionate responses are rated the
second in terms of empathetic level, and marginally significantly higher than
human response ($p<0.1$), and significantly higher than neutral responses
($p<0.01$). Human response is rated the third, and perceived more empathetic
than neutral responses ($p<0.01$). This indicates that our system also
controls empathetic tone well, and could even perform more empathetically than
human agents do.

In summary, the test results reveal that our system could perform as well as
human agent in term of responding to users properly. However, the annotators
rate our chatbot less helpful than real human agents. The tones embedded in
the responses by our chatbot can be accurately perceived by human. The
intensities of the embedded tones in the generated responses are as strong as
(passionate), or even stronger (empathetic) than the intensities of tones in
human responses.

##  7 Discussion

In this work, we report our tone-aware chatbot for social media customer care.
According to the human evaluation results, our chatbot is able to embed human-
perceivable tones in responses. Meanwhile, the tone-aware chatbot performs
reasonably in terms of the appropriateness and helpfulness levels. Since tones
used by agent in their responses could significantly affect user experience,
our work is of much practical value. A possible application of our system is
recommending human agents responses in different tones to a user request. By
doing this, the agent reacting time could be significantly reduced, and tones
are also considered by the system.

We summarize and identify eight major tones that commonly occur in customer
care conversation. Our study on the eight major tones suggests that two tones
– empathetic and passionate – are of great value to customer care. The
benefits of using these tones include reducing user negative emotion,
increasing their positive emotion, and eventually increasing user
satisfaction. Not surprisingly, the tones embedded by our tone-aware chatbot
appear to have similar effects of increasing user experience. According to the
human evaluation results, both empathetic and passionate responses are scored
significantly more appropriate than neutral responses. The observation implies
the effects of tones, and more importantly, evidences the application value of
the tone-aware chatbot.

Statistically, the evaluation indicates that the passionate responses
generated by our chatbot are perceived as appropriate as the responses by
human agents. Interestingly, according to previous work on customer care
chatbot [52], to a certain extent, human responses still outperform generated
responses on appropriateness. We suppose this is probably due to the
passionate tone embedded in the responses. According to our formative study,
passionate tone has significant positive effect on user experience. Therefore,
we suggest that the passionate tone embedded by our chatbot may increase the
impressions of the responses to the annotators, and consequently lead to
higher appropriateness scores.

The results of evaluation also reveal the differences between two tones
controlled by the system. Passionate tone is rated significantly more
appropriate than empathetic tone. We suggest that this is because passionate
tone is more general. In other words, this tone could fits for more types of
user requests. For example, Xu et al. suggested in [52] that user request
could be informational (seeking for information), or emotional (expressing
emotion). For informational user request, it may be not that appropriate for
agent to show empathetic tones, while passionate tone could be still
appropriate to use. Hence, passionate tone could be assigned higher rating
than empathetic tone in these cases. It is worth studying the effects of
different tones at a finer granularity in the future work, and furthermore,
how to adopt the fine-grained effects in an automatic conversational customer
care system.

Our evaluation is based on human judgment, instead of automatic metrics. This
is because although automatic metrics can be used to evaluate if the generated
results are grammatically correct, they are not capable of evaluating the
embedded tones. Therefore, human judgment is required for evaluating if users
can perceive the tones we embed in the responses. Moreover, the grammatical
correctness is also evaluated by comparing the appropriateness and helpfulness
of the generated responses and the real agent responses. In the future,
additional studies can be designed to examine how our chatbot is used in
practice. For example, a field study can be designed to study the perceptions
of perceived tones from end users of a brand, and how these perceptions can
affect user engagement.

The proposed tone-aware chatbot is based on a deep learning seq2seq framework.
The model controls the output styles by simply adding an indicator bit to the
standard seq2seq model. Besides tones, the model can be easily extended to
generate responses of various styles. A possible and interesting extension is
a brand-aware chatbot for customer care. The chatbot reported in this work
answers user request in a general brand style. However, customer care of
different brands may have different styles. For example, according to our
observation on the collected dataset, the customer care of some brands such as
Nike (@Nike) and Jetblue (@JetBlue) tend to use informal responses, while some
others are more formal, such as Chase (@Chase) and Wells Fargo (@WellsFargo).
Therefore, it is possible to extend our model to a brand-aware chatbot by
feeding the model meta information of brands. The chatbot could learn the
styles of different brands accordingly, and generates agent responses in
different brand styles.

##  8 Conclusion

In this paper, we first systematically study the effects of agent tones in
customer care. Two tones that are beneficial for increasing user experience –
passionate and empathetic – are identified accordingly. We further propose a
novel deep learning based chatbot for customer care that integrates the tone
information in conversations, and generates toned responses to user requests.
The evaluation results suggest that our system could generate as appropriate
responses as human agents. Meanwhile, the the tones embedded can be easily
perceived by annotators. More importantly, it is observed that the responses
generated by our system is perceived more empathetic than responses by human
agents. There are many interesting and valuable directions for future work.
Possible directions include studying the effects of agent tones at a finer
granularity, and how the chatbot could effect the end user engagement.
Meanwhile, it is also worth studying the possible extensions on our proposed
model, such as a brand-aware chatbot for different brand styles.

## References

  * [1]
  * [2] Jennifer L Aaker. 1997.  Dimensions of brand personality.  Journal of marketing research (1997), 347–356.
  * [3] Masroor Ahmed. 2017.  Social Media Customer Service Statistics and Trends.  http://www.socialmediatoday.com/social-business/. (2017).
  * [4] Joan-Isaac Biel, Oya Aran, and Daniel Gatica-Perez. 2011.  You Are Known by How You Vlog: Personality Impressions and Nonverbal Behavior in YouTube.. In ICWSM.
  * [5] Jeffrey G Blodgett, Donna J Hill, and Stephen S Tax. 1997.  The effects of distributive, procedural, and interactional justice on postcomplaint behavior.  Journal of retailing 73, 2 (1997), 185–210.
  * [6] Christo Boshoff. 1997.  An experimental study of service recovery options.  International Journal of service industry management 8, 2 (1997), 110–130.
  * [7] Scott Brave, Clifford Nass, and Kevin Hutchinson. 2005.  Computers that care: investigating the effects of orientation of emotion exhibited by an embodied computer agent.  International journal of human-computer studies 62, 2 (2005), 161–178.
  * [8] Heloisa Candello, Claudio Pinhanez, and Flavio Figueiredo. 2017.  Typefaces and the Perception of Humanness in Natural Language Chatbots. In CHI’17. ACM, 3476–3487.
  * [9] Ting-Hao Kenneth Huang Joseph Chee Chang and Saiganesh Swaminathan Jeffrey P Bigham. 2017.  Evorus: A Crowd-powered Conversational Assistant That Automates Itself Over Time. In UIST Poster 2017.
  * [10] Junyoung Chung, Caglar Gulcehre, KyungHyun Cho, and Yoshua Bengio. 2014\.  Empirical evaluation of gated recurrent neural networks on sequence modeling.  arXiv preprint arXiv:1412.3555 (2014).
  * [11] Gary L Clark, Peter F Kaminski, and David R Rink. 1992.  Consumer complaints: Advice on how companies should respond based on an empirical study.  Journal of Consumer Marketing 9, 3 (1992), 5–14.
  * [12] Moshe Davidow. 2000.  The bottom line impact of organizational responses to customer complaints.  Journal of hospitality & tourism research 24, 4 (2000), 473–490.
  * [13] Moshe Davidow. 2003.  Organizational responses to customer complaints: What works and what doesn’t.  Journal of service research 5, 3 (2003), 225–250.
  * [14] Moshe Davidow and James Leigh. 1998.  The effects of organizational complaint responses on consumer satisfaction, word of mouth activity and repurchase intentions.  Journal of Consumer Satisfaction, Dissatisfaction and Complaining Behavior 11 (1998).
  * [15] Hyo Jin Do and Wai-Tat Fu. 2016.  Empathic Virual Assistant for Healthcare Information with Positive Emotional Experience. In Healthcare Informatics (ICHI), 2016 IEEE International Conference on. IEEE, 318–318.
  * [16] Sabine A Einwiller and Sarah Steilen. 2015.  Handling complaints on social network sites–An analysis of complaints and complaint responses on Facebook and Twitter pages of large US companies.  Public Relations Review 41, 2 (2015), 195–204.
  * [17] Hans Jurgen Eysenck. 1953.  The structure of human personality.  (1953).
  * [18] Facebook. 2017.  Facebook Conversation Agent System.  https://www.facebook.com/ConversationAgent/. (2017).
  * [19] David Ha, Andrew Dai, and Quoc V Le. 2016.  HyperNetworks.  arXiv preprint arXiv:1609.09106 (2016).
  * [20] F Maxwell Harper, Daphne Raban, Sheizaf Rafaeli, and Joseph A Konstan. 2008.  Predictors of answer quality in online Q&A sites. In CHI’08. ACM, 865–874.
  * [21] Takayuki Hasegawa, Nobuhiro Kaji, Naoki Yoshinaga, and Masashi Toyoda. 2013.  Predicting and Eliciting Addressee’s Emotion in Online Dialogue.. In ACL (1). 964–972.
  * [22] Jonathan Herzig, Guy Feigenblat, Michal Shmueli-Scheuer, David Konopnicki, Anat Rafaeli, Daniel Altman, and David Spivak. 2016.  Classifying Emotions in Customer Support Dialogues in Social Media.. In SIGDIAL Conference. 64–73.
  * [23] Ting-Hao Kenneth Huang, Walter S Lasecki, Amos Azaria, and Jeffrey P Bigham. 2016.  " Is There Anything Else I Can Help You With?" Challenges in Deploying an On-Demand Crowd-Powered Conversational Agent. In HCOMP’16.
  * [24] IBM. 2017.  IBM Watson Automatic Chatbot Service.  https://www.ibm.com/watson/services/conversation-2/. (2017).
  * [25] Doga Istanbulluoglu. 2017.  Complaint handling on social media: The impact of multiple response times on consumer satisfaction.  Computers in Human Behavior 74 (2017), 72–82.
  * [26] L Kang, C Tan, and J Zhao. 2013.  The impact of intra-transaction communication on customer purchase behaviour in e-commerce context. In ACIS’13. RMIT University, 1–12.
  * [27] Suin Kim, JinYeong Bak, and Alice Haeyun Oh. 2012.  Do You Feel What I Feel? Social Aspects of Emotions in Twitter Conversations.. In ICWSM.
  * [28] Diederik Kingma and Jimmy Ba. 2014.  Adam: A method for stochastic optimization.  arXiv preprint arXiv:1412.6980 (2014).
  * [29] Michel Laroche, Mohammad Reza Habibi, and Marie-Odile Richard. 2013.  To be or not to be in social media: How brand loyalty is affected by social media?  International Journal of Information Management 33, 1 (2013), 76–82.
  * [30] Walter S Lasecki, Rachel Wesley, Jeffrey Nichols, Anand Kulkarni, James F Allen, and Jeffrey P Bigham. 2013.  Chorus: a crowd-powered conversational assistant. In Proceedings of the 26th annual ACM symposium on User interface software and technology. ACM, 151–162.
  * [31] Jiwei Li, Michel Galley, Chris Brockett, Georgios P Spithourakis, Jianfeng Gao, and Bill Dolan. 2016.  A persona-based neural conversation model.  arXiv preprint arXiv:1603.06155 (2016).
  * [32] Jiwei Li, Will Monroe, Alan Ritter, Michel Galley, Jianfeng Gao, and Dan Jurafsky. 2016.  Deep reinforcement learning for dialogue generation.  arXiv preprint arXiv:1606.01541 (2016).
  * [33] Shoushan Li, Lei Huang, Rong Wang, and Guodong Zhou. 2015.  Sentence-level Emotion Classification with Label and Context Dependence.. In ACL (1). 1045–1053.
  * [34] Jade Longelin. 2016.  Customer Service Response and Waiting Time on Social Media.  http://blog.playvox.com/customer-service-response-and-waiting-time-on-social-media. (2016).
  * [35] Rhonda Mack, Rene Mueller, John Crotts, and Amanda Broderick. 2000.  Perceptions, corrections and defections: implications for service recovery in the restaurant industry.  Managing Service Quality: An International Journal 10, 6 (2000), 339–346.
  * [36] François Mairesse and Marilyn Walker. 2007.  PERSONAGE: Personality generation for dialogue. In Annual Meeting-Association For Computational Linguistics, Vol. 45. 496.
  * [37] Jennifer Langston Martin. 1985.  Consumer perception of and response to corporate complaint handling… Ph.D. Dissertation. Texas Woman’s University.
  * [38] Michael A McCollough. 2000.  The effect of perceived justice and attributions regarding service failure and recovery on post-recovery customer satisfaction and service quality attitudes.  Journal of Hospitality & Tourism Research 24, 4 (2000), 423–447.
  * [39] Microsoft. 2017.  Build a great conversationalist.  https://dev.botframework.com/. (2017).
  * [40] Amy Mitchell and Dana Page. 2015.  State of the news media 2015.  Pew Research Center 29 (2015).
  * [41] Susan V Morris. 1988.  How many lost customers have you won back today? An aggressive approach to complaint handling in the hotel industry.  Journal of Consumer Satisfaction, Dissatisfaction and Complaining Behavior 1, 1 (1988), 86–92.
  * [42] Prashanth U Nyer. 2000.  An investigation into whether complaining can cause increased consumer satisfaction.  Journal of consumer marketing 17, 1 (2000), 9–19.
  * [43] Shereen Oraby, Pritam Gundecha, Jalal Mahmud, Mansurul Bhuiyan, and Rama Akkiraju. 2017.  How May I Help You?: Modeling Twitter Customer ServiceConversations Using Fine-Grained Dialogue Acts. In Proceedings of the 22nd International Conference on Intelligent User Interfaces. ACM, 343–355.
  * [44] James W Pennebaker, Martha E Francis, and Roger J Booth. 2001.  Linguistic inquiry and word count: LIWC 2001.  Mahway: Lawrence Erlbaum Associates 71, 2001 (2001), 2001.
  * [45] Rosalind W Picard and Roalind Picard. 1997.  Affective computing. Vol. 252.  MIT press Cambridge.
  * [46] Helmut Prendinger and Mitsuru Ishizuka. 2005.  The empathic companion: A character-based interface that addresses users’affective states.  Applied Artificial Intelligence 19, 3-4 (2005), 267–285.
  * [47] Alan Ritter, Colin Cherry, and William B Dolan. 2011.  Data-driven response generation in social media. In Proceedings of the conference on empirical methods in natural language processing. Association for Computational Linguistics, 583–593.
  * [48] Beverley A Sparks and Janet R McColl-Kennedy. 2001.  Justice strategy options for increased customer satisfaction in a services recovery setting.  Journal of Business Research 54, 3 (2001), 209–218.
  * [49] Martin Sundermeyer, Ralf Schlüter, and Hermann Ney. 2012.  LSTM neural networks for language modeling. In Thirteenth Annual Conference of the International Speech Communication Association.
  * [50] Ilya Sutskever, Oriol Vinyals, and Quoc V Le. 2014.  Sequence to sequence learning with neural networks. In Advances in neural information processing systems. 3104–3112.
  * [51] TARP TARP. 1982.  Measuring the grapevine consumer response and word-of-mouth.  The Coca-Cola Company (1982).
  * [52] Anbang Xu, Zhe Liu, Yufan Guo, Vibha Sinha, and Rama Akkiraju. 2017\.  A New Chatbot for Customer Service on Social Media. In CHI’17. ACM, 3506–3510.
  * [53] Peifeng Yin, Zhe Liu, Anbang Xu, and Taiga Nakamura. 2017.  Tone Analyzer for Online Customer Service: An Unsupervised Model with Interfered Training. In Proceedings of the 26th ACM International on Conference on Information and Knowledge Management. 1887–1895.
  * [54] Zhou Yu, Alexandros Papangelis, and Alexander Rudnicky. 2015.  TickTock: A non-goal-oriented multimodal dialog system with engagement awareness. In Proceedings of the AAAI Spring Symposium.
  * [55] Lu Zhang, Lee B Erickson, and Heidi C Webb. 2011.  Effects of “emotional text” on Online Customer Service Chat.  (2011).
  * [56] Hao Zhou, Minlie Huang, Tianyang Zhang, Xiaoyan Zhu, and Bing Liu. 2017\.  Emotional Chatting Machine: Emotional Conversation Generation with Internal and External Memory.  arXiv preprint arXiv:1704.01074 (2017).


# Algebraic Results on SP Numbers along with a generalization

Raghavendra N Bhat, Sundarraman Madhusudanan

(Date: September 2022)

###### Abstract.

We defined numbers of the form $p\cdot a^{2}$ as SP numbers (Square-Prime
numbers) ($a\neq 1$, $p$ prime) in [1] along with proofs on their
distribution. Some examples of SP Numbers : 75 = 3 $\cdot$ 25; 108 = 3 $\cdot$
36; 45 = 5 $\cdot$ 9\. These numbers are listed in the OEIS as A228056 [2]. In
this paper, we will prove a few algebraic theorems and generalize the
definition of SP Numbers to allow factors of arbitrary natural number powers.

##  1\. Introduction and Summary of Previous results

In our previous paper titled ‘Distribution of square-prime numbers’ [1], we
introduced the notion of a product of a prime and a square, with the square
not being 1. We call these SP numbers.

Here are the first 25 SP numbers: 8, 12, 18, 20, 27, 28, 32, 44, 45, 48, 50,
52, 63, 68, 72, 75, 76, 80, 92, 98, 99, 108, 112, 116, 117.

In the paper we mainly proved three results. Firstly, SP numbers have an
asymptotic distribution similar to prime numbers, meaning, for a large natural
number $n$, the number of SP numbers smaller than $n$ is asymptotic to
$\frac{n}{\log n}$, as with the case of primes. We denote the number of SP
numbers smaller than $n$ by $SP(n)$. The result derived in the paper is
$SP(n)=(\zeta(2)-1)\cdot\frac{n}{\log n}+O\left(\frac{n}{\log n^{2}}\right).$
We see that although asymptotically similar to the distribution of primes, the
actual value of $SP(n)$ is lower than $\pi(n)$ for large $n$, since
$\zeta(2)-1<1$.

Secondly, there are infinitely many pairs of SP numbers that are consecutive
natural numbers. We call these SP twins. An example is (27,28). More
generally, we showed that if $SP_{1}$ and $SP_{2}$ are SP Numbers, the
equation $SP_{1}-SP_{2}=g$, where $g\in\mathbb{N}$ has infinite solutions if
it has one solution. Here $g$ is the gap between the two SP Numbers.

Thirdly, we analyzed techniques to give asymptotic estimates for number of SP
numbers having a certain last digit. For example, the number of SP numbers
ending in 1 approaches $\frac{1}{400}\frac{n}{\log
n}(\zeta(2,1/10)+\zeta(2,9/10)+\zeta(2,3/10)+\zeta(2,7/10)-4).$

In this paper, our goal is to study algebraic properties of SP numbers, their
gaps and also their structure with regard to square-free numbers. Analogies to
famous prime number conjectures like the $x^{2}+1$ conjecture and primes
between squares are studied. We then generalize the idea of a square
multiplied by a prime to any power of a natural number multiplied by a prime.

##  2\. Algebraic SP Theorems

Theorem 2.1: For any positive integer $x$, there exist at least one pair of SP
numbers $(a,b)$ such that $a-b=x$.

###### Proof.

We will divide all positive integers into five groups. We will then prove the
existence of one pair of $SP$ numbers with difference $x$ in each group.

  * •

x=1: 28 - 27 = 1. Thus, there exists an $SP$ pair with difference 1.

  * •

x is prime:  Consider the following Pell’s equation

$m^{2}-pxn^{2}=1$

where $p\in\mathbf{P}\neq x$. We know from Chakravala that $(3)$ has at least
1 positive integer solution. Let that solution be $(M,N)$. Thus,

$M^{2}-pxN^{2}=1$ $\Rightarrow xM^{2}-px^{2}N^{2}=x\Rightarrow
xM^{2}-p(xN)^{2}=x$

Thus, we have generated two $SP$ numbers, $xM^{2}$ and $p(xN)^{2}$ that differ
by $x$. Since $x$ was an arbitrary prime, this case holds.

  * •

x is an odd composite square free number : Thus we have $x=p_{1}\cdot
p_{2}\cdot...\cdot p_{n}$, where $p_{1},p_{2}...,p_{n}$ are all odd prime
numbers. Let $p_{1}$ be the smallest prime factor of $x$. Thus $p_{1}\geq 3$
and $p_{2},p_{3},...p_{n}>3$. Thus we can write

$x=p_{1}\cdot y$

where $y=p_{2}\times p_{3}\times...\times p_{n}$. And since
$p_{2},p_{3},...p_{n}>3$, $y>3$. Furthermore, since $y$ is a product of odd
prime numbers, $y$ has to be odd. Thus, we can also write the above equation
as

$x=p_{1}\cdot(2k+1)$

And again, since $y>3$, we have $k>1$.

$x=p_{1}\cdot[(k+1)^{2}-k^{2}]\Rightarrow x=p_{1}\cdot(k+1)^{2}-p_{1}\cdot
k^{2}$

And since $k>1$ and $p_{1}$ is prime, by definition $p_{1}\cdot(k+1)^{2}$ and
$p_{1}\cdot k^{2}$ are both $SP$ numbers with difference $x$. This case holds.

  * •

x is an even composite square free number : This means $x=p_{1}\cdot
p_{2}\cdot...\cdot p_{n}$, where $p_{1}=2$ and $p_{2},p_{3}...p_{n}$ are all
odd prime numbers. Thus $p_{2},p_{3},...p_{n}\geq 3$. Thus, as previously
written,

$x=2\times y$

where $y=p_{2}\times p_{3}\times...\times p_{n}$. And since
$p_{2},p_{3},...p_{n}\geq 3$, $y\geq 3$. Furthermore, since $y$ is a product
of odd prime numbers, $y$ is odd. Thus, we can also write the above equation
as

$x=2\cdot(2k+1)$

And again, since $y\geq 3$, we have $k\geq 1$. The above equation simplifies
to

$x=2\cdot[(k+1)^{2}-k^{2}]\Rightarrow x=2\cdot(k+1)^{2}-2\cdot k^{2}$

Note that in the previous case we had $k>1$ and here, we have $k\geq 1$. This
is an issue because, when $k=1$, $2\cdot k^{2}$ will be 2 which is not an $SP$
number. Note that

$k=1\Rightarrow y=3\Rightarrow p_{2}\cdot p_{3}\cdot...\cdot
p_{n}=3\Rightarrow p_{2}=3$

since 3 is prime and has only 1 factor. Thus, except in the case where
$p_{1}=2,p_{2}=3$, this proof works exactly like the previous case.
Now, let us look at $p_{1}=2,p_{2}=3$, or in other words, $x=p_{1}\cdot
p_{2}=6$. $18-12=6$ and $18=2\cdot 3^{2},12=3\cdot 2^{2}$.
Since 6 was the only integer in this group for which the general method did
not work, we can combine the previous 2 paragraphs to jointly say that for
every even composite square free integer $x$, there exists a pair of SP
numbers $(a,b)$ such that $a-b=x$.

  * •

x is a non square free number : By the property of non square free numbers, we
can write $x=t^{2}\cdot s$ where $s$ is a square free number. Now, using the
result from the four cases above, we can say that for all $s$, there exists a
pair of $SP$ numbers $(j,k)$ such that

$s=j-k\Rightarrow t^{2}\cdot s=t^{2}\cdot j-t^{2}\cdot k\Rightarrow
x=t^{2}\cdot j-t^{2}\cdot k$

Since $(j,k)$ are $SP$ numbers, $(t^{2}\cdot j$ and $t^{2}\cdot k)$ are both
$SP$ numbers having difference $x$. Thus, for every non square free integer
$x$, there exists a pair of $SP$ numbers $(a,b)$ such that $a-b=x$.

Combining all the groups above, we can say that for any positive integer $x$,
there exist at least one pair of SP numbers $(a,b)$ such that $a-b=x$.
∎

Theorem 2.2: There are infinitely many SP Numbers of the form $x^{2}+1$.

###### Proof.

Our goal is to show that the equation $x^{2}+1=pa^{2}$ has infinitely many
solutions where $a,x\in{\mathbb{N}}$ and $p$ is prime. We start the proof with
the knowledge that at least one solution already exists (we have 50, 325 and
1025 as the first 3 SP Numbers of the form $x^{2}+1$).

$m^{2}-2n^{2}=-1\\\ $

has a solution, namely $(7,5)$. Let $(A,B)=(7,5)$. Now, consider the equation

$m^{2}-2n^{2}=1$

We know the above Pell’s equation has infinitely many solutions. Let $(X,Y)$
be an arbitrary solution to the above equation. Thus, we have the following 2
equations:

$A^{2}-2B^{2}=-1$ $X^{2}-2Y^{2}=1$

Multiplying $(1)$ and $(2)$, we get

$(A^{2}-2B^{2})(X^{2}-2Y^{2})=-1\Rightarrow(AX+2BY)^{2}-2(AY+BX)^{2}=-1$

Thus, for every one of the infinite solutions of the Pell’s equation $(X,Y)$,
we have a new solution for the equation:

$m^{2}-2n^{2}=-1\Rightarrow 2n^{2}=m^{2}+1$

Thus, there are infinitely many SP numbers of the form $x^{2}+1$.
∎

Theorem 2.3 : For any positive integer $x$, there exists at least one $SP$
number between $x^{2}$ and $(x+2)^{2}$.

###### Proof.

Consider the sub-sequence of $SP$ numbers $8,18,32,50,72,98,128,162,...$. All
of them are of the form $2n^{2}$. Notice that $2n^{2}$ lies between $x^{2}$
and $(x+2)^{2}$ if and only if $n\sqrt{2}$ lies between $x$ and $x+2$.
Thus, we now need to prove that for any positive integer $x$, there exists at
least one positive integer $n$ such that $n\sqrt{2}$ lies between $x$ and
$(x+2)$. We will prove this using contradiction.
Assume that there exists a positive integer $x$ such that the smallest
multiple of $\sqrt{2}$ greater than $x$ is greater than $x+2$. Let this
multiple be $a\sqrt{2}$ This means there is no multiple of $\sqrt{2}$ in
$[x,x+2]$. But then,

$(a-1)\sqrt{2}<x<x+2<a\sqrt{2}\Rightarrow
a\sqrt{2}-(a-1)\sqrt{2}>x+2-x\Rightarrow\sqrt{2}>2$

which is a contradiction.
∎

Theorem 2.4 : All $SP$ numbers of the form $pa^{2}$, where $p$ is a prime and
$a$ has at least one prime factor of the form $4k+1$ can be written as a sum
of 2 $SP$ numbers.

###### Proof.

By the 2 squares theorem, if $4k+1$ is a prime, $(4k+1)^{2}$ can be written as
$x^{2}+y^{2}$, where $x,y>1$. Now, since $4k+1$ is a factor of $a$, we can
write

$a=n\cdot(4k+1)\Rightarrow pa^{2}=pn^{2}\cdot(4k+1)^{2}$ $\Rightarrow
pa^{2}=pn^{2}\cdot(x^{2}+y^{2})\Rightarrow
pa^{2}=p\cdot(nx)^{2}+p\cdot(ny)^{2}$

We now have our original $SP$ number $pa^{2}$ as a sum of two $SP$ numbers
$p\cdot(nx)^{2}$ and $p\cdot(ny)^{2}$
∎

##  3\. SP Numbers of the form $x^{3}+1$

Conjecture 3.1: There are infinitely many SP Numbers of the form $x^{3}+1$, if
the Bunyakovsky [3] conjecture is true.

###### Proof.

Let $x=t^{2}-1$ for $t\in\mathbb{N}$.
We have $x^{3}+1=(x+1)(x^{2}-x+1)\Rightarrow
x^{3}+1=t^{2}\cdot(t^{4}-3t^{2}+3)$
Consider $f(t)=t^{4}-3t^{2}+1$. It satisfies the following 3 properties of the
Bunyakovsky conjecture:
1) The leading coefficient is positive.
2) The polynomial is irreducible over integers.
3) $GCD(f(2),f(3))$ is 1 and the coefficients of $f(x)$ are relatively prime.

Using the above three conditions, it follows from the Bunyakovsky conjecture
that $f(t)$ is prime for infinitely many positive integers $t$. This implies
$t^{2}\cdot(t^{4}-3t^{2}+3)$ is of the form $prime\cdot t^{2}$ for infinitely
many $t$ which further implies there exists infinitely many $x=t^{2}-1$ such
that $x^{3}+1$ is an SP number.
∎

##  4\. A generalization of SP Numbers

SP Numbers are those numbers that are of the form $pa^{2}$. We could extend
the definition to numbers of the form $pa^{k}$ and get asymptotic estimates on
their distribution. Let us call these numbers KPk Numbers. SP Numbers are a
special case of KP numbers and can be defined to be KP2. Trivially, the prime
numbers and semi-prime numbers are KP0 and KP1 respectively. Let $KP_{k}(n)$
denotes the number of KPk Numbers smaller than $n$. As proved in [1],

$KP_{2}(n)=(\zeta(2)-1)\frac{n}{\log n}+O\left(\frac{n}{\log^{2}n}\right)$

Theorem 4.1 : For any $k$ greater than 1,

$KP_{k}(n)=(\zeta(k)-1)\frac{n}{\log n}+O\left(\frac{n}{\log^{2}n}\right)$

###### Proof.

$KP_{k}(n)=\sum_{a=2}^{\sqrt{n/2}}\pi\left(\frac{n}{a^{k}}\right).$

The error term remains to be $O\left(\frac{n}{\log^{2}n}\right)$, as in [1].
The main term simplifies to

$n\sum_{a=2}^{\log^{2}n}\frac{1}{a^{k}(\log n-\log(a^{k}))}=\frac{n}{\log
n}\sum_{a=2}^{\log^{2}n}\frac{1}{a^{k}(1-\frac{k\log a}{\log n})}$
$\Rightarrow\frac{n}{\log
n}\sum_{a=2}^{\log^{2}n}\frac{1}{a^{k}}\left(1+O\left(\frac{\log a}{\log
n}\right)\right)$ $=\frac{n}{\log
n}\sum_{a=2}^{\log^{2}n}\frac{1}{a^{k}}+O\left(\frac{n}{\log^{2}n}\right)\leq\frac{n}{\log
n}\sum_{a=2}^{\infty}\frac{1}{a^{k}}+O\left(\frac{n}{\log^{2}n}\right)$
$=(\zeta(k)-1)\frac{n}{\log n}+O\left(\frac{n}{\log^{2}n}\right)$

∎

##  5\. PSP Numbers

A special type of SP Numbers can be defined to be the product of a prime and a
square such that the square is a prime square. An approach similar to the
proof of Theorem 4.1 can be employed to get the asymptotic estimate of the
count of PSP Numbers.

Theorem 5.1 :  The number of PSP numbers smaller than $n$ is

$P(2)\frac{n}{\log n}+O\left(\frac{n}{\log^{2}n}\right),$

where $P(2)$ is the prime zeta function of 2.

###### Proof.

$PSP(n)=\sum_{p=2}^{\sqrt{n/2}}\pi\left(\frac{n}{p^{2}}\right),\text{where $p$
is prime}.$ $\leq\frac{n}{\log
n}\sum_{p=2}^{\infty}\frac{1}{p^{2}}+O\left(\frac{n}{\log^{2}n}\right)=P(2)\frac{n}{\log
n}+O\left(\frac{n}{\log^{2}n}\right).$

∎

As a corollary (owing to Theorem 4.1), we have

$PKP_{k}(n)=P(k)\frac{n}{\log n}+O\left(\frac{n}{\log^{2}n}\right)$

where PKP Numbers are numbers of the form $p_{1}p_{2}^{k}$, where $p_{1}$ and
$p_{2}$ are arbitrary prime numbers and $P(k)$ is the prime zeta function of
$k$.

##  6\. Future work and Concluding Remarks

Conjecture 3.1 can be explored further via the use of elliptic curves. Trying
to find an SP Number of the form $x^{3}+1$ is analogous to finding integer
solutions to

$x^{3}+1=pa^{2}\Rightarrow px^{3}+p=(pa)^{2}$

Letting $y=pa$, we have the elliptic curve equation

$y^{2}=px^{3}+p.$

Computational experiments have given us over 25 integer solutions to this
equation. Potential future work can involve proving the existence of infinite
integer solutions to the same.

## References

  * [1] Bhat, R. “Distribution of Square-Prime Numbers.” Missouri J. Math. Sci. 34 (1) 121 - 126, May 2022. https://doi.org/10.35834/2022/3401121 https://arxiv.org/pdf/2109.10238.pdf
  * [2] The On-Line Encyclopedia of Integer Sequences, published electronically at https://oeis.org. Sequence A228056. https://oeis.org/A228056
  * [3] Pegg, Ed Jr. “Bouniakowsky Conjecture.” From MathWorld–A Wolfram Web Resource, created by Eric W. Weisstein. https://mathworld.wolfram.com/BouniakowskyConjecture.html


# Disassemblable Fieldwork CT Scanner Using a 3D-printed Calibration Phantom

Florian Schiffers, Thomas Bochynek, André Aichert, Tobias Würfl, Michael
Rubenstein, Oliver Cossairt F. Schiffers and T. Bochynek are with the
Department of Computer Science, Northwestern University, IL, Evanston, 60201,
USAM. Rubenstein and O. Cossairt are with the Department of Computer Science
and Electrical and Computer Engineering, Northwestern University, IL,
Evanston, 60201, USAA. Aichert is with Digital Technology Innovation, Siemens
Healthineers, Erlangen, GermanyT. Wuerfl is with the Chair of Pattern
Recognition, FAU Erlangen, Germany.Corresponding author:
<EMAIL_ADDRESS>
###### Abstract

The use of computed tomography (CT) imaging has become of increasing interest
to academic areas outside of the field of medical imaging and industrial
inspection, e.g. to biology and cultural heritage research. The pecularities
of these fields, however, sometimes require that objects need to be imaged on-
site, e.g., in field-work conditions or in museum collections. Under these
circumstances, it is often not possible to use a commercial device and a
custom solution is the only viable option. In order to achieve high image
quality under adverse conditions, reliable calibration and trajectory
reproduction are usually key requirements for any custom CT scanning system.
Here, we introduce the construction of a low-cost disassemblable CT scanner
that allows calibration even when trajectory reproduction is not possible due
to the limitations imposed by the project conditions. Using 3D-printed in-
image calibration phantoms, we compute a projection matrix directly from each
captured X-ray projection. We describe our method in detail and show
successful tomographic reconstructions of several specimen as proof of
concept.

###### Index Terms:

Industrial CT, low-cost calibration, disassemblable CT scanner.

##  I Introduction

When computed tomography (CT) was invented in 1971 it quickly became an
essential tool for non-destructive testing and medical diagnosis. The
proliferation of CT hardware and software in recent decades has promoted
widespread interest from the greater scientific community, finding new
applications in a broad range of fields such as cultural heritage [1, 2] and
biology [3].

While industrial CT applications often feature optimized and standardized
imaging setups that allow high-throughput imaging, e.g. in a hospital setting
or a production line, the scientific community operates under a fundamentally
different set of constraints than medical and industrial applications. For
instance, biological and cultural heritage research often prohibits samples
from being transported to the nearest CT facilities, requiring scanning on-
site.

Under these circumstances existing commercial products are unsuitable, and a
custom-built, portable system is necessary. Of particular interest here is the
case where the imaging system must be shipped between sessions, and repeated
calibration is necessary. As a potential solution to this problem, Aichert
_et al._ [4] proposed an online geometry calibration method using in-image
fiducial markers for flat-panel computed tomography based on projective
invariants that can be easily realized with a 3D-printed metal bead phantom.
They demonstrate a simulation-based proof-of-concept for a calibration phantom
designed for computing both extrinisic and intrinsic camera parameters from a
single projection image.

This paper describes the construction of a novel and disassemblable cone-beam
computed tomography (CBCT) scanner, which for the first time, applies the
calibration method proposed in [4]. We show reconstructions of biological
specimen imaged on Barro Colorado Island, a remote, tropical island in Panama.
This work demonstrates that customized imaging and calibration setups allow
for the acquisition of industry-standard quality images under demanding
imaging environments.

(a) Cross-Ratio

(b) Cross-section to calculate relative distances

Figure 1: Schematic principle of the projective invariant.

##  II Methods

###  II-A Cone Beam Projection Model

The most popular trajectory takes the shape of an arc of a circle. Such
trajectories depend on few parameters compared to the calibration of the
geometry of each projection image [5, 6]. Therefore it is appealing to assume
an ideal smooth trajectory and calibrate only those parameters as opposed to
estimating a geometry for each projection image independently. This
simplification, however, comes at the cost of no longer being able to
compensate for deviations from this ideal smooth trajectory. An alternative is
to describe each projection matrix independently e.g. [5]. For those methods,
the image formation of a conventional X-Ray source with a cone beam and flat-
panel detector is typically modeled as a projection matrix.

In an industrial CT setup, the focal length of the system and the principal
point, which is the intersection of the orthogonal projection of the source to
the detector, are stable because the source and detector do not move during
the acquisition. Therefore the intrinsic camera parameters can be measured as
fixed in the whole system, and only the extrinsic camera parameters need to be
determined for each projection.

(a) 3D-printed markers with unique metal bead placement to achieve different
cross-ratios.

(b) Sample container with calibration phantom consisting of ten calibration
markers

Figure 2: 3D-printed calibration markers, in detail and assembly.

###  II-B Estimation of Geometric Parameters

A significant challenge for tomographic calibration is to build a 3D-phantom
with interest points that can be uniquely identified under a projective
transformation in different projections. A pair of coordinates of the same 3D
interest point in the projections are called corresponding points and the
problem of computing them is commonly referred to as the correspondence
problem. Strobel  _et al._ [7] proposed the _PDS-2_ phantom where binary codes
of small metal beads are encoded to solve the correspondence problem. Choi
_et al._ [8] solve this problem using the assumption that markers only move a
small distance in successive projections.

These and similar methods usually acquire a dedicated calibration scan, since
CT scanners are manufactured to consistently reproduce the same motion.

In contrast, Aichert  _et al._ [4, 9] present a method relying on the cross-
ratio to solve the correspondence problem. If the phantom is present in the
acquisition the method can be used to calculate a projection matrix for each
X-Ray projection, which removes the necessity of reproducible trajectories.
This approach meets the requirement of robust reconstruction under demanding
field conditions. Each phantom consists of multiple, short calibration
elements of four uniquely spaced metal beads each.

These elements can be arranged arbitrarily within the projection space but in
fixed relation to the sample (e.g. by attaching them to a sample container).
The respective cross-ratio of the metal beads, depicted in Fig. 1, is used as
a scalar descriptor for each such calibration element. It is defined by the
distances $a,b,c,d$ $\in\mathbb{R}$ between the four metal beads in a linear
arrangement.

$\text{cr}(a,b,c,d):=\frac{(a-c)\cdot(b-d)}{(a-d)\cdot(b-c)}\,.$ (1)

Because this number is invariant to perspective projection, it can be used to
identify corresponding points in different projections. A RANSAC-based
algorithm is used to estimate all geometric parameters from a single image.
For a detailed discussion of the mathematical methodology and how the cross-
ratio is used for calibration, we refer to [4].

###  II-C Phantom Design and Manufacture

We fabricated ten calibration elements of six-centimeter length, each
containing a unique arrangement (and thereby cross-section) of four metal
beads. To provide directionality, the diameter of the lower-most bead was
twice that of the remaining beads (i.e., 3.2 mm and 1.6 mm, respectively).

We 3D-printed the base marker shape from Polylactic acid. Metal ball bearings
were press-fitted into predefined recesses. Fig. 2(a) exemplary shows five of
those calibration sticks. The assemblage of the ten sticks in 3D space is such
that at least three are fully visible on the detector for any projection image
of the trajectory.

We placed five of these calibration elements, each to both the top and bottom
of the sample container, see Fig. 2(b). Equidistant arrangement of the
elements ensured that there would be three markers identifiable for any
projection image of the trajectory, removing marker overlap as a possible
complicating factor. To avoid overlap of markers and the sample specimen, we
reserve the top and bottom of the projection for the calibration phantom. Note
that this effectively trades image information for a reliable and accurate
online estimation of geometric parameters.

(a) CT of 3D-printed calibration phantom with metal beads.

(b) Extracted 3D positions of metal beads.

Figure 3: The 3D-printed calibration is imaged with a commercial CT scanner at
a hospital. The 3D locations of the metal beads are extracted from DICOM-
series.

###  II-D Hospital CT-scan of Calibration Phantom

The algorithm proposed in [4] requires knowledge of the exact 3D positions of
all beads in the phantom. While it is known from computer vision that these
positions could be inferred algorithmically, we instead acquired a reference
scan of the whole calibration phantom with a commercial CT scanner in the
Northwestern Memorial Hospital (see Fig. 3(a)).

The spheres are identified from the DICOM series via the application of the
connected components method. Subsequently we calculate the center of mass of
each sphere as shown in Fig. 3(b). Note, that the marker accuracy is given not
by the accuracy of the 3D-printing process, but by the identification of the
circle centers.

###  II-E Experimental Setup

Figure 4: Computer model of the scanner setup. Mount for the X-Ray source
(left) and rotation stage (center right) are fabricated from 3D-printed
components. See text for details on the used components.

The CT scanner setup (see Fig. 4) is composed of four main components: The
imaging container with the calibration phantom is located inside an 80/20
T-slot aluminum-frame cabinet, which is shielded by fused lead/steel plates
for radiation protection. We used a Imaging M-113T X-Ray tube and a Varex
Imaging XRD 4343 Digital X-Ray detector for radiation generation and
detection. A rotation stage, driven by a 1000:1 Micro Metal Gearmotor HP 6V,
rotated the imaging container around its axis. Rotation stage, X-Ray tube, and
X-Ray detector were controlled and synchronized via an Arduino Uno
microprocessor.

A single 3D scan consisted of approximately 450 exposures of the rotating
imaging container at a rate of 4.5 exposures per second. A single exposure
consisted of a 10.6 ms X-Ray burst at 40 keV energy and 125 mA current
supplied by a Spellman PMX 5kW X-Ray generator.

##  III Reconstruction pipeline

We implemented the reconstruction pipeline in Python and embedded our pipeline
into the open-source framework of pyCONRAD
(https://git5.cs.fau.de/PyConrad/pyCONRAD) which natively supports arbitrary
trajectories via projection matrices [10]. Since pyCONRAD has the full GPU
functionality of CONRAD, fast reconstruction with the GPU-accelerated back-
projector is possible. For reconstruction, we use the Feldkamp algorithm [11].

###  III-A Image Pre-Processing

Raw images are normalized using the following normalization equation:

$f=\frac{I-I_{Dark}}{I_{0}-I_{Dark}}$ (2)

where $I$ denotes the measured intensity with the object, $I_{0}$ the
reference intensity without object, and $I_{Dark}$ the measured dark-image.

Our detector has approximately 100 permanent defect pixels which either report
full or zero intensity in every exposure. If not accounted for, these pixels
will result in strong ring-artifacts in the reconstructions. We hence detect
those pixels with a prior calibration measurement and correct them using
OpenCV’s inpainting method.

###  III-B High resolution volume reconstruction

Our detector allows for a resolution of up to $3000\times 3000$ pixels,
generating large volumes of data of both raw data and reconstructions. For
example, a reconstructed volume of $2000^{3}$ with float precision requires
approximately $32$ GB of storage space. PyCONRAD does not natively support
reconstruction volumes of this size because it is limited by the GPU memory.
Reconstruction of large high-resolution volumes was achieved by successively
reconstructing and storing smaller volume subsets.

###  III-C Results

Figure 5 shows an example of an online-calibration with bead detection,
feature matching using the cross-ratios, and successful geometric calibration
for two different views. The complete trajectory was calibrated and is
visualized in Fig. 7. Example tomographic reconstructions and renderings for
four specimens found on-site at the Barro Colorado Island are shown in Fig. 6.

(a) Projection image 1

(b) Projection image 2

(c) Close-up showing reprojection error 1

(d) Close-up showing reprojection error 2

Figure 5: (a,b) Projection images with biological specimen (Annona purpurea
fruit) and calibration markers. Detected calibration elements and the derived
local coordinate system are shown in the center of each image. (c,d) show a
zoomed version for better visualization of the detected beads’ reprojection.

(a) Tamiasciurus sp.  squirrel skull

(b) Alouatta palliata: howler monkey skull

(c) Nausititermes sp.  termite nest

(d) Alouatta palliata: tropical fruit

Figure 6: Example reconstruction from our tomographic scanner. Left:
Tomographic slice; right: volume rendering.

(a) Calculated source position

(b) Calculated trajectory

Figure 7: Visualization of the trajectory calculated online during a
tomographic scan. The image reveals that the source positions do not form
perfect sinusoids, and the angular spacing is not equidistant. While this
would be a challenge to a one-time calibrated setup, the online calibration we
employ compensates for these inaccuracies.

##  IV Discussion and Conclusion

We constructed a 3D CT scanner and online calibration phantom from commonly
available materials using 3D printing as a key manufacturing method. While the
methods we employ in the construction process might not meet the high-accuracy
manufacturing requirements applied to medical devices, we still obtain high-
quality 3D reconstructions. In contrast to one-time calibrated and commercial
scanners, our setup is resilient to adverse conditions, disassemblable for
transport to remote locations, and was successfully operated for field-work in
a tropical environment. We intend that this paper can serve as a guideline for
interested parties to develop their own applications.

Future research directions include reducing the amount of detector space
required for online calibration, employing bundle-adjustment to lift the
requirement of a prior CT-scan of the calibration phantom, using our
methodology on a theoretically complete trajectory like a helix, additional
artifact reduction techniques, such as beam-hardening correction, as well as
the use of image-based calibration correction methods.

## References

  * [1] D. Stromer, V. Christlein, X. Huang, P. Zippert, T. Hausotte, and A. Maier, “Virtual cleaning and unwrapping of non-invasively digitized soiled bamboo scrolls,” Scientific Reports, vol. 9, no. 1, pp. 1–10, 2019.
  * [2] M. P. Morigi, F. Casali, M. Bettuzzi, R. Brancaccio, and V. D’Errico, “Application of X-ray Computed Tomography to Cultural Heritage diagnostics,” Applied Physics A: Materials Science and Processing, vol. 100, no. 3, pp. 653–661, 2010.
  * [3] K. Singh, B. P. Muljadi, A. Q. Raeini, C. Jost, V. Vandeginste, M. J. Blunt, G. Theraulaz, and P. Degond, “The architectural design of smart ventilation and drainage systems in termite nests,” Science Advances, vol. 5, no. 3, pp. 1–12, 2019.
  * [4] A. Aichert, B. Bier, L. Rist, and A. Maier, “Projective invariants for geometric calibration in flat panel computed tomography,” Proc. 5th Intl. Mtg. on Image Formation in X-ray CT, pp. 69–72, 2018.
  * [5] L. Von Smekal, M. Kachelrieß, E. Stepina, and W. A. Kalender, “Geometric misalignment and calibration in cone-beam tomography,” Medical Physics, vol. 31, no. 12, pp. 3242–3266, 2004.
  * [6] M. J. Daly, J. H. Siewerdsen, Y. B. Cho, D. A. Jaffray, and J. C. Irish, “Geometric calibration of a mobile C-arm for intraoperative cone-beam CT,” Medical Physics, vol. 35, no. 5, pp. 2124–2136, 2008.
  * [7] N. K. Strobel, B. Heigl, T. M. Brunner, O. Schuetz, M. M. Mitschke, K. Wiesent, and T. Mertelmeier, “Improving 3D image quality of x-ray C-arm imaging systems by using properly designed pose determination systems for calibrating the projection geometry,” Medical Imaging 2003: Physics of Medical Imaging, vol. 5030, no. June 2003, p. 943, 2003.
  * [8] J. H. Choi, A. Maier, A. Keil, S. Pal, E. J. McWalter, G. S. Beaupré, G. E. Gold, and R. Fahrig, “Fiducial marker-based correction for involuntary motion in weight-bearing C-arm CT scanning of knees. II. Experiment,” Medical Physics, vol. 41, no. 6, pp. 1–16, 2014.
  * [9] A. Aichert, T. Würfl, and A. K. Maier, “Method and device for determining a geometry calibration for an imaging device and also method for determining assignment data for the geometry calibration,” 2019.  US Patent Application US2019/0355156 A1.
  * [10] A. Maier, H. G. Hofmann, M. Berger, P. Fischer, C. Schwemmer, H. Wu, K. Müller, J. Hornegger, J. H. Choi, C. Riess, A. Keil, and R. Fahrig, “CONRAD - A software framework for cone-beam imaging in radiology,” Medical Physics, vol. 40, no. 11, 2013.
  * [11] L. a. Feldkamp, L. C. Davis, and J. W. Kress, “Practical cone-beam algorithm,” Journal of the Optical Society of America A, vol. 1, p. 612, jun 1984.