prev_label = "" Error
chzuo opened this issue · comments
Hi,
I got an error when I run
data = NerData.create(train_path, valid_path, vocab_file)
~/Downloads/ner-bert-master/modules/data/bert_data.py in get_data(df, tokenizer, label2idx, max_seq_len, pad, cls2idx, is_cls, is_meta)
189 if label != "O":
190 label = label.split("")[1]
--> 191 if label == prev_label:
192 prefix = "I"
193 prev_label = labelUnboundLocalError: local variable 'prev_label' referenced before assignment
And if I cancel the comment in line 187: prev_label ="", it turns out missing the 'I_O 'label
Thanks, Fix in your code locally, plz :(.