File size: 781 Bytes
c841e06 4af7f69 c841e06 4af7f69 0eb7d6f 4af7f69 c841e06 4af7f69 a36211e c841e06 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import gradio as gr
from predict_utils import load_model_and_thresholds, predict
model, tokenizer, thresholds = load_model_and_thresholds()
def classify(text):
return predict(text, model, tokenizer, thresholds)
gr.Interface(
fn=classify,
inputs=gr.Textbox(lines=4, placeholder="Masukkan teks cyberbullying..."),
outputs=gr.Label(label="Prediksi Cyberbullying", num_top_classes=12),
title="๐ฌ Deteksi Cyberbullying Multi-Label ๐ฎ๐ฉ",
description="Model IndoBERT + BiLSTM dengan threshold ROC-AUC. Menampilkan 12 label klasifikasi multi-label teks bahasa Indonesia.",
examples=[
["Dasar kamu goblok dan gak punya otak!"],
["Cewek seperti itu emang pantas dihina."],
["Pribumi kampungan gak punya budaya!"]
]
).launch() |