Rasa regex

Hi, i was wondering is there any way we can map regex alone for some Entity recoganization in my training data ?

for example i know one entity A is only 5 or 6 digit number but i dont know entity B’s regex or which can’t be easily converted into regex ?

is there any priority while using NER ? like diet classifier> synonyms> regex ?

Entities A and B are completely independent. You can use Regex for A but not for B.

this is my configuration file

- name: WhitespaceTokenizer

   - name: RegexFeaturizer

   - name: RegexEntityExtractor

   - name: LexicalSyntacticFeaturizer

   - name: CountVectorsFeaturizer

   - name: CountVectorsFeaturizer

     analyzer: char_wb

     min_ngram: 2

     max_ngram: 4

   - name: DIETClassifier

     epochs: 70

   - name: EntitySynonymMapper

   - name: ResponseSelector

     epochs: 100

how i can use regex for one entity and another not here ? because while classifying both Diet classifier as well as RegexEntityExtractor trigger simultaneously.

You don’t need to worry about that… Just use Regex for entity A and treat entity B as normal.

1 Like

@ChrisRahme how many samples i need to use for entity A in nlu.yml if it is purely based on regex? some entity i am getting regex entity recognition as well as diet entity recognition also . that is leading filling both of my slots value simultaneously.

You just need to give at least 2 examples of the entity, as per the docs :slight_smile:

[…] you do need at least two annotated examples of the entity so that the NLU model can register it as an entity at training time.