|
import gradio as gr |
|
from transformers import pipeline |
|
|
|
|
|
classifier = pipeline("text-classification",model="AbraMuhara/Fine-TunedBERTURKOfansifTespit") |
|
|
|
|
|
def classify_text(text): |
|
|
|
result = classifier(text) |
|
|
|
label = result[0]['label'] |
|
score = result[0]['score'] |
|
return f"Label: {label}\nScore: {score:.4f}" |
|
|
|
|
|
iface = gr.Interface( |
|
fn=classify_text, |
|
inputs=gr.Textbox(), |
|
outputs=gr.Text(), |
|
title="Text Classification", |
|
description="Enter text to classify it and get the prediction label and score." |
|
) |
|
|
|
|
|
iface.launch() |
|
|