Using the same entity for different values with spacy

Hello, I have a form and I am using the spacy entity extractor to extract name information in PER entity. First I ask the last name and then I ask the first name. But there is a confusion because i am using the same entity for both slots. It always the last name that is fill. Do you know how can I fix this ?

@sarah1,

If you use same entity for different slots, It will fill up the slots with the entities you are referring to. You can write a condition on def required_slots and extract one by one

def required_slots(tracker: Tracker) -> List[Text]:
        if tracker.get_slot('Firstname') is None:
            return ["Firstname"]
        else:
            return['Lastname']

1 Like

Thank you, I will try this !

I just add other slots in the conditions it is working thank you