Emoji-AI-Avatar / avatar /sentiment_emoji_map.py
Deminiko
Initial import: Emoji AI Avatar
25e624c
"""
Sentiment Emoji Map - Maps emotion labels to face emojis
This module maps detected emotions to visual emoji representations
Unified for both user and AI (same emojis for all)
Version 2.0: Added new emotions for multi-emotion model support
"""
from typing import Dict, Optional
class EmojiMapper:
"""Maps emotion labels to face emojis - unified for user and AI"""
EMOTION_EMOJIS: Dict[str, str] = {
# === POSITIVE EMOTIONS (High Arousal) ===
"ecstasy": "๐Ÿคฉ",
"joy": "๐Ÿ˜",
"happiness": "๐Ÿ˜Š",
"delight": "๐Ÿ˜„",
"elation": "๐Ÿ˜†",
"euphoria": "๐Ÿฅณ",
"excitement": "๐Ÿ˜ƒ",
"thrill": "๐Ÿ˜",
"enthusiasm": "๐Ÿ˜€",
"cheerfulness": "๐Ÿ˜Š",
# === POSITIVE EMOTIONS (Medium Arousal) ===
"contentment": "๐Ÿ˜Œ",
"satisfaction": "๐Ÿ˜",
"pleasure": "๐Ÿ˜‹",
"relief": "๐Ÿ˜ฎโ€๐Ÿ’จ",
"serenity": "๐Ÿ˜‡",
"calm": "๐Ÿ˜Œ",
"relaxed": "๐Ÿ˜Ž",
"pride": "๐Ÿ˜ค",
"confidence": "๐Ÿ˜Ž",
"triumph": "๐Ÿ˜",
# === LOVE & AFFECTION ===
"love": "๐Ÿฅฐ",
"adoration": "๐Ÿ˜",
"affection": "๐Ÿฅฐ",
"tenderness": "๐Ÿค—",
"caring": "๐Ÿค—",
"compassion": "๐Ÿฅน",
"empathy": "๐Ÿฅน",
"gratitude": "๐Ÿ™",
"thankful": "๐Ÿ˜Š",
# === INTEREST & CURIOSITY ===
"curiosity": "๐Ÿง",
"interest": "๐Ÿค”",
"fascination": "๐Ÿ˜ฏ",
"wonder": "๐Ÿ˜ฒ",
"awe": "๐Ÿ˜ฎ",
"amazement": "๐Ÿ˜ฒ",
"intrigue": "๐Ÿคจ",
# === SURPRISE ===
"surprise": "๐Ÿ˜ฎ",
"astonishment": "๐Ÿ˜ฑ",
"shock": "๐Ÿ˜ณ",
"startled": "๐Ÿ˜ง",
# === NEUTRAL / THINKING ===
"neutral": "๐Ÿ˜",
"thinking": "๐Ÿค”",
"contemplative": "๐Ÿค”",
"pensive": "๐Ÿ˜”",
"reflective": "๐Ÿค”",
"uncertain": "๐Ÿ˜•",
"ambivalent": "๐Ÿ˜",
"indifferent": "๐Ÿ˜‘",
# === CONFUSION ===
"confused": "๐Ÿ˜•",
"confusion": "๐Ÿ˜•",
"puzzled": "๐Ÿคจ",
"perplexed": "๐Ÿ˜ตโ€๐Ÿ’ซ",
"bewildered": "๐Ÿ˜ต",
"baffled": "๐Ÿคฏ",
# === NEGATIVE EMOTIONS (Low Arousal) ===
"sadness": "๐Ÿ˜ข",
"sorrow": "๐Ÿ˜ญ",
"grief": "๐Ÿ˜ญ",
"melancholy": "๐Ÿ˜”",
"disappointment": "๐Ÿ˜ž",
"dejection": "๐Ÿ˜ฉ",
"despair": "๐Ÿ˜ซ",
"hopelessness": "๐Ÿ˜ฟ",
"loneliness": "๐Ÿฅบ",
"hurt": "๐Ÿ˜ข",
"misery": "๐Ÿ˜ฃ",
# === FEAR & ANXIETY ===
"fear": "๐Ÿ˜จ",
"terror": "๐Ÿ˜ฑ",
"horror": "๐Ÿ˜ฑ",
"dread": "๐Ÿ˜ฐ",
"anxiety": "๐Ÿ˜ฐ",
"worry": "๐Ÿ˜Ÿ",
"nervousness": "๐Ÿ˜ฌ",
"apprehension": "๐Ÿ˜ง",
"panic": "๐Ÿ˜ฑ",
# === ANGER & FRUSTRATION ===
"anger": "๐Ÿ˜ ",
"rage": "๐Ÿคฌ",
"fury": "๐Ÿ˜ก",
"irritation": "๐Ÿ˜ค",
"annoyance": "๐Ÿ™„",
"frustration": "๐Ÿ˜ค",
"exasperation": "๐Ÿ˜ซ",
"resentment": "๐Ÿ˜’",
"hostility": "๐Ÿ˜ ",
"bitterness": "๐Ÿ˜–",
# === DISGUST & CONTEMPT ===
"disgust": "๐Ÿคข",
"revulsion": "๐Ÿคฎ",
"contempt": "๐Ÿ˜’",
"disdain": "๐Ÿ™„",
"loathing": "๐Ÿ˜ค",
"scorn": "๐Ÿ˜",
# === SHAME & EMBARRASSMENT ===
"shame": "๐Ÿ˜ณ",
"embarrassment": "๐Ÿ˜ณ",
"guilt": "๐Ÿ˜ฃ",
"regret": "๐Ÿ˜”",
"remorse": "๐Ÿ˜ž",
"humiliation": "๐Ÿซฃ",
# === BOREDOM & TIREDNESS ===
"boredom": "๐Ÿ˜‘",
"tiredness": "๐Ÿ˜ด",
"exhaustion": "๐Ÿ˜ฉ",
"fatigue": "๐Ÿฅฑ",
"weariness": "๐Ÿ˜ฎโ€๐Ÿ’จ",
"sleepy": "๐Ÿ˜ด",
# === ENVY & JEALOUSY ===
"envy": "๐Ÿ˜’",
"jealousy": "๐Ÿ™„",
# === PLAYFUL & SILLY ===
"playful": "๐Ÿ˜œ",
"silly": "๐Ÿคช",
"mischievous": "๐Ÿ˜ˆ",
"teasing": "๐Ÿ˜",
"sarcastic": "๐Ÿ˜",
"witty": "๐Ÿ˜Ž",
"amusement": "๐Ÿ˜‚",
"funny": "๐Ÿคฃ",
# === SPECIAL STATES ===
"sympathy": "๐Ÿฅน",
"nostalgia": "๐Ÿฅฒ",
"hope": "๐Ÿ™‚",
"optimism": "๐Ÿ˜Š",
"pessimism": "๐Ÿ˜•",
"longing": "๐Ÿฅบ",
"yearning": "๐Ÿ˜ข",
# === NEW IN V2 ===
"determination": "๐Ÿ˜ค",
"inspiration": "๐Ÿคฉ", # Changed from โœจ to face emoji
"anticipation": "๐Ÿค—",
"trust": "๐Ÿ˜Š", # Changed from ๐Ÿค to face emoji
"acceptance": "๐Ÿ˜Œ",
"sarcasm": "๐Ÿ™„",
# === NEW IN V3 - Context Emotions ===
"indifferent": "๐Ÿ˜",
"admiration": "๐Ÿคฉ",
"despair": "๐Ÿ˜ฐ",
"greeting": "๐Ÿ˜Š", # Changed from ๐Ÿ‘‹ to face emoji
"heartbreak": "๐Ÿ˜ญ", # Changed from ๐Ÿ’” to face emoji,
# === LEGACY MAPPINGS ===
"very_negative": "๐Ÿ˜ญ",
"negative": "๐Ÿ˜ ",
"slightly_negative": "๐Ÿ˜•",
"slightly_positive": "๐Ÿ™‚",
"positive": "๐Ÿ˜Š",
"very_positive": "๐Ÿคฉ",
# Default
"default": "๐Ÿ˜",
"ready": "๐Ÿ˜",
}
def __init__(self, custom_emojis: Optional[Dict[str, str]] = None):
"""Initialize with default or custom emoji mappings"""
self.emojis = self.EMOTION_EMOJIS.copy()
if custom_emojis:
self.emojis.update(custom_emojis)
def get_emoji(self, emotion: str) -> str:
"""
Get emoji for a given emotion
Args:
emotion: Emotion label (e.g., 'joy', 'anger', 'curiosity')
Returns:
Face emoji string
"""
emotion_clean = emotion.lower().strip().replace(" ", "_").replace("-", "_")
return self.emojis.get(emotion_clean, self.emojis.get("default", "๐Ÿ˜"))
def get_all_emojis(self) -> Dict[str, str]:
"""Get all emotionโ†’emoji mappings"""
return self.emojis.copy()
if __name__ == "__main__":
mapper = EmojiMapper()
test_emotions = [
"joy", "happiness", "love", "sadness", "anger",
"fear", "surprise", "disgust", "curiosity", "neutral"
]
print("Emotion โ†’ Emoji Mappings:")
for emotion in test_emotions:
emoji = mapper.get_emoji(emotion)
print(f" {emotion:20} โ†’ {emoji}")
print(f"\nTotal emotions: {len(mapper.get_all_emojis())}")