notice

This is unreleased documentation for Rasa Open Source Documentation Master/Unreleased version.
For the latest released documentation, see the latest version (2.0.x).

Version: Master/Unreleased

rasa.shared.core.training_data.story_reader.story_reader

StoryReader Objects

class StoryReader()

Helper class to read a story file.

__init__

| __init__(domain: Optional[Domain] = None, template_vars: Optional[Dict] = None, use_e2e: bool = False, source_name: Optional[Text] = None, is_used_for_training: bool = True) -> None

Constructor for the StoryReader.

Arguments:

  • domain - Domain object.
  • template_vars - Template variables to be replaced.
  • use_e2e - Specifies whether to use the e2e parser or not.
  • source_name - Name of the training data source.
  • is_used_for_training - Identifies if the user utterances should be parsed (entities are extracted and removed from the original text) and OR statements should be unfolded. This parameter is used only to simplify the conversation from MD story files. Don't use it other ways, because it ends up in a invalid story that cannot be user for real training. Default value is False, which preserves the expected behavior of the reader.

is_test_stories_file

| @staticmethod
| is_test_stories_file(filename: Text) -> bool

Checks if the specified file is a test story file.

Arguments:

  • filename - File to check.

Returns:

True if specified file is a test story file, False otherwise.

is_stories_file

| @staticmethod
| is_stories_file(filename: Text) -> bool

Checks if the specified file is a story file.

Arguments:

  • filename - File to check.

Returns:

True if specified file is a story file, False otherwise.

StoryParseError Objects

class StoryParseError(RasaCoreException, ValueError)

Raised if there is an error while parsing a story file.