The only thing worse than using slot filling is to use it for a use case where it doesn't even make sense.
Motivation for slot filling
I have talked about this in my free 5 day course Understanding Slot Filling, but the real reason you want to use slot filling is because the user's question/message is posed in a specific format.
First, let us look at an example of a user wanting to book a flight.
They might say any of the following:
I would like to book a flight
I would like to book a flight from Seattle to New York
I would like to book a flight for 4
I would like to book a flight leaving from Seattle tomorrow
Notice that the intent is specified in bold text, and the entities are specified in italics.
Now imagine a conversation like this where the user is typing something to your bot:
User: I would like to book a flight for 4 people
Bot: OK, for how many people?
Now, that would make your chatbot look really stupid because the user is thinking "What? I just said it is for 4 people".
Slot filling is very handy in such circumstances, because it infers that the user has already provided one of the pieces of information (slot) needed to book the flight and only prompts for the rest.
In addition, slot filling is smart enough to handle multiple slots provided in the same sentence, and also smart enough to understand that the user could specify the first slot(s) in any order. (Like the example above).
So let us first start with some terminology:
Opening sentence - the first phrase that the user says to your chatbot
Slot - one of the pieces of information you need to collect for completing the task
Entity - Dialogflow's terminology for the name of the slot
Intent - The task at hand (again, in Dialogflow terminology. In this case it would be "booking a flight")
Your website contact form
Now let us take the example of your website contact form.
Suppose you provide marketing services. As part of filling out your contact form, the prospect has to fill out their website URL, their company Twitter handle, and their Facebook page URL, and also the company name and their estimated budget.
Since you decided to use a Dialogflow bot for collecting this information, you also looked at Google's demo and decided you will just use a bunch of slots for getting this information.
Is that a good idea?
A checklist to decide for yourself
I have put together a small checklist you can use to decide for yourself whether what you are doing is actually slot filling.
1 Could the opening sentence include ANY of the slots?
Take an example of flight booking. It is quite natural to say:
"I would like to book a flight for 4" or "I would like to book a flight leaving tomorrow".
In other words, it is natural to use any of the slots in the opening sentence.
What about your contact form?
"I would like to know more about your marketing services and my budget is $50000"
"I would like to know more about your marketing services and my Twitter handle is @examplecom"
See, almost no one talks like that!
2 Could the opening sentence include ALL of the slots?
Now with the flight booking example, someone might include all the slots in their opening sentence:
"I would like to book a flight from Seattle to New York for 4 people leaving tomorrow and returning next Monday".
It is quite a lot to say, but it isn't unnatural.
Imagine if your prospect said the following:
"I would like to know more about your marketing services and my website is at www.example.com and my Twitter handle is @examplecom and my Facebook page is at facebook.com/example and my company name is Example and the budget is $50000".
3 Could the slots be specified in any order?
In the flight booking example, it is quite possible that the slots are specified in any order (maybe not quite all combinations, but there are many possible combinations):
"I would like to book a flight from Seattle to New York for 4 people leaving tomorrow and returning next Monday"
could just as well be:
"I would like to book a flight for 4 people from Seattle to New York leaving tomorrow and returning next Monday"
I leave it as an exercise for you to imagine if this would work for your specific use case.
4 Are all the slots ACTUALLY required?
Does your prospect actually need to provide you with all this information before you can accept them as clients? Probably not. You could probably get just their contact info (e.g. email address) and ask the rest later.
In theory, you could also do the same with the flight booking (i.e. have a travel agent call the customer later), but that would sort of defeat the purpose of having the chatbot in the first place.
5 Is it possible a slot may not exist?
Is it possible your prospect doesn't have a website?
While it is unlikely, it is possible.
Can you still have them as a client even if they don't have a website? For sure, in fact you could be the one who actually sets up their website for the first time!
Is it possible to book a flight without knowing the destination?
6 Do the slots change dynamically?
Here is a comment someone left me recently:
In case you are wondering why my answer seems so blunt, it is because the user left this comment under a long article explaining why I avoid using slot filling.
But it perfectly illustrates the overall point of my article. If all you know is slot filling, everything looks like a slot filling problem 🙂
Don't blindly start using slot filling (required parameters) for your chatbot without understanding what it is and where it is appropriate.
You might ask: OK, so let us say that my task does satisfy everything in the checklist. Is it OK to use slot filling then? Yes, use the concept, but not the feature. I will explain in a future article.
Check out my guide to Dialogflow slot filling.
- Using Collect.chat for preNLU bots
- Reader Question: How to get some sample training data for Dialogflow?
- Getting the top 3 (or top N) intents in Dialogflow: An experiment
- Dialogflow Regexp (regular expression) entity
- Using Dialogflow for educational bots
- Chatbot makes $3 million in sales in 1 hour
- Reader Question: Intent based FAQ bots vs knowledge based FAQ bots
- Should you use Dialogflow from scratch?
- 3 ways Airtable can speed up your Dialogflow prototype development
- Automatically generating a rich Dialogflow website chatbot