Unable to work numeric data

I have two entities transaction & product

  1. transaction have pattern starting 4 digit is 1400 or 4280 and total of 12 digits
  2. product could any random number within 8 digits

when I trying to parse product it does not extract the correct details.


1 product code is 14005552 shows incorrect output as it has starting with 1400

2 product id is 43916357 shows correct output

  1. 14005552 shows correct output

I have also defined regex for then

screenshot is also attached

Training data file



  • \b^\d{8}$\b


  • \b^\d{12}$\b

Config file

language: en pipeline:

  • name: “SpacyNLP” model: “en_core_web_lg”
  • name: “SpacyTokenizer”
  • name: “SpacyFeaturizer”
  • name: “RegexFeaturizer”
  • name: “CRFEntityExtractor”
  • name: “CountVectorsFeaturizer”
  • name: “EntitySynonymMapper”
  • name: “EmbeddingIntentClassifier”
  • name: DucklingHTTPExtractor url: http://localhost:8000 dimensions:
  • email
  • phone-number
  • time
  • amount-of-money policies:
  • name: MemoizationPolicy
  • name: KerasPolicy
  • name: MappingPolicy


@akelad @Juste @juste_petr @JulianGerhard @GauravGaikwad94 @naoko

Are you calling a custom action to run this? You may extract the entity in your custom action then code a python logic on the format requirement of the serial number. You can put these entities into a single slot and parse it through your custom action to determine it’s relevance or function.