-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Response converter #7183
Response converter #7183
Conversation
3273859
to
0d5f439
Compare
0d5f439
to
feab7b6
Compare
@degiz would you mind giving a first review on this PR? I haven't run nor written tests yet, I want to get some feedback on the general approach (no need to look at docstrings and function names for instance) |
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.
Thanks a lot for working on this @m-vdb !!
One note about the general approach - can we use TrainingDataConverter
interface? This way we can:
- implement all needed conversions in another module and keep
data.py
from getting too long - reuse methods like
TrainingDataConverter::generate_path_for_converted_training_data_file
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.
Thanks a lot for jumping in and implementing the changes!! 🚀 💯
One note - with this PR rasa data convert nlg
will leave project in a broken state (domain and stories still not converted), could we extent the help text for this command and mention, that they should also run rasa data convert responses
?
rasa/nlu/training_data/converters/nlg_markdown_to_yaml_converter.py
Outdated
Show resolved
Hide resolved
rasa/nlu/training_data/converters/nlg_markdown_to_yaml_converter.py
Outdated
Show resolved
Hide resolved
rasa/nlu/training_data/converters/nlg_markdown_to_yaml_converter.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Alexander Khizov <[email protected]>
rasa/core/training/converters/story_responses_prefix_converter.py
Outdated
Show resolved
Hide resolved
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.
Thanks a lot! 🚀🚀🚀
Let's keep an eye on that domain dict key order 😬
""" | ||
# setting the `version` key first so that it appears at the top of YAML files | ||
# thanks to the `should_preserve_key_order` argument of `dump_obj_as_yaml_to_string` | ||
domain_data: Dict[Text, Any] = { |
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'm quite surprised this even works 🤔 it's still a Dict, and the keys order is not preserved 😬
If tests fails, we could change the dict
to the OrderedDict
right away!
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.
because they changed it in Python 3.7 \0/ => https://softwaremaniacs.org/blog/2020/02/05/dicts-ordered/
Co-authored-by: Alexander Khizov <[email protected]>
thanks for the rapid reviews @degiz 🙏 🙏 🙏 |
Proposed changes:
Status (please check what you already did):