-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make metadata available in NLU pipeline #6090
Comments
Thanks for submitting this feature request 🚀 @wochinge will get back to you about it soon! ✨ |
My team is also in need of this. Quoting my colleague, @nbeuchat :
|
Sorry, I was convinced to have already answered 😬 Thanks for brining up all these different use cases. Especially the one with geographic context is very valid. What do you think @Ghostvv ? |
Yes, having access to the tracker and sender_id would also be very nice! We have added a mechanism for logging by sender_id to our logging system, and seeing which sender has triggered a specific error in a pipeline component would be very useful :) |
NLU pipeline should be context agnostic, it is used to classify text into abstract notions. Disambiguation should happen through rasa core. E.g. disambiguating entities can be done inside custom action or a form. |
Does the NLU pipeline have to be context agnostic? Why? |
this is the separation of nlu and core. Core is responsible for context. Response selector is still context agnostic. We fully integrate nlu inside core in the further update. So you could easily access nlu components inside core, and therefore condition their output on the context. |
Correct me if I'm wrong but custom actions and forms are not really part of Rasa core, are they? Rasa core just predicts the next action/form/utterance to use and that's it. For the disambiguation case, that means that you need to either:
To me, it forces us to do some simple entities processing way later in the NLU > Core > Action pipeline which makes it very unclear of what is happening when.
I would agree with this statement for the conversation part (ie: it shouldn't really matter where you are in the conversation from an NLU perspective). However, I feel that entity disambiguation/linkage should be done within the NLU pipeline and some limited context can be needed (geography for entity disambiguation, user locale for date parsing, user country for phone number parsing, etc.) |
what do you mean? they are part of rasa core, but you need to write them using sdk
why can't you do it inside the action that needs to use it?
is it always the same inside conversation but change from conversation to conversation? |
@nbeuchat What do you think of the proposed solution? |
I love it! Very much waiting to have it in Rasa 2.0. I just implemented last week something that would have greatly benefited from the custom auto slot filling. It's also great combined with the new entities groups (for example, to pick or ignore a group for auto-filling a slot). |
Ehm, about this 🙄 🙈 It's probably rather gonna be a minor after 2.0 . We are currently focusing upon releasing a production ready Rasa Open Source 2.0 version with the features which we committed to and want to avoid further delays due to newly added features. Getting 2.0 ready, documented and smooth to use is currently our number one priority. We will return to our regular release cycle (every 4 weeks) once 2.0 is released so it shouldn't take too long 🤞 I'm sorry to keep you waiting longer. |
No worries at all 😄 In any case, we'll have some work to do to migrate to 2.0 in the first place so I wasn't expecting to have that new feature up and running directly :-) Thanks for the update! |
@wochinge Can we close this after 2.0? |
Yes, fixed by #6275 |
the default interpreter in Agent is RasaNLUInterpreter. But RasaNLUInterpreter does't have this feature of passing on the metadata in its parse method. |
Why this issue is closed? The current Lines 131 to 147 in 2039cef
The current interpreter of nlu can not accept metadata Lines 444 to 449 in 2039cef
Ref active question from forum https://forum.rasa.com/t/passing-metadata-to-custom-components-nlu/45198 |
The changes in the linked PR don't send metadata all the way down to the method in which it is needed for NLU components to access it. Lines 572 to 574 in 7c8aa9f
But here in RasaNLUInterpreter.parse which it calls, only the text of the message actually gets passed on:Line 145 in 7c8aa9f
(also true of RasaNLUHttpInterpreter.parse )
Eventually this will call Lines 444 to 449 in 7c8aa9f
This means the Lines 467 to 470 in 7c8aa9f
|
The original issue description seems to be referring to training data metadata, which is quite different from incoming message metadata. However the linked PR seems to be making incoming message metadata available to the interpreter (although not quite, as above) |
Apologies, the above is true for Rasa 2.8.x, this is resolved entirely in Rasa 3.0. Metadata is available in each component's |
@melindaloubser1 can you provide a link in the docs or code to where message.data["metadata"] is implemented in 3.0? |
Note: I know that I'm using Rasa in an unusual way.
Description of Problem:
I have a website with some tools and I'm trying to educate and guide my users on how to use those tools. For that I have many interactive tutorials which in turn have many steps. During the tutorial users can ask questions to the AI tutor about what they see, where they are supposed to click, how things work, in which order to do things, why they should do that thing, and many other kinds of questions. This chat functionality is powered by Rasa. This setup means that there are very many similar but different intents and each intent may only be valid on a few pages or during a few steps. I would therefor like to pass a key in the metadata that indicates where in the tutorial the user currently is and use this key in my custom NLU component to filter out the relevant intents/responses for that part of the tutorial before predicting the correct one.
In a sense I want the contextual assistants context to also include what the user sees in the current tutorial.
Relevant topics:
https://forum.rasa.com/t/pass-along-users-current-location-on-website-as-a-paramter-to-rasa/25908
https://forum.rasa.com/t/metadata-in-message-in-nlu-pipeline-component/26767
Overview of the Solution:
Metadata for each message in the conversation needs to be available in the NLU pipeline.
Currently metadata is only avaiable in
rasa.core.channels.UserMessage
not inrasa.nlu.training_data.Message
In this post https://forum.rasa.com/t/new-training-data-format-ideas/29687 it is mentioned that "support for optional custom metadata in training examples" may come in a new update. Will this also allow for providing metadata to the NLU during inference?
Definition of Done:
The text was updated successfully, but these errors were encountered: