"""
AI-Powered Marketing Automation & Lead Generation for SMEs
Main entry-point / Home page
"""
import streamlit as st
from utils.helpers import PHASE_DESCRIPTIONS, load_leads, load_bank
st.set_page_config(
page_title="AI Marketing Automation β SME",
page_icon="π",
layout="wide",
initial_sidebar_state="expanded",
)
# ββ Custom CSS ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
st.markdown("""
""", unsafe_allow_html=True)
# ββ Hero Banner βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
st.markdown("""
π AI-Powered Marketing Automation
Lead Generation & Scoring Framework for Small and Medium Enterprises (SMEs)
Bank Marketing Dataset (UCI) | Lead Scoring Dataset (Kaggle)
""", unsafe_allow_html=True)
# ββ Quick dataset stats βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
with st.spinner("Loading datasetsβ¦"):
leads = load_leads()
bank = load_bank()
c1, c2, c3, c4, c5, c6 = st.columns(6)
stats = [
(f"{len(leads):,}", "Lead Records"),
(f"{leads.shape[1]}", "Lead Features"),
(f"{leads['Converted'].mean()*100:.1f}%", "Lead Conv. Rate"),
(f"{len(bank):,}", "Bank Records"),
(f"{bank.shape[1]}", "Bank Features"),
(f"{(bank['y']=='yes').mean()*100:.1f}%", "Bank Sub. Rate"),
]
for col, (val, lbl) in zip([c1,c2,c3,c4,c5,c6], stats):
col.markdown(f'', unsafe_allow_html=True)
st.markdown("---")
# ββ Phase Overview ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
st.markdown("### π Implementation Phases")
st.markdown("Navigate through each phase using the **sidebar** on the left.")
cols = st.columns(3)
for idx, (phase_num, (title, desc)) in enumerate(PHASE_DESCRIPTIONS.items()):
with cols[idx % 3]:
st.markdown(
f''
f'Phase {phase_num}
'
f'{title}
'
f'{desc}'
f'
',
unsafe_allow_html=True,
)
st.markdown("---")
# ββ Research Goals Summary ββββββββββββββββββββββββββββββββββββββββββββββββββββ
with st.expander("π Research Goals & Background"):
st.markdown("""
**This system implements the research framework from:**
> *AI-Powered Marketing Automation and Lead Generation for SMEs*
#### Key Research Goals
| Goal | Description |
|------|-------------|
| **G1 β Integrated AI Framework** | Combine classification, NLP, and conversational AI |
| **G2 β Lead Scoring** | Evaluate LR, RF, XGBoost, LightGBM, SVM, MLP |
| **G3 β Empirical Validation** | Benchmark on Kaggle Leads (~9k) & UCI Bank (~45k) |
| **G4 β NLP Effectiveness** | Intent, sentiment, engagement signal extraction |
| **G5 β Conversational AI** | Chatbot for 24/7 lead qualification |
| **G6 β Ethics & Privacy** | Bias detection, GDPR compliance, explainability |
| **G7 β ROI Analysis** | Quantify conversion uplift and cost savings |
#### Datasets
- **Leads Dataset** β EdTech platform, ~9,240 records, 37 features, 38.5% conversion rate
- **Bank Marketing Dataset** β Portuguese bank, ~45,211 records, 17 features, 11.7% subscription rate
""")
st.info("π **Use the sidebar to navigate between phases.** Start with **Phase 1 β Data Loading**.")