Blog

How to Build and deploy a conversational Chatbot in minutes

15 Oct, 2019
Xebia Background Header Wave

Recently I received an SMS from a leading financial institution summarizing a loan process, which prompted me to click on a chat link, for more information. When I clicked on the link a chat window opened and I was really fascinated by the response to my queries, and to my surprise, it was a chatbot, which triggered my interest to explore and develop one.

Conversational chatbots are part of modern life

It would be pretty difficult to not encounter a conversational bot in our daily interactions. Apple’s Siri, Amazon’s Alexa and Microsoft’s Cortana are a few bots that are famous and well known. You might have also come across text-based chatbots while renewing your insurance, buying something online, or speaking to a chatty assistant even without knowing!

Chatbots are mainly used to provide customer support. Once you make them intelligent by training, they will communicate fluently with your target audience in their language. A chatbot is artificial intelligence (AI) software that can simulate a conversation (or a chat) with a user in natural language through messaging applications, websites, mobile apps or through the telephone.

A Conversational bot understands the context of the conversation and can handle any user goal gracefully. This doesn’t always mean that the bot will be able to answer all questions, but it can handle the conversation well and help the user accomplish their goal as well as possible.

An ideal Bot platform offers:

  • NLP service- that you can train
  • SDK to support & handle conversations (and their meta-data)
  • Platform to host the bot code
  • Platform to connect the bot logic with multiple channels (Integration)

The following chatbot frameworks are available in the market that is intuitive and easy to implement:

  • ai from Facebook
  • DialogFlow from Google
  • ai from Microsoft
  • Conversational AI from SAP (formerly known as Recast.AI)

Opensource Chatbots

But is there any significant chatbot framework in open source? The answer is yes, Rasa.AI. Advantages with Rasa over the enterprise-driven frameworks:

  • No vendor lock-in
  • No “AI fairy dust”
  • No State machines, Learn from real conversations
  • Run-on your favorite infrastructure (On-premise / cloud)
  • Get full control over training data and build up IP
  • Leverage backend systems, APIs and Robotic Process Automation to fully automate processes

Rasa is an open-source machine learning framework for building contextual AI assistants and chatbots, and consists of two main modules:

  • NLU (Natural Language Understanding) for understanding user messages. NLU is a library for natural language understanding with intent classification and entity extraction. This helps the chatbot to understand what the user is saying.
  • Core for holding conversations and deciding what to do next. A core is a chatbot framework with machine learning-based dialogue management that predicts the next best action based on the input from NLU, the conversation history, and the training data.

Some keywords you will find repeatedly used w.r.t NLP:

Intent: Simply, intents are the intentions of the end-user, which are conveyed by the user to the bot. They can be as casual as hoa, cya or professionally “when is the last flight today to Hyderabad”?

Entities: Business intents have metadata about the intent called “Entities”. Let’s see an example for an Intent: “GetReleaseYearByTitle” — Sample Utterance “When was Bahubali released ?” Here “Bahubali” is the title of the movie for which the user “intends” to find out the year of release.

Actions: As the name suggests, it’s an operation that can be performed by the bot. It could be replying to something in return, querying a DB or any other thing possible by the code.

Want to quickly build a chatbot?

Well, for RASA there is a learning curve. But don’t be disappointed, luckily we have “articulate” which was built on top of RASA and most of the boiler plating will be taken care of. Yes, it is an open-source tool. This helps as a gateway to enter the NLP world.

  • https://spg.ai/projects/articulate/ Articulate is a complete infrastructure for intelligent agents. It uses Rasa for NLU, Redis for quick look-ups, Elastic Search for logging and analytics that won’t miss a thing, and Duckling for enhanced date and time parsing.

Get your hands dirty by following the instructions :

https://github.com/samtecspg/articulate/blob/master/docs/getting-started/basic-installation.md

localhost:8080, Create an agent with Name and description and Save.

Under categories, create a category or import an existing category like the weather. Click on Train.

Post-training, Click on review tab and start chatting with your agent

The analytics section will give you insights on Actions, requests overtime, etc.

Once the agent/model is ready, Click on Connections to create an integration with  FB, Slack, Rocket chat, etc.



Click on save to get a shareable link like this: http://localhost:8080/demo/6f8da580-ca27-11e9-8666-39699ef60e5c

As you have seen, you can easily create your own bot with keywords, actions, and categories and solve real business problems. Once you feel the agent/model is up to the mark, integrate with external platforms like Slack, Facebook, etc.

Ganesh Akondi
Engineering Manager at coMakeIT
Questions?

Get in touch with us to learn more about the subject and related solutions

Explore related posts