jerrychen428 commited on
Commit
b5ab083
·
verified ·
1 Parent(s): 288a7c5

Create app,py

Browse files
Files changed (1) hide show
  1. app,py +19 -0
app,py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # app.py
2
+ from Fraud_Detection_BERT_grado_6 import FinancialFraudTrainer
3
+
4
+ trainer = FinancialFraudTrainer()
5
+ trainer.load_saved_model()
6
+
7
+ # 建立 Gradio 介面
8
+ import gradio as gr
9
+
10
+ demo = gr.Interface(
11
+ fn=self.predict_transaction, # 指定推論函式
12
+ inputs=gr.Textbox(lines=3, placeholder="輸入交易簡訊..."),
13
+ outputs="text",
14
+ title="💳 中英文詐騙簡訊判斷器",
15
+ description="輸入交易相關訊息,判斷是否為詐騙訊息(支援中文與英文)。"
16
+ ).launch(share=True, debug=True) # 如果防毒軟體會報錯,請將share=True, debug=True改為share=False
17
+
18
+ if __name__ == "__main__":
19
+ demo..launch(share=True, debug=True) # 如果防毒軟體會報錯,請將share=True, debug=True改為share=False