GithubHelp home page GithubHelp logo

ttjjlw / text_classify_by_keras Goto Github PK

View Code? Open in Web Editor NEW
23.0 1.0 6.0 53 KB

keras 搭建文本分类模型,textcnn/bi_gru/cnn+rnn_binglian/cnn+rnn_cuanlian/fasttext/att_bi_gru/rcnn,其中前面四个模型只有create_model函数不同,其余相同,fasttext和rcnn增加了数据预处理,att_bi_gru,增加了attention类

Python 100.00%

text_classify_by_keras's Introduction

text_classify_by_keras

Model中的模型只可以用来训练,没有载入模型的功能//

Model文件外面的模型可以用来训练,加载训练,和最终预测生成csv文件

前置条件: 1、需要数字编码后的文本文件,格式如:[[文本1],[文本2]]// 2、以及用于编码的字典,字典的index应该从0到vocab_size-1// 3、预训练好的词向量/n

关于Model外模型的使用注意事项: 1、只需要设置model_name,各种保存路径就设置好了// 2、设置好weights_path和mode==predict,就可以生成测试文件csv// 3、当不加载模型时,trainable=True 只会保存框架// 4、按以下训练策略,设置相关参数,训练模型//

#训练策略: #1/预训练词向量先保持shuffle=orderly,trainable=false,Truncat=pre 训练2-3个epoch,2/再post 训练2-3个epoch #3/trainable=true ,前向截断训练1-2个epoch,4/后向截断训练1-2epoch #再shuffle每篇文章,训练1-2个epoch #再reverse每篇,训练1-2个epoch #每次训练会自动保存最佳模型

text_classify_by_keras's People

Contributors

ttjjlw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

text_classify_by_keras's Issues

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.