Coder Social home page Coder Social logo

charlesxu86 / chatbot_cn Goto Github PK

View Code? Open in Web Editor NEW
1.3K 46.0 431.0 2.26 MB

基于金融-司法领域(兼有闲聊性质)的聊天机器人,其中的主要模块有信息抽取、NLU、NLG、知识图谱等,并且利用Django整合了前端展示,目前已经封装了nlp和kg的restful接口

License: Apache License 2.0

deep-learning chatbot-cn tenserflow-serving intent-detection django-restful reinforcement-learning knowledge-graph slot-filling dialogue-systems ir

chatbot_cn's Introduction

Chatbot_CN

基于深度学习、强化学习、对话引擎的多场景对话机器人

GitHub stars GitHub forks GitHub issues GitHub license

项目说明项目结构项目演示各模块详细介绍使用说明Update NewsFAQ参考Blog

Made by Xu • 🌐 https://www.chatbotcn.com

项目说明

    Chatbot_CN 是一个基于第三代对话系统的多轮对话机器人项目,旨在于开发一个结合规则系统、深度学习、强化学习、知识图谱、多轮对话策略管理的 聊天机器人,目前随着时间的慢慢发展,从最初的一个 Chatbot_CN 项目,发展成了一个 Chatbot_* 的多个项目。目前已经包含了在多轮任务型对话的场景中,基于话术(Story)、知识图谱(K-G)、端到端对话(E2E)。目的是为了实现一个可以快速切换场景、对话灵活的任务型机器人。 同时,Chatbot_CN 不仅仅是一个对话系统,而是一套针对客服场景下的完整人工智能解决方案。对话是解决方案的核心和最重要一环,但不仅限于对话,还包括智能决策,智能调度,智能预测,智能推荐等

    目前Chatbot_CN 已经拆分成了13个子项目,涵盖了对话数据收集处理、基本算法模型、对话引擎、对话质量评估,第三方平台快速接入、数据回流、模型优化等等。主要可以分为:

1、数据层:对话业务数据,开源多轮对话数据等

2、算法层:句法分析、细粒度情感分析、实体抽取、query纠错等
                                            
3、能力层:自然语言理解、对话管理、对话策略、策略优化、对话工厂

4、应用层:网页端、钉钉群机器人、微信公众号、第三方平台(如拼夕夕)等

5、硬件接入:可接入作为智能语音助手,目前已经加入语音助手模块,可接入树莓派、单片机等硬件

项目的大致流程如下图:

注:

1、图中的虚线部分为文本机器人部分

2、具体的项目结构请参考项目结构和各模块详细说明。

3、Chatbot_CN 系列项目还存在不少细节问题,正在慢慢完善中。

项目思维导图

项目结构

1. Chatbot_CN整体架构

2. 各子模块介绍

当你熟悉了项目的整体架构后,你还需要对其各个子模块进行详细的了解,这样你才能对机器人的机制有一个深刻的理解
Chatbot_CN总体项目介绍,包含文档(这里不包含代码)
chatbot_kg知识图谱模块、关系网络、实体连接、知识推理等
Chatbot_S2S训练端到端的对话模型,目前这个模块只为了项目的完整,作用不大,不过这个是一个研究方向
chatbot_utils机器人的基本算法组件,比如query纠错、实体识别等,他是机器人的基础
Chatbot_RASA机器人的核心对话引擎,基于RASA开源框架
Chatbot_DocNLP和对话系统的一些文献、收集的文章等等
Chatbot_Data机器人的一些语料收集
Chatbot_Crawler爬虫
chatbot_retrieval基于检索的对话模型,他在机器人无法处理用户意图时发挥重要作用
Chatbot_Evaluate对话质量评估、评价、对话诊断、数据回流模块,对话模型优化
Chatbot_Help一个将机器人接入第三方平台的工具、如钉钉群、微信公众号等,可快速实现工程化
Chatbot_Recommendation对话系统与推荐系统结合,目前正在规划中、暂未开始
Chatbot_Web机器人的简单pc端页面交互,可以实现快速体验机器人效果
Chatbot_Voice聊天机器人的语音交互模块
Chatbot_Analytics聊天机器人的数据分析模块

如果想了解更多详细的细节说明,请参考以下网站(详细文档):

www.chatbotcn.top

项目演示

各模块介绍

1、chatbot_utils

    该模块为基本算法组件,同时也提供了restful API接口,其中包括的功能有:

1、文本纠错,可以纠正用户query的错别字等,同时还可以纠正部分由于ASR和OCR识别出的错误,用到的主要技术为:字音字形特征提取、微调bert mlm

2、实体识别,可以识别出用户query中提及的实体信息,如:人名、机构名、快递公司、时间、地址等等

3、句法分析,基于转移的句法分析

4、指代消解。

5、其他功能后续继续更新
2、chatbot_retrieval

    检索式单论对话问答(FAQ),主要用到的技术为词权重、倒排索引、bert finetune。实现原理为Q-Q相似度匹配。该模块主要可以解决两类问题:

