|
import gradio as gr |
|
from mock_model import predict |
|
|
|
def run_app(amount, stage, industry, lead_score, emails, meetings, close_gap): |
|
input_data = { |
|
"amount": amount, |
|
"stage": stage, |
|
"industry": industry, |
|
"lead_score": lead_score, |
|
"emails_last_7_days": emails, |
|
"meetings_last_30_days": meetings, |
|
"close_date_gap": close_gap |
|
} |
|
result = predict(input_data, None, None, None) |
|
return result["score"], result["confidence"], result["risk"], result["recommendation"] |
|
|
|
demo = gr.Interface( |
|
fn=run_app, |
|
title="AI-Powered Deal Qualification Engine (Demo)", |
|
inputs=[ |
|
gr.Number(label="Amount (USD)", value=50000), |
|
gr.Dropdown(["Prospecting", "Proposal/Price Quote", "Negotiation", "Closed Won", "Closed Lost"], label="Stage"), |
|
gr.Textbox(label="Industry", value="Software"), |
|
gr.Number(label="Lead Score", value=85), |
|
gr.Number(label="Emails in Last 7 Days", value=3), |
|
gr.Number(label="Meetings in Last 30 Days", value=2), |
|
gr.Number(label="Close Date Gap (days)", value=10) |
|
], |
|
outputs=[ |
|
gr.Number(label="AI Score (0–100)"), |
|
gr.Number(label="Confidence (0–1)"), |
|
gr.Textbox(label="Risk Level"), |
|
gr.Textbox(label="Recommendation") |
|
] |
|
) |
|
|
|
if __name__ == "__main__": |
|
demo.launch() |
|
|