gau2345's picture
Update app.py
3df15be verified
Raw History Blame Contribute Delete
599 Bytes
import gradio as gr
from transformers import pipeline
MODEL_ID = "gau2345/autotrain-bk2rf-3sf1s" # your fine-tuned model repo
clf = pipeline("text-classification", model=MODEL_ID)
def predict(text):
out = clf(text, truncation=True)
# Return as label→score dict for a nice probability bar
return {r["label"]: float(r["score"]) for r in out}
gr.Interface(
fn=predict,
inputs=gr.Textbox(lines=3, label="Customer message"),
outputs=gr.Label(num_top_classes=5),
title="Amazon Intent Classifier",
description="Paste a customer message to classify intent."
).launch()