A few questions from a newbie at Rasa

Hello everyone, I`m new in Rasa and I have little question list.

  1. How much examples per intent recommended? In my case, I have categories that have 370 examples, but at the same time there are categories that have only 2. Is it correct to do this? Should the number of examples be roughly the same for good results?

  2. I have a trained model and I make some adjustments to it. How to properly train it further, because now I just start training the model again and it takes quite a long time.

  3. I have troubles with buttons. domain.yml

utter_buttons:
  - text: "КнопаЧки!"
  - buttons:
    - payload: /button_1
      title: ΠŸΠΎΠΊΠ°Π·Π°Ρ‚ΡŒ ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΡƒ ΠΊΠΎΡ‚ΠΈΠΊΠ°
    - payload: /button_2
      title: ΠšΠ½ΠΎΠΏΠΎΡ‡ΠΊΠ° 2
    text: НаТми Π½Π° ΠΊΠ½ΠΎΠΏΠΊΡƒ
  utter_cat:
  - image: https://klike.net/uploads/posts/2019-07/1564314090_3.jpg
    text: ΠšΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° ΠΊΠΎΡ‚ΠΈΠΊΠ°
  utter_button_2:
  - text: Π’Ρ‹ Π½Π°ΠΆΠ°Π» Π½Π° ΠΊΠ½ΠΎΠΏΠΊΡƒ 2

stories.yml

- story: buttons default path
  steps:
  - intent: buttons
  - action: utter_buttons
- story: button_1 path
  steps:
  - intent: button_1
  - action: utter_cat
- story: button_2 path
  steps:
  - intent: button_2
  - action: utter_button_2

than i got it

i correct it in Interactive Learning and added to stories

- story: Story from Conversation ID d3afebc97a0349b6a7a567e912c5a254
  steps:
  - intent: buttons
  - action: utter_buttons
  - intent: button_1
  - action: utter_cat

but it still doesnt work

Hello @tvoi-kotik ! Welcome to the community :handshake:

  1. Well there is not exact thumb rule for how many examples but it should have at least 10-20 examples, which should cover all your set of variations of questions. Sometimes, unnecessary examples can load your model. Please note and its recommended that training examples should be more than 2, if you gave less than that, whilst training you will get Warning.

Well, some examples need more sets of examples and some required fewer sets of examples, so it’s perfectly fine if some have a higher examples and some low, but it will be good to maintain 10-20 on the safer side and better learning for the bot.

  1. When you say made some adjustments what exactly do you mean by that? Yes, some time model train fast and some time model take a lot of time, it depends on data and resources also ( not sure on this part) But, yes model needs some time, so grab a coffee and take a walk and check the model :wink: PS: How much time your model is taking by the way.

  2. For this please check this thread How to add link and buttons in rasa - #3 by nik202, it is a demo code for other user solutions, please customize as per your need. Please even check the syntax, and hope you mentioned the intent: buttons, buttons1 and buttons2 in domain.yml as shown in the above-mentioned thread.

Note: In button, we normally use text one time, but you had used two times - text: "КнопаЧки!" | -text: НаТми Π½Π° ΠΊΠ½ΠΎΠΏΠΊΡƒ

If you have any further issues with this button problem, please clear it with me.

I hope you get more clarity and hope this will solve your issue. Good Luck!

2 Likes

Hi Kostya, starting from the buttons issue, I looked at your code of domain.yml

utter_buttons:
  - text: "КнопаЧки!"
  - buttons:
    - payload: /button_1
      title: ΠŸΠΎΠΊΠ°Π·Π°Ρ‚ΡŒ ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΡƒ ΠΊΠΎΡ‚ΠΈΠΊΠ°
    - payload: /button_2
      title: ΠšΠ½ΠΎΠΏΠΎΡ‡ΠΊΠ° 2
    text: НаТми Π½Π° ΠΊΠ½ΠΎΠΏΠΊΡƒ

Here. remove - before buttons, chose which text you want to keep before buttons one or below title one. This will solve your issue so output for buttons will look like below

utter_buttons:
  - text: "КнопаЧки!"
    buttons:
    - payload: /button_1
      title: ΠŸΠΎΠΊΠ°Π·Π°Ρ‚ΡŒ ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΡƒ ΠΊΠΎΡ‚ΠΈΠΊΠ°
    - payload: /button_2
      title: ΠšΠ½ΠΎΠΏΠΎΡ‡ΠΊΠ° 2
utter_buttons:
  - buttons:
    - payload: /button_1
      title: ΠŸΠΎΠΊΠ°Π·Π°Ρ‚ΡŒ ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΡƒ ΠΊΠΎΡ‚ΠΈΠΊΠ°
    - payload: /button_2
      title: ΠšΠ½ΠΎΠΏΠΎΡ‡ΠΊΠ° 2
    text: НаТми Π½Π° ΠΊΠ½ΠΎΠΏΠΊΡƒ

I added both ways so you know.

secondly for training data,

depends on the use case let’s say we take a customer care bot, there will be many intents for faq and chitchats because it has to chat with a customer about anything so make sure you think have some look at other bots online then try.

Training model

adding to @nik202 answer, training every time depends on data you give more the data more time, so give it enough to test, Then if you are a student tell your friends to test and they will give you some feedback and just add changes in them. This is known as CDD also well taught in Rasa new Tutorial series by Vincent

Any doubts add them here
Also, checkout Rasa tutorial series and my beginner tutorial on bots

3 Likes

Thx for ur answer. I correct it. Than i got this situation.

it works if i write buttons at the start, but , it still dont wanna work after greeting maybe if i will create story like this:

 steps:
  - intent: greeting
  - action: utter_greet
  - intent: buttons
  - action: utter_buttons

it will be fixed, but … Before I was making every story with

  - intent: greeting
  - action: utter_greet

at the start, and then rasa told me, that i can did it only one time, so i delete it from every story, and make this one:

- story: default greet
  steps:
  - intent: greeting
  - action: utter_greet

what the right way to resolve it

Thanks for your advice, I’ve already watched the series of guides, but they were old before version 2.0, thanks again for the helpful links.

please chose a solution so it would be helpful to community

@tvoi-kotik No worries, You can use one story for the same. If you want that button menu should come after the greet intent or if you have other utterances then you need to create a different story for the same.

@tvoi-kotik Whenever the greet intent will be a trigger by a user such as hello, heya, hi, hola it will activate utter_greet action and then button actions. You need to experiment for the same.

Tip: Please some time you need to delete the older trained model and re-train the model if you think your code is 100 % correct.

If you need any further help please mention me.

I’d even encourage to please see the video series Conversational AI with Rasa: Introduction to Rasa - YouTube and even check some tutorial on youtube. Good Luck and keep safe!