Synonym in Rasa

Can I define synonym of a word, not an entity in Rasa?

Example: It is a good place

Synonym: Place

  • location
1 Like

hi @tanzar - there is no mechanism for this. What are you trying to achieve with that?

What about for specific entities? Say you had an entity “countries” and you wanted to create a synonym for:

synonym: United Kingdom
    examples: |
    - UK
    - England
    - Great Britain

Actually, I want to do it for Bangla and Banglish Language. For example in English my intent:

  • intent: chitchat/other examples: | - It is a good place - It is a nice place

So when someone writes that, “it is a good location”, bot can understand that it is chitchat/other intent as place and location are synonyms. How to achieve it?

thanks @tanzar ! That clarifies things. Ultimately you are asking your model to generalize by understanding there are different ways to say the same thing. There are two pieces to this:

  1. you need at least a little bit of real training data (real user messages that you’ve annotated)
  2. you need a Featurizer that understands which words are synonyms. Word embeddings are a common choice, but any of the pre-trained models available in Rasa should do this well. You can check out this page to learn more.

Also if you want to learn more about how this actually works, I can highly recommend the Algorithm Whiteboard series on youtube.


Thanks for your suggestion.