Use of lookup table

Hi I am new, and I do not fully understand what I am doing. I am trying to use the lookup table in order to extract the common names from a phrase. I created a lookup table

...
  "rasa_nlu_data": {
    "lookup_tables": [
        {
            "name": "people",
            "elements": "./data/names/list_of_familynames.txt"
        }
    ],
...

My config

language: "fr"

pipeline:
- name: "tokenizer_whitespace"
- name: "intent_featurizer_count_vectors"
- name: "intent_entity_featurizer_regex"
- name: "ner_crf"
  features: [
              ["low", "title", "upper"],
              ["bias", "low", "prefix5", "prefix2", "suffix5", "suffix3",
               "suffix2", "upper", "title", "digit", "pattern"],
              ["low", "title", "upper"]
            ]
- name: "intent_classifier_tensorflow_embedding"

The intent is found the entity not. What I am doing wrong?

How much example in your training example? If less then please check if itā€™s enough.

Thank you for the reply, I got around 1200 entry in the lookup file however, I discovered that I need to enter in lowercase and when I make a phrase the first letter in capital, probably because I declared like this in training phrases.

Yes, lookup tables only match phrases when an exact match is found

Hi, Do you know how to write lookup table in ā€œ.mdā€ file ?

hey @HarshitDaftary you can write the code for lookup table:

 ## lookup : location 
 data/location.txt

Hello RASA Team,

Can you please clarify how lookup table is used. For e.g. if I gave one below line, would RASA will use all ccode defined in the ccode.txt files as training set to create the model or it is just the one line below used for creating model? and how do I verify if look up table content was used to create model?

intent:package

  • Where is package for 1AP?

intent:ccode

data/lookup/ccode.txt

hey @susheelks you can get the sample code and examples here :

I am having trouble with lookup tables as well. I am using the python (3.6.5) API. My data.md file is attached.

My nlu_config.yml file contains the following configuration

language: "en"

pipeline:
- name: "tokenizer_whitespace"
- name: "intent_featurizer_count_vectors"
- name: "intent_entity_featurizer_regex"
- name: "ner_crf"
  features: [
              ["low", "title", "upper"],
              ["bias", "low", "prefix5", "prefix2", "suffix5", "suffix3",
               "suffix2", "upper", "title", "digit", "pattern"],
              ["low", "title", "upper"]
            ]
- name: "intent_classifier_tensorflow_embedding"

I have a data folder that contains the data.md file and the lookup table text file (newline separated) with 21 different locations. Iā€™ve included 8 of the 21 locations in the data.md file. Iā€™ve referenced the lookup table in the data.md file with the following lines:

## lookup : location 
data/location.txt

when I train the model with the following python code (after installing the packages):

training_data = load_data('data/data.md')
trainer = Trainer(config.load("nlu_config.yml"))
trainer.train(training_data)
model_directory = trainer.persist('projects/')

the resulting model does not pick up on any of the location entities that are in the lookup table. I also noticed there is no sign of any lookup table related files in the projects folder that is created when I train the model (not sure if this should be the case or not)

I seem to be out of ideas to make this work. Can anyone spot anything?

data.md (945 Bytes)

1 Like

I am facing issue with look up tables. It is not working. I have used story, domain, config files from github (rasa/examples/restaurantbot at master Ā· RasaHQ/rasa Ā· GitHub /) To add more locations(local) I have used lookup tables. These new locations are not identified as locations. Whenever I launch bot I get warning , saying that " Is that the reason why it is not working? C:\Anaconda3\Lib\runpy.py:125: RuntimeWarning: ā€˜rasa_core.runā€™ found in sys.modules after import of package ā€˜rasa_coreā€™, but prior to execution of ā€˜rasa_core.runā€™; this may result in unpredictable behaviour" My versions as below: rasa-core==0.14.5 rasa-core-sdk==0.14.0 rasa-nlu==0.15.1 spacy==2.1.8 pandas==0.24.2 sklearn-crfsuite==0.3.6 python 3.5.4

Hi @JiteshGaikwad and @kothiyayogesh, Iā€™m pretty new to rasa. I have gone through this tutorial here - https://youtu.be/xu6D_vLP5vY and the code from Weatherbot_Tutorial/Full Code at master Ā· JustinaPetr/Weatherbot_Tutorial Ā· GitHub then i tried to modify liitle bit with lookup table (upgraded the rasa nlu package as the code is using a older version of rasa nlu )and i get errors. Is there any code example which uses the lookup table in similar, which would be very helpful

Hey @saran, Check out the rasa-demo botā€™s lookup table usage:

https://github.com/RasaHQ/rasa-demo/tree/master/data/nlu/lookups