On-device email assistant
Summary
Intent classification and inbox organisation for Gmail.
Users needed to organise email by intent without relying on manual labels or a heavyweight classification service.
A Chrome extension backed by a fine-tuned, distilled BERT model exported to ONNX. It classifies messages and supports inbox organisation and unsubscribe workflows.
Tech Stack
- AWS
- Chrome Extension APIs
- Gmail API
- Python
- BERT
- ONNX
- Scikit-Learn
- Pandas
- Webpack
Tech Challenge
-
Traditional keyword rules were not sufficient. Understanding nuanced email intent needed a strong NLP model fine-tuned on real-world inbox data.
-
Inference speed needed to be fast enough to classify emails in real time without disrupting the user experience.
- The inference design aimed to classify email inside the Chrome extension. Gmail integration and supporting cloud services are separate parts of the architecture.
-
The system had to accommodate thousands of daily users with consistent performance and reliability, while minimizing infrastructure costs.
Solution
-
To solve the classification problem, we fine-tuned a BERT model on a custom dataset built from hundreds of thousands of anonymized email samples categorized by real users. This dataset captured a wide variety of promotional, transactional, personal, and spam emails, which greatly improved model accuracy across edge cases.
-
To meet performance requirements, we distilled the BERT model and exported it to the ONNX format, optimizing it for inference to enable lightweight and fast predictions within the Chrome extension.
-
The extension integrated directly with Gmail’s API to read metadata and content from emails and then displayed intuitive UI options to filter, categorize, or unsubscribe.
-
All the services were deployed using AWS infrastructure for a low-maintenance and cost-efficient solution that could scale without manual intervention.
Impact
Outcome
A Chrome extension that classifies email and supports inbox organisation.
Published
