taishan1994 / BERT-BILSTM-CRF

使用BERT-BILSTM-CRF进行中文命名实体识别。
288 stars 32 forks source link

运行main.py报错 #35

Open jiangyuji666 opened 1 month ago

jiangyuji666 commented 1 month ago

raceback (most recent call last): File "/content/drive/MyDrive/BERT-BILSTM-CRF-main/main.py", line 193, in main(data_name) File "/content/drive/MyDrive/BERT-BILSTM-CRF-main/main.py", line 187, in main report = train.test() File "/content/drive/MyDrive/BERT-BILSTM-CRF-main/main.py", line 92, in test report = classification_report(trues, preds) File "/usr/local/lib/python3.10/dist-packages/seqeval/metrics/sequence_labeling.py", line 686, in classification_report name_width = max(map(len, target_names)) ValueError: max() arg is an empty sequence

jiangyuji666 commented 1 month ago

大佬,这是怎么回事

taishan1994 commented 1 month ago

检查trues和preds是否有为空的。

jiangyuji666 commented 1 month ago

好了,大佬这个数据集必须用bio格式吗,我用bmeo格式跑出来f1score,precision,recall全是0

taishan1994 commented 1 month ago

是的,需要转换下。