new_space_bool2 / app.py
Mahmoud3899's picture
Create app.py
a5068bb verified
raw
history blame
593 Bytes
import gradio as gr
from transformers import pipeline
# Load the classification pipeline from your model on the hub
classifier = pipeline("text-classification", model="Mahmoud3899/Boolean_new")
def classify_text(text):
results = classifier(text)
# Format output nicely
return {res["label"]: round(res["score"], 4) for res in results}
# Build Gradio UI
gr.Interface(
fn=classify_text,
inputs=gr.Textbox(lines=3, placeholder="Enter your text here..."),
outputs="label",
title="Boolean Classifier",
description="A classification model by Mahmoud3899"
).launch()