Home / spaCy / 3 Ways spaCy can help improve Dialogflow accuracy
spaCy

3 Ways spaCy can help improve Dialogflow accuracy

spaCy is a free open-source library for Natural Language Processing in Python.

You can use it to improve the accuracy of your Dialogflow bots.

This is somewhat advanced material, and also requires that you already have a Python programmer on your team who is familiar with the basics of Natural Language Understanding (NLU)

Automatically group chat logs into intents

You can do the verb.noun analysis I describe here to automatically group your chat logs into Dialogflow intents. It uses the spaCy dependency tree feature to extract sentences in the format specified.

This can be especially helpful if you have a lot of chat logs and you are trying to sort/cluster them without manually spending a lot of time. Even though the automatic grouping can help a little, you still need to do some manual work to finish the process.

This can improve the accuracy of your Dialogflow ES bot by making sure you are creating intents that help Dialogflow’s existing ML algorithm. To understand why, I recommend going through this article.

Autogenerate test scripts from training phrases

You can run automated conversation tests to ensure that your chatbot is working as expected. This is important because any change you make to your training phrases has the potential to break existing behavior.

The easiest way to generate test scripts is to parse your existing training phrases and programmatically add a filler word at the end. spaCy makes it easy for you to do this.

I explain the idea in this video.

Improve training phrase quality

Dialogflow matches user utterances to existing intents.

During this process, it provides an “intent detection confidence” score.

You can use spaCy to analyze all user utterances and see if you can identify patterns in the utterances which get very low confidence scores. In turn this will help you choose better training phrases for your chatbot.

When Dialogflow matches a user utterance to an intent, there are four possible outcomes: true positives, true negatives, false positives and false negatives (defined here).

We don’t care much about true positives and true negatives, although they can be useful for conversation testing.

To figure out false positives and false negatives, you can do some basic NLU analysis of your user utterance and try and see why the mapping failed. This will give you a lot of insight into what is happening under the hood.

<— End of article —>


This website contains affiliate links. See the disclosure page for more details. 
"The magic key I needed as a non-programmer"

The custom payload generator was the magic key I needed (as a non-programmer) to build a good demo with rich responses in DialogFlow Messenger. I've only used it for 30 minutes and am thrilled. I've spent hours trying to figure out some of the intricacies of DialogFlow on my own. Over and over, I kept coming back to Aravind's tutorials available on-line. I trust the other functionalities I learn to use in the app will save me additional time and heartburn.

- Kathleen R
Cofounder, gathrHealth
"Much clearer than the official documentation to be honest"

Thanks a lot for the advice (of buying and following your videos)! They helped a lot indeed. Everything is very clear when you explain, much clearer than the official documentation to be honest 🙂

Neuraz T
Review for Learn Dialogflow CX
"I will strongly recommend this course because even I can learn how to design chatbot (no programming background)"

I think Aravind really did a great job to introduce dialogflow to people like me, without programming background. He organizes his course in very clear manner since I have been a college professor for 20 years. It is very easy for me to recognize how great Aravind’s course is! Very use-friend and very easy to follow. He doesn’t have any strong accent when he gives the lectures. It is so easy for me to understand. Really appreciate it.

Yes, I will strongly recommend this course because even I can learn how to design chatbot (no programming background) after studying Avarind’s course, you definitely can!

Ann Cai
Review for Learn Dialogflow ES