Hi there,
I want the data from the filled slot, store as a new intent in the nlu file. Is that possible?
Hi there,
I want the data from the filled slot, store as a new intent in the nlu file. Is that possible?
It’s not clear to me what you’re trying to achive. If the slot is already filled, then you can reference that value with the slot_was_set
key in stories (this does not set the slot, just references it). If you want to access the slot value for something more elaborate, I think you want to look for custom actions. Or maybe you want to just fill a slot from an intent entity? Could you elaborate?
Dear FearsomeTuna, Thank you for the answer. The action should to do: User asks a question that the bot does not know. This request from the user is stored in the “answere_user” slot. The content of the slot should be entered in the nlu.yml ale new intent.
First, there’s the problem of how you define a ‘question that the bot does no know’. Is it any user message the bot doesn’t know how to classify its intent? Is it a specific intent that did not receive an expected entity? Is it any situation in which the bot does recognize an intent, but can’t predict an action with enough confidence?
Maybe it is worth to take a look at this page of the docs on how to manage fallback behaviour. Keep in mind that low intent confidence is handled separately from low action confidence. You can create rules to call a specific custom action if the intent has low confidence (nlu_fallback intent). You can overwrite the default action_default_fallback
or change the default action in your config.yml file. In any case, you can set slots manually in custom actions if you need, though maybe you want the whole user message, in which case you could retrieve that on a custom action intead of using slots.
The second problem is that it seems you want to add intents at run time. Keep in mind that just adding the intents on the nlu.yml file won’t have an impact on your bot until you re-train (which I don’t know if it can be done at runetime). If you just want a tool to conveniently add misclasiffied intents, I would suggest using Rasa X, which has a nice, visual interface to go through these cases. You could write the nlu.yml file using python from a custom action (for example, the action_default_fallback
I mentioned earlier). If you go this route, I would suggest to write them to a separate file, so you can review them manually before using them for training. But it seems to me Rasa X would serve you better for adding misclassified intents.
If you want something different, please elaborate on what you’re trying to accomplish or why do you wanna do that weird stuff.