def train_dialogue(domain_file='weather_domain.yml', model_path='./models/dialogue', training_data_file='./data/stories.md'): agent = Agent(domain_file, policies=[MemoizationPolicy(), KerasPolicy()]) agent.train(training_data_file, epochs=300, batch_size=50, validation_split=0.2) agent.persist(model_path) return agent
def train_dialog(domain_file="domain.yml", model_path="models/dialogue", training_data_file="data/stories.md"): agent = Agent(domain_file, policies=[MemoizationPolicy(), EventPolicy()]) agent.train(training_data_file, max_history=3, epochs=400, batch_size=100, validation_split=0.2) agent.persist(model_path) return agent
def train_dialogue(domain_file="weather_domain.yml", model_path="models/dialogue", training_data_file="data/babi_stories.md"): agent = Agent(domain_file, policies=[MemoizationPolicy(), WeatherPolicy()]) agent.train(training_data_file, max_history=3, epochs=2000, batch_size=50, augmentation_factor=50, validation_split=0.2) agent.persist(model_path) return agent
def learnonline(self, msg, args): """Command to trigger learn_online on rasa agent""" token = config.BOT_IDENTITY['token'] if token is None: raise Exception('No slack token') train_agent= Agent(self.domain_file, policies=[MemoizationPolicy(max_history=2), KerasPolicy()], interpreter=RegexInterpreter()) training_data = train_agent.load_data(self.training_data_file) train_agent.train_online(training_data, input_channel=self.backend_adapter, batch_size=50, epochs=200, max_training_samples=300)
def train_dialogue(domain_file='../mom/domain.yml', model_path='../models/policy/mom', training_data_file="../mom/data/stories.md"): agent = Agent(domain_file, policies=[MemoizationPolicy(), MomPolicy()]) agent.train(training_data_file, max_history=3, epochs=100, batch_size=50, augmentation_factor=50, validation_split=0.2) agent.persist(model_path) return agent
def train_dialogue(domain_file='domain.yml', model_path='./models/current/dialogue', training_data_file='./data/stories.md'): agent = Agent(domain_file, policies=[ MemoizationPolicy(), KerasPolicy(max_history=3, epochs=200, batch_size=50) ]) data = agent.load_data(training_data_file) agent.train(data) agent.persist(model_path) return agent