Giter VIP home page Giter VIP logo

bert-fine-tuning-for-chinese-multiclass-classification's Introduction

#bert-chinese classification

Use google BERT to do chinese sentences multiclass classification !

#train

export BERT_BASE_DIR=/path/to/model/chinese_L-12_H-768_A-12

export DATA_DIR=/path/to/data

python run_chinese_classification.py
--do_train=true
--do_eval=true
--train_dir=$DATA_DIR/Chinesedata/train.tsv
--dev_dir=$DATA_DIR/Chinesedata/dev.tsv
--test_dir=$DATA_DIR/Chinesedata/test.tsv
--vocab_file=$BERT_BASE_DIR/vocab.txt
--bert_config_file=$BERT_BASE_DIR/bert_config.json
--init_checkpoint=$BERT_BASE_DIR/bert_model.ckpt
--max_seq_length=512
--train_batch_size=6
--learning_rate=1e-6
--num_train_epochs=10.0
--output_dir=/path/to/chinese_model

#test

export BERT_BASE_DIR=/path/to/model/chinese_L-12_H-768_A-12

export DATA_DIR=/path/to/model/data

export TRAINED_CLASSIFIER=/path/to/model/chinese_model

python run_chinese_classification.py
--train_dir=$DATA_DIR/Chinesedata/train.tsv
--dev_dir=$DATA_DIR/Chinesedata/dev.tsv
--test_dir=$DATA_DIR/Chinesedata/test.tsv
--do_predict=true
--vocab_file=$BERT_BASE_DIR/vocab.txt
--bert_config_file=$BERT_BASE_DIR/bert_config.json
--init_checkpoint=$TRAINED_CLASSIFIER
--max_seq_length=512
--output_dir=/path/to/chinese_result

#results:

python results.py

#data

url:https://pan.baidu.com/s/1qDngiTq1FyNxb5GX-zDiCg passwd:9dk8

#reference:

https://github.com/google-research/bert

https://arxiv.org/abs/1810.04805

bert-fine-tuning-for-chinese-multiclass-classification's People

Contributors

maksna avatar

Watchers

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