0

I am very new to Spacy so this question might be kinda dumb, but I can't figure out how to add a NER from an existing model to a blank model. I am following this example: https://spacy.io/api/language#add_pipe and this is my code:

# Build main nlp
main_nlp = spacy.blank("es-419")

# Get spanish ner
spanish_nlp = spacy.load("es_core_news_lg")
main_nlp.add_pipe("ner",source=spanish_nlp, name="spanish_ner")

test_text = # Random text
main_nlp(test_text)

I get the following error: RuntimeError: [E896] There was an error using the static vectors. Ensure that the vectors of the vocab are properly initialized, or set 'include_static_vectors' to False.

Any help would be greatly appreciated!!

1 Answer 1

1

I figured out how to fix it, although I am not sure if it is correct. I added the line

main_nlp.vocab.vectors = spanish_nlp.vocab.vectors

before adding the pipe and now the error doesn't show up anymore

Sign up to request clarification or add additional context in comments.

1 Comment

This should work fine. Another option would be to pass spanish_nlp.vocab into spacy.blank as in spacy.blank("es", vocab=spanish_nlp.vocab) which copies the whole vocab including the vectors.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.