File size: 1,602 Bytes
846b01e
cdfb7e1
ede87a4
 
cdfb7e1
 
 
d04c1cc
 
ede87a4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
def classify_text(text: str) -> str:
    """
    Extended meme intent classifier with multiple categories.
    Uses simple keyword-based matching.
    """
    if not text or text.strip() == "":
        return "No text found"

    text_lower = text.lower()

    categories = {
        "Humor Meme": ["😂", "🤣", "lol", "funny", "joke", "lmao", "haha"],
        "Romantic Meme": ["love", "❤️", "crush", "romance", "kiss", "babe", "darling"],
        "Violent Meme": ["kill", "murder", "fight", "blood", "gun", "angry", "😡", "attack"],
        "Sad Meme": ["sad", "😭", "lonely", "depressed", "cry", "hurt", "pain", "tears"],
        "Motivational Meme": ["success", "never give up", "goal", "dream", "believe", "achieve"],
        "Sarcasm Meme": ["sure", "whatever", "yeah right", "sarcasm", "ironic", "duh"],
        "Political Meme": ["vote", "president", "minister", "government", "politics"],
        "Sports Meme": ["game", "football", "soccer", "basketball", "cricket", "team", "player"],
        "Gaming Meme": ["gg", "noob", "gamer", "fps", "level up", "gaming", "console", "pc"],
        "Wholesome Meme": ["cute", "wholesome", "puppy", "kitten", "family", "friends", "smile"],
        "Dark Meme": ["dark", "evil", "demon", "death", "grave", "hell", "fear"],
        "Work/Study Meme": ["office", "boss", "deadline", "exam", "homework", "school", "teacher"],
    }

    # Check each category
    for category, keywords in categories.items():
        if any(word in text_lower for word in keywords):
            return category

    # Default if no match
    return "General Meme"