Regex Name Extraction from custom Action

Hi All After going through the discussion on CRF and Regex, Regex to entity, Rasa Regex string, posting this. My requirement is that after a Regex is matched and an intent is chosen, I mapped a custom action to it in the stories and domain. It is getting invoked. I need a reference to the regex pattern name that got matched to do some manipulation. Below are details.




  • purse


  • wallet
  • dock

In custom action: How to get the value acc1 or acc2.

Could anyone throw some light on this!

Not sure what your question is? You can’t access the regex pattern from a custom action

Hi Akela

My requirement is that the user is to type either of the sentence forms as mentioned in the intent. But instead of “account”, user may type various forms that could be mentioned in regex. I agree that. Now, I need to do manipulation such that if some specific set of regex strings got match i need to know the regex pattern name. based on that, i do some logic.

Otherwise, is there a way to label an entity with different names, like below:


  • What is in my [account] (acc1) (acc2)
  • My balance in [account] (acc1) (acc2)

So that i could slot them and write condition based on slot set.

Note: I m using RASA as intellect of my Chatbot. I need RASA to respond a token (preferably intent or regex name) to my Chatbot based on input. It will choose the user response accordingly u Thanks in advance

I’m not sure why you would want to tag this entity as two different things?

I think you should just have two different entities if you want to do different things with them. Using the regex definitions in your custom action isn’t an option

Why not just extract the value as single entity and then classify that in a custom action?

Its a overhead when scaling is to be done. How much condition that you can write? Then purpose of NLU vanishes

There’s exactly as much performance overhead if not less if you classify in the custom action. All you need to do is a lookup. NLU will be costlier since it has to predict the classification.