[GH-ISSUE #191] Character Expressions: Using LLM for emotion classification #115

Closed
opened 2026-10-15 18:04:36 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @hopto-dot on GitHub (Nov 26, 2023).
Original GitHub issue: https://github.com/SillyTavern/SillyTavern-Extras/issues/191

Talking head and the Character Expressions extension should both give you the option to use the LLM to classify the emotion of the latest reply as it can be better at doing it (depending on the model obviously) AND is much more flexible. It also means you don't need to load another model into ram/vram.

Here is an example string you could use to do that:

"Oh no, really? *worried* Is it because it's from me?"

Out of the following emotions: joy, sad, neutral, terrified, surprised, embarrassed, anger, confusion

The sentence expresses: <answer>sad</answer>


"Oh it's just a present I bought for your birthday tomorrow! Surprise! *smiles*"

Out of the following emotions: joy, sad, neutral, terrified, surprised, embarrassed, anger, confusion

The sentence expresses: <answer>joy</answer>


"Woah, no way! You bought that just for me??"

Out of the following emotions: joy, sad, neutral, terrified, surprised, embarrassed, anger, confusion

The sentence expresses: <answer>surprised</answer>


"{current sentence}"

Out of the following emotions: joy, sad, neutral, terrified, surprised, embarrassed, anger, confusion

The sentence expresses: <answer>

After the final "Out of the following emotions:" you could have any custom emotion then have images in your emotion

Originally created by @hopto-dot on GitHub (Nov 26, 2023). Original GitHub issue: https://github.com/SillyTavern/SillyTavern-Extras/issues/191 Talking head and the Character Expressions extension should both give you the option to use the LLM to classify the emotion of the latest reply as it can be better at doing it (depending on the model obviously) AND is much more flexible. It also means you don't need to load another model into ram/vram. Here is an example string you could use to do that: ``` "Oh no, really? *worried* Is it because it's from me?" Out of the following emotions: joy, sad, neutral, terrified, surprised, embarrassed, anger, confusion The sentence expresses: <answer>sad</answer> "Oh it's just a present I bought for your birthday tomorrow! Surprise! *smiles*" Out of the following emotions: joy, sad, neutral, terrified, surprised, embarrassed, anger, confusion The sentence expresses: <answer>joy</answer> "Woah, no way! You bought that just for me??" Out of the following emotions: joy, sad, neutral, terrified, surprised, embarrassed, anger, confusion The sentence expresses: <answer>surprised</answer> "{current sentence}" Out of the following emotions: joy, sad, neutral, terrified, surprised, embarrassed, anger, confusion The sentence expresses: <answer> ``` After the final "`Out of the following emotions:`" you could have any custom emotion then have images in your emotion
Author
Owner

@Cohee1207 commented on GitHub (Nov 26, 2023):

One could use the newly added STscript to easily achieve this. Add as a quick reply and set to execute on character message.

/setglobalvar key=labels6emo ["joy", "sadness", "anger", "surprise", "love", "fear"] |
/genraw instruct=off stop=["\n"] {{lastMessage}}{{newline}}Pause your roleplay. Out of the following emotions: {{getglobalvar::labels6emo}}{{newline}}The message expresses: |
/fuzzy list=labels6emo |
/emote
<!-- gh-comment-id:1826905113 --> @Cohee1207 commented on GitHub (Nov 26, 2023): One could use the newly added [STscript](https://docs.sillytavern.app/usage/st-script/) to easily achieve this. Add as a quick reply and set to execute on character message. ``` /setglobalvar key=labels6emo ["joy", "sadness", "anger", "surprise", "love", "fear"] | /genraw instruct=off stop=["\n"] {{lastMessage}}{{newline}}Pause your roleplay. Out of the following emotions: {{getglobalvar::labels6emo}}{{newline}}The message expresses: | /fuzzy list=labels6emo | /emote ```
Author
Owner

@hopto-dot commented on GitHub (Nov 28, 2023):

Thank you!

<!-- gh-comment-id:1829981262 --> @hopto-dot commented on GitHub (Nov 28, 2023): Thank you!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
SillyTavern/SillyTavern-Extras#115
No description provided.