File size: 698 Bytes
73bdbb3 22c8df9 73bdbb3 22c8df9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import gradio as gr
from predict_utils import load_model, predict
model, tokenizer = load_model()
def classify(text):
return predict(text, model, tokenizer)
demo = gr.Interface(
fn=classify,
inputs=gr.Textbox(lines=4, placeholder="Masukkan teks cyberbullying..."),
outputs=gr.Label(label="Prediksi Cyberbullying"),
title="🚨 Deteksi Cyberbullying Berbahasa Indonesia",
description="Model hybrid IndoBERT + BiLSTM untuk klasifikasi 10 kategori cyberbullying (multi-label).",
examples=[
["Dasar kamu bodoh dan gak guna!"],
["Kaum kalian harus dimusnahkan dari muka bumi."],
["Kamu terlalu kurus, kayak tengkorak jalan!"]
]
)
demo.launch() |