Tekos NLP

Welcome to Tekos NLP

Tekos NLP is an interactive and intuitive Natural Language Processing engine, providing “understanding as a service”.

It is supposed to be used with Tekos Flow, providing “conversation engine as a service”. Together they fulfill Tekos mission - “Conversational Understanding as a Service”.

Create a new NLP Agent

  • You need to use TekosBot to add new NLP ressource to your App. You can also create a new App from scratch and then add the NLP ressource.

Use tekosbot to add a new NLP ressource to your APp
  • Now enter your new agent name, and language

Name your agent and click Create NLP. Wait for around 30 seconds to create your NLP Agent.

Agent Access

Once you have created your NLP agent, you can visit the NLP Agent dashboard by clicking on the link.

When the page reloads, you are now in the NLP editor.

NLP Agent Editor

Tekos NLP platform is organised in 3 Parts:

  • Agents: you can access to all your agents here

  • Intents & entities

  • Stories

Intents & Entities

Let’s assume that anything our users say can be categorized into one of the following intents:

  • greet

  • restaurant_search

  • thankyou

Of course there are many ways our users might greet our bot:

  • Hi!

  • Hey there!

  • Hello again :)

And even more ways to say that you want to look for restaurants:

  • Do you know any good pizza places?

  • I’m in the North of town and I want chinese food

  • I’m hungry

The first job of NLP is to assign any given sentence to one of the intent categories: greet, restaurant_search, or thankyou.

The second job is to label words like “chinese” and “North” as cuisine and location entities, respectively. In this tutorial we’ll build a model which does that.

You can start adding intents, With the button ‘New Intent’, you can add new intents to your model. Your intents will be displayed in the select Intents to train section.

Create Intents

With the button ‘New Intent’ intents, you can add new intents to your model. Your intents will be displayed in the select Intents to train section.

Let’s now create a simple order agent

We need to create at least 2 intent, in oder to let the agent train correctly, let’s add some examples:

Intent order:

I want to order milk
i want a coffe
please order a pizza for me
can you take a ice cream
order for me
i need to make an order
i need to book something

Intent greetings:

hi
hello
hey
hii
hi there
good morning

The following step is to specify an entity of the intent you have entered

Create Entities

Let’s start with specifying the good as en entity of the intent to order

Intents & Entities Training

In the example, select ‘milk’ and double click, add the name of the entity (good)

Do the same for the other examples:

I want to order milk
i want a coffe
please order a pizza for me
can you take a ice cream

As you can see, there is some examples without specifying the good. The mandatory entity will be predicted by the machine learning engine using Stories.

Stories

A good place to start is by writing a few stories. NLP works by learning from example conversations, and we’ll write the first few examples ourselves to kick things off.

Create a story

In this very simple conversation, the user says hello to our bot, and the bot says hello back. This is how it looks as a story:

## story1
* greet
- say_greet

A story starts with ## followed by a name (the name is optional). lines that start with * are messages sent by the user. Although you don’t write the actual message, but rather the intent (and the entities) that represent what the user means. If you don’t know about intents and entities, don’t worry! We will talk about them more later. Lines that start with - are actions taken by your bot. In this case all of our actions are just messages sent back to the user, like say_greet, but in general an action can do anything, including calling an API and interacting with the outside world.

To create stories click on “stories” on the left side of your dashboard, and then click on the button [Create]

You can copy paste these samples or create your own:

##Story 1
* greet
- say_greet
##Story 2
* order {"order" : "miled"}
- order

Use the imporant sample feature to start with a sample that you can modify and prevent training errors

Train the model

With everything ready you can now train your model by clicking on “Train” on the upper right side of your dashboard.

Depending on the model, the training time will take from seconds to minutes.

During Training Process the button color turns to yello

And when the agent is ready, the button color turns to green

Test the model

Use the Testing feature to test your model.

This is only for testing the model, and not creating the bot. The NLP agent responses should be used with TekosFlow or your App using the API in order to build your Bot.

Accessing the NLP Agent

Accessing the NLP Agent From Tekos Flow

The most convienent way to use your NLP agent is to use the Tekos NLP Node inside TekosFlow. This will use the API in backend.

If you want to communicate with your agent using the API and http request, go to the next section.

In Tekos Flow, use the tekos-nlp node.

Double click on the node to start editing the node properties.

You will need the base URL and the Token. keep Option as 'Parse'.

Base URL

All the URLs referenced in the documentation have the following base: agent_name.tekosnlp.com

To get your nlp base url, go to Agents in the left menu, then click on the agent name.

Authentication

Each API request requires authentication to identify the agent that is responsible for making the request. Authentication is provided through an access token.

Obtaining Access Tokens

To obtain the access token, choose the required agent from the Agents dropdown and click the Agent Name. The agent’s settings will be opened. In the API keys section you’ll find two access tokens that you will use for authentication.

Accessing the NLP Agent From a http request

For each API request, include this HTTP header:

Authorization with the value Bearer {access_token}.

For example:

Authorization: Bearer YOUR_ACCESS_TOKEN