Participating in AWS chatbot challenge 2017

No comments
Last year at reInvent 2016, AWS introduced Amazon Lex - a service for building conversational interfaces using voice and text. To promote this service, Amazon announced AWS chatbot challenge 2017. It was a great opportunity to learn a new service in depth and build something from scratch. Therefore, me and my friend Samtadecided to give it a try. After a few weeks of efforts, We successfully built a chatbot called SplitSmart Bot ( watch video ) which allows user to manage shared expenses using SplitWise. Bot is deployed on Facebook messenger which makes it work on seamlessly on any browser, phone, tablets etc. You can chat, discuss and split expenses in one place. 
This post describes our short but exciting journey of participating in the hackathon and building SplitSmartBot.

Getting started

When we started thinking about the challenge we had two concerns:
  1. We didn't have any experience in NLP and deep learning.
  2. We didn't have much UI or front end experience to build chat interface.
However, AWS surprised us big time. We discovered that we don't need either. Lex abstracts all the complex deep learning and NLP stuff with easy to understand constructs like Bot, Intent, Slots types and utterance. AWS documentation has some really good hands on tutorials to explain these basic concepts. Moreover, Lex provides seamless integration with existing messenger platforms like Facebook and Slack.  So that became our front end. Both problems solved !

 Implementation Challenges

Building a chatbot has different set of challenges than a typical web or mobile application. Here are some of the challenges we faced.
  1. Implementing Oauth workflow inside chatbot: Our bot needs to access user's SplitWise account for making calls to SplitWise API. Therefore, user needs to authorize the bot to use his account. SplitWise supports this via Oauth which is easy to integrate with web or mobile app. However, challenge was to implement this workflow from within chatbot. We decided to go with Serverless approach and implement this AWS API gateway, Lambda and Dynamodb.
  2. User experience: The challenge was to make interaction with chatbot simple and intuitive. To make it happen, we need to 'train' Lex engine with different phrases or sentences ( called utterances in Lex terminology ) We interacted with Lex experts on slack channel and followed their recommendations. However, the real issues were discovered during our beta testing ( when we asked friends to try out the bot). Depending upon their feedback, we trained our Lex bot to handler variety of interactions. E.g. To add a new expense, some people preferred to type "I paid 300 Rs for drinks" while others were more comfortable with "add bill of Rs 300". Good thing about Lex is you don't have to change backend code to handle new utterances.

 Accomplishments

  • Serverless Oauth implementation: As mentioned above, Serverless Oauth implementation was one of the trickiest to implement. It was a good learning experience. See our submission page to learn more about architecture
  • Open source contribution: To interact with SplitWise API, we used open source python SDK. However, some features we need were missing in this SDK. We are really pleased to be able to make open source contribution.

Support from AWS community

For any new service to become popular, you need solid documentation and community support. As usual, AWS documentation was up to the mark. Moreover, there was a Slack channel for participants to ask questions, discuss ideas and report issues. People shared code snippets, how-to videos, scripts etc. which helped us move faster. Overall it was a wonderful experience.

Final outcome - SplitSmartBot !

After a few weeks of reading, design and implementation ( On weekends ! ), we are proud to present our entry - SplitSmart Bot. Right now it is NOT publicly available and can be access only on invitation basis. Watch the bot in action here on my youtube channel. If you are interested to try out, please visit our Facebook page and send us a message. For more information on design and architecture, visit our submission page.
We are still waiting for the results. But the journey was indeed fulfilling.
 - Atharva and Samta

No comments :

Post a Comment