Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| import pandas as pd | |
| # Define survey questions and options | |
| survey_data = { | |
| "What % of recurring issues have well-defined SOPs or repeatable resolution steps?": { | |
| "< 20%": 1, | |
| "20β50%": 2, | |
| "51β70%": 3, | |
| "71β90%": 4, | |
| "> 90%": 5 | |
| }, | |
| "Are SOPs documented in a standardized and machine-readable format (e.g., YAML, BPMN)?": { | |
| "Not documented": 1, | |
| "Free-text or wiki-based": 2, | |
| "Semi-structured documents (PDFs, flows)": 3, | |
| "Structured formats (JSON, forms)": 4, | |
| "Fully machine-readable & API-integrated": 5 | |
| }, | |
| "What % of tickets & service requests (SRs) are low complexity and potentially automatable?": { | |
| "< 10%": 1, | |
| "10β30%": 2, | |
| "31β50%": 3, | |
| "51β70%": 4, | |
| "> 70%": 5 | |
| }, | |
| "How well are alerts integrated with your ticketing system?": { | |
| "No integration": 1, | |
| "Manual linking": 2, | |
| "Basic rule-based mapping": 3, | |
| "Event-driven ticket creation": 4, | |
| "Full integration with correlation logic": 5 | |
| }, | |
| "How mature is your knowledge management system?": { | |
| "Tribal knowledge / ad-hoc": 1, | |
| "Partially documented but not maintained": 2, | |
| "Basic documentation maintained": 3, | |
| "Regularly updated and searchable KB": 4, | |
| "Integrated with AI/chatbot search": 5 | |
| }, | |
| "What % of your teamβs decisions are made using documented knowledge assets?": { | |
| "< 10%": 1, | |
| "10β30%": 2, | |
| "31β50%": 3, | |
| "51β70%": 4, | |
| "> 70%": 5 | |
| }, | |
| "How well is your monitoring and alerting infrastructure set up?": { | |
| "Minimal / reactive alerts only": 1, | |
| "Basic metrics dashboards": 2, | |
| "Alerts with some thresholds set": 3, | |
| "Advanced monitoring with alerts & log correlation": 4, | |
| "AI-powered observability with predictive insights": 5 | |
| }, | |
| "How frequently do you do health checks or preemptive diagnostics?": { | |
| "Only when issues arise": 1, | |
| "Ad-hoc manual checks": 2, | |
| "Weekly manual checks": 3, | |
| "Automated scheduled checks": 4, | |
| "Continuous monitoring with anomaly detection": 5 | |
| }, | |
| "What % of operational workload is non-ticket-based (e.g., maintenance, health checks)?": { | |
| "< 10%": 1, | |
| "10β30%": 2, | |
| "31β50%": 3, | |
| "51β70%": 4, | |
| "> 70%": 5 | |
| }, | |
| "What % of incidents are resolved without human intervention today?": { | |
| "< 5%": 1, | |
| "5β10%": 2, | |
| "11β25%": 3, | |
| "26β50%": 4, | |
| "> 50%": 5 | |
| }, | |
| "What is your team's comfort with adopting automation tools (bots, RPA, AI agents)?": { | |
| "Resistant / low exposure": 1, | |
| "Curious but skeptical": 2, | |
| "Open but not trained": 3, | |
| "Familiar & trained on automation tools": 4, | |
| "Already using automation in daily work": 5 | |
| }, | |
| "Are there governance frameworks to support automation (approvals, security, versioning)?": { | |
| "None": 1, | |
| "Informal guidelines": 2, | |
| "Partial policy in place": 3, | |
| "Documented governance policies": 4, | |
| "Mature, enforced automation governance": 5 | |
| } | |
| } | |
| # Benefit calculation logic | |
| def calculate_benefit(score): | |
| if 1 <= score <= 20: | |
| return "Low", "20 to 30%" | |
| elif 21 <= score <= 40: | |
| return "Medium", "30 to 40%" | |
| elif 41 <= score <= 60: | |
| return "High", "40 to 50%" | |
| else: | |
| return "Unknown", "Unknown" | |
| # Streamlit UI | |
| st.title("Automation Potential Survey") | |
| st.write("Answer the following questions to estimate the potential benefits of implementing our automation solution.") | |
| # Initialize session state for responses | |
| if 'responses' not in st.session_state: | |
| st.session_state.responses = {} | |
| # Display survey questions | |
| for question, options in survey_data.items(): | |
| st.subheader(question) | |
| response = st.radio( | |
| question, | |
| list(options.keys()), | |
| key=question, | |
| index=0 | |
| ) | |
| st.session_state.responses[question] = response | |
| # Calculate and display results | |
| if st.button("Submit Survey"): | |
| total_score = 0 | |
| for question, response in st.session_state.responses.items(): | |
| score = survey_data[question][response] | |
| total_score += score | |
| benefit, effort_reduction = calculate_benefit(total_score) | |
| st.write("### Survey Results") | |
| st.write(f"**Total Score**: {total_score}") | |
| st.write(f"**Benefit Level**: {benefit}") | |
| st.write(f"**Potential Effort Reduction**: {effort_reduction}") | |
| st.write("Thank you for completing the survey! This assessment indicates the potential efficiency gains from our automation solution.") | |