コード例 #1
0
ファイル: Train_Online.py プロジェクト: dlameyer/RASA_chatbot
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