The LEAP

Automation insights and productivity tips from LEAPWORK.

All Posts

How to Classify Emails with AI and Automation

As more and more enterprises are realizing the benefits of using robots to automate mundane tasks, equally many are looking to scale their efforts with AI capabilities.

AI enabled automation allows businesses to not only transfer data faster but also to interpret that data, making the entire process smarter and more efficient.

One use case for this is automation of email classification. As companies have more and more pressure on efficiency and costs, replying to emails or messages in a timely fashion with limited resources at hand can be a challenge.

By using robots and cognitive services, however, classification of emails can be automated, allowing faster and better customer responses.

What you need to get started

To classify emails with AI automation, you need three things:

  • The LEAPWORK automation software – you can download a trial version here: leapwork.com/trial
  • A LUIS cognitive service account – you can get a trial here: luis.ai
  • An email account – you can use any of the web based email providers (we are going to use mail.google.com in this guide)

The outcome should be a robot that monitors your email, understands the context of the email body, and places the email into the appropriate email folder/inbox/team.

Watch the video to see how it works, or follow the step-by-step guide below to try it yourself.

 

Step 1: Configure email inbox

The first step is to create a folder and all the underlying subfolders corresponding to the various topics that you want to track

 Configure email inbox

Step 2: Create your smart classifier on luis.ai

Next, open your Luis cognitive services account and create a new application.

Create your smart classifier 1Within your application, create your intents so that they correspond to the folders that you have defined in your email inbox.Create your smart classifier 2

Add utterances (examples) for each intent that you want tracked.Create your smart classifier 3

Click Train. This will trigger the training of the underlying algorithm using the data you have provides so far.Create your smart classifier 4

Click Publish. Now you will be able to expose the application as a web service to the outside, which will mean you can send the text to it via REST API calls.Create your smart classifier 5

Get the application details and save them. You will need them once you have built your automation flow.Create your smart classifier 6

Step 3: Create your automation workflow using LEAPWORK

First, set up a flow like the one below that automates the log in to your email account.Create your automation workflow using LEAPWORK 1

Once you have logged in, you can go through the list of emails that you have in your inbox.

For each email it will read the text in the body and send that to the LUIS service we created earlier (also called a REST API request).

The LUIS application gives you a good set of examples on how to create the requests. You can also see it in our flow.

The service will send us back a response. Once we check and approve that process, we can proceed.Create your automation workflow using LEAPWORK 2

The next step will be to extract the value of interest from the response file (JSON file). Here is an example of how it looks:

  "topScoringIntent": {

    "intent": "internet banking",

    "score": 0.400545418

What we do in the automation flow is to specify what to extract and from where. In our example, that would be “internet banking”. Once we have that, we can proceed to the next step.Create your automation workflow using LEAPWORK 3

The last step in our automation flow is to move the actual email into the underlying folder that corresponds to the identified value by our LUIS application. In our example, that is the “internet banking” folder.

Create your automation workflow using LEAPWORK 4And that’s it! Now we have an automated flow that reads our emails and classifies them accordingly in the corresponding folders.

A last piece of advice is that if you want to improve the accuracy of the LUIS application, more examples for each intent will help you achieve that.

Curious to learn more about no-code automation? Sign up for our next webinar.

New call-to-action

Maria Homann
Maria Homann
Content Marketing Manager

Related Posts

Why Choose a No-code Automation Tool for Regression Testing?

Two of the major challenges in automating regression tests are setup and maintenance. This is because many test automation tools require coding, which requires time and capabilities that not all testing teams have.

How Frequently Should You Run Your Regression Tests?

Deciding how often to perform regression tests can be a challenge. Particularly when you've automated your regression suite, and are more free to decide the frequency.

Building Automated Regression Tests: What to Include

Over time, as your application grows or changes, your regression test suite will grow as well, numbering into perhaps hundreds or thousands of regression test cases. This is why automation will inevitably become part of your testing process at some point.