Can a "word" be two entities at same time?

“wordx” is “entity1”

“wordx” is also “entity2”

i am trying to find [aziz] (person)(human)

aziz is human and as well as person

1 Like

No. If a single token belongs to an entity it must belong to a single entity.

Note that if a token is part of a multi-token entity that we have a similar thing.

My name is [Vincent Warmerdam](person_name)

In this example the entity is “Vincent Warmerdam”. There’s one entity, not two.

One thing that you can do though is have enities with extra context like roles or groups. More information on that can be found here

1 Like

Hi, @koaning!

But what if for choosing an answer I need two pieces of information? An illustrating example I made:

Ticket from Tallin{"entity": "Estonian_city", role:"from"} to Tartu{"entity": "Estonian_city", role:"to"}
Ticket from Tallin{"entity": "Estonian_city", role:"from"} to Helsinki{"entity": "foreign_city", role:"to"}
Ticket from Rome{"entity": "foreign_city", role:"from"} to Helsinki{"entity": "foreign_city", role:"to"}

and for each of these cases the answer is a bit different, because it depends on: is the ticket for crossing the border, moving within the country or outside the country. One form and intent for it seemed appropriate for this task.

When I convert the answers into slots I lose the entity name value. Can I overcome this somehow or should I instead just make an entity “city” and add a validation whether the city is in or outside the country within some action?

You can write a custom action or a validator to handle these use-cases. The idea is that you’d fetch the entity information from the tracker and write it into a slot using python code. That way you can fully customise what information is saved where.