Horologer/LeanSixSigma-AI-Lab-Define
0
1import gradio as gr2 3# Pre-filled DMAIC demo content4dmaic_content = {5 "Define": {6 "Problem Statement": "Every Monday, the coffee served in our company cafe is too cold or weak, leading to employee dissatisfaction.",7 "Business Case": "Poor-quality coffee reduces employee morale, creates repeated complaints, and results in wasted materials, costing the company approximately £200 per week.",8 "Goal Statement": "Ensure that 95% of coffees served on Mondays meet temperature and strength standards within four weeks.",9 "Scope": "Cafe coffee preparation from Monday morning start-up until final service. Excludes other beverages and days.",10 "Stakeholders": "Cafe Manager, Baristas, Facilities/Maintenance, Customer Service."11 },12 "Measure": {13 "Key Metrics": ["Temperature of coffee at service", "Strength (grams per cup)", "Number of complaints", "Wasted coffee volume"],14 "Data Collection": "Baristas record temperature and strength; complaints logged by Customer Service.",15 "Baseline Performance": "30% of Monday coffees are below standard; 15 complaints per week."16 },17 "Analyze": {18 "Root Causes": ["Inconsistent coffee machine calibration", "Barista preparation errors during Monday rush", "Equipment not fully preheated before service"],19 "Insights": "Most quality issues occur in the first 2 hours of Monday service."20 },21 "Improve": {22 "Actions": ["Standardize machine calibration", "Preheat machines before Monday service", "Barista refresher training"],23 "Expected Impact": "Reduce cold/weak coffees to under 5% and complaints to fewer than 3 per week."24 },25 "Control": {26 "Monitoring Plan": "Weekly checks of coffee temperature and strength; ongoing complaint tracking.",27 "SOP": "Include Monday preheat and calibration checklist.",28 "Responsibility": "Cafe Manager and Baristas to maintain standards; Customer Service to report issues."29 }30}31 32with gr.Blocks() as demo:33 gr.Markdown("# DMAIC AI Lab Full Demo")34 gr.Markdown("Professional pre-filled coffee example for teaching and demos. Use tabs to navigate each DMAIC phase. Actions can be checked off to simulate progress.")35 36 # Progress tracker (just a visual indicator)37 progress_text = gr.Markdown("**Progress:** Define → Measure → Analyze → Improve → Control")38 39 input_box = gr.Textbox(lines=2, placeholder="Enter your business problem here... (ignored for demo)")40 41 with gr.Tabs():42 for phase, content in dmaic_content.items():43 with gr.Tab(phase):44 for key, value in content.items():45 if isinstance(value, list):46 # Show each item with a checkbox47 for item in value:48 gr.Checkbox(label=item, value=False)49 else:50 # Show text in Markdown with color highlights51 gr.Markdown(f"**{key}:** {value}")52 53demo.launch()54 