THE EMOTINOMICON is an app for internal navigation.
You can play with it here.
This README, like the app, is a work in progress.
The app is implemented as a svelte component. The code is currently unlicensed. Feel free to play with this for fun and learning, but you may not build anything with it (yet!).
The primary interface is a combo box, which has typeahead suggestions for 177 emotional states (cribbed from a pyschology textbook). Upon selecting an emotional state from the combobox, the app displays:
- a definition of the emotional state
- selectors for the ten nearest emotional states
Both of the above are generated using large language models (LLMs). The python scripts implementing the data generation are not yet released (but coming).
The definitions were generated by the cohere "large" generation model, using the release as of April 25th 2022, or more recent for a couple of definitions. The associated model card.
The definitions were generated by seeding the generate endpoint with dictionary definitions of ten emotions, in the following prompt:
Anger: a strong feeling of annoyance, displeasure, or hostility.
Disgust: a feeling of revulsion or strong disapproval aroused by something unpleasant or offensive.
Envy: a feeling of discontented or resentful longing aroused by someone else's possessions, qualities, or luck.
Fear: an unpleasant emotion caused by the threat of danger, pain, or harm.
Guilt: a feeling of having committed wrong or failed in an obligation.
Happiness: the feeling or showing pleasure or contentment.
Jealousy: feeling or showing an envious resentment of someone or their achievements, possessions, or perceived advantages.
Love: an intense feeling of deep affection.
Sadness: feeling or showing sorrow; unhappy.
Shame: a painful feeling of humiliation or distress caused by the consciousness of wrong or foolish behaviour.
<Emotion>:
The final <Emotion>
tag is replaced with the emotion to be defined, and the definition was terminated upon the first period .
.
For each emotion, 5 definitions were generated. These were then manually curated in a text editor by me. Mostly I selected one of the definitions, occasionaly I mashed two of them together.
Emotional similarity was computed as the cosine distance between embeddings of the emotions produced by the cohere "large" reperesentation model. The associated model card.
Each emotion is represented by the embedding of the sentence:
I am feeling <emotion>.
where <emotion>
is replaced such that the sentence reads I am feeling anger.
or I am feeling joy.
and so on.
- if no matching selection, display a message rather than an empty popup
- automated test aria (playwright has some integrations)
- actually test aria (use a screenreader, eg)
- use state machine to better organize focus and aria states?
- tidy up the python scripts used for generation and embedding
- data should be data: store the emotions in JSON and parse into TS, rather than define them in a single large TS file.