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()