Back to Blog

Working with entities instead of multiple intents

Having several intents that look like each other is dramatic for the performance of your AI-model. Prevent a design where one expression is part of two or more intents. Add training data that doesn’t overlap or work with entities.

Intents

Training data of one intent should not overlap with training data of another intent or as less as possible. The training data should be relevant and specific.

Entities

Entities are words or small groups of words that are relevant for that particular conversation. They can be names of people, organizations, cities, products, brands etc. These entities are usually extracted from the sentence to use later on for an API-call, product recommendation or to redirect to the right flow.

Different entities can have the same intent

Let’s say we are an e commerce company and we sell all kinds of consumer electronics. Instead of creating an intent for each separate product we use entities. A common Intent would be something like “Order Product” and corresponding training data:

Entities instead of Intents

Follow up with corresponding Flow

Let’s say we’ve got a different process for ordering a Playstation 5 as it not released yet but also a different process for TV’s and headphones.

Quick Tip: Create entity lists to add synonyms such as television, monitor for the TV category.

Use actions and a bit of code to redirect to right Event. You could also create separate Flows for each of the categories. Have look at our Code Best Practices for more info.


async payload => {
  // Check if Param exists
  if(Array.isArray(payload.params.product_type)) {
   product = payload.params.product_type[0].value

  // Trigger event that matches param name
   trigger(product)
  }

}

Your design will now look something like this:

Entity to event

Now go ahead and give it a try. Your bot should be able to redirect to correct event based on user input.

Test your AI chatbot

Intent training data guidelines

Get StartedContact us