I'm trying to use Rasa to detect entities such as phone numbers or contract ID. It seems natural to use regular expressions to define precisely those entities, and Rasa does have something called "Regular Expression Features" which allows us to define regular expressions.
Except I don't understand how to use them. In the Rasa-NLU tutorial, there are regexes (like "zipcode"
), but I don't see how they are linked to entities ("location"
).
Does anyone have a clue about how regexes work with Rasa ?
The regexes you define are not linked to any entity or intent explicitly. What a regex does is add a new feature to your input, e.g. an extra vector element which can be 1 or 0 depending on whether the regex matched. When you train, the model now has this extra information about each of your examples, and can choose itself when to pay attention to it.