예제 #1
0
def run_online(interpreter,domain_file="./domain.yml",training_data_file='./backend/stories.md'):					  
    agent = Agent(domain_file,
                  policies=[MemoizationPolicy(max_history=2), KerasPolicy()],
                  interpreter=interpreter) 
    				  
    data = agent.load_data(training_data_file)
    agent.train(data,
                       batch_size=50,
                       epochs=200,
                       max_training_samples=300)				   
    online.serve_agent(agent)
    return agent
예제 #2
0
def run_weather_online(interpreter,
                       domain_file="weather_domain.yml",
                       training_data_file='data/stories.md'):
    action_endpoint = EndpointConfig(url="http://localhost:5055/webhook")
    agent = Agent(domain_file,
                  policies=[MemoizationPolicy(max_history=2),
                            KerasPolicy()],
                  interpreter=interpreter,
                  action_endpoint=action_endpoint)

    data = agent.load_data(training_data_file)
    agent.train(data, batch_size=50, epochs=200, max_training_samples=300)
    online.serve_agent(agent)
    return agent
예제 #3
0
파일: bot.py 프로젝트: tarunbhavnani/rasa
def run_online(domain_file="domain.yml", training_data_file="data/stories.md"):
    interpreter = RasaNLUInterpreter('models/nlu/default/latest_nlu')
    action_endpoint = EndpointConfig(url="http://localhost:5055/webhook")
    agent = Agent(
        domain_file,
        policies=[MemoizationPolicy(max_history=2),
                  KerasPolicy(), fallback],
        interpreter=interpreter,
        action_endpoint=action_endpoint)

    data = agent.load_data(training_data_file)
    agent.train(data, batch_size=50, epochs=200, max_training_samples=300)
    online.serve_agent(agent)
    return agent