Bot Driven Development

Mark Orel

 

About me

 

JS Addicted

 

@markbaraban

 

Software Engineer

 

Full-Stack Developer

 

Step back

Bot?!

< 90s

+- 00s

 

+- 05s

 

middle 20s

 

Dictionary.com

Nowadays

Beginning

- All in all, when will we create our own bot, to help people with booking?

- Think it's a great idea.

 

Motivation #1

 

Alcohol game:

1. Open any website.

2. If website has its own chat-bot -> drink.

 

Motivation #2

 

Proof of concept.

Language representation

- Are you sure?

- Yes/No.

 

Try #0

Try #1

 

Try #2

 

Flying Spaghetti Monster

Finite-state machine

 

FSM

M = (V, Q, q_0, F, \delta)
M=(V,Q,q0,F,δ)M = (V, Q, q_0, F, \delta)
V
VV
Q
QQ
q_0
q0q_0
F
FF
\delta
δ\delta
is the input alphabet 

is a finite, non-empty set of states

 

is an initial state

 

 is the set of final states (possibly empty)

 

is the state-transition function

 
\delta
δ\delta
action => handler(state, action) => state

set of states.

const Q = {
    "0": hello,
    "01": doYouLikeMe,
    "010": sad,
    "011": happy,
};

handle.

 
const doYouLikeMe = (state, params) => {
    if (params) {
        const goTo = makeStateDecision(state.id, params);
        return {
            id: goTo,
            type: "transition"
            ...state
        }
    } else {
        return {
            message: "Do you like me?",
            type: "input",
            ...state
        }
    }
}

make decision.

 
const makeStateDecision = (id, param) => {
    if (param === 'YES') {
        return '011';
    }
    return '010';
}

process.

 
let state = { id: 0 }
let params = null
while(true) {
    const handler = Q[q.id]
    state = handler(state, params)
    if (state.type === 'message') {
        say(state.message)
    }
    if (state.type === 'input') {
        params = ask(params, state.message)
    }
}

Done.

Upgrade #1

Global handler.

Upgrade #2

 

Machine learning

(HMM, Neural Networks)

 

Upgrade #3

 

AIasS

(wit, pandorabots)

 

Why should you try?

  1. People are messengers-addicted

  2. Expansion outlook

  3. Maybe you'll become the creator of real AI

  4. It's fun

 

Happy end.

@markbaraban

Homework

 

Bot Driven Development

By Mark Orel

Bot Driven Development

Talk about chat bots development approach.

  • 838
Loading comments...

More from Mark Orel