-
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
Initial implementation of Core YAML parser #6001
Conversation
6058c1f
to
5d45f3c
Compare
5d45f3c
to
599dae9
Compare
599dae9
to
d277ace
Compare
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.
Love the cleanness of the implementation 🚀
- What about a
YAMLStoryWriter
?
Thanks for the review! I'm bringing the
As mentioned in the #5970 I plan to implement writers for |
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.
Tobias' review was already super extensive so I didn't add many comments. It's working nicely at the moment and I was able to write stories using the new format. Here's some things that we should consider changing:
- If I don't prefix the user intent with
/
, I get three warnings for this. Though I am not sure if this is specific to this format. - When adding a new story, if I do not write
story
correctly (e.g.storie
), the block is ignored. I think we should show a warning in this case, if the key does not correspond to any of the ones we recognize. - If I don't add
steps
, or writesteps
incorrectly, the entire story is ignored. We should show a warning in this case. - (In reference to my comment below) If I don't specify
action
/user
/slot
/etc. correctly, the step is ignored. We should should a warning for this. Maybe we can do something similar to what I suggested in the NLU PR, take one of the keys of the dict and include them in the warning. - If I don't write
entities
correctly in theuser
step, they are ignored. Maybe a warning for this would work as well.
So I guess the main improvements we could do are making sure the user knows if they have made a mistake writing stories.
d277ace
to
5dddb64
Compare
0d16c86
to
358f67b
Compare
358f67b
to
a5dc96a
Compare
4c8d562
to
d89f792
Compare
- Created new YAML parser - Extracted common parts for YAML and MD to the separate classes - Added unit tests
- Added support for `OR` and `Checkpoints` for the YAML parser - Addressing PR review comments - Added more tests
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.
haven't checked the tests yet, will do that separately.
Great work 🚀 💪 🎸 🥒 🌶️
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.
One more thing: I think the logger.error()
s should actually be raise_warnings
, no? I'm referring to the ones in yaml_story_reader
This breaks with the
|
d89f792
to
973be61
Compare
Ignore my comment from above. I think that was due to an experimental state my domain file was in :-D |
@wochinge yes, I see it too. Bad that I didn't add a test for that. |
c39e551
to
1c66a07
Compare
- Addessed the comments - Adjusted the tests
1c66a07
to
f9aab71
Compare
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.
Really great work @degiz 💪
Do you wanna add a changelog?
rasa/core/training/loading.py
Outdated
reader = MarkdownStoryReader( | ||
interpreter, domain, template_variables, use_e2e, filename | ||
) | ||
elif PurePath(filename).suffix in YAML_FILE_EXTENSIONS: |
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.
that doesn't work? Why do we need PurePath
?
elif PurePath(filename).suffix in YAML_FILE_EXTENSIONS: | |
elif Path(filename).suffix in YAML_FILE_EXTENSIONS: |
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.
Path
is a child of PurePath
, and the pathlib
docs mention PurePath(filename).suffix
as an example, I simply followed it.
But since you've found that confusing I can change that.
f"Issue found in {self.source_name}: \n" | ||
f'User intent "{user_utterance}" should start with ' | ||
f'"{INTENT_MESSAGE_PREFIX}"', | ||
docs=DOCS_URL_STORIES, |
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.
we still should tell them that we skipped
I guess yes, thanks. Even though this is only an "Initial implementation". But probably later we can simply modify the same changelog entry? |
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.
🎉
cdeb739
to
53f4f92
Compare
Part of #5996
Proposed changes:
Forms and Rules are not covered in this PR.
Things to address in the next PRs:
Status (please check what you already did):
black
(please check Readme for instructions)