Synonyms of zero vectors

Hello everyone!

I’m trying to specify 2 unique intents on acronyms with questions such as “What is XXXX?” and “What is YYYY?”, specifying the empty vectors ‘XXXX’, ‘YYYY’ as synonyms of their full forms. But the model always confuses one intent with the other. Do you have any suggestions?? Thank you so much!

Synonym specified as follows:

synonym:XrayXrayXraysXrays

  • Xray Xray Xrays Xrays
  • xxxx
  • XXXX

intent:xxxx

key_xxxx: entity

Synonyms don’t work this way, they only replace the entity value once the entity has been extracted. So you need to provide examples with the variants within the intent examples

Thank you for your reply. The RASA documentation on synonyms is rather ambiguous: http://www.rasa.com/docs/nlu/0.12.1//dataformat/. There is only one example for the two ways in which you can specify synonyms. There’s not much info for markdown formats.

Here is an example which doesn’t work well: entity: kw_dea

synonym:Data Exchange Agreement

  • Data Agreement
  • DEA
  • Xchange Agreement
  • dea
  • Dea

intent:dea

  • What is DEA?
  • What’s [Data Exchange](kw_dea:Data Exchange Agreement)
  • Can you explain [Data Exchange Agreement](kw_dea:Data Exchange Agreement)?

Is this the right way to specify synonyms? Many thanks once again.

Synonyms will map extracted entities to the same name, for example mapping “my savings account” to simply “savings”. However, this only happens after the entities have been extracted, so you need to provide examples with the synonyms present so that Rasa can learn to pick them up.

This is from the docs.

What exactly isn’t working very well in your example? It looks more correct to me how you’ve specified synonyms, but you still should provide examples for “Xchange agreement” at least. Also, 3 examples for one intent won’t work very well for intent classification or entity extraction. I’d say have at least 20 examples

@akelad Thank you for replying.

I do have examples for every single synonym example in my training set and around 20-30 examples per intent. However, the bot can never answer “What is DEA”, only “What is Data Exchange Agreement” in the above example. I am struggling to understand why. Is it because DEA is an empty vector? But the synonym mapping should have helped?

Thank you once again!

Is the entity not getting extracted? Try running Core in debug mode, that should help you find out what’s going wrong. There’s docs about it here: http://rasa.com/docs/core/debugging/

Hi akela,

So do i need to provide examples in intent for all the synonyms? Doesn’t that beat the purpose of synonyms?

Sorry, just a bit confused, Shruti

well synonyms aren’t designed to reduce the amount of training data you have to write. So yeah you have to write some examples for your synonym values too