Avoid filling slot with None

Hello,

I’ve an intent my_name_iswith multiple example and a lookup table.

## intent:my_name_is
- Je m'appelle [Julien](name)

When the first name is not in my lookup table, the agent is not using the fallback policy but make an answer with None.

templates:
  utter_name:
  - text: Salut, comment t'appelles-tu ?
  - text: Hey! A qui ai-je plaisir de m'adresser ?
  - text: Coucou! Comment dois-je t'appeler ?
  utter_greet:
  - text: Enchanté {name}. Que puis-je faire pour toi ?
  - text: Super {name}. En quoi puis-je t'être utile ?
  - text: Salut {name}, quel est l'objet de ton message ?

For instance,

  • Rasa: Salut, comment t’appelles-tu ? (Hi, What’s your name ?)

  • User: My name is Juliien (there is a type in the first name. So, it’s not in the lookup table).

  • Rasa: Enchanté None. Que puis-je faire pour toi ? (Nice to meet you None, What can I do for you ?)

This is the story:

## greet
* greet
    - utter_name
* my_name_is{"name":"Pierre"}
    - utter_greet

I want to call a fallback to try fixing the typo.

How can I do that ?

Regards,

Julien.

The fallback is for intents, and your intent is correctly identified as my_name_is, so calling fallback is not the solution.

What you need is a custom action to analyze the phrase, discard the words you don’t need and compare the rest to the names you have. To eliminate words, start with the stop words of your language using nltk and add others that you’ll find in this context, like “je”. _For the names you can create apyspellchecker dictionary and use the correction function.