• Stars
    star
    384
  • Rank 111,044 (Top 3 %)
  • Language
    Python
  • Created over 6 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

BiLstm+CNN+CRF 法律文档(合同类案件)领域分词(100篇标注样本)

BiLstm_CNN_CRF_CWS

BiLstm+CNN+CRF 在线演示

note: 实验基于

anaconda py3.5

tensorflow==1.0.1

keras==2.0.6

keras_contrib==2.0.8 pip install git+https://www.github.com/keras-team/keras-contrib.git

cuda==v8.0

gpu==GTX750Ti

简要介绍

model

  1. 使用 bilstm+cnn+crf训练seq2seq模型
  2. 预训练词向量 gensim
  3. 段落有的太长,按简单标点切分为句子,maxlen控制在100+,不足maxlen前面补0
  4. 测试也是按句子测试,最后还原成段落
  5. 有机会写个blog,先准备过年~新年快乐!_

step1: 法律文档+conll2012分词语料 训练word embedding

python embedding_model.py

step2: 预处理+训练+测试

  1. 随机抽80篇训练(10%用于验证集),20篇用于测试   实验10次,平均f-score=0.953,详见prf_result_max_epoch_50_em.txt

  2. 随机抽50篇训练(10%用于验证集),50篇用于测试   实验10次,平均f-score=0.933,详见prf_result_max_epoch_50_law.txt

  3. 用conll2012中6个领域的分词训练语料+法律文档训练语料(20篇)-> 法律80篇测试   时间问题,只测一次:f-score:0.943

  4. 用conll2012中6个领域的分词训练语料-> 法律100篇测试   时间问题,只测一次:f-score:0.757

New 拖了好久,终于在毕业论文交(3.26)后写了一篇分词blog(虽然也没啥技术含量,写着玩..)

   基于BiLSTM-CNN-CRF的中文分词

simple_bilstm_model

程序写的太繁琐,简化了一下  只关心 pip install keras==2.0.6  深度学习分词算法的可以只看这个文件夹下的bilstm_cnn_crf.py程序 keras_contrib==2.0.8 pip install git+https://www.github.com/keras-team/keras-contrib.git   pip install gensim
如缺少其它模块,看报错自行安装  

## note
# 把你的语料放到corpus文件夹下  我的corpus中的语料压缩了,如使用可以解压
# 1. python embedding_model.py  -> model_conll_law.m  生成词向量文件
# 2. python bilstm_cnn_crf.py    // is_train==1
# 会得到 train_model.hdf5  lexicon.pkl
# 3. 可以在之前的基础上train_model.hdf5,继续训练
# 4. 训练完成,测试  is_train==0
# python bilstm_cnn_crf.py  按句测试或按文件测试

# my_weights 中存放的是我的权值 

关于simple_bilstm_model程序的运行,写了个讲解,详见

BiLSTM_CNN_CRF分词程序—运行讲解-简书
BiLSTM_CNN_CRF分词程序—运行讲解-知乎

simple_bilstm_model 百度网盘下载:链接:https://pan.baidu.com/s/1b0WRe16aVVILYGEBmhB9lg 密码:9tiv

不想下载全部项目的可以只下载网盘的内容。

More Repositories

1

geetest_break

极验验证码破解-源码+手册
Python
770
star
2

ParseLawDocuments

对收集的法律文档进行一系列分析,包括根据规范自动切分、案件相似度计算、案件聚类、法律条文推荐等(试验目前基于婚姻类案件,可扩展至其它领域)。
Python
196
star
3

pkulaw_spider

爬取北大法宝网http://www.pkulaw.cn/Case/
Python
158
star
4

captcha_break_keras

keras theano 验证码破解 字母+数字
Python
61
star
5

SINA_Spider

新浪微博爬虫:登录、关键词微博查询、微博监控
Python
31
star
6

sinaFinanceSpider

爬取新浪财经网http://finance.sina.com.cn/stock/,各股票公司每日公告(爬取股票分析所需语料)
Python
26
star
7

QQSpider

爬取QQ用户信息(qq号、昵称、生日、地址等基本信息)并做简要analysis。
Python
21
star
8

QQZoneParse

模拟登陆QQ空间,获取好友信息,并做分析(年龄分布、性别分布、地址分布等)具体参见说明文档及1049755192文件夹下的分析结果展示。
Python
14
star
9

QQMusicSpider

爬取QQ空间背景音乐并简单分析统计。
Python
13
star
10

EmotionClassificationByMultiLstm

一种尝试解决情绪分类任务中的不平衡问题的分类方法研究。
Python
9
star
11

PythonSort

python版本 常见的排序算法(自己复习整理)
Python
6
star
12

GetProxy

一个爬取代理网站免费代理并测试可用代理的程序。
Python
4
star
13

GraduateSystem

模拟浏览器登录xx大学学生管理系统,并爬取学生成绩。
Python
3
star
14

sina_stock_company_announcement

抓取新浪财经网-个股的公司每日公告,可以辅助股票预测。
Python
3
star
15

Ner_Law_Corpus

Law Corpus for NER Experiment
3
star
16

sklearn_learning_notes

http://cwiki.apachecn.org/pages/viewpage.action?pageId=10814293 sklearn学习笔记
Python
2
star
17

NN_Test_Python

python 简易NN
Python
2
star
18

tensorflow_learning_note

tf学习笔记
Python
2
star
19

FanhuaandLuomu.github.io

My Online Resume
HTML
2
star
20

Visitors

给目标站点http://angularjs.cn/hots增加访【负】客【载】。纯属无聊之作,切勿恶意攻击【违法】,否则查到IP被起诉与本人无关。。。
Python
2
star
21

financeSpider

抓取当天的股票数据,并处理成json格式
Python
2
star
22

Apriori_Learning

学习了苏神的apriori实现,并与python包做了比较
Python
1
star
23

ImageClassification

原文:http://blog.keras.io/building-powerful-image-classification-models-using-very-little-data.html
Python
1
star
24

VAE_NOTES

学习VAE的点滴记载~
Python
1
star
25

web_service

学习使用python-flask 框架搭建简单的web service服务
Python
1
star
26

translate_by_baidu

为了翻译语料,python实现了一个翻译程序,基于百度翻译
Python
1
star
27

RNNTest

python实现简单rnn循环神经网络,实现二进制加法
Python
1
star
28

liangting_demo

1
star
29

PictureSpider

爬取http://desk.zol.com.cn/pc/和http://www.4j4j.cn/zmbz/两个壁纸网站的Demo,程序只实现了抓取每个类别壁纸的首页。虽然程序简单,但这类爬虫很经典,当初研一做《网络编程》助教时曾写进ppt讲解,并在期末考试中考到,供初学者学习。有兴趣的朋友可以进一步实现多线程爬取所有页,或者进一步实现爬取各种分辨率的壁纸,欢迎pull requests。
Python
1
star
30

select_word_captcha

Python
1
star