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.
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.