from rasa.core.agent import Agent from rasa.core.training_data import load_data training_data = load_data('data/stories.md') agent = Agent('domain.yml') agent.train(training_data)
from rasa.core.agent import Agent from rasa.core.training_data import loading from rasa.core import config domain_file = "domain.yml" training_directory = "data" training_data = None for file in loading.get_core_nlu_directories(training_directory): if not training_data: training_data = loading.load_data(file) else: training_data = training_data.merge(loading.load_data(file)) agent = Agent( domain_file, policies=config.load('config.yml'), ) agent.train( training_data, augmentation_factor=50, validation_split=0.1, )In this example, the `load_data` method is used to load training data from a directory called `data`. The `merge` method is used to combine multiple data files within the directory. The Agent is then initialized using a domain file called `domain.yml`, and a policy configuration file called `config.yml`. Finally, the Agent is trained using the loaded training data with an `augmentation_factor` of 50, and a `validation_split` of 0.1.