AboutKeywords / app.py
Mohzen321's picture
Create app.py
ced22e1 verified
raw
history blame
535 Bytes
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!")