notice
This is unreleased documentation for Rasa Documentation Main/Unreleased version.
For the latest released documentation, see the latest version (3.x).
rasa.shared.core.training_data.story_reader.yaml_story_reader
YAMLStoryReader Objects
Class that reads Core training data and rule data in YAML format.
from_reader
Create a reader from another reader.
Arguments:
reader
- Another reader.
Returns:
A new reader instance.
read_from_file
Read stories or rules from file.
Arguments:
filename
- Path to the story/rule file.skip_validation
-True
if the file was already validated e.g. when it was stored in the database.
Returns:
StoryStep
s read from filename
.
read_from_string
Read stories or rules from a string.
Arguments:
string
- Unprocessed YAML file content.skip_validation
-True
if the string was already validated e.g. when it was stored in the database.
Returns:
StoryStep
s read from string
.
read_from_parsed_yaml
Read stories from parsed YAML.
Arguments:
parsed_content
- The parsed YAML as a dictionary.
Returns:
The parsed stories or rules.
is_stories_file
Check if file contains Core training data or rule data in YAML format.
Arguments:
file_path
- Path of the file to check.
Returns:
True
in case the file is a Core YAML training data or rule data file,
False
otherwise.
Raises:
YamlException
- if the file seems to be a YAML file (extension) but can not be read / parsed.
is_test_stories_file
Checks if a file is a test conversations file.
Arguments:
file_path
- Path of the file which should be checked.
Returns:
True
if it's a conversation test file, otherwise False
.
unpack_regex_message
Unpacks the message if TEXT
contains an encoding of attributes.
Arguments:
message
- some messagedomain
- the domainentity_extractor_name
- An extractor name which should be added for the entities.
Returns:
the given message if that message does not need to be unpacked, and a new message with the extracted attributes otherwise
StoryParser Objects
Encapsulate story-specific parser behavior.
RuleParser Objects
Encapsulate rule-specific parser behavior.