Mahmoud3899 commited on
Commit
a5068bb
·
verified ·
1 Parent(s): dc5b54b

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ # Load the classification pipeline from your model on the hub
5
+ classifier = pipeline("text-classification", model="Mahmoud3899/Boolean_new")
6
+
7
+ def classify_text(text):
8
+ results = classifier(text)
9
+ # Format output nicely
10
+ return {res["label"]: round(res["score"], 4) for res in results}
11
+
12
+ # Build Gradio UI
13
+ gr.Interface(
14
+ fn=classify_text,
15
+ inputs=gr.Textbox(lines=3, placeholder="Enter your text here..."),
16
+ outputs="label",
17
+ title="Boolean Classifier",
18
+ description="A classification model by Mahmoud3899"
19
+ ).launch()