Skip to content

Email classification with AI

We train a model to label your emails the way your team does now, with uncertain cases referred to a team member. For WUA, we built a topic classification model.

For WUA, we built a model that structures respondents’ open-ended answers and categorises them by topic

These were open-ended answers in customer research, not emails; categorising them by topic calls for the same skills. “I’m very pleased with the collaboration. The close communication and detailed sprint reviews ensured the model met our needs exactly […].” Yannick Ludwig, Head of Product

Read the case study

Who goes through the shared inbox every morning and routes everything to the right team?

Complaints, invoices, address changes and fault reports all arrive in one inbox. Someone reads each message, chooses a team and adds a label. A model suggests a team for each message, extracts the customer number and leaves uncertain cases to a member of staff.

Book a call

Every email gets a label, a team and the details that team needs

Discuss your email flow

Labels you choose

A model classifies each email using your own categories, including several at once. We built a classification model like this for WUA’s open-ended responses.

To the right team

Each category belongs to a team or queue. That’s how Dex, our chatbot for PostNL, helps employees reach the right colleague more quickly.

Details from the text

The model extracts customer numbers, order numbers, invoice numbers or addresses from emails, so the team doesn’t have to search for them first.

A person handles uncertain cases

If the model isn’t confident enough, it passes the email to an employee. Their decision becomes a new example for the model to learn from.

The labels your team applies by hand today are the starting point for the model

  1. Categories and examples

    Together with the people who read the inbox, we define categories and teams and collect labelled emails.

  2. Test on your own emails

    Rules, a trained model or a language model: for each category, we measure how often it gets previously unseen emails right.

  3. Go live with a safety net

    Labels appear in the inbox or ticketing system. Uncertain cases go to a team member, and we monitor quality.

Is our email volume high and consistent enough for a model?

Discuss it with us

A good fit if

A high volume of email arrives in one or more shared inboxes every day, someone currently routes it to teams by hand, and the types of email are fairly consistent.

Not a good fit if

There are only a handful of emails, or every email still needs a substantive reply from the same person. In those cases, inbox rules or a web form with selection fields are often enough.

What the scope depends on

The number of categories and teams, whether labelled emails are already available, how many languages are involved, which data needs to be extracted, whether attachments count, and where the label goes: the inbox, a ticketing system or a CRM.

What if an email goes to the wrong place?

If the model is unsure, it leaves the email unlabelled and passes it to a team member. Every label a team member changes is traceable and becomes a new training example.

Inbox rules, your own model or a language model: how do you sort your emails?

Inbox rules

Choose this if the sender or subject line already tells you where an email should go, such as invoices from regular suppliers. It’s quick to set up, but misses information in free-form text.

A trained classification model

Choose this if you receive a lot of email and already have labelled examples. We recommend it for fixed categories: you can measure performance for each label, and the results are predictable.

A language model (LLM)

Choose this if you have few examples so far or the categories change often. Test it on the same test set and agree where the emails will be processed.

We classified text and routed questions for customer research, recruitment and a service desk

Based in Amsterdam, Data Science Lab has built data and AI applications since 2016 as a Databricks and Microsoft partner. We built classification models for WUA and Olympia, and the Dex chatbot for PostNL.

Book an introductory meeting

A handful of sample emails and your current labels are the starting point for our first conversation

Stef Stoelwinder

Stef Stoelwinder

Business Development

Stef is your point of contact. In our first conversation, we’ll discuss what emails come in, how your team distributes them and where the labels end up.

Which teams should receive our incoming emails?

Describe which mailboxes are involved, what kinds of emails come in and who handles them. We’ll reply by email or arrange an initial conversation.

Enter a valid email address.

Let us know how we can help you.

Frequently asked questions

Email classification automatically sorts incoming messages. A model assigns each message one or more labels, such as complaint, invoice or fault, and sends it to the right team. It often also extracts information from the text and determines which emails take priority. With AI, this goes beyond rules based on the sender or subject line.

Routing email with AI is one of the AI applications we build.

From examples: emails your team has already labelled. The model learns which words and sentences belong to which category. Microsoft describes two approaches for Azure Language: one label per text, or multiple labels at once. An email about both an invoice and a complaint would get both labels.

The quality of the labelled examples matters more than the choice of algorithm. For Olympia, we built an automated classification model to match candidates with suitable job openings.

Yes, if you define what should take priority. A fault, a cancellation or a complaint about an earlier complaint can go to the top of the queue. The model predicts the category; the order comes from rules your team chooses, sometimes supplemented with CRM data, such as the type of contract.

Keep the prioritisation explainable. A member of staff needs to be able to see why an email is at the top.

Usually a customer number, order number, invoice number, address or date. A model recognises these in free text, even when they are written in different ways. The system can then use that information to look up the customer or order in advance.

If the information is mainly in attachments, such as invoices or PDF forms, document processing with AI is a better fit.

For Microsoft 365, we use Microsoft Graph to read messages from a mailbox, assign them a category or move them to a folder. We connect a ticketing system or CRM through its API so that the label and information appear there.

Ideally, the model runs on the platform you already use, such as Azure or Databricks. As a Microsoft and Databricks partner, we choose an approach that fits how you manage your systems.

Before launch, we test the model on emails it has not seen, measuring two things for each category: how often the label is correct, and how many emails of that type it identifies. Together with your team, we choose a confidence threshold below which an email goes to a member of staff.

After launch, we track how often staff change a label. If that rises, for example because of a new product or a new type of complaint, we retrain the model using the new examples.

Email almost always contains personal data: a name, an email address, sometimes a customer number or information about someone’s health. That means the GDPR applies. Document where the email is processed, whether a language model outside your own environment has access to it, and how long the data is kept.

Your data protection officer should assess whether a DPIA is needed. You can read what that involves in DPIA for AI.

When you receive few emails, when the sender or subject line already makes the category clear, or when a web form with selection fields can replace email. In those cases, mailbox rules are enough.

If you want to analyse large volumes of text by topic and sentiment, read about NLP and text analysis. If you also want to answer questions, building an AI chatbot may be a better fit. Generating a draft reply for each email falls under generative AI.