How to use Rasa for shopping on E-commerce store

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

@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.

@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)

@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?

@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.

@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 :stuck_out_tongue:

@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.

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

  1. rasa-demo/products.yml at main · RasaHQ/rasa-demo · GitHub
  2. rasa-demo/nlu.yml at main · RasaHQ/rasa-demo · GitHub

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

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

@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