Image for post
Image for post
Photo by Luo Lei on Unsplash

Your Chatbot Has A Big Vulnerability And This Is How To Fix It

Improve Chatbot Resilience By Adding An Initial High-Pass NLP Layer

Introduction

Image for post
Image for post
More Complex Entity Detection with Linked Entities

But We Tested

Image for post
Image for post
Entity List with Normalized Result

Our Tools Are Shaping Us

What Goes Wrong

Image for post
Image for post
Entities with Relations are Detected

The Solution

Step 1: Automatic Language Detection

Image for post
Image for post
Language Detection with a Confidence Score

Step 2: Sentence Boundary Detection

Image for post
Image for post
Sentence Boundary Detection using spaCy

Step 3: Find All Named Entities

Image for post
Image for post
Extracting Named Entities from a Sentence
Image for post
Image for post
Detail On Each Named Entity Detected

Step 4: Determine Dependencies

Image for post
Image for post
Python Code To Determine Dependencies
Image for post
Image for post
Matrix Of Returned Data
Image for post
Image for post
A Visual Representation Of Dependencies

Step 5: Clean Text From Any Possible Markup

Image for post
Image for post
This Is An Example From The Documentation

Step 6: Tokens

Image for post
Image for post
A Simple Example Of A Sentence Tokenized

Conclusion

Written by

NLP/NLU, Chatbots, Voice, Conversational UI/UX, CX Designer, Developer, Ubiquitous User Interfaces. www.cobusgreyling.me

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store