File size: 5,698 Bytes
ee74471 be39efb ee74471 eae084c ee74471 be39efb f367cc5 be39efb ee74471 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 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 |
import gradio as gr
from rag import rbc_product
from tool import rival_product
from graphrag import reasoning
with gr.Blocks() as demo:
with gr.Tab("RAG"):
gr.Markdown("""
Marketing
------------
GraphRAG: Models customer-product relationship networks for next-best-action predictions
DSPy: Optimizes cross-sell/upsell prompt variations through A/B testing
Risk & Audit
------------
GraphRAG: Maps transactional relationships into dynamic knowledge graphs to detect multi-layered fraud patterns
Tool Use: Integrates fraud detection APIs, anomaly scoring models, and regulatory compliance checkers
DSPy: Optimizes fraud explanation prompts for regulatory reporting
Other Use Case
------------
https://huggingface.co/spaces/kevinhug/clientX
https://kevinwkc.github.io/davinci/
""")
gr.Markdown("""
Retrieval: Public RBC Product Data
Recommend: RBC Product
""")
in_verbatim = gr.Textbox(label="Verbatim")
out_product = gr.Textbox(label="Product")
gr.Examples(
[
["Low APR and great customer service. I would highly recommend if you’re looking for a great credit card company and looking to rebuild your credit. I have had my credit limit increased annually and the annual fee is very low."]
],
[in_verbatim]
)
btn_recommend=gr.Button("Recommend")
btn_recommend.click(fn=rbc_product, inputs=in_verbatim, outputs=out_product)
with gr.Tab("Tool Use"):
gr.Markdown("""
Retrieval: Public Product Data using Tavily Search
Recommend: Competition Product
""")
in_verbatim = gr.Textbox(label="Verbatim")
out_product = gr.Textbox(label="Product")
gr.Examples(
[
["Low APR and great customer service. I would highly recommend if you’re looking for a great credit card company and looking to rebuild your credit. I have had my credit limit increased annually and the annual fee is very low."]
],
[in_verbatim]
)
btn_recommend=gr.Button("Recommend")
btn_recommend.click(fn=rival_product, inputs=in_verbatim, outputs=out_product)
with gr.Tab("graphrag"):
gr.Markdown("""
Reasoning from context, answering the question
""")
in_verbatim = gr.Textbox(label="Context")
in_question = gr.Textbox(label="Question")
out_product = gr.Textbox(label="Answer")
gr.Examples(
[
[
"""
A business model is not merely a static description but a dynamic ecosystem defined by five interdependent pillars:
Value Creation (What you sell): The core offering must solve a critical pain point or unlock untapped demand. This is the foundation of your value proposition—quantifiable (e.g., cost efficiency) or qualitative (e.g., exceptional user experience)—that differentiates you in the market.
Delivery Infrastructure (How you deliver): Channels and partnerships must align to ensure seamless access to your offering. For instance, a SaaS company might leverage cloud platforms for instant scalability, while a luxury brand prioritizes exclusive retail partnerships.
Customer Lifecycle Dynamics:
Acquisition: How do users discover you? Channels like organic search (SEO), targeted ads, or influencer partnerships must map to your customer segments’ behaviors.
Activation: Do first-time users experience immediate value? A fitness app, for example, might use onboarding tutorials to convert sign-ups into active users.
Retention: Is engagement sustained? Metrics like churn rate and CLV reveal whether your model fosters loyalty through features like personalized content or subscription perks.
Referral: Do users become advocates? Incentivize sharing through referral programs or viral loops (e.g., Dropbox’s storage rewards).
Revenue Architecture (How you monetize): Align pricing models (subscriptions, freemium tiers) with customer willingness-to-pay. For instance, a niche market might sustain premium pricing, while a mass-market product prioritizes volume.
Cost Symmetry: Every activity—from R&D to customer support—must balance against revenue streams. A low-cost airline, for example, optimizes for operational efficiency to maintain profitability.
Strategic Imperatives for Modern Business Models
Systemic Integration: Ohmae’s “3C’s” (Customer, Competitor, Company) remind us that acquisition channels and value propositions must adapt to shifting market realities. For instance, a retailer might pivot from brick-and-mortar to hybrid models post-pandemic.
Data-Driven Iteration: Use AARRR metrics to identify leaks in the funnel. If activation rates lag, refine onboarding; if referrals stagnate, enhance shareability.
Scalability through Partnerships: Key partners (e.g., tech vendors, logistics providers) can reduce overhead while expanding reach—critical for transitioning from niche to mass markets.
By framing each component as a strategic variable rather than a fixed element, businesses can continuously adapt to disruptions—a necessity in Ohmae’s vision of fluid, customer-first strategy.
"""]
],
[in_verbatim]
)
gr.Examples(
[
[
"""Create marketing campaign that can improve customer acquisition, activation, retention and referral for this persona:
Low APR and great customer service. I would highly recommend if you’re looking for a great credit card company and looking to rebuild your credit. I have had my credit limit increased annually and the annual fee is very low.
"""]
],
[in_question]
)
btn_recommend = gr.Button("Reasoning")
btn_recommend.click(fn=reasoning, inputs=[in_verbatim, in_question], outputs=out_product)
demo.launch(allowed_paths=["./xgb","./ts"]) |