Update app.py
Browse files
app.py
CHANGED
|
@@ -26,7 +26,47 @@ def ask(name):
|
|
| 26 |
else:
|
| 27 |
return "It is a non-banking message. May subject to be SPAM or other messages"
|
| 28 |
|
| 29 |
-
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
|
|
|
|
| 26 |
else:
|
| 27 |
return "It is a non-banking message. May subject to be SPAM or other messages"
|
| 28 |
|
| 29 |
+
interface = gr.Interface(
|
| 30 |
+
fn=ask, # Function to call for prediction
|
| 31 |
+
inputs=gr.Textbox(label="Enter the bank message here:", placeholder="Type your message...", lines=5), # Input component
|
| 32 |
+
outputs=gr.Textbox(label="Prediction"), # Output component
|
| 33 |
+
title="Bank Message Classifier", # Title of the interface
|
| 34 |
+
description="Classify your bank messages as 'Banking' or 'Non-Banking'.", # Description text
|
| 35 |
+
theme="compact", # UI theme for compact design
|
| 36 |
+
css="""
|
| 37 |
+
.gradio-container {
|
| 38 |
+
font-family: Arial, sans-serif;
|
| 39 |
+
background-color: #f4f4f4;
|
| 40 |
+
border-radius: 10px;
|
| 41 |
+
padding: 20px;
|
| 42 |
+
}
|
| 43 |
+
.gradio-title {
|
| 44 |
+
font-size: 24px;
|
| 45 |
+
font-weight: bold;
|
| 46 |
+
color: #333;
|
| 47 |
+
text-align: center;
|
| 48 |
+
}
|
| 49 |
+
.gradio-description {
|
| 50 |
+
font-size: 16px;
|
| 51 |
+
color: #666;
|
| 52 |
+
text-align: center;
|
| 53 |
+
margin-bottom: 20px;
|
| 54 |
+
}
|
| 55 |
+
.input_textbox {
|
| 56 |
+
border: 1px solid #ddd;
|
| 57 |
+
border-radius: 5px;
|
| 58 |
+
padding: 10px;
|
| 59 |
+
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
|
| 60 |
+
}
|
| 61 |
+
.output_textbox {
|
| 62 |
+
border: 1px solid #ddd;
|
| 63 |
+
border-radius: 5px;
|
| 64 |
+
padding: 10px;
|
| 65 |
+
background-color: #e9ffe9;
|
| 66 |
+
}
|
| 67 |
+
"""
|
| 68 |
+
)
|
| 69 |
+
|
| 70 |
+
interface.launch()
|
| 71 |
|
| 72 |
|