GithubHelp home page GithubHelp logo

bert_family_tasks's Introduction

BERT family tasks

[中文]

  • Demos of multiple NLP task pipelines.

  • Implementations are Based on keras_bert.

  • Support various Transformer-Encoder style pre-trained models.

  • In each run, models, data and log files are stored seperately to support massive repeatation of training.


Features

  • RoBERTa、ALBERT、BERT and tf version ERNIE are supported
  • CLS(classification tasks)、NER(Named Entity Recognition)、MRC(Machine Reading Comprehension) tasks are supported.(prediction needs adjustment according to tasks)
  • Dynamically change learning rate
  • Continue pre-train on domain data(except for ALBERT)
  • Freeze certain encoder layers during training(except for ALBERT)
  • Extract output of needed encoder layers and make modifications on downstream architecture
  • Provide multiple loss functions for unbalanced data sets
  • Support tensorboard(tensorboard original codes need to be modified,reference: https://www.jianshu.com/p/9da54361d289)
  • Record training information and hyperparameter settings in log files

Usage

  • Select needed train functions(cls_train, ner_train,mrc_train) in main.py and modify predict function(model can be automatically tested on test set during training after each epoch in training functions) before performing tasks.
python main.py \
  --times 1 \
  --pretrained_path D:/codes/Bert_projects/pre_trained_models/albert_tiny_google_zh_489k/ \
  --log_name training_info \
  --epoch 2 \
  --batch_size 1 \
  --maxlen 512 \
  --do_train  \
  --nclass 3 \

Pre-trained Models

RoBERTa: https://github.com/brightmart/roberta_zh

ALBERT: https://github.com/bojone/albert_zh

tf version ERNIE: https://github.com/ArthurRizar/tensorflow_ernie


License

MIT

Forks and Stars are welcomed:blush:.​

bert_family_tasks's People

Contributors

araloak avatar

Watchers

 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.