Before started, would like to appreciate for Google Research Team and @Kaiyinzhou's previous work at here.
- Python 3.5+
- Tensorflow 1.11+
Item | Desc |
---|---|
NERdata | training / evaluating dataset |
bert | bert code download from here |
bert_ner.py | training code |
ner_predict.py | predict code |
predict_cli.py | simple command line program for testing purpose |
I found this pretty detailed instructions of how to deploy code, mount folders and execute .py files with Google Colab and utilizing their FREE TPU/GPU capabilities.
BERT-Base, Uncased or BERT-Large, Uncased need to be unzipped and upload to your Google Drive folder and be mounted.
I used Colab GPU (K80) fine-tuning the model, took me around 30 mins.
An evaluation script can be found here. A quick evaluation with Uncased 12-layer result in 93.26 f1 score. 24-layer result will be tried and provided here later.
A simple command line program was provided here for testing purpose. Simply run
python predict_cli.py
The program will firstly load the model and waiting for inputs.