Basic NLP concepts

This page covers the fundamental concepts of Natural language processing (NLP).

Understanding natural language is challenging. It takes us over 12 years to learn 20,000 common words. Imagine how hard it is for computers! Training NLP engines requires massive data. Fortunately, pre-trained models help. Our NLP engine handles spelling errors, synonyms, slang, and word order.

In this page, you'll learn about the basics to learn your bot's NLP model.

NLP model

An NLP model is made of a set of intents and entities which are trained on data so that the model can recognize expressions that were never seen.

Each bot has its own NLP model.

You can set up your NLP model under the NLP tab.

The basics of NLP.

Whenever a user sends a message to the bot, the bot will check if that message can be labelled with an intent that is part of the NLP model.

Example

For example, when a user types 'Get me a flight ticket,' the NLP will check if this sentence matches any of its expressions and check if this message contains similar words as the expressions. In the example above, the NLP gives a 93% confidence score that 'Get me a flight ticket' belongs to the intent 'Book flight'. Because this sentence is recognised above the NLP threshold, the response that is linked to this intent will be shown to the user.

Intents

An intent is a series of expressions (or utterances) that mean the same intention or goal from the user side. During the conversation, intents are recognised by the NLP engine and serve to steer the conversation in different ways.

Example of intents

Some examples of intents:

  • Book train ticket

  • Talk to a human

  • Create support ticket

  • Greeting

  • Yes

You can add intents from the NLP tab.

It is important to scope your intents well so the bot can recognise them more easily. Learn how to create good intents here.

Expressions

Expressions are example sentences to specific intent: they're all the different ways a user can express their intent.

Example of expressions

Here are a few expressions for the intent 'who are you'

  • Who are you?

  • What is your name?

  • Do you have a name?

  • Tell me more about yourself

  • Please, I'd like to know who I am talking to

  • How should I call you?

  • who is choo choo?

  • Tell me what your name is

  • Who are ya?

  • What do people call you?

Here are a few expressions for the intent 'order pizza'

  • I'd like to order some pizza please

  • Can I get a pizza to go?

  • I want a pizza margherita

  • I'd like to order some food

  • Can you help me order pizza?

  • I'm in the mood for some pizza tonight!

You can add expressions from the NLP tab.

It's crucial for an intent to contain diverse expressions so that the NLP can give more accurate results. Learn more about how to create a good set of expressions here.

Expressions for a 'talk_to_human' intent.

Please note that our NLP engine has a limit of 1000 characters. Messages with more than 1000 characters will always trigger the Not understood block.

Entities

Entities are important pieces of information that can be extracted from an expression. You want to store these entities as variables so you can re-use them later on.

Example of an expressions where @date, @origin, and @destination entities are extracted.

Chatlayer has different entity types. Learn all about them here.

Last updated