Regular expressions not working with Rasa with entities


(LIJO M MANICKATHAN JOHN) #1

regex:nbareg

  • [0-9]{5}

intent:Qualification Failed

When I run this with NPANXX invalid 123456m I get below with no entities.

{ “intent”: { “name”: “Qualification Failed”, “confidence”: 0.939350962638855 }, “entities”: [], ’ I need to get an entity of failedreason with a value of 123456

I tried with

intent:Qualification Failed

  • NPANXX invalid 908978, but I get no entities. It always goes with exact match.

Please help.


(Srikar) #2

Include a few more examples in the nlu data. I had to add 4~5 examples, then the regex started working. Also, you have 6 digits in your training example but you’ve mentioned [0-9]{5}. And your second syntax is correct way of defining not the first.


(LIJO M MANICKATHAN JOHN) #3

Thanks,

I removed the reg exp and I did like below as you said.

and it worked for me. There was no need of the regular expresssion. failedreason is not an entity which is tied up with regular expression.


(LIJO M MANICKATHAN JOHN) #4

If we give the below.

regex:regexp

  • [0-9]{6}

intent:Qualification Failed

If I give a n input of NPANXX invalid 1234907865, then I should not get any entities. But, it gives me the entities. “entities”: [ { “start”: 15, “end”: 25, “value”: “1234907865”, “entity”: “regexp”, “confidence”: 0.5930968739654005, “extractor”: “ner_crf” } ], which is wrong.


(Libindavis) #5

Hi, I am having a trouble with using regex feature. How is your configuration of pipeline? Would you mind to share here?