1、FAQ

2、在多轮对话过程中,意图未匹配情况下检索出最佳答案
3、Chatbot_Skills

    任务型多轮对话的技能管理模块,当我们的机器人"学习"到了多种技能的时候,在对话的过程中可能会出现技能的交叉,即在任务A还没完成的时候跳转到任务B。

Chatbot_Skills旨在完成多种任务的平滑切换和机器人的技能初始化配置。

4、Chatbot_Recommendation

    将推荐系统和任务型对话结合

使用说明

Start

在启动服务之前,你需要比较熟悉整个项目的架构,项目的各模块依赖关系如下图:

Update News

*  2019.10    添加 Chatbot_RASA 子项目
*  2019.10    添加 Chatbot_NLU 子项目
*  2019.10    添加 Chatbot_DM 子项目
*  2019.11    添加 Chatbot_Retrieval 子项目
*  2019.12    添加 Chatbot_Utils 子项目
*  2019.12    添加 Chatbot_Help 子项目
*  2020.1     移除项目里的Chatbot_Web模块,添加 Chatbot_Web 子项目,从2020.1.20日开始, Chatbot_CN 不再做工程项目使用,只是该项目的说明
*  2020.1     将机器人接入钉钉群,实现用户交互
*  2020.3     添加对话技能管理模块
*  2020.4     添加爬虫模块(基于scrapy框架)
*  2020.5     添加语音助手模块 Chatbot_Voice
*  2020.5     在对话模型中加入 【AutoDL + 模型压缩 + MLflow】技术
*  2020.6     引入Botfront,此项目可以代替以前的Chatbot_Web项目,同时Botfront还可以对模型、意图等进行管理
*  2020.6     开始制定对RASA整体进行二次开发(DeepChatbot),DeepChatbot在rasa的基础上引入更多内容,包括集成AutoDL、模型加速(教师-学生模型等)、
              增加了机器人训练数据的读取方式、DST优化、更加丰富的接口等等  
*  2020.7     增加了机器人分析模块
*  2021.7     增加呼叫中心模块

FAQ

1、目前这个工程比较完备了,但是很多细节需要完善,也正在积极开发维护,如果你有什么新的idea,欢迎联系我: 997562867

2、如果你也是一个NLPER,或者对对话系统的开发感兴趣,欢迎加入群聊 聊天机器人开发实战,一起讨论技术: 群号: 718607564

3、欢迎关注知乎专栏`聊天机器人开发实战`

4、有不少人反应整个系统的代码不能启动、Chatbot_CN怎么没有代码,我还是希望读者可以把上述文档好好看一下,对整个机器人的运行流程有个整体的
思路。

5、目前正在做产品级重构

参考

1、RASA demo
2、bert as service
3、Botfront
4、RasaTalk
5、Dashbot

chatbot_cn's People

Contributors

charlesxu86 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chatbot_cn's Issues

failed to run server: mongo ServerSelectionTimeoutError

when I use 'python manage.py runserver 192.168.110.8:8000', the error occurs:

File "/home1/liuxin/task1/Chatbot_CN/Chatbot_KG/util/mongo_model.py", line 40, in find_MONGO_one
datas = collection.find_one({'judgementId':ids})
File "/home1/liuxin/anaconda3/envs/py36/lib/python3.6/site-packages/pymongo/collection.py", line 1262, in find_one
for result in cursor.limit(-1):
File "/home1/liuxin/anaconda3/envs/py36/lib/python3.6/site-packages/pymongo/cursor.py", line 1189, in next
if len(self.__data) or self._refresh():
File "/home1/liuxin/anaconda3/envs/py36/lib/python3.6/site-packages/pymongo/cursor.py", line 1087, in _refresh
self.__session = self.__collection.database.client._ensure_session()
File "/home1/liuxin/anaconda3/envs/py36/lib/python3.6/site-packages/pymongo/mongo_client.py", line 1563, in _ensure_session
return self.__start_session(True, causal_consistency=False)
File "/home1/liuxin/anaconda3/envs/py36/lib/python3.6/site-packages/pymongo/mongo_client.py", line 1516, in __start_session
server_session = self._get_server_session()
File "/home1/liuxin/anaconda3/envs/py36/lib/python3.6/site-packages/pymongo/mongo_client.py", line 1549, in _get_server_session
return self._topology.get_server_session()
File "/home1/liuxin/anaconda3/envs/py36/lib/python3.6/site-packages/pymongo/topology.py", line 427, in get_server_session
None)
File "/home1/liuxin/anaconda3/envs/py36/lib/python3.6/site-packages/pymongo/topology.py", line 199, in _select_servers_loop
self._error_message(selector))
pymongo.errors.ServerSelectionTimeoutError: 10.0.0.8:27017: timed out

缺少配置文件

你好,在执行python main.py的时候, 发现github给出的代码里面没有params.ini这个文件

该项目被废除了?

你好!请问该项目已经被废除了吗?没有看到任何的代码和相关说明,网站也没有了。

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.