-
Notifications
You must be signed in to change notification settings - Fork 43
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
你好,报这个错是什么原因 #47
Comments
是不是训练数据当中某一条数据里面没有标签,全是O的问题 |
数据格式这么可以吗 |
可以的 |
解决了,数据的问题,里面有空字符串"" |
Traceback (most recent call last):
File "/mnt/workspace/BERT-BILSTM-CRF/main.py", line 190, in
main(data_name)
File "/mnt/workspace/BERT-BILSTM-CRF/main.py", line 182, in main
train.train()
File "/mnt/workspace/BERT-BILSTM-CRF/main.py", line 45, in train
for step, batch_data in enumerate(self.train_loader):
File "/mnt/workspace/BERT-BILSTM-CRF/env/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 631, in next
data = self._next_data()
File "/mnt/workspace/BERT-BILSTM-CRF/env/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 675, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/mnt/workspace/BERT-BILSTM-CRF/env/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 51, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/mnt/workspace/BERT-BILSTM-CRF/env/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 51, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/mnt/workspace/BERT-BILSTM-CRF/data_loader.py", line 28, in getitem
labels = [self.label2id[label] for label in labels]
File "/mnt/workspace/BERT-BILSTM-CRF/data_loader.py", line 28, in
labels = [self.label2id[label] for label in labels]
KeyError: ''
The text was updated successfully, but these errors were encountered: