# How to use Rasa for shopping on E-commerce store

**URL:** <https://forum.rasa.com/t/how-to-use-rasa-for-shopping-on-e-commerce-store/45471>\
**Category:** Rasa Open Source\
**Created:** [July 7, 2021, 12:20pm UTC](https://forum.rasa.com/t/how-to-use-rasa-for-shopping-on-e-commerce-store/45471 "2021-07-07T12:20:17Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![segre\_dominic](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@segre\_dominic](https://forum.rasa.com/u/segre_dominic)\
**Post date:** [July 7, 2021, 12:20pm UTC](https://forum.rasa.com/t/how-to-use-rasa-for-shopping-on-e-commerce-store/45471/1 "2021-07-07T12:20:17Z")

</div>

Hello,

Please I’m very new to Rasa, infact I only just recently finished watching the masterclass and some tutorials online. Now, I have started building a chatbot which I want to return the “url” of different products category users are interested in. I noticed this is possible if I only include every single product category I think users may want to buy e.g say we have only 3 products then we can add the conversations for these 3 products in the nlu.md and assign an entity to them (for instance “product” entity). so the nlu.md looks like:

```
- intent: buy_product
  examples: |
      - i want to order [hand bag](product)
      - want to order [cloth](product)
      - want to order [laptop](product)
      - get me a [laptop](product)
      - need to buy [hand bag](product) please
      - want to purchase me [cloth](product) pls

```

However, I need help to understand how we can use this for a case where we have around 500 product categories. Is this possible with rasa, because it will be almost impossible to write all conversations for 500 products category in the nlu.md. What if the categories increase to 1000 or 2000?

I had a look at the one of rasa features called “lookup table” but it seems it can’t work for this case.

I would be glad to receive your response.

Thank you,

Kind regards

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [July 7, 2021, 12:39pm UTC](https://forum.rasa.com/t/how-to-use-rasa-for-shopping-on-e-commerce-store/45471/2 "2021-07-07T12:39:19Z")

</div>

@segre_dominic Hello! One question if you can reply.

For your scenario such as:

Bot: Help, how can I help you in shopping today!

User: I am looking for an laptop

Bot: Bot will display some URL , which will direct to your website page under laptop?

same with other products? Right

Thanks.

---

<div class="post-metadata">

**Author:** ![segre\_dominic](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@segre\_dominic](https://forum.rasa.com/u/segre_dominic)\
**Post date:** [July 7, 2021, 12:54pm UTC](https://forum.rasa.com/t/how-to-use-rasa-for-shopping-on-e-commerce-store/45471/3 "2021-07-07T12:54:28Z")

</div>

@nik202 Thank you for the quick response.

Yes, I’m interested in this kind of scenario, for large category of products (e.g more than 500 categories)

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [July 7, 2021, 1:18pm UTC](https://forum.rasa.com/t/how-to-use-rasa-for-shopping-on-e-commerce-store/45471/4 "2021-07-07T13:18:15Z")

</div>

@segre_dominic Means you have sets of questions and corresponding URL links( which you want to display to there user) Right?

One question one url?

---

<div class="post-metadata">

**Author:** ![segre\_dominic](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@segre\_dominic](https://forum.rasa.com/u/segre_dominic)\
**Post date:** [July 7, 2021, 1:40pm UTC](https://forum.rasa.com/t/how-to-use-rasa-for-shopping-on-e-commerce-store/45471/5 "2021-07-07T13:40:55Z")

</div>

@nik202 Not really, the url are in a DB table “shop” which contains fields: “product\_id, product\_name, product\_category, url”. So i was thinking if i can dynamically get the category of a product i can run a query on the DB and fetch the url to display to user. This will be placed in a CustomAction.

Bot: Help, how can I help you in shopping today!

User: I am looking for an “laptop” \<— this should allow users pass any product

It’s because the product categories (\> 500) is too much so I can’t write all conversations in nlu.md.

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [July 7, 2021, 2:12pm UTC](https://forum.rasa.com/t/how-to-use-rasa-for-shopping-on-e-commerce-store/45471/6 "2021-07-07T14:12:29Z")

</div>

@segre_dominic Perfect, Make sure, all the product should have same fields with values, else DB will not give you response as expected.

@segre_dominic

User: Looking for an laptop? \<\<==== are you planning to ask about product\_name (brand) in next message such as

Bot: Which brand you are looking at? \<\<= make sure you have proper dialogue management for such type of scenarios?

User: Mac Book Pro (product\_ name) and the corresponding list of options with full spec or URLs link.

Construct your KB based on the above mention facts. If you need any suggestions, please mention me.

**PS:** now nlu.md is grown as adult to nlu.yml 😛

---

<div class="post-metadata">

**Author:** ![segre\_dominic](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@segre\_dominic](https://forum.rasa.com/u/segre_dominic)\
**Post date:** [July 7, 2021, 2:33pm UTC](https://forum.rasa.com/t/how-to-use-rasa-for-shopping-on-e-commerce-store/45471/7 "2021-07-07T14:33:51Z")

</div>

@nik202 this suggestion is quite explanatory. so i have to break it down into some flow of conversation. from product, to brand and url

regarding this:

User: Looking for an laptop?

i’m just wondering if i have those many product names (more than 500 names) how will the nlu.yml look like. I’m not sure i should write 500+ plus conversations under the intent in nlu.yml

Thank you for informing about nlu.yml. I’m just noticing now.

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [July 7, 2021, 2:54pm UTC](https://forum.rasa.com/t/how-to-use-rasa-for-shopping-on-e-commerce-store/45471/8 "2021-07-07T14:54:21Z")

</div>

@segre_dominic Hope this will help see how they have used the products

1. [rasa-demo/products.yml at main · RasaHQ/rasa-demo · GitHub](https://github.com/RasaHQ/rasa-demo/blob/main/data/nlu/lookups/products.yml)
2. [rasa-demo/nlu.yml at main · RasaHQ/rasa-demo · GitHub](https://github.com/RasaHQ/rasa-demo/blob/main/data/nlu/nlu.yml)

PS: You can even fetch the data from the excel/csv file to

If you have already seen it, then it’s ok.

---

<div class="post-metadata">

**Author:** ![segre\_dominic](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@segre\_dominic](https://forum.rasa.com/u/segre_dominic)\
**Post date:** [July 7, 2021, 3:38pm UTC](https://forum.rasa.com/t/how-to-use-rasa-for-shopping-on-e-commerce-store/45471/9 "2021-07-07T15:38:20Z")

</div>

@nik202 Thank you very much for your response. It has being of great help. I also found a link to using custom SpaCy model with Rasa. I think this will work for my scenario. I will train the model with all categories of products and use this model in Rasa config.yml

> **[Using Custom spaCy components](https://blog.rasa.com/custom-spacy-components/)**
>
> In this guide we're going to show you how you can get a custom spaCy model working inside of Rasa on your local machine.

---

<div class="post-metadata">

**Author:** ![anitatukci](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/anitatukci/32/17135_2.png) [@anitatukci](https://forum.rasa.com/u/anitatukci)\
**Post date:** [October 1, 2021, 12:31pm UTC](https://forum.rasa.com/t/how-to-use-rasa-for-shopping-on-e-commerce-store/45471/10 "2021-10-01T12:31:48Z")

</div>

That’s really helpful!

---

<div class="post-metadata">

**Author:** ![JasonMay](https://avatars.discourse-cdn.com/v4/letter/j/7993a0/32.png) [@JasonMay](https://forum.rasa.com/u/JasonMay)\
**Post date:** [January 23, 2022, 9:03am UTC](https://forum.rasa.com/t/how-to-use-rasa-for-shopping-on-e-commerce-store/45471/11 "2022-01-23T09:03:53Z")

</div>

Why do you have to suffer so much if there are already ready-made cases for such cases? It seems that this is just a waste of time, whereas, on the Internet, there are both paid and free templates for your site, including chatbots and everything you will need to work. I can advise you to use [out of the sandbox coupons](https://www.gomontana.com/store/out-of-the-sandbox-coupons/) and make your life easier. Now there are just a lot of discounts on their services since it was recently the new year and it is always the season of significant discounts and sales. Write to me if you have any questions; I would be happy to talk to you on this topic and explain my position
