Giter VIP home page Giter VIP logo

cnn_lstm_for_text_classify's Introduction

DNN for text classify

中文文本分类


├── Model                       模型文件夹
│   ├── FastText.py             fastText算法,调用好接口
│   ├── NeuralBOW.py            NBOW算法,可以作为base
│   ├── __init__.py             __init__
│   ├── textCnn.py              textCNN
│   └── textLstm.py             textRnn,这里使用lstm
│   └── textDynamicRNN.py       DynaicRnn,这里使用lstm
├── README.md
├── __init__.py
├── data
│   ├── fastTextData      fastText对应的数据
│   │   ├── train_data    训练集
│   │   └── valid_data    测试集
│   └── pkl               DNN对应的处理好的数据
│       ├── test.pkl      DNN对应的测试集
│       └── train.pkl     DNN对应的训练集
├── data.tar              源数据
├── preprocess.py         预处理数据,将源文本数据处理成NN和fastText所需要的特征
       NNfeature          NNfeature
       fastTextfeature    fastText特征
       DynamicRnnfeature  DynamicRnn特征
└── train.py              训练模型,将每个NN模型对应训练测试过程封装成类
       NeuralBowTrain     训练NeuralBow
       textCnnTrain       训练textCnn
       textRnnTrain       训练textRnn
       train_step         函数化的train过程
       dev_step           函数化的dev过程
└── dynamicRnnTrain.py    训练DynamicRNN,将每个NN模型对应训练测试过程封装成类
'''

文本采用压缩包里面的文档,运行代码之前需要解压文件夹
解压之后的文件夹名称: data/context


执行过程:
先执行PreProcess.py
再执行train.py

代码中的参数为不走心设置,可以自行进行调参
    包括epoches,mini batch大小,学习率和每个模型对应的模型参数等

后续工作:
    加入多层LSTM,dynamic_rnn,attention机制

加入项目:
   neural machine translate

cnn_lstm_for_text_classify's People

Contributors

cementmaker 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.