How to use FuzzyWuzzy in NLU pipeline

as mentioned in this article: Entity extraction with the new lookup table feature in Rasa NLU

I want to use fuzzywazzy library to help matching user input in NLU pipeline … how can I use it?

There seems to be no premade solution

You would have to write a custom entity extractor. I recommend using the duckling or the spacy extractor as an example.

In that extractor, you use a variation of this code

choices = ["Atlanta Falcons", "New York Jets", "New York Giants", "Dallas Cowboys"]
process.extract("new york jets", choices, limit=2) [('New York Jets', 100), ('New York Giants', 78)
process.extractOne("cowboys", choices) ("Dallas Cowboys", 90)

I think rasa would appreciate a pull request if you are done with that.

1 Like

where to write this custom entity extractor … in which file and how to replace the default extractor.

If you are willing to pay me, I can do that for you.

Otherwise you need to put in some effort yourself. Clone the rasa_nlu repo. Analyze how the other extractors work and create a custom one with that knowledge.

Check out the pipeline part in the documentation on how to enable it.

2 Likes