Skip to content

ncpaddle/BERT4Doc-paddle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BERT4Doc-paddle

Dependencies

  • python>=3.6

  • paddle == 2.1.3

  • paddlenlp == 2.0.0

Further Pre-training

  1. Executing further pre-training based on IMDB dataset:
python main.py \
  --data_dir data/imdb_pretraining.json \
  --model_dir further_imdb_pretraining \
  --max_steps 100000 \
  --model_name_or_path bert-base-uncased
  1. Executing further pre-training based on yahoo-answers dataset:
python main.py \
  --data_dir data/yahoo_pretraining.json \
  --model_dir further_imdb_pretraining \
  --max_steps 100000 \
  --model_name_or_path bert-base-uncased

You can download models trained by us in here.

Fine-tuning

  1. Using the pre-training model based on IMDB to fine-tuning IMDB dataset;
python run_discriminative_paddle_decay.py \
                          --data_dir="IMDB_data" \
                          --task_name="IMDB" \
                          --output_dir="imdb_output" \
                          --model_name_or_path="furthered_imdb_pretrained" \
                          --model_dir="imdb_model" \
                          --do_lower_case \
                          --do_train --do_eval --discr\
                          --layers 11 \
                          --trunc_medium 128 \
                          --layer_learning_rate 2e-5 \
                          --layer_learning_rate_decay 0.95
  1. Using the pre-traning model based on yahoo-answers to fine-tuning TREC dataset;
python run_discriminative_paddle_decay.py \
                          --data_dir="TREC_data" \
                          --task_name="TREC" \
                          --output_dir="trec_output" \
                          --model_name_or_path="furthered_trec_pretrained" \
                          --model_dir="trec_model" \
                          --do_lower_case \
                          --do_train --do_eval --discr\
                          --layers 11 \
                          --trunc_medium 128 \
                          --layer_learning_rate 2e-5 \
                          --layer_learning_rate_decay 0.95

Experiment Results

Further pre-training Dataset Fine-tuning Dataset Accuracy
IMDB IMDB 94,76
Yah. A TREC 93.00

Align

More details about align works in here.

About

BERT4Doc的paddlepaddle实现

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published