# Expressing Robot Personality through Talking Body Language
## 3 Sentiment to Expression Conversion
### Affective Input  
The literature reveals two types of emotional models. On the one hand, the theory of basic emotions divides emotions into discrete and independent categories, such as the six basic emotions (anger, disgust, fear, happiness, sadness and surprise) identified by [PERSON] [42]. Other affective models regard those experiences as a continuum of highly ambiguous states with also a high degree of interrelationship. They describe emotions as linear combinations of _Valence-Arousal-Dominance_ (VAD) values. _Valence_ is a measure of positivity-negativity of the stimulus, _Arousal_ is related to the energy level and _Dominance_ addresses the approachability of the stimulus. These models allow for a wider range of emotions [43; 44]. The goal of the research field called _sentiment analysis_ is the analysis, from pieces of written language, of writer's attitudes, evaluations, emotions, sentiments, and opinions [45]. Its main purpose is to associate a given text with its polarity: positive, negative or neutral. A brief review of the sentiment analyzers tested in this work are listed below. VADER (Valence aware dictionary for sentiment reasoning) sentiment analyzer [46], is a tool for sentiment analysis first designed for social media, but also applicable in different domains. It is based on rules derived from dimensional affective models, but also uses a lexicon. It analyzes the intensity and polarity of the written text and gives as output the proportion of text for each category and a compound score from the _Valence_ scores of each word, according to the lexicon. VADER is optimized for social media data. The wellknown NLTK library [47] also uses VADER as a sentiment analyzer tool. TextBlob [[https://textblob.readthedocs.io/en/dev/](https://textblob.readthedocs.io/en/dev/)]([https://textblob.readthedocs.io/en/dev/](https://textblob.readthedocs.io/en/dev/)) (accessed on 18 May 2021) is another tool for text analisys, written in Python. Its API provides sentiment analysis and another usual natural language processing (NLP) capabilities, as noun phrase extraction or part-of- speech tagging. Similar to VADER, it is a rule-based system but slightly more limited in the sense that it does not take into account the punctuation marks. The sentiment analyzer outputs the polarity of the sentence together with the level of subjectivity. The advantage is that it can evaluate pieces of text instead of individual sentences. The main weakness of the rule-based approaches is that the context is not taken into account, and only single words are analyzed. In order to address this issue, word representation in the form of embeddings places two words with similar meaning close to each other in a n-dimensional space. This approach is used in the flair framework [48]. Table 1 shows a comparison example of the sentiment scores obtained by the three mentioned tools. The sentences of the table correspond to the text chosen for the experimentation in Section 5. None of them take into account the semantics of the text as a whole, neither relate each sentence with the previous one. The three options gave non-expected outputs, i.e., scores that would be very different if the text was manually annotated. The decision to use VADER for our experiments was made on the one hand, by observation and, on the other hand, by the flexibility to attenuate or enhance the nuance given to a sentence by the analyzer by adding emoticons or punctuation marks. This allows us to obtain a robot expression more in harmony with the non captured semantics of the text. The _Valence_ value places the emotion in the scale ranging from sadness to happiness, thus evaluating its positivity. VADER takes all the _Valence_ scores from all the words, summarizes them, and returns a normalized sentiment in the range (\(-1\), \(+1\)), being \(-1\) the negative extreme and \(+1\) the positive extreme.