rasa.core.training.story_writer.yaml_story_writer
YAMLStoryWriter Objects
Writes Core training data into a file in a YAML format.
dumps
Turns Story steps into a string.
Arguments:
story_steps
- Original story steps to be converted to the YAML.
Returns:
String with story steps in the YAML format.
dump
Writes Story steps into a target file/stream.
Arguments:
target
- name of the target file/stream to write the YAML to.story_steps
- Original story steps to be converted to the YAML.
stories_to_yaml
Converts a sequence of story steps into yaml format.
Arguments:
story_steps
- Original story steps to be converted to the YAML.
process_story_step
Converts a single story step into an ordered dict.
Arguments:
story_step
- A single story step to be converted to the dict.
Returns:
Dict with a story step.
stories_contain_loops
Checks if the stories contain at least one active loop.
Arguments:
stories
- Stories steps.
Returns:
True
if the stories
contain at least one active loop.
False
otherwise.
process_user_utterance
Converts a single user utterance into an ordered dict.
Arguments:
user_utterance
- Original user utterance object.
Returns:
Dict with a user utterance.
process_action
Converts a single action into an ordered dict.
Arguments:
action
- Original action object.
Returns:
Dict with an action.
process_slot
Converts a single SlotSet
event into an ordered dict.
Arguments:
event
- OriginalSlotSet
event.
Returns:
Dict with an SlotSet
event.
process_checkpoints
Converts checkpoints event into an ordered dict.
Arguments:
checkpoints
- List of original checkpoint.
Returns:
List of converted checkpoints.
process_or_utterances
Converts user utterance containing the OR
statement.
Arguments:
utterances
- User utterances belonging to the sameOR
statement.
Returns:
Dict with converted user utterances.
process_active_loop
Converts ActiveLoop event into an ordered dict.
Arguments:
event
- ActiveLoop event.
Returns:
Converted event.