Code Monkey home page Code Monkey logo

fanfanba / keras-textclassification Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yongzhuo/keras-textclassification

0.0 1.0 1.0 386 KB

中文长文本分类、短句子分类(Chinese Text Classification of Keras NLP, or sentence classify, long or short),字词句向量嵌入层(embeddings)和网络层(graph)构建基类,FastText,TextCNN,CharCNN,TextRNN, RCNN, DCNN, DPCNN, VDCNN, CRNN, Bert, Attention, DeepMoji, HAN, 胶囊网络-CapsuleNet, Transformer, Seq2seq, ENT, DMN,

Home Page: https://blog.csdn.net/rensihui

License: MIT License

Python 100.00%

keras-textclassification's Introduction

Keras-TextClassification

keras_textclassification(代码主体,未完待续...)

- Bert-fineture
- FastText
- TextCNN
- charCNN
- TextRNN
- TextRCNN
- TextDCNN
- TextDPCNN
- TextVDCNN
- TextCRNN
- DeepMoji
- SelfAttention
- HAN
- CapsuleNet

run(运行, 以FastText为例)

- 1. 进入keras_textclassification/m01_FastText目录,
- 2. 训练: 运行 train.py,   例如: python train.py
- 3. 预测: 运行 predict.py, 例如: python predict.py
- 说明: 默认不带pre train的random embedding,训练和验证语料只有100条,完整语料移步下面data查看下载

run(test/sample实例)

- bert,word2vec,random样例在test/目录下, 注意word2vec(char or word), random-word,  bert(chinese_L-12_H-768_A-12)未全部加载,需要下载
- predict_bert_text_cnn.py
- tet_char_bert_embedding.py
- tet_char_random_embedding.py
- tet_char_word2vec_embedding.py
- tet_word_random_embedding.py
- tet_word_word2vec_embedding.py

keras_textclassification/data

- 数据下载
  ** github项目中只是上传部分数据,需要的前往链接: https://pan.baidu.com/s/1I3vydhmFEQ9nuPG2fDou8Q 提取码: rket
- baidu_qa_2019(百度qa问答语料,只取title作为分类样本,17个类,有一个是空'',已经压缩上传)
   - baike_qa_train.csv
   - baike_qa_valid.csv
- embeddings
   - chinese_L-12_H-768_A-12/(取谷歌预训练好点的模型,已经压缩上传)
   - term_char.txt(已经上传, 项目中已全, wiki字典, 还可以用新华字典什么的)
   - term_word.txt(未上传, 项目中只有部分, 可参考词向量的)
   - w2v_model_merge_short.vec(未上传, 项目中只有部分, 词向量, 可以用自己的)
   - w2v_model_wiki_char.vec(已上传百度网盘, 项目中只有部分, 自己训练的维基百科字向量, 可以用自己的)
- model
   - 预训练模型存放地址

项目说明

    1. 构建了base基类(网络(graph)、向量嵌入(词、字、句子embedding)),后边的具体模型继承它们,代码简单
    1. conf存放项目数据、模型的地址, data存放数据和语料, etl为数据预处理模块,

模型与论文paper题与地址

参考/感谢

keras-textclassification's People

Contributors

yongzhuo avatar

Watchers

 avatar

Forkers

maanqi

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.