Problems with numeric input and regex entities

Hello all, I am having a hard time getting numeric input to resolve to the proper intent.

I have a regex entity and intent for a strictly five-digit ‘zipcode’, and I have a separate intent for a single-digit ‘1’ (with or without a corresponding regex entity). (see code below)

Rasa resolves any digit to intent inform_zipcode, even a single digit which does not get tagged with the zipcode entity.

I thought perhaps DIETClassifier’s entity extraction was confusing things, but when I run with entity_recognition: false then rasa shell nlu STILL classifies any number as an inform_zipcode.

Any help appreciated. Below are the changes to a clean rasa init (also added RegexEntityExtractor or config.yml.

- regex: zipcode
  examples: |
    - ^\d{5}$
    - ^((zero|oh|o|one|two|three|four|five|six|seven|eight|nine)\b ?){5}$

- regex: digit
  examples: |
    - ^\d{1}$

- intent: inform_zipcode
  examples: |
    - [08023](zipcode)
    - [11122](zipcode)
    - [98324](zipcode)
    - [90301](zipcode)
    - [23567](zipcode)
    - [87123](zipcode)
    - [08029](zipcode)
    - [41404](zipcode)
    - My zipcode is [91801](zipcode).
    - [08044](zipcode) is my zip
    - My zip code is [08022](zipcode).
    - my zip is [91030](zipcode).

- intent: one
  examples: |
    - [1](digit)
    - one

@braddock

A couple of points to try -

  1. To correctly identify digits from word utterances, edit the digit regex to
- regex: digit
  examples: |
    - ^\d{1}$
    - ^(zero|oh|o|one|two|three|four|five|six|seven|eight|nine){1}$
  1. Provide more annotated training data for intent “one”, lets call it inform_digit
- intent: inform_digit
  examples: |
    - [1](digit)
    - [2](digit)
    - [3](digit)
    - [4](digit)
    - [5](digit)
    - [6](digit)
    - [7](digit)
    - [8](digit)
    - [9](digit)
    - [0](digit)
    - [zero](digit)
    - [one](digit)
    - [two](digit)
    - [three](digit)
    - [four](digit)
    - [five](digit)
    - [six](digit)
    - [seven](digit)
    - [eight](digit)
    - [nine](digit)
1 Like

Thanks for the reply. The problem with what you propose is that I need to identify individual digits (0, 1, etc) as intents (“one”, “two”) because I have slots that depend on a subset of digits as intents (press 1 for yes, 0 for no legacy system).

That said, I think I am going to bypass this issue by taking a different approach.

Thanks for your help.