1 Star 4 Fork 3

yasiping/RasaChatBot

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
training_online.py 1.19 KB
一键复制 编辑 原始数据 按行查看 历史
梅干菜烧饼不加肉 提交于 2018-12-14 23:46 . add some data examples
import logging
from rasa_core.agent import Agent
from rasa_core.policies.keras_policy import KerasPolicy
from rasa_core.policies.memoization import MemoizationPolicy
from rasa_core.interpreter import RasaNLUInterpreter
from rasa_core.train import interactive
from rasa_core.utils import EndpointConfig
logger = logging.getLogger(__name__)
# checkSelfPermission
def run_criminal_online(interpreter,
domain_file="data/criminal_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(max_history=3, epochs=5, batch_size=50)],
interpreter=interpreter,
action_endpoint=action_endpoint)
data = agent.load_data(training_data_file)
agent.train(data)
interactive.run_interactive_learning(agent, training_data_file)
return agent
if __name__ == '__main__':
logging.basicConfig(level="INFO")
nlu_interpreter = RasaNLUInterpreter('./models/nlu/default/criminalnlu')
run_criminal_online(nlu_interpreter)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yasiping/RasaChatBot.git
git@gitee.com:yasiping/RasaChatBot.git
yasiping
RasaChatBot
RasaChatBot
master

搜索帮助