Einstien's picture
Update app.py
e97639c verified
Raw
History Blame Contribute Delete
470 Bytes
import gradio as gr
from transformers import pipeline
my_text_classifier = pipeline("text-classification", model="Einstien/Final_Tuned_Model")
def predict(text):
result = my_text_classifier(text)
return result[0]['label'], result[0]['score']
app = gr.Interface(
fn=predict,
inputs=gr.Textbox(placeholder="Enter text here..."),
outputs=[
gr.Label(label="Predicted Class"),
gr.Number(label="Confidence Score")
]
)
app.launch()