Multiple Entities for same word

I need some clarification. I have an intent named “Intent_ask_documents” in which I have marked the word “documents” as an entity “doc” Example… : I want to renew my license. Can you tell me which documents are required? Which documents do I need to renew license? etc

Here you can see the word ‘document’ is tagged as entity “doc”. Now I have an intent with sentences… “Intent_Lost” I have lost my ID card and I want to report it. I have lost documents of my car and I want to report it.
OR I have lost some documents and I want to report. Now the same word “documents” have been tagged with different entities in different intents.

How do I handle this scenario?

Hello!

You can use slot mapping for example

intents:
- intent_ask_document
- intent_lost_document

entities:
- document

slots:
  asked_doc:
    type: text
    mappings:
    - type: from_entity
      entity: document
      intent: intent_ask_document
  lost_doc:
    type: text
    mappings:
    - type: from_entity
      entity: document
      intent: intent_lost_document

Reference: Domain

OR if really want different entities you can use role labeling

intent_ask_documents:
- I want to renew my license. Can you tell me which [documents]{"entity": "doc", "role": "asked"} are required?

intent_lost_document:
- I have lost my [ID card]{"entity": "doc", "role": "lost"} and I want to report it. 

Reference: NLU Training Data

1 Like

This is exactly what synonyms are for :slight_smile:

nlu:
- synonym: document
  examples: |
    - documents
    - doc
    - docs