Spaces:
Build error
Build error
TokenopolyHQ commited on
Commit ·
3cbab5d
1
Parent(s): d287b8a
code update in app.py
Browse files
app.py
CHANGED
|
@@ -76,6 +76,9 @@ def chatbot_response(raw_text):
|
|
| 76 |
history = []
|
| 77 |
result = parse_banking_sms(raw_text)
|
| 78 |
|
|
|
|
|
|
|
|
|
|
| 79 |
if result["is_transaction"]:
|
| 80 |
response = (
|
| 81 |
"✅ **Transaction Detected!**\n\n"
|
|
@@ -84,22 +87,15 @@ def chatbot_response(raw_text):
|
|
| 84 |
f"💰 **Amount:** {result['amount']}\n"
|
| 85 |
f"🏪 **Category:** {result['category']}\n"
|
| 86 |
f"🔢 **Last 4 Digits:** {result['last4']}\n\n"
|
| 87 |
-
"**Full JSON:**\n```
|
| 88 |
-
+ json.dumps(result, indent=2)
|
| 89 |
-
+ "\n```"
|
| 90 |
)
|
| 91 |
else:
|
| 92 |
response = (
|
| 93 |
"ℹ️ **Non-Transaction Message**\n\n"
|
| 94 |
"This appears to be a promotional or informational message, not a banking transaction.\n\n"
|
| 95 |
-
"**Classification:**\n```
|
| 96 |
-
+ json.dumps(result, indent=2)
|
| 97 |
-
+ "\n```"
|
| 98 |
)
|
| 99 |
|
| 100 |
-
history.append((raw_text, response))
|
| 101 |
-
return history
|
| 102 |
-
|
| 103 |
# --------------------------------------------------
|
| 104 |
# 4. Gradio Interface
|
| 105 |
# --------------------------------------------------
|
|
|
|
| 76 |
history = []
|
| 77 |
result = parse_banking_sms(raw_text)
|
| 78 |
|
| 79 |
+
if result["is_transaction"]:
|
| 80 |
+
response = (
|
| 81 |
+
"✅ **Transaction Detected!**\n\n"
|
| 82 |
if result["is_transaction"]:
|
| 83 |
response = (
|
| 84 |
"✅ **Transaction Detected!**\n\n"
|
|
|
|
| 87 |
f"💰 **Amount:** {result['amount']}\n"
|
| 88 |
f"🏪 **Category:** {result['category']}\n"
|
| 89 |
f"🔢 **Last 4 Digits:** {result['last4']}\n\n"
|
| 90 |
+
f"**Full JSON:**\n```\n{json.dumps(result, indent=2)}\n```"
|
|
|
|
|
|
|
| 91 |
)
|
| 92 |
else:
|
| 93 |
response = (
|
| 94 |
"ℹ️ **Non-Transaction Message**\n\n"
|
| 95 |
"This appears to be a promotional or informational message, not a banking transaction.\n\n"
|
| 96 |
+
f"**Classification:**\n```\n{json.dumps(result, indent=2)}\n```"
|
|
|
|
|
|
|
| 97 |
)
|
| 98 |
|
|
|
|
|
|
|
|
|
|
| 99 |
# --------------------------------------------------
|
| 100 |
# 4. Gradio Interface
|
| 101 |
# --------------------------------------------------
|