File size: 535 Bytes
ced22e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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!")