代码拉取完成,页面将自动刷新
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)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。