Rasa是一个不错的开源bot工具,全部基于python实现,主页是https://rasa-nlu.readthedocs.io/en/latest/index.html

本节是关于工具安装和初步运行的记录。

根据其文档进行安装,我选择的安装方式是:

git clone git@github.com:RasaHQ/rasa_nlu.git
cd rasa_nlu
pip install -r requirements.txt
python setup.py install

后端我选择的是“spaCy + sklearn”, 其中提示我需要安装sklearn-crfsuite。

然后当我安装这个工具时,又是各种与当前环境不匹配或找不到可用版本,最后通过以下方式解决了。

conda install -c conda-forge python-crfsuite=0.9.2

最后是在Ipython中针对自带的例子“ata\examples\rasa\demo-rasa.json”进行模型训练:

In [2]: run  rasa_nlu/train.py   -c config_spacy.json
INFO:rasa_nlu.utils.spacy_utils:Trying to load spacy model with name 'en'
INFO:rasa_nlu.components:Added 'nlp_spacy' to component cache. Key 'nlp_spacy-en'.
INFO:rasa_nlu.converters:Training data format at ./data/examples/rasa/demo-rasa.json is rasa_nlu
INFO:rasa_nlu.training_data:Training data stats:
        - intent examples: 40 (4 distinct intents)
        - found intents: 'affirm', 'goodbye', 'greet', 'restaurant_search'
        - entity examples: 9 (2 distinct entities)
        - found entities: 'cuisine', 'location'
INFO:rasa_nlu.model:Starting to train component nlp_spacy
INFO:rasa_nlu.model:Finished training component.
INFO:rasa_nlu.model:Starting to train component ner_crf
INFO:rasa_nlu.model:Finished training component.
INFO:rasa_nlu.model:Starting to train component ner_synonyms
INFO:rasa_nlu.model:Finished training component.
INFO:rasa_nlu.model:Starting to train component intent_featurizer_spacy
INFO:rasa_nlu.model:Finished training component.
INFO:rasa_nlu.model:Starting to train component intent_classifier_sklearn
Fitting 2 folds for each of 6 candidates, totalling 12 fits
[Parallel(n_jobs=1)]: Done  12 out of  12 | elapsed:    0.0s finished
INFO:rasa_nlu.model:Finished training component.
INFO:rasa_nlu.model:Successfully saved model into 'D:\Work\NLP\Task\Rasa\workspace\models\model_20170709-153926'
INFO:__main__:Finished training

针对以上得到的模型,进行预测的代码如下:

from rasa_nlu.model import Metadata, Interpreter
from rasa_nlu.config import RasaNLUConfig
metadata = Metadata.load('models/model_20170709-153926')   # where model_directory points to the folder the model is persisted in
interpreter = Interpreter.load(metadata, RasaNLUConfig("config_spacy.json"))
interpreter.parse(u"I am looking for Chinese food")

Out[9]:
{'entities': [],
 'intent': {'confidence': 0.7729154931115908, 'name': 'restaurant_search'},
 'intent_ranking': [{'confidence': 0.7729154931115908,
   'name': 'restaurant_search'},
  {'confidence': 0.093570000080283558, 'name': 'goodbye'},
  {'confidence': 0.093241162858677284, 'name': 'greet'},
  {'confidence': 0.040273343949448648, 'name': 'affirm'}],
 'text': 'I am looking for Chinese food'}

