Spaces:
Sleeping
Sleeping
| from transformers import pipeline | |
| import gradio as gr | |
| clf = pipeline("text-classification", model="vnarasiman/unwrap-base") | |
| def predict(text): | |
| result = clf(text)[0] | |
| return {"label": result["label"], "confidence": round(result["score"], 3)} | |
| gr.Interface( | |
| fn=predict, | |
| inputs=gr.Textbox(placeholder="Paste a Reddit comment here..."), | |
| outputs=gr.JSON(), | |
| ).launch() |