| # app.py | |
| import gradio as gr | |
| from Fraud_Detection_BERT_grado_6 import FinancialFraudTrainer | |
| trainer = FinancialFraudTrainer() | |
| trainer.load_model() | |
| app = gr.Interface( | |
| fn=trainer.predict_transaction, | |
| inputs=gr.Textbox(lines=3, placeholder="輸入交易簡訊..."), | |
| outputs="text", | |
| title="💳 中英文詐騙簡訊判斷器", | |
| description="輸入交易相關訊息,判斷是否為詐騙訊息(支援中文與英文)。" | |
| ) | |
| if __name__ == "__main__": | |
| app.launch(share=True, debug=True) | |