# Lookup Table or Multiple Examples?

**URL:** <https://forum.rasa.com/t/lookup-table-or-multiple-examples/1896>\
**Category:** Rasa Open Source\
**Created:** [October 15, 2018, 6:01pm UTC](https://forum.rasa.com/t/lookup-table-or-multiple-examples/1896 "2018-10-15T18:01:38Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![dev-yesapps](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@dev-yesapps](https://forum.rasa.com/u/dev-yesapps)\
**Post date:** [October 15, 2018, 6:01pm UTC](https://forum.rasa.com/t/lookup-table-or-multiple-examples/1896/1 "2018-10-15T18:01:38Z")

</div>

I am facing a problem with entity extraction for a entity “Company\_Name”.

One variant of example : what are the current assets for Alpha Steels company.

Alpha Steels is a company name. there would be a hundred company names in my list.

shall i add examples for all the companies or lookup would help me out to solve this issue? and Do i need to add any options to the ner\_crf pipeline.

I just wanted to know before implementing lookup.

---

<div class="post-metadata">

**Author:** ![akelad](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/akelad/32/69_2.png) [@akelad](https://forum.rasa.com/u/akelad)\
**Post date:** [October 17, 2018, 9:17am UTC](https://forum.rasa.com/t/lookup-table-or-multiple-examples/1896/2 "2018-10-17T09:17:47Z")

</div>

this depends, do you really have a fixed list of possible companies? Or is it any company in the world? If it’s a fixed list, then a lookup table could work. You still need to provide some examples of sentences with these entities in them though. Otherwise without the lookup table you can provide a bunch of training examples and eventually the `ner_crf` will learn to generalise

---

<div class="post-metadata">

**Author:** ![kishanbajaj](https://avatars.discourse-cdn.com/v4/letter/k/a6a055/32.png) [@kishanbajaj](https://forum.rasa.com/u/kishanbajaj)\
**Post date:** [October 23, 2018, 5:45am UTC](https://forum.rasa.com/t/lookup-table-or-multiple-examples/1896/3 "2018-10-23T05:45:20Z")

</div>

Suppose I have fixed list of 1000 companies. Do I have to use each one of them in the training example? If yes, then what purpose really is the lookup table feature serving?

For my use case I have only 1 intent and 18 entities. 12 entities out of all have \>500 “fixed” list of values. I have more than 500 patterns of input statement. I am using Chatito to generate the training data and if I use all the values of all the entities, the training set will be humongous and so will the training time. I was really expecting lookup feature would solve this problem but it doesn’t seem to.

Could you please tell if the lookup feature requires something else along with it which I might be missing?

---

<div class="post-metadata">

**Author:** ![dev-yesapps](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@dev-yesapps](https://forum.rasa.com/u/dev-yesapps)\
**Post date:** [October 25, 2018, 4:52am UTC](https://forum.rasa.com/t/lookup-table-or-multiple-examples/1896/4 "2018-10-25T04:52:15Z")

</div>

Hi @akelad as @kishanbajaj was asking… do i have to create examples for all the list of companies? If so how the lookup table helps? please answer to the @kishanbajaj question in the comment.

---

<div class="post-metadata">

**Author:** ![akelad](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/akelad/32/69_2.png) [@akelad](https://forum.rasa.com/u/akelad)\
**Post date:** [October 25, 2018, 9:13am UTC](https://forum.rasa.com/t/lookup-table-or-multiple-examples/1896/5 "2018-10-25T09:13:39Z")

</div>

Nope, you don’t have to use **each** one in your trainin examples, just a few of them. The lookup table will then do that rest. The CRF just needs to learn the pattern of when to extract these entities

---

<div class="post-metadata">

**Author:** ![dev-yesapps](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@dev-yesapps](https://forum.rasa.com/u/dev-yesapps)\
**Post date:** [October 25, 2018, 1:40pm UTC](https://forum.rasa.com/t/lookup-table-or-multiple-examples/1896/6 "2018-10-25T13:40:19Z")

</div>

Thankyou for the information… 🙂

---

<div class="post-metadata">

**Author:** ![kishanbajaj](https://avatars.discourse-cdn.com/v4/letter/k/a6a055/32.png) [@kishanbajaj](https://forum.rasa.com/u/kishanbajaj)\
**Post date:** [October 26, 2018, 2:38pm UTC](https://forum.rasa.com/t/lookup-table-or-multiple-examples/1896/7 "2018-10-26T14:38:17Z")

</div>

Could you please elaborate on **few**? Because it does not seem to work.

I tried with:

100+ patterns, 6 entities and ~100,000 training statements

1 entity had total 5 fixed values and I used 2 in training. Another entity had 9 fixed values and I used 5 in training. For both the entities, RASA could not predict the remaining values which were present along with the trained values in the respective lookup tables.

Has anybody had success with the lookup tables? I would really like to know as it seems one awesome feature but I am having a hard time getting it to give results.

---

<div class="post-metadata">

**Author:** ![akelad](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/akelad/32/69_2.png) [@akelad](https://forum.rasa.com/u/akelad)\
**Post date:** [October 31, 2018, 9:10am UTC](https://forum.rasa.com/t/lookup-table-or-multiple-examples/1896/8 "2018-10-31T09:10:35Z")

</div>

well, 100,000 seems like it’s far too much. your model is probably overfitting to those values now

---

<div class="post-metadata">

**Author:** ![feucht](https://avatars.discourse-cdn.com/v4/letter/f/9d8465/32.png) [@feucht](https://forum.rasa.com/u/feucht)\
**Post date:** [November 2, 2018, 11:02am UTC](https://forum.rasa.com/t/lookup-table-or-multiple-examples/1896/9 "2018-11-02T11:02:33Z")

</div>

I’m seeing much the same thing. I have generated about 100 training examples using 5 different values for my entity, then (as a test) I have specified 3 of the 5 and 1 other new value as lookup values. I see matches on the values in the training data, but not for the new value in the lookup list.

---

<div class="post-metadata">

**Author:** ![akelad](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/akelad/32/69_2.png) [@akelad](https://forum.rasa.com/u/akelad)\
**Post date:** [November 2, 2018, 2:53pm UTC](https://forum.rasa.com/t/lookup-table-or-multiple-examples/1896/10 "2018-11-02T14:53:33Z")

</div>

what does your pipeline look like?

---

<div class="post-metadata">

**Author:** ![feucht](https://avatars.discourse-cdn.com/v4/letter/f/9d8465/32.png) [@feucht](https://forum.rasa.com/u/feucht)\
**Post date:** [November 3, 2018, 11:52am UTC](https://forum.rasa.com/t/lookup-table-or-multiple-examples/1896/11 "2018-11-03T11:52:56Z")

</div>

Thanks for the reply Akela, I have managed to solve this by changing my training data to have a wider selection of entity value examples so there are many fewer duplicates. It was overtraining on the examples I had given, but now picks out place names (in this case) by context rather than by matching to a list. On reflection, I think it makes more sense to work this way and then match them to my list in an action to better handle typos, ambiguities etc

---

<div class="post-metadata">

**Author:** ![lgrinberg](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/lgrinberg/32/1659_2.png) [@lgrinberg](https://forum.rasa.com/u/lgrinberg)\
**Post date:** [February 6, 2019, 9:25pm UTC](https://forum.rasa.com/t/lookup-table-or-multiple-examples/1896/12 "2019-02-06T21:25:55Z")

</div>

You can try this for names [Providing conversation context to the NLU using microervices](http://forum.rasa.com/t/providing-conversation-context-to-the-nlu-using-microervices/4972)

Together with a lookup table it worked very well for us in getting first names and last names.

---

<div class="post-metadata">

**Author:** ![prashant123](https://avatars.discourse-cdn.com/v4/letter/p/46a35a/32.png) [@prashant123](https://forum.rasa.com/u/prashant123)\
**Post date:** [December 18, 2023, 1:17pm UTC](https://forum.rasa.com/t/lookup-table-or-multiple-examples/1896/13 "2023-12-18T13:17:03Z")

</div>

if the company list is not fix then what should i do?
