Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| def mood_detector(text): | |
| text = text.lower() | |
| if any(word in text for word in ["happy", "great", "awesome", "joy", "love"]): | |
| return "π Happy" | |
| elif any(word in text for word in ["sad", "tired", "upset", "cry"]): | |
| return "π’ Sad" | |
| elif any(word in text for word in ["angry", "mad", "furious"]): | |
| return "π‘ Angry" | |
| elif any(word in text for word in ["bored", "meh", "nothing"]): | |
| return "π Bored" | |
| else: | |
| return "π€ Not sure" | |
| demo = gr.Interface( | |
| fn=mood_detector, | |
| inputs=gr.Textbox(lines=2, placeholder="How are you feeling today?"), | |
| outputs="text", | |
| title="AI Emoji Mood Detector π§ ", | |
| description="Enter how you're feeling and get a mood emoji!" | |
| ) | |
| demo.launch() | |