Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| from api.config import ROUTING_MAP, ACTION_MAP | |
| from api.classifier import infer | |
| st.title("Support Ticket Router") | |
| st.caption("AI-powered intent classification for customer support") | |
| text = st.text_area("Enter customer message:", height=100) | |
| if st.button("Classify"): | |
| result = infer(text) | |
| st.write(result) | |
| col1, col2 = st.columns(2) | |
| with col1: | |
| intent = result["intent"] | |
| st.metric("Intent", intent) | |
| st.metric("Confidence", f"{result['confidence']*100:.1f}%") | |
| with col2: | |
| st.metric("Latency", f"{result['latency_ms']:.0f}ms") | |
| st.metric("Routed to", ROUTING_MAP.get(intent, "General Support")) | |
| st.info(f"Auto action: {ACTION_MAP.get(intent, "Manual review required")}") | |