Unable to extract Entity with spaces

Hello, I have an entity such as [block1] but if query is “Block 1” only [block] is extracted from it instead of [block1]. I have created a lookup table and synonyms for 4 blocks.

NLU DATA:

  • intent: location_query examples: |

  • lookup: location examples: |

    • block1
    • block2
    • block3
    • block4
  • synonym: block1 examples: |

    • block 1
    • block one
    • first block
  • synonym: block2 examples: |

    • block 2
    • block two
    • second block
  • synonym: block3 examples: |

    • block 3
    • block three
    • third block
  • synonym: block4 examples: |

    • block 4
    • block four
    • fourth block

PIPELINE:

recipe: default.v1

assistant_id: 20240111-153320-prompt-accelerometer

language: en

pipeline:

  • name: WhitespaceTokenizer
  • name: RegexFeaturizer
  • name: LexicalSyntacticFeaturizer
  • name: CountVectorsFeaturizer analyzer: char_wb min_ngram: 1 max_ngram: 4
  • name: DIETClassifier epochs: 100 constrain_similarities: true
  • name: EntitySynonymMapper use_lookup_tables: true
  • name: ResponseSelector epochs: 100 constrain_similarities: true
  • name: FallbackClassifier threshold: 0.3 ambiguity_threshold: 0.1

policies: null

EXAMPLE: Query: Where is block1? Extracted Entity: block1

Query: Where is block 1? Extracted Entity: block

How can I fix this?

There’s an important note about this in the synonyms docs page. Include examples with spaces in the intent examples. Synonyms are intented to clean-up/standardize the entity after it has been extracted.

PROVIDE TRAINING EXAMPLES

Synonym mapping only happens after entities have been extracted. That means that your training examples should include the synonym examples