Rasa 2 Lookup Table file syntax

Ah gotcha! I did not realize that I should also remove the line -lookup: xxx. The warning message is gone, cheers XD

1 Like

Glad to hear it! :slight_smile:

@fkoerner you are saying, I don’t have to mention my lookups folder and file in the nlu.yml file?

I did as you mentioned above, I also add some examples in the nlu file. but still, I am not sure it is looking in my lookups/product.yml. sometimes it is recognizing sometimes it doesn’t. You know, how can I verify that it is looking in lookup files?

Thank you!

@tanyraj

sometimes it is recognizing sometimes it doesn’t

Just to check:

  • Do you have RegexEntityExtractor in your pipeline?
  • Do you have at least 2 labeled examples per entity type in your nlu file?
  • Is the lookups/product.yml file in your data folder (default is data, otherwise you can specify a different folder with --data parameter)

ok. got your point.

Answering your questions:

  • Yes, RegexEntityExtrator is in my pipeline.
  • I am a little confused about your 2nd question. In my lookups/product.yml file, there is around 15000 different product fall under product entity. so you are saying I have to give, for all 15000 products only two examples in my nlu file?
  • Yes, lookups/product.yml is in my data folder.

@fkoerner Thank you for your response!

@tanayraj You’re welcome! For the second question, you will need to have examples in your nlu file for the product entity. You will need to have at least two examples in your nlu file that use this entity, for example:

 - intent: purchase_product
   examples: |
        - I want to buy a [phone](product)
        - Could I purchase a [laptop](product)

Does that help?

Hi Fkoerner, Hope you could help us here .!

My lookup file string contains some special characters like.

  • PV7…C/D/N/W
  • DS2513…ATEX

But I wanted to extract that entity when a user enters .! So basically whatever I add in my lookup file should be treated as a normal string irrespective of any special char.! is there any way to handle it easily like if I wrap it in single quotes rasa treats it as string?

MFG, Suryakiran

Hi @suryakiran sorry, not quite sure what you’re getting at here! Do you mean you want it to be recognized even if the user types: PV!? What’s the behaviour you’re currently seeing?

how to use in RASA 3.0

  • lookup: country

    files: |

    • data/lookups/country.yml

THROWS ERROR

YamlValidationException: Failed to validate ‘data\nlu.yml’. Please make sure the file is correct and all mandatory parameters are specified. Here are the errors found during validation: in data\nlu.yml:99: Key ‘lookup’ was not defined. Path: ‘/nlu/8’ in data\nlu.yml:99: Key ‘files’ was not defined. Path: ‘/nlu/8’

country.yml (339 Bytes) nlu.yml (1.7 KB)

how to use look up txt file in rasa 3.1.

  • intent: my_Nation

    examples: |

  • lookup: country

    • country.txt getting error, remove the black bullet