import gradio as gr | |
from transformers import pipeline | |
# تحميل النموذج | |
classifier = pipeline("text-classification", model="distilbert-base-uncased") | |
# دالة لتصنيف النص | |
def classify_text(text): | |
result = classifier(text) | |
return result[0]['label'] | |
# إنشاء واجهة مستخدم | |
iface = gr.Interface(fn=classify_text, inputs="text", outputs="text") | |
iface.launch() |