Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,146 +1,297 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import pandas as pd
|
|
|
|
| 3 |
from GoogleNews import GoogleNews
|
| 4 |
from transformers import pipeline
|
| 5 |
import plotly.express as px
|
|
|
|
| 6 |
import dateparser
|
| 7 |
-
from datetime import datetime
|
| 8 |
|
| 9 |
-
# --- CONFIG ---
|
| 10 |
-
st.set_page_config(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
#
|
| 13 |
st.markdown("""
|
| 14 |
<style>
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
color:
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
</style>
|
| 24 |
""", unsafe_allow_html=True)
|
| 25 |
|
|
|
|
| 26 |
@st.cache_resource
|
| 27 |
-
def
|
| 28 |
-
|
| 29 |
return pipeline("zero-shot-classification", model="facebook/bart-large-mnli")
|
| 30 |
|
| 31 |
-
analyzer =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
-
def
|
| 34 |
-
|
|
|
|
|
|
|
| 35 |
gn.clear()
|
| 36 |
|
| 37 |
-
|
|
|
|
| 38 |
if mode == "Social Buzz (Risk)":
|
| 39 |
-
|
|
|
|
|
|
|
| 40 |
|
| 41 |
-
gn.search(
|
| 42 |
results = gn.result()
|
| 43 |
|
| 44 |
-
|
| 45 |
-
if len(results) < 5:
|
| 46 |
gn.getpage(2)
|
| 47 |
-
results = gn.result()
|
| 48 |
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
else:
|
| 62 |
-
|
| 63 |
-
"- Maintain current transparency levels.",
|
| 64 |
-
"- Use this period for aggressive market expansion."]
|
| 65 |
|
| 66 |
-
#
|
| 67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
with st.sidebar:
|
| 70 |
-
st.header("
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
|
|
|
|
|
|
| 74 |
|
| 75 |
-
|
|
|
|
|
|
|
| 76 |
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import pandas as pd
|
| 3 |
+
import numpy as np
|
| 4 |
from GoogleNews import GoogleNews
|
| 5 |
from transformers import pipeline
|
| 6 |
import plotly.express as px
|
| 7 |
+
import plotly.graph_objects as go
|
| 8 |
import dateparser
|
| 9 |
+
from datetime import datetime, timedelta
|
| 10 |
|
| 11 |
+
# --- SYSTEM CONFIG ---
|
| 12 |
+
st.set_page_config(
|
| 13 |
+
page_title="VBI Terminal: Strategic AI",
|
| 14 |
+
page_icon="🛡️",
|
| 15 |
+
layout="wide",
|
| 16 |
+
initial_sidebar_state="collapsed"
|
| 17 |
+
)
|
| 18 |
|
| 19 |
+
# --- PROFESSIONAL UI (Cyberpunk/Terminal Style) ---
|
| 20 |
st.markdown("""
|
| 21 |
<style>
|
| 22 |
+
/* Dark Deep Background */
|
| 23 |
+
.stApp { background-color: #0f172a; color: #e2e8f0; }
|
| 24 |
+
|
| 25 |
+
/* Metrics Cards */
|
| 26 |
+
[data-testid="stMetric"] {
|
| 27 |
+
background-color: #1e293b !important;
|
| 28 |
+
border: 1px solid #334155 !important;
|
| 29 |
+
border-left: 5px solid #0ea5e9 !important;
|
| 30 |
+
border-radius: 8px;
|
| 31 |
+
padding: 15px !important;
|
| 32 |
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
|
| 33 |
+
}
|
| 34 |
+
[data-testid="stMetricLabel"] p { color: #94a3b8 !important; font-size: 0.9rem !important; }
|
| 35 |
+
[data-testid="stMetricValue"] div { color: #f8fafc !important; font-size: 2rem !important; }
|
| 36 |
+
|
| 37 |
+
/* Advisor Box */
|
| 38 |
+
.advisor-box {
|
| 39 |
+
background-color: #334155;
|
| 40 |
+
border: 1px solid #10b981;
|
| 41 |
+
border-radius: 10px;
|
| 42 |
+
padding: 20px;
|
| 43 |
+
margin-top: 20px;
|
| 44 |
+
color: #f0fdf4;
|
| 45 |
}
|
| 46 |
+
.warning-box {
|
| 47 |
+
background-color: #450a0a;
|
| 48 |
+
border: 1px solid #ef4444;
|
| 49 |
+
border-radius: 10px;
|
| 50 |
+
padding: 20px;
|
| 51 |
+
margin-top: 20px;
|
| 52 |
+
color: #fef2f2;
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
/* Tables */
|
| 56 |
+
.stDataFrame { border: 1px solid #334155; border-radius: 5px; }
|
| 57 |
</style>
|
| 58 |
""", unsafe_allow_html=True)
|
| 59 |
|
| 60 |
+
# --- AI ENGINE ---
|
| 61 |
@st.cache_resource
|
| 62 |
+
def load_neural_engine():
|
| 63 |
+
"""Load Zero-Shot Classification Model"""
|
| 64 |
return pipeline("zero-shot-classification", model="facebook/bart-large-mnli")
|
| 65 |
|
| 66 |
+
analyzer = load_neural_engine()
|
| 67 |
+
|
| 68 |
+
# --- INTELLIGENCE ENGINE ---
|
| 69 |
+
def calculate_source_weight(source_name):
|
| 70 |
+
"""Assigns weight based on source credibility (Heuristic)"""
|
| 71 |
+
source_name = str(source_name).lower()
|
| 72 |
+
if any(x in source_name for x in ['reuters', 'bloomberg', 'forbes', 'tengrinews', 'zakon', 'kapital']):
|
| 73 |
+
return 2.0 # High Impact Tier 1
|
| 74 |
+
elif any(x in source_name for x in ['blog', 'reddit', 'twitter', 'post']):
|
| 75 |
+
return 0.8 # Low Impact / High Noise
|
| 76 |
+
return 1.0 # Standard
|
| 77 |
|
| 78 |
+
def fetch_intelligence(query, region, depth, mode):
|
| 79 |
+
"""Fetches real-time data using OSINT techniques."""
|
| 80 |
+
lang_set = 'en'
|
| 81 |
+
gn = GoogleNews(lang=lang_set, region=region)
|
| 82 |
gn.clear()
|
| 83 |
|
| 84 |
+
# Advanced Query Logic
|
| 85 |
+
final_query = query
|
| 86 |
if mode == "Social Buzz (Risk)":
|
| 87 |
+
final_query = f'{query} AND ("scandal" OR "fail" OR "crash" OR "complaint" OR "leak" OR "reddit" OR "opinion")'
|
| 88 |
+
elif mode == "Financial Intel":
|
| 89 |
+
final_query = f'{query} AND ("stock" OR "profit" OR "loss" OR "quarter" OR "ipo" OR "revenue")'
|
| 90 |
|
| 91 |
+
gn.search(final_query)
|
| 92 |
results = gn.result()
|
| 93 |
|
| 94 |
+
if len(results) < depth:
|
|
|
|
| 95 |
gn.getpage(2)
|
| 96 |
+
results += gn.result()
|
| 97 |
|
| 98 |
+
clean_data = []
|
| 99 |
+
seen_titles = set()
|
| 100 |
+
|
| 101 |
+
for item in results[:depth]:
|
| 102 |
+
title = item.get('title', '')
|
| 103 |
+
if title in seen_titles: continue
|
| 104 |
+
seen_titles.add(title)
|
| 105 |
+
|
| 106 |
+
raw_date = item.get('date', '')
|
| 107 |
+
parsed_date = dateparser.parse(raw_date)
|
| 108 |
+
if not parsed_date:
|
| 109 |
+
parsed_date = datetime.now()
|
| 110 |
+
|
| 111 |
+
source_label = item.get('media', 'Unknown Node')
|
| 112 |
+
weight = calculate_source_weight(source_label)
|
| 113 |
+
|
| 114 |
+
clean_data.append({
|
| 115 |
+
"Timestamp": parsed_date,
|
| 116 |
+
"Source": source_label,
|
| 117 |
+
"Headline": title,
|
| 118 |
+
"Link": item.get('link', '#'),
|
| 119 |
+
"Weight": weight
|
| 120 |
+
})
|
| 121 |
+
return clean_data
|
| 122 |
+
|
| 123 |
+
# --- STRATEGIC ADVISOR MODULE ---
|
| 124 |
+
def generate_ai_advice(rep_index, top_risk, volatility, sentiment_ratio):
|
| 125 |
+
"""Generates text-based strategy based on metrics."""
|
| 126 |
+
advice = []
|
| 127 |
+
status = "STABLE"
|
| 128 |
+
css_class = "advisor-box"
|
| 129 |
+
|
| 130 |
+
# 1. Reputation Assessment
|
| 131 |
+
if rep_index < 40:
|
| 132 |
+
status = "CRITICAL"
|
| 133 |
+
css_class = "warning-box"
|
| 134 |
+
advice.append(f"🚨 **CRISIS MODE ACTIVATED:** Reputation Index ({round(rep_index)}%) is critically low. Immediate PR intervention required.")
|
| 135 |
+
elif rep_index < 60:
|
| 136 |
+
status = "VOLATILE"
|
| 137 |
+
advice.append(f"⚠️ **Caution:** Brand sentiment is mixed ({round(rep_index)}%). Monitor closely.")
|
| 138 |
else:
|
| 139 |
+
advice.append(f"✅ **Healthy:** Strong market perception ({round(rep_index)}%). Focus on maintaining momentum.")
|
|
|
|
|
|
|
| 140 |
|
| 141 |
+
# 2. Risk Specific Strategy
|
| 142 |
+
if top_risk == "Legal/Compliance":
|
| 143 |
+
advice.append("⚖️ **Legal Vector:** High volume of legal discussions detected. Prepare official statements regarding compliance/lawsuits immediately.")
|
| 144 |
+
elif top_risk == "Technical Failure":
|
| 145 |
+
advice.append("🔧 **Ops Vector:** Technical complaints are trending. Issue a transparency report on uptime/fixes to reassure customers.")
|
| 146 |
+
elif top_risk == "Financial Risk":
|
| 147 |
+
advice.append("📉 **Market Vector:** Financial anxiety detected. IR (Investor Relations) should release clarifying data.")
|
| 148 |
+
elif top_risk == "PR Crisis":
|
| 149 |
+
advice.append("📣 **PR Vector:** Viral negativity detected. Do not ignore. Use 'Recall & Reframe' strategy.")
|
| 150 |
|
| 151 |
+
# 3. Volatility Check
|
| 152 |
+
if volatility > 0.3:
|
| 153 |
+
advice.append("🌊 **High Volatility:** Opinions are shifting rapidly. Avoid controversial statements for 48h.")
|
| 154 |
+
|
| 155 |
+
return status, "\n\n".join(advice), css_class
|
| 156 |
+
|
| 157 |
+
# --- SIDEBAR ---
|
| 158 |
with st.sidebar:
|
| 159 |
+
st.header("🛰️ VBI: COMMAND")
|
| 160 |
+
target_region = st.selectbox("Geo-Node", ["KZ", "US", "GB", "RU"], index=0)
|
| 161 |
+
source_mode = st.radio("Signal Mode:", ["Corporate News", "Social Buzz (Risk)", "Financial Intel"])
|
| 162 |
+
scan_depth = st.slider("Depth", 10, 60, 30)
|
| 163 |
+
st.divider()
|
| 164 |
+
st.markdown("Created by **VBI Intelligence**")
|
| 165 |
|
| 166 |
+
# --- MAIN LAYOUT ---
|
| 167 |
+
st.title("🛡️ VBI: Strategic Brand Intelligence")
|
| 168 |
+
st.markdown("`v2.0` | Neural OSINT & Automated Strategy Generation")
|
| 169 |
|
| 170 |
+
col_search, col_btn = st.columns([4, 1])
|
| 171 |
+
with col_search:
|
| 172 |
+
target_query = st.text_input("TARGET ENTITY:", placeholder="e.g. FlyArystan, Kaspi, KazMunayGas")
|
| 173 |
+
with col_btn:
|
| 174 |
+
st.write("")
|
| 175 |
+
st.write("")
|
| 176 |
+
start_btn = st.button("🚀 INITIATE SCAN", use_container_width=True)
|
| 177 |
+
|
| 178 |
+
if start_btn and target_query:
|
| 179 |
+
with st.spinner(f"🛰️ Intercepting signals for '{target_query}'..."):
|
| 180 |
+
# 1. Fetch
|
| 181 |
+
raw_data = fetch_intelligence(target_query, target_region, scan_depth, source_mode)
|
| 182 |
+
|
| 183 |
+
if not raw_data:
|
| 184 |
+
st.error("No signals detected. System Standby.")
|
| 185 |
+
else:
|
| 186 |
+
# 2. Process
|
| 187 |
+
processed_data = []
|
| 188 |
+
risk_vectors = ["Legal/Compliance", "Financial Risk", "Technical Failure", "Market Expansion", "PR Crisis", "Customer Service"]
|
| 189 |
+
sentiment_cats = ["Positive", "Negative", "Neutral"]
|
| 190 |
+
|
| 191 |
+
prog = st.progress(0)
|
| 192 |
+
for i, item in enumerate(raw_data):
|
| 193 |
+
# Neural Analysis
|
| 194 |
+
risk_out = analyzer(item['Headline'], candidate_labels=risk_vectors)
|
| 195 |
+
sent_out = analyzer(item['Headline'], candidate_labels=sentiment_cats)
|
| 196 |
|
| 197 |
+
# Logic: If Risk Score is low, it might be just General News
|
| 198 |
+
top_risk = risk_out['labels'][0]
|
| 199 |
+
if risk_out['scores'][0] < 0.4:
|
| 200 |
+
top_risk = "General Noise"
|
| 201 |
+
|
| 202 |
+
# Weighted Score Calculation
|
| 203 |
+
sent_score = 1 if sent_out['labels'][0] == 'Positive' else -1 if sent_out['labels'][0] == 'Negative' else 0
|
| 204 |
+
weighted_impact = sent_score * item['Weight']
|
| 205 |
+
|
| 206 |
+
processed_data.append({
|
| 207 |
+
"Time": item['Timestamp'],
|
| 208 |
+
"Source": item['Source'],
|
| 209 |
+
"Headline": item['Headline'],
|
| 210 |
+
"Risk Category": top_risk,
|
| 211 |
+
"Risk Conf": risk_out['scores'][0],
|
| 212 |
+
"Sentiment": sent_out['labels'][0],
|
| 213 |
+
"Impact Score": weighted_impact
|
| 214 |
+
})
|
| 215 |
+
prog.progress((i + 1) / len(raw_data))
|
| 216 |
+
prog.empty()
|
| 217 |
+
|
| 218 |
+
df = pd.DataFrame(processed_data).sort_values(by='Time')
|
| 219 |
+
|
| 220 |
+
# --- ANALYTICS ENGINE ---
|
| 221 |
+
total_impact = df['Impact Score'].sum()
|
| 222 |
+
total_weight = df['Impact Score'].abs().sum() if df['Impact Score'].abs().sum() != 0 else 1
|
| 223 |
+
|
| 224 |
+
# Reputation Index (0-100)
|
| 225 |
+
rep_index = 50 + ((total_impact / len(df)) * 50)
|
| 226 |
+
rep_index = max(0, min(100, rep_index)) # Clamp 0-100
|
| 227 |
+
|
| 228 |
+
# Volatility (Std Dev of Impact)
|
| 229 |
+
volatility = df['Impact Score'].std()
|
| 230 |
+
|
| 231 |
+
# Top Risk
|
| 232 |
+
top_risk_cat = df['Risk Category'].value_counts().idxmax()
|
| 233 |
+
|
| 234 |
+
# Advice Generation
|
| 235 |
+
status, strategy_text, css_style = generate_ai_advice(rep_index, top_risk_cat, volatility, 0)
|
| 236 |
+
|
| 237 |
+
# --- DASHBOARD ---
|
| 238 |
+
|
| 239 |
+
# 1. STRATEGIC ADVISOR BLOCK
|
| 240 |
+
st.markdown(f"""
|
| 241 |
+
<div class="{css_style}">
|
| 242 |
+
<h3>🧠 AI Strategic Advisor: {status}</h3>
|
| 243 |
+
<div style='white-space: pre-wrap; font-size: 1.1rem;'>{strategy_text}</div>
|
| 244 |
+
</div>
|
| 245 |
+
""", unsafe_allow_html=True)
|
| 246 |
+
|
| 247 |
+
st.divider()
|
| 248 |
+
|
| 249 |
+
# 2. KEY METRICS
|
| 250 |
+
m1, m2, m3, m4 = st.columns(4)
|
| 251 |
+
m1.metric("Reputation Index", f"{round(rep_index, 1)}%", delta="Weighted Impact")
|
| 252 |
+
m2.metric("Signal Volume", len(df))
|
| 253 |
+
m3.metric("Primary Threat", top_risk_cat, delta_color="off")
|
| 254 |
+
m4.metric("Volatility", f"{round(volatility, 2)}", help="Higher means less stable opinions")
|
| 255 |
+
|
| 256 |
+
# 3. VISUALIZATIONS
|
| 257 |
+
st.subheader("📊 Visual Intelligence")
|
| 258 |
+
|
| 259 |
+
tab1, tab2 = st.tabs(["📈 Trend Dynamics", "🛡️ Risk Matrix"])
|
| 260 |
+
|
| 261 |
+
with tab1:
|
| 262 |
+
# Rolling Average Trend
|
| 263 |
+
df['MA'] = df['Impact Score'].rolling(window=3).mean()
|
| 264 |
+
fig_trend = go.Figure()
|
| 265 |
+
fig_trend.add_trace(go.Scatter(x=df['Time'], y=df['Impact Score'], mode='markers', name='Raw Signal', marker=dict(color='#94a3b8')))
|
| 266 |
+
fig_trend.add_trace(go.Scatter(x=df['Time'], y=df['MA'], mode='lines', name='Reputation Trend', line=dict(color='#38bdf8', width=3)))
|
| 267 |
+
fig_trend.update_layout(title="Reputation Stability Over Time", template="plotly_dark", paper_bgcolor='rgba(0,0,0,0)', plot_bgcolor='rgba(0,0,0,0)')
|
| 268 |
+
st.plotly_chart(fig_trend, use_container_width=True)
|
| 269 |
+
|
| 270 |
+
with tab2:
|
| 271 |
+
c1, c2 = st.columns(2)
|
| 272 |
+
with c1:
|
| 273 |
+
fig_pie = px.pie(df, names='Sentiment', title="Sentiment Distribution", color='Sentiment',
|
| 274 |
+
color_discrete_map={"Positive": "#10b981", "Negative": "#ef4444", "Neutral": "#64748b"})
|
| 275 |
+
fig_pie.update_layout(template="plotly_dark", paper_bgcolor='rgba(0,0,0,0)')
|
| 276 |
+
st.plotly_chart(fig_pie, use_container_width=True)
|
| 277 |
+
with c2:
|
| 278 |
+
risk_counts = df['Risk Category'].value_counts().reset_index()
|
| 279 |
+
risk_counts.columns = ['Risk', 'Count']
|
| 280 |
+
fig_bar = px.bar(risk_counts, x='Count', y='Risk', orientation='h', title="Risk Vectors",
|
| 281 |
+
color='Count', color_continuous_scale='Redor')
|
| 282 |
+
fig_bar.update_layout(template="plotly_dark", paper_bgcolor='rgba(0,0,0,0)')
|
| 283 |
+
st.plotly_chart(fig_bar, use_container_width=True)
|
| 284 |
+
|
| 285 |
+
# 4. INTELLIGENCE LOG
|
| 286 |
+
st.subheader("📡 Decrypted Signal Log")
|
| 287 |
+
|
| 288 |
+
def highlight_risk(val):
|
| 289 |
+
color = '#ef4444' if val in ['Legal/Compliance', 'Technical Failure', 'PR Crisis'] else '#cbd5e1'
|
| 290 |
+
return f'color: {color}'
|
| 291 |
+
|
| 292 |
+
display_df = df[['Time', 'Source', 'Headline', 'Risk Category', 'Sentiment', 'Impact Score']].copy()
|
| 293 |
+
st.dataframe(
|
| 294 |
+
display_df.style.map(highlight_risk, subset=['Risk Category']),
|
| 295 |
+
use_container_width=True,
|
| 296 |
+
height=400
|
| 297 |
+
)
|