Spaces:
Sleeping
Sleeping
import streamlit as st | |
from transformers import pipeline | |
# تحميل النموذج | |
classifier = pipeline("text-classification", model="distilbert-base-uncased") | |
# عنوان التطبيق | |
st.title("Text Classification App") | |
# إدخال النص | |
text = st.text_area("Enter your text here:") | |
# زر التصنيف | |
if st.button("Classify"): | |
if text: | |
result = classifier(text) | |
label = result[0]['label'] | |
st.write(f"Classification Result: {label}") | |
else: | |
st.warning("Please enter some text!") |