rasa_nlu 实战 处理英文
材料
pycharm
git
anaconda
https://github.com/RasaHQ/starter-pack-rasa-nlu
1、构建搭建rasa_nlu 环境,不在本地上运行
在terminal中
创建一个虚拟环境,使用python3.6
conda create -n rasa_nlu python=3.6
激活虚拟环境
conda activate rasa_nlu
2、从github上clone下来
在pycharm上配置解释器
file/setting中找到conda envirement
选择existing envirment
在目录中选择刚刚构建的虚拟环境
3、安装依赖包
pip install -r requirments.txt
requirments中tensorflow的版本信息不对,把tensorflow的版本信息去掉再安装
4、因为pipeline选择的是spacy,所以要安装spacy 模型
python -m spacy download en
5、训练模型
make train-nlu
默认训练的是文件data中的 .md文件
模型默认保存在current文件夹中
6、测试模型,命令行启动服务器
make run-nlu
重新开一个terminal
curl -X POST localhost:5000/parse -d '{"query":"Hello", "project": "current"}'
即可获取结果
最简单的处理英文的rasa-nlu即搭建完成了
大概只包含5个intent
到开源社区clone 包含其他intent的.md文件到data文件夹中重新训练模型
可提高智商(玩笑)