FikriRiyadi's picture
Update app.py
0eb7d6f verified
raw
history blame contribute delete
781 Bytes
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()