Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
使用深度学习方法解析问题 知识图谱存储 查询知识点 基于医疗垂直领域的对话系统
| Date | Stars |
|---|---|
| 2026-07-31 | 794 |
| 2026-08-02 | 793 |
| 2026-08-06 | 793 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
It is indeed a luxury to keep human reason forever. by Moss, a robot of the film The Wandering Earth
“让人类永远保持理智,确实是一种奢求” ,机器人莫斯,《流浪地球》
<p align="center">
<img src=./pictures/show_talk.gif alt="Sample" width="700">
<p align="center">
<em> </em>
</p>
</p>
+ [0.项目概况](#项目概况)
+ [1.基础数据爬取](#基础数据爬取)
+ [2.知识图谱搭建](#知识图谱搭建)
+ [3.自动问答实现](#自动问答实现)
+ [数据准备](#数据准备)
+ [词向量训练](#词向量训练)
+ [医疗命名实体识别](#医疗命名实体识别)
+ [嵌入层](#嵌入层)
+ [BiLSTM层](#句子输入到BiLSTM层)
+ [CRF层](#CRF层)
+ [损失函数及反向传播](#损失函数及反向传播)
+ [网络结构与超参数](#循环网络结构与超参数)
+ [用户意图识别](#用户意图识别)
+ [数据嵌入人工特征](#数据嵌入人工特征)
+ [模型选择](#模型选择)
+ [嵌入层](#嵌入层)
+ [卷积层](#卷积层)
+ [池化层](#池化层)
+ [全连接及SoftMax层](#全连接及SoftMax分类层)
+ [网络结构与超参数](#卷积网络结构与超参数)
+ [参考资料](#参考资料)
### 项目概况
本项目为一个使用深度学习方法解析问题,知识图谱存储、查询知识点,基于医疗垂直领域的对话系统的后台程序
+ 运行效果:
<p align="center">
<img src=./pictures/082601.png alt="Sample" width="700">
<p align="center">
<em> </em>
</p>
</p>
+ 项目的搭建大致分为三个模块:
+ 基础数据爬取
+ 知识图谱构建
+ 自动问答实现
+ 项目运行环境:
python :
```
python 3.6.8
```
运行系统:
```
ubuntu 16.04
```
知识图谱:
```
neo4j 3.2.2 图形数据库
py2neo 3.1.1 neo4j对应的python驱动
```
深度学习:
```
jieba 0.39
numpy 1.17.0
pandas 0.25.0
tensorflow 1.10.0
```
文本匹配:
```
ahocorasick (安装方法 pip install pyahocorasick)
```
必要说明:
```
1.深度学习模块深度网络的训练使用tensorflow的gpu版本,
在应用阶段由于要部署要服务器上使用的对应的tensorflow的cpu版本
2.若要clone项目,尽量保持扩展包的版本一致
```
+ 项目运行方式
1. 搭建知识图谱:python build_grapy.py。大概几个小时,耐心等待。
2. 启动问答系统:python chatbot_graph.py
+ 项目主要文件目录结构
```shell
chatbot
├── answer_search.py # 问题查询及返回
├── BiLSTM_CRF.py # 实体识别的双向LSTM-CRF网络
├── build_medicalgraph.py # 将结构化json数据导入neo4j
├── chatbot_graph.py # 问答程序脚本
├── classifyApp.py # 问句分类应用脚本
├── classifyUtils.py # 工具函数集合
├── data
│ └── medical.json # 全科知识数据
├── data_ai
│ ├── cbowData # 词向量文件
│ │ ├── classifyDocument.txt.ebd.npy # 词向量查找表
│ │ ├── classifyDocument.txt.vab # 词向量中词与索引对照表
│ │ ├── document.txt.ebd.npy
│ │ └── document.txt.vab
│ ├── classifyData # 问句分类训练数据
│ │ ├── test_data.txt
│ │ └── train_data.txt
│ ├── classifyModel # 问句分类模型
│ │ ├── checkpoint
│ │ ├── model-3500.data-00000-of-00001
│ │ ├── model-3500.index
│ │ └── model-3500.meta
│ ├── nerData
│ └── nerModel # 命名实体识别模型
├── dict # 实体数据文件
├── nerApp.py # 命名实体识别应用脚本
├── nerUtils.py # 工具函数集合
├── prepare_data
│ ├── build_data.py # 数据库操作脚本
│ ├── data_spider.py # 数据采集脚本
│ └── max_cut.py # 基于词典的最大前向/后向匹配
├── question_analysis.py # 问句类型分类脚本
├── question_parser.py # 回答生成脚本
└── text_cnn.py # 文本分类的cnn网络
```
### 基础数据爬取
基础数据爬取于[寻医问药](<http://www.xywy.com/>)网站,一家医疗信息提供平台,上面的数据做了较好的分类处理,爬下来后可以较为方便的保存为json格式的结构化文件,格式展示如下:
<p align="center">
<img src=./pictures/json_show.gif alt="Sample" width="700">
<p align="center">
<em> 爬取的数据保存为json格式文件 </em>
</p>
</p>
### 知识图谱搭建
知识图谱可以用若干三元组来表示,三元组的基本形式:
+ 实体1-关系-实体2
+ 实体-属性-属性值
将爬取的数据调用`build_medicalgraph.py `脚本将结构化json数据导入neo4j图数据库,部分数据库展示如下:
<p align="center">
<img src=./pictures/graph.svg alt="Sample" width="800">
<p align="center">
<em> 图形数据库部分展示 </em>
</p>
</p>
知识图谱实体类型
| 实体类型 | 中文含义 | 实体数量 | 举例 |
| :--------- | :----------: | :------: | :------------------------------------- |
| Check | 诊断检查项目 | 3,353 | 支气管造影;关节镜检查 |
| Department | 医疗科目 | 54 | 整形美容科;烧伤科 |
| Disease Excerpt of 14,525 characters
Read on GitHub24
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:c1dc211f3676dc4e, name:knowledge graph
matched fp:c1dc211f3676dc4e, name:chatbot