# -*- coding: utf-8 -*- """ Emotion Test Suite - Comprehensive emotion detection test cases Tests ALL emotions in the emoji map with multiple text examples per emotion """ from typing import Dict, List, Tuple from dataclasses import dataclass @dataclass class EmotionTestCase: """Single test case for emotion detection""" emotion: str text: str expected_emoji: str category: str # positive, negative, neutral, complex class EmotionTestSuite: """ Complete test suite for all supported emotions Contains 5+ test strings per emotion for accuracy measurement """ # === COMPLETE EMOTION TEST CASES === # Format: emotion -> [(text, expected_polarity), ...] EMOTION_TEST_DATA: Dict[str, List[Tuple[str, str]]] = { # ========================================== # POSITIVE EMOTIONS - HIGH AROUSAL # ========================================== "joy": [ ("I feel so much joy right now!", "positive"), ("This brings me pure joy", "positive"), ("Joy fills my heart", "positive"), ("What a joyful moment", "positive"), ("I'm full of joy today", "positive"), ], "happiness": [ ("I am so happy today!", "positive"), ("This makes me really happy", "positive"), ("I feel happy and content", "positive"), ("Happiness is all around", "positive"), ("I'm genuinely happy", "positive"), ("I am good", "positive"), ("I'm doing great", "positive"), ], "excitement": [ ("I'm so excited about this!", "positive"), ("This is really exciting", "positive"), ("I can't contain my excitement", "positive"), ("How exciting!", "positive"), ("I'm thrilled and excited", "positive"), ], "enthusiasm": [ ("I'm very enthusiastic about this project", "positive"), ("My enthusiasm is through the roof", "positive"), ("I feel enthusiastic and eager", "positive"), ("Such enthusiasm!", "positive"), ("I'm enthusiastically looking forward to it", "positive"), ], "ecstasy": [ ("I'm in absolute ecstasy!", "positive"), ("This is pure ecstasy", "positive"), ("Ecstatic about the news", "positive"), ("I feel ecstatic", "positive"), ("What ecstasy!", "positive"), ], "elation": [ ("I'm elated by the results", "positive"), ("Such elation!", "positive"), ("I feel elated", "positive"), ("Elation washes over me", "positive"), ("I'm absolutely elated", "positive"), ], "euphoria": [ ("I'm in a state of euphoria", "positive"), ("Pure euphoria right now", "positive"), ("This euphoric feeling", "positive"), ("I feel euphoric", "positive"), ("Euphoria takes over", "positive"), ], "thrill": [ ("What a thrill!", "positive"), ("I'm thrilled about this", "positive"), ("This is thrilling", "positive"), ("I feel thrilled", "positive"), ("Such a thrilling experience", "positive"), ], "delight": [ ("I'm delighted to hear that", "positive"), ("What a delight!", "positive"), ("This is delightful", "positive"), ("I'm absolutely delighted", "positive"), ("Such delight!", "positive"), ], "cheerfulness": [ ("I'm feeling cheerful today", "positive"), ("Such cheerfulness around", "positive"), ("Cheerful vibes only", "positive"), ("I feel cheerful", "positive"), ("What a cheerful day", "positive"), ], # ========================================== # POSITIVE EMOTIONS - MEDIUM AROUSAL # ========================================== "contentment": [ ("I feel content with my life", "positive"), ("Such contentment", "positive"), ("I'm content and at peace", "positive"), ("Contentment fills me", "positive"), ("I feel okay", "positive"), ("I'm fine", "positive"), ], "satisfaction": [ ("I'm satisfied with the outcome", "positive"), ("Great satisfaction", "positive"), ("I feel satisfied", "positive"), ("Satisfaction guaranteed", "positive"), ("Very satisfying", "positive"), ], "serenity": [ ("I feel serene and calm", "positive"), ("Such serenity", "positive"), ("Serenity now", "positive"), ("A serene feeling", "positive"), ("I'm at peace and serene", "positive"), ], "calm": [ ("I feel calm and relaxed", "positive"), ("So calm right now", "positive"), ("Calmness washes over me", "positive"), ("I'm staying calm", "positive"), ("Very calm today", "positive"), ], "relaxed": [ ("I'm feeling relaxed", "positive"), ("So relaxed right now", "positive"), ("I feel relaxed and happy", "positive"), ("Relaxed vibes", "positive"), ("Totally relaxed", "positive"), ], "relief": [ ("What a relief!", "positive"), ("I feel relieved", "positive"), ("Such relief", "positive"), ("I'm so relieved", "positive"), ("Relief washes over me", "positive"), ], "pride": [ ("I'm so proud of this", "positive"), ("Pride in my work", "positive"), ("I feel proud", "positive"), ("Such pride", "positive"), ("I'm proud of myself", "positive"), ], "confidence": [ ("I feel confident about this", "positive"), ("Confidence is high", "positive"), ("I'm confident", "positive"), ("Such confidence", "positive"), ("I feel self-confident", "positive"), ], "pleasure": [ ("It's my pleasure", "positive"), ("Such pleasure", "positive"), ("I feel pleasure", "positive"), ("What a pleasure", "positive"), ("Pure pleasure", "positive"), ], # ========================================== # LOVE & AFFECTION # ========================================== "love": [ ("I love this so much!", "positive"), ("I'm in love", "positive"), ("Love is in the air", "positive"), ("I love you", "positive"), ("Such love", "positive"), ], "adoration": [ ("I adore this", "positive"), ("Such adoration", "positive"), ("I feel adoration", "positive"), ("Adoring this moment", "positive"), ("I absolutely adore it", "positive"), ], "affection": [ ("I feel great affection", "positive"), ("Such affection", "positive"), ("Affection for everyone", "positive"), ("I feel affectionate", "positive"), ("Showing affection", "positive"), ], "tenderness": [ ("Such tenderness", "positive"), ("I feel tender", "positive"), ("Tenderness in my heart", "positive"), ("A tender feeling", "positive"), ("Tender moments", "positive"), ], "caring": [ ("I really care about you", "positive"), ("Such caring", "positive"), ("I feel caring", "positive"), ("Caring deeply", "positive"), ("I'm caring for you", "positive"), ], "compassion": [ ("I feel compassion for them", "positive"), ("Such compassion", "positive"), ("Compassionate response", "positive"), ("I'm compassionate", "positive"), ("Showing compassion", "positive"), ], "empathy": [ ("I feel empathy for your situation", "positive"), ("Such empathy", "positive"), ("I'm empathetic", "positive"), ("Empathy is important", "positive"), ("Showing empathy", "positive"), ], "gratitude": [ ("I'm so grateful for this", "positive"), ("Gratitude fills my heart", "positive"), ("Thank you so much", "positive"), ("I feel grateful", "positive"), ("Such gratitude", "positive"), ], # ========================================== # INTEREST & CURIOSITY # ========================================== "curiosity": [ ("I'm curious about this", "positive"), ("Such curiosity", "positive"), ("I feel curious", "positive"), ("Curiosity got me", "positive"), ("I'm really curious", "positive"), ], "interest": [ ("I'm interested in learning more", "positive"), ("Such interest", "positive"), ("I feel interested", "positive"), ("This is interesting", "positive"), ("I'm very interested", "positive"), ], "fascination": [ ("I'm fascinated by this", "positive"), ("Such fascination", "positive"), ("I feel fascinated", "positive"), ("Fascinating!", "positive"), ("I'm absolutely fascinated", "positive"), ], "wonder": [ ("I wonder about this", "positive"), ("Such wonder", "positive"), ("I feel wonder", "positive"), ("Wonderful!", "positive"), ("I'm in wonder", "positive"), ], "awe": [ ("I'm in awe", "positive"), ("Such awe", "positive"), ("I feel awe", "positive"), ("Awe-inspiring", "positive"), ("I'm awestruck", "positive"), ], "amazement": [ ("I'm amazed!", "positive"), ("Such amazement", "positive"), ("I feel amazed", "positive"), ("Amazing!", "positive"), ("I'm absolutely amazed", "positive"), ], "intrigue": [ ("I'm intrigued", "positive"), ("Such intrigue", "positive"), ("I feel intrigued", "positive"), ("Intriguing!", "positive"), ("Very intriguing", "positive"), ], # ========================================== # SURPRISE # ========================================== "surprise": [ ("What a surprise!", "positive"), ("I'm surprised", "positive"), ("Such a surprise", "positive"), ("Surprising!", "positive"), ("I'm pleasantly surprised", "positive"), ], "astonishment": [ ("I'm astonished!", "positive"), ("Such astonishment", "positive"), ("I feel astonished", "positive"), ("Astonishing!", "positive"), ("I'm absolutely astonished", "positive"), ], "shock": [ ("I'm in shock", "negative"), ("Shocking news", "negative"), ("I feel shocked", "negative"), ("What a shock", "negative"), ("I'm completely shocked", "negative"), ], # ========================================== # NEUTRAL / THINKING # ========================================== "neutral": [ ("The weather is average today", "neutral"), ("It's just okay", "neutral"), ("Nothing special", "neutral"), ("I don't have strong feelings", "neutral"), ("It is what it is", "neutral"), ], "thinking": [ ("I'm thinking about it", "neutral"), ("Let me think", "neutral"), ("I need to think", "neutral"), ("Thinking hard", "neutral"), ("I'm contemplating", "neutral"), ], "uncertain": [ ("I'm not sure about this", "negative"), ("Feeling uncertain", "negative"), ("I'm uncertain", "negative"), ("Uncertainty lingers", "negative"), ("I feel unsure", "negative"), ], # ========================================== # CONFUSION # ========================================== "confused": [ ("I'm so confused", "negative"), ("This is confusing", "negative"), ("I feel confused", "negative"), ("Confusion everywhere", "negative"), ("I'm really confused", "negative"), ], "puzzled": [ ("I'm puzzled by this", "negative"), ("Such a puzzle", "negative"), ("I feel puzzled", "negative"), ("Puzzling!", "negative"), ("I'm quite puzzled", "negative"), ], "perplexed": [ ("I'm perplexed", "negative"), ("Such perplexity", "negative"), ("I feel perplexed", "negative"), ("Perplexing situation", "negative"), ("I'm thoroughly perplexed", "negative"), ], "bewildered": [ ("I'm bewildered", "negative"), ("Feeling bewildered", "negative"), ("I feel bewildered", "negative"), ("Bewildering!", "negative"), ("I'm completely bewildered", "negative"), ], "baffled": [ ("I'm baffled by this", "negative"), ("Such bafflement", "negative"), ("I feel baffled", "negative"), ("Baffling!", "negative"), ("I'm totally baffled", "negative"), ], # ========================================== # SADNESS # ========================================== "sadness": [ ("I feel so sad", "negative"), ("Such sadness", "negative"), ("I'm really sad", "negative"), ("Sadness fills me", "negative"), ("I'm feeling sad today", "negative"), ], "sorrow": [ ("I feel deep sorrow", "negative"), ("Such sorrow", "negative"), ("Sorrow in my heart", "negative"), ("I'm sorrowful", "negative"), ("Overwhelming sorrow", "negative"), ], "grief": [ ("I'm grieving", "negative"), ("Such grief", "negative"), ("I feel grief", "negative"), ("Grief consumes me", "negative"), ("Deep grief", "negative"), ], "melancholy": [ ("I feel melancholy", "negative"), ("Such melancholy", "negative"), ("A melancholy mood", "negative"), ("I'm melancholic", "negative"), ("Melancholy sets in", "negative"), ], "disappointment": [ ("I'm disappointed", "negative"), ("Such disappointment", "negative"), ("I feel disappointed", "negative"), ("Disappointing!", "negative"), ("I'm really disappointed", "negative"), ], "despair": [ ("I'm in despair", "negative"), ("Such despair", "negative"), ("I feel despair", "negative"), ("Despair takes over", "negative"), ("I'm filled with despair", "negative"), ], "loneliness": [ ("I feel so lonely", "negative"), ("Such loneliness", "negative"), ("I'm lonely", "negative"), ("Loneliness consumes me", "negative"), ("I feel alone", "negative"), ], "hurt": [ ("I feel hurt", "negative"), ("That hurts", "negative"), ("I'm hurt", "negative"), ("Feeling hurt", "negative"), ("I'm really hurt", "negative"), ], "misery": [ ("I'm miserable", "negative"), ("Such misery", "negative"), ("I feel miserable", "negative"), ("Misery everywhere", "negative"), ("I'm in misery", "negative"), ], # ========================================== # FEAR & ANXIETY # ========================================== "fear": [ ("I'm afraid", "negative"), ("I feel fear", "negative"), ("Fear grips me", "negative"), ("I'm scared", "negative"), ("Such fear", "negative"), ], "terror": [ ("I'm terrified", "negative"), ("Such terror", "negative"), ("I feel terror", "negative"), ("Terrifying!", "negative"), ("I'm in terror", "negative"), ], "horror": [ ("I'm horrified", "negative"), ("Such horror", "negative"), ("I feel horror", "negative"), ("Horrifying!", "negative"), ("Horror fills me", "negative"), ], "dread": [ ("I feel dread", "negative"), ("Such dread", "negative"), ("I'm dreading it", "negative"), ("Dreadful!", "negative"), ("I'm filled with dread", "negative"), ], "anxiety": [ ("I feel anxious", "negative"), ("Such anxiety", "negative"), ("I'm anxious", "negative"), ("Anxiety takes over", "negative"), ("I'm very anxious", "negative"), ], "worry": [ ("I'm worried", "negative"), ("Such worry", "negative"), ("I feel worried", "negative"), ("Worrying about it", "negative"), ("I'm really worried", "negative"), ], "nervousness": [ ("I'm nervous", "negative"), ("Such nervousness", "negative"), ("I feel nervous", "negative"), ("Nervous about it", "negative"), ("I'm very nervous", "negative"), ], "apprehension": [ ("I feel apprehensive", "negative"), ("Such apprehension", "negative"), ("I'm apprehensive", "negative"), ("Apprehension sets in", "negative"), ("I'm filled with apprehension", "negative"), ], "panic": [ ("I'm panicking", "negative"), ("Such panic", "negative"), ("I feel panic", "negative"), ("Panic mode!", "negative"), ("I'm in a panic", "negative"), ], # ========================================== # ANGER & FRUSTRATION # ========================================== "anger": [ ("I'm so angry!", "negative"), ("Such anger", "negative"), ("I feel angry", "negative"), ("Anger fills me", "negative"), ("I'm really angry", "negative"), ], "rage": [ ("I'm in a rage", "negative"), ("Such rage", "negative"), ("I feel rage", "negative"), ("Rage takes over", "negative"), ("I'm filled with rage", "negative"), ], "fury": [ ("I'm furious!", "negative"), ("Such fury", "negative"), ("I feel fury", "negative"), ("Fury consumes me", "negative"), ("I'm absolutely furious", "negative"), ], "irritation": [ ("I'm irritated", "negative"), ("Such irritation", "negative"), ("I feel irritated", "negative"), ("Irritating!", "negative"), ("I'm really irritated", "negative"), ], "annoyance": [ ("I'm annoyed", "negative"), ("Such annoyance", "negative"), ("I feel annoyed", "negative"), ("Annoying!", "negative"), ("I'm really annoyed", "negative"), ], "frustration": [ ("I'm frustrated!", "negative"), ("Such frustration", "negative"), ("I feel frustrated", "negative"), ("Frustrating!", "negative"), ("I'm so frustrated", "negative"), ], "resentment": [ ("I feel resentment", "negative"), ("Such resentment", "negative"), ("I'm resentful", "negative"), ("Resentment builds", "negative"), ("I'm filled with resentment", "negative"), ], "hostility": [ ("I feel hostile", "negative"), ("Such hostility", "negative"), ("I'm hostile", "negative"), ("Hostility in the air", "negative"), ("I'm feeling hostile", "negative"), ], "bitterness": [ ("I feel bitter", "negative"), ("Such bitterness", "negative"), ("I'm bitter", "negative"), ("Bitterness takes over", "negative"), ("I'm really bitter", "negative"), ], # ========================================== # DISGUST & CONTEMPT # ========================================== "disgust": [ ("I'm disgusted", "negative"), ("Such disgust", "negative"), ("I feel disgust", "negative"), ("Disgusting!", "negative"), ("I'm really disgusted", "negative"), ], "revulsion": [ ("I feel revulsion", "negative"), ("Such revulsion", "negative"), ("I'm revolted", "negative"), ("Revolting!", "negative"), ("I feel revolted", "negative"), ], "contempt": [ ("I feel contempt", "negative"), ("Such contempt", "negative"), ("I'm contemptuous", "negative"), ("Contempt for this", "negative"), ("I'm filled with contempt", "negative"), ], "disdain": [ ("I feel disdain", "negative"), ("Such disdain", "negative"), ("I'm disdainful", "negative"), ("Disdain for this", "negative"), ("I'm filled with disdain", "negative"), ], "scorn": [ ("I feel scorn", "negative"), ("Such scorn", "negative"), ("I'm scornful", "negative"), ("Scorn for this", "negative"), ("I'm filled with scorn", "negative"), ], # ========================================== # SHAME & EMBARRASSMENT # ========================================== "shame": [ ("I feel ashamed", "negative"), ("Such shame", "negative"), ("I'm ashamed", "negative"), ("Shame on me", "negative"), ("I'm filled with shame", "negative"), ], "embarrassment": [ ("I'm embarrassed", "negative"), ("Such embarrassment", "negative"), ("I feel embarrassed", "negative"), ("Embarrassing!", "negative"), ("I'm really embarrassed", "negative"), ], "guilt": [ ("I feel guilty", "negative"), ("Such guilt", "negative"), ("I'm guilty", "negative"), ("Guilt consumes me", "negative"), ("I'm filled with guilt", "negative"), ], "regret": [ ("I regret this", "negative"), ("Such regret", "negative"), ("I feel regret", "negative"), ("Regretful!", "negative"), ("I'm filled with regret", "negative"), ], "remorse": [ ("I feel remorse", "negative"), ("Such remorse", "negative"), ("I'm remorseful", "negative"), ("Remorse takes over", "negative"), ("I'm filled with remorse", "negative"), ], "humiliation": [ ("I feel humiliated", "negative"), ("Such humiliation", "negative"), ("I'm humiliated", "negative"), ("Humiliating!", "negative"), ("I'm filled with humiliation", "negative"), ], # ========================================== # BOREDOM & TIREDNESS # ========================================== "boredom": [ ("I'm bored", "negative"), ("Such boredom", "negative"), ("I feel bored", "negative"), ("Boring!", "negative"), ("I'm really bored", "negative"), ], "tiredness": [ ("I'm tired", "negative"), ("Such tiredness", "negative"), ("I feel tired", "negative"), ("Tiring!", "negative"), ("I'm really tired", "negative"), ], "exhaustion": [ ("I'm exhausted", "negative"), ("Such exhaustion", "negative"), ("I feel exhausted", "negative"), ("Exhausting!", "negative"), ("I'm completely exhausted", "negative"), ], "fatigue": [ ("I feel fatigued", "negative"), ("Such fatigue", "negative"), ("I'm fatigued", "negative"), ("Fatigue sets in", "negative"), ("I'm feeling fatigue", "negative"), ], "weariness": [ ("I feel weary", "negative"), ("Such weariness", "negative"), ("I'm weary", "negative"), ("Weariness takes over", "negative"), ("I'm feeling weary", "negative"), ], # ========================================== # ENVY & JEALOUSY # ========================================== "envy": [ ("I feel envious", "negative"), ("Such envy", "negative"), ("I'm envious", "negative"), ("Envy takes over", "negative"), ("I'm filled with envy", "negative"), ], "jealousy": [ ("I feel jealous", "negative"), ("Such jealousy", "negative"), ("I'm jealous", "negative"), ("Jealousy consumes me", "negative"), ("I'm really jealous", "negative"), ], # ========================================== # PLAYFUL & SILLY # ========================================== "playful": [ ("I'm feeling playful", "positive"), ("Such playfulness", "positive"), ("Playful mood", "positive"), ("I'm in a playful mood", "positive"), ("Being playful", "positive"), ], "silly": [ ("I'm feeling silly", "positive"), ("Such silliness", "positive"), ("Silly mood", "positive"), ("I'm being silly", "positive"), ("Feeling silly", "positive"), ], "mischievous": [ ("I'm feeling mischievous", "positive"), ("Such mischief", "positive"), ("Mischievous mood", "positive"), ("I'm being mischievous", "positive"), ("Feeling mischievous", "positive"), ], "amusement": [ ("I'm amused", "positive"), ("Such amusement", "positive"), ("I feel amused", "positive"), ("Amusing!", "positive"), ("I'm really amused", "positive"), ("LOL", "positive"), ("haha", "positive"), ], # ========================================== # SPECIAL STATES # ========================================== "sympathy": [ ("I feel sympathy for you", "positive"), ("Such sympathy", "positive"), ("I'm sympathetic", "positive"), ("Sympathy for your loss", "positive"), ("I feel sympathetic", "positive"), ], "nostalgia": [ ("I feel nostalgic", "positive"), ("Such nostalgia", "positive"), ("I'm nostalgic", "positive"), ("Nostalgia hits", "positive"), ("Feeling nostalgic", "positive"), ], "hope": [ ("I feel hopeful", "positive"), ("Such hope", "positive"), ("I'm hopeful", "positive"), ("Hope is alive", "positive"), ("I have hope", "positive"), ], "optimism": [ ("I feel optimistic", "positive"), ("Such optimism", "positive"), ("I'm optimistic", "positive"), ("Optimism takes over", "positive"), ("I'm feeling optimistic", "positive"), ], "pessimism": [ ("I feel pessimistic", "negative"), ("Such pessimism", "negative"), ("I'm pessimistic", "negative"), ("Pessimism sets in", "negative"), ("I'm feeling pessimistic", "negative"), ], "longing": [ ("I'm longing for you", "negative"), ("Such longing", "negative"), ("I feel longing", "negative"), ("Longing for the past", "negative"), ("I miss you", "negative"), ], "yearning": [ ("I'm yearning for this", "negative"), ("Such yearning", "negative"), ("I feel yearning", "negative"), ("Yearning for more", "negative"), ("I'm filled with yearning", "negative"), ], } def get_all_emotions(self) -> List[str]: """Get list of all emotions in the test suite""" return list(self.EMOTION_TEST_DATA.keys()) def get_test_cases(self, emotion: str) -> List[Tuple[str, str]]: """Get test cases for a specific emotion""" return self.EMOTION_TEST_DATA.get(emotion, []) def get_all_test_cases(self) -> List[EmotionTestCase]: """Get all test cases as EmotionTestCase objects""" cases = [] for emotion, tests in self.EMOTION_TEST_DATA.items(): for text, polarity in tests: cases.append(EmotionTestCase( emotion=emotion, text=text, expected_emoji="", # Will be filled by EmojiMapper category=polarity )) return cases def get_emotion_count(self) -> int: """Get total number of emotions""" return len(self.EMOTION_TEST_DATA) def get_test_count(self) -> int: """Get total number of test cases""" return sum(len(tests) for tests in self.EMOTION_TEST_DATA.values()) if __name__ == "__main__": suite = EmotionTestSuite() print(f"Total emotions: {suite.get_emotion_count()}") print(f"Total test cases: {suite.get_test_count()}") print(f"\nEmotions: {suite.get_all_emotions()[:10]}...")