Understanding en_core_web_trf
tensors tuple
#12565
-
When creating an nlp pipeline based on Could someone confirm what the tensors tuple actually contain? The view more link of https://spacy.io/universe/project/spacy-transformers seems to redirect to an outdated blogpost of Explosion, as I cannot successfully run the code examples. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @IliasAarab! The data in Again, this depends on the HF model. I recommend inspecting |
Beta Was this translation helpful? Give feedback.
Hi @IliasAarab! The data in
doc._.trf_data
are instances ofFullTransformerBatch
. The contents ofFullTransformerBatch.tensor
depends on the output of the underlying HuggingFace model - in the case of models with pooling the outputs (cf. the HF docs) containlast_hidden_state
andpooler_output
as the first two elements.Again, this depends on the HF model. I recommend inspecting
doc.trf_data.model_output
to see what's included.