Spaces:
Running
Running
File size: 31,217 Bytes
25e624c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 |
# -*- 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]}...")
|