AI for UI

Why bots?

Why bots?

  • Natural Language is the future - Don't Make Me Think

Why bots?

  • Natural Language is the future - Don't Make Me Think

  • APIs are getting simpler and cheaper

Why bots?

  • Natural Language is the future - Don't Make Me Think

  • APIs are getting simpler and cheaper

  • Everybody's doing it!

Who's doing it?

  • Facebook – Wit.ai

  • Google – API.ai

  • IBM – Watson

  • Microsoft – Luis

  • Probably everyone else

Why bots?

  • Natural Language is the future - Don't Make Me Think

  • APIs are getting simpler and cheaper

  • Everybody's doing it!

  • They'll be conscious soon, so pick a side

Why Wit.ai?

Why Wit.ai?

+

Reasons to use Wit.ai:

  • Free to use and open-source on github

  • Highly-customizable

  • Owned by Facebook

Reasons not to use Wit.ai

  • Slightly more complicated to employ than some paid options – API.ai, IBM Watson

  • Owned by Facebook

Mark never blinks.

Get started with Wit

  • Create an account and get an API key

Get started with Wit

  • Create an account and get an API key

  • Create a 'Story' - conversation your bot can have

Create a story

  • Most bots only need one story

  • Define custom intents and entities

  • You'll write the functions in the next step

Get started with Wit

  • Create an account and get an API key

  • Create a 'Story' - conversation your bot can have

  • Clone the repo

Node Wit

git clone https://github.com/wit-ai/node-wit
cd node-wit
npm install
npm install node-wit --save
(you will likely need express and body-parser, too)

Don't fear the Repo!

Get started with Wit

  • Create an account and get an API key

  • Create a 'Story' - conversation your bot can have

  • Clone the repo

  • Code some functions

Code some functions

  • Starting point provided in repo

  • Set props on the 'context' object

  • Add 'actions' to the 'actions' object

API Integration

  • Most actions require additional APIs

  • Calls to those servers are async

  • Use ES6 Promises!

Integrate

  • Facebook Messenger with 'webhooks'

  • HTTP API for live pinging the Wit server

  • Express app for other stuff

“Results! Why, man, I have gotten a lot of results! I know several thousand things that won’t work!”

- Thomas Edison (maybe)

Post-reading:

  • Wit.ai API docs – https://wit.ai/docs

  • chatbotsmagazine.com – "How Bots will completely kill websites and mobile apps"

    https://chatbotsmagazine.com/how-bots-will-completely-kill-websites-and-mobile-apps-656db8e6fc03#.r1i6svikf

  • A review of Natural language APIs

    https://medium.com/@Conversate/natural-language-apis-for-bots-e791f090e32f#.wyl2yxchb

AI for UI

By Luisa de Miranda

AI for UI

An introduction to AI APIs: lightweight implementations

  • 668