-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Description
您好,感谢对我再“出现wordPiece应该怎么办?”这一问题下的提问了。
是我描述不到位,我遇到的问题是:
数据集使用的Conll2003,Bert模型使用的是bert-base-cased。运行时出现如下错误:
File "D:\python-workspace\BERT-BiLSTM-CRF-NER-pytorch-master\utils.py", line 162, in convert_examples_to_features
assert len(ori_tokens) == len(ntokens), f"{len(ori_tokens)}, {len(ntokens)}, {ori_tokens}, {ntokens}"
AssertionError: 3, 8, ['[CLS]', '-DOCSTART-', '[SEP]'], ['[CLS]', '-', 'do', '##cs', '##tar', '##t', '-', '[SEP]']
可见,是tokenizer将单词切分了,导致assert len(ori_tokens) == len(ntokens)不能通过,请问如何解决?感谢您。
Metadata
Metadata
Assignees
Labels
No labels