Spaces:
Sleeping
Sleeping
Download intent.py from maman056/Customer_Review: direct link, hf CLI and curl.
- Browser
- Download file 553 Bytes
-
https://huggingface.co/spaces/maman056/Customer_Review/resolve/main/intent.py
- Command line
-
hf download hf://spaces/maman056/Customer_Review/intent.py
-
curl -L -o intent.py https://huggingface.co/spaces/maman056/Customer_Review/resolve/main/intent.py
553 Bytes
| def predict_intent(text): | |
| text = text.lower() | |
| # Refund Request | |
| if any(word in text for word in ["refund", "return", "money back", "replace"]): | |
| return "Refund Request" | |
| # Delivery Issue | |
| elif any(word in text for word in ["late", "delayed", "never arrived", "lost", "shipping"]): | |
| return "Delivery Issue" | |
| # Complaint | |
| elif any(word in text for word in ["wrong", "damaged", "broken", "poor", "bad", "defective"]): | |
| return "Complaint" | |
| # Default | |
| else: | |
| return "General Query" |