Repository navigation
How to train spacy transformer model with currently not avalilable languages [spacy-nightly] #6319
|
Hello, I would like to train transformer model for Croatian language. I have converted the pyTorch BERT model to spaCy model but when I try to add transformer pipeline in the cfg file the error "Transformer model is not available for language hr". I was hoping that the installation of the BERT model and linking it to spaCy data directory with hr shortcut will solve the problem but that didn't help. Any suggestions? I have successfully trained the tok2vec model with init_tok2vec using BERT embeddings but the accuracy of the model remains the same obvously I have missinterpreted the usage for this component. Your Environment
|
Replies: 4 comments
|
The transformer model needs to be something that you can load with You no longer need a step where you're "converting the model to a spacy model" as in 0.x versions of |
|
Dear @adrianeboyd , Thank you for the response, how can I define the configuration file for using pretrained CroSloEngualBert or is this something that I cannot yet define by using CLI, if not how can I train this model for parsing, tagging and ner. |
|
I haven't tested this, but the config would look like: [components.transformer.model]
@architectures = "spacy-transformers.TransformerModel.v1"
name = "EMBEDDIA/crosloengual-bert"You can run |
|
Dear @adrianeboyd , Thanks very much for the instructions will try and report back if there are any issues. Best regards, |
I haven't tested this, but the config would look like:
You can run
spacy init configwith the English transformer defaults (it will fill inenandroberta-base) and then adjustnlp.langand the transformer model in the config.