Entities Definition / Synonym

Hi - I need help and suggestions related to Entity and Synonyms. I have defined two intents as follows in nlu.md file :

intent:flow

  • which flows consist of [Ordering] (application)
  • are there any scenarios which involve [Ordering] (application) and [Billing] (application)
  • do we have any use cases that involve [CRM] (application)

intent:interface

  • is there an interface from [Ordering] (source) to [CRM] (target)
  • give me all applications that interact with [Billing] (target)
  • do we have any integration between [CRM] (source) and [Biilng] (target)

synonym:application

  • Ordering
  • Billing
  • CRM
  • App4
  • App5
  • Etc …

My confusion is that, I have two intents that both involve application names.

  1. In intent flow, I am trying to find all the flows which have a certain application involved in it. When I train and run the rasa, it is able to identify the intents and also the entities for intent A.

  2. What I am not clear is that it is not working as expected to identify {source} and {target}. I am not sure how to define these entities as the values in them are same as entity {application}.

Would appreciate help and suggestions.

Any help or suggestions from anyone ? I am kind of stuck how to fill these slots of source and target ?

Both source and target represent my applications. So this means that both have same set of values.

It would look something like this -

synonym:source

  • CRM
  • Ordeing
  • Billing
  • App3
  • App4
  • App5
  • So on … long list

synonym:target

  • CRM
  • Ordeing
  • Billing
  • App3
  • App4
  • App5
  • So on … long list

But as per what I understood, the above won;t work. So how can we make Rasa work to extract these two values as sometimes CRM can be source and sometimes target ?

Hi @utsuk.prani, thanks for the detailed description. I’m currently working on composite entities (see Composite Entities as part of Rasa NLU · Issue #3765 · RasaHQ/rasa · GitHub & Update data format to support composite entities · Issue #5465 · RasaHQ/rasa · GitHub) to solve this kind of problems. I will have a working solution ready end of this week.

What are composite entities? Currently you can just assign one entity label to a word. However, sometimes you actually want to have more fine-grained labels. Composite entities allow you to assign a second label to a word next to the entity label. For example

do we have any integration between [CRM]{"entity": "application", "role": "source"} and [Biilng]{"entity": "application", "role": "target"}

Using custom actions or forms you will be able to fill a slot based on an entity and role label.

Would you be interested in testing the feature before we actually release it? If yes, I would contact you next week and send you the details on how to try it out.

Hey @Tanja , thank you so much for the reply. I was trying for this for quite sometime and I thought I missed something. I would really want to be part of the testing. Please feel free to contact me. Would like to help in whichever way I contribute.

1 Like

Hi @Tanja, quick comment / query after I went over the Github link you shared above.

Overview of the Solution : Markdown We want to change the annotation format for entities: I want to fly from [Berlin]{"entity": "city", "role": "origin"} to [LA]{"entity": "city", "role": "destination", "value": "Los Angeles"}

If a user writes things in reverse. Say for example ‘to’ coming first and ‘from’ coming later. will that also be picked by Rasa ?

I want to fly to [Berlin]{"entity": "city", "role": "destination"} from [LA]{"entity": "city", "role": "source", "value": "Los Angeles"}

WDYT ?

The order does not matter. Important is that the annotation is correct. Also, you should actually include examples for both orders in your training data so that the model is able to generalize and assigns the correct role next to the city label.