Skip to content

Commit 082fa7a

Browse files
add readme
1 parent 00f11dd commit 082fa7a

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed

ReadMe.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# 基于深度学习的自然语言处理库
2+
3+
本项目是对[DeepNLP](https://github.com/supercoderhawk/DeepNLP)的重构,着重增强架构设计的合理性,提高代码的可读性,减少模块的耦合度,并增加一些新功能。
4+
5+
## 环境
6+
7+
* `python >= 3.5`
8+
* `tensorflow >= 1.3.0`
9+
10+
## 项目结构
11+
本项目的核心代码位于`python\dnlp`目录下
12+
13+
```bash
14+
python/dnlp
15+
│ cws.py # 分词
16+
│ ner.py # 命名实体识别
17+
│ rel_extract.py # 关系抽取
18+
│ __init__.py
19+
20+
├─config
21+
│ config.py # 配置项
22+
│ __init__.py
23+
24+
├─core # 核心功能模块
25+
│ │ dnn_crf.py # 基于dnn-crf的序列标注
26+
│ │ dnn_crf_base.py # 基于dnn-crf的序列标注的基类
27+
│ │ mmtnn.py # max-margin tensor nural network模型
28+
│ │ re_cnn.py # 基于cnn的关系抽取
29+
│ │ __init__.py
30+
31+
├─data_process # 训练和测试数据的预处理
32+
│ processor.py # 基类
33+
│ process_cws.py # 对分词的预处理
34+
│ process_emr.py
35+
│ process_ner.py # 对命名实体识别的预处理
36+
│ process_pos.py # 对词性标注的预处理
37+
│ __init__.py
38+
39+
40+
├─models # 保存训练后的模型
41+
42+
├─tests # 单元测试
43+
├─utils # 公用函数
44+
constant.py # 一些常量
45+
__init__.py
46+
47+
```
48+
49+
* `python\init_datasets.py`:初始化训练数据
50+
* `python\runner\cws_ner.py`:进行分词和命名实体识别的训练和使用
51+
52+
## 运行
53+
54+
1. 初始化数据
55+
56+
```bash
57+
python python\init_datasets.py
58+
```
59+
60+
2. 训练
61+
```bash
62+
python dnlp\runner\cws_new.py -t
63+
```
64+
65+
3. 使用
66+
```bash
67+
python dnlp\runner\cws_new.py -p
68+
```
69+
## 参考论文
70+
71+
### 中文分词 && 命名实体识别
72+
* [deep learning for chinese word segmentation and pos tagging](www.aclweb.org/anthology/D13-1061) (完全实现,文件[`dnn_crf.py`](https://github.com/supercoderhawk/DeepLearning_NLP/blob/master/python/dnlp/core/dnn_crf.py)
73+
* [Long Short-Term Memory Neural Networks for Chinese Word Segmentation](http://www.emnlp2015.org/proceedings/EMNLP/pdf/EMNLP141.pdf) (完全实现,文件[`dnn_crf.py`](https://github.com/supercoderhawk/DeepLearning_NLP/blob/master/python/dnlp/core/dnn_crf.py))
74+
* [Max-Margin Tensor Neural Network for Chinese Word Segmentation](www.aclweb.org/anthology/P14-1028) (待实现,文件[`mmtnn.py`](https://github.com/supercoderhawk/DeepLearning_NLP/blob/master/python/dnlp/core/mmtnn.py)
75+
76+
## 实体关系抽取
77+
* [relation extraction: perspective from convolutional neural networks](http://aclweb.org/anthology/W15-1506) (待实现,文件[`re_cnn.py`](https://github.com/supercoderhawk/DeepLearning_NLP/blob/master/python/dnlp/core/re_cnn.py)
78+
79+
80+
## ToDo-List
81+
82+
- [ ] 增加更多算法的实现
83+
- [ ] 支持pip
84+
- [ ] 增加对Java、C++的支持
85+
86+
87+
88+

0 commit comments

Comments
 (0)