Spaces:
Sleeping
Sleeping
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() |