How to deal with the 2 intents having similar kind of text?
For example, I am having following Intents:
\
Also, I do have both these intents in the stories.md as the initial point(entry point).
But, when I request for the text: “sales by period”, it correctly gives a response i.e classifies as intent “sales_function” but when querying with text: “compare sales over by period”, also RASA marks as the intent “sales_function”, which is wrong. It must identify as “compare_sales_over_period”.
How to deal with the 2 intents having similar kind of text?
Don’t have 2 intents with similar text
Essentially the bot looks at the words to decide what goes where, and if the data is the same, it rightfully doesn’t have any idea how to decide what goes where. Have you tried using entities for the sales_function? it would look something like this:
##intent:compare_sales
- compare [sales by period](sales_function)
- want to compare [sales by period](sales_function)
- I want to compare [sales by geography](sales_function)
- Can I look at [sales by product](sales_function)?
...
Etc. You can even use synonyms to map things like sales over period to the entity value sales by period.
This makes more sense, as the general intent is the same, and how it handles it will depend on the entity. I.e. in your stories, the compare_sales intent would lead to a custom action, in which you can pull the latest sales_function entity in order to decide what to compare over.