Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行main.py报错 #35

Open
jiangyuji666 opened this issue May 19, 2024 · 4 comments
Open

运行main.py报错 #35

jiangyuji666 opened this issue May 19, 2024 · 4 comments

Comments

@jiangyuji666
Copy link

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
Copy link
Author

大佬,这是怎么回事

@taishan1994
Copy link
Owner

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

@jiangyuji666
Copy link
Author

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

@taishan1994
Copy link
Owner

是的,需要转换下。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants