Photo by Vladimir Malyutin on Unsplash

Using spaCy In Your Chatbot For Natural Language Processing

And It’s Easier Than What You Think…


The simplest example of a spaCy implementation.



What is Conversational AI?


Practical Implementations

In this example a nlp object is created and a sequence of tokens are assigned to doc. A doc is a container for accessing linguistic annotations.
A listing of the tokens, part of speech and dependencies.
Here the pattern is iPhone and X.
In this more complex example the pattern is looking for iOS followed by any number.
Any form of the word “download” is matched. But only if followed by a proper noun.
Here a proper noun needs to be followed by a verb to be detected.
A similarity score can be retrieved between two spans.
Creating a function to check if text has a number.
Appending text with the label of Person, Organization, Geo Political Entity or Location to a Wikipedia URL.
In this example data is retrieved in JSON format from an URL and a doc object is created. When criteria is met from a set of patterns, an entity name of Gadget is assigned to it.