def do_train(config, component_builder=None): # type: (RasaNLUConfig, Optional[ComponentBuilder]) -> Tuple[Trainer, Text] """Loads the trainer and the data and runs the training of the specified model.""" trainer = Trainer(config, component_builder) persistor = create_persistor(config) training_data = load_data(config['data']) trainer.validate() trainer.train(training_data) persisted_path = trainer.persist(config['path'], persistor) return trainer, persisted_path
def do_train(config): # type: (RasaNLUConfig) -> (Trainer, str) """Loads the trainer and the data and runs the training of the specified model.""" trainer = Trainer(config) persistor = create_persistor(config) training_data = load_data(config['data'], config['language'], luis_data_tokenizer=config['luis_data_tokenizer']) trainer.validate() trainer.train(training_data) persisted_path = trainer.persist(config['path'], persistor) return trainer, persisted_path
def train(cfg_name, model_name): from rasa_nlu.train import create_persistor from rasa_nlu.converters import load_data config = RasaNLUConfig(cfg_name) trainer = Trainer(config) training_data = load_data(config['data'], config['language']) trainer.validate() trainer.train(training_data) persistor = create_persistor(config) trainer.persist(os.path.join("test_models", model_name), persistor, create_unique_subfolder=False)