GithubHelp home page GithubHelp logo

tcnlp's Introduction

天池&Datawhale 新闻文本分类比赛 第2名参赛方案源码

比赛地址: https://tianchi.aliyun.com/competition/entrance/531810/introduction

项目主要文件目录:

├── bert_lstm.ipynb                           10个模型概率加权及生成伪标签  
├── bert_model                                5个bert模型  
│   ├── BERT_fold_5.ipynb                     seed=555,130w步bert_base模型,使用test_a伪标签  
│   ├── BERT_fold_6.ipynb                     seed=666,130w步bert_base模型,使用test_a伪标签  
│   ├── BERT_fold_7.ipynb                     seed=777,130w步bert_base模型,使用test_a伪标签  
│   ├── BERT_fold_8.ipynb                     seed=888,130w步bert_base模型,使用test_a伪标签  
│   ├── BERT_fold_9.ipynb                     seed=999,130w步bert_base模型,使用test_a伪标签  
│   └── pretrain_bert                         bert_base预训练代码,语料为train_set + test_a  
│       └── pretrain_bert.ipynb               bert_base预训练步骤  
│         
└── lstm_model                                5折交叉验证lstm模型  
    ├── lstm.ipynb                            使用word2vec词向量,test_a伪标签  
    ├── word2vec.ipynb                        用天池官方的gensim训练word2vec代码,训练200维词向量,语料为train_set + test_a  
    └── word2vec.txt                          使用的word2vec词向量,200dim,10window,10iter  

如果你不能看懂这里的源码,推荐你看下我的比赛经验分享

https://blog.csdn.net/lz123snow/article/details/108508189

无论是bert预训练模型、bert分类模型,还是LSTM 5折交叉验证模型训练都非常耗时,如果你用单卡P100,训练时间将是以天为单位的。。。

不过我在代码里提供了全部已经训练好的模型文件,你可以直接进行预测

我最终提交的成绩线上F1值 97.35,其中5折LSTM是96.74,5个bert模型没有机会做测试,根据之前的成绩推测应该在97.25左右。

我这里提供的模型文件与我在比赛时提交的并不完全相同,所以你的预测结果会跟我有微小的差异。

还有一个导致预测结果存在误差的原因,就是5折LSTM原作者的模型并没有固定全部seed,而我出于某种玄学原因,决定维持原状。

项目文件重新整理后并没有进行测试,如果存在BUG请反馈

tcnlp's People

Contributors

zhounlp avatar

Watchers

James Cloos 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.