学习笔记(10)- 智能会话框架rasa

https://rasa.com/

阿里用过这个,贝壳也在用这个。

  • 优点:
  1. 有中文版本(https://github.com/crownpku/rasa_nlu_chi);
  2. 2018年发布,文档多,业界应用多;
  3. 使用简单,pipline方式定义会话流程,“讲故事”stories.md
  4. 有数据标注工具rasa_nlu_trainer;
  5. 可以使用语义理解word2vec;
  6. 部署简单,支持docker;
  • 缺点:
    端到端的实现较弱;

创建一个虚拟环境,然后这两句话就可以创建智能会话的工程

python3 -m venv env
source env/bin/activate
pip install rasa-x --extra-index-url https://pypi.rasa.com/simple
rasa init

使用的命令:

$ rasa 
usage: rasa [-h] [--version]
            {init,run,shell,train,interactive,test,visualize,data,x} ...

Rasa command line interface. Rasa allows you to build your own conversational
assistants 🤖. The 'rasa' command allows you to easily run most common commands
like creating a new bot, training or evaluating models.

positional arguments:
  {init,run,shell,train,interactive,test,visualize,data,x}
                        Rasa commands
    init                Creates a new project, with example training data,
                        actions, and config files.
    run                 Starts a Rasa server with your trained model.
    shell               Loads your trained model and lets you talk to your
                        assistant on the command line.
    train               Trains a Rasa model using your NLU data and stories.
    interactive         Starts an interactive learning session to create new
                        training data for a Rasa model by chatting.
    test                Tests Rasa models using your test NLU data and
                        stories.
    visualize           Visualize stories.
    data                Utils for the Rasa training files.

组成部分:

基本流程:

目录结构是这样的:

自然语言理解NLU

多轮会话(控制器)

交互图

posted on 2020-01-27 11:54  宋岳庭  阅读(792)  评论(0编辑  收藏  举报