kyzhouhzau / BERT-NER

Use Google's BERT for named entity recognition (CoNLL-2003 as the dataset).
MIT License
1.23k stars 335 forks source link

The type of command line argument "crf" should be bool #66

Open lishu2016 opened 4 years ago

lishu2016 commented 4 years ago

Thanks a lot for sharing your code. It helps me a lot. I found an issue in thecode. Line 123 of BERT_NER.py is flags.DEFINE_string("crf", "True", "use crf!") I think that it should be flags.DEFINE_bool("crf", True, "use crf!") In another word, DEFINE_string should be DEFINE_bool "True" should be True

[Note] When the string "False" is converted to bool type, it will be True! Try the following in python: bool("False") We will get True. So if we use DEFINE_string and specify --crf False, the program actually gets a string "False", which will be True (as bool type) in the "if" statement.