Spaces:
Sleeping
Sleeping
File size: 470 Bytes
10dce50 d816650 10dce50 e97639c 10dce50 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 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() |