Coder Social home page Coder Social logo

bob329 / rasa_ch_faq Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dustyposa/rasa_ch_faq

0.0 0.0 0.0 245 KB

用 rasa 实现 rasa demo 机器人,有一些惊奇的功能,faq,图谱,多轮等

License: MIT License

Python 98.86% Dockerfile 1.14%

rasa_ch_faq's Introduction

rasa_ch_bot

RASA 实现 RASA Bot 后端。 能够回答关于 RASA 的问题,以及一些例子。 欢迎大家多提 RASA 相关的问题,或者想看的示例,我会补充在这里。

前端地址: 这里

功能更新

  • [2021-06-24] 增加知图谱的接入(放在GRAPH分支了)
  • [2021-06-01] 增加文本纠错 pipeline (由于 demo 较慢,默认未开启,如何开启?)
  • [2021-05-13] 增加按钮 demo
  • [2021-05-11] 支持查看 BTC 行情
  • [2021-05-08] 支持 吸猫\狗\狐狸。支持 根据图片搜索动漫出处。
  • [2021-05-06] 支持 找饭店 demo。
  • [2021-04-13] 实现追问demo,实现细节

部分功能展示

FAQ

grtKwF.gif

天气查询及BTC查询功能

grtGS1.gif

吸动物

grt2m8.gif

搜动漫

grtUeO.gif

知识图谱

RQE8gA.gif

支持的问题列表

请参见: 问题列举

一些配置

分词使用的 bert, 自定义了 tokenizers

如何运行

由于使用了 bert_chinese, 所以 需要下载 bert_chinese 模型。 并放到 pre_models 文件夹中,重命名为 tf_model.h5 命令执行:

curl -L https://mirror.tuna.tsinghua.edu.cn/hugging-face-models/bert-base-chinese-tf_model.h5 -o pre_models/tf_model.h5
rasa train

一些文件说明

run.py  # 相当于运行 rasa run
train.py  # == rasa train
run_action_server.py  # == rasa run actions
load_model.py   # 直接加载并运行模型,与 server 无关。(需要先训练好一个模型) 

一些工具

back_translation.py  # 回译脚本
# 使用方式
python back_translation.py 需要回译的文本

从零开始搭建机器人

1. 下载项目并进入

git clone https://github.com/Dustyposa/rasa_ch_faq.git 
cd rasa_ch_faq

2. 安装依赖

pip install -r requirements.txt
curl -L https://mirror.tuna.tsinghua.edu.cn/hugging-face-models/bert-base-chinese-tf_model.h5 -o pre_models/tf_model.h5
rasa train

ps: 注意 python 版本 37+

3. 训练模型

rasa train

4. 运行机器人

需要开两个 shell/iterm 第一个:

rasa shell

第二个:

rasa run actions

然后就可以在第一个 shell 窗口对话了

从 1 开始搭建机器人

这个是干啥的?如果第一个你已经会了,我们加点前端展示的,效果参看这里

1. 下载前端项目并进入

git clone -#-depth 1 https://github.com/Dustyposa/rasa_bot_front
cd rasa_bot_front

2. 启动前端

参照文档

3. 启动 rasa

同样是两个 shell/iterm,第一个命令稍有不同:

rasa run --cors "*"

第二个:

rasa run actions

rasa_ch_faq's People

Contributors

dustyposa 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.