Home .NET Developing intelligent bots using the Microsoft Bot Framework, Azure Cognitive Services and NER systems.Part 1

Developing intelligent bots using the Microsoft Bot Framework, Azure Cognitive Services and NER systems.Part 1

by admin

At the moment, only messengers (and, partly, games) show a stable growth of the audience against the background of the fall of all the statistical indicators of classic mobile applications. WhatsApp claims 1 billion active users, Facebook Messengerat 900 million, WeChat at 700 million, and messengers are already have overtaken social networks by active audience.

For millions of people, Facebook Messenger could be the first place they encounter chatbots. And if people start using them, it could become the new Klondike for software developers – the first time since Apple opened the App Store.
The Verge

Developing intelligent bots using the Microsoft Bot Framework, Azure Cognitive Services and NER systems.Part 1
It is logical that messengers want to take advantage of the situation and try even more to sweat the traditional media, and even the hegemony of Google in terms of search. And this desire led to the opening of almost all popular messengers public Bot API. Despite the fact that formally messengers give developers access to their large audience, in fact, these same developers will bring their own users back to messengers. But let’s not focus too much on conspiracy theories or philosophize about where this can lead us, but concentrate on the technical issues of creating intelligent bots.

Examples of smart bots

Msg.ai allows brands to communicate with users via messengers.
Sony Pictures Replaced by 70 operators with one chatbot.
A 19-year-old developer has created a free bot that returned drivers $3 million for parking tickets.
Developing intelligent bots using the Microsoft Bot Framework, Azure Cognitive Services and NER systems.Part 1
More examples. The Iranian bot Tina (also called the Iranian Siri) has 2.6 million subscribers on Telegram
Microsoft Xiaoice (China) is a 17-year-old girl who lives on WeChat and Weibo. This bot. is called the greatest Turing test in history. The robot can answer questions, recognize emotions, and even empathize. Many users don’t even realize they are communicating with a bot.
X2AI is a Silicon Valley startup created bot that helps Syrian refugees in Lebanon deal with their psychological problems related to the war.
In Ukraine the most popular bot is Opendatabot which, using open data sets (court registry and database of entrepreneurs and businesses) allows you to check counterparties and protect yourself from raider attacks by notifying about unauthorized changes of entries in the unified registry.
Developing intelligent bots using the Microsoft Bot Framework, Azure Cognitive Services and NER systems.Part 1
DonorUA.Bot (Available for Skype, Telegram, Facebook Messenger ) allows you to check if you have any contraindications to donation (absolute or temporary) in Russian or Ukrainian :
Developing intelligent bots using the Microsoft Bot Framework, Azure Cognitive Services and NER systems.Part 1
I’d be grateful if you could jot down links to other interesting examples of bots in the comments (particularly those that work in our region).
Sometimes smart bots "go" the wrong way, and we can observe interesting results. For example, Microsoft’s Twitter bot TayTweets, which learned from tweets sent to it by users. Of course, humans don’t teach robots anything bad (sarcasm), so after 24 hours the bot started giving out xenophobic and racist tweets:
Developing intelligent bots using the Microsoft Bot Framework, Azure Cognitive Services and NER systems.Part 1
Developing intelligent bots using the Microsoft Bot Framework, Azure Cognitive Services and NER systems.Part 1
Microsoft had to remove the bot from the public domain. This suggests that bots are a tool after all, and what they will be depends on the data and training methods.

Why bots?

This question is asked every time someone starts talking about bots. Let’s look at the advantages over other ways of communicating with users :

  1. Easy start. Developing a bot can be fairly quick and easy. Much easier than developing a mobile app or bot.
  2. Once the bot is developed, it’s automatically available on messengers and social networks, which means less time and resources need to be spent on marketing.
  3. It’s cheaper than developing mobile apps or websites. Since bots run on existing infrastructures, all you need is a database and a service that will answer questions and provide data on demand.
  4. A dialog interface is understandable to everyone, designing dialogs is still an easier task than developing UX/UI for mobile apps or graphic design for a website.

However, this does not mean that bots should be used everywhere you can. Users should ideally make 1-2 clicks to get the information you need, but if you need more clicks, maybe a bot isn’t the best solution for your service.
And yet, there are many scenarios where bots are a better solution. For example, to work with potential customers (user engagement), call centers, to order something (pizza, cab), to create knowledge bases in specific domains (as in the case of DonorUA.Bot).
What new markets and jobs are bots creating for developers?

  • development of AI/ML/NLP tools and platforms;
  • Bot frameworks development;
  • bot stores;
  • bot development;
  • process automation;
  • marketing bots.

Who has already joined the game called "chatbots"? They are Telegram, Microsoft Skype, WeChat, Slack, Facebook Messenger. Each of the platforms offers its own unique features, for example, Telegram has inline bots that you can connect in a conversation with other people, but overall the capabilities of all platforms are more or less the same.

Creating a simple chatbot

The process of creating a chatbot consists of several parts :

  1. Registration of a bot in the messenger. In Telegram this is the responsibility of @BotFather In Messenger, you need to create a page, which will be the bot, and link it to the application in the settings on the developer’s portal. For those who want to write a bot for Skype there is separate portal where you can add your bot.
  2. Creation of a web service (webhooks endpoint), which will receive requests and generate responses. The webhooks endpoint link should be written in your bot’s settings.
  3. Writing logic for processing commands (in simple cases) or unstructured texts with NLP/ML/NER tools. (we’ll talk about them later).
  4. Creating a database if you want to track dialogs and create closer and more personalized communication with your users.
  5. That’s it. Test it, run it, use it.

Telegram allows you to create a set of commands. Like any other bot customization task, this can be done with BotFather command :

/setcommands - change bot commands listOK. Send me a list of commands for your bot. Please use this format:command1 - Descriptioncommand2 - Another description

Facebook has such a role Persistent Menu (up to 5 elements):
Developing intelligent bots using the Microsoft Bot Framework, Azure Cognitive Services and NER systems.Part 1
Of course, these are not the only UX/UI features of the bots, and the list of interesting features is constantly growing.
– In the next part, let’s talk about Microsoft Bot Framework for fast bot development for ~10 platforms.

You may also like