class_docstr: Featurize messages using SpaCy.
docstr: Adds the spacy word vectors to the messages features.
docstr_tok: ["Adds","the","spacy","word","vectors","to","the","messages","features","."]
code: def _set_spacy_features(
      self, message: Message, attribute: Text = TEXT
  ) -> None:
      """Adds the spacy word vectors to the messages features."""
      doc = self._get_doc(message, attribute)
  
      if doc is None:
          return
  
      # in case an empty spaCy model was used, no vectors are present
      if doc.vocab.vectors_length == 0:
          logger.debug(
              "No features present. You are using an empty spaCy model."
          )
          return
  
      sequence_features = self._features_for_doc(doc)
      sentence_features = self.aggregate_sequence_features(
          sequence_features, self.pooling_operation
      )
  
      final_sequence_features = Features(
          sequence_features,
          FEATURE_TYPE_SEQUENCE,
          attribute,
          self._config[FEATURIZER_CLASS_ALIAS],
      )
      message.add_features(final_sequence_features)
      final_sentence_features = Features(
          sentence_features,
          FEATURE_TYPE_SENTENCE,
          attribute,
          self._config[FEATURIZER_CLASS_ALIAS],
      )
      message.add_features(final_sentence_features)
  
imports: import numpy
  import typing
  import logging
  from typing import Any, Text, Dict, List, Type
  from rasa.engine.recipes.default_recipe import DefaultV1Recipe
  from rasa.engine.graph import ExecutionContext, GraphComponent
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
  from rasa.nlu.featurizers.dense_featurizer.dense_featurizer import DenseFeaturizer
  from rasa.nlu.tokenizers.spacy_tokenizer import SpacyTokenizer
  from rasa.shared.nlu.training_data.training_data import TrainingData
  from rasa.shared.nlu.training_data.features import Features
  from rasa.shared.nlu.training_data.message import Message
  from rasa.nlu.constants import SPACY_DOCS, DENSE_FEATURIZABLE_ATTRIBUTES, FEATURIZER_CLASS_ALIAS
  from rasa.shared.nlu.constants import TEXT, FEATURE_TYPE_SENTENCE, FEATURE_TYPE_SEQUENCE
  from rasa.utils.tensorflow.constants import POOLING, MEAN_POOLING
label_desc: Use image node_id 10 for calling the SpacyFeaturizer obj's underlying member method code with example usage: obj._set_spacy_features(message, attribute) without return types