Search code examples
rasa-nlurasarasa-core

Handling misspelled entities


let me describe you my problem. I have NLU intent get_food with examples like this:

version: "2.0"


nlu:
  - intent: get_food
    examples: |
      - I want to know more about [apple](food).
      - I am interested in [pear](food) nutrition facts.
      - Tell me something about [banana](food).
      - ...

  - lookup: food
    examples: |
      - apple
      - banana
      - peach
      - pear
      - avocado

The idea is to store extracted entity food into slot food which is working (almost) as expected. The problem is when a user misspells for example apple with appel. It's still extracted perfectly but it stores misspelled value appel into food slot. Is there any way to let my RASA assistant pick exact value listed in look-up table with the highest confidence, store this value into food slot and ignore everything not listed in this look-up table? For example if user asks for details about appel, it will store apple into food slot, but if user asks for details about pineapple it will store null into food or something like this. Thanks for any suggestions.


Solution

  • You would need to call a custom action to clean-up the spelling errors.