Skip to content

Use Google's BERT for named entity recognition (CoNLL-2003 as the dataset).

Notifications You must be signed in to change notification settings

NeeMax/BERT-NER

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BERT-NER

Use google BERT to do CoNLL-2003 NER !

Try to implement NER work based on google's BERT code!

First git clone https://github.com/google-research/bert.git

Second download file in this project

BERT
|____ <strong>bert</strong>
|____ BERT_NER.py
|____ <strong>checkpoint</strong>
|____ <strong>output</strong>

Third run:

  python BERT_NER.py   \
                  --task_name="NER"  \ 
                  --do_train=true   \
                  --do_eval=True   \
                  --data_dir=NERdata   \
                  --vocab_file=checkpoint/vocab.txt  \ 
                  --bert_config_file=checkpoint/bert_config.json \  
                  --init_checkpoint=checkpoint/bert_model.ckpt   \
                  --max_seq_length=128   \
                  --train_batch_size=32   \
                  --learning_rate=2e-5   \
                  --num_train_epochs=3.0   \
                  --output_dir=./output/result_dir/ 

result:

注:For the parameters of the above model, I have not made any modifications. All parameters are based on the BERT default parameters. The better parameters for this problem can be adjusted by yourselves.

The f_score evaluation codes come from:https://github.com/guillaumegenthial/tf_metrics/blob/master/tf_metrics/__init__.py

reference:

About

Use Google's BERT for named entity recognition (CoNLL-2003 as the dataset).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 71.4%
  • Perl 27.9%
  • Shell 0.7%