FikriRiyadi's picture
Create app.py
2e07337 verified
raw
history blame contribute delete
768 Bytes
import gradio as gr
from predict_utils import load_model_and_thresholds, predict
model, tokenizer, thresholds = load_model_and_thresholds()
def classify_text(text):
return predict(text, model, tokenizer, thresholds)
gr.Interface(
fn=classify_text,
inputs=gr.Textbox(lines=4, placeholder="Masukkan teks untuk dideteksi..."),
outputs=gr.Label(num_top_classes=12, label="Prediksi Cyberbullying"),
title="๐Ÿ’ฌ IndoRoBERTa Cyberbullying Classifier ๐Ÿ‡ฎ๐Ÿ‡ฉ",
description="Model klasifikasi multi-label cyberbullying Bahasa Indonesia menggunakan IndoRoBERTa. Akurasi F1-macro 84%.",
examples=[
["Kamu jelek, bodoh dan gak berguna!"],
["Kaum kalian harus dibasmi."],
["Aduh anak-anak ini bikin kesel."]
]
).launch()