Upload
saurabh-sharma
View
503
Download
2
Embed Size (px)
Citation preview
Introduction to Facebook Messenger,
Conversational UI &
NLP~ Saurabh Sharma
Messanger Platform
Launched on 12th April 2016 in F8 annual developers conference.
Was it a big news?
Facebook unveiled 10 year roadmap, with key stress on AI.
AI Bots Platforms
Use BotList.co (App Store for Bots) to discover bots for all platforms.
Why Messenger is important?
Source: http://www.statista.com/statistics/258749/most-popular-global-mobile-messenger-apps/
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.
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.
Trying Poncho: The weather cat
• Greets user by name.
• Predicts weather
• Able to process simple NLP to answer questions.
Human > Bot
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
Why is it important?
• Truly cross-platform
• Removes Human-Computer interaction friction
• More interactive/user friendly.
Rise of Voice Assistants
Where it all started? Chat bubble
Source: http://dangrover.com/blog/2016/04/20/bots-wont-replace-apps.html
And then WeChat started a new revolution in China
Source: http://dangrover.com/blog/2016/04/20/bots-wont-replace-apps.html
Messaging apps are booming
What experts are saying?
Some big news: Foursquare is remaking itself as a bot
Facebook Messenger Bot Development
Step by step Guide
Tech Stack covered in session
NodeJS
Wit.ai
Heroku
Facebook Messenger Bot
Step 1: Gather your armours
Setting your development environment
1.1 HerokuWhy?
• Quick setup, supports all major languages
• Provides HTTPS, a prerequisite for web hooks to integrate with Facebook messenger platform
• Download heroic tool belt: https://toolbelt.heroku.com/
Heroic Commands• Login:
• Create App:
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
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
Step 2: Setup Facebook app
Linking app to web hooks
Create page and appCreate:
• Facebook page
• Facebook app
Subscribe web hook to messages
In the pop-up, add web hook and verification token. Click Verify and Save.
Subscribe web hook
Subscribe your web hook to page events.
Receive message• Add a POST method to your web hook to receive
all incoming messages and reply (Text limit is 320 characters).
What more you can do?Welcome screen Structured messages
Things to avoid
• Premature product
• No user guide/help available
• Grammatical mistakes in live version
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: https://chatbotsmagazine.com/the-bot-playbook-7bb6d181a6a9#.auv6qenh6 Thanks to Juraj Pal, CoFounder, Sure (http://besure.io/)
NLPNatural Language Processing
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.
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.
Wit.ai• 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.
Manage multiple apps
Create Story
• Story is series of chat messages to train your Bot.
• Entity is the keyword that is relevant to Bot.
Dealing with multiple message types
Thanks