DeepKE
DeepKE copied to clipboard
训练NER时出现key error
Traceback (most recent call last): File "D:/pythonProject/DeepKE/example/ner/standard/run_bert.py", line 179, in main eval_features = convert_examples_to_features(eval_examples, label_list, cfg.max_seq_length, tokenizer) File "D:\Anaconda\envs\deepke\lib\site-packages\deepke\name_entity_re\standard\tools\preprocess.py", line 92, in convert_examples_to_features label_ids.append(label_map[labels[i]]) KeyError: ''
有修改代码吗,还有使用的是哪个数据集
出现keyerror很有可能是数据集编码问题,我使用过程中数据集编码utf-8-sig就出现了keyerror问题,简单修改一下就可以