In run_ner.py
file , when we set label_all_tokens
into True , it convert all B-Xxx label to its I-Xxx. Thus it reduce the unique labels . Even though unique label get reduced , models still accept the old number of unique label as num_label.
File : https://github.com/huggingface/transformers/blob/main/examples/pytorch/token-classification/run_ner.py
I believe , the num_label
and model.config.label2id
should be changed . Correct me if am wrong.