I’m trying to build a bot for entity extraction and intent detection. That being said, I’m just interested in NLU. Giving query/question as an input/request and getting intent and its parameters (entities) as an output/response.

E.g. Let’s say my intent name is DetectItem. Examples will be
I have a Mango
I have a Chair
Do you need Coffee

Please note that there is only one entity here called @Item which will have values as Fruit, Furniture and Drink.
Mango, Banana etc. would be synonyms for Fruit.
Similarly, Chair, Table would be synonym for Furniture and so on.

Now with the above, setup. If I ask “Where is my tea”, Response should be
Intent - DetectItem
Entity - Item
EntityValue - Tea.

I can do similar stuff in Dialogflow. If you want I can share an export of dialogflow agent. Can you please suggest whether I can do similar thing with Rasa NLU.

Also, please note that the example I gave above is pretty general but in my case it would be completely different(custom) values and those values won’t be common or well known values. That being said, any general dictionaries won’t help and I have my own dictionary as I mentioned.

Could you please suggest which model will fit in the best for above use case ?

So far, I have tried to set up mitie + sklearn as that might fit well based on what we researched (not sure though). We are using RASA-UI to generate agent, intent and entities. However, the agent test data that will be fed to training doesn’t contain entities synonyms and hence it doesn’t work in a way it should. Please help us to understand this better.

Make sure you include entities and their synonyms inside your training dataset. If you are using Rasa UI for it, one of the ways to do it is to highlight the entity as you would usually do, assign it the entity name ‘Item’ and the change it’s value to the name of the group you would like that entity to be a synonym of. For example, based on the picture below, the input is ‘Where is my tea’. I highlighted ‘tea’ as an entity and assigned this entity a name ‘Item’. Then instead of leaving original value ‘tea’, I changed it to ‘Tea’ so that my model would know that when it sees an entity ‘tea’ it should be extracted with the value ‘Tea’ instead.

Many thanks for your quick revert. However, my scenario is little different. My entity is not just a list of values. It also has synonyms. Below are screenshots from the Dialogflow to demonstrate what I’m looking for with RASA.

Yeah. I have checked this. Thanks Again. So is that the only solution as of date ? The reason I didn’t go for that solution is that

My entity values may get updated

Generating examples for each possible set of entity value will lead to m power n (where m is number of entities in an intent and n is number of values in a given entity) x no of examples for given intent. That will make it a very very large number of example statements. That doesn’t sound like a right way to do it as it diminishes the reason to use Natural Language Understanding and power of algorithms.

It would be great to know if RASA supports something like what I attached in screenshots above.

I understand what you mean, you don’t need to provide an example for every possible sentence structure for every entity. Just a few so the model is aware of it.
Could you also try this PR for your use case? https://github.com/RasaHQ/rasa_nlu/pull/822
That should directly extract the entity values you list there.
Or you could try adding regexs to your training data file for your entities.

As for the RASA UI, this isn’t something we built ourselves but is a project by one of our contributors, so I’m not too sure about the specifics of it. But I would assume it deals with synonyms in the Rasa sense, so mapping an entity to a particular slot value

Thanks @akelad for the quick revert. We took a look on the thread you suggested to use Phrase Matcher and it looks like it is close to what we are looking for. However, there isn’t any clear documentation. Can you please help us to understand what is the difference between entity_phrases and entity_synonyms ? Below link has an example json that uses this.

So the entity_phrases are entities that should be extracted from the text. And synonyms are values that entities can be mapped to. So if you extract say entities for cuisine like chinese, japanese, thai, but only actually want to search for a broader cuisine like asian in your custom action, you can specify synonyms for this like specified in the entity_synonyms you linked