From 28d5700aae1bed4ec721cbeb5bc2527079113f46 Mon Sep 17 00:00:00 2001 From: Lowin <33021512+LowinLi@users.noreply.github.com> Date: Tue, 21 Sep 2021 03:01:35 +0800 Subject: [PATCH] fix research_projects/mlm_wwm readme.md examples (#13646) the variables of run example is not correct --- examples/research_projects/mlm_wwm/README.md | 28 ++++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/examples/research_projects/mlm_wwm/README.md b/examples/research_projects/mlm_wwm/README.md index 33ff7ab6d9..9426be7c27 100644 --- a/examples/research_projects/mlm_wwm/README.md +++ b/examples/research_projects/mlm_wwm/README.md @@ -60,33 +60,39 @@ You could run the following: ```bash -export TRAIN_FILE=/path/to/dataset/wiki.train.raw +export TRAIN_FILE=/path/to/train/file export LTP_RESOURCE=/path/to/ltp/tokenizer export BERT_RESOURCE=/path/to/bert/tokenizer export SAVE_PATH=/path/to/data/ref.txt python run_chinese_ref.py \ - --file_name=path_to_train_or_eval_file \ - --ltp=path_to_ltp_tokenizer \ - --bert=path_to_bert_tokenizer \ - --save_path=path_to_reference_file + --file_name=$TRAIN_FILE \ + --ltp=$LTP_RESOURCE \ + --bert=$BERT_RESOURCE \ + --save_path=$SAVE_PATH ``` Then you can run the script like this: ```bash +export TRAIN_FILE=/path/to/train/file +export VALIDATION_FILE=/path/to/validation/file +export TRAIN_REF_FILE=/path/to/train/chinese_ref/file +export VALIDATION_REF_FILE=/path/to/validation/chinese_ref/file +export OUTPUT_DIR=/tmp/test-mlm-wwm + python run_mlm_wwm.py \ --model_name_or_path roberta-base \ - --train_file path_to_train_file \ - --validation_file path_to_validation_file \ - --train_ref_file path_to_train_chinese_ref_file \ - --validation_ref_file path_to_validation_chinese_ref_file \ + --train_file $TRAIN_FILE \ + --validation_file $VALIDATION_FILE \ + --train_ref_file $TRAIN_REF_FILE \ + --validation_ref_file $VALIDATION_REF_FILE \ --do_train \ --do_eval \ - --output_dir /tmp/test-mlm-wwm + --output_dir $OUTPUT_DIR ``` **Note1:** On TPU, you should the flag `--pad_to_max_length` to make sure all your batches have the same length. -**Note2:** And if you have any questions or something goes wrong when runing this code, don't hesitate to pin @wlhgtc. \ No newline at end of file +**Note2:** And if you have any questions or something goes wrong when runing this code, don't hesitate to pin @wlhgtc.