---
title: "SEPRG — paper by Firdaus et al. (2021) — summary and ideas"
description: "SEPRG uses conversation sentiment, speaker profiles, and a requested emotion to generate replies, then tests how well those replies fit."
canonical: "https://research.elamur.ai/free/en/papers/firdaus-2021-seprg-sentiment-aware-emotion-controlled/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Shryfti](https://md.shryfti.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/firdaus-2021-seprg-sentiment-aware-emotion-controlled/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2021](https://md.research.elamur.ai/free/en/papers/2021/) / SEPRG: Sentiment aware Emotion controlled Personalized Response Generation

# SEPRG: Sentiment aware Emotion controlled Personalized Response Generation

Paper · 2021 · Mauajama Firdaus, Umang Jain, Asif Ekbal et al.

**Authors:** [Mauajama Firdaus](https://md.research.elamur.ai/free/en/authors/mauajama-firdaus/), [Umang Jain](https://md.research.elamur.ai/free/en/authors/umang-jain/), [Asif Ekbal](https://md.research.elamur.ai/free/en/authors/asif-ekbal/) and [Pushpak Bhattacharyya](https://md.research.elamur.ai/free/en/authors/pushpak-bhattacharyya/) · **Year:** 2021 · **Venue:** Proceedings of the 14th International Conference on Natural Language Generation · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

Proceedings of the 14th International Conference on Natural Language Generation · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/2021.inlg-1.39/)
- [PDF](https://aclanthology.org/2021.inlg-1.39.pdf)
- [DOI 10.18653/v1/2021.inlg-1.39](https://doi.org/10.18653/v1/2021.inlg-1.39)

## Summary

A reply can remember who is speaking and still pass over the most important thing the other person has just said. In one of the paper’s examples, a speaker introduces a pet turtle by name. A reply about preferring cats can fit the responding speaker’s profile, but it does little with the introduction. SEPRG studies how to generate a reply that can acknowledge the other person’s contribution, express an appropriate emotion, and stay consistent with the responder’s profile. The task brings together concerns usually discussed separately in [dialogue systems](https://md.research.elamur.ai/free/en/topics/dialogue-systems/).

The authors distinguish the sentiment of what has already been said from the emotion the next reply is asked to express. Sentiment describes the tone of a previous turn as positive, negative, or neutral. The requested emotion is more specific, such as joy or surprise, and is supplied as a separate input. SEPRG encodes the previous turns and the speaker’s profile with separate Transformer encoders, attaches sentiment information to the turn representations, and gives a recurrent decoder the requested emotion each time it generates a token. The experiments use an emotion-annotated version of the PersonaChat benchmark, to which the authors add sentiment labels through a combination of automatic mapping and human judgment.

On the automatic evaluation, the full system recorded a BLEU-4 score of 0.143 and an emotion accuracy of 0.715. The strongest comparison using a hierarchical recurrent architecture with the same kinds of input scored 0.127 and 0.689, respectively. Human raters judged the full system’s replies emotionally appropriate in 65% of cases, persona-consistent in 67%, and sentiment-coherent in 62%. The system also scored highest among the evaluated systems on fluency and relevance. In the Transformer ablation, adding sentiment labels to a system already supplied with persona and emotion improved every reported automatic score.

These tests support conditioning a reply on both what has happened in the conversation and how the reply is intended to sound. The results are about individual replies produced under benchmark conditions. The requested emotion is supplied, so choosing it autonomously is a separate problem. Higher persona consistency also leaves room for direct contradictions. The authors show a reply that expresses dislike of children in spite of a profile that says the speaker enjoys spending time with their children.

## Deep dive: SEPRG: Sentiment aware Emotion controlled Personalized Response Generation

SEPRG uses conversation sentiment, speaker profiles, and a requested emotion to generate replies, then tests how well those replies fit. · about 34 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### Giving a reply a speaker and a tone

A personal assistant can carry out a request and be judged by whether the requested action succeeded. The authors are interested in social conversation, where the purpose of an exchange can include keeping someone company or learning about them. In this setting, the way a reply follows from the preceding turn matters in its own right. The authors frame emotional responsiveness and a consistent personality as desirable properties of social [chatbots](https://md.research.elamur.ai/free/en/concepts/chatbot/).

PersonaChat makes one part of that problem concrete. A persona is supplied as a set of short statements about a speaker. Those statements can describe work, hobbies, preferences, or other aspects of the role the speaker has been assigned. A dialogue can then reveal some of the information in the profile as the participants get to know each other. In the paper’s example involving two people discussing their jobs, the conversation can draw on facts about looking after children, playing guitar, and welding. A system with access to those facts has a source of information about who is supposed to be speaking. The benchmark provides the conversation and the persona texts as distinct inputs. PersonaChat

The speaker’s profile and the most recent conversational turn serve different purposes. A profile can tell the responder that a particular activity fits the role. The latest turn helps determine whether there is any reason to bring that activity up. When a participant shares something about their profession, an acknowledgment can connect the response to that disclosure before the responder offers a fact about themselves or asks a question. Choosing when to use a detail is part of the task. Repeating a piece of profile information on every turn would leave much of the conversation unanswered.

The authors use the difference between sentiment and emotion to make this second aspect of response generation more manageable. They draw on prior work that treats sentiment as frequently more enduring and directed at a target, while an emotion can be a shorter episode with or without a specific target. In SEPRG’s data, sentiment is represented by broad polarity categories and emotion by more specific labels. The categories overlap in meaning without providing the same degree of detail. A broad positive label is compatible with several possible emotional expressions. The resulting task belongs to the study of [sentiment and emotion](https://md.research.elamur.ai/free/en/topics/sentiment-emotion/).

Surprise makes the distinction especially easy to see. Learning something unexpected can be welcome, unwelcome, or mostly a matter of curiosity. An emotion label of surprise therefore gives too little information to assign the utterance a polarity mechanically. Conversely, an utterance already labeled positive leaves several possibilities for a fitting reply. The authors’ proposal uses prior sentiment to narrow the context in which a requested emotion is expressed. It does so without defining a rule that every utterance of a particular polarity must receive a reply with the same emotion.

This setup gives the paper a practical meaning for emotional control. The system can be asked to generate the next turn with a specified emotion. Its job is to find words that express that emotion while responding to the existing exchange and respecting the speaker’s profile. A general account of empathy would also need to ask when an emotion is appropriate and what the other participant experiences. SEPRG’s design makes the generation problem tractable by taking the requested emotion as part of the task input.

#### How earlier dialogue work handled those inputs

The paper traces its generation setup to work on neural conversational systems and sequence-to-sequence learning. In the basic encoder–decoder design, one component represents the input text and another produces a response from that representation. For an exchange with several turns, the earlier hierarchical work discussed by the authors provides a way to represent the structure of the conversation as well as the words. These approaches supply the basic sequence-to-sequence and hierarchical comparisons in the experiments. [Sequence to Sequence Learning with Neural Networks](https://md.research.elamur.ai/free/en/papers/sutskever-2014-sequence-sequence-learning-neural-networks/), [A Hierarchical Latent Variable Encoder-Decoder Model for Generating Dialogues](https://md.research.elamur.ai/free/en/papers/serban-2016-hierarchical-latent-variable-encoder-decoder/)

Earlier personalization work approached speaker identity in several ways. One system represented speakers with learned embeddings, which are vectors used to carry information into the response generator. PersonaChat made the information available as text, giving a system a short written description to work from. The paper also describes work that adapted a generator to supplied persona information through meta-learning, alongside work that used a hierarchical pointer design to draw on relevant source text. Other work used a conditional variational autoencoder to produce a wider range of replies grounded in the profile. [A Persona-Based Neural Conversation Model](https://md.research.elamur.ai/free/en/papers/li-2016-persona-based-neural-conversation-model/), [Personalizing Dialogue Agents via Meta-Learning](https://md.research.elamur.ai/free/en/papers/madotto-2019-personalizing-dialogue-agents-meta-learning/)

There was already interest in personalization for conversations with a practical goal. The authors discuss work that supplied persona information in a task-oriented dialogue dataset and work that used conditional variational techniques for personalized generation. The needs of a goal-oriented interaction can include tailoring a response to a user’s preferences. In open-domain conversation, the paper gives the profile an additional role in maintaining a recognizable speaker across an exchange whose topic is free to change.

The work on emotional replies had its own set of mechanisms. The authors discuss an Emotional Chatting Machine built on a sequence-to-sequence design, work using lexicon-based attention to generate a specified emotion, and an approach that incorporated emotional embeddings and affect-sensitive choices during generation. They also describe their own earlier work that combined persona information with controllable emotions. That earlier combination matters for reading SEPRG. The new comparison is against systems that can already take an emotion and a profile, as well as simpler systems driven only by the conversation.

The paper’s account of earlier work also mentions adversarial techniques for dialogue generation. The concrete SEPRG design is described through separate encoders, attention, a recurrent decoder, and likelihood training. The methodological detail that connects the problem to the experiments is the addition of sentiment at the level of previous utterances. Given a profile and an emotion for the response, the generator also sees an explicit signal about the tone of the conversation leading up to it.

### The method, step by step

#### What goes into a reply

Start with a conversation stopped just before someone is about to answer. SEPRG receives the previous turns, a sentiment label associated with each turn, the profile of the speaker whose reply it is generating, and a desired emotion for that reply. The previous turns provide the subject and progression of the conversation. The labels describe the tone of those turns. The profile supplies personal facts that the responder can draw on. The emotion is a control for the words about to be generated.

Consider the paper’s example of a conversation about pets. The other participant has introduced a turtle and supplied its name. The person who is to reply has a profile describing a fondness for cats. A response can first acknowledge the turtle’s name and then mention the speaker’s preference for cats. The conversation and profile justify different parts of that response. The emotion control can influence the language of the acknowledgment, and the sentiments of the previous turns provide evidence about how that language will fit the exchange.

The design processes the dialogue and the profile separately before drawing on both in generation. Each encoder uses a Transformer, which in this paper builds contextual representations by letting positions attend to other positions through several attention heads. A feed-forward transformation then operates on the resulting representations. The encoder layers also use residual connections, which carry a layer’s input forward alongside its transformation, and layer normalization, which helps control the scale of activations. The decoder generates a sequence through recurrent state updates. [Transformer and attention](https://md.research.elamur.ai/free/en/concepts/transformer/)

How SEPRG generates a reply The steps in order.

The paper represents the input conversation as an ordered sequence.

```
D = [U_1, U_2, …, U_N]
```

Here `D` denotes the dialogue context, `U_i` is a prior turn at position `i`, and `N` is the number of turns in that context. The brackets mark an ordered collection, and the ellipsis stands for the intervening turns. Order matters because a later clarification or reaction may change the significance of what was said earlier.

```
U_n = [w_1, w_2, …, w_k]
```

Here `U_n` is the turn at position `n`, `w_j` is the word at position `j` inside that turn, and `k` is the number of word positions in the turn. The ellipsis covers the intervening words. In the encoder equations below, the word symbol carries a turn index as well as a position index so the two kinds of order are easy to tell apart.

```
S_lab = [s_1, s_2, …, s_N]
```

Here `S_lab` is the sequence of sentiment labels, `s_i` is the sentiment at turn position `i`, and `N` indexes the final turn in `D`. Each label corresponds to a place in the dialogue. It summarizes a property of that prior turn, while the words of the turn remain available through the encoder.

```
P = [P_1, P_2, …, P_m]
```

Here `P` is the profile supplied for the response speaker, `P_i` denotes a piece of persona text at index `i`, and `m` is the number of entries in that profile. The ellipsis covers the intervening entries. The content of these entries can be relevant at different points in the discussion, but all belong to the same supplied persona.

```
Y = [y_1, y_2, …, y_n′]
```

Here `Y` denotes the generated reply, `y_t` is its token at decoding position `t`, and `n′` marks the final position in the reply. The notation distinguishes reply length from the length of the dialogue context or the profile. The other generation input is `E`, the desired emotion, represented for the decoder by an embedding `V_e`.

#### Encoding the conversation and attaching sentiment

The turn encoder starts with a word vector and a position vector at every word position. The word vector gives the encoder a continuous representation on which to operate. The position vector gives it information about where that word occurs. SEPRG uses pretrained [GloVe](https://md.research.elamur.ai/free/en/concepts/glove/) vectors for words.

```
T_u = (t_i¹, t_i², …, t_i^|U_i|), with t_iʲ = e(w_iʲ) + p_j
```

Here `T_u` is the input vector sequence for dialogue turn `U_i`, and `|U_i|` is the length of that sequence. The index `i` identifies the turn and `j` the position within it. The symbol `w_iʲ` denotes the word at that position, `e` is the word-embedding lookup, and `p_j` is the positional vector for that word position. The plus sign denotes addition, producing the vector `t_iʲ` supplied to the encoder. The ellipsis covers word positions between the displayed terms.

The paper uses sine and cosine positional values. This makes the position signal available without learning a separate set of positional parameters. A turn enters the Transformer as a sequence, and the Transformer returns a contextual vector for each place in it. The paper summarizes the utterance with the vector at the end-of-sequence token, or EOS. Because the encoder has processed the turn through self-attention, that last vector can carry information gathered from other positions in the same utterance.

```
h_iˢ = h_i^|U_i| + p_i
```

Here `h_i^|U_i|` is the encoder’s hidden vector at the final position of turn `U_i`, whose length is indicated by `|U_i|`. The vector `p_i` now represents the position `i` of the turn in the dialogue. Their sum `h_iˢ` represents the utterance text with its position in the larger exchange. The paper shares the positional embedding matrix used for words and for utterances. The distinction between their indices comes from where those positions are used.

At this point the system has a representation for each turn that reflects its words and its place in the conversation. The addition proposed by SEPRG is to attach sentiment to that representation. The surrounding description calls the operation concatenation, which joins the components into a longer vector. Written to follow that description, the turn representation is as follows.

```
h_iᵘᵗᵗ = [h_iˢ ; s_i]
```

Here `h_iᵘᵗᵗ` is the resulting representation of turn `i`, `h_iˢ` is its position-aware textual representation, and `s_i` is the representation of the sentiment associated with that turn. The semicolon inside the brackets indicates concatenation. The paper’s displayed sentiment expression uses a plus sign and writes `s_N`; its prose specifies concatenation with the sentiment of each sentence. The notation here follows that per-turn description. The paper gives the sentiment categories more clearly than it specifies the vector representation of the categories.

The aim of joining the two signals is to keep the wording and tone of a turn accessible together. A neutral question and a positive disclosure can both be relevant to the next reply. When the decoder attends to either turn, the attended representation contains both the contextual information derived from the text and the accompanying label. A sentiment label on the conversation as a whole would provide different information, since a single label could not identify which part of the exchange bore that tone.

#### Encoding the profile

The other Transformer processes the speaker’s profile. Its input also begins with word and position vectors. The words of a profile statement can then contribute to a contextual representation of that statement. By keeping this encoder separate, the architecture preserves the distinction between what has been said in the dialogue and what is supplied as background about the next speaker.

```
T_p = (t_i¹, t_i², …, t_i^|P_i|), with t_iᵏ = e(w_iᵏ) + p′_k
```

Here `T_p` denotes the input sequence for a piece of persona text `P_i`, with length `|P_i|`. The indices `i` and `k` identify the persona entry and the word position in it. The symbol `w_iᵏ` is the word at that position, `e` gives its GloVe vector, `p′_k` is the position vector used on the persona side, and `t_iᵏ` is the sum supplied to the persona encoder. The ellipsis stands for the intermediate vectors. This uses `P_i` throughout for the entry being encoded, where the paper’s equations use `P_m` in the length index. The prime distinguishes persona-side position notation.

```
h_iᵖ = h′_i^|P_i| + p′_i
```

Here `h′_i^|P_i|` denotes the persona encoder’s hidden representation at the end-of-sequence position of entry `P_i`. The notation `|P_i|` gives its length, and the prime on `h′` identifies a persona-encoder state. The vector `p′_i` identifies the entry’s position, and `h_iᵖ` is the resulting positional persona representation. As on the dialogue side, the last encoder state summarizes the text being encoded and the positional vector is added to that state.

The paper describes the persona input as a set of statements and uses an end representation to carry persona information forward to the decoder. Its equations give the construction for the text being represented, while the prose identifies the encoded profile as an input to token prediction. Details of how to assemble the entries into a single decoder-side input are less explicit. The substantive distinction is that the decoder can draw on information about the speaker beyond facts already disclosed in the previous turns.

The profile they supplied offers evidence of the part the next speaker is expected to play. In the pet example, it gives support for a statement about liking cats. It leaves the conversational reason for mentioning cats to the generator, which also has access to the other speaker’s introduction of the turtle. The separate inputs let the decoder use the profile to decide what personal claim is available and the conversation to decide where it could fit.

#### Generating a token from context and emotion

The decoder section specifies a gated recurrent unit, or GRU. A GRU updates a hidden state as generation proceeds, giving the decoder a running representation that can carry forward information from the preceding steps. The first equation gives the update before the emotion control is added.

```
hᵈᵉᶜ_d,t = GRU_d(y_k,t−1, h_d,t−1)
```

Here `hᵈᵉᶜ_d,t` is the decoder state at step `t`, `d` indexes the decoding component, and `GRU_d` is its recurrent update. The quantity `y_k,t−1` is the preceding token input, with `k` identifying the response sequence and `t−1` the preceding step. The quantity `h_d,t−1` is the preceding decoder state. A recurrence of this kind lets the token chosen at one step affect the predictions at later steps through both the next token input and the continuing hidden state.

At each step the decoder uses its state as a query for attention over the encoded dialogue. A query is the vector against which the available context vectors are scored. A softmax converts those scores into weights that sum to one across the available positions. SEPRG uses a trainable matrix between the dialogue representation and the decoder state in the scoring operation. The paper associates the decoder’s attention and input-feeding approach with [Effective Approaches to Attention-based Neural Machine Translation](https://md.research.elamur.ai/free/en/papers/luong-2015-effective-approaches-attention-based-neural/).

```
α_t = softmax(D̂ W_f h_d,t)
```

Here `α_t` is the vector of attention weights at decoding step `t`, `D̂` is the collection of encoded dialogue vectors arranged for scoring, `W_f` is a trainable weight matrix, and `h_d,t` is the decoder state used as the query. The operation `softmax` normalizes the scores across dialogue positions. The component `α_t,i` is the weight on context position `i`.

```
c_t = ∑_{i=1}^{k} α_t,i D̂_i
```

Here `c_t` is the attended context at step `t`. The summation adds the contribution at each context position `i` from `1` through `k`, where `k` is the number of positions included in this attention operation. The scalar `α_t,i` weights `D̂_i`, the encoded dialogue vector at that position. The indexed vector makes explicit which context representation belongs with each weight in the paper’s sum. A larger weight makes the corresponding turn contribute more to the context used at that step.

Attention can change as a reply unfolds. A decoder acknowledging the turtle’s name might draw strongly on the turn where the name was mentioned. Later in the same reply, the recurrent state reflects the words it has already generated, and the speaker profile can support a turn towards the speaker’s own preferences. The architecture makes that division of labor possible, although the paper’s examples concern the resulting text and do not trace individual attention weights.

```
h̃_t = tanh(W_h̃ [h_d,t ; c_t])
```

Here `h̃_t` is the intermediate representation used to make the prediction at time `t`. The brackets join the decoder state `h_d,t` with the attended context `c_t`. The matrix `W_h̃` is a trainable transformation, and `tanh` applies a nonlinear transformation to the resulting vector. The prose describes persona information as part of the combination for prediction. The displayed equation shows the state and context explicitly, leaving the persona input implicit at this point in the notation.

```
P(y_t | y_<t) = softmax(W_V h̃_t)
```

Here `P(y_t | y_<t)` is the predicted probability for a candidate token `y_t` given the tokens at positions earlier than `t`, denoted by `y_<t`. The architecture conditions those probabilities on the dialogue, profile, and control information as well. The matrix `W_V` maps `h̃_t` to scores over the output vocabulary, and `softmax` converts those scores to a distribution. The probability symbol `P` serves a different purpose here from the symbol `P` for the persona collection.

The emotional control enters the recurrent update at every decoding step. Rather than being needed only to initialize the reply, it is available whenever the decoder forms its next state. For a requested emotion such as joy, a single emotion vector is supplied throughout the generation of that reply.

```
hᵈᵉᶜ_d,t = GRU_d(y_k,t−1, [h_d,t−1 ; V_e])
```

Here `V_e` is the pretrained GloVe embedding for the desired emotion `E`. The brackets concatenate it with the preceding decoder state `h_d,t−1`. The update `GRU_d` takes this combined quantity and the previous token input `y_k,t−1` to produce the decoder state `hᵈᵉᶜ_d,t` for step `t`. The index `k` identifies the response sequence, `d` the decoder, and `t−1` the preceding step. The equation gives the intended conditioning operation. The paper leaves details such as the dimensions of the combined state implicit.

#### Training from reference replies

The training data provide the actual reply that followed each context. At a given generation step, the system is fed the preceding reference tokens. This procedure is called teacher forcing. It lets the decoder learn to assign probability to the next reference token after a correct prefix, even if its own predictions early in training would have taken the sequence in another direction.

```
L_ml = −∑_{t=1}^{m} log p(y_t* | y_1*, …, y_t−1*)
```

Here `L_ml` is the negative log-likelihood objective used for maximum-likelihood training. The reference token at position `t` is `y_t*`, and the starred tokens to the right of the conditioning bar are the preceding reference tokens. The function `p` gives the probability assigned to the reference token after that prefix, with the input context and controls understood. The sum runs from the first position `1` through reference length `m`, and `log` takes the logarithm of each token probability. The minus sign turns low probability on the reference into a larger loss. The symbol `m` refers here to the reply length, independently of its earlier use for the number of persona entries.

At inference, the reference prefix is unavailable. The decoder advances using partial replies that it has generated. Beam search keeps a group of candidate partial replies as generation proceeds so that the resulting sequence can depend on more than the locally highest-scoring token. The paper reports a beam size of 10 for decoding. A requested emotion remains part of the input while those candidate replies are generated.

The authors implemented the systems in PyTorch and used batches of 32 for the proposed architecture and its baselines. For parameter initialization, they used the Gaussian variant of the Xavier scheme. Training used AMSGrad, which the authors chose to address slow convergence, and dropout with probability 0.45. Dropout temporarily removes some activations during training as a form of regularization. [On the Convergence of Adam and Beyond](https://md.research.elamur.ai/free/en/papers/reddi-2019-convergence-adam/), [Dropout: A Simple Way to Prevent Neural Networks from Overfitting](https://md.research.elamur.ai/free/en/papers/srivastava-2014-dropout-simple-way-prevent/)

The authors also report uniform label smoothing with a setting of 0.1. Label smoothing gives the target distribution some weight outside the reference token during training. They clipped the gradient when its norm exceeded 5, limiting the size of unusually large gradient updates. To reduce the number of distinct surface forms the system had to handle, they replaced numbers with `<number>` and personal names with `<person>`. That preprocessing choice matters when interpreting examples involving an individual, a pet’s name, or a numerical biographical fact.

### Experiments and results

#### The conversations and their added labels

The experiments use ConvAI2, described by the authors as an extension of PersonaChat with a new test set. Crowd workers were paired at random and asked to converse in the roles of the supplied personas. The paper describes 10,981 dialogues, 164,356 utterances, and 1,155 profiles, each with at least four persona statements. These are conversations in which people enact written roles. The supplied profile gives reviewers a concrete source against which a response speaker’s claim can be checked.

The dataset description identifies a testing set of 1,016 dialogues and mentions 200 previously unseen personas. The dataset statistics table separately gives 7686 train dialogues, 1640 validation dialogues, and 1655 test dialogues. The table’s utterance counts are 124,816 for train, 19,680 for validation, and 19,860 for test. The prose and table thus give different descriptions of the test set. The paper leaves the relationship between those counts unresolved, so the results are best read as the authors’ reported PersonaChat evaluation without assigning each score to a more specific split construction.

In the statistics table, the average dialogue lengths in turns are 12.51 for train, 12.73 for validation, and 12.74 for test. The mean response lengths in words are 11.89, 9.57, and 10.75 for those splits, respectively. The table’s emotions-per-dialogue column gives 7.4 for train, 6.5 for validation, and 5.1 for test. Those entries describe the collection on which the experiments are based. The paper does not use them to report separate performance by dialogue length or by the amount of emotional variation in an exchange.

The authors start from an emotion-annotated version used in their earlier work. To add sentiment, they use the emotion labels as an initial source of evidence. A label such as gratitude or joy is mapped to positive sentiment. Anger, sadness, and jealousy are among the labels mapped to negative sentiment. This procedure automatically gives a broad sentiment label to utterances whose emotion is treated as having a clear polarity.

The authors send cases with context-dependent polarity for human review. Surprise, pride, and nostalgia are among the examples they give. The same emotion label in these cases can accompany different sentiments, depending on what the speaker says and what has happened in the exchange. Four graduate students proficient in English received guidelines and examples, and the final label was chosen by majority vote. The authors report a Fleiss’ kappa of 0.75 for sentiment labeling. Fleiss’ kappa assesses agreement between raters beyond what would be expected by chance. [Linguistic annotation](https://md.research.elamur.ai/free/en/concepts/annotation/)

The dataset work puts different labels on different parts of the generation problem. The earlier emotion annotations make emotional categories available for the response task. The new sentiment annotations give the encoder a polarity label for dialogue turns. Some of these labels come directly from a mapping of emotion to sentiment, and the rest of the labeling procedure incorporates human judgments about context. The added signal therefore reflects both the earlier label scheme and the authors’ decisions about which emotional categories call for contextual review.

#### What the comparisons hold in common

The simplest baseline is Seq2Seq, a basic sequence-to-sequence encoder–decoder. HRED, the other basic baseline, uses a hierarchical encoder–decoder to represent dialogue context. Both generate without direct access to persona, sentiment, or emotion inputs. These systems show how the underlying generation approaches behave when the dialogue itself is their source of information.

The authors add persona and a desired emotion to each of those recurrent baselines. In the results, `E` means emotion and `P` means persona. These versions have access to the profile and can condition generation on the desired emotion. A further version of each baseline receives sentiment as well, indicated by `S`. This gives the authors comparisons within the same basic architectural family while changing which information is supplied.

The full SEPRG system is `Trans + E + P + S`. The paper also runs `Trans`, its plain Transformer comparison, and `Trans + E + P`, which uses the Transformer encoders with persona and emotion. These variants help test whether gains attributed to the full design also appear when information is added within the Transformer family. The automatic results include those variants. The reported human evaluation compares the full system with the recurrent baselines.

These comparisons address changes at different levels. Comparing the complete Transformer-based system with basic Seq2Seq changes the architecture as well as the supplied inputs. Comparing the complete system with the hierarchical baseline supplied with sentiment, emotion, and persona keeps the types of conditioning information in common. Within the Transformer comparison, the versions with and without sentiment on top of emotion and persona give a more focused test of the additional turn labels.

#### What the automatic scores measure

Perplexity reports how well the system predicts the reference text in probabilistic terms. Lower perplexity means the system assigns more probability to the observed sequence under the scoring procedure. This can be relevant to the quality of the text it generates, but the metric is computed using the reference. Human fluency ratings address more directly whether the actual replies read naturally.

BLEU-4 measures overlap between generated replies and references using word sequences, or n-grams. In this study it provides one view of how much reference wording and content survives in the generated reply. ROUGE-L provides another view through a shared subsequence, which can retain words in their original order despite intervening differences. Both depend on the wording of the particular reference. [BLEU score](https://md.research.elamur.ai/free/en/concepts/bleu/), [ROUGE](https://md.research.elamur.ai/free/en/papers/lin-2004-rouge-package-automatic-evaluation-summaries/)

Distinct-1 and Distinct-2 count distinct individual tokens and distinct adjacent token pairs, respectively, and scale those counts by the total number of generated tokens. These scores indicate how much repetition occurs at those lengths in the generated material. A higher score can accompany more varied language. Whether the variation helps the reply depends on what the different expressions say and how they fit the conversation. [N-gram](https://md.research.elamur.ai/free/en/concepts/n-gram/)

For emotion accuracy, the authors apply a pretrained BERT classifier to generated replies. The classifier predicts an emotion from the output text, which the evaluation uses to assess the reply’s emotional content. This supplies a common automatic check across systems. The human emotion appropriateness rating asks a contextual question and is reported separately.

#### Automatic results on PersonaChat

The full system leads the automatic comparison on each reported metric. Its perplexity is 51.92, compared with 52.46 for HRED supplied with emotion, persona, and sentiment. Basic HRED records 55.63 and basic Seq2Seq records 56.11. The progression puts the full system’s reference predictions in context. The best hierarchical comparison already has the same kinds of auxiliary information, while the simpler baselines start from the conversation alone.

PersonaChat automatic evaluation of response overlap by BLEU-4 The complete SEPRG system has the highest reference overlap on this measure.

**The numbers**

| System or setting | BLEU-4 |
| --- | --- |
| Seq2Seq | 0.089 |
| HRED | 0.096 |
| Seq2Seq + E + P | 0.103 |
| HRED + E + P | 0.116 |
| Seq2Seq + E + P + S | 0.115 |
| HRED + E + P + S | 0.127 |
| SEPRG Trans + E + P + S (this paper) | 0.143 |

On ROUGE-L, SEPRG scores 0.266. The hierarchical system with all the auxiliary inputs scores 0.237, and the version with persona and emotion scores 0.224. The plain HRED score is 0.201. The corresponding sequence-to-sequence comparisons are less uniform. Basic Seq2Seq scores 0.196, the persona-and-emotion version scores 0.189, and the version supplied with sentiment as well scores 0.203. Adding information can affect the particular wording a generator chooses, and a gain on one overlap metric can occur alongside a loss on another.

The full system scores 0.0219 on Distinct-1 and 0.0987 on Distinct-2. HRED with emotion, persona, and sentiment records 0.0186 and 0.0590 on the same metrics. Basic HRED records 0.0128 and 0.0469. The difference in the ranking of some intermediate settings shows why the paper reports both measures. HRED with emotion and persona scores 0.0592 for Distinct-2, slightly higher than its sentiment-equipped counterpart, while that counterpart has the higher Distinct-1 score.

Emotion accuracy reaches 0.715 for the full system. The HRED baseline with all three auxiliary inputs scores 0.689, and the corresponding Seq2Seq scores 0.673. The plain HRED and Seq2Seq baselines record 0.376 and 0.358, respectively. Those figures show the importance of knowing which settings receive a requested emotion. The large changes from the plain recurrent baselines come in comparisons where both persona and emotion are added. The full system’s score is the highest even when the comparisons already have those controls.

The paper’s discussion describes improvements using percentage language. The score entries give the most direct account of the conditions and metric scales, particularly for BLEU-4 and emotion accuracy. The full system leads on both reference overlap and measured diversity. As a consequence, its larger inventory of distinct phrasing coincides with higher overlap with references at the aggregate level. The outcomes still leave open how frequently a more varied reply is the better reply for a particular conversation.

#### Human judgments of the replies

The human evaluation uses a random sample of 500 responses from the test set. Six raters with postgraduate experience examine responses with their conversation input and supplied persona information. They assess fluency and relevance on rating scales where 1 is unacceptable, 3 is moderate, and 5 is excellent. The paper describes 2 and 4 as intermediate choices for uncertainty. The system is evaluated on whether its reply reads well and belongs in the conversation, in addition to the qualities targeted by the control inputs.

The other three judgments are binary. For persona consistency, sentiment coherence, and emotion appropriateness, 1 represents a reply judged consistent or suitable and 0 represents a reply judged irrelevant or contradictory on that dimension. Looking at these outcomes separately matters because a reply can sound natural and still say something incompatible with the supplied speaker profile. It can also express a recognizable emotion while reacting poorly to what the other person has just said.

The authors report a Fleiss’ kappa of 0.75 for fluency and relevance. For the other judgments, they report 0.75 for emotion appropriateness, 0.71 for sentiment coherence, and 0.78 for persona consistency. These agreement scores describe how consistently reviewers applied the criteria. They have a different role from the system scores, which describe how often a system’s replies met those criteria.

The full system has the highest scores in both of the scaled human ratings, with entries of 3.66 and 3.89 for fluency and relevance. The strongest hierarchical comparison with all auxiliary inputs has corresponding entries of 3.45 and 3.52. The basic Seq2Seq system has entries of 2.65 and 2.98. Across those systems, the changes are visible in judgments of ordinary reply quality as well as in the measurements designed to capture emotional and personal content.

For emotion appropriateness, the full system records 65%, compared with 61% for HRED with persona, emotion, and sentiment and 59% for HRED with persona and emotion. Basic HRED records 41%. On sentiment coherence, the full system records 62%. The hierarchy-based version with all auxiliary inputs records 55%, its counterpart with persona and emotion records 47%, and basic HRED records 37%. These comparisons establish the conditions under which raters judged the outputs, with an explicit request for emotion available to the controlled systems.

PersonaChat sampled test replies compared on human-rated persona consistency SEPRG has the highest share of replies judged consistent with the supplied speaker profile.

**The numbers**

| System or setting | Persona consistency |
| --- | --- |
| Seq2Seq | 35% |
| HRED | 39% |
| Seq2Seq + E + P | 48% |
| HRED + E + P | 55% |
| Seq2Seq + E + P + S | 52% |
| HRED + E + P + S | 58% |
| SEPRG Trans + E + P + S (this paper) | 67% |

Persona consistency is the strongest of the full system’s binary human judgments. Its 67% is above the 58% of the HRED comparison with the same kinds of input. The simpler recurrent settings also receive some positive judgments. A system without the profile can give a reply that happens to be consistent with it, especially when it makes few personal claims or when the conversation already provides relevant details. The profile supplies an explicit source of grounding and raises the reported consistency rates in these comparisons.

### What the ablations show

#### Adding emotion and persona together

The Transformer ablation starts with the plain `Trans` setting. The next setting adds emotion and persona together. Perplexity changes from 53.47 for the plain setting to 53.44 for the version with those controls, while BLEU-4 moves from 0.118 to 0.125. ROUGE-L moves from 0.239 to 0.242. The joint addition improves all the reported automatic scores, although the size of the change varies with the metric.

The corresponding diversity scores move from 0.0189 to 0.0193 for Distinct-1 and from 0.0883 to 0.0896 for Distinct-2. Emotion accuracy also rises. These comparisons show what happens when the decoder gains both a representation of the desired emotion and access to a persona encoder. The design has no emotion-only and persona-only Transformer settings. As a consequence, it gives a joint estimate of the contribution of the two additions and leaves their separate contributions unresolved.

That distinction matters for interpreting the emotion score. A requested emotion is a direct clue about the kind of wording the classifier is being asked to recognize. A profile offers different information, such as what interests or experiences the speaker can mention. Adding them together can improve the fit of a response in several ways. The resulting increase in automatic emotion accuracy cannot assign a share of the improvement to each input.

PersonaChat Transformer ablation by automatic emotion accuracy Emotion accuracy rises when the Transformer comparison gains the paired emotion and persona inputs and again when it gains sentiment.

**The numbers**

| System or setting | Emotion accuracy |
| --- | --- |
| Trans | 0.678 |
| Trans + E + P | 0.695 |
| SEPRG Trans + E + P + S (this paper) | 0.715 |

#### Adding sentiment while retaining the other inputs

The most direct Transformer comparison for sentiment is between `Trans + E + P` and the full system. Both configurations have the persona and the emotion control. The full system adds the labels for prior turns. Its perplexity is 51.92 against 53.44, its BLEU-4 is 0.143 against 0.125, and its ROUGE-L is 0.266 against 0.242. Both diversity scores and automatic emotion accuracy also favor the complete setting. The experiment supports including those labels in the context representation when the other controls are already present.

The recurrent comparisons give a complementary test of that idea within different architectures. For Seq2Seq, adding sentiment to the setting with emotion and persona changes emotion accuracy from 0.657 to 0.673. For HRED, it changes the same metric from 0.665 to 0.689. Human sentiment coherence also rises, from 42% to 51% for Seq2Seq and from 47% to 55% for HRED. These settings show the effect of using the labels with systems that organize and process the conversation differently.

The changes are uneven across outcomes. With Seq2Seq, the version with sentiment gets 56% for human emotion appropriateness compared with 53% for its counterpart with persona and emotion. HRED’s corresponding entries are 61% and 59%. Those scores move in the same direction as sentiment coherence, while their closeness illustrates the difference between the two criteria. Information about past polarity is directly relevant to coherence with the conversation. An appropriate emotional reaction depends on the situation and what the reply does with it.

The diversity comparisons also show why the treatment of sentiment should be tied to the exact setting. With HRED, Distinct-2 moves from 0.0592 with emotion and persona to 0.0590 after sentiment is added, even as the unigram diversity score rises. In the Transformer setting, both diversity measures favor the complete system. The paper’s results therefore locate the strongest sentiment result in the complete architecture, with several supporting gains in the recurrent comparisons and some exceptions on individual metrics.

#### What the examples add

The authors examine a discussion about jobs in which one participant mentions playing guitar and working as a welder. The reference asks a follow-up about the welding. The plain recurrent systems also attempt a question about welding, although the Seq2Seq example contains unknown tokens and the HRED reply is terse. The emotionally conditioned versions add a reaction of surprise. The full system combines an enthusiastic acknowledgment with a follow-up, using the earlier disclosure to keep the emotional language tied to the subject of the exchange.

That case illustrates a distinction between the sentiment of the reference reply and the affect of a suitable generated reply. The reference question is labeled neutral, while the example output under emotional control expresses surprise. Both can ask about the same activity. A response can therefore vary in its interpersonal tone while preserving the conversational purpose. Reference overlap captures some of the shared content, and the case study shows what can change beyond it.

The pet exchange demonstrates how a profile and the dialogue history can both be used in a short reply. The baseline replies about owning or preferring cats are roughly aligned with the responder’s profile. The versions with emotional conditioning also react to the mention of the turtle. The full reply expresses affection for the turtle’s name and then returns to the responder’s stated preference. It illustrates how a personal detail can be integrated after an acknowledgment of the other participant.

The examples accompany the ablations without identifying which individual component produced each phrase. A stronger acknowledgment could be related to the emotion input, the sentiment information, the architecture, or the interaction among them. The automatic controlled comparisons provide the evidence about which settings improve average scores. The examples show what a difference between outputs can look like in an actual exchange.

The authors also inspect failures that survive those improvements. One output introduces hunting into a reply where the reference discusses cooking and house repair, and it repeats part of its wording. In the persona discrepancy example, the supplied speaker profile expresses enjoyment of time with the speaker’s children, while the output says that children are annoying. These cases distinguish unreliable handling of contextual detail from a direct violation of the supplied persona. Both can make a fluent reply unsuitable.

### Limitations

#### Limits identified by the authors

The authors identify extraneous information and persona discrepancies in generated replies. Extra material can arise when a response repeats part of an input and adds words that are unsupported by the conversation. A persona discrepancy can involve an omitted detail or a position that contradicts the supplied profile. The specific examples make clear that conditioning is a source of information for the decoder. A learned association between the input and likely tokens does not enforce every profile statement as a constraint.

The persona problem is particularly consequential for the authors’ goal of presenting a consistent conversational partner. A failure to mention hobbies may leave a reply generic but acceptable. A statement that reverses a speaker’s declared feelings about their own children changes the apparent identity of the speaker. Human persona consistency rates capture some of that issue at the sample level. The error discussion establishes that the complete architecture can still produce contradictions of the strongest kind the criterion is meant to catch.

The authors propose improving the generation architecture and investigating other properties of social conversation, including politeness and diversity. The diversity measures in the experiment describe token and phrase variety. The future-work discussion reaches a broader question about what kinds of responses a social agent can produce. The human ratings in this paper cover fluency, relevance, persona, sentiment, and emotion, leaving politeness outside the evaluated criteria.

#### Limits visible in the evaluation

The system is given a desired emotion at decoding time. The experiments measure how well a generator expresses a requested emotion and fits it to the conversation. They do not test a separate policy for choosing the emotion from the history and speaker profile. If a conversation changes direction between turns, a deployed conversational system would have to decide what response is called for, or receive that decision from another component. The paper’s generation scores do not estimate how well such a decision would be made.

The relationship between emotion and sentiment also affects what the label comparison can establish. Some of the new sentiment annotations come from a mapping of existing emotion labels. The controls apply to different parts of the generation task, so this procedure does not on its own establish that the reply label was exposed through the context. It does mean that a gain from labeled sentiment should be understood in relation to this particular annotation scheme. The experiments leave open whether the same gain would be achieved with sentiment labels predicted on unfamiliar conversations.

The reference for each generated reply is one continuation that participants actually wrote. Open-domain dialogue allows many compatible continuations. A short acknowledgment, a relevant follow-up question, and a statement about the responder’s own experience can each work after the same utterance and share different amounts of wording with the reference. BLEU-4 and ROUGE-L measure the corresponding kinds of overlap. Agreement with the recorded reply supplies evidence about reference matching while leaving room for acceptable responses that score poorly on that comparison.

Distinct scores measure variation in the generated wording. A response that introduces an unsupported activity may contribute a new word or phrase and still be worse for that particular exchange. Emotion accuracy similarly depends on a classifier’s decisions about the output. It indicates that the language is recognizable as the requested emotion under the evaluation procedure. A reader’s judgment about whether expressing that emotion is welcome also depends on the situation, which is why the human emotion appropriateness rating is a separate outcome.

The human study brings reviewers closer to that contextual question, but its judgments concern sampled replies read with the input and profile. Raters assess the suitability of the text. The experiment does not track the experience of people carrying on a conversation with the system over many turns. Claims about sustained rapport, trust, and user satisfaction belong to the motivation for the work. The results demonstrate more specific properties of replies under the study’s viewing and rating conditions.

The crowd-worker data also give the profile a particular form. Participants know which persona they are expected to enact, and the generator receives the role description as a set of written statements. The tests therefore speak directly to generation with an explicit supplied profile. They leave open how a system would learn accurate information about a real conversation partner, decide when to use it, or maintain grounding when the profile is incomplete or changes. The paper mentions unseen personas in its dataset description but does not break down generation scores by persona familiarity.

The ablations supply the cleanest evidence for the addition of sentiment after persona and emotion have already been included. They do not separately test every input or architectural detail. There is no Transformer comparison that adds sentiment alone to the plain setting, and the available emotion-and-persona comparison introduces those two jointly. Differences between the full system and the recurrent baselines also bundle several design choices. The resulting evidence supports the tested configurations without quantifying how much each encoder or each form of conditioning contributes in isolation.

The results tables provide point estimates for the comparisons. The paper does not give uncertainty intervals or a significance test alongside them. This matters when scores are close, such as the perplexity of the plain Transformer and of the setting with emotion and persona. The point estimates establish the direction of the reported differences. They do not show how much those differences would vary with a different training run or a different sample of replies.

Finally, some implementation details are unevenly specified. The framework overview mentions a Transformer decoder, while the decoder equations use a GRU. The decoder prose describes persona information in the prediction stage more explicitly than the corresponding equation does. The sentiment representation is described as a concatenation even though the displayed expression uses addition and an index for the last turn. Reading the detailed recurrent equations together with the per-turn prose gives a coherent account of the experiment’s main design. Those inconsistencies, along with the different reported test dialogue counts, limit how precisely a reader can reproduce it from the paper alone.

### What came after

The later citing work listed for 2023 studies how to produce empathy and politeness in conversational replies using multiple generators that are sensitive to different behaviors. Its stated focus extends the earlier interest in emotional appropriateness to another property of social interaction that the SEPRG authors identify for future investigation. In SEPRG, a requested emotion and the sentiments of previous turns both condition generation alongside the persona. The later work frames empathy and politeness as behaviors to be induced together through multiple behavior-aware generators. [Mixing It Up](https://md.research.elamur.ai/free/en/papers/firdaus-2023-mixing-it-up-inducing-empathy/)

The connection is the treatment of social qualities as properties a response generator can be designed to express. SEPRG makes that idea concrete through an emotion vector supplied at each decoding step, turn-level polarity labels, and an encoded profile. The later work’s title identifies a different organizing choice, multiple behavior-aware generators, and a particular combination of goals, empathy and politeness. The citation establishes the link between the studies. The later work’s stated focus does not establish that it reused SEPRG’s sentiment annotations, persona encoder, or decoding procedure.

## Cite

Cite as Mauajama Firdaus, Umang Jain, Asif Ekbal and Pushpak Bhattacharyya. 2021. SEPRG: Sentiment aware Emotion controlled Personalized Response Generation. Proceedings of the 14th International Conference on Natural Language Generation.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.18653/v1/2021.inlg-1.39](https://doi.org/10.18653/v1/2021.inlg-1.39)

```bibtex
@inproceedings{firdaus2021seprg,
  title = {{SEPRG: Sentiment aware Emotion controlled Personalized Response Generation}},
  author = {Mauajama Firdaus, Umang Jain, Asif Ekbal and Pushpak Bhattacharyya},
  booktitle = {Proceedings of the 14th International Conference on Natural Language Generation},
  year = {2021},
  doi = {10.18653/v1/2021.inlg-1.39},
  url = {https://doi.org/10.18653/v1/2021.inlg-1.39}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
