FikriRiyadi commited on
Commit
73bdbb3
·
verified ·
1 Parent(s): 1bb7f18

Create app.py

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