shahadd / app.py
ShahadFawaz99's picture
Create app.py
4831e84 verified
raw
history blame
No virus
1.26 kB
import gradio as gr
# دالة التصنيف
def classify_location(item):
# تصنيف الأشياء حسب المكان
kitchen_items = ["قهوة", "مطبخ", "مقلاة", "ثلاجة", "خلاط"]
bathroom_items = ["صابون", "منشفة", "فرشاة أسنان", "شامبو", "مرآة"]
bedroom_items = ["سرير", "وسادة", "لحاف", "خزانة", "منبه"]
# التحقق من التصنيف بناءً على الكلمات المفتاحية
if any(word in item.lower() for word in kitchen_items):
return "📍 المطبخ"
elif any(word in item.lower() for word in bathroom_items):
return "📍 دورة المياه"
elif any(word in item.lower() for word in bedroom_items):
return "📍 غرفة النوم"
else:
return "📍 غير محدد"
# إعداد واجهة gradio
iface = gr.Interface(fn=classify_location,
inputs="text",
outputs="text",
title="تصنيف الأشياء المنزلية",
description="أدخل اسم الشيء لتصنيفه إلى المطبخ، دورة المياه، أو غرفة النوم.")
# تشغيل الواجهة
iface.launch()