Saad-Mirza / app.py
Saadmirza12's picture
Create app.py
9b51f32 verified
raw
history blame contribute delete
774 Bytes
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()