Closed N1ckyyy closed 2 years ago
Traceback (most recent call last): File "D:/code/entity_extractor_by_ner-master/main.py", line 72, in train(configs, dataManager, logger) File "D:\code\entity_extractor_by_ner-master\engines\train.py", line 50, in train train_dataset, val_dataset = data_manager.get_training_set() File "D:\code\entity_extractor_by_ner-master\engines\data.py", line 249, in get_training_set df_train['label_id'] = df_train.label.map(lambda x: -1 if str(x) == str(np.nan) else self.label2id[x]) File "C:\ProgramData\Anaconda3\envs\entity_extractor_by_ner-master\lib\site-packages\pandas\core\series.py", line 3828, in map new_values = super()._map_values(arg, na_action=na_action) File "C:\ProgramData\Anaconda3\envs\entity_extractor_by_ner-master\lib\site-packages\pandas\core\base.py", line 1300, in _map_values new_values = map_f(values, mapper) File "pandas/_libs/lib.pyx", line 2228, in pandas._libs.lib.map_infer File "D:\code\entity_extractor_by_ner-master\engines\data.py", line 249, in df_train['label_id'] = df_train.label.map(lambda x: -1 if str(x) == str(np.nan) else self.label2id[x]) KeyError: 'B-EQ'
EQ是我自己的实体类别 system.config里已经修改suffix为我的实体类别了 但还是报错 是不是还有其他地方需要修改 谢谢
你好解决了吗
把label2id那两个文件删除。 请问你知道自己标注的训练集识别为0是啥情况吗。
Traceback (most recent call last): File "D:/code/entity_extractor_by_ner-master/main.py", line 72, in
train(configs, dataManager, logger)
File "D:\code\entity_extractor_by_ner-master\engines\train.py", line 50, in train
train_dataset, val_dataset = data_manager.get_training_set()
File "D:\code\entity_extractor_by_ner-master\engines\data.py", line 249, in get_training_set
df_train['label_id'] = df_train.label.map(lambda x: -1 if str(x) == str(np.nan) else self.label2id[x])
File "C:\ProgramData\Anaconda3\envs\entity_extractor_by_ner-master\lib\site-packages\pandas\core\series.py", line 3828, in map
new_values = super()._map_values(arg, na_action=na_action)
File "C:\ProgramData\Anaconda3\envs\entity_extractor_by_ner-master\lib\site-packages\pandas\core\base.py", line 1300, in _map_values
new_values = map_f(values, mapper)
File "pandas/_libs/lib.pyx", line 2228, in pandas._libs.lib.map_infer
File "D:\code\entity_extractor_by_ner-master\engines\data.py", line 249, in
df_train['label_id'] = df_train.label.map(lambda x: -1 if str(x) == str(np.nan) else self.label2id[x])
KeyError: 'B-EQ'
EQ是我自己的实体类别 system.config里已经修改suffix为我的实体类别了 但还是报错 是不是还有其他地方需要修改 谢谢