en_core_web_trf: no word vectors loaded #7643
-
Hi there, me again. I've been looking through the documentation but still don't understand. In the base Transformer models, a transformer model is present as the shared underlying model. This implies that it replaces tok2vec from other models. However, I would still expect that this transformer component adds word vectors - which is not the case. nlp = spacy.load("en_core_web_sm")
nlp_trf = spacy.load("en_core_web_trf")
nlp_lg = spacy.load("en_core_web_lg")
nlp.pipe_names
Out[7]: ['tok2vec', 'tagger', 'parser', 'ner', 'attribute_ruler', 'lemmatizer']
nlp_trf.pipe_names
Out[8]: ['transformer', 'tagger', 'parser', 'ner', 'attribute_ruler', 'lemmatizer']
nlp_lg.pipe_names
Out[9]: ['tok2vec', 'tagger', 'parser', 'ner', 'attribute_ruler', 'lemmatizer'] When I calculate the similarity between tokens with
Additionally I also get the warning that I am evaluating on empty vectors. Wouldn't transformer models be perfect to get contextualised word vectors? Why are they not included, or how does that differ from the "regular" models? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
All the necessary information is in |
Beta Was this translation helpful? Give feedback.
All the necessary information is in
doc._.trf_data
, but since different applications may want to calculate the vectors in different ways, we don't set anything by default. The alignment for the strided spans used inen_core_web_trf
also requires a bit of additional understanding of the internal details. Some pointers to relevant discussions: