Mohzen321 commited on
Commit
ced22e1
·
verified ·
1 Parent(s): 4c70655

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -0
app.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from transformers import pipeline
3
+
4
+ # تحميل النموذج
5
+ classifier = pipeline("text-classification", model="distilbert-base-uncased")
6
+
7
+ # عنوان التطبيق
8
+ st.title("Text Classification App")
9
+
10
+ # إدخال النص
11
+ text = st.text_area("Enter your text here:")
12
+
13
+ # زر التصنيف
14
+ if st.button("Classify"):
15
+ if text:
16
+ result = classifier(text)
17
+ label = result[0]['label']
18
+ st.write(f"Classification Result: {label}")
19
+ else:
20
+ st.warning("Please enter some text!")