# Use of lookup table

**URL:** <https://forum.rasa.com/t/use-of-lookup-table/1679>\
**Category:** Getting Started with Rasa\
**Created:** [October 6, 2018, 6:06pm UTC](https://forum.rasa.com/t/use-of-lookup-table/1679 "2018-10-06T18:06:41Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neofita](https://avatars.discourse-cdn.com/v4/letter/n/898d66/32.png) [@Neofita](https://forum.rasa.com/u/Neofita)\
**Post date:** [October 6, 2018, 6:06pm UTC](https://forum.rasa.com/t/use-of-lookup-table/1679/1 "2018-10-06T18:06:41Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![kothiyayogesh](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/kothiyayogesh/32/324_2.png) [@kothiyayogesh](https://forum.rasa.com/u/kothiyayogesh)\
**Post date:** [October 8, 2018, 4:02pm UTC](https://forum.rasa.com/t/use-of-lookup-table/1679/2 "2018-10-08T16:02:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Neofita](https://avatars.discourse-cdn.com/v4/letter/n/898d66/32.png) [@Neofita](https://forum.rasa.com/u/Neofita)\
**Post date:** [October 8, 2018, 4:16pm UTC](https://forum.rasa.com/t/use-of-lookup-table/1679/3 "2018-10-08T16:16:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kothiyayogesh](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/kothiyayogesh/32/324_2.png) [@kothiyayogesh](https://forum.rasa.com/u/kothiyayogesh)\
**Post date:** [October 8, 2018, 4:29pm UTC](https://forum.rasa.com/t/use-of-lookup-table/1679/4 "2018-10-08T16:29:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![HarshitDaftary](https://avatars.discourse-cdn.com/v4/letter/h/958977/32.png) [@HarshitDaftary](https://forum.rasa.com/u/HarshitDaftary)\
**Post date:** [October 27, 2018, 3:08pm UTC](https://forum.rasa.com/t/use-of-lookup-table/1679/5 "2018-10-27T15:08:26Z")

</div>

Hi, Do you know how to write lookup table in “.md” file ?

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [December 8, 2018, 8:12am UTC](https://forum.rasa.com/t/use-of-lookup-table/1679/6 "2018-12-08T08:12:14Z")

</div>

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

```
 ## lookup : location 
 data/location.txt
```

---

<div class="post-metadata">

**Author:** ![susheelks](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@susheelks](https://forum.rasa.com/u/susheelks)\
**Post date:** [December 18, 2018, 6:30pm UTC](https://forum.rasa.com/t/use-of-lookup-table/1679/7 "2018-12-18T18:30:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [December 19, 2018, 1:40am UTC](https://forum.rasa.com/t/use-of-lookup-table/1679/8 "2018-12-19T01:40:08Z")

</div>

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

> <https://github.com/RasaHQ/rasa_lookup_demo/blob/master/data/food/food_train_lookup.md>

---

<div class="post-metadata">

**Author:** ![mscott12](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@mscott12](https://forum.rasa.com/u/mscott12)\
**Post date:** [December 20, 2018, 2:57am UTC](https://forum.rasa.com/t/use-of-lookup-table/1679/9 "2018-12-20T02:57:47Z")

</div>

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](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/2/2a238b54bb9dbb29f495fd7cb0efe02589315f33.md) (945 Bytes)

---

<div class="post-metadata">

**Author:** ![Vageshwari](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/vageshwari/32/5338_2.png) [@Vageshwari](https://forum.rasa.com/u/Vageshwari)\
**Post date:** [September 17, 2019, 9:34am UTC](https://forum.rasa.com/t/use-of-lookup-table/1679/10 "2019-09-17T09:34:22Z")

</div>

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](https://github.com/RasaHQ/rasa/tree/master/examples/restaurantbot) /) 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

---

<div class="post-metadata">

**Author:** ![saran](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@saran](https://forum.rasa.com/u/saran)\
**Post date:** [February 26, 2020, 5:13pm UTC](https://forum.rasa.com/t/use-of-lookup-table/1679/11 "2020-02-26T17:13:09Z")

</div>

Hi @JiteshGaikwad and @kothiyayogesh, I’m pretty new to rasa. I have gone through this tutorial here - [https://youtu.be/xu6D\_vLP5vY](https://youtu.be/xu6D_vLP5vY) and the code from [Weatherbot\_Tutorial/Full Code at master · JustinaPetr/Weatherbot\_Tutorial · GitHub](https://github.com/JustinaPetr/Weatherbot_Tutorial/tree/master/Full%20Code) 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

---

<div class="post-metadata">

**Author:** ![JiteshGaikwad](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@JiteshGaikwad](https://forum.rasa.com/u/JiteshGaikwad)\
**Post date:** [February 27, 2020, 4:18am UTC](https://forum.rasa.com/t/use-of-lookup-table/1679/12 "2020-02-27T04:18:05Z")

</div>

Hey @saran, Check out the `rasa-demo` bot’s lookup table usage:

> [https://github.com/RasaHQ/rasa-demo/tree/master/data/nlu/lookups](https://github.com/RasaHQ/rasa-demo/tree/master/data/nlu/lookups)
