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
initial prototype (refactoring of policy/tracker featrizer/single state featurizer) #9074
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a first read-through. Its a good start I think!
That is, this function filters all sparse sequence features and then | ||
turns each of these sparse sequence features into sparse sentence feature | ||
by summing over their first axis, respectively. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't always work. For example, the "natural" operation to combine semantic map embeddings is not a sum.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is something that depends on the kind of Features and their origin (which means this will not make separate state featurizer classes necessary), I think we'll leave this in here as TODO (for a future Feature rework or so?)
# 1. Would be cool if users would be notified that they're not training | ||
# the policy based on what their NLU pipeline returns.... (cf. | ||
# featurize_via_interpreter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was really confused whether the wrong interpreter might be used by accident. But I guess the reason there's no mismatch (in practice now) is in the .persist of the TrackerFeaturizer which will pickles this StateFeaturizer as a wholeand preserve the "use_regex..." flag.
self, state: State, interpreter: NaturalLanguageInterpreter | ||
) -> Dict[Text, List["Features"]]: | ||
"""Encode the given state with the help of the given interpreter. | ||
class EntityFeaturizer: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I follow. Why do you want to implement a separate class here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It just helped me understand that the functionality that follows is completely independent of the rest (at least the functions itself). The logic seems to overlap and might be merged/solved with some of the above. No?
Co-authored-by: Johannes E. M. Mosig <j.mosig@rasa.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just looked through the state.py again
Proposed changes:
Status (please check what you already did):
black
(please check Readme for instructions)