当前位置: 首页 > news >正文

网站域名被注销重新备案怎么做php网站模板

网站域名被注销重新备案怎么做,php网站模板,网络图怎么绘制,沈阳网是什么公司文章目录1. 领域 domain2. 故事 story用户消息机器人动作与事件辅助符号3. 动作 action回复动作表单默认动作自定义动作4. 词槽 slot词槽和对话行为词槽类型词槽映射5. 策略 policy6. 端点 endpoints.yml7. rasa SDK、自定义动作自定义动作运行自定义动作8. rasa 支持的客户端9… 文章目录1. 领域 domain2. 故事 story用户消息机器人动作与事件辅助符号3. 动作 action回复动作表单默认动作自定义动作4. 词槽 slot词槽和对话行为词槽类型词槽映射5. 策略 policy6. 端点 endpoints.yml7. rasa SDK、自定义动作自定义动作运行自定义动作8. rasa 支持的客户端9. 实战报时机器人nlu.ymlstories.ymldomain.ymlconfig.ymlendpoints.ymlactions.py测试learn from https://github.com/Chinese-NLP-book/rasa_chinese_book_code rasa core 对话记录 和 选择下一个动作 1. 领域 domain 定义了所有信息 意图、实体、词槽、动作、表单、回复 意图、实体 应该 跟 rasa nlu 中的保持一致 utter_ 开头的回复 表示 渲染同名模板发送给用户 responses:utter_greet:- 你好 {name} # {name} 是模板变量回复 还支持 富文本指定通道 会话配置会话过期时间是否继承历史词槽 2. 故事 story version: 3.0 stories:- story: happy pathsteps:- intent: greet- action: utter_greet- story: query timesteps:- intent: query_time- action: action_query_time必须要有的 key 是 story、steps steps 表示用户和机器人之间的交互 用户消息 - intent: inform # 用户意图entities:- location: 上海 # 实体信息- price: 实惠机器人动作与事件 动作: action 返回事件词槽事件对词槽的值进行变更、active_loop 事件激活or取消激活表单 辅助符号 检查点符号checkpoint 减少故事中重复的部分名字相同的检查点可以互相跳转 不同的故事之间可以通过一个尾部一个首部 相同的 checkpoint 连接成一个新的故事 or 语句 stories: - story:steps:# 上一个step...- action: utter_ask_confirm- or:- intent: affirm- intent: thankyou- action: action_handle_affirmation大部分相同仅有其中一个步骤用户的意图不同 3. 动作 action 接受用户输入、对话状态信息按照业务逻辑处理并输出改变对话状态的事件和回复消息 回复动作 与 domain 里的 回复 关联在一起 当调用这类动作时会自动查找回复中的同名的模板并渲染 表单 收集任务所需的所有要素 默认动作 rasa内置的一些默认动作 自定义动作 满足后端交互计算需求如查数据库、第三方api请求 4. 词槽 slot 词槽必须要有 名字 和 类型 slots:slot_name: # 名字type: text # 类型influence_conversation: falseinitial_value: hello # 初始值mappings: # 映射- type: from_entityentity: entity_name词槽和对话行为 设置 influence_conversation bool 选项 词槽是否影响对话行为 词槽类型 text、bool、category枚举、float需要设置取值范围、list、any不影响系统动作预测 词槽映射 如上mappings 字段from_entity 表示将读取某个实体entity指定的值来赋值词槽 5. 策略 policy 策略负责学习故事从而预测动作 有一些内置的策略他们有优先级除非是专家不要随意修改优先级 数据增强 使用 Rasa 命令时添加 -- augmentation 来设定数据增强的数量 6. 端点 endpoints.yml 定义了 rasa core 和 其他服务进行连接的配置信息 7. rasa SDK、自定义动作 安装 rasa时默认安装 单独安装 pip install rasa-sdk 自定义动作 class ActionQueryTime(Action):def name(self) - Text:return action_query_timedef run(self,dispatcher: CollectingDispatcher,tracker: Tracker,domain: Dict[Text, Any],) - List[Dict[Text, Any]]:current_time datetime.now().strftime(%H:%M:%S)dispatcher.utter_message(textcurrent_time)return []重写 name() 向服务器申明动作名字重写 run() 获取当前对话信息 tracker 对象(对话状态追踪获取历史实体、词槽等) domain 对象 用户消息对象 dispatcher 根据这些信息完成业务动作如想改变对话状态需要返回事件发送给 rasa服务器没有的话返回 [] 运行自定义动作 跟rasa一起安装的sdkrasa run actions 单独安装的 python -m rasa_sdk --actions actions 8. rasa 支持的客户端 支持 Facebook、Rasa Webchat、Chatroom 等 跟 IM 连接的组件 称为 connector 其负责实现通信协议 rasa支持自定义 连接器支持同时使用多个连接器连接IM需要在 credentials.yml 文件中配置如何连接客户端 9. 实战报时机器人 tree . ├── actions.py ├── config.yml ├── credentials.yml ├── data │ ├── nlu.yml │ └── stories.yml ├── domain.yml ├── endpoints.yml ├── __init__.py ├── media │ └── demo.png ├── README.md └── tests└── conversation_tests.mdnlu.yml version: 3.0 nlu:- intent: greetexamples: |- 你好- 您好- hello- hi- 喂- 在么- intent: goodbyeexamples: |- 拜拜- 再见- 拜- 退出- 结束- intent: query_timeexamples: |- 现在几点了- 什么时候了- 几点了- 现在什么时候了- 现在的时间- intent: query_dateexamples: |- [今天](date)几号- [今天](date)是几号- [昨天](date)几号- [明天](date)几号- [今天](date)的日期- [今天](date)几号了- [明天](date)的日期- 几号- intent: query_weekdayexamples: |- [今天](date)星期几- [明天](date)星期几- [昨天](date)星期几- [今天](date)是星期几- 星期几stories.yml version: 3.0 stories:- story: happy pathsteps:- intent: greet- action: utter_greet- story: query timesteps:- intent: query_time- action: action_query_time- story: query datesteps:- intent: query_date- action: action_query_date- story: query weekdaysteps:- intent: query_weekday- action: action_query_weekday- story: say goodbyesteps:- intent: goodbye- action: utter_goodbyedomain.yml version: 3.0 session_config:session_expiration_time: 60carry_over_slots_to_new_session: true intents:- greet- goodbye- query_time- query_date- query_weekday entities:- date slots:date:type: textinfluence_conversation: falsemappings:- type: from_entityentity: date responses:utter_greet:- text: 你好我是 Silly我可以帮你查询时间、日期和星期几。你可以对我说「现在几点了」、「今天几号」或者「明天星期几」。utter_goodbye:- text: 再见 actions:- action_query_time- action_query_date- action_query_weekday- utter_goodbye- utter_greetconfig.yml recipe: default.v1 language: zh pipeline:- name: JiebaTokenizer- name: LanguageModelFeaturizermodel_name: bertmodel_weights: bert-base-chinese- name: DIETClassifierepochs: 100tensorboard_log_directory: ./loglearning_rate: 0.001 policies:- name: MemoizationPolicy- name: TEDPolicymax_history: 5epochs: 100- name: RulePolicyendpoints.yml action_endpoint:url: http://localhost:5055/webhookactions.py from typing import Any, Text, Dict, List from datetime import datetime, timedeltafrom rasa_sdk import Action, Tracker from rasa_sdk.executor import CollectingDispatcherdef text_date_to_int(text_date):if text_date 今天:return 0if text_date 明天:return 1if text_date 昨天:return -1# in other casereturn Noneweekday_mapping [星期一, 星期二, 星期三, 星期四, 星期五, 星期六, 星期天]def weekday_to_text(weekday):return weekday_mapping[weekday]class ActionQueryTime(Action):def name(self) - Text:return action_query_timedef run(self,dispatcher: CollectingDispatcher,tracker: Tracker,domain: Dict[Text, Any],) - List[Dict[Text, Any]]:current_time datetime.now().strftime(%H:%M:%S)dispatcher.utter_message(textcurrent_time)return []class ActionQueryDate(Action):def name(self) - Text:return action_query_datedef run(self,dispatcher: CollectingDispatcher,tracker: Tracker,domain: Dict[Text, Any],) - List[Dict[Text, Any]]:text_date tracker.get_slot(date) or 今天int_date text_date_to_int(text_date)if int_date is not None:delta timedelta(daysint_date)current_date datetime.now()target_date current_date deltadispatcher.utter_message(texttarget_date.strftime(%Y-%m-%d))else:dispatcher.utter_message(text系统暂不支持{}的日期查询.format(text_date))return []class ActionQueryWeekday(Action):def name(self) - Text:return action_query_weekdaydef run(self,dispatcher: CollectingDispatcher,tracker: Tracker,domain: Dict[Text, Any],) - List[Dict[Text, Any]]:text_date tracker.get_slot(date) or 今天int_date text_date_to_int(text_date)if int_date is not None:delta timedelta(daysint_date)current_date datetime.now()target_date current_date deltadispatcher.utter_message(textweekday_to_text(target_date.weekday()))else:dispatcher.utter_message(text系统暂不支持{}的星期查询.format(text_date))return []测试 rasa run actions 运行动作服务器 rasa run actions 2022-11-28 09:50:58 INFO rasa_sdk.endpoint - Starting action endpoint server... 2022-11-28 09:50:58 INFO rasa_sdk.executor - Registered function for action_query_time. 2022-11-28 09:50:58 INFO rasa_sdk.executor - Registered function for action_query_date. 2022-11-28 09:50:58 INFO rasa_sdk.executor - Registered function for action_query_weekday. 2022-11-28 09:50:58 INFO rasa_sdk.endpoint - Action endpoint is up and running on http://0.0.0.0:5055rasa trainrasa shell 2022-11-28 21:16:49 INFO root - Rasa server is up and running. Bot loaded. Type a message and press enter (use /stop to exit): Your input - 你好呀 Building prefix dict from the default dictionary ... Loading model from cache /tmp/jieba.cache Loading model cost 1.346 seconds. Prefix dict has been built successfully. 你好我是 Silly我可以帮你查询时间、日期和星期几。你可以对我说「现在几点了」、「今天几号」或者「明天星期几」。 Your input - bye 你好我是 Silly我可以帮你查询时间、日期和星期几。你可以对我说「现在几点了」、「今天几号」或者「明天星期几」。 Your input - 拜拜 再见 Your input - 现在几点 21:18:11 Your input - 今天是几号 2022-11-28 Your input - 明天是几号 2022-11-29 Your input - 后天是几号 系统暂不支持后天的日期查询 Your input - 昨天是几号 2022-11-27 Your input - 今天星期几 星期一 Your input - 明天周几 星期二 Your input - 现在几点了 2022-11-29修改 nlu里添加 - [后天](date)的日期 actions.py 添加 if text_date 后天: return 2 重新训练测试 Your input - 后天几号 2022-11-30 Your input - 后天星期几 星期三
http://www.zqtcl.cn/news/119049/

