Intelligent bot development using the Microsoft Bot Framework, Azure Cognitive Services and NER systems. Part 1

    To date, only messengers (and, in part, games) show a steady growth in the audience against the backdrop of a fall in all the statistical indicators of classic mobile applications. WhatsApp claims 1 billion active users, Facebook Messenger - 900 million, WeChat - 700 million, and instant messengers have overtaken social networks by an active audience.

    For millions of people, Facebook Messenger could be the first place they come across chatbots. And if people start using them, then this could become the new Klondike for software developers - for the first time after Apple opened the App Store.

    The verge



    Logical is the desire of instant messengers to take advantage of this situation and try to further test the traditional media, and even Google’s hegemony in terms of search. And this desire resulted in the discovery by almost all popular instant messengers of the public Bot API. Despite the fact that formally instant messengers provide developers with access to their large audience, in fact, these same developers will bring their own users back to instant messengers. But we will not focus much on conspiracy theories or philosophize on the topic of where this can lead us, but rather concentrate on the technical issues of creating intelligent bots.

    Intelligent bot examples


    Msg.ai allows brands to communicate with users through instant messengers.

    Sony Pictures replaced 70 operators with one chatbot.

    The 19-year-old developer created a free bot that returned $ 3 million to drivers for parking fines.



    More examples. The Iranian bot Tina (also called Iranian Siri) has 2.6 million subscribers in Telegram .

    Microsoft Xiaoice (China) is a 17-year-old girl who lives on WeChat and Weibo. This bot is called the largest Turing test in history. The robot can answer questions, recognize emotions and even empathize. Many users do not even realize that they are communicating with the bot.

    X2AI - Silicon Valley Startup Createda bot that helps Syrian refugees in Lebanon solve their psychological problems associated with the war.

    In Ukraine, the most popular bot is the Opendatabot , which, using open data sets (the judicial registry and the database of entrepreneurs and businesses) allows you to check contractors and protect themselves from raider attacks by notifying you of unauthorized changes to entries in the single registry.



    Donor UA.Bot (available for Skype, Telegram, Facebook Messenger ) allows you to check whether you have any contraindications to donation (absolute or temporary) in Russian or Ukrainian:



    I would be grateful if in the comments you jot down links to other interesting examples of bots (in in particular, working in our region).

    Sometimes intelligent bots “go” wrong way, and we can observe interesting results. For example, the TayTweets Twitter bot from Microsoft, which studied on tweets that users sent to it. Of course, people will not learn bad robots (sarcasm), so after 24 hours the bot began to produce xenophobic and local tweets:





    Microsoft was forced to remove the bot from public access. This suggests that bots are still a tool, and what it will be like 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. You can develop a bot quickly and easily. Much easier than developing a mobile application or bot.
    2. After the bot is developed, it is automatically available in instant messengers and social networks, which means that you need to spend less time and resources for marketing.
    3. It's cheaper than developing mobile apps or sites. Since bots work on existing infrastructures, all you need is a database and a service that will answer questions and provide data on request.
    4. The dialogue interface is understandable to everyone, the design of dialogs is still an easier task than the development of UX / UI for mobile applications or graphic design for a site.

    However, this does not mean that bots should be used wherever possible. Users, ideally, should make 1-2 clicks to get the necessary information, but if you need more clicks - perhaps the bot is not the best solution for your service.

    And yet, there are many scenarios where bots are a better solution. For example, for working with potential customers (user engagement), call centers, ordering something (pizza, taxi), for creating knowledge bases in specific domains (as is the case with Donor UA.Bot).

    What new markets and developer jobs do bots create?

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

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

    Create a simple chatbot


    The process of creating a chat bot consists of several parts:

    1. Register a bot in the messenger. In Telegram, @BotFather is responsible for this , in Messenger you need to create a page that will be a bot and link it in the settings with the application on the developer's portal. For those who want to write a bot for Skype, there is a separate portal on which you need to add your bot.
    2. Creation of a web service (webhooks endpoint), which will accept requests and generate responses. The link to the web service needs to be registered in the settings of your bot.
    3. Writing command processing logic (in simple cases) or unstructured texts using NLP / ML / NER tools. (we will talk about them later).
    4. Creating a database if you want to track dialogs and create closer and personalized communication with your users.
    5. Actually, that's all. We test, run, use.

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

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

    On Facebook, the Persistent Menu plays this role (up to 5 elements):



    Of course, these are not the only UX / UI capabilities of bots, and the list of interesting features is constantly growing.

    - In the next part we will talk about the Microsoft Bot Framework for the rapid development of bots for ~ 10 platforms.

    Also popular now: