mirror of https://github.com/explosion/spaCy.git
Fix init-model if no vectors provided
This commit is contained in:
parent
c4698f5712
commit
664f89327a
|
@ -90,6 +90,7 @@ def create_model(lang, probs, oov_prob, clusters, vectors_data, vector_keys, pru
|
||||||
lexeme.cluster = 0
|
lexeme.cluster = 0
|
||||||
lex_added += 1
|
lex_added += 1
|
||||||
nlp.vocab.cfg.update({'oov_prob': oov_prob})
|
nlp.vocab.cfg.update({'oov_prob': oov_prob})
|
||||||
|
if vector_keys is not None:
|
||||||
for word in vector_keys:
|
for word in vector_keys:
|
||||||
if word not in nlp.vocab:
|
if word not in nlp.vocab:
|
||||||
lexeme = nlp.vocab[word]
|
lexeme = nlp.vocab[word]
|
||||||
|
|
Loading…
Reference in New Issue