Spaces:
Sleeping
Sleeping
| 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() |