Photo by Izzy Gibson on Unsplash

DeepPavlov Is An Open Source Conversational AI Framework

Here Are A Few Key Concepts & How To Start using DeepPavlov

Introduction

As chatbot development frameworks move from a No-Code environment all the way op to native code (pro-code), the ability to fine-tune increases. And in most cases the barrier to entry also increases.
There is been much talk about the low-code approach to software development and how it acts as a catalyst for rapid development. And how it acts as a vehicle for delivering solutions with minimal bespoke hand-coding.

Where Does DeepPavlov Fit In?

DeepPavlov refers to a Semantic Frame. This includes Natural Language Understanding, encompassing Domain Detection, Intent and Entities.

Goal-Oriented Bot In DeepPavlov

[
[
{
"speaker": 2,
"text": "Hello, welcome to the Cambridge restaurant system. You can ask for restaurants by area, price range or food type. How may I help you?",
"slots": [],
"act": "welcomemsg"
},
{
"speaker": 1,
"text": "cheap restaurant",
"slots": [
[
"pricerange",
"cheap"
]
]
},
{
"speaker": 2,
"text": "What kind of food would you like?",
"slots": [],
"act": "request_food"
},
{
"speaker": 1,
"text": "any",
"slots": [
[
"this",
"dontcare"
]
]
},
{
"speaker": 2,
"text": "What part of town do you have in mind?",
"slots": [],
"act": "request_area"
},
{
"speaker": 1,
"text": "south",
"slots": [
[
"area",
"south"
]
]
},
{
"speaker": 2,
"text": "api_call area=\"south\" food=\"dontcare\" pricerange=\"cheap\"",
"db_result": {
"food": "chinese",
"pricerange": "cheap",
"area": "south",
"addr": "cambridge leisure park clifton way cherry hinton",
"phone": "01223 244277",
"postcode": "c.b 1, 7 d.y",
"name": "the lucky star"
},
"slots": [
[
"area",
"south"
],
[
"pricerange",
"cheap"
],
[
"food",
"dontcare"
]
],
"act": "api_call"
},
{
"speaker": 2,
"text": "The lucky star is a nice place in the south of town serving tasty chinese food.",
"slots": [
[
"area",
"south"
],
[
"pricerange",
"cheap"
],
[
"name",
"the lucky star"
],
[
"food",
"chinese"
]
],
"act": "inform_area+inform_food+offer_name"
},
User utterances:
----------------
[ {'prev_resp_act': None, 'text': ''},
{'prev_resp_act': 'welcomemsg', 'text': 'id like to find a restaurant'},
{'prev_resp_act': 'request_pricerange', 'text': 'in appleton wiscon'},
{ 'db_result': { 'addr': '88 mill road city centre',
'area': 'centre',
'food': 'chinese',
'name': 'rice house',
'phone': '01223 367755',
'pricerange': 'cheap'},
'prev_resp_act': 'api_call',
'text': 'in appleton wiscon'},
{'prev_resp_act': 'offer_name', 'text': 'restaurant'},
{ 'prev_resp_act': 'offer_name',
'slots': [['food', 'irish']],
'text': 'irish food'},
{ 'db_result': {},
'prev_resp_act': 'api_call',
'slots': [['food', 'irish']],
'text': 'irish food'},
{'prev_resp_act': 'canthelp_food', 'text': 'appleton wisconsin'},
{'prev_resp_act': 'canthelp_food', 'text': 'thank you'},
{'prev_resp_act': 'canthelp_food', 'text': 'good bye'}]
System responses:
-----------------
[ { 'act': 'welcomemsg',
'text': 'Hello, welcome to the Cambridge restaurant system. You can '
'ask for restaurants by area, price range or food type. How '
'may I help you?'},
{ 'act': 'request_pricerange',
'text': 'Would you like something in the cheap, moderate, or expensive '
'price range?'},
{ 'act': 'api_call',
'text': 'api_call area="dontcare" food="dontcare" '
'pricerange="dontcare"'},
{ 'act': 'offer_name',
'slots': [['name', 'rice house']],
'text': 'Rice house is a great restaurant.'},
{ 'act': 'offer_name',
'slots': [['name', 'rice house']],
'text': 'Rice house is a great restaurant.'},
{ 'act': 'api_call',
'slots': [['food', 'irish']],
'text': 'api_call area="dontcare" food="irish" pricerange="dontcare"'},
{ 'act': 'canthelp_food',
'slots': [['food', 'irish']],
'text': 'I am sorry but there is no irish restaurant that matches your '
'request.'},
{ 'act': 'canthelp_food',
'slots': [['food', 'irish']],
'text': 'I am sorry but there is no irish restaurant that matches your '
'request.'},
{ 'act': 'canthelp_food',
'slots': [['food', 'irish']],
'text': 'I am sorry but there is no irish restaurant that matches your '
'request.'},
{'act': 'bye', 'text': 'You are welcome!'}]
Interacting with the chatbot via a Google Collab Notebook.

More on Dialog Development Approaches

Design Canvas

Dialog Configuration

Native Code

ML Stories

Conclusion