Share

How to Independently Create and Train a Chatbot on the Botlibre platform basis

Here we’ll tell you and demonstrate how to independently create and configure a chatbot of your own on the basis of Botlibre.

So, let’s start with the process of creation

1. Chatbot creation

To create a chatbot it is necessary to sign up to the site https://www.botlibre.com/, and sign in.

01_creation

Click «Create», this window will appear:

02_creation

Type the bot’s name in “Bot name”.

Then choose «Template» from an empty, basic, smart or some other chatbot. Describe the bot in the «Description» field.

03_creation

Choose a category from the categories, click “Create” and get a chatbot of your own.

04_creation

Now, let’s proceed to the process of bot training.

2.    Training

The process of bot training is not very complicated.

It is possible to train a bot either with the help of an interactive window, when you ask a question and write down an answer or correct a chatbot’s answer, or with the help of the markup language AIML.

Here is a template example:

aiml
    category
        pattern Hi/pattern
        templateHi/template
    /category
    category
        pattern* Hi/pattern
        templatesraistar/ /sraiHi /template
    /category
    category
        pattern Hi */pattern
        templateHi sraistar/ /srai/template
    /category
    category
        pattern * Hi */pattern
        template sraistar index="0" //srai Hisraistar index="1" //srai/template
    /category
/aiml

This is a scrip example in aiml.

The chatbot singles out the word “Hi” and responds “Hi”. If there are more words, it sends them to itself as a remaining message for further analysis according to templates or for any other action.

Let’s see what kind of actions they are.

Because we use a programming language (self) on the basis of JS, we can work with strings.

var str=http.requestHTML("https://www.google.ru/search?q=site::http://endurancerobots.com/+" + star,hint='//*/h3/a/@href');

This is an example of the unprocessed url. return.

Using Google, it is also possible to correct spelling (it’s important since most people misspell words, while there are no errors in templates). It’s done by means of word analysis through http message.

Request delegation to another chatbot in case when the first chatbot knows that the other one is built to it (self).

var message = new Object();
message.message = res;
message.root = "chat";
message.@instance = ".......";
message.@application = "..........";
var result = Http.postXML("https://www.botlibre.biz/rest/api/chat", message);

This is what it looks like in case of  aiml

category
   patternask * about */pattern
   templatestar/ says "sraix default="Timeout or max anonymous API calls exceeded"botnamestar//botnamestar index="2"//sraix"/template
/category

In aiml there is tag learnf. Tag (learnf) enables to create templates in the automatic mode.

category
patternlearn question * answer */pattern
template
learnf
category
patternevalstar//eval/pattern
templateevalstar index="2"//eval/template
/category
/learnf
/category

It creates a separate file with the .aiml extension, where it writes a new template and an answer to it. It is possible to train a chatbot using this file during a conversation of two interlocutors.

05_config

Here is description of chatbot’s features.

3. Correction mode

Examples of chatbot correction

06_correction

You can correct a chatbot’s answer to a request if you don’t like it with the help of the “Submit correction” button.

07_correction

We entered «hi», and the chatbot started giving us responses the way we needed.

08_correction

Giving a number of variants at first, and after a series of repeated corrections it will give only one answer.

4. Chatbot connection

First we get in chatbot (sign in)

09_connection

Then we open this page by clicking the gear icon (under the admin profile).

10_connection

Now we want to connect our chatbot to Email ,Facebook, Twitter.

Email

Click Email.

11_email

Enter the email address, user and password, then go to the page

12_email

The«Disconnect» button disconnects the bot from the email. «Check email» – the chatbot checks email every 5 minutes.

Twitter

Now click “Twitter”.

13_twitter

Then “Authorize”.

14_twitter

Then click the link.

15_twitter

In Twitter click «Authorize».

16_twitter

Copy the pin code and paste to the home page.

17_twitter

Then click «Done». It’s almost ready.

18_twitter

Click «Сonnect» on the page. Ready. Twitter is connected.

19_twitter

Click «Disconnect» to disconnect the chatbot from Twitter. «Check status» is a response to messages.

Facebook

Who did not dream about creation of one’s own chatbot on Facebook?

Just do the same as for Twitter.

Web site

Open a web page.

20_facebook

Click «Embedded».

21_facebook

Get the code on «Embedding Code» and insert it on the site to activate a chatbot (not every browser has speech recognition; Firefox, for instance, does not have it. Speech recognition functions best of all at Google Chrome). Now let’s have a look at this page.

22_facebook

23_facebook

This is description chatbot’s looks. Here we can change its looks.

24_facebook

5. Samples of chatbot operation

Gmail

We send a message to the chatbot’s email box.

25_samples

Here’s a simple chatbot’s response to the message.

26_samples

Twitter

An example of a dialogue window (request).

27_samples

An example of a dialogue window (response).

28_samples

Our own test on EnduranceRobots.com

This is what the window looks like before sending message.

29_endurance

This is what the window looks like after sending message.

30_endurance

We hope that you will find this information useful, and more people will be willing to create and use chatbots.

Test our chatbot at EnduranceRobots.com. We’ll be happy to answer your questions and give additional comments.

Written by George Fomitchev, Skype: George.fomitchev