Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Introduction to Facebook Messenger, Conversational UI & NLP


Published on

Presented in Facebook Developer Community meetup in Delhi

Published in: Technology
  • Be the first to comment

Introduction to Facebook Messenger, Conversational UI & NLP

  1. 1. Introduction to Facebook Messenger, Conversational UI & NLP ~ Saurabh Sharma
  2. 2. Messanger Platform Launched on 12th April 2016 in F8 annual developers conference.
  3. 3. Was it a big news? Facebook unveiled 10 year roadmap, with key stress on AI.
  4. 4. AI Bots Platforms Use (App Store for Bots) to discover bots for all platforms.
  5. 5. Why Messenger is important? Source:
  6. 6. Discovering Bots on Messanger • Currently, Bots listing is not available in India. • However, you can search by name and use any bot unless developer have put any country specific restriction.
  7. 7. Messenger Bots: Small demo of Yabi • Greets user by name • Search out coupons for user and provide in simple plain text avoiding all click bait model.
  8. 8. Trying Poncho: The weather cat • Greets user by name. • Predicts weather • Able to process simple NLP to answer questions.
  9. 9. Human > Bot
  10. 10. Conversational UI • Any UI that mimics chatting with a real human • Instead of communicating with a computer on its own inhuman terms—by clicking on icons and entering syntax-specific commands—you interact with it by just telling it what to do • Types: • Voice assistants • Chatbots • Pseudo-chatbot
  11. 11. Why is it important? • Truly cross-platform • Removes Human-Computer interaction friction • More interactive/user friendly.
  12. 12. Rise of Voice Assistants
  13. 13. Where it all started? Chat bubble Source:
  14. 14. And then WeChat started a new revolution in China Source:
  15. 15. Messaging apps are booming
  16. 16. What experts are saying?
  17. 17. Some big news: Foursquare is remaking itself as a bot
  18. 18. Facebook Messenger Bot Development Step by step Guide
  19. 19. Tech Stack covered in session NodeJS Heroku Facebook Messenger Bot
  20. 20. Step 1: Gather your armours Setting your development environment
  21. 21. 1.1 Heroku Why? • Quick setup, supports all major languages • Provides HTTPS, a prerequisite for web hooks to integrate with Facebook messenger platform • Download heroic tool belt:
  22. 22. Heroic Commands • Login: • Create App:
  23. 23. Create WebHook in NodeJS • Install NodeJS and create index.js to serve web hook for authentication (code in next slide) • Used to verify authenticity of Webhook (Similar to OTP system) • CheckPoints: • Should support HTTPS • Should serve GET request • Should return challenge code for verification
  24. 24. Add Procfile and upload code • Add a Profile with this code (it specifies that which file server needs to run): • web: node index.js • Push code to Heroku: git init git add . git commit -m ‘’Initial code’ heroku create git push heroku master
  25. 25. Step 2: Setup Facebook app Linking app to web hooks
  26. 26. Create page and app Create: • Facebook page • Facebook app
  27. 27. Subscribe web hook to messages In the pop-up, add web hook and verification token. Click Verify and Save.
  28. 28. Subscribe web hook Subscribe your web hook to page events.
  29. 29. Receive message • Add a POST method to your web hook to receive all incoming messages and reply (Text limit is 320 characters).
  30. 30. What more you can do? Welcome screen Structured messages
  31. 31. Things to avoid • Premature product • No user guide/help available • Grammatical mistakes in live version
  32. 32. ChatBot Playbook • Chatbots should make life easier 🔮 • The bot should introduce itself 💁 • Continuous support # • Always suggest the next step 👟 • Start simple, but quickly add power features ⚡ • Interactions will be short, and that is okay ⏲ • A hybrid experience is the way forward 📱 • Interactions should be simple ( • Personality makes the experience more pleasant 👀 • Start off with a focused chatbot 🚴 • Reply, always 📝 Source: Thanks to Juraj Pal, CoFounder, Sure (
  33. 33. NLP Natural Language Processing
  34. 34. Challenges • Parsing Natural language i.e. language that people use in chat. • Dealing with spelling mistakes, poor grammar etc. • Feeding NLP engine with all possible words.
  35. 35. Few examples • Failed to pick city and instead of asking location, showing default location’s weather. • Gave herself a nice name, but failed to detect that.
  36. 36. • Y Combinator startup • Acquired by Facebook in Jan, 2015 • Launched free Bot Engine in April, 2016 • Provides drag and drop interface to write NLP rules • Support available for Python, NodeJS, Ruby and as REST services.
  37. 37. Manage multiple apps
  38. 38. Create Story • Story is series of chat messages to train your Bot. • Entity is the keyword that is relevant to Bot.
  39. 39. Dealing with multiple message types
  40. 40. Thanks