FBBC is abbreviation of Feature-Based BERT Classifier, and it is easy to adapt to other tasks with few changes.
- Refactor
DataProcessorto fit your task. - run following command as BERT does
if you want to fine-tune BERT model, add arg
python simple_classifier.py --do_train=true --do_eval=true\ --data_dir=YOUR_DATA_PATH --bert_config_file=CONFIG_PATH\ --vocab_file=VOCAB_PATH --output_dir=OUTPUT_MODEL--finetune=true - if you want to check a model is
frozenorfinetune, runpython check_fintuned.py --raw_ckpt=BERT_MODEL_PATH --trained_ckpt=YOUR_MODEL_PATH
-
simple_classifier.py
In this code we can choose how to use pre-trained BERT model. Notice there is a
finetuneflag default byfalsewhich means this classifier uses BERT as feature-based model likeELMo. We can also set it totruejust like the paper does.Another thing is we simplify the processors here.
-
optimizeation.py
We set trainable variables in this code. We use
bertas keyword to filter BERT variables out, so you should name your variables withoutbertin it.