How to deal with name from 2 different persons with spacy?

Hello everyone,

I am creating a chatbot for appointment and I have trouble mapping the right name entity with the right slot. Imagine, our talker say ‘I have an appointment with doctor Doney.’, we will got an entity PERSON for ‘Doney’ which can be mapped to a slot using a form but in the case we want to ask for the patient name after, the entity PERSON has already been filled, I can’t use it again to fill the patient name with another form because it will stick on the value ‘Doney’. My question is simple, how to handle multiple name classification?

Thanks in advance

If you have a different domain for those names as per your example Doctor and patient. First fills the slot for DOCTOR_NAME then don’t reset create another for PATIENT_NAME set it with that. It shouldn’t be an issue I feel. Is this what you are trying out?

It is what i tried with two forms filling slot with the entity PERSON but when i get my entity PERSON it directly fill my two slots patient_name and doctor_name

Have you already solved the problem?

What I mainly try to do in my bot is to work with the entity instead of the slots.

I would try working in the action file with

DOCTOR_NAME = next (tracker.get_latest_entity_values ​​(‘DOCTOR_NAME’), None)

PATIENT_NAME = next (tracker.get_latest_entity_values ​​(‘PATIENT_NAME’), None)

Do not forget to mention these examples in your stories.

  • story: user_ask_appointment steps:
    • intent: appointment entities:
      • DOCTOR_NAME: “Wendy Morgan”
      • PATIENT_NAME: “Jogn Dheere”
    • action: actions.appointment

Hi, yes it is finally what i did, i created 2 differents entities one for the patient and one for the doctor.