trueto / medbert

本项目开源硕士毕业论文“BERT模型在中文临床自然语言处理中的 应用探索与研究”相关模型
Apache License 2.0
96 stars 12 forks source link

couldn't load model??? #2

Open bluesoulo opened 3 years ago

bluesoulo commented 3 years ago

OSError: Can't load tokenizer for 'trueto/medalbert-base-wwm-chinese'. Make sure that:

trueto commented 3 years ago

you can also download the models and load them locally. By the way, BertModel. from_pretrained() could work.

bluesoulo commented 3 years ago

you can also download the models and load them locally. By the way, BertModel. from_pretrained() could work.

thanks,i will try it.

wupengcheng6819 commented 2 years ago

The model trueto/medbert-base-chinese loads with warning:

>>> model = BertModel.from_pretrained('trueto/medbert-base-chinese')
Some weights of the model checkpoint at trueto/medbert-base-chinese were not used when initializing BertModel: ['cls.predictions.decoder.bias', 'cls.seq_relationship.bias', 'cls.predictions.decoder.weight', 'cls.predictions.bias', 'cls.predictions.transform.dense.bias', 'cls.predictions.transform.dense.weight', 'cls.predictions.transform.LayerNorm.weight', 'cls.seq_relationship.weight', 'cls.predictions.transform.LayerNorm.bias']
- This IS expected if you are initializing BertModel from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
- This IS NOT expected if you are initializing BertModel from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).
>>>

However, this model won't work for Named Entity Recognition tasks, right? As its labels are only binary:

>>> model.config.id2label
{0: 'LABEL_0', 1: 'LABEL_1'}
>>>