rasa-nlurasanlu

How to extract product name from statement using RASA?


I am beginner in RASA. I want to extract the product name as entity from a statement like "Add X to cart", "Select X" or "Put X in cart". My bot is identifying the intent correctly but is unable to extract the entity. It is only able to pick entities very close to what I put in examples. What I want is to detect anything that is put in the statement as an entity. How can I do this?

I tried regex example like [A-Za-z0-9]+ but it didn't work.


Solution

  • Did you configure a RegexEntityExtractor in your pipeline? You'll likely want to add something like this to your config.yml file.

      - name: RegexEntityExtractor
        case_sensitive: False
        use_lookup_tables: True
        use_regexes: True
    

    The regexes should be available in a lookup table. This is part of your nlu.yml file. Here's the example from the docs:

    nlu:
    - lookup: country
      examples: |
        - Afghanistan
        - Albania
        - ...
        - Zambia
        - Zimbabwe
    

    You should be able to add regexes here.