项目简介
本项目借助RASA框架开发了一款中文聊天机器人,运用自然语言处理(NLP)技术达成智能对话交互。其目标是通过简便的安装与配置,为用户营造智能、便捷且友好的聊天体验。
项目的主要特性和功能
- 智能化对话:利用RASA框架的NLU(自然语言理解)模块,理解用户输入并给出对应响应。
- 多渠道支持:支持Web、命令行等多种渠道与机器人进行交互。
- 丰富的功能:具备天气查询、身份查询等实用功能,满足用户多样化需求。
- 可扩展性:可通过添加新的意图和响应来拓展机器人功能。
安装使用步骤
假设用户已下载本项目的源码文件,按照以下步骤操作:
1. 环境准备
- 安装Python 3.6及以上版本。
- 安装依赖库:
shell pip install -U rasa pip install rasa[mitie] pip install jieba
2. 数据准备
- 下载MITIE中文词向量模型total_word_feature_extractor_zh.dat,并放置在项目目录下。
- 准备训练模型所需的数据样本和配置文件。
3. 模型训练
- 使用MITIE训练模型:
shell python -m rasa train --config configs/config.yml --domain configs/domain.yml --data data/
- 使用Supervised_Embedding训练模型:
shell python -m rasa train --config configs/zh_jieba_supervised_embeddings_config.yml --domain configs/domain.yml --data data/
- 使用MITIE+Supervised_Embedding训练模型:
shell python -m rasa train --config configs/zh_jieba_mitie_embeddings_config.yml --domain configs/domain.yml --data data/
4. 启动服务
- 启动Rasa服务:
shell python -m rasa run --port 5005 --endpoints configs/endpoints.yml --credentials configs/credentials.yml --debug
- 启动Action服务:
shell python -m rasa run actions --port 5055 --actions actions --debug
- 启动server.py服务:
shell python server.py
5. 访问测试
- 通过浏览器访问:
http://127.0.0.1:8088/ai?content=查询广州明天的天气
License
``` Copyright 2020 Jiangdongguo
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ```
下载地址
点击下载 【提取码: 4003】【解压密码: www.makuang.net】