Hi,
I am little confused with providing the entities in .txt in lookup file.
What should be the format of the .txt file
[‘Rakesh’, ‘Micheal’,‘Stan’,‘Rita’]
Rakesh
Micheal
Stan
Rita
I have tried three approches none of them are succesfull in extracting entities rather than example entity provided in nlu.md file.
If I ma doing anything wrong please specify.
@JiteshGaikwad Thank you.
I have tried that, But still it is not getting recognised.
How to provide in NLU.md file
like:
intent: greet
Hi, I am [Rakesh] (name)
lookup: name
./names.txt
so when I type
Hi, I am santhosh.
santhosh should be entity right.
but not recognising santhosh as entity even if it is in names.txt file
I have also tried names.txt instead of ./names.txt which basically I shouldnot But tried.
@JiteshGaikwad
Thanks Buddy, Its working for the list provided, but not from every name in .txt. I think I need to provide more examples entities to do that. Thanks a lot for the help.
try adding more examples from your .txt file to your nlu data. Sometimes it needs more examples to pick that table. I used ner_spacy for this purpose, it tends to serve me well.
Sorry for late reply. I don’t know an exact amount as it depends on how much examples you have in table. I had a table of 50-60 names and I added 8-9 examples in my nlu data and it worked fine.
For ner_spacy, you add it in your pipeline and It works very well with certain entities but I personally like duckling because of it’s date filter.
Hi sorry to interrupt the thread. I am having issues with providing lookup tables in .txt format. I tried the code as advised by @ChikkaUdayaSai but I get this error.
You no longer need to point to the file in nlu.yml, instead you can include the files in the same folder that your nlu.yml file is in (default is data), and rasa will search the subdirectories in data recursively.
Your nlu.ymlshould contain some examples that include the lookup table items. You don’t have to include every single lookup table item, just a few of them. You also do not have to mention fruits.yml or the lookup table in the nlu.yml file. Including it in the data directory is enough.
nlu.yml:
version: "2.0"
nlu:
- intent: ask_for_fruit
examples: |
- I'd like to buy some [apples](fruits)
- Can I purchase some [pears](fruits)?
Finally, your directory structure should look like this: