GithubHelp home page GithubHelp logo

rasa_chatbot_cn's Introduction

Rasa Core and Rasa NLU

rasa对话系统系列文章

Introduction

五月份rasa官方发布了release版本,做了比较大的改动。介于此,rasa_chatbot_cn这个demo也做出相对应的更新,更新到master分支上。之前基于0.13的版本在0.13.x分支上,你可以自由切换。新版本中将命令行做的十分简便,具体命令如下。

edit at 2019.06.24 将之前的rasa-nlu-gao进行了修改,以支持新版本的rasa,而且不再在源码里进行修改。首先需要pip install rasa-nlu-gao>=0.3.1,具体用法如下。

Command

install packages

  • python >= 3.5
pip install -r requirements.txt

下载依赖package

train model

make train

训练nlu和core模型,新版本中会将模型自动打包成zip文件

run model

make run

test in cmdline

make run-cmdline

可以在命令行中测试

test by http server

http://localhost:5005/webhooks/rest/webhook post请求,请求参数例如:

{
    "sender": "0001",
    "message": "你好"
}

可以使用postman去请求调用

Some magical functions

之前在rasa-nlu-gao增加了若干个自定义组件。而在release版本中可以直接将组建在外部调用,比如这里我举个之前的JiebaPsegExtractor component的栗子,直接将该组建放在components下面,在config.yml中:

- name: "components.extractors.jieba_pseg_extractor.JiebaPsegExtractor"
  part_of_speech: ["nr"]

这样就ok了,后续我会考虑将rasa-nlu-gao重新修改下。

[edit 2019.06.24] 继续上次所说的对rasa-nlu-gao进行修改,现在可以直接使用原来rasa-nlu-gao里面的组件。

  • 首先pip install rasa-nlu-gao>=0.3.1
  • 下面只需要在config.yml中配置:
- name: "rasa_nlu_gao.extractors.jieba_pseg_extractor.JiebaPsegExtractor"
  part_of_speech: ["nr"]

其他组件也是这样用,具体可参照README.md。 而如果是你自己的组件可以放到components里面,如果你想做贡献,欢迎fork rasa-nlu-gao,并提交pr。

use rasa x

rasa新版本中,增加了rasa x这个功能。这里也做了尝试,感觉挺方便。

install rasa x

pip install rasa-x --extra-index-url https://pypi.rasa.com/simple

下载rasa-x package

use rasa x

make run-x

没错就是这么简单。Have a fun!

some problems

Q: 为什么我会报couldn't find component...这个错?

A: rasa使用了importlib动态加载自定义component和policy。这个错误的原因是你没有将component和policy的目录append到PYTHONPATH里面。你需要export PYTHONPATH=/path/to/your/component

rasa_chatbot_cn's People

Contributors

carlos9310 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.