How It Works
This system uses Zero-Shot Classification, a Natural Language Processing (NLP) technique that understands customer intent without requiring prior training examples. Unlike traditional keyword matching, it comprehends context and nuance.
AI Model
facebook/bart-large-mnli
Zero-shot classifier used via Hugging Face Inference API
Inference API
Hugging Face Inference (Serverless)
No model hosting required — pay-per-use cloud inference
Architecture
Channel-agnostic core + web/whatsapp handlers
Same AI engine powers web, WhatsApp, email, and SMS
Supported Categories
⚠️
complaint
Product defects, damages, quality issues, dissatisfaction
→ complaints@mycompany.com
💰
sales_inquiry
Pricing, bulk orders, product availability, quotes
→ sales@mycompany.com
🚚
shipping_inquiry
Delivery times, tracking, shipping costs, logistics
→ shipping@mycompany.com
📋
other
General inquiries, greetings, out-of-scope messages
→ info@mycompany.com
🎯 Example Classifications
| User Message |
Detected Category |
Why? |
| "The cheese arrived completely melted and leaking." |
complaint |
Negative sentiment + product damage + quality issue |
| "Do you offer discounts for orders over 50 units?" |
sales_inquiry |
Volume query + pricing intent + potential B2B deal |
| "When will my package arrive? I ordered last Tuesday." |
shipping_inquiry |
Delivery timing + tracking reference + logistics concern |
| "Thanks, have a great day!" |
other |
Polite closing — no business intent or inquiry |
🏗️ System Architecture
🔑 KEY PRINCIPLE: The core AI engine knows NOTHING about channels.
It only receives text → returns category → channel handlers add metadata.
Adding Telegram, Slack, or Messenger = ZERO changes to AI logic.
Current Limitations & Future Improvements
- Model: Currently English-optimized. Spanish version pending with
pysentimiento/bert-base-spanish-wwm-uncased-xnli
- Confidence threshold: Low confidence (<35%) falls back to "other" category
- Shipping override: Tracking/delivery messages route to shipping even when tone sounds like a complaint
- Rate limits: Hugging Face free tier allows ~1,000 requests/day
- Cold starts: First request after inactivity may take 3-5 seconds
- Planned: Custom fine-tuning for your business domain + webhook integrations