Coder Social home page Coder Social logo

bert-korquad-dynamic-training's Introduction

Dynamic Training

  • (인라이플 공개 소스)https://github.com/enlipleai/kor_pretrain_LM 으로 부터 소스 수정
  • 기존 소스에서 BERT로 KorQuADv1.0 학습시 문제 없지만, AI Hub의 News Q&A와 같은 대용량 데이터 학습시 RAM이 부족
    • 이는 학습데이터를 모두 Input Feature로 변환하여 pkl로 저장하는데 Input Feature 전체를 RAM에 올리기 때문에 발생하는 문제
  • 이를 해결하기 위해, 동적으로 학습데이터를 전처리하여 Feature를 만드는 방식 구현

Example Scripts

KorQuAD1.0

* Train

  • 추가된 Arguments
    • --dynamic_training - dynamic training 활성화
    • --num_workers n - n개의 worker로 학습 데이터 전처리
python3 run_qa.py \
  --dynamic_training
  --num_workers 2
  --checkpoint $MODEL_FILE \
  --config_file $CONFIG_FILE \
  --vocab_file $VOCAB_FILE \
  --train_file data/korquad/KorQuAD_v1.0_train.json \
  --max_seq_length 512 \
  --doc_stride 128 \
  --max_query_length 64 \
  --max_answer_length 30 \
  --per_gpu_train_batch_size 16 \
  --learning_rate 5e-5 \
  --num_train_epochs 4.0 \
  --adam_epsilon 1e-6 \
  --warmup_proportion 0.1

* Eval

python3 eval_qa.py \
  --checkpoint $MODEL_FILE \
  --config_file $CONFIG_FILE \
  --vocab_file $VOCAB_FILE \
  --predict_file data/korquad/KorQuAD_v1.0_dev.json \
  --max_seq_length 512 \
  --doc_stride 64 \
  --max_query_length 64 \
  --max_answer_length 30 \
  --batch_size 16 \
  --n_best_size 20

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.