IBM's Jeopardy-playing Watson “knew” facts and could construct realistic natural language responses, but it couldn’t schedule your meetings or deliver your groceries.
spa Cy is easy to use and fast, though it can be memory intensive and doesn’t attempt to cover the whole of statistical NLP.
Text Blob wraps the sprawling NLTK library in a very approachable API, so while it can be slower, it’s quite comprehensive.
A shopping bot could have the persona of a helpful person, a cheerful kitten, or have no personality at all.
Having warned you away from human personifications, I’m going to break my own rule and create a bot with a particular set of well-known personality traits and interaction models.
Dependency grammars describe the relationship among all clauses in a sentence, allowing you to discriminate between (say) the subject and object of a sentence.
If your bot needs to know the difference between “dog bites man” and “man bites dog”, I recommend using the dependency parsing function of a library like spa Cy.Bots have historically been personified as something less than fully human to excuse their rote responses and frustrating lack of comprehension.This can be an opportunity for creativity and playful invention—the first bot I helped design was modelled after a famous parrot—but it can also be a minefield of unexamined assumptions.I’ll use Text Blob here, though see my article on text generation for an example using spa Cy.property, which returns the words’ parts of speech.(You’ll want to consult the Penn Treebank reference to map the part-of-speech tag names to the actual grammatical constructs.) Depending on the bot’s domain, you’re going to be more interested in some values than others, and you may also want to transform some of the input values or identify synonyms.