Open fedoralina opened 7 months ago
Here I will add the logical steps for the intent "order" to think about (starting from existing sample repo), they are in the nlu
folder
Short: What is the first thing a user would do with the pizza ordering bot?
after step 2, the model can be trained (without adding anything else than nlu data) by running rasa train nlu
and then test by rasa shell nlu
intents we will not need
When to use rules?
note: you can use retrieval_intent
in ResponseSelector for that, so that actions and intents are not packed too much regarding faq questions, but can be grouped in a rule (like shown in this YT vid, important to give intents and actions the same name inside the retrieval intent so that they are recognized)
what rules do we use from the bot?
what to know about stories: https://rasa.com/docs/rasa/stories
Notes:
slot_was_set
: if custom action sets a slot, then we need to put that directly after the action. (this specific slot needs to be filled)active_loop
used after action form to make form continue until it is completedregarding responses, only not required is utter_delivery_address
rest depends on how we want to design it.
what to know about slots
requested_slot
is used to change the flow depending on at which state we are now, e.g. if pizza_amount needs to be filled, but user may ask why we need that information, then requested_slot: pizza_amount
tells us that we are at that part of the form
slots with influence_conversation = true
will influence the dialog flow and how the conversation will continue (check here - minute 4:02) → only use it if the slot has a valid reason why it needs to influence the conversation
more generic from the docs regarding requested_slot
:
If you want to change this behavior, you need to add the requested_slot to your domain file as a categorical slot with influence_conversation set to true. You might want to do this if you want to handle your unhappy paths differently, depending on what slot is currently being asked from the user. For example, if your users respond to one of the bot's questions with another question, like why do you need to know that? The response to this explain intent depends on where we are in the story.
Note: more information also on slot types can be found in the video i linked and on slot types in the docs
what actions to use from pizzabot
comments on other actions of pizzabot code
how actions work (ref YT video here):
dispatcher
object can send messages back to the usertracker
can fetch information and contains relevant data extracted from the conversation so far (predicted intents, entities. slot values)domain
object has access to data in domain.yml
fileNotes:
rasa run actions
after training the model to enable the usage of custom actions in project IMPORTANT:
including following intents result in error (at least for now, only using basic pizza ordering
lookup tables vs synonyms:
https://forum.rasa.com/t/synonyms-vs-lookup-tables/15711
TL;DR:
for synonyms: you need an example for each synonym in your intents examples so that they can be recognized! https://rasa.com/docs/rasa/nlu-training-data/
outsourcing files logically is possible! https://github.com/ChrisRahme/FYP-Chatbot/tree/main/data/stories
rasa init
based on the repo, which parts can we use for our project