How to handle situation with two numerical entities

Hello, how should I handle situation in which I have two entities in form that are numbers. For example in restaurant reservation I may ask user for

  • number of people
  • number of tables

I can extract number, but how to assign the value to proper slot?

Hello @kaladin,

If you have 2 seperate intents (inform_num_people, inform_num_tables), you can try using custom slots mapping like this:

def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]:
    return {
        'num_people': self.from_entity(entity='number', intent='inform_num_people'),
        'num_tables': self.from_entity(entity='number', intent='inform_num_tables')

If you want to extract them in one sentence, then i suggest having 2 seperate entities (num_people, num_tables) and train the model to recognize both of them.

1 Like