相关文章:

  • 万宁市住房和城乡建设局网站网页游戏制作过程的
  • 网站建设批复意见浏览有关小城镇建设的网站 记录
  • 做国际贸易做什么网站遵义做网站优化
  • 电商平台正在建设中网站页面提示开发手机网站用什么好
  • 电商设计素材网站推荐百度云app下载安装
  • 网站怎样和首页做链接地址百度怎么打广告在首页
  • 眉县做网站网站开发技术可行性分析
  • 深圳求职网站哪个好网站上面的在线咨询是怎么做的
  • 做饰品一般用什么网站做首饰凡客数据
  • 工业电商做网站怎么样wordpress 韩国 主题
  • 网站的优化从几个方面网站建设需注意哪些事项
  • 网站建设的技术有哪些内容东莞网站建设最优
  • 网站建设税费很多网站没有后台
  • 百度云主机上装网站flash怎么做网页
  • 外贸网站能用阿里云吗哔哩哔哩网页版打不开
  • 南宁月嫂网站建设财经直播的网站开发一个多少钱
  • 宁波网站的建设百度网盟推广 网站
  • 大连城乡建设局网站青岛网站建设外贸
  • 石家庄网站建设招聘珠海快速网站建设
  • 网站建设代理ai制作网页
  • 微网站平台怎样做网站wordpress侧栏跟随
  • 手机网站建设好吗湖南省专业建设公司网站的机构
  • 网站代码 字体好用的cms网站
  • 美食网站首页设计用手机怎么看自己做的网站
  • 平台类网站开发怎样做永久网站二维码
  • 网站开发客户挖掘php网站开发心得3500字
  • 检察院做网站的目的青岛网站推广优化
  • dede替换网站模板定制网站建设的流程
  • 天津专业网站制作网站开发模板
  • 做二手车网站需要什么怎样建立门户网站