Emotion-probability-plugin ========================== ###### tags: `HRI` [TOC] ## Description ### Eric > I would propose a scoring metric something like this: > * ``` > probability_emote = w * emotion_confidence + (1 - w) * frequency_penalty > Where: > * emotion_confidence: a score from 0.0 to 1.0 representing the emotion model’s confidence in it’s classification results > * frequency_penalty: a score from 0.0 to 1.0 where a high score penalizes frequent emotes > * ``` > frequency_penalty = 1 - emotion_frequency > * w: a weight from 0.0 to 1.0 that controls the balance between emotion_confidence and frequency_penalty > * Then you generate a random number between 0.0 and 1.0 and emote if it is greater than probability_emote > * You will have to set frequency_penalty and w through trial and error, but you can start with setting w=0.5 and giving the emotion classifier and frequency penalty equal weight. > * Setting w=1.0 would disable the frequency penalty altogether ### To discuss [Analysis](https://docs.google.com/presentation/d/1KeiAKtmqzzR0IbbP8D5gqI-Uqjzlf8jQq_zMuVDyKQM/edit#slide=id.g113622ce877_0_154) ### Creating a Plugin for Behavior Tree - Input-Output - emotion_confidence: float between 0 and 1 - emotion_frequency: float between 0 and 1 - w: float between 0 and 1 - show_emotions: bool ![](https://i.imgur.com/FMRvBlY.png) - The Sub-Tree ![](https://i.imgur.com/w8VIcvz.png) --- ## Old Suggestion (Ignore) :::spoiler 1. Ratio ``` num_sentences = 0 num_non-neutral-sentences = 0 ratio = 0.7 LOOP if (ratio*num_sentences > num_non-neutral-sentences and genre == non-neutral) then use non-neutral genre num_non-neutral-sentences += 1 else use neutral genre num_sentences += 1 ``` ::: <!-- {%hackmd theme-dark %} --> ## Compare Equations ### Table | | PE1 | PE2 | | --- | ---------------------------------------------------- | ---------------------------------------- | | Eq | w * emotion_confidence + (1 - w) * frequency_penalty | 1 - e ^ (- w * emotion_confidence / frequency) | | ec | PE1 | PE2 | | --- | ------------------------------------ | ------------------------------------ | | 0 | ![](https://i.imgur.com/vgLS05T.png) | ![](https://i.imgur.com/pAGs3d6.png) | | 1 | ![](https://i.imgur.com/M1X3rFA.png) | ![](https://i.imgur.com/bNw6NSF.png) | ### PE1 ![](https://i.imgur.com/vgLS05T.png) ![](https://i.imgur.com/M1X3rFA.png) ### PE2 ![](https://i.imgur.com/pAGs3d6.png) ![](https://i.imgur.com/IdB2JTO.png) ![](https://i.imgur.com/bNw6NSF.png) ![](https://i.imgur.com/gaTI5A4.jpg) ![](https://i.imgur.com/JiB2Z60.jpg) ![](https://i.imgur.com/0zVFC4m.jpg) ![](https://i.imgur.com/5aLWWYl.jpg)