Giter VIP home page Giter VIP logo

qa-public's Introduction

数仓与ETL问答机器人

李军利 / 2019-01-10 分类:编程,算法,NLP,问答机器人 关键词:智能问答,分词,关键词匹配,相似度,Flask, Gunicorn

项目背景

​ 回答数仓与ETL群里的问题占用开发人员大量的时间,构建的常见问题文档篇幅又过大,群里问题还是应接不暇,公司已有的自动问答系统专业性不够强,需要做一个适用的自动问答系统。问答数据的处理与算法都是用Python,而且智能问答系统仅供内部使用,并发量不是很大,所以服务端直接采用 Python 的 Flask 框架构建,生产环境里使用Gunicorn启多进程。常见问题的数据量用深度学习不足以训练出非常好的算法,问题的专业性又很强,所以关键词匹配算法是一个简单合适的选择。

代码目录结构

jdd-etl-qa-produce/                # 工程根目录
├── bin/                           # 可执行命令目录
|   ├─ start.sh                    # 启动脚本
|   ├─ stop.sh                     # 停止脚本
|   └─ env.sh                      # 安装环境
├── static/                        # 前端目录
|   ├─ css
|   ├─ js
|   └─ ...
├── docs/api.md                    # 接口文档
├── jdd_etl_qa/                    # 模块根目录
|   ├─ conf/                       # 日志目录
|   |   ├─ __init__.py
|   |   ├─ log.conf                # 日志参数
|   |   ├─ read_logger.py          # 打印日志
|   |   └─ ...
|   ├─ core/                       # 模型代码根目录
|   |   ├─ __init__.py
|   |   ├─ qa_system.py            # 计算问题相似度
|   |   └─ ...
|   ├─ data/                       # 数据根目录
|   |   ├─ qa_data                 # 本地数据根目录
|   |   |   ├─ customise.txt       # 自定义专业词语
|   |   |   ├─ Question_list.txt   # 历史问题列表
|   |   |   ├─ Superword_list.txt  # 重要词汇列表
|   |   |   ├─ QA_dict.json        # 历史问答对字典
|   |   |   ├─ question_key.json   # 历史问题及关键词字典
|   |   ├─ __init__.py
|   |   ├─ read_local_data.py      # 读入本地数据
|   ├─ model/model_resource.py     # 回答post过来的问题
|   ├─ validation/                 # 校验json格式包 
├── .gitignore                     # Git Ignore 文件
├── main.py                        # 主程序代码
├── README.md                      # 说明文件
└── requirements.txt               # 依赖包列表

数据准备

​ 下载群历史聊天记录,将聊天数据结构化,提取有用问答对及关键词,以列表和字典形式存储问答数据

算法

​ 给予关键词不同的权重,问题分词,关键词匹配算法计算相似度,输出答案

推荐工具

​ 此算法可能适用于其他很多特定领域的自动问答,如果读者(尤其是像我这样的学生)有兴趣,使用自己的笔记本电脑就能模拟自动问答系统,代码和数据涉及公司机密,就不分享了,下面是给学生党推荐的一些工具:

Pycharm: 功能强大的Python IDE,与Github关联方便,可以连通Anaconda的包,免去下载包的麻烦

Postman: 伪装post请求,测试模型,用于Google浏览器,Firefox用户可使用RESTClient插件

VirtualBox: 比VMvare player小巧灵活,系统安装CentOS-Minimal版本即可

FindShell: 界面比虚拟机更加友好,方便系统之间互传文件,相比Xshell,最大优势是免费

qa-public's People

Contributors

ai-friend 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.