开源bot工具Rasa学习---1相关推荐

  1. 清华「计图」、旷视「天元」纷纷重磅开源,国产深度学习框架迎来高光时刻...

    来源:CSDN 本文约3141字,建议阅读7分钟. 本文介绍清华开源的深度学习框架 Jittor(计图) 引起了广泛关注,支撑旷视诸多业务和战绩的深度学习框架 MegEngine(天元) 也将在近日开 ...

  2. 6款实用开源报表工具 | 码云周刊第 83 期

    大数据时代,从海量数据中挖掘出有用的数据,并以较人性化.直观的方式展示这些数据,变得尤为重要.今天小编为大家介绍6款实用的开源报表工具,你可以使用这些工具做出高效,且符合企业需求的报表. 1.项目名称 ...

  3. python 持续集成工具_持续集成工具: Jenkins学习

    持续集成工具: Jenkins学习 -- 部分内容收集自网络,如有侵权,请联系作者删除 一. 概念 在过去的开发整体流程中,是所有人写好代码之后统一进行合并(svn,git),然后进行测试,确保准发布 ...

  4. 华为开源构建工具_为什么我构建了用于大数据测试和质量控制的开源工具

    华为开源构建工具 I've developed an open-source data testing and a quality tool called data-flare. It aims to ...

  5. 分享11款主流的开源编程工具

    导读:有了开源编程工具,在基于开源许可证的情况下您可以轻松学习.修改.提高代码的质量,本文收集了11款最主流的且有价值的开源编程工具.或许会给您带来一丝惊喜.一起来看下吧. NO.1 Rhomobil ...

  6. 开源性能测试工具 - Apache ab 介绍

    开源性能测试工具 - Apache ab 介绍 简介 ab的全称是ApacheBench,是 Apache 附带的一个小工具,专门用于 HTTP Server 的benchmark testing,可 ...

  7. 开源开发工具_3个开源行为驱动的开发工具

    开源开发工具 行为驱动开发 (BDD)似乎非常容易. 测试以易于阅读的格式编写,允许产品所有者,业务赞助商和开发人员提供反馈. 这些测试是您团队的有效文档,因此您不需要任何要求. 这些工具易于使用,可 ...

  8. 华为开源构建工具_5个开源工具可快速构建地图应用

    华为开源构建工具 近年来,地理信息系统(GIS)引起的所有关注都可能使您认为它们是新事物. 实际上,超过160年前,地理空间数据在确定1854年伦敦霍乱致命爆发的来源方面发挥了重要作用. 当地医生约翰 ...

  9. sql如何取前几行_重磅!蚂蚁金服开源机器学习工具SQLFlow,机器学习比SQL还简单...

    开源最前线(ID:OpenSourceTop) 猿妹整编 综合自:AI前线.https://github.com/sql-machine-learning/sqlflow 5月6日,蚂蚁金服副 CTO ...

最新文章

  1. mongodb 安装时错误
  2. linux的阻塞waitqueue,Linux阻塞控制 wait_event与wait_event_interruptible函数详解
  3. Run service in specified proxyPort via jettyrun
  4. android 隐藏键盘时ui延迟恢复,android 软键盘的显示与隐藏问题的研究
  5. 画股票图csdn_这个股票今天是要弄啥?
  6. js ---- 对象去重
  7. jquery监听html状态,jquery监听页面刷新
  8. GPS时钟装置,北斗卫星授时,ntp校时服务器,网络时间服务器
  9. 51单片机开发工具安装
  10. C语言函数库之字符串连接函数(string.h)
  11. 事物的开始和结束命令分别是什么_5. 详解Redis中的事务
  12. golang 求差集和并集算法
  13. 青岛科技大学计算机一级报名,2019年3月山东青岛科技大学计算机等级考试报名通知...
  14. 《数字图像处理》-(3)-1从傅里叶级数到傅里叶变换详细推导以及傅里叶图像的性质
  15. TOEFL wordlist 28
  16. 做单:第3章 骂人的客户
  17. python连接sap接口_基于Python的SAP流程自动化
  18. Java中的七种设计原则
  19. putty连接虚拟机服务器,SSH:putty通过SSH连接固定IP的虚拟机
  20. ubuntu安装网易云音乐 打不开, 或者不想使用root权限打开 尝试思路

热门文章

  1. IOS 中的XML解析
  2. java容量_java中常用集合类的容量
  3. 大数据开发笔记(四):Hive分区详解
  4. 数据安全治理面临哪些挑战
  5. 大数据该如何运行与分析
  6. 排队论模型的monteCarlo法仿真
  7. 计算相同维度向量之间的欧氏距离
  8. oracle中ccuser,oracle数据库user profile设置方法
  9. 字节跳动面试经验 php,双指针算法:字节跳动初级面试题 PHP
  10. 计算机专业评定职称论文,《计算机职称论文.doc