|
|
def detect_intent(message: str): |
|
|
""" |
|
|
A robust, rule-based classifier for warehouse tasks. |
|
|
Returns one of: |
|
|
- "slotting" |
|
|
- "picking" |
|
|
- "report" |
|
|
""" |
|
|
|
|
|
msg = message.lower().strip() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
slot_keywords = [ |
|
|
"slot", "slotting", "putaway", "storage location", |
|
|
"rearrange items", "reorganize racks", "optimize space", |
|
|
"velocity", "sku placement", "bin allocation" |
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pick_keywords = [ |
|
|
"pick", "picking", "route", "path", "walk sequence", |
|
|
"shortest path", "aisle", "rack", "order fulfillment", |
|
|
"picklist" |
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
report_keywords = [ |
|
|
"full report", "overall performance", "warehouse report", |
|
|
"summary", "end to end", "combined", "complete report", |
|
|
"all optimizations" |
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if any(k in msg for k in report_keywords): |
|
|
return "report" |
|
|
|
|
|
if any(k in msg for k in slot_keywords): |
|
|
return "slotting" |
|
|
|
|
|
if any(k in msg for k in pick_keywords): |
|
|
return "picking" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return "report" |
|
|
|