Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def audit_regbi(advice_text):
|
| 4 |
+
flags = []
|
| 5 |
+
score = 100
|
| 6 |
+
|
| 7 |
+
# REG BI / SEC Keywords
|
| 8 |
+
if "fiduciary" not in advice_text.lower():
|
| 9 |
+
flags.append("⚠️ Missing 'Fiduciary' Standard acknowledgement.")
|
| 10 |
+
score -= 20
|
| 11 |
+
if "conflict of interest" not in advice_text.lower() and "disclosure" not in advice_text.lower():
|
| 12 |
+
flags.append("🚨 Critical: No Conflict of Interest Disclosure detected.")
|
| 13 |
+
score -= 40
|
| 14 |
+
if "commission" in advice_text.lower() or "fee" in advice_text.lower():
|
| 15 |
+
if "offset" not in advice_text.lower():
|
| 16 |
+
flags.append("⚠️ Fee structure mentioned without 'Offset' or 'Net' clarification.")
|
| 17 |
+
score -= 15
|
| 18 |
+
|
| 19 |
+
if score < 60:
|
| 20 |
+
verdict = "FAIL: HIGH REGULATORY RISK"
|
| 21 |
+
else:
|
| 22 |
+
verdict = "PASS: COMPLIANT"
|
| 23 |
+
|
| 24 |
+
return f"VERDICT: {verdict}\nRISK SCORE: {score}/100\n\nFINDINGS:\n" + "\n".join(flags)
|
| 25 |
+
|
| 26 |
+
iface = gr.Interface(
|
| 27 |
+
fn=audit_regbi,
|
| 28 |
+
inputs=gr.Textbox(lines=10, placeholder="Paste Investment Advice / Client Email here..."),
|
| 29 |
+
outputs="text",
|
| 30 |
+
title="⚖️ WealthGuard RegBI Auditor",
|
| 31 |
+
description="Audits client communications for SEC Regulation Best Interest (Reg BI) compliance markers."
|
| 32 |
+
)
|
| 33 |
+
iface.launch()
|