rasa/core/training/dsl.py
async def read_from_folder(resource_name, domain,
                               interpreter=RegexInterpreter(),
                               template_variables=None, use_e2e=False,
                               exclusion_percentage=None):
        """Given a path reads all contained story files."""
        import rasa_nlu.utils as nlu_utils

        if not os.path.exists(resource_name):
            raise ValueError("Story file or folder could not be found. Make "
                             "sure '{}' exists and points to a story folder "
                             "or file.".format(os.path.abspath(resource_name)))

        story_steps = []
        for f in nlu_utils.list_files(resource_name):
            steps = await StoryFileReader.read_from_file(f, domain,
                                                         interpreter,
                                                         template_variables,
                                                         use_e2e)
            story_steps.extend(steps)

        # if exclusion percentage is not 100
        if exclusion_percentage and exclusion_percentage is not 100:
            import random
            idx = int(round(exclusion_percentage / 100.0 * len(story_steps)))
            random.shuffle(story_steps)
            story_steps = story_steps[:-idx]

        return story_steps
Given a path reads all contained story files.
Given a path reads all contained story files.
Given a path reads all contained story files .
async def read_from_folder(resource_name, domain,
                               interpreter=RegexInterpreter(),
                               template_variables=None, use_e2e=False,
                               exclusion_percentage=None):
        import rasa_nlu.utils as nlu_utils
        if not os.path.exists(resource_name):
            raise ValueError("Story file or folder could not be found. Make "
                             "sure '{}' exists and points to a story folder "
                             "or file.".format(os.path.abspath(resource_name)))
        story_steps = []
        for f in nlu_utils.list_files(resource_name):
            steps = await StoryFileReader.read_from_file(f, domain,
                                                         interpreter,
                                                         template_variables,
                                                         use_e2e)
            story_steps.extend(steps)
        if exclusion_percentage and exclusion_percentage is not 100:
            import random
            idx = int(round(exclusion_percentage / 100.0 * len(story_steps)))
            random.shuffle(story_steps)
            story_steps = story_steps[:-idx]
        return story_steps
async def read_from_folder ( resource_name , domain , interpreter = RegexInterpreter ( ) , template_variables = None , use_e2e = False , exclusion_percentage = None ) : import rasa_nlu . utils as nlu_utils if not os . path . exists ( resource_name ) : raise ValueError ( "Story file or folder could not be found. Make " "sure '{}' exists and points to a story folder " "or file." . format ( os . path . abspath ( resource_name ) ) ) story_steps = [ ] for f in nlu_utils . list_files ( resource_name ) : steps = await StoryFileReader . read_from_file ( f , domain , interpreter , template_variables , use_e2e ) story_steps . extend ( steps ) if exclusion_percentage and exclusion_percentage is not 100 : import random idx = int ( round ( exclusion_percentage / 100.0 * len ( story_steps ) ) ) random . shuffle ( story_steps ) story_steps = story_steps [ : - idx ] return story_steps
Given a path reads all contained story files.
Given a path reads all contained story files .
"""Given a path reads all contained story files.""" # if exclusion percentage is not 100
resource_name
domain
interpreter
template_variables
use_e2e
exclusion_percentage