Skip to content

Instantly share code, notes, and snippets.

@NikhilBansal21
Created August 3, 2018 11:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NikhilBansal21/5c0b9ba1892da393ec9b77dfb342208e to your computer and use it in GitHub Desktop.
Save NikhilBansal21/5c0b9ba1892da393ec9b77dfb342208e to your computer and use it in GitHub Desktop.
def train_dialogue(domain_file="faq_domain.yml",
model_path="models/dialogue",
training_data_file="data/stories.md"):
agent = Agent(domain_file,
policies=[MemoizationPolicy(max_history=3)])
training_data = agent.load_data(training_data_file)
agent.train(
training_data,
epochs=400,
batch_size=100,
validation_split=0.2
)
agent.persist(model_path)
return agent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment