Using bert-base-uncased instead of default roberta-base inside an en_core_web_trf based pipeline #10330
-
Using bert-base-uncased instead of default roberta-base inside an en_core_web_trf based pipelineOn loading the en_core_web_trf model using spacy.load, the nlp.pipeline has the default transformer component (based on roberta-base) loaded before the tagger. I want to replace it with the bert-base-uncased model. I tried the following steps, which seem to give no error. But when parsing a sentence using nlp, it seems to raise a "NoneType object isn't callable" error.
Traceback (most recent call last): Assuming the bert-base-uncased model is available and downloaded in a suitable local directory, is this a right way to use a transformer model different from the default roberta-base? If not, is there a better way to achieve the desired setting? And if this is a possible way, can some light be thrown on why the NoneType error? Your Environment
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
facing same issue |
Beta Was this translation helpful? Give feedback.
-
Sorry you're having trouble with this. We just added an FAQ post about changing the base Transformer model you use. In this case the important thing is that you can't change the underlying Transformer model and keep using a trained pipeline - you'd have to retrain it. Changing the base without changing the downstream layers is like cutting a branch off a rosebush and trying to graft it onto a cow - they're just not compatible and you'll get errors or nonsense output. If you want to use a different base model, you'll need to train a new pipeline. |
Beta Was this translation helpful? Give feedback.
Sorry you're having trouble with this. We just added an FAQ post about changing the base Transformer model you use.
In this case the important thing is that you can't change the underlying Transformer model and keep using a trained pipeline - you'd have to retrain it. Changing the base without changing the downstream layers is like cutting a branch off a rosebush and trying to graft it onto a cow - they're just not compatible and you'll get errors or nonsense output.
If you want to use a different base model, you'll need to train a new pipeline.