File size: 329 Bytes
dda3dc2
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
def detect_intent(question: str) -> str:
    q = question.lower()

    if "appointment" in q or "follow up" in q:
        return "appointment"
    if "how serious" in q or "severity" in q or "risk" in q:
        return "severity"
    if "why" in q or "explain" in q:
        return "explanation"

    return "unknown"